Skip to content

Commit

Permalink
Fix some further merge problems
Browse files Browse the repository at this point in the history
  • Loading branch information
cristian-recoseanu committed Oct 23, 2023
1 parent 7476048 commit 3334de7
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 13 deletions.
7 changes: 5 additions & 2 deletions code/src/NCModel/Blocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ export class NcBlock extends NcObject
if(holders)
return new CommandResponseWithValue(handle, NcMethodStatus.OK, this.SetPropertiesHolders(holders));
else
return new CommandResponseError(handle, NcMethodStatus.InvalidRequest, 'Invalid arguments provided');
return new CommandResponseError(handle, NcMethodStatus.InvalidRequest, 'Invalid arguments provided');
}
else
return new CommandResponseError(handle, NcMethodStatus.InvalidRequest, 'Invalid arguments provided');
Expand Down Expand Up @@ -386,7 +386,10 @@ export class NcBlock extends NcObject
new NcParameterDescriptor("classId", "NcClassId", false, false, null, "Class id to search for"),
new NcParameterDescriptor("includeDerived", "NcBoolean", false, false, null, "If TRUE it will also include derived class descriptors"),
new NcParameterDescriptor("recurse", "NcBoolean", false, false, null, "TRUE to search nested blocks")
], "Finds members with given class id")
], "Finds members with given class id"),
new NcMethodDescriptor(new NcElementId(2, 5), "SetPropertiesByPath", "NcMethodResult", [
new NcParameterDescriptor("holders", "NcPropertyValueHolder", false, true, null, "Sequence of properties holders")
], "Set properties by path")
],
[]
);
Expand Down
33 changes: 22 additions & 11 deletions code/src/NCModel/Core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,13 +285,7 @@ export abstract class NcObject
else
return new CommandResponseError(handle, NcMethodStatus.InvalidRequest, 'Invalid arguments provided');
}
}
}


switch(key)
{
case '1m7':
case '1m8': //GetAllProperties
{
if(args != null)
{
Expand All @@ -305,12 +299,23 @@ export abstract class NcObject
else
return new CommandResponseError(handle, NcMethodStatus.InvalidRequest, 'Invalid arguments provided');
}
default:
return new CommandResponseError(handle, NcMethodStatus.MethodNotImplemented, 'Method does not exist in object');
case '1m9': //SetProperties
{
if(args != null)
{
let properties = args['properties'] as NcPropertyValueHolder[];
if(properties)
return new CommandResponseWithValue(handle, NcMethodStatus.OK, this.SetProperties(properties));
else
return new CommandResponseWithValue(handle, NcMethodStatus.OK, this.SetProperties(properties));
}
else
return new CommandResponseError(handle, NcMethodStatus.InvalidRequest, 'Invalid arguments provided');
}
}
}

return new CommandResponseError(handle, NcMethodStatus.InvalidRequest, 'OID could not be found');
return new CommandResponseError(handle, NcMethodStatus.MethodNotImplemented, 'Method does not exist in object');
}

public GenerateMemberDescriptor() : NcBlockMemberDescriptor
Expand Down Expand Up @@ -359,7 +364,13 @@ export abstract class NcObject
], "Delete sequence item"),
new NcMethodDescriptor(new NcElementId(1, 7), "GetSequenceLength", "NcMethodResultLength", [
new NcParameterDescriptor("id", "NcPropertyId", false, false, null, "Property id")
], "Get sequence length")
], "Get sequence length"),
new NcMethodDescriptor(new NcElementId(1, 8), "GetAllProperties", "NcMethodResultObjectPropertiesHolder", [
new NcParameterDescriptor("recurse", "NcBoolean", false, false, null, "Should method recurse")
], "Get sequence length"),
new NcMethodDescriptor(new NcElementId(1, 9), "SetProperties", "NcMethodResult", [
new NcParameterDescriptor("properties", "NcPropertyValueHolder", false, true, null, "Sequence of properties to set")
], "Set properties method")
],
[ new NcEventDescriptor(new NcElementId(1, 1), "PropertyChanged", "NcPropertyChangedEventData", "Property changed event") ]
);
Expand Down

0 comments on commit 3334de7

Please sign in to comment.