forced added
This commit is contained in:
parent
aed13ae2d5
commit
776f450be1
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
After Width: | Height: | Size: 557 B |
@ -0,0 +1,50 @@
|
||||
{
|
||||
"custom": {
|
||||
"key": "value",
|
||||
"key_1": "value",
|
||||
"string": "value"
|
||||
},
|
||||
"params": {
|
||||
"key": "value"
|
||||
},
|
||||
"propConfig": {
|
||||
"custom.key": {
|
||||
"persistent": true
|
||||
},
|
||||
"custom.key_1": {
|
||||
"persistent": true
|
||||
},
|
||||
"custom.string": {
|
||||
"persistent": true
|
||||
},
|
||||
"params.key": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"defaultSize": {
|
||||
"height": 8,
|
||||
"width": 240
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"meta": {
|
||||
"name": "root"
|
||||
},
|
||||
"position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"props": {
|
||||
"mode": "percent",
|
||||
"style": {
|
||||
"backgroundColor": "white",
|
||||
"borderStyle": "solid",
|
||||
"borderWidth": "1px",
|
||||
"overflow": "hidden"
|
||||
}
|
||||
},
|
||||
"type": "ia.container.coord"
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,72 @@
|
||||
{
|
||||
"custom": {},
|
||||
"params": {
|
||||
"key": "value"
|
||||
},
|
||||
"propConfig": {
|
||||
"params.key": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"defaultSize": {
|
||||
"height": 271,
|
||||
"width": 316
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "Conveyor_Right90"
|
||||
},
|
||||
"position": {
|
||||
"height": 0.9446,
|
||||
"width": 0.9494
|
||||
},
|
||||
"props": {
|
||||
"elements": [
|
||||
{
|
||||
"id": "defs1",
|
||||
"name": "defs1",
|
||||
"type": "defs"
|
||||
},
|
||||
{
|
||||
"elements": [
|
||||
{
|
||||
"d": "m 0.48408946,0.63336539 c 5.03604004,0.02588 7.95928004,-0.266973 12.23377954,1.98944001 1.65503,0.9666 2.74197,2.07523 3.73794,3.20659 1.85537,2.84128 3.14745,5.8598596 3.05039,10.7798096 l -8.06562,0.031 c -0.0803,-1.92185 0.0446,-3.79913 -1.5474595,-5.77497 -2.38574,-2.6865496 -6.13811,-2.3322296 -9.40355004,-2.4430596 z",
|
||||
"fill": {
|
||||
"opacity": "1",
|
||||
"paint": "#ffffff"
|
||||
},
|
||||
"id": "path27086",
|
||||
"name": "path27086",
|
||||
"stroke": {
|
||||
"dasharray": "none",
|
||||
"opacity": "1",
|
||||
"paint": "#000000",
|
||||
"width": "0.25"
|
||||
},
|
||||
"type": "path"
|
||||
}
|
||||
],
|
||||
"id": "layer1",
|
||||
"name": "layer1",
|
||||
"type": "group"
|
||||
}
|
||||
],
|
||||
"viewBox": "0 0 20 17"
|
||||
},
|
||||
"type": "ia.shapes.svg"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "root"
|
||||
},
|
||||
"props": {
|
||||
"mode": "percent"
|
||||
},
|
||||
"type": "ia.container.coord"
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,235 @@
|
||||
{
|
||||
"custom": {
|
||||
"string": "OK"
|
||||
},
|
||||
"params": {
|
||||
"tagProps": [
|
||||
"value"
|
||||
]
|
||||
},
|
||||
"propConfig": {
|
||||
"custom.state": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"fallbackDelay": 1,
|
||||
"mode": "indirect",
|
||||
"references": {
|
||||
"0": "{view.params.tagProps[0]}",
|
||||
"fc": "{session.custom.fc}"
|
||||
},
|
||||
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/STATE"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "coalesce({value},{view.params.forceFaultStatus},0)",
|
||||
"type": "expression"
|
||||
},
|
||||
{
|
||||
"fallback": 0,
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 1,
|
||||
"output": 1
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": 2
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": 3
|
||||
},
|
||||
{
|
||||
"input": 4,
|
||||
"output": 4
|
||||
},
|
||||
{
|
||||
"input": 5,
|
||||
"output": 5
|
||||
},
|
||||
{
|
||||
"input": 6,
|
||||
"output": 6
|
||||
},
|
||||
{
|
||||
"input": 7,
|
||||
"output": 7
|
||||
}
|
||||
],
|
||||
"outputType": "scalar",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "tag"
|
||||
}
|
||||
},
|
||||
"custom.string": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.state"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": "Unknown",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 0,
|
||||
"output": "OK"
|
||||
},
|
||||
{
|
||||
"input": 1,
|
||||
"output": "Fault"
|
||||
}
|
||||
],
|
||||
"outputType": "scalar",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
},
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"defaultSize": {
|
||||
"height": 20,
|
||||
"width": 20
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "EncoderIcon"
|
||||
},
|
||||
"position": {
|
||||
"height": 1,
|
||||
"width": 1
|
||||
},
|
||||
"propConfig": {
|
||||
"props.elements[0].fill.paint": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.state"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": "#47FF47",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 1,
|
||||
"output": "#FF0000"
|
||||
}
|
||||
],
|
||||
"outputType": "color",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"elements": [
|
||||
{
|
||||
"cx": 12,
|
||||
"cy": "12",
|
||||
"fill": {},
|
||||
"name": "statusCircle",
|
||||
"rx": "10",
|
||||
"ry": "10",
|
||||
"stroke": {
|
||||
"paint": "#000000",
|
||||
"width": "2"
|
||||
},
|
||||
"type": "ellipse"
|
||||
},
|
||||
{
|
||||
"d": "M 4.6516854,13.685393 H 9.8292135",
|
||||
"fill": {},
|
||||
"name": "segLeft",
|
||||
"stroke": {
|
||||
"paint": "#000000",
|
||||
"width": 1
|
||||
},
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"d": "M 9.6000004,13.469662 V 8.2112357",
|
||||
"fill": {},
|
||||
"name": "segUpLeft",
|
||||
"stroke": {
|
||||
"paint": "#000000",
|
||||
"width": 1
|
||||
},
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"d": "M 19.829214,13.685393 H 14.651685",
|
||||
"fill": {},
|
||||
"name": "segRight",
|
||||
"stroke": {
|
||||
"paint": "#000000",
|
||||
"width": 1
|
||||
},
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"d": "M 14.880899,13.469662 V 8.211236",
|
||||
"fill": {},
|
||||
"name": "segUpRight",
|
||||
"stroke": {
|
||||
"paint": "#000000",
|
||||
"width": 1
|
||||
},
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"d": "m 9.8154019,8.4404597 4.8815551,0.013462",
|
||||
"fill": {},
|
||||
"name": "segTop",
|
||||
"stroke": {
|
||||
"paint": "#000000",
|
||||
"width": 1
|
||||
},
|
||||
"type": "path"
|
||||
}
|
||||
],
|
||||
"viewBox": "0 0 24 24"
|
||||
},
|
||||
"type": "ia.shapes.svg"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "Encoder",
|
||||
"tooltip": {
|
||||
"enabled": true
|
||||
}
|
||||
},
|
||||
"propConfig": {
|
||||
"meta.tooltip.text": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "\"Source Id: \" + {view.params.tagProps[0]} + \", Status: \" + {view.custom.string}\n"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
},
|
||||
"meta.visible": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "session.custom.alarm_filter.show_encoders"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"mode": "percent"
|
||||
},
|
||||
"type": "ia.container.coord"
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,225 @@
|
||||
{
|
||||
"custom": {
|
||||
"alarmHighlight": "",
|
||||
"alarm_filter": {
|
||||
"show_VFD": true,
|
||||
"show_beacons": true,
|
||||
"show_buttons": true,
|
||||
"show_camera_jams": true,
|
||||
"show_dpm_mcm": true,
|
||||
"show_encoders": true,
|
||||
"show_epc": true,
|
||||
"show_fio_safety": true,
|
||||
"show_map": true,
|
||||
"show_photoeyes": true,
|
||||
"show_px": true,
|
||||
"show_solenoids": true
|
||||
},
|
||||
"areaHover": [],
|
||||
"colours": {
|
||||
"Fallback": "#00FF00",
|
||||
"colour_impaired": false,
|
||||
"state0": "#8C8C8C",
|
||||
"state1": "#FF0000",
|
||||
"state2": "#FF8000",
|
||||
"state3": "#FFFF00",
|
||||
"state4": "#007EFC",
|
||||
"state5": "#00CC00",
|
||||
"state6": "#CCCCFF"
|
||||
},
|
||||
"covert": true,
|
||||
"currentGraphic": "Windows/Graphics/Overview",
|
||||
"demoHighlight": "",
|
||||
"dexmanager": {
|
||||
"config": {
|
||||
"font": "bold 12px Arial",
|
||||
"highlight": "#ff0"
|
||||
},
|
||||
"show": {
|
||||
"Beacons": false,
|
||||
"ConveyorLabels": true,
|
||||
"ConveyorPatterns": true,
|
||||
"Conveyors": true,
|
||||
"DivertPaddles": true,
|
||||
"EIPs": false,
|
||||
"Encoders": false,
|
||||
"Estops": false,
|
||||
"Gaylords": true,
|
||||
"LimitSwitches": false,
|
||||
"MCPs": false,
|
||||
"PhotoEyes": false,
|
||||
"PushButtons": false,
|
||||
"Scanners": false,
|
||||
"VFDs": false
|
||||
}
|
||||
},
|
||||
"dpm_view_path": "autStand/Custom_Views/Enternet-Windows/DPMS/DPM Devices/MCM01/PS3_1_DPM1",
|
||||
"fc": "BNA8",
|
||||
"heatmapSettings": {
|
||||
"alarms": [],
|
||||
"alarmsText": "",
|
||||
"data": {
|
||||
"$": [
|
||||
"ds",
|
||||
192,
|
||||
1755608623601
|
||||
],
|
||||
"$columns": [
|
||||
{
|
||||
"data": [],
|
||||
"name": "firsttime",
|
||||
"type": "Date"
|
||||
},
|
||||
{
|
||||
"data": [],
|
||||
"name": "lasttime",
|
||||
"type": "Date"
|
||||
},
|
||||
{
|
||||
"data": [],
|
||||
"name": "duration",
|
||||
"type": "String"
|
||||
},
|
||||
{
|
||||
"data": [],
|
||||
"name": "count",
|
||||
"type": "Long"
|
||||
},
|
||||
{
|
||||
"data": [],
|
||||
"name": "device",
|
||||
"type": "String"
|
||||
},
|
||||
{
|
||||
"data": [],
|
||||
"name": "description",
|
||||
"type": "String"
|
||||
}
|
||||
]
|
||||
},
|
||||
"devices": [],
|
||||
"devicesText": "",
|
||||
"enabled": false,
|
||||
"shifts": [],
|
||||
"shiftsText": "",
|
||||
"time": {
|
||||
"end": "2020-07-30 00:00:00",
|
||||
"start": "2020-07-29 00:00:00"
|
||||
}
|
||||
},
|
||||
"rotation": "0deg",
|
||||
"show_dpm_device_view": true,
|
||||
"show_dpm_view": true,
|
||||
"timewidget": {
|
||||
"endDate": {
|
||||
"$": [
|
||||
"ts",
|
||||
192,
|
||||
1604092861010
|
||||
],
|
||||
"$ts": 1604116800000
|
||||
},
|
||||
"mode": "currentDay",
|
||||
"startDate": {
|
||||
"$": [
|
||||
"ts",
|
||||
192,
|
||||
1604092861010
|
||||
],
|
||||
"$ts": 1604030400000
|
||||
},
|
||||
"update": {
|
||||
"$": [
|
||||
"ts",
|
||||
192,
|
||||
1604092861010
|
||||
],
|
||||
"$ts": 1604092861010
|
||||
}
|
||||
}
|
||||
},
|
||||
"propConfig": {
|
||||
"custom.dexmanager.highlight": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"struct": {
|
||||
"alarm": "{this.custom.alarmHighlight}",
|
||||
"demo": "{this.custom.demoHighlight}",
|
||||
"toggle": "{[default]Gateway/ToggleTag}"
|
||||
},
|
||||
"waitOnAll": true
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"code": "\thighlights \u003d []\n\t# Add alarm highlight:\n\tif len(value.alarm) \u003e 0:\n\t\thighlights.append({\n\t\t\t\"color\": \"#F00\" if value.toggle else \"#FF0\",\n\t\t\t\"keys\": [value.alarm]\n\t\t})\n\t\tif \".\" in value.alarm:\n\t\t\thighlights.append({\n\t\t\t\t\"color\": \"#F00\" if value.toggle else \"#FF0\",\n\t\t\t\t\"keys\": [value.alarm.split(\".\")[0], \"conveyor\"]\n\t\t\t})\n\t# Add demo highlight:\n\tif False and len(value.demo) \u003e 0:\n\t\thighlights.append({\n\t\t\t\"color\": \"#F00\" if value.toggle else \"#FF0\",\n\t\t\t\"keys\": [\"conveyor\", value.demo]\n\t\t})\n\treturn highlights",
|
||||
"type": "script"
|
||||
}
|
||||
],
|
||||
"type": "expr-struct"
|
||||
}
|
||||
},
|
||||
"custom.isMobile": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "indexOf(lower({session.props.device.userAgent}), \"mobile\")\u003e\u003d0"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
},
|
||||
"props.auth": {
|
||||
"access": "PRIVATE",
|
||||
"persistent": false
|
||||
},
|
||||
"props.device.accelerometer": {
|
||||
"access": "SYSTEM",
|
||||
"persistent": false
|
||||
},
|
||||
"props.device.identifier": {
|
||||
"access": "SYSTEM",
|
||||
"persistent": false
|
||||
},
|
||||
"props.device.timezone": {
|
||||
"access": "SYSTEM",
|
||||
"persistent": false
|
||||
},
|
||||
"props.device.type": {
|
||||
"access": "SYSTEM",
|
||||
"persistent": false
|
||||
},
|
||||
"props.device.userAgent": {
|
||||
"access": "SYSTEM",
|
||||
"persistent": false
|
||||
},
|
||||
"props.gateway": {
|
||||
"access": "SYSTEM",
|
||||
"persistent": false
|
||||
},
|
||||
"props.geolocation.data": {
|
||||
"access": "SYSTEM",
|
||||
"persistent": false
|
||||
},
|
||||
"props.geolocation.permissionGranted": {
|
||||
"access": "SYSTEM",
|
||||
"persistent": false
|
||||
},
|
||||
"props.host": {
|
||||
"access": "SYSTEM",
|
||||
"persistent": false
|
||||
},
|
||||
"props.id": {
|
||||
"access": "SYSTEM",
|
||||
"persistent": false
|
||||
},
|
||||
"props.lastActivity": {
|
||||
"access": "SYSTEM",
|
||||
"persistent": false
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"address": "[0:0:0:0:0:0:0:1]",
|
||||
"device": {},
|
||||
"geolocation": {},
|
||||
"locale": "en-US",
|
||||
"timeZoneId": "Asia/Tbilisi"
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,241 @@
|
||||
{
|
||||
"custom": {
|
||||
"state": 0,
|
||||
"string": "Starting"
|
||||
},
|
||||
"params": {
|
||||
"name": "amber",
|
||||
"tagProps": [
|
||||
"/system/mcm01/test",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value"
|
||||
]
|
||||
},
|
||||
"propConfig": {
|
||||
"custom.state": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"fallbackDelay": 2.5,
|
||||
"mode": "indirect",
|
||||
"references": {
|
||||
"0": "{view.params.tagProps[0]}",
|
||||
"fc": "{session.custom.fc}"
|
||||
},
|
||||
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/STATE"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "coalesce({value},{view.params.forceFaultStatus},0)",
|
||||
"type": "expression"
|
||||
},
|
||||
{
|
||||
"fallback": null,
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 1,
|
||||
"output": 1
|
||||
},
|
||||
{
|
||||
"input": 0,
|
||||
"output": 0
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": 2
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": 3
|
||||
}
|
||||
],
|
||||
"outputType": "scalar",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "tag"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.string": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.state"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": "Starting",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 1,
|
||||
"output": "Running"
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": "EStop or Faulted"
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": "Gridlock Prevention"
|
||||
},
|
||||
{
|
||||
"input": 4,
|
||||
"output": "Full"
|
||||
},
|
||||
{
|
||||
"input": 5,
|
||||
"output": "Jammed"
|
||||
}
|
||||
],
|
||||
"outputType": "scalar",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"params.name": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.tagProps": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"defaultSize": {
|
||||
"height": 20,
|
||||
"width": 20
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "Label"
|
||||
},
|
||||
"position": {
|
||||
"height": 1,
|
||||
"width": 1
|
||||
},
|
||||
"propConfig": {
|
||||
"props.text": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "substring({view.params.name}, 0, 1)"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"textStyle": {
|
||||
"fontSize": "20px",
|
||||
"textAlign": "center",
|
||||
"textTransform": "uppercase"
|
||||
}
|
||||
},
|
||||
"type": "ia.display.label"
|
||||
}
|
||||
],
|
||||
"events": {
|
||||
"dom": {
|
||||
"onClick": {
|
||||
"config": {
|
||||
"script": "\tsystem.perspective.openDock(\u0027Docked-East-JR\u0027,params\u003d{\u0027tagProps\u0027:self.view.params.tagProps})"
|
||||
},
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
},
|
||||
"onMouseEnter": {
|
||||
"config": {
|
||||
"script": "\tfrom time import sleep\n\t\n\talarm \u003d []\n\tmessage \u003d None\n\t\n\tsleep(0.5)\n\t\n\tif system.tag.exists(\"System/aws_data\"):\n\t\tif self.view.params.tagProps[0] !\u003d \"\":\n\t\t\ttags_to_read \u003d system.tag.readBlocking(\"System/aws_data\")\n\t\t\tdecode_alarm_data \u003d system.util.jsonDecode(tags_to_read[0].value)\n\t\t\talarm \u003d [decode_alarm_data[i] for i in decode_alarm_data\n\t\t\t\t\tif decode_alarm_data[i][\u0027sourceId\u0027].startswith(self.view.params.tagProps[0])]\n\t\tif alarm:\n\t\t\talarm \u003d sorted(alarm, key \u003d lambda t:t[\u0027timestamp\u0027], reverse\u003dTrue)\n\t\t\tmessage \u003d max(alarm, key \u003d lambda p:p[\u0027priority\u0027]).get(\u0027message\u0027)\n\t\t\tif len(alarm) \u003e 1:\n\t\t\t\tmessage +\u003d \" (+\" + str(len(alarm)-1) + \")\"\n\tself.view.custom.alarm_message \u003d message"
|
||||
},
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
}
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"name": "root",
|
||||
"tooltip": {
|
||||
"enabled": true
|
||||
}
|
||||
},
|
||||
"propConfig": {
|
||||
"meta.tooltip.text": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "\"Source Id: \" + {view.params.tagProps[0]} + \", Status: \" + {view.custom.string}\n"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
},
|
||||
"meta.visible": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "session.custom.alarm_filter.show_beacons"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.style.backgroundColor": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.state"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": "#808080",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 1,
|
||||
"output": "#00FF00"
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": "#FF0000"
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": "#FF00FF"
|
||||
},
|
||||
{
|
||||
"input": 4,
|
||||
"output": "#0000D9"
|
||||
},
|
||||
{
|
||||
"input": 5,
|
||||
"output": "#FF8C00"
|
||||
}
|
||||
],
|
||||
"outputType": "color",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"mode": "percent",
|
||||
"style": {
|
||||
"borderStyle": "solid",
|
||||
"cursor": "pointer",
|
||||
"overflow": "hidden"
|
||||
}
|
||||
},
|
||||
"type": "ia.container.coord"
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,75 @@
|
||||
{
|
||||
"custom": {},
|
||||
"params": {
|
||||
"key": "value"
|
||||
},
|
||||
"propConfig": {
|
||||
"params.key": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"defaultSize": {
|
||||
"height": 69,
|
||||
"width": 49
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "Conveyor45"
|
||||
},
|
||||
"position": {
|
||||
"height": 0.9855,
|
||||
"width": 0.9796
|
||||
},
|
||||
"props": {
|
||||
"elements": [
|
||||
{
|
||||
"id": "defs1",
|
||||
"name": "defs1",
|
||||
"type": "defs"
|
||||
},
|
||||
{
|
||||
"elements": [
|
||||
{
|
||||
"d": "m 0.61872656,19.047242 0.185181,-7.76481 C 2.3211966,6.4490419 5.3844746,3.4831579 9.6680236,0.93748089 L 13.582549,7.8726519 c -2.984985,1.33473 -4.2291194,3.3482401 -4.9990764,6.5174301 l -0.08744,4.67802 z",
|
||||
"fill": {
|
||||
"opacity": "1",
|
||||
"paint": "#ffffff"
|
||||
},
|
||||
"id": "path26615",
|
||||
"name": "path26615",
|
||||
"stroke": {
|
||||
"dasharray": "none",
|
||||
"opacity": "1",
|
||||
"paint": "#000000",
|
||||
"width": "0.25"
|
||||
},
|
||||
"type": "path"
|
||||
}
|
||||
],
|
||||
"id": "layer1",
|
||||
"name": "layer1",
|
||||
"type": "group"
|
||||
}
|
||||
],
|
||||
"viewBox": "0 0 14 19"
|
||||
},
|
||||
"type": "ia.shapes.svg"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "root"
|
||||
},
|
||||
"props": {
|
||||
"mode": "percent",
|
||||
"style": {
|
||||
"overflow": "hidden"
|
||||
}
|
||||
},
|
||||
"type": "ia.container.coord"
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,78 @@
|
||||
{
|
||||
"custom": {},
|
||||
"params": {
|
||||
"key": "value"
|
||||
},
|
||||
"propConfig": {
|
||||
"params.key": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"defaultSize": {
|
||||
"height": 272,
|
||||
"width": 215
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "Conveyor_Left90"
|
||||
},
|
||||
"position": {
|
||||
"height": 1.3652,
|
||||
"width": 1,
|
||||
"x": 0.0069,
|
||||
"y": -0.1685
|
||||
},
|
||||
"props": {
|
||||
"elements": [
|
||||
{
|
||||
"id": "defs1",
|
||||
"name": "defs1",
|
||||
"type": "defs"
|
||||
},
|
||||
{
|
||||
"elements": [
|
||||
{
|
||||
"d": "M 16.890047,19.897888 C 4.1781605,20.036878 -0.11241603,13.922713 0.16340637,0.16060852 L 8.2822031,0.16091303 C 8.3924473,8.3148192 8.5268195,11.434975 16.856526,11.653146 Z",
|
||||
"fill": {
|
||||
"opacity": "1",
|
||||
"paint": "#ffffff"
|
||||
},
|
||||
"id": "path27089",
|
||||
"name": "path27089",
|
||||
"stroke": {
|
||||
"dasharray": "none",
|
||||
"opacity": "1",
|
||||
"paint": "#000000",
|
||||
"width": "0.260407"
|
||||
},
|
||||
"type": "path"
|
||||
}
|
||||
],
|
||||
"id": "layer1",
|
||||
"name": "layer1",
|
||||
"type": "group"
|
||||
}
|
||||
],
|
||||
"viewBox": "0 0 17 20"
|
||||
},
|
||||
"type": "ia.shapes.svg"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "root"
|
||||
},
|
||||
"props": {
|
||||
"mode": "percent",
|
||||
"style": {
|
||||
"overflow": "hidden",
|
||||
"overflowX": "hidden"
|
||||
}
|
||||
},
|
||||
"type": "ia.container.coord"
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,296 @@
|
||||
{
|
||||
"custom": {
|
||||
"state": 0,
|
||||
"string": "Clear"
|
||||
},
|
||||
"params": {
|
||||
"tagProps": [
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value"
|
||||
]
|
||||
},
|
||||
"propConfig": {
|
||||
"custom.state": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"fallbackDelay": 1,
|
||||
"mode": "indirect",
|
||||
"references": {
|
||||
"0": "{view.params.tagProps[0]}",
|
||||
"fc": "{session.custom.fc}"
|
||||
},
|
||||
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/STATE"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "coalesce({value},{view.params.forceFaultStatus},0)",
|
||||
"type": "expression"
|
||||
},
|
||||
{
|
||||
"fallback": 0,
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 1,
|
||||
"output": 1
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": 2
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": 3
|
||||
},
|
||||
{
|
||||
"input": 4,
|
||||
"output": 4
|
||||
},
|
||||
{
|
||||
"input": 5,
|
||||
"output": 5
|
||||
},
|
||||
{
|
||||
"input": 6,
|
||||
"output": 6
|
||||
},
|
||||
{
|
||||
"input": 7,
|
||||
"output": 7
|
||||
}
|
||||
],
|
||||
"outputType": "scalar",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "tag"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.string": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.state"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": "Clear",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 1,
|
||||
"output": "Clear"
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": "Blocked"
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": "Disabled"
|
||||
},
|
||||
{
|
||||
"input": 4,
|
||||
"output": "Jammed"
|
||||
}
|
||||
],
|
||||
"outputType": "scalar",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"params.tagProps": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"defaultSize": {
|
||||
"height": 40,
|
||||
"width": 200
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "Photoeye"
|
||||
},
|
||||
"position": {
|
||||
"height": 1,
|
||||
"width": 1
|
||||
},
|
||||
"propConfig": {
|
||||
"props.elements[0].fill.paint": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.state"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": "#00FF00",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 0,
|
||||
"output": "#00FF00"
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": "#000000"
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": "#800080"
|
||||
},
|
||||
{
|
||||
"input": 4,
|
||||
"output": "#FF0000"
|
||||
}
|
||||
],
|
||||
"outputType": "color",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.elements[2].fill.paint": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.state"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": "#00FF00",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 0,
|
||||
"output": "#00FF00"
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": "#000000"
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": "#800080"
|
||||
},
|
||||
{
|
||||
"input": 4,
|
||||
"output": "#FF0000"
|
||||
}
|
||||
],
|
||||
"outputType": "color",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"elements": [
|
||||
{
|
||||
"d": "m 28.763932,20 -20,10 V 10 Z",
|
||||
"fill": {},
|
||||
"name": "path",
|
||||
"stroke": {
|
||||
"paint": "#000000",
|
||||
"width": "2"
|
||||
},
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"stroke": {
|
||||
"paint": "#000000",
|
||||
"width": "2"
|
||||
},
|
||||
"stroke-dasharray": "4,4",
|
||||
"type": "line",
|
||||
"x1": "30",
|
||||
"x2": "95%",
|
||||
"y1": "20",
|
||||
"y2": "20"
|
||||
},
|
||||
{
|
||||
"fill": {},
|
||||
"height": "20",
|
||||
"stroke": {
|
||||
"paint": "#000000",
|
||||
"width": "2"
|
||||
},
|
||||
"type": "rect",
|
||||
"width": "6",
|
||||
"x": "95%",
|
||||
"y": "10"
|
||||
}
|
||||
],
|
||||
"viewBox": "0 0 300 40"
|
||||
},
|
||||
"type": "ia.shapes.svg"
|
||||
}
|
||||
],
|
||||
"events": {
|
||||
"dom": {
|
||||
"onClick": {
|
||||
"config": {
|
||||
"script": "\tsystem.perspective.openDock(\u0027Docked-East-Photoeye\u0027,params\u003d{\u0027tagProps\u0027:self.view.params.tagProps})"
|
||||
},
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
},
|
||||
"onMouseEnter": {
|
||||
"config": {
|
||||
"script": "\tfrom time import sleep\n\n\talarm \u003d []\n\tmessage \u003d None\n\n\tsleep(0.5)\n\n\tif system.tag.exists(\"System/aws_data\"):\n\t\tif self.view.params.tagProps[0] !\u003d \"\":\n\t\t\ttags_to_read \u003d system.tag.readBlocking(\"System/aws_data\")\n\t\t\tdecode_alarm_data \u003d system.util.jsonDecode(tags_to_read[0].value)\n\t\t\talarm \u003d [decode_alarm_data[i] for i in decode_alarm_data\n\t\t\t\t\tif decode_alarm_data[i][\u0027sourceId\u0027].startswith(self.view.params.tagProps[0])]\n\t\tif alarm:\n\t\t\talarm \u003d sorted(alarm, key \u003d lambda t:t[\u0027timestamp\u0027], reverse\u003dTrue)\n\t\t\tmessage \u003d max(alarm, key \u003d lambda p:p[\u0027priority\u0027]).get(\u0027message\u0027)\n\t\t\tif len(alarm) \u003e 1:\n\t\t\t\tmessage +\u003d \" (+\" + str(len(alarm)-1) + \")\"\n\tself.view.custom.alarm_message \u003d message"
|
||||
},
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
}
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"name": "root",
|
||||
"tooltip": {
|
||||
"enabled": true
|
||||
}
|
||||
},
|
||||
"propConfig": {
|
||||
"meta.tooltip.text": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "\"Source Id: \" + {view.params.tagProps[0]} + \", Status: \" + {view.custom.string}\n"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
},
|
||||
"meta.visible": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "session.custom.alarm_filter.show_photoeyes"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"mode": "percent",
|
||||
"style": {
|
||||
"cursor": "pointer"
|
||||
}
|
||||
},
|
||||
"type": "ia.container.coord"
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 4.8 KiB |
@ -0,0 +1,296 @@
|
||||
{
|
||||
"custom": {
|
||||
"state": 0,
|
||||
"string": "Clear"
|
||||
},
|
||||
"params": {
|
||||
"tagProps": [
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value"
|
||||
]
|
||||
},
|
||||
"propConfig": {
|
||||
"custom.state": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"fallbackDelay": 1,
|
||||
"mode": "indirect",
|
||||
"references": {
|
||||
"0": "{view.params.tagProps[0]}",
|
||||
"fc": "{session.custom.fc}"
|
||||
},
|
||||
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/STATE"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "coalesce({value},{view.params.forceFaultStatus},0)",
|
||||
"type": "expression"
|
||||
},
|
||||
{
|
||||
"fallback": 0,
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 1,
|
||||
"output": 1
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": 2
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": 3
|
||||
},
|
||||
{
|
||||
"input": 4,
|
||||
"output": 4
|
||||
},
|
||||
{
|
||||
"input": 5,
|
||||
"output": 5
|
||||
},
|
||||
{
|
||||
"input": 6,
|
||||
"output": 6
|
||||
},
|
||||
{
|
||||
"input": 7,
|
||||
"output": 7
|
||||
}
|
||||
],
|
||||
"outputType": "scalar",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "tag"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.string": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.state"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": "Clear",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 1,
|
||||
"output": "Clear"
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": "Blocked"
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": "Disabled"
|
||||
},
|
||||
{
|
||||
"input": 4,
|
||||
"output": "Jammed"
|
||||
}
|
||||
],
|
||||
"outputType": "scalar",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"params.tagProps": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"defaultSize": {
|
||||
"height": 40,
|
||||
"width": 110
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "Photoeye"
|
||||
},
|
||||
"position": {
|
||||
"height": 1,
|
||||
"width": 1
|
||||
},
|
||||
"propConfig": {
|
||||
"props.elements[0].fill.paint": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.state"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": "#00FF00",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 0,
|
||||
"output": "#00FF00"
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": "#000000"
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": "#800080"
|
||||
},
|
||||
{
|
||||
"input": 4,
|
||||
"output": "#FF0000"
|
||||
}
|
||||
],
|
||||
"outputType": "color",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.elements[2].fill.paint": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.state"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": "#00FF00",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 0,
|
||||
"output": "#00FF00"
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": "#000000"
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": "#800080"
|
||||
},
|
||||
{
|
||||
"input": 4,
|
||||
"output": "#FF0000"
|
||||
}
|
||||
],
|
||||
"outputType": "color",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"elements": [
|
||||
{
|
||||
"d": "m 28.763932,20 -20,10 V 10 Z",
|
||||
"fill": {},
|
||||
"name": "path",
|
||||
"stroke": {
|
||||
"paint": "#000000",
|
||||
"width": "2"
|
||||
},
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"stroke": {
|
||||
"paint": "#000000",
|
||||
"width": "2"
|
||||
},
|
||||
"stroke-dasharray": "4,4",
|
||||
"type": "line",
|
||||
"x1": "30",
|
||||
"x2": "90%",
|
||||
"y1": "20",
|
||||
"y2": "20"
|
||||
},
|
||||
{
|
||||
"fill": {},
|
||||
"height": "20",
|
||||
"stroke": {
|
||||
"paint": "#000000",
|
||||
"width": "2"
|
||||
},
|
||||
"type": "rect",
|
||||
"width": "6",
|
||||
"x": "90%",
|
||||
"y": "10"
|
||||
}
|
||||
],
|
||||
"viewBox": "0 0 110 40"
|
||||
},
|
||||
"type": "ia.shapes.svg"
|
||||
}
|
||||
],
|
||||
"events": {
|
||||
"dom": {
|
||||
"onClick": {
|
||||
"config": {
|
||||
"script": "\tsystem.perspective.openDock(\u0027Docked-East-Photoeye\u0027,params\u003d{\u0027tagProps\u0027:self.view.params.tagProps})"
|
||||
},
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
},
|
||||
"onMouseEnter": {
|
||||
"config": {
|
||||
"script": "\tfrom time import sleep\n\n\talarm \u003d []\n\tmessage \u003d None\n\n\tsleep(0.5)\n\n\tif system.tag.exists(\"System/aws_data\"):\n\t\tif self.view.params.tagProps[0] !\u003d \"\":\n\t\t\ttags_to_read \u003d system.tag.readBlocking(\"System/aws_data\")\n\t\t\tdecode_alarm_data \u003d system.util.jsonDecode(tags_to_read[0].value)\n\t\t\talarm \u003d [decode_alarm_data[i] for i in decode_alarm_data\n\t\t\t\t\tif decode_alarm_data[i][\u0027sourceId\u0027].startswith(self.view.params.tagProps[0])]\n\t\tif alarm:\n\t\t\talarm \u003d sorted(alarm, key \u003d lambda t:t[\u0027timestamp\u0027], reverse\u003dTrue)\n\t\t\tmessage \u003d max(alarm, key \u003d lambda p:p[\u0027priority\u0027]).get(\u0027message\u0027)\n\t\t\tif len(alarm) \u003e 1:\n\t\t\t\tmessage +\u003d \" (+\" + str(len(alarm)-1) + \")\"\n\tself.view.custom.alarm_message \u003d message"
|
||||
},
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
}
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"name": "root",
|
||||
"tooltip": {
|
||||
"enabled": true
|
||||
}
|
||||
},
|
||||
"propConfig": {
|
||||
"meta.tooltip.text": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "\"Source Id: \" + {view.params.tagProps[0]} + \", Status: \" + {view.custom.string}\n"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
},
|
||||
"meta.visible": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "session.custom.alarm_filter.show_photoeyes"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"mode": "percent",
|
||||
"style": {
|
||||
"cursor": "pointer"
|
||||
}
|
||||
},
|
||||
"type": "ia.container.coord"
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,45 @@
|
||||
{
|
||||
"custom": {
|
||||
"key": "value",
|
||||
"string": "value"
|
||||
},
|
||||
"params": {
|
||||
"key": "value"
|
||||
},
|
||||
"propConfig": {
|
||||
"custom.key": {
|
||||
"persistent": true
|
||||
},
|
||||
"custom.string": {
|
||||
"persistent": true
|
||||
},
|
||||
"params.key": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"defaultSize": {
|
||||
"height": 8,
|
||||
"width": 240
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"meta": {
|
||||
"name": "root"
|
||||
},
|
||||
"position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"props": {
|
||||
"mode": "percent",
|
||||
"style": {
|
||||
"backgroundColor": "white",
|
||||
"borderStyle": "solid",
|
||||
"borderWidth": "1px"
|
||||
}
|
||||
},
|
||||
"type": "ia.container.coord"
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,98 @@
|
||||
import os, json, sys
|
||||
|
||||
global_project_page_ids = {}
|
||||
|
||||
def get_project_config():
|
||||
"""
|
||||
Scan each view.json under Detailed_Views (no recursion),
|
||||
go one level deeper (coordinateContainer), extract tagProps[0]
|
||||
from children, and store as {source_id: view_folder_name}.
|
||||
"""
|
||||
global global_project_page_ids
|
||||
global_project_page_ids.clear()
|
||||
|
||||
try:
|
||||
project_name = system.util.getProjectName()
|
||||
base_path = (
|
||||
os.getcwd().replace("\\", "/")
|
||||
+ "/data/projects/"
|
||||
+ project_name
|
||||
+ "/com.inductiveautomation.perspective/Views/autStand/Detailed_Views"
|
||||
)
|
||||
|
||||
if not os.path.exists(base_path):
|
||||
system.perspective.print("Path not found: " + base_path)
|
||||
return {}
|
||||
|
||||
for view_folder in os.listdir(base_path):
|
||||
json_file = os.path.join(base_path, view_folder, "view.json")
|
||||
if not os.path.isfile(json_file):
|
||||
continue
|
||||
|
||||
with open(json_file, "r") as fh:
|
||||
view_json = json.load(fh)
|
||||
|
||||
# go one level deeper: root -> children[0] (coordinateContainer) -> its children
|
||||
root_children = (view_json.get("root") or {}).get("children") or []
|
||||
if not root_children:
|
||||
continue
|
||||
|
||||
# assume first child is the coordinateContainer
|
||||
container = root_children[0]
|
||||
children = container.get("children") or []
|
||||
|
||||
# now loop through these children to get tagProps
|
||||
for child in children:
|
||||
props = child.get("props") or {}
|
||||
params = props.get("params") or {}
|
||||
tag_props = params.get("tagProps")
|
||||
|
||||
if isinstance(tag_props, list) and len(tag_props) > 0:
|
||||
source_id = str(tag_props[0])
|
||||
global_project_page_ids[source_id] = view_folder
|
||||
|
||||
except:
|
||||
whid = system.tag.readBlocking("Configuration/FC")[0].value
|
||||
logger = system.util.getLogger("%s-get_project_config" % whid)
|
||||
exc_type, exc_obj, tb = sys.exc_info()
|
||||
logger.error("Error at line %s: %s" % (tb.tb_lineno, exc_obj))
|
||||
|
||||
return global_project_page_ids
|
||||
|
||||
def navigate_to_url(self, source_id, page_id):
|
||||
url_to_navigate = "autStand/Detailed_Views/%s" % (page_id)
|
||||
system.perspective.navigate(view=url_to_navigate, params={"highlightTagPath": source_id + "||Diagnostic"})
|
||||
|
||||
def source_id_lookup(self, source_id):
|
||||
"""
|
||||
Finds page_id from global_project_page_ids by source_id or by hierarchy,
|
||||
then navigates.
|
||||
"""
|
||||
if not source_id:
|
||||
return
|
||||
|
||||
page_id = global_project_page_ids.get(source_id)
|
||||
found = False
|
||||
|
||||
if page_id:
|
||||
found = True
|
||||
navigate_to_url(self, source_id, page_id)
|
||||
else:
|
||||
# Walk hierarchy upwards until we find a match
|
||||
items = source_id.split("/")
|
||||
while len(items) > 1:
|
||||
items.pop()
|
||||
source_id = "/".join(items)
|
||||
page_id = global_project_page_ids.get(source_id)
|
||||
if page_id:
|
||||
found = True
|
||||
navigate_to_url(self, source_id, page_id)
|
||||
break
|
||||
|
||||
if not found:
|
||||
open_pop_up("No page id found")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 68 KiB |
@ -0,0 +1,264 @@
|
||||
{
|
||||
"custom": {
|
||||
"state": 0,
|
||||
"string": "Clear"
|
||||
},
|
||||
"params": {
|
||||
"tagProps": [
|
||||
3,
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value"
|
||||
]
|
||||
},
|
||||
"propConfig": {
|
||||
"custom.state": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"fallbackDelay": 1,
|
||||
"mode": "indirect",
|
||||
"references": {
|
||||
"0": "{view.params.tagProps[0]}",
|
||||
"fc": "{session.custom.fc}"
|
||||
},
|
||||
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/State"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "coalesce({value},0)",
|
||||
"type": "expression"
|
||||
}
|
||||
],
|
||||
"type": "tag"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.string": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.state"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": "Clear",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 1,
|
||||
"output": "Clear"
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": "Blocked"
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": "Disabled"
|
||||
},
|
||||
{
|
||||
"input": 4,
|
||||
"output": "Jammed"
|
||||
}
|
||||
],
|
||||
"outputType": "scalar",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"params.tagProps": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"defaultSize": {
|
||||
"height": 42,
|
||||
"width": 98
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "Photoeye"
|
||||
},
|
||||
"position": {
|
||||
"height": 1,
|
||||
"width": 1
|
||||
},
|
||||
"propConfig": {
|
||||
"props.elements[0].fill.paint": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.state"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": "#00FF00",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 0,
|
||||
"output": "#00FF00"
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": "#000000"
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": "#800080"
|
||||
},
|
||||
{
|
||||
"input": 4,
|
||||
"output": "#FF0000"
|
||||
}
|
||||
],
|
||||
"outputType": "color",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.elements[2].fill.paint": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.state"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": "#00FF00",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 0,
|
||||
"output": "#00FF00"
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": "#000000"
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": "#800080"
|
||||
},
|
||||
{
|
||||
"input": 4,
|
||||
"output": "#FF0000"
|
||||
}
|
||||
],
|
||||
"outputType": "color",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"elements": [
|
||||
{
|
||||
"d": "m 28.763932,20 -20,10 V 10 Z",
|
||||
"fill": {},
|
||||
"name": "path",
|
||||
"stroke": {
|
||||
"paint": "#000000",
|
||||
"width": "2"
|
||||
},
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"stroke": {
|
||||
"paint": "#000000",
|
||||
"width": "2"
|
||||
},
|
||||
"stroke-dasharray": "4,4",
|
||||
"type": "line",
|
||||
"x1": "30",
|
||||
"x2": "60",
|
||||
"y1": "20",
|
||||
"y2": "20"
|
||||
},
|
||||
{
|
||||
"fill": {},
|
||||
"height": "20",
|
||||
"stroke": {
|
||||
"paint": "#000000",
|
||||
"width": "2"
|
||||
},
|
||||
"type": "rect",
|
||||
"width": "6",
|
||||
"x": "60",
|
||||
"y": "10"
|
||||
}
|
||||
],
|
||||
"preserveAspectRatio": "none",
|
||||
"style": {
|
||||
"boxShadow": "value"
|
||||
},
|
||||
"viewBox": "0 0 80 40"
|
||||
},
|
||||
"type": "ia.shapes.svg"
|
||||
}
|
||||
],
|
||||
"events": {
|
||||
"dom": {
|
||||
"onClick": {
|
||||
"config": {
|
||||
"script": "\tsystem.perspective.openDock(\u0027Docked-East-Photoeye\u0027,params\u003d{\u0027tagProps\u0027:self.view.params.tagProps})"
|
||||
},
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
},
|
||||
"onMouseEnter": {
|
||||
"config": {
|
||||
"script": "\tfrom time import sleep\n\n\talarm \u003d []\n\tmessage \u003d None\n\n\tsleep(0.5)\n\n\tif system.tag.exists(\"System/aws_data\"):\n\t\tif self.view.params.tagProps[0] !\u003d \"\":\n\t\t\ttags_to_read \u003d system.tag.readBlocking(\"System/aws_data\")\n\t\t\tdecode_alarm_data \u003d system.util.jsonDecode(tags_to_read[0].value)\n\t\t\talarm \u003d [decode_alarm_data[i] for i in decode_alarm_data\n\t\t\t\t\tif decode_alarm_data[i][\u0027sourceId\u0027].startswith(self.view.params.tagProps[0])]\n\t\tif alarm:\n\t\t\talarm \u003d sorted(alarm, key \u003d lambda t:t[\u0027timestamp\u0027], reverse\u003dTrue)\n\t\t\tmessage \u003d max(alarm, key \u003d lambda p:p[\u0027priority\u0027]).get(\u0027message\u0027)\n\t\t\tif len(alarm) \u003e 1:\n\t\t\t\tmessage +\u003d \" (+\" + str(len(alarm)-1) + \")\"\n\tself.view.custom.alarm_message \u003d message"
|
||||
},
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
}
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"name": "root",
|
||||
"tooltip": {
|
||||
"enabled": true
|
||||
}
|
||||
},
|
||||
"propConfig": {
|
||||
"meta.tooltip.text": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "\"Source Id: \" + {view.params.tagProps[0]} + \", Status: \" + {view.custom.string}\n"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
},
|
||||
"meta.visible": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "session.custom.alarm_filter.show_photoeyes"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"mode": "percent",
|
||||
"style": {
|
||||
"cursor": "pointer"
|
||||
}
|
||||
},
|
||||
"type": "ia.container.coord"
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
After Width: | Height: | Size: 123 KiB |
Loading…
x
Reference in New Issue
Block a user