showing pressure sensor in docked view when clicking on it

This commit is contained in:
Salijoghli 2025-11-10 12:32:58 +04:00
parent 1644ef72c8
commit 27c176da81
18 changed files with 28 additions and 29 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

View File

@ -267,7 +267,7 @@
"dom": {
"onClick": {
"config": {
"script": "\t#create tags lists for the device\n\tprops \u003d self.view.params.tagProps\n\ttags_table_dataset \u003d autStand.devices.getAllTags(self, props[0])\n\tsystem.perspective.openDock(\u0027Docked-East-Device\u0027,params\u003d{\u0027tagProps\u0027:props, \"tags\":tags_table_dataset, \"name\":self.view.custom.deviceName} )"
"script": "\t#create tags lists for the device\n\tprops \u003d self.view.params.tagProps\n\ttags_table_dataset \u003d autStand.devices.getAllTags(self, props[0])\n\tsystem.perspective.openDock(\u0027Docked-East-Device\u0027,params\u003d{\u0027tagProps\u0027:props, \"tags\":tags_table_dataset, \"name\":\"\"} )"
},
"scope": "G",
"type": "script"

View File

@ -227,12 +227,10 @@ global_device_mapping = {}
def build_device_mapping(full_tag_path):
"""
Builds global_device_mapping for devices under the same PLC and parent device.
Adds support for:
- Chute FIOM devices (e.g. S03_CH109_FIOM_1 when clicking S03_CH109)
- Shared JR and PE devices used by multiple chutes (e.g. S03_1_JR1, S03_1_LRPE1)
Builds global_device_mapping for devices under the same Conveyor and Chute.
Support for:
- Shared JR and Long Range PE devices used by multiple chutes (e.g. S03_1_JR1, S03_1_LRPE1)
"""
system.perspective.print(full_tag_path)
global global_device_mapping
global_device_mapping.clear()

View File

@ -1,7 +1,7 @@
{
"custom": {
"PLC": "MCM02",
"device": "PE2",
"device": "NSC1_1_PS1",
"showTags": true,
"state": "Offline",
"view": "autStand/Equipment/Photoeye_Chute"
@ -9,7 +9,7 @@
"params": {
"name": "",
"tagProps": [
"System/MCM02/Chute/S03_CH101/PE2",
"System/MCM02/PS/NSC1_1_PS1",
"value",
"value",
"value",
@ -53,7 +53,7 @@
},
"onChange": {
"enabled": null,
"script": "\tname \u003d self.view.custom.device\n\t\n\t# Use a list of tuples to maintain order - longer matches first\n\tdevice_mapping \u003d [\n\t # Encoder variations (check these first before \u0027EN\u0027)\n\t (\u0027ENSH\u0027, \u0027Encoder\u0027),\n\t (\u0027ENW\u0027, \u0027Encoder\u0027),\n\t (\u0027ENCODER\u0027, \u0027Encoder\u0027),\n\t \n\t # Photoeye variations\n\t (\u0027LRPE\u0027, \u0027Photoeye_Tracking\u0027),\n\t (\u0027TPE\u0027, \u0027Photoeye_Tracking\u0027),\n\t \n\t # IO_Block variations\n\t (\u0027SIO\u0027, \u0027IO_Block\u0027),\n\t (\u0027FIOM\u0027, \u0027IO_Block\u0027),\n\t (\u0027FIO_\u0027, \u0027IO_Block\u0027),\n\t \n\t # Button variations (check after encoder)\n\t (\u0027EN\u0027, \u0027Chute_Button\u0027),\n\t (\u0027JR\u0027, \u0027Button\u0027),\n\t \n\t # Photoeye (shorter version after longer ones)\n\t (\u0027TPE\u0027, \u0027Photoeye_Tracking\u0027),\n\t (\u0027PE\u0027, \u0027Photoeye_Chute\u0027),\n\t \n\t # Other devices variations \n\t (\u0027DPM\u0027, \u0027DPM\u0027),\n\t (\u0027EPC\u0027, \u0027EPC\u0027),\n\t (\u0027MCM\u0027, \u0027MCM\u0027),\n\t (\u0027PRX\u0027, \u0027ProxSensor\u0027),\n\t (\u0027SS\u0027, \u0027SS_Button\u0027),\n\t (\u0027SOL\u0027, \u0027Solenoid\u0027),\n\t \n\t # Beacon Variations (single letters last)\n\t (\u0027B\u0027, \u0027Beacon\u0027),\n\t (\u0027G\u0027, \u0027Beacon\u0027),\n\t (\u0027R\u0027, \u0027Beacon\u0027),\n\t (\u0027H\u0027, \u0027Beacon\u0027),\n\t (\u0027A\u0027, \u0027Beacon\u0027),\n\t (\u0027S03\u0027, \u0027Scanner\u0027)\n\t]\n\t\n\tview \u003d \"\"\n\t\n\tfor key, value in device_mapping:\n\t if key in name:\n\t\t\tview \u003d value\n\t\t\tself.custom.view \u003d \"autStand/Equipment/\" + view\n\t\t\treturn \n\t\n\tself.custom.view \u003d \"autStand/Equipment/Camera\""
"script": "\tname \u003d self.view.custom.device\n\t\n\t# Use a list of tuples to maintain order - longer matches first\n\tdevice_mapping \u003d [\n#\t (\u0027PS\u0027, \u0027PressureSensor\u0027)\n\t \n\t # Encoder variations (check these first before \u0027EN\u0027)\n\t (\u0027ENSH\u0027, \u0027Encoder\u0027),\n\t (\u0027ENW\u0027, \u0027Encoder\u0027),\n\t (\u0027ENCODER\u0027, \u0027Encoder\u0027),\n\t \n\t # Photoeye variations\n\t (\u0027LRPE\u0027, \u0027Photoeye_Tracking\u0027),\n\t (\u0027TPE\u0027, \u0027Photoeye_Tracking\u0027),\n\t \n\t # IO_Block variations\n\t (\u0027SIO\u0027, \u0027IO_Block\u0027),\n\t (\u0027FIOM\u0027, \u0027IO_Block\u0027),\n\t (\u0027FIO_\u0027, \u0027IO_Block\u0027),\n\t \n\t # Button variations (check after encoder)\n\t (\u0027EN\u0027, \u0027Chute_Button\u0027),\n\t (\u0027JR\u0027, \u0027Button\u0027),\n\t \n\t # Photoeye (shorter version after longer ones)\n\t (\u0027TPE\u0027, \u0027Photoeye_Tracking\u0027),\n\t (\u0027PE\u0027, \u0027Photoeye_Chute\u0027),\n\t \n\t # Other devices variations \n\t (\u0027DPM\u0027, \u0027DPM\u0027),\n\t (\u0027EPC\u0027, \u0027EPC\u0027),\n\t (\u0027MCM\u0027, \u0027MCM\u0027),\n\t (\u0027PRX\u0027, \u0027ProxSensor\u0027),\n\t (\u0027SS\u0027, \u0027SS_Button\u0027),\n\t (\u0027SOL\u0027, \u0027Solenoid\u0027),\n\t \n\t # Beacon Variations (single letters last)\n\t (\u0027B\u0027, \u0027Beacon\u0027),\n\t (\u0027G\u0027, \u0027Beacon\u0027),\n\t (\u0027R\u0027, \u0027Beacon\u0027),\n\t (\u0027H\u0027, \u0027Beacon\u0027),\n\t (\u0027A\u0027, \u0027Beacon\u0027),\n\t (\u0027S03\u0027, \u0027Scanner\u0027)\n\t\t\n\t]\n\t\n\tview \u003d \"\"\n\t\n\tfor key, value in device_mapping:\n\t if key in name:\n\t\t\tview \u003d value\n\t\t\tself.custom.view \u003d \"autStand/Equipment/\" + view\n\t\t\treturn \n\t\n\tself.custom.view \u003d \"autStand/Equipment/Camera\""
},
"persistent": true
},

View File

@ -1,8 +1,8 @@
{
"custom": {
"scale": 1.7,
"scale": 1,
"x": 0,
"y": -505.882352941
"y": 0
},
"params": {
"controls": {
@ -399,7 +399,7 @@
"position": {
"height": 0.0324,
"width": 0.0182,
"x": 0.0811
"x": 0.1019
},
"propConfig": {
"meta.visible": {

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -1,10 +1,11 @@
def calculateFocus(self, child, scale=1.7):
"""
Please don't modify!
Hybrid focusing:
- MCM01: precise per-rotation affine for (dx, dy) (unchanged)
- MCM01: precise per-rotation affine for (dx, dy)
- MCM02: search-style mapping:
* 0°/180°: strong horizontal (dx from x,y), dy very gentle (clamped)
* 90°/270°: dx = 0, dy from x (fits your left/right anchors)
* 90°/270°: dx = 0, dy from x left/right anchors)
"""
# --- rotation ---
@ -28,7 +29,7 @@ def calculateFocus(self, child, scale=1.7):
except:
zone = "MCM01"
# ======== MCM01 (your proven mapping, unchanged) ========
# ======== MCM01 ========
COEFFS_MCM01 = {
0: dict(ax= 956.86984, bx=-1853.94329, cx= -17.57191,
ay= 124.82245, by= -191.28916, cy= 227.58568),
@ -40,9 +41,9 @@ def calculateFocus(self, child, scale=1.7):
ay=-1341.88064, by= 1615.55073, cy= 142.77638),
}
# ======== MCM02 (fit from your new table) ========
# ======== MCM02 ========
# 0°: dx ≈ a + b*x + c*y (LS fit on: left/right/center/top/bottom)
# 0°: dx ≈ a + b*x + c*y
_M2_DX_0 = dict(a= 691.72633028, b=-1788.01433165, c= 295.57517840)
# dy kept light & clamped around center (use a small gain around 0.5)
def _m2_dy0(y):

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -33,7 +33,7 @@
"covert": true,
"dpm_view_path": "autStand/Custom_Views/Enternet-Windows/DPMS/DPM Devices/MCM02/NCS1_1_DPM1",
"fc": "BNA8",
"rotation": "270deg",
"rotation": "0deg",
"show_dpm_device_view": true,
"show_dpm_view": true
},

View File

@ -10,8 +10,8 @@
"attributes": {
"lastModification": {
"actor": "admin",
"timestamp": "2025-11-07T13:55:08Z"
"timestamp": "2025-11-10T08:31:52Z"
},
"lastModificationSignature": "ec0003b6640ced92e4151dbe532c0349d2d3ddc8e09646a978e5359d7955292d"
"lastModificationSignature": "becc8a5c7acecf6f8adb56342e078d629e2aae3e26c0db451c7b495dc5b7e310"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -1,15 +1,15 @@
{
"custom": {
"PLC": "MCM02",
"device": "PE2",
"device": "NSC1_1_PS1",
"showTags": true,
"state": "Offline",
"view": "autStand/Equipment/Photoeye_Chute"
"view": "autStand/Equipment/PressureSensor"
},
"params": {
"name": "",
"tagProps": [
"System/MCM02/Chute/S03_CH101/PE2",
"System/MCM02/PS/NSC1_1_PS1",
"value",
"value",
"value",
@ -53,7 +53,7 @@
},
"onChange": {
"enabled": null,
"script": "\tname \u003d self.view.custom.device\n\t\n\t# Use a list of tuples to maintain order - longer matches first\n\tdevice_mapping \u003d [\n\t # Encoder variations (check these first before \u0027EN\u0027)\n\t (\u0027ENSH\u0027, \u0027Encoder\u0027),\n\t (\u0027ENW\u0027, \u0027Encoder\u0027),\n\t (\u0027ENCODER\u0027, \u0027Encoder\u0027),\n\t \n\t # Photoeye variations\n\t (\u0027LRPE\u0027, \u0027Photoeye_Tracking\u0027),\n\t (\u0027TPE\u0027, \u0027Photoeye_Tracking\u0027),\n\t \n\t # IO_Block variations\n\t (\u0027SIO\u0027, \u0027IO_Block\u0027),\n\t (\u0027FIOM\u0027, \u0027IO_Block\u0027),\n\t (\u0027FIO_\u0027, \u0027IO_Block\u0027),\n\t \n\t # Button variations (check after encoder)\n\t (\u0027EN\u0027, \u0027Chute_Button\u0027),\n\t (\u0027JR\u0027, \u0027Button\u0027),\n\t \n\t # Photoeye (shorter version after longer ones)\n\t (\u0027TPE\u0027, \u0027Photoeye_Tracking\u0027),\n\t (\u0027PE\u0027, \u0027Photoeye_Chute\u0027),\n\t \n\t # Other devices variations \n\t (\u0027DPM\u0027, \u0027DPM\u0027),\n\t (\u0027EPC\u0027, \u0027EPC\u0027),\n\t (\u0027MCM\u0027, \u0027MCM\u0027),\n\t (\u0027PRX\u0027, \u0027ProxSensor\u0027),\n\t (\u0027SS\u0027, \u0027SS_Button\u0027),\n\t (\u0027SOL\u0027, \u0027Solenoid\u0027),\n\t \n\t # Beacon Variations (single letters last)\n\t (\u0027B\u0027, \u0027Beacon\u0027),\n\t (\u0027G\u0027, \u0027Beacon\u0027),\n\t (\u0027R\u0027, \u0027Beacon\u0027),\n\t (\u0027H\u0027, \u0027Beacon\u0027),\n\t (\u0027A\u0027, \u0027Beacon\u0027),\n\t (\u0027S03\u0027, \u0027Scanner\u0027)\n\t]\n\t\n\tview \u003d \"\"\n\t\n\tfor key, value in device_mapping:\n\t if key in name:\n\t\t\tview \u003d value\n\t\t\tself.custom.view \u003d \"autStand/Equipment/\" + view\n\t\t\treturn \n\t\n\tself.custom.view \u003d \"autStand/Equipment/Camera\""
"script": "\tname \u003d self.view.custom.device\n\t\n\t# Use a list of tuples to maintain order - longer matches first\n\tdevice_mapping \u003d [\n\t (\u0027PS\u0027, \u0027PressureSensor\u0027),\n\t \t \n\t # Encoder variations (check these first before \u0027EN\u0027)\n\t (\u0027ENSH\u0027, \u0027Encoder\u0027),\n\t (\u0027ENW\u0027, \u0027Encoder\u0027),\n\t (\u0027ENCODER\u0027, \u0027Encoder\u0027),\n\t \n\t # Photoeye variations\n\t (\u0027LRPE\u0027, \u0027Photoeye_Tracking\u0027),\n\t (\u0027TPE\u0027, \u0027Photoeye_Tracking\u0027),\n\t \n\t # IO_Block variations\n\t (\u0027SIO\u0027, \u0027IO_Block\u0027),\n\t (\u0027FIOM\u0027, \u0027IO_Block\u0027),\n\t (\u0027FIO_\u0027, \u0027IO_Block\u0027),\n\t \n\t # Button variations (check after encoder)\n\t (\u0027EN\u0027, \u0027Chute_Button\u0027),\n\t (\u0027JR\u0027, \u0027Button\u0027),\n\t \n\t # Photoeye (shorter version after longer ones)\n\t (\u0027TPE\u0027, \u0027Photoeye_Tracking\u0027),\n\t (\u0027PE\u0027, \u0027Photoeye_Chute\u0027),\n\t \n\t # Other devices variations \n\t (\u0027DPM\u0027, \u0027DPM\u0027),\n\t (\u0027EPC\u0027, \u0027EPC\u0027),\n\t (\u0027MCM\u0027, \u0027MCM\u0027),\n\t (\u0027PRX\u0027, \u0027ProxSensor\u0027),\n\t (\u0027SS\u0027, \u0027SS_Button\u0027),\n\t (\u0027SOL\u0027, \u0027Solenoid\u0027),\n\t \n\t # Beacon Variations (single letters last)\n\t (\u0027B\u0027, \u0027Beacon\u0027),\n\t (\u0027G\u0027, \u0027Beacon\u0027),\n\t (\u0027R\u0027, \u0027Beacon\u0027),\n\t (\u0027H\u0027, \u0027Beacon\u0027),\n\t (\u0027A\u0027, \u0027Beacon\u0027),\n\t (\u0027S03\u0027, \u0027Scanner\u0027)\n\t\t\n\t]\n\t\n\tview \u003d \"\"\n\t\n\tfor key, value in device_mapping:\n\t if key in name:\n\t\t\tview \u003d value\n\t\t\tself.custom.view \u003d \"autStand/Equipment/\" + view\n\t\t\treturn \n\t\n\tself.custom.view \u003d \"autStand/Equipment/Camera\""
},
"persistent": true
},

View File

@ -10,8 +10,8 @@
"attributes": {
"lastModification": {
"actor": "admin",
"timestamp": "2025-11-08T15:19:46Z"
"timestamp": "2025-11-10T08:25:40Z"
},
"lastModificationSignature": "98a6c0b91032ad41732f547f4ec9d2e44fef6d9ed2d0cbf94471fadb1c89990c"
"lastModificationSignature": "52742c79e4927a83828abf86779dc63ef42e5774fa305c136260b225f27aeab2"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 B

After

Width:  |  Height:  |  Size: 73 B

View File

@ -10,8 +10,8 @@
"attributes": {
"lastModification": {
"actor": "admin",
"timestamp": "2025-11-08T15:17:45Z"
"timestamp": "2025-11-10T08:27:20Z"
},
"lastModificationSignature": "08dafc4ff229fb0d9c58e5fd60cd3d4312c9de7f2480fd40a4b899d406952d49"
"lastModificationSignature": "4373a81e6c47b64828242db9f688b9c8cec9f7b8145551f7218721bc53e9d9ce"
}
}

View File

@ -267,7 +267,7 @@
"dom": {
"onClick": {
"config": {
"script": "\t#create tags lists for the device\n\tprops \u003d self.view.params.tagProps\n\ttags_table_dataset \u003d autStand.devices.getAllTags(self, props[0])\n\tsystem.perspective.openDock(\u0027Docked-East-Device\u0027,params\u003d{\u0027tagProps\u0027:props, \"tags\":tags_table_dataset, \"name\":self.view.custom.deviceName} )"
"script": "\t#create tags lists for the device\n\tprops \u003d self.view.params.tagProps\n\ttags_table_dataset \u003d autStand.devices.getAllTags(self, props[0])\n\tsystem.perspective.openDock(\u0027Docked-East-Device\u0027,params\u003d{\u0027tagProps\u0027:props, \"tags\":tags_table_dataset, \"name\":\"\"} )"
},
"scope": "G",
"type": "script"