Alarm click events #143

Merged
gigi.mamaladze merged 5 commits from guga into main 2025-06-26 14:25:58 +00:00
5 changed files with 121 additions and 40 deletions
Showing only changes of commit 6ad1847adc - Show all commits

View File

@ -0,0 +1,19 @@
{
"base": {
"animation": {
"duration": "2.5s",
"timingFunction": "ease-in-out",
"keyframes": {
"0%": {
"boxShadow": "0 0 12px 5px rgba(255, 255, 0, 0.8)"
},
"50%": {
"boxShadow": "0 0 20px 8px rgba(255, 255, 0, 1)"
},
"100%": {
"boxShadow": "0 0 5px 2px rgba(255, 255, 0, 0.3)"
}
}
}
}
}

View File

@ -7,13 +7,18 @@ def handleTagHighlight(view, currentValue):
splitedTag = str(tag).split("/") splitedTag = str(tag).split("/")
deviceName = splitedTag[-1] deviceName = splitedTag[-1]
system.perspective.print(splitedTag) Docked_East_Map = {
"VFD" : "Docked-East-VFD",
tagCopy = tag "MCM" : "Docked-East-MCM"
}
Docked_East_View = Docked_East_Map["VFD"]
if "PE" in deviceName: if "PE" in deviceName:
tag = "/".join(splitedTag[:2]) + "/Conveyor/" + deviceName[:-3] + "VFD1" tag = "/".join(splitedTag[:2]) + "/Conveyor/" + deviceName[:-3] + "VFD1"
system.perspective.print(tag)
if "MCM" in deviceName:
Docked_East_View = Docked_East_Map["MCM"]
components = view.rootContainer.getChildren() components = view.rootContainer.getChildren()
@ -28,8 +33,8 @@ def handleTagHighlight(view, currentValue):
tagPath = tagsList[0] tagPath = tagsList[0]
if tag == tagPath: if tag == tagPath:
child.props.params["isHighlighted"] = True child.props.style["classes"] = "Highlight/Pulse"
system.perspective.openDock('Docked-East-VFD', params={'tagProps': tagProps}) system.perspective.openDock(Docked_East_View, params={'tagProps': tagProps})
return True return True
return False return False

View File

@ -0,0 +1,18 @@
{
"base": {
"animation": {
"duration": "2.5s",
"keyframes": {
"0%": {
"boxShadow": "0 0 12px 5px rgba(255, 255, 0, 0.8)"
},
"50%": {
"boxShadow": "0 0 20px 8px rgba(255, 255, 0, 1)"
},
"100%": {
"boxShadow": "0 0 5px 2px rgba(255, 255, 0, 0.3)"
}
}
}
}
}

View File

