BNA8/.resources/930b262975765ae2b54b813442daf60421756f5173b5778dea23bd97b81f72d1
Salijoghli f38f97fee0 fixes
2025-10-07 19:20:00 +04:00

297 lines
20 KiB
Plaintext

{
"custom": {
"State": "#FFFFFF",
"Status": "#808080",
"state_string": "Empty/Idle",
"status_string": "Unknown Status"
},
"params": {
"tagProps": [
"Status/Carriers/Carrier_100",
"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}"
},
"transforms": [
{
"code": "\tif value is None:\n\t\treturn \u0027#808080\u0027 # Grey - No Data\n\t\n\t# Priority 2 - Critical Faults - Red\n\tif (value.get(\u0027bCommonFault\u0027, False) or value.get(\u0027bTCBMCBError\u0027, False) or\n\t value.get(\u0027bNotCheckedCTBCRB\u0027, False) or value.get(\u0027bCommunicationError\u0027, False) or\n\t value.get(\u0027bCurrentLimitExceeded\u0027, False) or value.get(\u0027bCalibrationError\u0027, False) or\n\t value.get(\u0027bItemOverhangingBeltFault\u0027, False) or value.get(\u0027bCurrentCollectorFault\u0027, False) or\n\t value.get(\u0027bItemTooHigh\u0027, False) or value.get(\u0027bItemTooWide\u0027, False) or\n\t value.get(\u0027bItemOnActivatedCarrier\u0027, False) or value.get(\u0027bDeflectedBellowsFault\u0027, False) or\n\t value.get(\u0027bItemOnBellowsWarning\u0027, False) or value.get(\u0027bItemOnBellowsActive\u0027, False)):\n\t\treturn \u0027#FF0000\u0027 # Red - E-Stop/Unit Faulted\n\t\n\t# Critical State Faults - Red\n\tif value.get(\u0027bDisabledOrFaulted\u0027, False):\n\t\treturn \u0027#FF0000\u0027 # Red - E-Stop/Unit Faulted\n\t\n\t# Priority 5 - Test/Maintenance - Brown\n\tif (value.get(\u0027bNeedsUpdate\u0027, False) or value.get(\u0027bCCTCommunication\u0027, False) or\n\t value.get(\u0027bDefaultConfiguration\u0027, False) or value.get(\u0027bProgrammingMode\u0027, False) or\n\t value.get(\u0027bCCTDownloadDone\u0027, False) or value.get(\u0027bAssignedToTiltTest\u0027, False)):\n\t\treturn \u0027#AC5F00\u0027 # Brown - Manual/Maintenance Mode\n\t\n\t# Priority 8 - Occupied - Green\n\tif value.get(\u0027bOccupied\u0027, False):\n\t\treturn \u0027#008000\u0027 # Green - Running or ON\n\t\n\t# Priority 9 - Operational Status - Green or Light Green\n\tif value.get(\u0027bStatusOK\u0027, False):\n\t\treturn \u0027#008000\u0027 # Green - Running or ON\n\tif value.get(\u0027bItemDischarged\u0027, False):\n\t\treturn \u0027#CCFFCC\u0027 # Light green - Enabled, not running\n\tif value.get(\u0027bMotorNotRunning\u0027, False):\n\t\treturn \u0027#CCFFCC\u0027 # Light green - Enabled, not running\n\t\n\t# Priority 10 - Energy Management - Light Sky Blue\n\tif value.get(\u0027bDoubleMaxRecirculation\u0027, False):\n\t\treturn \u0027#87CEFA\u0027 # Light Sky Blue - Energy management\n\t\n\t# Priority 11 - High Priority Issues\n\tif value.get(\u0027bDisabled\u0027, False):\n\t\treturn \u0027#D3D3D3\u0027 # Light grey - OFF/Inactive\n\tif value.get(\u0027bBlocked\u0027, False):\n\t\treturn \u0027#D900D9\u0027 # Purple - Gridlock Prevention Mode\n\t\n\t# Active Processing States - Yellow\n\tif (value.get(\u0027bItemBeingScannedBarcode\u0027, False) or value.get(\u0027bItemScannedWaitingRedirect\u0027, False) or\n\t value.get(\u0027bItemBeingScannedVolume\u0027, False) or value.get(\u0027bSPSCheckingCarrier\u0027, False)):\n\t\treturn \u0027#FFFF00\u0027 # Yellow - 75%/50%/25% Full\n\t\n\t# System/Communication States - Light Sky Blue\n\tif (value.get(\u0027bInfoReceivedFromCSC\u0027, False) or value.get(\u0027bReceivedFromCCB\u0027, False) or\n\t value.get(\u0027bReservedForInductionTakeover\u0027, False) or value.get(\u0027bNotActivatedForProfile\u0027, False)):\n\t\treturn \u0027#87CEFA\u0027 # Light Sky Blue - Energy management\n\t\n\t# Multi-carrier Operations - Blue\n\tif (value.get(\u0027bSecondThirdCarrierInRow\u0027, False) or value.get(\u0027bPartOfMultiCarrierItem\u0027, False)):\n\t\treturn \u0027#0000FF\u0027 # Blue - 100% Full\n\t\n\t# Check distance data\n\tif value.get(\u0027iRelativeDistance\u0027, 0) \u003e 0:\n\t\treturn \u0027#FFA500\u0027 # Orange - JAM (item positioning)\n\t\n\t# Default state - White (Empty/Idle)\n\treturn \u0027#FFFFFF\u0027 # White - Gravity/not motorized MHE",
"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}"
},
"transforms": [
{
"code": "\tif value is None:\n\t\treturn \u0027#808080\u0027\n\t\n\t# Priority-based status determination (lower number \u003d higher priority)\n\tactive_status \u003d \u0027default\u0027\n\t\n\t# Check in priority order (highest to lowest)\n\t# Priority 2 - Critical\n\tif (value.get(\u0027bCommonFault\u0027, False) or value.get(\u0027bTCBMCBError\u0027, False) or \n\t value.get(\u0027bNotCheckedCTBCRB\u0027, False) or value.get(\u0027bCommunicationError\u0027, False) or\n\t value.get(\u0027bCurrentLimitExceeded\u0027, False) or value.get(\u0027bCalibrationError\u0027, False) or\n\t value.get(\u0027bItemOverhangingBeltFault\u0027, False) or value.get(\u0027bCurrentCollectorFault\u0027, False) or\n\t value.get(\u0027bItemTooHigh\u0027, False) or value.get(\u0027bItemTooWide\u0027, False) or\n\t value.get(\u0027bItemOnActivatedCarrier\u0027, False) or value.get(\u0027bDeflectedBellowsFault\u0027, False) or\n\t value.get(\u0027bItemOnBellowsWarning\u0027, False) or value.get(\u0027bItemOnBellowsActive\u0027, False)):\n\t\tactive_status \u003d \u0027critical_fault\u0027\n\t# Priority 5 - Low/Maintenance\n\telif (value.get(\u0027bNeedsUpdate\u0027, False) or value.get(\u0027bCCTCommunication\u0027, False) or\n\t value.get(\u0027bDefaultConfiguration\u0027, False) or value.get(\u0027bProgrammingMode\u0027, False) or\n\t value.get(\u0027bCCTDownloadDone\u0027, False)):\n\t\tactive_status \u003d \u0027maintenance_mode\u0027\n\t# Priority 9 - Medium-High\n\telif value.get(\u0027bStatusOK\u0027, False):\n\t\tactive_status \u003d \u0027status_ok\u0027\n\telif value.get(\u0027bMotorNotRunning\u0027, False):\n\t\tactive_status \u003d \u0027motor_not_running\u0027\n\t# Priority 10 - Medium\n\telif value.get(\u0027bDoubleMaxRecirculation\u0027, False):\n\t\tactive_status \u003d \u0027recirculation\u0027\n\t# Priority 11 - High\n\telif value.get(\u0027bDisabled\u0027, False):\n\t\tactive_status \u003d \u0027disabled\u0027\n\telif value.get(\u0027bBlocked\u0027, False):\n\t\tactive_status \u003d \u0027blocked\u0027\n\t\n\t# Dictionary-based switch for color mapping\n\tcolor_map \u003d {\n\t\t\u0027critical_fault\u0027: \u0027#FF0000\u0027, # Red - Critical errors/faults\n\t\t\u0027maintenance_mode\u0027: \u0027#AC5F00\u0027, # Brown - Manual/Maintenance mode\n\t\t\u0027status_ok\u0027: \u0027#008000\u0027, # Green - Running or ON\n\t\t\u0027motor_not_running\u0027: \u0027#CCFFCC\u0027, # Light Green - Enabled, not running\n\t\t\u0027recirculation\u0027: \u0027#87CEFA\u0027, # Light Sky Blue - Energy management\n\t\t\u0027disabled\u0027: \u0027#D3D3D3\u0027, # Light Grey - OFF/Inactive\n\t\t\u0027blocked\u0027: \u0027#D900D9\u0027, # Purple - Gridlock Prevention\n\t\t\u0027default\u0027: \u0027#808080\u0027 # Grey - Default/Invalid\n\t}\n\t\n\t# Return color using dictionary lookup\n\treturn color_map.get(active_status, \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.tagProps": {
"paramDirection": "inout",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 50,
"width": 20
}
},
"root": {
"children": [
{
"meta": {
"name": "RunningStatus"
},
"position": {
"grow": 1
},
"props": {
"elements": [
{
"d": "M 1 5 L 17 5 L 17 55 L 1 55 Z ",
"fill": {
"paint": "#2C3E50"
},
"name": "carrierFrame",
"stroke": {
"paint": "#34495E",
"width": "0.5"
},
"type": "path"
},
{
"d": "M 2 7 L 16 7 L 16 53 L 2 53 Z ",
"fill": {
"paint": "#3498DB"
},
"name": "carrierTray",
"type": "path"
},
{
"cx": "9",
"cy": "12",
"fill": {
"paint": "#E74C3C"
},
"name": "topSensor",
"r": "1.5",
"type": "circle"
},
{
"cx": "9",
"cy": "48",
"fill": {
"paint": "#E74C3C"
},
"name": "bottomSensor",
"r": "1.5",
"type": "circle"
},
{
"fill": {
"paint": "#95A5A6"
},
"height": "20",
"name": "package",
"rx": "1",
"type": "rect",
"width": "10",
"x": "4",
"y": "20"
},
{
"cx": "3",
"cy": "10",
"fill": {
"paint": "#1ABC9C"
},
"name": "topLeftWheel",
"r": "1",
"type": "circle"
},
{
"cx": "15",
"cy": "10",
"fill": {
"paint": "#1ABC9C"
},
"name": "topRightWheel",
"r": "1",
"type": "circle"
},
{
"cx": "3",
"cy": "50",
"fill": {
"paint": "#1ABC9C"
},
"name": "bottomLeftWheel",
"r": "1",
"type": "circle"
},
{
"cx": "15",
"cy": "50",
"fill": {
"paint": "#1ABC9C"
},
"name": "bottomRightWheel",
"r": "1",
"type": "circle"
}
],
"preserveAspectRatio": "none",
"style": {
"overflow": "hidden",
"transform": ""
},
"viewBox": "-1.5 -1.5 20 60"
},
"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": "\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,
"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"
}
},
"type": "ia.container.flex"
}
}