97 lines
4.8 KiB
Plaintext
97 lines
4.8 KiB
Plaintext
{
|
|
"custom": {},
|
|
"params": {
|
|
"tagPath": "[PHXA2_IG_DH01]CP1321/PHXA2_UPS_BATT_VM_P1_1_P1_2"
|
|
},
|
|
"propConfig": {
|
|
"params.tagPath": {
|
|
"paramDirection": "input",
|
|
"persistent": true
|
|
}
|
|
},
|
|
"props": {
|
|
"defaultSize": {
|
|
"height": 636,
|
|
"width": 1378
|
|
}
|
|
},
|
|
"root": {
|
|
"children": [
|
|
{
|
|
"meta": {
|
|
"name": "Table_0"
|
|
},
|
|
"position": {
|
|
"height": 575,
|
|
"width": 1331,
|
|
"y": 39.5
|
|
},
|
|
"propConfig": {
|
|
"props.data": {
|
|
"binding": {
|
|
"config": {
|
|
"struct": {
|
|
"timer": "now(10000)"
|
|
},
|
|
"waitOnAll": true
|
|
},
|
|
"transforms": [
|
|
{
|
|
"code": "\n from collections import OrderedDict\n\n \"\"\"\n Populates a Perspective table with ordered columns.\n Ensures \u0027Device\u0027 column appears first using OrderedDict.\n \"\"\"\n\n # Hardcoded base path and device list\n basePath \u003d value.get(\"basePath\")\n devices1 \u003d {\n \t\"VM_HS1_HS2\": \"[PHXA2_IG_COMN]HE1138/PHXA2_UPS_BATT_VM_HS1\",\n \"VM_R1_R3\": \"[PHXA2_IG_COMN]CP1322/PHXA2_UPS_BATT_VM_R1\",\n \"VM_R2_R4\": \"[PHXA2_IG_COMN]CP2321/PHXA2_UPS_BATT_VM_R2\",\n \"VM_P1_1_P1_2\": \"[PHXA2_IG_DH01]CP1321/PHXA2_UPS_BATT_VM_P1_1_P1_2\",\n \"VM_P1_3\": \"[PHXA2_IG_DH01]CP1319/PHXA2_UPS_BATT_VM_P1_3\",\n #\"VM_P2_1_P2_2\": \"[PHXA2_IG_DH02]CP1315/PHXA2_UPS_BATT_VM_P2_1_P2_2\",\n #\"VM_P2_3\": \"[PHXA2_IG_DH02]CP1313/PHXA2_UPS_BATT_VM_P2_3\",\n #\"VM_P3_1_P3_2\": \"[PHXA2_IG_DH03]CP1308/PHXA2_UPS_BATT_VM_P3_1_P3_2\",\n #\"VM_P3_3\": \"[PHXA2_IG_DH03]CP1306/PHXA2_UPS_BATT_VM_P3_3\",\n \"VM_P4_1_P4_2\": \"[PHXA2_IG_DH04]CP2320/PHXA2_UPS_BATT_VM_P4_1_P4_2\",\n \"VM_P4_3_P4_4\":\"[PHXA2_IG_DH04]CP2318/PHXA2_UPS_BATT_VM_P4_3_P4_4\",\n #\"VM_P5_1_P5_2\": \"[PHXA2_IG_DH05]CP2315/PHXA2_UPS_BATT_VM_P5_1_P5_2\",\n #\"VM_P5_3\": \"[PHXA2_IG_DH05]CP2313/PHXA2_UPS_BATT_VM_P5_3\",\n #\"VM_P6_1_P6_2\": \"[PHXA2_IG_DH06]CP2308/PHXA2_UPS_BATT_VM_P6_1_P6_2\",\n #\"VM_P6_3_P6_4\": \"[PHXA2_IG_DH06]CP2306/PHXA2_UPS_BATT_VM_P6_3_P6_4\"\n }\n devices \u003d OrderedDict(sorted(devices1.items()))\n # Define columns and corresponding tag suffixes\n tagSuffixes \u003d {\n \"Number of Strings in System\": \"Number of Strings in System\",\n \"Avg Battery Current\": \"Avg Battery Current\",\n \"Avg Battery Temperature\": \"Avg Battery Temperature\",\n \"Avg Battery Voltage\": \"Avg Battery Voltage\",\n \"Max Battery Current\": \"Max Battery Current\",\n \"Max Battery Temperature\": \"Max Battery Temperature\",\n \"Max Battery Voltage\": \"Max Battery Voltage\",\n \"Min Battery Current\": \"Min Battery Current\",\n \"Min Battery Temperature\": \"Min Battery Temperature\",\n \"Min Battery Voltage\": \"Min Battery Voltage\"\n }\n\n # Build tag paths\n tagPaths \u003d []\n for device in devices.values():\n for suffix in tagSuffixes.values():\n tagPaths.append(device + \"/\" + suffix)\n\n # Read all tag values\n results \u003d system.tag.readBlocking(tagPaths)\n\n # Build table data with ordered columns\n data \u003d []\n i \u003d 0\n for device in devices.keys():\n row \u003d OrderedDict()\n row[\"Device\"] \u003d device\n for columnName in tagSuffixes.keys():\n row[columnName] \u003d results[i].value\n i +\u003d 1\n data.append(row)\n\n return data",
|
|
"type": "script"
|
|
}
|
|
],
|
|
"type": "expr-struct"
|
|
}
|
|
}
|
|
},
|
|
"type": "ia.display.table"
|
|
},
|
|
{
|
|
"children": [
|
|
{
|
|
"meta": {
|
|
"name": "Markdown_1"
|
|
},
|
|
"position": {
|
|
"shrink": 0
|
|
},
|
|
"props": {
|
|
"source": "Virtual Machines",
|
|
"style": {
|
|
"alignSelf": "center",
|
|
"classes": "labels/text-xl"
|
|
}
|
|
},
|
|
"type": "ia.display.markdown"
|
|
}
|
|
],
|
|
"meta": {
|
|
"name": "LargeHeader"
|
|
},
|
|
"position": {
|
|
"height": 42,
|
|
"width": 159,
|
|
"x": 17
|
|
},
|
|
"props": {
|
|
"alignItems": "center",
|
|
"style": {
|
|
"overflow": "hidden",
|
|
"paddingRight": "0.5rem",
|
|
"width": "100%"
|
|
}
|
|
},
|
|
"type": "ia.container.flex"
|
|
}
|
|
],
|
|
"meta": {
|
|
"name": "root"
|
|
},
|
|
"position": {
|
|
"x": -165,
|
|
"y": -31
|
|
},
|
|
"type": "ia.container.coord"
|
|
}
|
|
} |