Monitor¶
SetMonitorRespond¶
Set response to MonitorDatas/RealTimeData.
Name | Required | Description |
---|---|---|
Object Reference | Yes | Object Reference |
config | Yes | Response is based on properties of MonitorDatas/RealTimeData. Note
|
Example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | {
"cmd": "SetMonitorRespond",
"fromBuffer":{"ObjectManager": "RunBuffer/Grain"},
"config":{
"GrainCatelog":{ //get value from "MonitorDatas/RealTimeData/GrainCatelog"
"Corn":[ //run command if value is "Corn"
{"cmd": "GetLastMonitorRespondObj", "toBuffer":"monitorRespondObj"}, //run command
{"cmd": "ChangePlacementTexture", "fromBuffer":"monitorRespondObj", "url": "images/corn.jpg"}
],
"Wheat":[ //run command if value is "Wheat"
{"cmd": "GetLastMonitorRespondObj", "toBuffer":"monitorRespondObj"}, //run command
{"cmd": "ChangePlacementTexture", "fromBuffer":"monitorRespondObj", "url": "images/wheat.jpg"}
]
},
"GrainStorage":{ //get value from "MonitorDatas/RealTimeData/GrainStorage"
"10":[{"cmd":"SetScale", "fromBuffer":"lastMonitorRespondObj", "scale":[1,0.1,1] } ], // run command if value equal or less than 10, note that current object is fetch by system buffer lastMonitorRespondObj
"30":[{"cmd":"SetScale", "fromBuffer":"lastMonitorRespondObj", "scale":[1,0.3,1] } ], //run command if value equal or less than 30
"50":[{"cmd":"SetScale", "fromBuffer":"lastMonitorRespondObj", "scale":[1,0.5,1] } ], //run command if value equal or less than 50
"80":[{"cmd":"SetScale", "fromBuffer":"lastMonitorRespondObj", "scale":[1,0.8,1] } ], //run command if value equal or less than 50
"100":[{"cmd":"SetScale", "fromBuffer":"lastMonitorRespondObj", "scale":[1,1,1] } ] //run command if value equal or less than 100
},
"GrainStatus":{ //get value from "MonitorDatas/RealTimeData/GrainStatus"
"InsectHazzard":[{"cmd":"ColorFlash", "fromBuffer":"lastMonitorRespondObj", "color":[1,0,0] , "start":0.6, "end":0.2, "time":1.0 } ], //run command if value equals to InsectHazzard
"Decay":[{"cmd":"ColorFlash", "fromBuffer":"lastMonitorRespondObj", "color":[0,0,1] , "start":0.6, "end":0.2, "time":1.0 } ], //run command if value equals to Decay
"_default_":[{"cmd":"ColorFlash", "fromBuffer":"lastMonitorRespondObj", "enable":false } ] //run command if no match
}
}
}
|