Common Object Interface¶
GetValue¶
- Get object properties and save to buffer, Object properties can be access:
- ID:uique ID generated by system
- UserID:user input ID
- Name:object name set by user
- BundleId:model ID
- PropertyDict:user-defined properties, can be access by path such as “PropertyDict/ObjectType”, will access all user-defined properties if no path is given
- MoniterData/RealTimeData: monitoring data, save as PropertyDict, can be access by path, will access all monitoring properties if no path is given
Name | Required | Description |
---|---|---|
Object Reference | Yes | Object Reference |
path | Yes | property path, for instance, PropertyDict/ObjectType ,can also be used to access user-define property |
toBuffer | Yes | Buffer to save result |
Example
- Get user-define value of a object
1 2 3 4 5 6 | {
"cmd": "GetValue",
"uid":"obj01"
"path":"PropertyDict/ObjectType",
"toBuffer":"resultBuffer"
}
|
- Get one monitoring data
1 2 3 4 5 6 | {
"cmd": "GetValue",
"uid":"obj01"
"path":"MoniterData/RealTimeData/Temperature",
"toBuffer":"resultBuffer"
}
|
- Get all monitoring data
1 2 3 4 5 6 | {
"cmd": "GetValue",
"uid":"obj01"
"path":"MoniterData/RealTimeData",
"toBuffer":"resultBuffer"
}
|
SetValue¶
Set object property.
Name | Required | Description |
---|---|---|
Object Reference | Yes | Object Reference |
path | Yes | Property path, for instance, PropertyDict/ObjectType ,can also be used to access user-define property |
value | Yes | Value to be assign to property 注解 System use strong type internally. String, number or boolean can be used as normal, for other data type, the name of data type need to be specified. For instance, vector3,color should be wrote as
|
Example
- Set Object Name
1 2 3 4 5 6 | {
"cmd": "SetValue",
"uid":"obj01",
"path":"Name",
"value":"Camera01"
}
|
CallMethod¶
Call Object Method. Object Method List:
- Object in Scene:
- show:if visible
- GetCenter:get object center
- Timer Object
- reset:reset timer
- setStartTime:set timer start time
[2015, 8,12,16,15,22,0]
- setPeriod:set timer run duration
[0,0,0,30,0]
- start:start timer
- pause:pause timer
- setSpeed:set timer run speed
Name | Required | Description |
---|---|---|
Object Reference | Yes | Object Reference |
path | Yes | property path, for instance, PropertyDict/ObjectType ,can also be used to access user-define property |
toBuffer | Yes | Buffer to save result |
Example
- Show method, same as CmdShow command
1 2 3 4 5 6 | {
"cmd": "CallMethod",
"uid":"obj01",
"path":"show",
"params":false
}
|
- Get object center and save to buffer
1 2 3 4 5 6 | {
"cmd": "CallMethod",
"uid":"obj01",
"path":"GetCenter",
"toBuffer":{"ObjectManager":"RunBuffer/curObjectCenter"}
}
|
- Set timer start time
1 2 3 4 5 6 | {
"cmd": "CallMethod",
"uid":"timer01",
"path":"setStartTtime",
"params":[2015,8,11,13,55,23,0]
}
|