@ -482,7 +482,6 @@
], ],
"custom": { "custom": {
"priorities": { "priorities": {
"critical": false,
"diagnostic": false, "diagnostic": false,
"high": false, "high": false,
"low": false, "low": false,
@ -690,7 +689,7 @@
"component": { "component": {
"onRowClick": { "onRowClick": {
"config": { "config": {
"script": "\tdata \u003d self.props.selection.data\n\tif not data or len(data) !\u003d 1:\n\t return\n\t\n\trow \u003d data[0]\n\tclickedTagPath \u003d row.get(\"FullTag\", \"\")\n\tMCM \u003d row.get(\"Location\", \"\")\n\t\n\tMCM_Pages_Map \u003d {\n\t\t\"MCM01\": \"Detailed-Views/MCM01 Fluid Inbound Merges 1-4\",\n\t\t\"MCM02\": \"Detailed-Views/MCM02 Fluid Inbound Merges 5-7\",\n\t\t\"MCM03\": \"Detailed-Views/MCM03 Non Con\",\n\t\t\"MCM04\": \"Detailed-Views/MCM04 North Bulk Inbound, Fluid Outbound and Problem Solve\",\n\t\t\"MCM05\": \"Detailed-Views/MCM05 South Bulk Inbound, Fluid Outbound and Problem Solve\",\n\t\t\"MCM06\": \"Detailed-Views/MCM06 Non Con\",\n\t\t\"MCM07\": \"Detailed-Views/MCM07 Bypass\",\n\t}\n\t\n\n\tpage \u003d MCM_Pages_Map.get(MCM)\n\t\n\tif not page:\n\t return\n\t\t\n\tdevice \u003d row.get(\"Device\", \"\")\n\t\n\tif not device or not clickedTagPath:\n\t\treturn\n\n\tindex \u003d clickedTagPath.find(device)\n\tif index \u003d\u003d -1:\n\t\treturn\n\t\n\tpathToDevice \u003d clickedTagPath[:index + len(device)]\n\t\t\n\t# Navigate to target view, passing the tag to highlight\n\tsystem.perspective.navigate(view \u003d page, params \u003d {\u0027highlightTagPath\u0027:pathToDevice})\n\t\n\t\n" "script": "\tdata \u003d self.props.selection.data\n\tif not data or len(data) !\u003d 1:\n\t return\n\t\n\trow \u003d data[0]\n\tclickedTagPath \u003d row.get(\"FullTag\", \"\")\n\tMCM \u003d row.get(\"Location\", \"\")\n\t\n\tMCM_Pages_Map \u003d {\n\t\t\"MCM01\": \"Detailed-Views/MCM01 Fluid Inbound Merges 1-4\",\n\t\t\"MCM02\": \"Detailed-Views/MCM02 Fluid Inbound Merges 5-7\",\n\t\t\"MCM03\": \"Detailed-Views/MCM03 Non Con\",\n\t\t\"MCM04\": \"Detailed-Views/MCM04 North Bulk Inbound, Fluid Outbound and Problem Solve\",\n\t\t\"MCM05\": \"Detailed-Views/MCM05 South Bulk Inbound, Fluid Outbound and Problem Solve\",\n\t\t\"MCM06\": \"Detailed-Views/MCM06 Non Con\",\n\t\t\"MCM07\": \"Detailed-Views/MCM07 Bypass\",\n\t}\n\t\n\n\tpage \u003d MCM_Pages_Map.get(MCM)\n\t\n\tif not page:\n\t return\n\t\t\n\tdevice \u003d row.get(\"Device\", \"\")\n\t\n\tif not device or not clickedTagPath:\n\t\treturn\n\n\tpathToDevice \u003d \"\"\n\n#\tcheck for the mcm\n\tif \"MCM\" in device:\n\t\tparts \u003d clickedTagPath.split(\"/\")\n\t\tpathToDevice \u003d \"/\".join(parts[:3])\n\n\telse:\n\t\tindex \u003d clickedTagPath.find(device)\n\t\tif index \u003d\u003d -1:\n\t\t\treturn\n\t\tpathToDevice \u003d clickedTagPath[:index + len(device)]\n\n\t\t\n\t# Navigate to target view, passing the tag to highlight\n\tsystem.perspective.navigate(view \u003d page, params \u003d {\u0027highlightTagPath\u0027:pathToDevice})\n\t\n\t\n"
}, },
"scope": "G", "scope": "G",
"type": "script" "type": "script"
@ -1588,7 +1587,74 @@
} }
}, },
"selection": { "selection": {
"mode": "multiple interval" "data": [
{
"Description": {
"style": {
"classes": "Alarms-Styles/High"
},
"value": "MCM01 - Hello world"
},
"Device": {
"style": {
"classes": "Alarms-Styles/High"
},
"value": "MCM01"
},
"Duration": {
"style": {
"classes": "Alarms-Styles/High"
},
"value": "01:05:19"
},
"FullTag": {
"style": {
"classes": "Alarms-Styles/High"
},
"value": "System/MCM01/MCM01/Beacon_Light"
},
"ID": {
"style": {
"classes": "Alarms-Styles/High"
},
"value": 12
},
"Location": {
"style": {
"classes": "Alarms-Styles/High"
},
"value": "MCM01"
},
"Priority": {
"style": {
"classes": "Alarms-Styles/High"
},
"value": "High"
},
"StartTimestamp": {
"style": {
"classes": "Alarms-Styles/High"
},
"value": {
"$": [
"ts",
0,
1750942947091
],
"$ts": 1750939070000
}
},
"Tag": {
"style": {
"classes": "Alarms-Styles/High"
},
"value": "MCM01.HMI.Beacon_Light"
}
}
],
"mode": "multiple interval",
"selectedColumn": "Location",
"selectedRow": 0
} }
}, },
"type": "ia.display.table" "type": "ia.display.table"
@ -3092,7 +3158,7 @@
"$": [ "$": [
"ts", "ts",
192, 192,
1750866213319 1750938073345
], ],
"$ts": 1750435156149 "$ts": 1750435156149
}, },
@ -3100,7 +3166,7 @@
"$": [ "$": [
"ts", "ts",
192, 192,
1750866213319 1750938073345
], ],
"$ts": 1750436956149 "$ts": 1750436956149
} }
@ -4048,7 +4114,7 @@
"$": [ "$": [
"ts", "ts",
192, 192,
1750866213319 1750938073345
], ],
"$ts": 1750435156149 "$ts": 1750435156149
}, },
@ -4056,7 +4122,7 @@
"$": [ "$": [
"ts", "ts",
192, 192,
1750866213319 1750938073345
], ],
"$ts": 1750436956149 "$ts": 1750436956149
}, },

View File

@ -17,7 +17,6 @@
"directionLeft": false, "directionLeft": false,
"forceFaultStatus": null, "forceFaultStatus": null,
"forceRunningStatus": null, "forceRunningStatus": null,
"isHighlighted": false,
"tagProps": [ "tagProps": [
"System/MCM01/Conveyor/UL1_3_VFD1", "System/MCM01/Conveyor/UL1_3_VFD1",
"value", "value",
@ -302,10 +301,6 @@
"paramDirection": "input", "paramDirection": "input",
"persistent": true "persistent": true
}, },
"params.isHighlighted": {
"paramDirection": "input",
"persistent": true
},
"params.tagProps": { "params.tagProps": {
"paramDirection": "inout", "paramDirection": "inout",
"persistent": true "persistent": true
@ -508,28 +503,6 @@
], ],
"type": "property" "type": "property"
} }
},
"props.style.classes": {
"binding": {
"config": {
"expression": "{view.params.isHighlighted}"
},
"transforms": [
{
"fallback": "",
"inputType": "scalar",
"mappings": [
{
"input": true,
"output": "State-Styles/State101"
}
],
"outputType": "style-list",
"type": "map"
}
],
"type": "expr"
}
} }
}, },
"props": { "props": {