332 lines
20 KiB
Plaintext
332 lines
20 KiB
Plaintext
{
|
|
"custom": {
|
|
"State": "#FFFFFF",
|
|
"Status": "#808080",
|
|
"state_string": "Empty/Idle",
|
|
"status_string": "Unknown Status"
|
|
},
|
|
"params": {
|
|
"angle": 0,
|
|
"directionLeft": false,
|
|
"tagProps": [
|
|
"System/MCM01/Conveyor/VFD/UL1_3_VFD1",
|
|
"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}/dwState"
|
|
},
|
|
"transforms": [
|
|
{
|
|
"expression": "coalesce({value},{view.params.forceFaultStatus},0)",
|
|
"type": "expression"
|
|
},
|
|
{
|
|
"code": "\tif value is None:\n\t\treturn \u0027#808080\u0027 # Grey - No Data\n\t\n\t# Check bits in priority order (highest priority first)\n\t\n\t# Priority 5 - Test/Maintenance - Brown\n\tif value \u0026 128: # Bit 7: Assigned to do a tilttest\n\t\treturn \u0027#AC5F00\u0027 # Brown - Manual/Maintenance Mode\n\t\n\t# Priority 8 - Operational Status - Green\n\tif value \u0026 256: # Bit 8: Occupied\n\t\treturn \u0027#008000\u0027 # Green - Running or ON\n\t\n\t# Priority 9 - Discharge Status - Light Green\n\tif value \u0026 8: # Bit 3: Item has been discharged\n\t\treturn \u0027#CCFFCC\u0027 # Light green - Enabled, not running\n\t\n\t# Critical/Error States - Red\n\tif value \u0026 1: # Bit 0: Disabled or faulted\n\t\treturn \u0027#FF0000\u0027 # Red - E-Stop/Unit Faulted\n\tif value \u0026 2048: # Bit 11: Occupied but disabled\n\t\treturn \u0027#FF0000\u0027 # Red - E-Stop/Unit Faulted\n\t\n\t# Active Processing States - Yellow\n\tif value \u0026 2: # Bit 1: Item being scanned by Barcode/OCR\n\t\treturn \u0027#FFFF00\u0027 # Yellow - 75% Full/50% Full/25% Full\n\tif value \u0026 4: # Bit 2: Scanned, waiting for redirect\n\t\treturn \u0027#FFFF00\u0027 # Yellow - 75% Full/50% Full/25% Full\n\tif value \u0026 16384: # Bit 14: Item being scanned by volume scanner\n\t\treturn \u0027#FFFF00\u0027 # Yellow - 75% Full/50% Full/25% Full\n\tif value \u0026 32768: # Bit 15: SPS checking carrier\n\t\treturn \u0027#FFFF00\u0027 # Yellow - 75% Full/50% Full/25% Full\n\t\n\t# Multi-carrier Operations - Blue\n\tif value \u0026 16: # Bit 4: Second or third carrier in row\n\t\treturn \u0027#0000FF\u0027 # Blue - 100% Full\n\tif value \u0026 64: # Bit 6: Part of multi-carrier item\n\t\treturn \u0027#0000FF\u0027 # Blue - 100% Full\n\t\n\t# System/Communication States - Light Sky Blue\n\tif value \u0026 512: # Bit 9: Information received from CSC/host\n\t\treturn \u0027#87CEFA\u0027 # Light Sky Blue - Energy management\n\tif value \u0026 1024: # Bit 10: Received from CCB\n\t\treturn \u0027#87CEFA\u0027 # Light Sky Blue - Energy management\n\tif value \u0026 4096: # Bit 12: Reserved for induction takeover\n\t\treturn \u0027#87CEFA\u0027 # Light Sky Blue - Energy management\n\tif value \u0026 8192: # Bit 13: Not activated for profile execution\n\t\treturn \u0027#87CEFA\u0027 # Light Sky Blue - Energy management\n\t\n\t# Special Equipment States - Light Grey\n\tif value \u0026 32: # Bit 5: Used at flipper door chutes\n\t\treturn \u0027#D3D3D3\u0027 # Light grey - OFF/Inactive\n\t\n\t# Check if bits 16-31 contain distance data\n\tdistance_bits \u003d (value \u003e\u003e 16) \u0026 0xFFFF # Extract upper 16 bits\n\tif distance_bits \u003e 0:\n\t\treturn \u0027#FFA500\u0027 # Orange - JAM (item positioning)\n\t\n\t# Default state\n\tif value \u003d\u003d 0:\n\t\treturn \u0027#FFFFFF\u0027 # White - Gravity/not motorized MHE\n\telse:\n\t\treturn \u0027#808080\u0027 # Grey - Invalid/Unavailable",
|
|
"type": "script"
|
|
}
|
|
],
|
|
"type": "tag"
|
|
},
|
|
"persistent": true
|
|
},
|
|
"custom.Status": {
|
|
"binding": {
|
|
"config": {
|
|
"fallbackDelay": 2.5,
|
|
"mode": "indirect",
|
|
"references": {
|
|
"0": "{view.params.tagProps[0]}",
|
|
"fc": "{session.custom.fc}"
|
|
},
|
|
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/dwStatus"
|
|
},
|
|
"transforms": [
|
|
{
|
|
"expression": "coalesce({value},{view.params.forceFaultStatus},0)",
|
|
"type": "expression"
|
|
},
|
|
{
|
|
"code": "\tif value is None:\n\t\treturn \u0027#808080\u0027\n\t\n\t# Critical Priority (2) - Red\n\tif value \u0026 8: # Bit 3: Common fault\n\t\treturn \u0027#FF0000\u0027\n\tif value \u0026 32: # Bit 5: Possible TCB/MCB error\n\t\treturn \u0027#FF0000\u0027\n\tif value \u0026 64: # Bit 6: Not checked at last CTB/CRB\n\t\treturn \u0027#FF0000\u0027\n\tif value \u0026 128: # Bit 7: Communication error\n\t\treturn \u0027#FF0000\u0027\n\tif value \u0026 512: # Bit 9: Current limit exceeded\n\t\treturn \u0027#FF0000\u0027\n\tif value \u0026 2048: # Bit 11: Calibration error\n\t\treturn \u0027#FF0000\u0027\n\tif value \u0026 4194304: # Bit 22: Item overhanging belt fault\n\t\treturn \u0027#FF0000\u0027\n\tif value \u0026 8388608: # Bit 23: Current collector fault\n\t\treturn \u0027#FF0000\u0027\n\tif value \u0026 16777216: # Bit 24: Item too high\n\t\treturn \u0027#FF0000\u0027\n\tif value \u0026 33554432: # Bit 25: Item too wide\n\t\treturn \u0027#FF0000\u0027\n\tif value \u0026 67108864: # Bit 26: Item on activated carrier\n\t\treturn \u0027#FF0000\u0027\n\tif value \u0026 134217728: # Bit 27: Deflected bellows fault\n\t\treturn \u0027#FF0000\u0027\n\tif value \u0026 1073741824: # Bit 30: Item on bellows warning\n\t\treturn \u0027#FF0000\u0027\n\tif value \u0026 2147483648: # Bit 31: Item on bellows is active\n\t\treturn \u0027#FF0000\u0027\n\t\n\t# High Priority (11) - Light Grey (OFF/Inactive)\n\tif value \u0026 1: # Bit 0: Disabled\n\t\treturn \u0027#D3D3D3\u0027\n\tif value \u0026 4: # Bit 2: Blocked\n\t\treturn \u0027#D900D9\u0027 # Purple - Gridlock Prevention Mode\n\t\n\t# Medium Priority (9-10) - Status OK, Motor not running\n\tif value \u0026 256: # Bit 8: Status OK\n\t\treturn \u0027#008000\u0027 # Green - Running or ON\n\tif value \u0026 1024: # Bit 10: Motor not running\n\t\treturn \u0027#CCFFCC\u0027 # Light green - Enabled, not running\n\tif value \u0026 268435456: # Bit 28: Double maximum recirculation\n\t\treturn \u0027#87CEFA\u0027 # Light Sky Blue - Energy management\n\t\n\t# Low Priority (5) - Brown (Manual/Maintenance Mode)\n\tif value \u0026 2: # Bit 1: Needs update\n\t\treturn \u0027#AC5F00\u0027\n\tif value \u0026 16: # Bit 4: CCT communication to carrier\n\t\treturn \u0027#AC5F00\u0027\n\tif value \u0026 8192: # Bit 13: Default configuration\n\t\treturn \u0027#AC5F00\u0027\n\tif value \u0026 16384: # Bit 14: Programming mode\n\t\treturn \u0027#AC5F00\u0027\n\tif value \u0026 536870912: # Bit 29: CCT download done\n\t\treturn \u0027#AC5F00\u0027\n\t\n\t# Default - Grey\n\treturn \u0027#808080\u0027",
|
|
"type": "script"
|
|
}
|
|
],
|
|
"type": "tag"
|
|
},
|
|
"persistent": true
|
|
},
|
|
"custom.state_string": {
|
|
"binding": {
|
|
"config": {
|
|
"fallbackDelay": 2.5,
|
|
"mode": "indirect",
|
|
"references": {
|
|
"0": "{view.params.tagProps[0]}",
|
|
"fc": "{session.custom.fc}"
|
|
},
|
|
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/dwState"
|
|
},
|
|
"transforms": [
|
|
{
|
|
"expression": "coalesce({value},{view.params.forceFaultStatus},0)",
|
|
"type": "expression"
|
|
},
|
|
{
|
|
"code": "\tif value is None:\n\t\treturn \u0027No Data\u0027\n\t\n\t# Check bits in priority order (highest priority first)\n\t\n\t# Priority 5 - Test/Maintenance\n\tif value \u0026 128: # Bit 7: Assigned to do a tilttest\n\t\treturn \u0027Tilt Test Mode\u0027\n\t\n\t# Priority 8 - Operational Status\n\tif value \u0026 256: # Bit 8: Occupied\n\t\treturn \u0027Occupied\u0027\n\t\n\t# Priority 9 - Discharge Status\n\tif value \u0026 8: # Bit 3: Item has been discharged\n\t\treturn \u0027Item Discharged\u0027\n\t\n\t# Other operational states (no specific priority)\n\tif value \u0026 1: # Bit 0: Disabled or faulted\n\t\treturn \u0027Disabled/Faulted\u0027\n\tif value \u0026 2: # Bit 1: Item being scanned by Barcode/OCR\n\t\treturn \u0027Barcode Scanning\u0027\n\tif value \u0026 4: # Bit 2: Scanned, waiting for redirect\n\t\treturn \u0027Awaiting Redirect\u0027\n\tif value \u0026 16: # Bit 4: Second or third carrier in row\n\t\treturn \u0027Multi-Carrier Row\u0027\n\tif value \u0026 32: # Bit 5: Used at flipper door chutes\n\t\treturn \u0027Flipper Door Mode\u0027\n\tif value \u0026 64: # Bit 6: Part of multi-carrier item\n\t\treturn \u0027Multi-Carrier Item\u0027\n\tif value \u0026 512: # Bit 9: Information received from CSC/host\n\t\treturn \u0027Host Data Received\u0027\n\tif value \u0026 1024: # Bit 10: Received from CCB\n\t\treturn \u0027CCB Received\u0027\n\tif value \u0026 2048: # Bit 11: Occupied but disabled\n\t\treturn \u0027Occupied/Disabled\u0027\n\tif value \u0026 4096: # Bit 12: Reserved for induction takeover\n\t\treturn \u0027Induction Reserved\u0027\n\tif value \u0026 8192: # Bit 13: Not activated for profile execution\n\t\treturn \u0027Profile Inactive\u0027\n\tif value \u0026 16384: # Bit 14: Item being scanned by volume scanner\n\t\treturn \u0027Volume Scanning\u0027\n\tif value \u0026 32768: # Bit 15: SPS checking carrier\n\t\treturn \u0027SPS Checking\u0027\n\t\n\t# Check if bits 16-31 contain distance data\n\tdistance_bits \u003d (value \u003e\u003e 16) \u0026 0xFFFF # Extract upper 16 bits\n\tif distance_bits \u003e 0:\n\t\treturn \u0027Item Distance: \u0027 + str(distance_bits)\n\t\n\t# Default state\n\tif value \u003d\u003d 0:\n\t\treturn \u0027Empty/Idle\u0027\n\telse:\n\t\treturn \u0027State: \u0027 + str(value)",
|
|
"type": "script"
|
|
}
|
|
],
|
|
"type": "tag"
|
|
},
|
|
"persistent": true
|
|
},
|
|
"custom.status_string": {
|
|
"binding": {
|
|
"config": {
|
|
"fallbackDelay": 2.5,
|
|
"mode": "indirect",
|
|
"references": {
|
|
"0": "{view.params.tagProps[0]}",
|
|
"fc": "{session.custom.fc}"
|
|
},
|
|
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/dwStatus"
|
|
},
|
|
"transforms": [
|
|
{
|
|
"expression": "coalesce({value},{view.params.forceFaultStatus},0)",
|
|
"type": "expression"
|
|
},
|
|
{
|
|
"code": "\tif value is None:\n\t\treturn \u0027No Data\u0027\n\t\n\t# Critical Priority (2) - Errors and Faults\n\tif value \u0026 8: # Bit 3: Common fault\n\t\treturn \u0027Common fault\u0027\n\tif value \u0026 32: # Bit 5: Possible TCB/MCB error\n\t\treturn \u0027Possible TCB/MCB error\u0027\n\tif value \u0026 64: # Bit 6: Not checked at last CTB/CRB\n\t\treturn \u0027Not checked at last CTB/CRB\u0027\n\tif value \u0026 128: # Bit 7: Communication error\n\t\treturn \u0027Communication error\u0027\n\tif value \u0026 512: # Bit 9: Current limit exceeded\n\t\treturn \u0027Current limit exceeded\u0027\n\tif value \u0026 2048: # Bit 11: Calibration error\n\t\treturn \u0027Calibration error\u0027\n\tif value \u0026 4194304: # Bit 22: Item overhanging belt fault\n\t\treturn \u0027Item overhanging belt fault\u0027\n\tif value \u0026 8388608: # Bit 23: Current collector fault\n\t\treturn \u0027Current collector fault\u0027\n\tif value \u0026 16777216: # Bit 24: Item too high\n\t\treturn \u0027Item too high\u0027\n\tif value \u0026 33554432: # Bit 25: Item too wide\n\t\treturn \u0027Item too wide\u0027\n\tif value \u0026 67108864: # Bit 26: Item on activated carrier\n\t\treturn \u0027Item on activated carrier\u0027\n\tif value \u0026 134217728: # Bit 27: Deflected bellows fault\n\t\treturn \u0027Deflected bellows fault\u0027\n\tif value \u0026 1073741824: # Bit 30: Item on bellows warning\n\t\treturn \u0027Item on bellows warning\u0027\n\tif value \u0026 2147483648: # Bit 31: Item on bellows is active\n\t\treturn \u0027Item on bellows is active\u0027\n\t\n\t# High Priority (11) - Disabled/Blocked States\n\tif value \u0026 1: # Bit 0: Disabled\n\t\treturn \u0027Disabled\u0027\n\tif value \u0026 4: # Bit 2: Blocked\n\t\treturn \u0027Blocked\u0027\n\t\n\t# Medium Priority (9-10) - Normal Operations\n\tif value \u0026 256: # Bit 8: Status OK\n\t\treturn \u0027Status OK\u0027\n\tif value \u0026 1024: # Bit 10: Motor not running\n\t\treturn \u0027Motor not running\u0027\n\tif value \u0026 268435456: # Bit 28: Double maximum recirculation\n\t\treturn \u0027Double maximum recirculation\u0027\n\t\n\t# Low Priority (5) - Maintenance/Configuration\n\tif value \u0026 2: # Bit 1: Needs update\n\t\treturn \u0027Needs update\u0027\n\tif value \u0026 16: # Bit 4: CCT communication to carrier\n\t\treturn \u0027CCT communication to carrier\u0027\n\tif value \u0026 8192: # Bit 13: Default configuration\n\t\treturn \u0027Default configuration\u0027\n\tif value \u0026 16384: # Bit 14: Programming mode\n\t\treturn \u0027Programming mode\u0027\n\tif value \u0026 536870912: # Bit 29: CCT download done\n\t\treturn \u0027CCT download done\u0027\n\t\n\t# Default - No active status\n\treturn \u0027Unknown Status\u0027",
|
|
"type": "script"
|
|
}
|
|
],
|
|
"type": "tag"
|
|
},
|
|
"persistent": true
|
|
},
|
|
"params.angle": {
|
|
"paramDirection": "input",
|
|
"persistent": true
|
|
},
|
|
"params.directionLeft": {
|
|
"paramDirection": "input",
|
|
"persistent": true
|
|
},
|
|
"params.tagProps": {
|
|
"paramDirection": "inout",
|
|
"persistent": true
|
|
}
|
|
},
|
|
"props": {
|
|
"defaultSize": {
|
|
"height": 20,
|
|
"width": 50
|
|
}
|
|
},
|
|
"root": {
|
|
"children": [
|
|
{
|
|
"meta": {
|
|
"name": "RunningStatus"
|
|
},
|
|
"position": {
|
|
"grow": 1
|
|
},
|
|
"propConfig": {
|
|
"props.elements[0].fill.paint": {
|
|
"binding": {
|
|
"config": {
|
|
"path": "view.custom.Status"
|
|
},
|
|
"type": "property"
|
|
}
|
|
}
|
|
},
|
|
"props": {
|
|
"elements": [
|
|
{
|
|
"d": "M 5 1 L 55 1 L 55 17 L 5 17 Z ",
|
|
"fill": {},
|
|
"name": "carrierFrame",
|
|
"stroke": {
|
|
"paint": "#34495E",
|
|
"width": "0.5"
|
|
},
|
|
"type": "path"
|
|
},
|
|
{
|
|
"d": "M 7 2 L 53 2 L 53 16 L 7 16 Z ",
|
|
"fill": {
|
|
"paint": "#3498DB"
|
|
},
|
|
"name": "carrierTray",
|
|
"type": "path"
|
|
},
|
|
{
|
|
"cx": "12",
|
|
"cy": "9",
|
|
"fill": {
|
|
"paint": "#E74C3C"
|
|
},
|
|
"name": "leftSensor",
|
|
"r": "1.5",
|
|
"type": "circle"
|
|
},
|
|
{
|
|
"cx": "48",
|
|
"cy": "9",
|
|
"fill": {
|
|
"paint": "#E74C3C"
|
|
},
|
|
"name": "rightSensor",
|
|
"r": "1.5",
|
|
"type": "circle"
|
|
},
|
|
{
|
|
"fill": {
|
|
"paint": "#95A5A6"
|
|
},
|
|
"height": "10",
|
|
"name": "package",
|
|
"rx": "1",
|
|
"type": "rect",
|
|
"width": "20",
|
|
"x": "20",
|
|
"y": "4"
|
|
},
|
|
{
|
|
"cx": "10",
|
|
"cy": "3",
|
|
"fill": {
|
|
"paint": "#1ABC9C"
|
|
},
|
|
"name": "topLeftWheel",
|
|
"r": "1",
|
|
"type": "circle"
|
|
},
|
|
{
|
|
"cx": "10",
|
|
"cy": "15",
|
|
"fill": {
|
|
"paint": "#1ABC9C"
|
|
},
|
|
"name": "bottomLeftWheel",
|
|
"r": "1",
|
|
"type": "circle"
|
|
},
|
|
{
|
|
"cx": "50",
|
|
"cy": "3",
|
|
"fill": {
|
|
"paint": "#1ABC9C"
|
|
},
|
|
"name": "topRightWheel",
|
|
"r": "1",
|
|
"type": "circle"
|
|
},
|
|
{
|
|
"cx": "50",
|
|
"cy": "15",
|
|
"fill": {
|
|
"paint": "#1ABC9C"
|
|
},
|
|
"name": "bottomRightWheel",
|
|
"r": "1",
|
|
"type": "circle"
|
|
}
|
|
],
|
|
"preserveAspectRatio": "none",
|
|
"style": {
|
|
"overflow": "hidden",
|
|
"transform": ""
|
|
},
|
|
"viewBox": "-1.5 -1.5 60 20"
|
|
},
|
|
"type": "ia.shapes.svg"
|
|
}
|
|
],
|
|
"events": {
|
|
"dom": {
|
|
"onClick": {
|
|
"config": {
|
|
"script": "\tsystem.perspective.openDock(\u0027Docked-East-VFD\u0027,params\u003d{\u0027tagProps\u0027:self.view.params.tagProps})"
|
|
},
|
|
"scope": "G",
|
|
"type": "script"
|
|
},
|
|
"onDoubleClick": {
|
|
"config": {
|
|
"script": "\ttagProps \u003d self.view.params.tagProps\n\tsystem.perspective.openPopup(\"StatusPopUP\", \"PopUp-Views/Controller-Equipment/Information\", params \u003d{\"tagProps\":tagProps})\n\t"
|
|
},
|
|
"enabled": false,
|
|
"scope": "G",
|
|
"type": "script"
|
|
},
|
|
"onMouseEnter": {
|
|
"config": {
|
|
"script": "\tself.props.style.transform \u003d \"scale(2)\"\n\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"
|
|
},
|
|
"onMouseLeave": {
|
|
"config": {
|
|
"script": "\tself.props.style.transform \u003d \"scale(1)\""
|
|
},
|
|
"scope": "G",
|
|
"type": "script"
|
|
}
|
|
}
|
|
},
|
|
"meta": {
|
|
"name": "root",
|
|
"tooltip": {
|
|
"enabled": true,
|
|
"location": "top-left",
|
|
"style": {
|
|
"classes": "Alarms-Styles/NoAlarm"
|
|
}
|
|
}
|
|
},
|
|
"propConfig": {
|
|
"meta.tooltip.text": {
|
|
"binding": {
|
|
"config": {
|
|
"expression": "if(\n {view.custom.status_string} !\u003d \"Unknown Status\",\n \"Source Id: \" + {view.params.tagProps[0]} + \" Status: \" + {view.custom.status_string} + \" State: \" + {view.custom.state_string},\n \"Device Disconnected\"\n)\n"
|
|
},
|
|
"type": "expr"
|
|
}
|
|
}
|
|
},
|
|
"props": {
|
|
"justify": "center",
|
|
"style": {
|
|
"borderColor": "#FF0000",
|
|
"borderStyle": "none",
|
|
"borderWidth": "2px",
|
|
"cursor": "pointer",
|
|
"transform": "scale(1)",
|
|
"transition": "transform 100ms linear"
|
|
}
|
|
},
|
|
"type": "ia.container.flex"
|
|
}
|
|
} |