{ "custom": { "batt": "1_1", "provider": "PHXA2_IG_DH01", "room": "P1_1_P1_2", "string": "1" }, "params": { "deviceType": "Jar", "selectedDeviceTagpath": "[PHXA2_IG_DH01]CP1321/PHXA2_UPS_BATT_VM_P1_1_P1_2/1_1/Strings/1/Jars/", "tagPath": "[PHXA2_IG_DH01]CP1321/PHXA2_UPS_BATT_VM_P1_1_P1_2/1_1/Strings/1" }, "propConfig": { "custom.area": { "binding": { "config": { "expression": "split(\r\n replace({view.params.tagPath}, \r\n substring({view.params.tagPath}, 0, indexOf({view.params.tagPath}, \"]\") + 1), \r\n \"\"\r\n ), \r\n \"/\"\r\n)[0]\r\n" }, "type": "expr" } }, "custom.batt": { "binding": { "config": { "expression": "{view.params.tagPath}" }, "transforms": [ { "code": "\n tagPath \u003d value\n\n # Remove provider (e.g., [PHXA2_IG_COMN])\n if tagPath.startswith(\u0027[\u0027):\n closing_index \u003d tagPath.find(\u0027]\u0027)\n if closing_index !\u003d -1:\n tagPath \u003d tagPath[closing_index + 1:]\n\n # Split the rest of the tag path by \"/\"\n parts \u003d tagPath.split(\u0027/\u0027)\n\n # Check if we have at least 3 parts\n if len(parts) \u003e\u003d 3:\n return parts[2] # This is the 3rd segment (index 2)\n else:\n return \"\" # Fallback if structure is too short", "type": "script" } ], "type": "expr" }, "persistent": true }, "custom.provider": { "binding": { "config": { "expression": "{view.params.tagPath}" }, "transforms": [ { "code": "\n tagPath \u003d value\n\n # Make sure it starts with a provider in square brackets\n if tagPath.startswith(\u0027[\u0027):\n closing_index \u003d tagPath.find(\u0027]\u0027)\n if closing_index !\u003d -1:\n return tagPath[1:closing_index] # Extract between [ and ]\n \n # If no provider is found, return empty string or fallback\n return \"\"", "type": "script" } ], "type": "expr" }, "persistent": true }, "custom.room": { "binding": { "config": { "expression": "{view.params.tagPath}" }, "transforms": [ { "code": "\n tagPath \u003d value\n\n # Step 1: Remove provider (e.g., [PHXA2_IG_DH01])\n if tagPath.startswith(\u0027[\u0027):\n closing_index \u003d tagPath.find(\u0027]\u0027)\n if closing_index !\u003d -1:\n tagPath \u003d tagPath[closing_index + 1:]\n\n # Step 2: Split the remaining tag path by \"/\"\n parts \u003d tagPath.split(\u0027/\u0027)\n\n # Step 3: Get the subfolder part (usually at index 1)\n if len(parts) \u003e\u003d 2:\n subfolder \u003d parts[1]\n\n # Step 4: Find \"VM_\" and return everything after it\n vm_index \u003d subfolder.find(\"VM_\")\n if vm_index !\u003d -1:\n return subfolder[vm_index + 3:] # +3 to skip over \"VM_\"\n\n # Fallback if structure doesn\u0027t match\n return \"\"", "type": "script" } ], "type": "expr" }, "persistent": true }, "custom.string": { "binding": { "config": { "expression": "{view.params.tagPath}" }, "transforms": [ { "code": "\n tagPath \u003d value\n\n # Remove the tag provider (e.g., [PHXA2_IG_COMN])\n if tagPath.startswith(\u0027[\u0027):\n closing_index \u003d tagPath.find(\u0027]\u0027)\n if closing_index !\u003d -1:\n tagPath \u003d tagPath[closing_index + 1:]\n\n # Split the remaining tag path by \"/\"\n parts \u003d tagPath.split(\u0027/\u0027)\n\n # Return the last segment, if it exists\n if parts:\n return parts[-1]\n else:\n return \"\"", "type": "script" } ], "type": "expr" }, "persistent": true }, "params.deviceType": { "paramDirection": "input", "persistent": true }, "params.selectedDeviceTagpath": { "binding": { "config": { "path": "/root/Table_0.props.selection.selectedRow" }, "transforms": [ { "expression": "//{view.custom.deviceData}[{value}][\u0027value\u0027][\u0027tagPath\u0027]\r\n\u0027[\u0027+{view.custom.provider}+\u0027]\u0027+{view.custom.area}+\u0027/PHXA2_UPS_BATT_VM_\u0027+{view.custom.room}+\u0027/\u0027+{view.custom.batt}+\u0027/Strings/\u0027+{view.custom.string}+\u0027/Jars/\u0027+({/root/Table_0.props.selection.selectedRow}+1)", "type": "expression" } ], "type": "property" }, "paramDirection": "input", "persistent": true }, "params.tagPath": { "paramDirection": "input", "persistent": true } }, "props": { "defaultSize": { "height": 1357, "width": 1024 } }, "root": { "children": [ { "events": { "component": { "onRowDoubleClick": { "config": { "script": "\tutils.nav.openEQPopup(self.view.params.deviceType, self.view.params.selectedDeviceTagpath)" }, "scope": "G", "type": "script" } } }, "meta": { "name": "Table_0" }, "position": { "height": 1287, "width": 965, "y": -0.5 }, "propConfig": { "props.data": { "binding": { "config": { "struct": { "key": "{view.params.tagPath}", "path": "{view.custom.area}+\"/PHXA2_UPS_BATT_VM_\"+{view.custom.room}+\"/\"+{view.custom.batt}+\"/Strings/\"+{view.custom.string}+\"/Jars*\"", "provider": "{view.custom.provider}", "timer": "now(10000)" }, "waitOnAll": true }, "transforms": [ { "code": "\t\n\n\tprovider \u003d value[\u0027provider\u0027]\n\tlimit \u003d 1000\n\t\n\tquery \u003d {\n\t \"options\": {\n\t \"includeUdtMembers\": True,\n\t \"includeUdtDefinitions\": False\n\t },\n\t \"condition\": {\n\t \"path\": value[\u0027path\u0027],\n\t \"tagType\": \"AtomicTag\",\n\t \"attributes\": {\n\t \"values\": [],\n\t \"requireAll\": True\n\t },\n\t \"valueSource\": \"opc\"\n\t },\n\t \"returnProperties\": [\n\t \"InstanceName\",\n\t \"name\"\n\t ]\n\t}\n\t\n\t# Limited to 100 rows. Use continuationPoint functionality to continue from last result, \n\t# or remove limit for full results.\n\tresults \u003d system.tag.query(provider, query, limit)\n\tarr \u003d []\n\t\n\td \u003d {}\n\t\n\tfor result in results:\n\t\t#print result[\u0027InstanceName\u0027] + \u0027/\u0027 + result[\u0027name\u0027] + \u0027/\u0027 + str(result[\u0027value\u0027].value)\n\t\t\n\t\t\n\t\t#js \u003d {\n\t #\t\"Jar\": result[\u0027InstanceName\u0027],\n\t #\t\"Voltage\": \"United States\",\n\t #\t\"Temperature\": 77271,\n\t #\t\"Ohmic Value\": \u0027C\u0027\n\t #}\n\t index \u003d int(result[\u0027InstanceName\u0027])\n\t if index not in d:\n\t \n\t\t\td[index] \u003d {}\n\t\t\td[index][\u0027Jar ID\u0027] \u003d index\n\t\t\t\n\t \n\t if result[\u0027name\u0027] \u003d\u003d \u0027Voltage\u0027:\n\t \td[index][\u0027Voltage\u0027] \u003d result[\u0027value\u0027].value\n\t elif result[\u0027name\u0027] \u003d\u003d \u0027Temperature\u0027:\n\t \td[index][\u0027Temperature\u0027] \u003d result[\u0027value\u0027].value\n\t elif result[\u0027name\u0027] \u003d\u003d \u0027Ohmic Value\u0027:\n\t \td[index][\u0027Ohmic Value\u0027] \u003d result[\u0027value\u0027].value\n\t\t\n\t#print d\n\t\n\tfor x in d:\n\t\t#print d[x]\n\t\tarr.append(d[x])\n\t\t\n\treturn arr", "type": "script" } ], "type": "expr-struct" } } }, "props": { "pager": { "activeOption": 50 } }, "type": "ia.display.table" } ], "meta": { "name": "root" }, "position": { "x": -165, "y": -31 }, "type": "ia.container.coord" } }