BNA8/.resources/fec9f69a258bfaa339b682c2036c788185d47b31a0cf193f6ae80261f0293eef
2025-09-30 18:55:01 +04:00

941 lines
24 KiB
Plaintext

{
"custom": {
"largeView": false
},
"params": {
"params": {}
},
"propConfig": {
"custom.largeView": {
"binding": {
"config": {
"expression": "{page.props.dimensions.viewport.width} \u003e 800"
},
"type": "expr"
},
"persistent": true
},
"params.params": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 58
}
},
"root": {
"children": [
{
"children": [
{
"events": {
"dom": {
"onDoubleClick": {
"config": {
"page": "/Monitron"
},
"scope": "C",
"type": "nav"
}
}
},
"meta": {
"name": "Icon"
},
"position": {
"basis": "30px"
},
"props": {
"color": "#FFFFFF",
"path": "material/vibration",
"style": {
"classes": ""
}
},
"type": "ia.display.icon"
},
{
"meta": {
"name": "Label"
},
"position": {
"basis": "41px"
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "direct",
"tagPath": "[IEC_SCADA_TAG_PROVIDER]Monitron/monitron_data"
},
"transforms": [
{
"code": "\treturn value.getRowCount()",
"type": "script"
}
],
"type": "tag"
}
}
},
"props": {
"style": {
"color": "#FFFFFF",
"textAlign": "center"
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "FlexContainer_0"
},
"position": {
"basis": "80px",
"display": false
},
"type": "ia.container.flex"
},
{
"children": [
{
"events": {
"dom": {
"onDoubleClick": {
"config": {
"page": "/Oil"
},
"scope": "C",
"type": "nav"
}
}
},
"meta": {
"name": "Icon"
},
"position": {
"basis": "30px"
},
"props": {
"color": "#FFFFFF",
"path": "material/opacity",
"style": {
"classes": ""
}
},
"type": "ia.display.icon"
},
{
"meta": {
"name": "Label"
},
"position": {
"basis": "41px"
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "direct",
"tagPath": "[IEC_SCADA_TAG_PROVIDER]Oil/oil_condition_monitoring"
},
"transforms": [
{
"code": "\treturn value.getRowCount()",
"type": "script"
}
],
"type": "tag"
}
}
},
"props": {
"style": {
"color": "#FFFFFF",
"textAlign": "center"
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "FlexContainer_1"
},
"position": {
"basis": "80px",
"display": false
},
"type": "ia.container.flex"
},
{
"meta": {
"name": "Image"
},
"position": {
"basis": "120px"
},
"propConfig": {
"position.display": {
"binding": {
"config": {
"path": "view.custom.largeView"
},
"type": "property"
}
}
},
"props": {
"fit": {
"height": 30,
"mode": "fill"
},
"source": "/system/images/Builtin/amazon_rme_logo.png"
},
"type": "ia.display.image"
},
{
"meta": {
"hasDelegate": true,
"name": "Spacer Start"
},
"position": {
"basis": "16px",
"shrink": 0
},
"props": {
"text": " "
},
"type": "ia.display.label"
},
{
"events": {
"dom": {
"onClick": {
"config": {
"id": "Docked-West",
"type": "toggle"
},
"scope": "C",
"type": "dock"
}
}
},
"meta": {
"name": "Menu Dock"
},
"position": {
"basis": "24px",
"shrink": 0
},
"propConfig": {
"position.display": {
"binding": {
"config": {
"expression": "!{view.custom.largeView}"
},
"type": "expr"
}
}
},
"props": {
"color": "#FFFFFF",
"path": "material/menu",
"style": {
"classes": "Header/Icon",
"marginRight": "10px"
}
},
"type": "ia.display.icon"
},
{
"children": [
{
"meta": {
"name": "FlexContainer"
},
"position": {
"basis": "550px",
"grow": 1
},
"type": "ia.container.flex"
},
{
"custom": {
"area": ""
},
"meta": {
"name": "Label"
},
"position": {
"basis": "300px",
"shrink": 0
},
"propConfig": {
"custom.path": {
"binding": {
"config": {
"expression": "{page.props.path}"
},
"type": "expr"
},
"onChange": {
"enabled": null,
"script": "\t# get the last part of the path\n\tmcm_key \u003d str(currentValue.value).split(\u0027/\u0027)[-1]\n\tself.custom.area \u003d mcm_key\n\tsystem.perspective.print(mcm_key)\n\n#\t# get the JSON from the custom property\n#\tjson_data \u003d self.custom.plc_dict\n#\t\n#\t# lookup the Area value\n#\tarea_value \u003d json_data.get(mcm_key, {}).get(\"Area\", \"Unknown\")\n#\t\n#\t# debug prints\n#\tsystem.perspective.print(mcm_key)\n#\tsystem.perspective.print(area_value)\n\t\n\t# write result to another property (e.g., Label.props.text)\n#\tself.getSibling(\"Label\").props.text \u003d \"{mcm_key} - {area_value}\""
}
},
"custom.plc_dict": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]Configuration/PLC"
},
"type": "tag"
}
},
"position.display": {
"binding": {
"config": {
"expression": "{view.params.size} \u003d \"large\""
},
"type": "expr"
}
},
"props.text": {
"binding": {
"config": {
"path": "this.custom.area"
},
"type": "property"
}
}
},
"props": {
"style": {
"color": "#FFFFFF",
"fontFamily": "Arial",
"fontWeight": "bold",
"textAlign": "center"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "FlexContainer_0"
},
"position": {
"basis": "150px",
"grow": 1
},
"type": "ia.container.flex"
}
],
"meta": {
"name": "Area"
},
"position": {
"basis": "200px",
"grow": 1
},
"type": "ia.container.flex"
},
{
"meta": {
"name": "Icon_1",
"tooltip": {
"enabled": true
}
},
"position": {
"basis": "30px"
},
"propConfig": {
"meta.tooltip.text": {
"binding": {
"config": {
"expression": "{[System]Gateway/Database/MariaDB/Available}"
},
"transforms": [
{
"fallback": "Database Connection Status: LOST",
"inputType": "scalar",
"mappings": [
{
"input": true,
"output": "Database Connection Status: GOOD"
},
{
"input": false,
"output": "Database Connection Status: LOST"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "expr"
}
},
"props.color": {
"binding": {
"config": {
"expression": "{[System]Gateway/Database/MariaDB/Available}"
},
"transforms": [
{
"fallback": "#FF0000",
"inputType": "scalar",
"mappings": [
{
"input": true,
"output": "#47FF47"
},
{
"input": false,
"output": "#FF0000"
}
],
"outputType": "color",
"type": "map"
}
],
"type": "expr"
},
"onChange": {
"enabled": null,
"script": " db_tag_path \u003d \"[System]Gateway/Database/MariaDB/Available\"\n\t\n if not (system.tag.readBlocking([db_tag_path])[0].value):\n \tsystem.perspective.openPopup(\"errorPopup\",\u0027autStand/PopUp-Views/DatabaseError\u0027, title\u003d\"Database Error\")\n\t"
},
"persistent": true
}
},
"props": {
"color": "#47FF47",
"path": "material/table_chart"
},
"type": "ia.display.icon"
},
{
"meta": {
"hasDelegate": true,
"name": "Spacer End_3"
},
"position": {
"basis": "10px",
"shrink": 0
},
"props": {
"text": " "
},
"type": "ia.display.label"
},
{
"custom": {
"buttonid": "HeaderLegendIcon"
},
"events": {
"dom": {
"onClick": {
"config": {
"draggable": false,
"id": "TZyBcXB7",
"modal": true,
"overlayDismiss": true,
"resizable": false,
"showCloseIcon": false,
"type": "open",
"viewPath": "autStand/PopUp-Views/Legend_Popup/Legend-popup-view",
"viewportBound": true
},
"scope": "C",
"type": "popup"
}
}
},
"meta": {
"name": "Icon",
"tooltip": {
"delay": 250,
"enabled": true,
"sustain": 1000,
"text": "Legend"
}
},
"position": {
"basis": "35px"
},
"props": {
"color": "#FFFFFF",
"path": "material/legend_toggle",
"style": {
"classes": ""
}
},
"type": "ia.display.icon"
},
{
"children": [
{
"meta": {
"hasDelegate": true,
"name": "Spacer End"
},
"position": {
"basis": "10px",
"shrink": 0
},
"props": {
"text": " "
},
"type": "ia.display.label"
},
{
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tsystem.perspective.navigate(page \u003d \"/autStand/Alarms\")"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Icon"
},
"position": {
"basis": "30px"
},
"propConfig": {
"props.color": {
"binding": {
"config": {
"path": "../Label.props.text"
},
"transforms": [
{
"code": "\t\n\treturn \"red\" if value \u003e 0 else \"#fff\"",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"path": "material/notifications_active",
"style": {
"classes": ""
}
},
"type": "ia.display.icon"
},
{
"meta": {
"name": "Label"
},
"position": {
"basis": "41px",
"grow": 1
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"polling": {
"enabled": true,
"rate": "3"
},
"queryPath": "autStand/Alarms/GetActiveAlarmsByLocationAndPriority",
"returnFormat": "json"
},
"transforms": [
{
"code": "\ttotal \u003d sum(row[\"Count\"] for row in value if \"Count\" in row and row[\"Count\"] is not None)\n\treturn total",
"type": "script"
}
],
"type": "query"
}
}
},
"props": {
"style": {
"color": "#FFFFFF",
"textAlign": "center"
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "FlexContainer",
"tooltip": {
"enabled": true
}
},
"position": {
"basis": "75px"
},
"propConfig": {
"meta.tooltip.text": {
"binding": {
"config": {
"expression": "{./Label.props.text} + \" active alarms in the system\""
},
"type": "expr"
}
}
},
"props": {
"justify": "flex-end",
"style": {
"cursor": "pointer",
"overflow": "hidden"
}
},
"type": "ia.container.flex"
},
{
"custom": {
"covert": true
},
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tdevice_list \u003d tags.tag_utilities.get_devices(self.session.custom.fc)\n\ttags.tag_utilities.reset_disconnect_tags(self.session.custom.fc, device_list)\n\tAWS.wbsckt_abort.close_websckt()"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Icon_2",
"tooltip": {
"enabled": true
}
},
"position": {
"basis": "30px"
},
"propConfig": {
"custom.heartbeat_received": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]System/wbsckt_heartbeat_interval"
},
"transforms": [
{
"expression": "if(secondsBetween(todate({value}),todate(now())) \u003e 70, False, True)",
"type": "expression"
}
],
"type": "tag"
}
},
"custom.wbsckt_running": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]System/wbsckt_running"
},
"transforms": [
{
"expression": "if({value} \u003d True \u0026\u0026 ({this.custom.heartbeat_received} \u003d True) , True, False)",
"type": "expression"
}
],
"type": "tag"
}
},
"meta.tooltip.text": {
"binding": {
"config": {
"path": "this.custom.wbsckt_running"
},
"transforms": [
{
"fallback": "",
"inputType": "scalar",
"mappings": [
{
"input": true,
"output": "websocket running"
},
{
"input": false,
"output": "websocket disconnected"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
}
},
"props.color": {
"binding": {
"config": {
"path": "this.custom.wbsckt_running"
},
"transforms": [
{
"fallback": "#000000",
"inputType": "scalar",
"mappings": [
{
"input": false,
"output": "#FF4747"
},
{
"input": true,
"output": "#FFFFFF"
}
],
"outputType": "color",
"type": "map"
}
],
"type": "property"
}
}
},
"props": {
"path": "material/location_city",
"style": {
"cursor": "pointer"
}
},
"type": "ia.display.icon"
},
{
"meta": {
"name": "Label"
},
"position": {
"shrink": 0
},
"propConfig": {
"position.basis": {
"binding": {
"config": {
"expression": "len({this.props.text}) * 11 + \"px\""
},
"type": "expr"
}
},
"props.text": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{session.custom.fc}"
},
"tagPath": "[{0}_SCADA_TAG_PROVIDER]Configuration/FC"
},
"type": "tag"
}
}
},
"props": {
"icon": "material/building",
"style": {
"borderWidth": "0.25px",
"color": "#FFFFFF",
"textAlign": "",
"textIndent": 10
},
"textStyle": {
"lineBreak": "auto"
}
},
"type": "ia.display.label"
},
{
"meta": {
"hasDelegate": true,
"name": "Spacer End"
},
"position": {
"basis": "20px",
"shrink": 0
},
"props": {
"text": " "
},
"type": "ia.display.label"
},
{
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tif self.session.props.auth.authenticated:\n\t\tsystem.perspective.logout()\n\telse:\n\t\tsystem.perspective.login()"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "User"
},
"position": {
"basis": "30px",
"shrink": 0
},
"props": {
"path": "material/person",
"style": {
"classes": "Header/Icon",
"color": "#FFFFFF"
}
},
"type": "ia.display.icon"
},
{
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tif self.session.props.auth.authenticated:\n\t\tsystem.perspective.logout()\n\telse:\n\t\tsystem.perspective.login()"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"hasDelegate": true,
"name": "Sign In"
},
"position": {
"shrink": 0
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "session.props.auth.user.userName"
},
"transforms": [
{
"code": "\tif value is None or len(str(value)) \u003d\u003d 0 or str(value).lower() \u003d\u003d \"null\":\n\t return \"Sign In\"\n\telse:\n\t return str(value).split(\"@\")[0]",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"style": {
"classes": "Header/Icon",
"color": "#FFFFFF",
"cursor": "pointer",
"marginLeft": "4px"
}
},
"type": "ia.display.label"
},
{
"meta": {
"hasDelegate": true,
"name": "Spacer End_0"
},
"position": {
"basis": "20px",
"shrink": 0
},
"props": {
"text": " "
},
"type": "ia.display.label"
},
{
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tsystem.perspective.closeSession()"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Exit",
"tooltip": {
"enabled": true,
"location": "bottom-left",
"style": {
"fontFamily": "Arial",
"fontSize": 12
},
"tail": false,
"text": "Exit Application"
}
},
"position": {
"basis": "30px",
"shrink": 0
},
"props": {
"path": "material/exit_to_app",
"style": {
"classes": "Header/Icon",
"color": "#FFFFFF",
"cursor": "pointer"
}
},
"type": "ia.display.icon"
},
{
"meta": {
"hasDelegate": true,
"name": "Spacer End_1"
},
"position": {
"basis": "16px",
"shrink": 0
},
"props": {
"text": " "
},
"type": "ia.display.label"
}
],
"meta": {
"name": "root"
},
"props": {
"justify": "flex-end",
"style": {
"background": "rgb(43,43,43)"
}
},
"type": "ia.container.flex"
}
}