Fix views

This commit is contained in:
b.makharadze 2025-08-26 15:54:32 +04:00
parent 44584323fe
commit 7c98be09f3
7 changed files with 39 additions and 9 deletions

View File

@ -715,6 +715,7 @@
"type": "group" "type": "group"
} }
], ],
"preserveAspectRatio": "none",
"viewBox": "0 0 1850 1028" "viewBox": "0 0 1850 1028"
}, },
"type": "ia.shapes.svg" "type": "ia.shapes.svg"

View File

@ -1543,6 +1543,7 @@
"type": "group" "type": "group"
} }
], ],
"preserveAspectRatio": "none",
"viewBox": "0 0 1850 1028" "viewBox": "0 0 1850 1028"
}, },
"type": "ia.shapes.svg" "type": "ia.shapes.svg"

View File

@ -1991,6 +1991,7 @@
"fill": { "fill": {
"paint": "transparent" "paint": "transparent"
}, },
"preserveAspectRatio": "none",
"viewBox": "0 0 1850 1028" "viewBox": "0 0 1850 1028"
}, },
"type": "ia.shapes.svg" "type": "ia.shapes.svg"

View File

@ -3267,6 +3267,7 @@
"type": "group" "type": "group"
} }
], ],
"preserveAspectRatio": "none",
"viewBox": "0 0 1850 1028" "viewBox": "0 0 1850 1028"
}, },
"type": "ia.shapes.svg" "type": "ia.shapes.svg"

View File

@ -1906,6 +1906,7 @@
"type": "group" "type": "group"
} }
], ],
"preserveAspectRatio": "none",
"viewBox": "0 0 1850 1028" "viewBox": "0 0 1850 1028"
}, },
"type": "ia.shapes.svg" "type": "ia.shapes.svg"

View File

@ -16,20 +16,38 @@ def handleTagHighlight(view, currentValue):
priority = parts[1] if len(parts) > 1 else "1" priority = parts[1] if len(parts) > 1 else "1"
splitedTag = tag.split("/") splitedTag = tag.split("/")
deviceName = splitedTag[-1] deviceName = splitedTag[-2] # second-to-last part
# Map device keywords to Docked-East views
Docked_East_Map = { Docked_East_Map = {
"VFD": "Docked-East-VFD", "VFD": "Docked-East-VFD",
"MCM": "Docked-East-MCM" "MCM": "Docked-East-MCM",
"EXTENDO": "Docked-East-EX",
"DPM": "Docked-East-DS",
"FIO": "Docked-East-DS",
"SIO": "Docked-East-DS",
"HUB": "Docked-East-DS",
"EPC": "Docked-East-EPC",
"JR": "Docked-East-BTN",
"Chute_JR": "Docked-East-BTN",
"S_PB": "Docked-East-BTN",
"SS_PB": "Docked-East-BTN",
"Chute": "Docked-East-SNP",
"FL_CHUTE": "Docked-East-SNP",
"PalletBuild": "Docked-East-SNP",
"D2C": "Docked-East-SNP",
"NC": "Docked-East-SNP",
} }
Docked_East_View = Docked_East_Map["VFD"]
Docked_East_View = Docked_East_Map.get(deviceName, "Docked-East-VFD") # fallback
# Special handling for PE devices
if "PE" in deviceName: if "PE" in deviceName:
tag = "/".join(splitedTag[:2]) + "/Conveyor/" + deviceName[:-3] + "VFD1" tag = "/".join(splitedTag[:2]) + "/Conveyor/" + deviceName[:-3] + "VFD1"
if "MCM" in deviceName: if "MCM" in deviceName:
Docked_East_View = Docked_East_Map["MCM"] Docked_East_View = Docked_East_Map["MCM"]
# Clear old highlights (set to Clear class) # Clear old highlights (set to Clear class)
components = view.rootContainer.getChildren() components = view.rootContainer.getChildren()
for child in components: for child in components:

View File

@ -1,9 +1,9 @@
{ {
"custom": { "custom": {
"alarm_message": null, "alarm_message": null,
"color": "#00FF00", "color": "#C2C2C2",
"priority": "No Active Alarms", "priority": "No Active Alarms",
"state": "System Started" "state": "Closed"
}, },
"params": { "params": {
"forceFaultStatus": null, "forceFaultStatus": null,
@ -449,6 +449,14 @@
"enabled": false, "enabled": false,
"script": "" "script": ""
} }
},
"props.elements[1].style.fill": {
"binding": {
"config": {
"expression": "if(\r\n {view.custom.state} \u003d \"Closed\",\r\n \"#FFFFFF\",\r\n \"#000000\"\r\n)\r\n"
},
"type": "expr"
}
} }
}, },
"props": { "props": {
@ -466,7 +474,6 @@
{ {
"style": { "style": {
"classes": "", "classes": "",
"fill": "#000000",
"fontWeight": "bold" "fontWeight": "bold"
}, },
"text": "MCM", "text": "MCM",