Tentei simular usando um data source virtual mas não funcionou:
Data Point numerico devria ser alterado pelos DP binarios (bit a bit).
Data Points binarios deveriam mostra status (bit a bit) do DP numerico. (isso funcionou)
Segue json:
{
"graphicalViews":[
{
"user":"admin",
"anonymousAccess":"SET",
"viewComponents":[
{
"type":"SCRIPT",
"dataPointXid":"DP_124483",
"bkgdColorOverride":"",
"displayControls":false,
"nameOverride":"",
"script":"var s = \"<input type=\\\"text\\\" onChange='mango.view.setPoint(\"+ point.id +\", \\\"\"+ pointComponent.id +\"\\\", this.value);return false;'value=\" + value + \">\";\nreturn s; \n",
"settableOverride":true,
"x":178,
"y":33
},
{
"type":"SCRIPT",
"dataPointXid":"DP_769061",
"bkgdColorOverride":"",
"displayControls":false,
"nameOverride":"",
"script":"var s = \"\";\nif (value) \n s += \"<img style='cursor:pointer;' src='graphics\/LightBulb2\/light_on.gif' onclick='mango.view.setPoint(\"+ point.id +\", \\\"\"+ pointComponent.id +\"\\\", \\\"false\\\");return false;'\/>\"; \nelse \n s += \"<img src='graphics\/LightBulb2\/light_off.gif' onclick='mango.view.setPoint(\"+ point.id +\", \\\"\"+ pointComponent.id +\"\\\", \\\"true\\\");return false;'\/>\"; \nreturn s;",
"settableOverride":true,
"x":175,
"y":86
},
{
"type":"SCRIPT",
"dataPointXid":"DP_662451",
"bkgdColorOverride":"",
"displayControls":false,
"nameOverride":"",
"script":"var s = \"\";\nif (value) \n s += \"<img style='cursor:pointer;' src='graphics\/LightBulb2\/light_on.gif' onclick='mango.view.setPoint(\"+ point.id +\", \\\"\"+ pointComponent.id +\"\\\", \\\"false\\\");return false;'\/>\"; \nelse \n s += \"<img src='graphics\/LightBulb2\/light_off.gif' onclick='mango.view.setPoint(\"+ point.id +\", \\\"\"+ pointComponent.id +\"\\\", \\\"true\\\");return false;'\/>\"; \nreturn s;",
"settableOverride":true,
"x":297,
"y":84
}
],
"sharingUsers":[
{
"user":"User",
"accessType":"SET"
}
],
"name":"Escritorio",
"xid":"GV_872043"
}
],
"dataSources":[
{
"xid":"DS_109086",
"type":"META",
"alarmLevels":{
"SCRIPT_ERROR":"NONE",
"CONTEXT_POINT_DISABLED":"NONE",
"RESULT_TYPE_ERROR":"NONE"
},
"enabled":true,
"name":"dpm"
},
{
"xid":"DS_576785",
"type":"VIRTUAL",
"updatePeriodType":"SECONDS",
"enabled":true,
"name":"dpv",
"updatePeriods":2
}
],
"dataPoints":[
{
"xid":"DP_124483",
"loggingType":"ON_CHANGE",
"intervalLoggingPeriodType":"MINUTES",
"intervalLoggingType":"INSTANT",
"purgeType":"YEARS",
"pointLocator":{
"dataType":"NUMERIC",
"changeType":{
"type":"NO_CHANGE",
"startValue":"0"
},
"settable":true
},
"eventDetectors":[
],
"engineeringUnits":"",
"chartColour":null,
"chartRenderer":null,
"dataSourceXid":"DS_576785",
"defaultCacheSize":1,
"deviceName":"dpv",
"discardExtremeValues":false,
"discardHighLimit":1.7976931348623157E308,
"discardLowLimit":-1.7976931348623157E308,
"enabled":true,
"intervalLoggingPeriod":15,
"name":"VN",
"purgePeriod":1,
"textRenderer":{
"type":"ANALOG",
"format":"",
"suffix":""
},
"tolerance":0.0
},
{
"xid":"DP_769061",
"loggingType":"ON_CHANGE",
"intervalLoggingPeriodType":"MINUTES",
"intervalLoggingType":"INSTANT",
"purgeType":"YEARS",
"pointLocator":{
"dataType":"BINARY",
"updateEvent":"CONTEXT_UPDATE",
"context":[
{
"dataPointXid":"DP_124483",
"varName":"p27"
}
],
"executionDelaySeconds":0,
"script":"var e = p27.value;\ne&=1; \/\/ mascara para testar o bit 0\nif (e)\n return true;\nelse\n return false;",
"settable":true,
"updateCronPattern":""
},
"eventDetectors":[
],
"engineeringUnits":"",
"chartColour":null,
"chartRenderer":null,
"dataSourceXid":"DS_109086",
"defaultCacheSize":1,
"deviceName":"dpm",
"discardExtremeValues":false,
"discardHighLimit":1.7976931348623157E308,
"discardLowLimit":-1.7976931348623157E308,
"enabled":true,
"intervalLoggingPeriod":15,
"name":"M1_STB_1",
"purgePeriod":1,
"textRenderer":{
"type":"PLAIN",
"suffix":""
},
"tolerance":0.0
},
{
"xid":"DP_662451",
"loggingType":"ON_CHANGE",
"intervalLoggingPeriodType":"MINUTES",
"intervalLoggingType":"INSTANT",
"purgeType":"YEARS",
"pointLocator":{
"dataType":"BINARY",
"updateEvent":"CONTEXT_UPDATE",
"context":[
{
"dataPointXid":"DP_124483",
"varName":"p27"
}
],
"executionDelaySeconds":0,
"script":"var e = p27.value;\ne&=2; \/\/ mascara para testar o bit 1\nif (e)\n return true;\nelse\n return false;",
"settable":true,
"updateCronPattern":""
},
"eventDetectors":[
],
"engineeringUnits":"",
"chartColour":null,
"chartRenderer":null,
"dataSourceXid":"DS_109086",
"defaultCacheSize":1,
"deviceName":"dpm",
"discardExtremeValues":false,
"discardHighLimit":1.7976931348623157E308,
"discardLowLimit":-1.7976931348623157E308,
"enabled":true,
"intervalLoggingPeriod":15,
"name":"M1_STB_2",
"purgePeriod":1,
"textRenderer":{
"type":"PLAIN",
"suffix":""
},
"tolerance":0.0
}
],
"scheduledEvents":[
],
"compoundEventDetectors":[
],
"pointLinks":[
{
"xid":"PL_741069",
"sourcePointId":"DP_769061",
"targetPointId":"DP_124483",
"event":"CHANGE",
"disabled":false,
"script":"var s = 'DP_124483'.value; \/\/ aqui preciso do valor de dpv-VN_A\nif (source.value)\n return s|=1; \/\/mascara para setar bit 0\nelse\n return s&=65534; \/\/mascara para resetar bit 0\nreturn s;"
},
{
"xid":"PL_761116",
"sourcePointId":"DP_662451",
"targetPointId":"DP_124483",
"event":"CHANGE",
"disabled":false,
"script":"var s = 'DP_124483'.value; \/\/ aqui preciso do valor de dpv-VN_A\nif (source.value)\n return s|=2; \/\/mascara para setar bit 1\nelse\n return s&=65533; \/\/mascara para resetar bit 1\nreturn s;"
}
],
"users":[
{
"dataSourcePermissions":[
],
"dataPointPermissions":[
],
"admin":false,
"disabled":false,
"email":"aureodoliveira@gmail.com",
"homeUrl":"",
"password":"cRDtpNCeBiql5KOQsKVyrA0sAiA=",
"phone":"",
"receiveOwnAuditEvents":false,
"username":"User"
},
{
"admin":true,
"disabled":false,
"email":"admin@yourMangoDomain.com",
"homeUrl":null,
"password":"0DPiKuNIrrVmD8IUCuw1hQxNqZc=",
"phone":"",
"receiveOwnAuditEvents":false,
"username":"admin"
}
],
"mailingLists":[
],
"publishers":[
],
"pointHierarchy":[
],
"eventHandlers":[
],
"watchLists":[
{
"xid":"WL_174404",
"user":"admin",
"dataPoints":[
"DP_124483",
"DP_769061",
"DP_662451"
],
"sharingUsers":[
{
"user":"User",
"accessType":"SET"
}
],
"name":"Modulos Rele"
},
{
"xid":"WL_856534",
"user":"User",
"dataPoints":[
],
"sharingUsers":[
],
"name":"(sem nome)"
}
],
"maintenanceEvents":[
],
"scripts":[
{
"type":"CONTEXTUALIZED_SCRIPT",
"user":"admin",
"pointsOnContext":[
{
"dataPointXid":"DP_124483",
"varName":"p27"
}
],
"objectsOnContext":[
{
"varName":"val_2",
"objectId":2
}
],
"name":"Teste",
"script":"var e = p32.value;\nvar s = p27.value;\nif (e)\n s |= 1; \nelse\n s &= 65534;\nreturn s;",
"xid":"SC_227670"
}
],
"systemSettings":[
{
"plotGridlineColour":"silver",
"emailSmtpUsername":"",
"instanceDescription":"ScadaBR - 1.0 CE",
"filedata.path":"~\/WEB-INF\/filedata",
"databaseSchemaVersion":"1.12.4",
"uiPerformance":2000,
"chartBackgroundColour":"white",
"futureDateLimitPeriods":24,
"httpClientProxyPassword":"",
"httpClientProxyPort":-1,
"httpdsEpilogue":"",
"groveLogging":false,
"plotBackgroundColour":"white",
"eventPurgePeriods":1,
"futureDateLimitPeriodType":3,
"reportPurgePeriods":1,
"httpClientProxyUsername":"",
"reportPurgePeriodType":6,
"emailFromName":"ScadaBR",
"emailSmtpHost":"",
"emailSmtpPassword":"",
"emailFromAddress":"",
"httpClientProxyServer":"",
"eventPurgePeriodType":7,
"newVersionNotificationLevel":"S",
"language":"pt",
"emailSmtpPort":25,
"httpdsPrologue":""
}
]
}