From a32b9d4d64094df2f6a8df3420839a96e9469ca2 Mon Sep 17 00:00:00 2001
From: wu <731351411@qq.com>
Date: 星期一, 15 一月 2024 16:32:11 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/CanadaMes
---
springboot-vue3/src/main/resources/config.properties | 2
CanadaMes-ui/src/views/Electrical/Positioning2.vue | 4
springboot-vue3/src/main/java/com/example/springboot/component/PlcParameter2.java | 13
CanadaMes-ui/src/views/Electrical/Servomanual.vue | 47
CanadaMes-ui/src/views/Electrical/Sign.vue | 10
springboot-vue3/src/main/resources/JsonFile/PlcParameter.json | 347 ++++++++++
springboot-vue3/src/main/java/com/example/springboot/component/PlcsignReview.java | 47
CanadaMes-ui/src/views/Electrical/ManualonePosition.vue | 42
CanadaMes-ui/src/views/Electrical/Parameter2.vue | 73 +-
springboot-vue3/src/main/java/com/example/springboot/component/Plcsign.java | 2
springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java | 2
CanadaMes-ui/src/lang/locales/zh-CN.json | 64 +
springboot-vue3/src/main/java/com/example/springboot/component/PlcParameter2Review.java | 347 +++++++++++
CanadaMes-ui/src/views/Electrical/Positioning1.vue | 4
CanadaMes-ui/src/views/Electrical/AutomaticParameterSetting.vue | 4
CanadaMes-ui/src/lang/locales/en-US.json | 3
CanadaMes-ui/src/views/Electrical/ManualJog.vue | 22
CanadaMes-ui/src/views/Electrical/ServoManualone.vue | 4
CanadaMes-ui/src/configuration/Sign.json | 565 +++++++++++++++--
CanadaMes-ui/src/configuration/parameter2.json | 11
springboot-vue3/src/main/java/com/example/springboot/component/PlcParameter1Review.java | 209 +++---
21 files changed, 1,473 insertions(+), 349 deletions(-)
diff --git a/CanadaMes-ui/src/configuration/Sign.json b/CanadaMes-ui/src/configuration/Sign.json
index 3401be1..dc57259 100644
--- a/CanadaMes-ui/src/configuration/Sign.json
+++ b/CanadaMes-ui/src/configuration/Sign.json
@@ -92,20 +92,6 @@
"page": "1"
},
{
- "name": "B01.SR out dec",
- "value": "1",
- "state": "1",
- "type": "1",
- "page": "1"
- },
- {
- "name": "B01.SR out in pos",
- "value": "1",
- "state": "1",
- "type": "1",
- "page": "1"
- },
- {
"name": "B01.SR in dec",
"value": "1",
"state": "1",
@@ -114,6 +100,20 @@
},
{
"name": "B01.SR in in pos",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ },
+ {
+ "name": "B01.SR out dec",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ },
+ {
+ "name": "B01.SR out in pos",
"value": "1",
"state": "1",
"type": "1",
@@ -204,13 +204,6 @@
"page": "1"
},
{
- "name": "B01.SR out safety",
- "value": "1",
- "state": "1",
- "type": "1",
- "page": "1"
- },
- {
"name": "B01.SR in safety",
"value": "1",
"state": "1",
@@ -218,7 +211,14 @@
"page": "1"
},
{
- "name": "B02.SR out safety",
+ "name": "B01.SR out safety",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ },
+ {
+ "name": "B02.SR in safety",
"value": "1",
"state": "1",
"type": "1",
@@ -253,7 +253,7 @@
"page": "1"
},
{
- "name": "SB.pause",
+ "name": "space",
"value": "1",
"state": "1",
"type": "1",
@@ -281,61 +281,398 @@
"page": "1"
},
{
- "name": "B02.SR in safety",
+ "name": "B02.SR out safety",
"value": "1",
"state": "1",
"type": "1",
"page": "1"
},
{
- "name": "SAFETYDOOR.requset",
+ "name": "SafetyDoor.requset",
"value": "1",
"state": "1",
"type": "1",
"page": "1"
},
{
- "name": "SAFETYDOOR.confirm",
+ "name": "SafetyDoor.confirm",
"value": "1",
"state": "1",
"type": "1",
"page": "1"
},
{
- "name": "SAFETYDOOR.reset",
+ "name": "SafetyDoor.reset",
"value": "1",
"state": "1",
"type": "1",
"page": "1"
},
+ {
+ "name": "Sspace",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ },
+ {
+ "name": "Sspce",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ },
+ {
+ "name": "Sspce",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ },
+ {
+ "name": "Sspce",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ },
+ {
+ "name": "A01.SR left dec",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ },
+ {
+ "name": "A01.SR left in pos",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ },
+ {
+ "name": "A01.SR left safety",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ },
+ {
+ "name": "A01.SR right dec",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ },
+ {
+ "name": "A01.SR right in pos",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ },
+ {
+ "name": "A01.SR right safety",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ },
+ {
+ "name": "A01.SR turn home",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ },
+ {
+ "name": "A01.SR turn up",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ },
+ {
+ "name": "A01.SR turn down",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ },
+ {
+ "name": "A01.SR travel home",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ },
+ {
+ "name": "A01.SR travel left dec",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ },
+ {
+ "name": "A01.SR travel left limit",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ },
+ {
+ "name": "A01.SR travel right dec",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ },
+ {
+ "name": "A01.SR travel right limit",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ },
+ {
+ "name": "space",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ },
+ {
+ "name": "space",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ }
+ ,
+ {
+ "name": "A02.SR left dec",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ }
+ ,
+ {
+ "name": "A02.SR left in pos",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ }
+ ,
+ {
+ "name": "A02.SR left safety",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ }
+ ,
+ {
+ "name": "A02.SR right dec",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ }
+ ,
+ {
+ "name": "A02.SR right in pos",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ }
+ ,
+ {
+ "name": "A02.SR right safety",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ }
+ ,
+ {
+ "name": "A02.SR turn home",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ }
+ ,
+ {
+ "name": "A02.SR turn up",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ }
+ ,
+ {
+ "name": "A02.SR turn down",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ }
+ ,
+ {
+ "name": "A02.SR travel home",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ }
+ ,
+ {
+ "name": "A02.SR travel left dec",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ }
+ ,
+ {
+ "name": "A02.SR travel left limit",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ }
+ ,
+ {
+ "name": "A02.SR travel right dec",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ }
+ ,
+ {
+ "name": "A02.SR travel right limit",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ }
+ ,
+ {
+ "name": "space",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ }
+ ,
+ {
+ "name": "space",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ }
+ ,
+ {
+ "name": "B01.SR origin",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ }
+ ,
+ {
+ "name": "B01.SR left limit",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ }
+ ,
+ {
+ "name": "B01.SR right limit",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ }
+ ,
+ {
+ "name": "B02.SR origin",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ }
+ ,
+ {
+ "name": "B02.SR left limit",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ }
+ ,
+ {
+ "name": "B02.SR right limit",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ }
+ ,
+ {
+ "name": "space",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ }
+ ,
+ {
+ "name": "space",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ }
+ ,
{
"name": "LED.red",
"value": "1",
"state": "1",
"type": "1",
"page": "1"
- },
+ }
+ ,
{
"name": "LED.green",
"value": "1",
"state": "1",
"type": "1",
"page": "1"
- },
+ }
+ ,
{
"name": "LED.yellow",
"value": "1",
"state": "1",
"type": "1",
"page": "1"
- },
+ }
+ ,
{
"name": "D01.LED.green",
"value": "1",
"state": "1",
"type": "1",
"page": "1"
- },
+ }
+ ,
{
"name": "D06.LED.green",
"value": "1",
@@ -349,98 +686,152 @@
"state": "1",
"type": "1",
"page": "1"
- },
+ }
+ ,
{
"name": "B01.YV.up down",
"value": "1",
"state": "1",
"type": "1",
"page": "1"
- },
+ }
+ ,
{
"name": "B01.YV.gassing",
"value": "1",
"state": "1",
"type": "1",
"page": "1"
- },
+ }
+ ,
{
"name": "B02.YV.turn",
"value": "1",
"state": "1",
"type": "1",
"page": "1"
- },
+ }
+ ,
{
"name": "B02.YV.up down",
"value": "1",
"state": "1",
"type": "1",
"page": "1"
- },
+ }
+ ,
{
"name": "B02.YV.gassing",
"value": "1",
"state": "1",
"type": "1",
"page": "1"
- },
+ }
+ ,
{
- "name": "SAFETYDOOR.led",
- "value": "1",
- "state": "1",
- "type": "1",
- "page": "1"
- },
- {
- "name": "SAFETYDOOR.open",
- "value": "1",
- "state": "1",
- "type": "1",
- "page": "1"
- },
- {
- "name": "B01.SR origin",
- "value": "1",
- "state": "1",
- "type": "1",
- "page": "1"
- },
- {
- "name": "B01.SR left limit",
- "value": "1",
- "state": "1",
- "type": "1",
- "page": "1"
- },
- {
- "name": "B01.SR right limit",
- "value": "1",
- "state": "1",
- "type": "1",
- "page": "1"
- },
- {
- "name": "B02.SR origin",
- "value": "1",
- "state": "1",
- "type": "1",
- "page": "1"
- },
- {
- "name": "B02.SR left limit",
- "value": "1",
- "state": "1",
- "type": "1",
- "page": "1"
- },
- {
- "name": "B02.SR right limit",
+ "name": "SafetyDoor.Led",
"value": "1",
"state": "1",
"type": "1",
"page": "1"
}
+ ,
+ {
+ "name": "SafetyDoor.open",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ }
+ ,
+ {
+ "name": "D01 SB.confirm",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ }
+ ,
+ {
+ "name": "space",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ }
+ ,
+ {
+ "name": "space",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ }
+ ,
+ {
+ "name": "A01 oilPump",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ }
+ ,
+ {
+ "name": "A01 motorCtr",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ }
+ ,
+ {
+ "name": "space",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ }
+ ,
+ {
+ "name": "space",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ }
+ ,
+ {
+ "name": "A02 oilPump",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ }
+ ,
+ {
+ "name": "A02 motorCtr",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ }
+ ,
+ {
+ "name": "space",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ },
+ {
+ "name": "space",
+ "value": "1",
+ "state": "1",
+ "type": "1",
+ "page": "1"
+ }
+
+
],
"address": [
{
diff --git a/CanadaMes-ui/src/configuration/parameter2.json b/CanadaMes-ui/src/configuration/parameter2.json
index b181b8c..79f5ef3 100644
--- a/CanadaMes-ui/src/configuration/parameter2.json
+++ b/CanadaMes-ui/src/configuration/parameter2.json
@@ -395,6 +395,15 @@
}
- ]
+ ],
+ [
+ {
+ "button": {
+ "name": "杞�ュ仠",
+ "value":0,
+ "address":"DB10.0",
+ "type":"66"
+ }
+ }]
]
\ No newline at end of file
diff --git a/CanadaMes-ui/src/lang/locales/en-US.json b/CanadaMes-ui/src/lang/locales/en-US.json
index 422dbf4..60023b8 100644
--- a/CanadaMes-ui/src/lang/locales/en-US.json
+++ b/CanadaMes-ui/src/lang/locales/en-US.json
@@ -400,7 +400,8 @@
"鎬ュ仠鍚庝腑姝�/缁х画閫夋嫨": "Abort/ResumeTasks",
"A01缁堟/缁х画": "A01Abort/ResumeTasks",
"A02缁堟/缁х画": "A02Abort/ResumeTasks",
- "瀛樼墖绛夊緟寤舵椂": "Storage wait delay"
+ "瀛樼墖绛夊緟寤舵椂": "Storage wait delay",
+ "杞�ュ仠": "emgHMI"
},
"langPositioning1": {
diff --git a/CanadaMes-ui/src/lang/locales/zh-CN.json b/CanadaMes-ui/src/lang/locales/zh-CN.json
index baa4a6d..cc0008c 100644
--- a/CanadaMes-ui/src/lang/locales/zh-CN.json
+++ b/CanadaMes-ui/src/lang/locales/zh-CN.json
@@ -389,10 +389,10 @@
"D05.SR in pos": "D05.鍒颁綅浼犳劅鍣�",
"D06.SR dec": "D06.鍑忛�熶紶鎰熷櫒",
"D06.SR in pos": "D06.鍒颁綅浼犳劅鍣�",
- "B01.SR out dec": "B01.鍑虹墖鍑忛�熶紶鎰熷櫒",
- "B01.SR out in pos": "B01.鍑虹墖鍒颁綅浼犳劅鍣�",
"B01.SR in dec": "B01.杩涚墖鍑忛�熶紶鎰熷櫒",
"B01.SR in in pos": "B01.杩涚墖鍒颁綅浼犳劅鍣�",
+ "B01.SR out dec": "B01.鍑虹墖鍑忛�熶紶鎰熷櫒",
+ "B01.SR out in pos": "B01.鍑虹墖鍒颁綅浼犳劅鍣�",
"B01.SR turn on": "B01.缈昏浆涓婂埌浣嶄紶鎰熷櫒",
"B01.SR turn off": "B01.缈昏浆涓嬪埌浣嶄紶鎰熷櫒",
"B01.SR up": "B01.涓婂崌鍒颁綅浼犳劅鍣�",
@@ -405,21 +405,56 @@
"B02.SR turn off": "B02.缈昏浆涓嬪埌浣嶄紶鎰熷櫒",
"B02.SR up": "B02.涓婂崌鍒颁綅浼犳劅鍣�",
"B02.SR down": "B02.涓嬮檷鍒颁綅浼犳劅鍣�",
- "B01.SR out safety": "B01.鍑虹墖瀹夊叏浼犳劅鍣�",
"B01.SR in safety": "B01.杩涚墖瀹夊叏浼犳劅鍣�",
- "B02.SR out safety": "B02.鍑虹墖瀹夊叏浼犳劅鍣�",
+ "B01.SR out safety": "B01.鍑虹墖瀹夊叏浼犳劅鍣�",
+ "B02.SR in safety": "B02.杩涚墖瀹夊叏浼犳劅鍣�",
"SB.start(+)": "SB.鍚姩锛�+锛夋寜閽�",
"SB.stop(1)": "SB.鍋滄锛�-锛夋寜閽�",
"SB.reset": "SB.澶嶄綅鎸夐挳",
"SB.auto/manul": "SB.鎵�/鑷垏鎹㈡寜閽�",
- "SB.pause": "SB.鏆傚仠鎸夐挳",
+ "D01.SB.confirm": "鐜荤拑淇℃伅纭",
"SB.emg": "SB.鎬ュ仠鎸夐挳",
"D01.SB.start": "D01.鍚姩",
"D06.SB.start": "D06.鍚姩",
- "B02.SR in safety": "B02.杩涚墖瀹夊叏浼犳劅鍣�",
- "SAFETYDOOR.requset": "瀹夊叏闂ㄨ姹傝繘鍏�",
- "SAFETYDOOR.confirm": "瀹夊叏闂ㄧ‘璁�",
- "SAFETYDOOR.reset": "瀹夊叏闂ㄥ浣�",
+ "B02.SR out safety ": "B02.鍑虹墖瀹夊叏浼犳劅鍣�",
+ "SafetyDoor.requset": "瀹夊叏闂ㄨ姹傝繘鍏�",
+ "SafetyDoor.confirm": "瀹夊叏闂ㄧ‘璁�",
+ "SafetyDoor.reset": "瀹夊叏闂ㄥ浣�",
+ "Sspce":"澶囩敤",
+ "A01.SR left dec":"A01宸﹂敭閫�",
+ "A01.SR left in pos":"A01宸﹀埌浣�",
+ "A01.SR left safety":"A01宸﹀畨鍏�",
+ "A01.SR right dec":"A01鍙抽敭閫�",
+ "A01.SR right in pos":"A01鍙冲埌浣�",
+ "A01.SR right safety":"A01鍙冲畨鍏�",
+ "A01.SR turn home":"A01缈昏浆鍘熺偣",
+ "A01.SR turn up":"A01缈昏浆涓婃瀬闄�",
+ "A01.SR turn down":"A01缈昏浆涓嬫瀬闄�",
+ "A01.SR travel home":"A01琛岃蛋鍘熺偣",
+ "A01.SR travel left dec":"A01琛岃蛋宸﹀噺閫�",
+ "A01.SR travel left limit":"A01琛岃蛋宸︽瀬闄�",
+ "A01.SR travel right dec":"A01琛岃蛋鍙冲噺閫�",
+ "A01.SR travel right limit":"A01琛岃蛋鍙虫瀬闄�",
+ "A02.SR left dec":"A02宸﹂敭閫�",
+ "A02.SR left in pos":"A02宸﹀埌浣�",
+ "A02.SR left safety":"A02宸﹀畨鍏�",
+ "A02.SR right dec":"A02鍙抽敭閫�",
+ "A02.SR right in pos":"A02鍙冲埌浣�",
+ "A02.SR right safety":"A02鍙冲畨鍏�",
+ "A02.SR turn home":"A02缈昏浆鍘熺偣",
+ "A02.SR turn up":"A02缈昏浆涓婃瀬闄�",
+ "A02.SR turn down":"A02缈昏浆涓嬫瀬闄�",
+ "A02.SR travel home":"A02琛岃蛋鍘熺偣",
+ "A02.SR travel left dec":"A02琛岃蛋宸﹀噺閫�",
+ "A02.SR travel left limit":"A02琛岃蛋宸︽瀬闄�",
+ "A02.SR travel right dec":"A02琛岃蛋鍙冲噺閫�",
+ "A02.SR travel right limit":"A02琛岃蛋鍙虫瀬闄�",
+ "B01.SR origin":"B01.鍘熺偣",
+ "B01.SR left limit":"B01.宸︽瀬闄�",
+ "B01.SR right limit":"B01.鍙虫瀬闄�",
+ "B02.SR origin":"B02.鍘熺偣",
+ "B02.SR left limit":"B02.宸︽瀬闄�",
+ "B02.SR right limit":"B02.鍙虫瀬闄�",
"LED.red": "涓夎壊鐏孩",
"LED.green": "涓夎壊鐏豢",
"LED.yellow": "涓夎壊鐏粍",
@@ -431,8 +466,15 @@
"B02.YV.turn": "B02.鐢电闃�缈昏浆",
"B02.YV.up down": "B02.鐢电闃�涓婂崌涓嬮檷",
"B02.YV.gassing": "B02.鐢电闃�鍚规皵",
- "SAFETYDOOR.led": "瀹夊叏闂ㄧ姸鎬佺伅",
- "SAFETYDOOR.open": "瀹夊叏闂ㄦ墦寮�"
+ "SafetyDoor.Led": "瀹夊叏闂ㄧ姸鎬佺伅",
+ "SafetyDoor.open": "瀹夊叏闂ㄦ墦寮�",
+ "D01 SB.confirm":"鐜荤拑淇℃伅纭鎸囩ず鐏�",
+ "A01 oilPump":"A01娉ㄦ补娉�",
+ "A01 motorCtr":"A01鐢垫満鎺у埗",
+ "A02 oilPump":"A02娉ㄦ补娉�",
+ "A02 motorCtr":"A02鐢垫満鎺у埗",
+ "space":"澶囩敤"
+
},
"Statelang": {
"D01.State": "D01.鐘舵��",
diff --git a/CanadaMes-ui/src/views/Electrical/AutomaticParameterSetting.vue b/CanadaMes-ui/src/views/Electrical/AutomaticParameterSetting.vue
index c1831cb..c2b94f9 100644
--- a/CanadaMes-ui/src/views/Electrical/AutomaticParameterSetting.vue
+++ b/CanadaMes-ui/src/views/Electrical/AutomaticParameterSetting.vue
@@ -19,9 +19,9 @@
<el-breadcrumb separator-class="el-icon-arrow-right" class="el-breadcrumb">
<router-link to="/Electrical/Parameter2" tag="el-button" type="text" active-class="blue-button">{{ $t('Automatic State')
}}</router-link>
- <router-link to="/Electrical/ManualJog" tag="el-button" type="text" active-class="blue-button">{{
+ <!-- <router-link to="/Electrical/ManualJog" tag="el-button" type="text" active-class="blue-button">{{
$t('ManualJog')
- }}</router-link>
+ }}</router-link> -->
<router-link to="/Electrical/ManualonePosition" tag="el-button" type="text" active-class="blue-button">{{
$t('ManualonePosition')
diff --git a/CanadaMes-ui/src/views/Electrical/ManualJog.vue b/CanadaMes-ui/src/views/Electrical/ManualJog.vue
index 9897ac8..e23ebb1 100644
--- a/CanadaMes-ui/src/views/Electrical/ManualJog.vue
+++ b/CanadaMes-ui/src/views/Electrical/ManualJog.vue
@@ -1,22 +1,19 @@
<template>
<div class="app">
- <el-breadcrumb separator-class="el-icon-arrow-right" class="el-breadcrumb">
+ <!-- <el-breadcrumb separator-class="el-icon-arrow-right" class="el-breadcrumb">
<router-link to="/Electrical/alarm" tag="el-button" type="text" active-class="blue-button">{{ $t('Alarm')
}}</router-link>
<router-link to="/Electrical/State" tag="el-button" type="text" active-class="blue-button">{{ $t('State')
}}</router-link>
- <!-- <router-link to="/Electrical/Action" tag="el-button" type="text" active-class="blue-button">{{ $t('Action')
- }}</router-link> -->
- <!-- <router-link to="/Electrical/Parameter" tag="el-button" type="text" active-class="blue-button">{{ $t('Parameter')
- }}</router-link> -->
+
<router-link to="/Electrical/Sign" tag="el-button" type="text" active-class="blue-button">{{ $t('Sign')
}}</router-link>
<router-link to="/Electrical/Servomanual" tag="el-button" type="text" active-class="blue-button">{{
$t('Parameter')
}}</router-link>
- </el-breadcrumb>
+ </el-breadcrumb> -->
- <el-breadcrumb separator-class="el-icon-arrow-right" class="el-breadcrumb">
+ <!-- <el-breadcrumb separator-class="el-icon-arrow-right" class="el-breadcrumb">
<router-link to="/Electrical/Parameter2" tag="el-button" type="text" active-class="blue-button">{{ $t('Automatic State')
}}</router-link>
<router-link to="/Electrical/ManualJog" tag="el-button" type="text" active-class="blue-button">{{
@@ -30,24 +27,17 @@
<router-link to="/Electrical/Servomanualone" tag="el-button" type="text" active-class="blue-button">{{
$t('Servomanualone')
}}</router-link>
- <!-- <router-link to="/Electrical/Parameter1" tag="el-button" type="text" active-class="blue-button">{{ $t('Parameter1')
- }}</router-link> -->
+
<router-link to="/Electrical/Positioning1" tag="el-button" type="text" active-class="blue-button">{{
$t('Address parameter settings')
}}</router-link>
- <!-- <router-link to="/Electrical/Positioning2" tag="el-button" type="text" active-class="blue-button">{{
- $t('Positioning2')
- }}</router-link> -->
- <!-- <router-link to="/Electrical/ManualonePosition2" tag="el-button" type="text" active-class="blue-button">{{
- $t('ManualonePosition2')
- }}</router-link> -->
<router-link to="/Electrical/AutomaticParameterSetting" tag="el-button" type="text" active-class="blue-button">{{
$t('Speed parameter settings')
}}</router-link>
- </el-breadcrumb>
+ </el-breadcrumb> -->
<el-row :gutter="40" >
<el-col :span="26" v-for="(dataGroup, groupIndex) in jsonData" :key="groupIndex">
diff --git a/CanadaMes-ui/src/views/Electrical/ManualonePosition.vue b/CanadaMes-ui/src/views/Electrical/ManualonePosition.vue
index 8d15a80..bde607c 100644
--- a/CanadaMes-ui/src/views/Electrical/ManualonePosition.vue
+++ b/CanadaMes-ui/src/views/Electrical/ManualonePosition.vue
@@ -18,31 +18,24 @@
<el-breadcrumb separator-class="el-icon-arrow-right" class="el-breadcrumb">
<router-link to="/Electrical/Parameter2" tag="el-button" type="text" active-class="blue-button">{{ $t('Automatic State')
}}</router-link>
- <router-link to="/Electrical/ManualJog" tag="el-button" type="text" active-class="blue-button">{{
+ <!-- <router-link to="/Electrical/ManualJog" tag="el-button" type="text" active-class="blue-button">{{
$t('ManualJog')
- }}</router-link>
+ }}</router-link> -->
<router-link to="/Electrical/ManualonePosition" tag="el-button" type="text" active-class="blue-button">{{
$t('ManualonePosition')
}}</router-link>
-<router-link to="/Electrical/Servomanualone" tag="el-button" type="text" active-class="blue-button">{{
- $t('Servomanualone')
- }}</router-link>
- <!-- <router-link to="/Electrical/Parameter1" tag="el-button" type="text" active-class="blue-button">{{ $t('Parameter1')
- }}</router-link> -->
+<router-link v-if="hasPermission" to="/Electrical/Servomanualone" tag="el-button" type="text" active-class="blue-button">
+ {{ $t('Servomanualone') }}
+ </router-link>
+
- <router-link to="/Electrical/Positioning1" tag="el-button" type="text" active-class="blue-button">{{
+ <router-link v-if="hasPermission" to="/Electrical/Positioning1" tag="el-button" type="text" active-class="blue-button">{{
$t('Address parameter settings')
}}</router-link>
- <!-- <router-link to="/Electrical/Positioning2" tag="el-button" type="text" active-class="blue-button">{{
- $t('Positioning2')
- }}</router-link> -->
-
- <!-- <router-link to="/Electrical/ManualonePosition2" tag="el-button" type="text" active-class="blue-button">{{
- $t('ManualonePosition2')
- }}</router-link> -->
- <router-link to="/Electrical/AutomaticParameterSetting" tag="el-button" type="text" active-class="blue-button">{{
+
+ <router-link v-if="hasPermission" to="/Electrical/AutomaticParameterSetting" tag="el-button" type="text" active-class="blue-button">{{
$t('Speed parameter settings')
}}</router-link>
@@ -93,6 +86,7 @@
<div class="container">
<component :is="embeddedComponent"></component>
+ <component :is="embeddedComponent2"></component>
</div>
<!-- <el-button @click="submitDataToBackend">鎻愪氦鏁版嵁鍒板悗绔�</el-button> -->
@@ -106,6 +100,10 @@
import data from '../../configuration/Manualoneposition'
import ManualonePosition2 from './ManualonePosition2.vue';
+import ManualJog from './ManualJog.vue';
+import {
+SelectPermissionByUserName, currentUsername
+} from "../../api/home";
// import { createWebSocket } from '../../api/websocket.js';
let socket;
export default {
@@ -116,6 +114,8 @@
jsonData: data,
language: this.$i18n.locale,
embeddedComponent: ManualonePosition2,
+ embeddedComponent2: ManualJog,
+ hasPermission: false // 榛樿娌℃湁鏉冮檺
// 鍔犺浇鏁翠釜data.json鏂囦欢浣滀负jsonData
}
@@ -129,7 +129,17 @@
this.replaceChineseWithEnglish();
}
this.$forceUpdate();
+ currentUsername().then(res => {
+ SelectPermissionByUserName(res.data).then(res => {
+ res.data.permission.forEach(item => {
+ if (item.permissionId == "36" && item.state == 1) {
+ this.hasPermission = true;
+ }
+
+ });
+ });
+ });
},
methods: {
diff --git a/CanadaMes-ui/src/views/Electrical/Parameter2.vue b/CanadaMes-ui/src/views/Electrical/Parameter2.vue
index 5542c24..b22cce4 100644
--- a/CanadaMes-ui/src/views/Electrical/Parameter2.vue
+++ b/CanadaMes-ui/src/views/Electrical/Parameter2.vue
@@ -48,13 +48,13 @@
active-class="blue-button"
>{{ $t("Automatic State") }}</router-link
>
- <router-link
+ <!-- <router-link
to="/Electrical/ManualJog"
tag="el-button"
type="text"
active-class="blue-button"
>{{ $t("ManualJog") }}</router-link
- >
+ > -->
<router-link
to="/Electrical/ManualonePosition"
@@ -64,37 +64,18 @@
>{{ $t("ManualonePosition") }}</router-link
>
- <router-link
- to="/Electrical/Servomanualone"
- tag="el-button"
- type="text"
- active-class="blue-button"
- >{{ $t("Servomanualone") }}</router-link
- >
- <!-- <router-link to="/Electrical/Parameter1" tag="el-button" type="text" active-class="blue-button">{{ $t('Parameter1')
- }}</router-link> -->
-
- <router-link
- to="/Electrical/Positioning1"
- tag="el-button"
- type="text"
- active-class="blue-button"
- >{{ $t("Address parameter settings") }}</router-link
- >
- <!-- <router-link to="/Electrical/Positioning2" tag="el-button" type="text" active-class="blue-button">{{
- $t('Positioning2')
- }}</router-link> -->
- <!--
- <router-link to="/Electrical/ManualonePosition2" tag="el-button" type="text" active-class="blue-button">{{
- $t('ManualonePosition2')
- }}</router-link> -->
- <router-link
- to="/Electrical/AutomaticParameterSetting"
- tag="el-button"
- type="text"
- active-class="blue-button"
- >{{ $t("Speed parameter settings") }}</router-link
- >
+ <router-link v-if="hasPermission" to="/Electrical/Servomanualone" tag="el-button" type="text" active-class="blue-button">
+ {{ $t('Servomanualone') }}
+ </router-link>
+
+
+ <router-link v-if="hasPermission" to="/Electrical/Positioning1" tag="el-button" type="text" active-class="blue-button">{{
+ $t('Address parameter settings')
+ }}</router-link>
+
+ <router-link v-if="hasPermission" to="/Electrical/AutomaticParameterSetting" tag="el-button" type="text" active-class="blue-button">{{
+ $t('Speed parameter settings')
+ }}</router-link>
</el-breadcrumb>
<el-row :gutter="40">
@@ -209,6 +190,9 @@
<script>
import LanguageMixin from "../../lang/LanguageMixin";
import data from "../../configuration/parameter2";
+import {
+SelectPermissionByUserName, currentUsername
+} from "../../api/home";
// import { throttle } from 'lodash';
let socket;
@@ -226,6 +210,9 @@
jsonData: data,
inputValue: "",
language: this.$i18n.locale,
+
+
+ hasPermission: false // 榛樿娌℃湁鏉冮檺
// 鍔犺浇鏁翠釜data.json鏂囦欢浣滀负jsonData
};
@@ -240,6 +227,17 @@
this.replaceChineseWithEnglish();
}
this.$forceUpdate();
+ currentUsername().then(res => {
+ SelectPermissionByUserName(res.data).then(res => {
+ res.data.permission.forEach(item => {
+ if (item.permissionId == "36" && item.state == 1) {
+ this.hasPermission = true;
+ }
+
+ });
+ });
+
+ });
},
computed: {},
@@ -338,6 +336,15 @@
const jsonString2 = JSON.stringify(jsonObject2);
console.log("鎵�鏈塗ype涓�0鐨剉alue:", jsonString2);
socket?.send(jsonString2);
+
+ // 寤惰繜2绉掑彂閫佹寚瀹氬唴瀹�
+setTimeout(() => {
+ const jsonObject = { data: [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [], []] };
+ const jsonString = JSON.stringify(jsonObject);
+ console.log("鍙戦�佺殑鍐呭:", jsonString);
+ socket?.send(jsonString);
+}, 2000);
+
}
if (
diff --git a/CanadaMes-ui/src/views/Electrical/Positioning1.vue b/CanadaMes-ui/src/views/Electrical/Positioning1.vue
index 7b46cad..10b4905 100644
--- a/CanadaMes-ui/src/views/Electrical/Positioning1.vue
+++ b/CanadaMes-ui/src/views/Electrical/Positioning1.vue
@@ -48,13 +48,13 @@
active-class="blue-button"
>{{ $t("Automatic State") }}</router-link
>
- <router-link
+ <!-- <router-link
to="/Electrical/ManualJog"
tag="el-button"
type="text"
active-class="blue-button"
>{{ $t("ManualJog") }}</router-link
- >
+ > -->
<router-link
to="/Electrical/ManualonePosition"
diff --git a/CanadaMes-ui/src/views/Electrical/Positioning2.vue b/CanadaMes-ui/src/views/Electrical/Positioning2.vue
index 1212fc2..c8f65f9 100644
--- a/CanadaMes-ui/src/views/Electrical/Positioning2.vue
+++ b/CanadaMes-ui/src/views/Electrical/Positioning2.vue
@@ -19,9 +19,9 @@
<el-breadcrumb separator-class="el-icon-arrow-right" class="el-breadcrumb">
<router-link to="/Electrical/Parameter2" tag="el-button" type="text" active-class="blue-button">{{ $t('Automatic State')
}}</router-link>
- <router-link to="/Electrical/ManualJog" tag="el-button" type="text" active-class="blue-button">{{
+ <!-- <router-link to="/Electrical/ManualJog" tag="el-button" type="text" active-class="blue-button">{{
$t('ManualJog')
- }}</router-link>
+ }}</router-link> -->
<router-link to="/Electrical/ManualonePosition" tag="el-button" type="text" active-class="blue-button">{{
$t('ManualonePosition')
diff --git a/CanadaMes-ui/src/views/Electrical/ServoManualone.vue b/CanadaMes-ui/src/views/Electrical/ServoManualone.vue
index e2acb21..8244745 100644
--- a/CanadaMes-ui/src/views/Electrical/ServoManualone.vue
+++ b/CanadaMes-ui/src/views/Electrical/ServoManualone.vue
@@ -43,13 +43,13 @@
active-class="blue-button"
>{{ $t("Automatic State") }}</router-link
>
- <router-link
+ <!-- <router-link
to="/Electrical/ManualJog"
tag="el-button"
type="text"
active-class="blue-button"
>{{ $t("ManualJog") }}</router-link
- >
+ > -->
<router-link
to="/Electrical/ManualonePosition"
diff --git a/CanadaMes-ui/src/views/Electrical/Servomanual.vue b/CanadaMes-ui/src/views/Electrical/Servomanual.vue
index cd03f42..d64d9ea 100644
--- a/CanadaMes-ui/src/views/Electrical/Servomanual.vue
+++ b/CanadaMes-ui/src/views/Electrical/Servomanual.vue
@@ -20,31 +20,24 @@
<el-breadcrumb separator-class="el-icon-arrow-right" class="el-breadcrumb">
<router-link to="/Electrical/Parameter2" tag="el-button" type="text" active-class="blue-button">{{ $t('Automatic State')
}}</router-link>
- <router-link to="/Electrical/ManualJog" tag="el-button" type="text" active-class="blue-button">{{
+ <!-- <router-link to="/Electrical/ManualJog" tag="el-button" type="text" active-class="blue-button">{{
$t('ManualJog')
- }}</router-link>
+ }}</router-link> -->
<router-link to="/Electrical/ManualonePosition" tag="el-button" type="text" active-class="blue-button">{{
$t('ManualonePosition')
}}</router-link>
-<router-link to="/Electrical/Servomanualone" tag="el-button" type="text" active-class="blue-button">{{
- $t('Servomanualone')
- }}</router-link>
- <!-- <router-link to="/Electrical/Parameter1" tag="el-button" type="text" active-class="blue-button">{{ $t('Parameter1')
- }}</router-link> -->
+<router-link v-if="hasPermission" to="/Electrical/Servomanualone" tag="el-button" type="text" active-class="blue-button">
+ {{ $t('Servomanualone') }}
+ </router-link>
+
- <router-link to="/Electrical/Positioning1" tag="el-button" type="text" active-class="blue-button">{{
+ <router-link v-if="hasPermission" to="/Electrical/Positioning1" tag="el-button" type="text" active-class="blue-button">{{
$t('Address parameter settings')
}}</router-link>
- <!-- <router-link to="/Electrical/Positioning2" tag="el-button" type="text" active-class="blue-button">{{
- $t('Positioning2')
- }}</router-link> -->
-
- <!-- <router-link to="/Electrical/ManualonePosition2" tag="el-button" type="text" active-class="blue-button">{{
- $t('ManualonePosition2')
- }}</router-link> -->
- <router-link to="/Electrical/AutomaticParameterSetting" tag="el-button" type="text" active-class="blue-button">{{
+
+ <router-link v-if="hasPermission" to="/Electrical/AutomaticParameterSetting" tag="el-button" type="text" active-class="blue-button">{{
$t('Speed parameter settings')
}}</router-link>
@@ -56,18 +49,36 @@
<script>
import LanguageMixin from '../../lang/LanguageMixin'
import data from '../../configuration/ServoManualone'
+import {
+SelectPermissionByUserName, currentUsername
+} from "../../api/home";
export default {
name: "Servomanual",
mixins: [LanguageMixin],
+
data () {
return {
- jsonData: data // 鍔犺浇鏁翠釜data.json鏂囦欢浣滀负jsonData
+ jsonData: data,
+
+ hasPermission: false // 榛樿娌℃湁鏉冮檺
}
},
created () {
// 閫氳繃璺敱璺宠浆鍒�/Electrical/Servomanualone椤甸潰
- this.$router.push('/Electrical/Servomanualone');
+ this.$router.push('/Electrical/Parameter2');
+
+ currentUsername().then(res => {
+ SelectPermissionByUserName(res.data).then(res => {
+ res.data.permission.forEach(item => {
+ if (item.permissionId == "36" && item.state == 1) {
+ this.hasPermission = true;
+ }
+
+ });
+ });
+
+ });
}
}
</script>
diff --git a/CanadaMes-ui/src/views/Electrical/Sign.vue b/CanadaMes-ui/src/views/Electrical/Sign.vue
index f5e3edd..4c0108f 100644
--- a/CanadaMes-ui/src/views/Electrical/Sign.vue
+++ b/CanadaMes-ui/src/views/Electrical/Sign.vue
@@ -64,7 +64,13 @@
},
activated(){
this.init();
-
+ this.record.xyData = this.jsonData.sign;
+ const language = this.$i18n.locale;
+ if (language === 'zh-CN') {
+ this.replaceChineseWithEnglish();
+ } else {
+ this.localizedRoles = [...this.record.xyData];
+ }
},
methods: {
showdata () {
@@ -132,7 +138,7 @@
const language = this.$i18n.locale;
- if (language === 'en-US') {
+ if (language === 'zh-CN') {
this.replaceChineseWithEnglish();
} else {
this.localizedRoles = [...this.record.xyData];
diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/PlcParameter1Review.java b/springboot-vue3/src/main/java/com/example/springboot/component/PlcParameter1Review.java
index ab4ee3c..f3737e1 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/component/PlcParameter1Review.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/component/PlcParameter1Review.java
@@ -40,11 +40,12 @@
}
return instance;
}
+
PlcParameterObject plcParameterObject = new PlcParameterObject();//璇B鍖烘暟鎹疄渚�
- private void init() {
+ private void init() {
try {
- String jsonfilename= PlcParameter1Review.class.getResource("/JsonFile/PlcParameter.json").getFile();
+ String jsonfilename = PlcParameter1Review.class.getResource("/JsonFile/PlcParameter.json").getFile();
FileReader fileReader = new FileReader(jsonfilename);
BufferedReader bufferedReader = new BufferedReader(fileReader);
@@ -55,27 +56,27 @@
content.append(line);
}
- bufferedReader.close();
+ bufferedReader.close();
fileReader.close();
-
+
JSONObject jsonfileobj = new JSONObject(content.toString());
JSONArray jsonArray = jsonfileobj.getJSONArray("parameteInfor");
- plcParameterObject.setPlcAddressBegin(jsonfileobj.getStr("plcAddressBegin"));//璁剧疆璧峰浣嶅湴鍧�
- plcParameterObject.setPlcAddressLength(Integer.valueOf(jsonfileobj.getStr("plcAddressLenght")));//璁剧疆鍦板潃闀垮害
-
+ plcParameterObject.setPlcAddressBegin(jsonfileobj.getStr("plcAddressBegin"));//璁剧疆璧峰浣嶅湴鍧�
+ plcParameterObject.setPlcAddressLength(Integer.valueOf(jsonfileobj.getStr("plcAddressLenght")));//璁剧疆鍦板潃闀垮害
+
for (int i = 0; i < jsonArray.size(); i++) {
- JSONObject parameterObj = jsonArray.getJSONObject(i);
-
+ JSONObject parameterObj = jsonArray.getJSONObject(i);
+
PlcParameterInfo plcParameterInfo = new PlcParameterInfo(jsonfileobj.getStr("plcAddressBegin")); //鍙傛暟瀹炰緥
- String codeid=parameterObj.getStr("codeId");
+ String codeid = parameterObj.getStr("codeId");
plcParameterInfo.setCodeId(codeid);
plcParameterInfo.setAddressIndex(Integer.valueOf(parameterObj.getStr("addressIndex")));
plcParameterInfo.setRatio(Integer.valueOf(parameterObj.getStr("ratio")));
- plcParameterInfo.setAddressLength(Integer.valueOf(parameterObj.getStr("addressLenght")));
- plcParameterInfo.setUnit(parameterObj.getStr("unit"));
+ plcParameterInfo.setAddressLength(Integer.valueOf(parameterObj.getStr("addressLenght")));
+ plcParameterInfo.setUnit(parameterObj.getStr("unit"));
plcParameterObject.addPlcParameter(plcParameterInfo);
- }
+ }
System.out.println("");
} catch (IOException e) {
e.printStackTrace();
@@ -92,122 +93,126 @@
} catch (InterruptedException e) {
e.printStackTrace();
}
- byte[] getplcvlues=S7control.getinstance().ReadByte(plcParameterObject.getPlcAddressBegin(),plcParameterObject.getPlcAddressLength());
+ byte[] getplcvlues = S7control.getinstance().ReadByte(plcParameterObject.getPlcAddressBegin(), plcParameterObject.getPlcAddressLength());
plcParameterObject.setPlcParameterList(getplcvlues);
- int index=plcParameterObject.getPlcParameter("conveyorVelocity(AutoFAST)").getAddressIndex();
- S7control.getinstance().WriteWord(plcParameterObject.getPlcParameter("conveyorVelocity(AutoFAST)").getAddress(index), (short)100);
-
+ int index = plcParameterObject.getPlcParameter("conveyorVelocity(AutoFAST)").getAddressIndex();
+ S7control.getinstance().WriteWord(plcParameterObject.getPlcParameter("conveyorVelocity(AutoFAST)").getAddress(index), (short) 100);
+
List<String> addresses = new ArrayList<>();
addresses.add("conveyorVelocity(AutoFAST)");
addresses.add("conveyorVelocity(AutoSLOW)");
addresses.add("conveyorVelocity(Manual)");
addresses.add("A01A02TURNJOGVelocity");
- addresses.add("A01A02TRAVELJOGVelocity");
-
+ addresses.add("A01A02TRAVELJOGVelocity");
+
plcParameterObject.getPlcParameterValues(addresses);
-
- JSONObject jsonObject = new JSONObject();
-
+
+ JSONObject jsonObject = new JSONObject();
+
jsonObject.append("params", plcParameterObject.getPlcParameterValues(addresses));
jsonObject.append("fanzhuan", plcParameterObject.getPlcParameter("conveyorVelocity(AutoFAST)").getValue());
jsonObject.append("xiaoche", plcParameterObject.getPlcParameter("").getValue());
- WebSocketServer sendwServer = WebSocketServer.sessionMap.get("Parameter1");
+ ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("Parameter1");
if (sendwServer != null) {
- sendwServer.sendMessage(jsonObject.toString());
- }
+ for (WebSocketServer webserver : sendwServer) {
- WebSocketServer webSocketServer = WebSocketServer.sessionMap.get("Parameter1");
- if (webSocketServer != null) {
- List<String> messages = webSocketServer.getMessages();
- List<String> waddresses1 = new ArrayList<>();
- waddresses1.add("DB100.0");
- waddresses1.add("DB100.2");
- waddresses1.add("DB100.4");
- waddresses1.add("DB100.6");
- waddresses1.add("DB100.26");
- waddresses1.add("DB100.28");
- waddresses1.add("DB100.30");
- waddresses1.add("DB100.32");
- waddresses1.add("DB100.34");
- waddresses1.add("DB100.36");
- waddresses1.add("DB100.38");
- waddresses1.add("DB100.40");
+ webserver.sendMessage(jsonObject.toString());
- String addressList2 = "DB100.8";
- String addressList3 = "DB100.12";
- if (!messages.isEmpty()) {
- // 灏嗘渶鍚庝竴涓秷鎭浆鎹负 short 绫诲瀷鐨勫垪琛�
- String lastMessage = messages.get(messages.size() - 1);
- // System.out.println("lastMessage锛�" + lastMessage);
- JSONArray messageArray = new JSONArray(lastMessage);
+ if (webserver != null) {
- // 鏁村悎绗� 1 鍒� 3 涓暟缁勫苟鍘绘帀 null 鍏冪礌
- List<Short> mergedList = new ArrayList<>();
- for (int i = 0; i < 3; i++) {
- JSONArray sublist = messageArray.getJSONArray(i);
- for (int j = 0; j < sublist.size(); j++) {
- Object value = sublist.get(j);
- if (value != null && !value.toString().equals("null")) {
- try {
- String cleanedValue = value.toString().replaceAll("[^0-9-]", "");
- short sValue = Short.parseShort(cleanedValue.trim());
- mergedList.add(sValue);
- } catch (NumberFormatException e) {
- // 濡傛灉鏃犳硶瑙f瀽涓� short 绫诲瀷锛屽垯蹇界暐璇ラ儴鍒�
- System.err.println("Could not parse value: " + value);
+ List<String> messages = webserver.getMessages();
+ List<String> waddresses1 = new ArrayList<>();
+ waddresses1.add("DB100.0");
+ waddresses1.add("DB100.2");
+ waddresses1.add("DB100.4");
+ waddresses1.add("DB100.6");
+ waddresses1.add("DB100.26");
+ waddresses1.add("DB100.28");
+ waddresses1.add("DB100.30");
+ waddresses1.add("DB100.32");
+ waddresses1.add("DB100.34");
+ waddresses1.add("DB100.36");
+ waddresses1.add("DB100.38");
+ waddresses1.add("DB100.40");
+
+ String addressList2 = "DB100.8";
+ String addressList3 = "DB100.12";
+
+ if (!messages.isEmpty()) {
+ // 灏嗘渶鍚庝竴涓秷鎭浆鎹负 short 绫诲瀷鐨勫垪琛�
+ String lastMessage = messages.get(messages.size() - 1);
+ // System.out.println("lastMessage锛�" + lastMessage);
+ JSONArray messageArray = new JSONArray(lastMessage);
+
+ // 鏁村悎绗� 1 鍒� 3 涓暟缁勫苟鍘绘帀 null 鍏冪礌
+ List<Short> mergedList = new ArrayList<>();
+ for (int i = 0; i < 3; i++) {
+ JSONArray sublist = messageArray.getJSONArray(i);
+ for (int j = 0; j < sublist.size(); j++) {
+ Object value = sublist.get(j);
+ if (value != null && !value.toString().equals("null")) {
+ try {
+ String cleanedValue = value.toString().replaceAll("[^0-9-]", "");
+ short sValue = Short.parseShort(cleanedValue.trim());
+ mergedList.add(sValue);
+ } catch (NumberFormatException e) {
+ // 濡傛灉鏃犳硶瑙f瀽涓� short 绫诲瀷锛屽垯蹇界暐璇ラ儴鍒�
+ System.err.println("Could not parse value: " + value);
+ }
+ }
}
}
- }
- }
- // 鍐欏叆绗竴涓湴鍧�
- if (messageArray.getJSONArray(3).size() > 0) {
- Object value = messageArray.getJSONArray(3).get(0);
- if (value != null && !value.toString().equals("null")) {
- try {
- String cleanedValue = value.toString().replaceAll("[^0-9-]", "");
- short sValue = Short.parseShort(cleanedValue.trim());
- S7control.getinstance().WriteWord(addressList2, Arrays.asList(sValue));
- System.out
- .println("messageValue锛�" + Arrays.asList(sValue) + " written to PLC at address " + addressList2);
- } catch (NumberFormatException e) {
- // 濡傛灉鏃犳硶瑙f瀽涓� short 绫诲瀷锛屽垯蹇界暐璇ラ儴鍒�
- System.err.println("Could not parse value: " + value);
+ // 鍐欏叆绗竴涓湴鍧�
+ if (messageArray.getJSONArray(3).size() > 0) {
+ Object value = messageArray.getJSONArray(3).get(0);
+ if (value != null && !value.toString().equals("null")) {
+ try {
+ String cleanedValue = value.toString().replaceAll("[^0-9-]", "");
+ short sValue = Short.parseShort(cleanedValue.trim());
+ S7control.getinstance().WriteWord(addressList2, Arrays.asList(sValue));
+ System.out
+ .println("messageValue锛�" + Arrays.asList(sValue) + " written to PLC at address " + addressList2);
+ } catch (NumberFormatException e) {
+ // 濡傛灉鏃犳硶瑙f瀽涓� short 绫诲瀷锛屽垯蹇界暐璇ラ儴鍒�
+ System.err.println("Could not parse value: " + value);
+ }
+ }
}
- }
- }
- // 鍐欏叆绗簩涓湴鍧�
- if (messageArray.getJSONArray(4).size() > 0) {
- Object value = messageArray.getJSONArray(4).get(0);
- if (value != null && !value.toString().equals("null")) {
- try {
- String cleanedValue = value.toString().replaceAll("[^0-9-]", "");
- short sValue = Short.parseShort(cleanedValue.trim());
- S7control.getinstance().WriteWord(addressList3, Arrays.asList(sValue));
- System.out
- .println("messageValue锛�" + Arrays.asList(sValue) + " written to PLC at address " + addressList3);
- } catch (NumberFormatException e) {
- // 濡傛灉鏃犳硶瑙f瀽涓� short 绫诲瀷锛屽垯蹇界暐璇ラ儴鍒�
- System.err.println("Could not parse value: " + value);
+ // 鍐欏叆绗簩涓湴鍧�
+ if (messageArray.getJSONArray(4).size() > 0) {
+ Object value = messageArray.getJSONArray(4).get(0);
+ if (value != null && !value.toString().equals("null")) {
+ try {
+ String cleanedValue = value.toString().replaceAll("[^0-9-]", "");
+ short sValue = Short.parseShort(cleanedValue.trim());
+ S7control.getinstance().WriteWord(addressList3, Arrays.asList(sValue));
+ System.out
+ .println("messageValue锛�" + Arrays.asList(sValue) + " written to PLC at address " + addressList3);
+ } catch (NumberFormatException e) {
+ // 濡傛灉鏃犳硶瑙f瀽涓� short 绫诲瀷锛屽垯蹇界暐璇ラ儴鍒�
+ System.err.println("Could not parse value: " + value);
+ }
+ }
}
+
+ // 鍐欏叆绗笁涓湴鍧�
+ if (!mergedList.isEmpty()) {
+ S7control.getinstance().WriteWord(waddresses1, mergedList);
+ System.out.println("messageValue锛�" + mergedList + " written to PLC at address " + waddresses1);
+ }
+
+ // 娓呯┖娑堟伅鍒楄〃
+ webserver.clearMessages();
}
}
- // 鍐欏叆绗笁涓湴鍧�
- if (!mergedList.isEmpty()) {
- S7control.getinstance().WriteWord(waddresses1, mergedList);
- System.out.println("messageValue锛�" + mergedList + " written to PLC at address " + waddresses1);
- }
-
- // 娓呯┖娑堟伅鍒楄〃
- webSocketServer.clearMessages();
}
-
}
-
}
}
}
+
diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/PlcParameter2.java b/springboot-vue3/src/main/java/com/example/springboot/component/PlcParameter2.java
index 379ec1b..85d5d78 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/component/PlcParameter2.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/component/PlcParameter2.java
@@ -40,20 +40,13 @@
storageCageService = WebSocketServer.applicationContext.getBean(StorageCageService.class);
// id
List<String> addressList1 = Arrays.asList(config.getProperty("Parameter2.id").split(","));
-
List<String> paramlist = S7control.getinstance().readStrings(addressList1);
// System.out.println(paramlist);
-
//鎵嬪姩鐘舵��
List<String> addresses = Arrays.asList(config.getProperty("Parameter2.state").split(","));
-
List<Short> data = S7control.getinstance().readWords(addresses);
-
-
//娓呴櫎id
List<String> addressList0 = Arrays.asList(config.getProperty("Parameter2.cleanid").split(","));
-
-
// 鎵爜鏋�
List<Boolean> data2 = S7control.getinstance().readBits(addressList0);
List<String> addressList3 = Arrays.asList(config.getProperty("Parameter2.scanner").split(","));
@@ -63,17 +56,11 @@
List<String> timeout = Arrays.asList(config.getProperty("Parameter2.timeout").split(","));
String timeout2 = config.getProperty("Parameter2.timeout");
-
Long readtimeout = S7control.getinstance().readtime(timeout2);
List<Boolean> anniuread = S7control.getinstance().readBits(niuanaddressList3);
-
-
List<String> data3 = S7control.getinstance().readStrings(addressList3);
// A01 A02 B01 B02
-
List<String> addresses4 = Arrays.asList(config.getProperty("Parameter2.Currentcell").split(","));
-
-
List<Short> data4 = S7control.getinstance().readWords(addresses4);
//System.out.println(data);
// List<Long> TIME2 = Collections.singletonList(S7control.getinstance().readtime("DB100.194"));
diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/PlcParameter2Review.java b/springboot-vue3/src/main/java/com/example/springboot/component/PlcParameter2Review.java
new file mode 100644
index 0000000..fed001a
--- /dev/null
+++ b/springboot-vue3/src/main/java/com/example/springboot/component/PlcParameter2Review.java
@@ -0,0 +1,347 @@
+package com.example.springboot.component;
+
+import cn.hutool.json.JSONArray;
+import cn.hutool.json.JSONObject;
+import com.example.springboot.service.StorageCageService;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.io.BufferedReader;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import com.example.springboot.entity.device.PlcParameterObject;
+import com.example.springboot.entity.device.PlcParameterInfo;
+import org.springframework.core.io.ResourceLoader;
+
+
+public class PlcParameter2Review extends Thread {
+
+ @Autowired
+
+ StorageCageService storageCageService;
+ private ResourceLoader resourceLoader;
+ private volatile static PlcParameter2Review instance = null;
+
+ private PlcParameter2Review() {
+ init();
+ }
+
+ // 鍗曚緥妯″紡 绾跨▼瀹夊叏
+ public static PlcParameter2Review getInstance() {
+ if (instance == null) {
+ synchronized (PlcParameter1Review.class) {
+ if (instance == null) {
+ instance = new PlcParameter2Review();
+ }
+ }
+ }
+ return instance;
+ }
+
+ PlcParameterObject plcParameterObject = new PlcParameterObject();//璇B鍖烘暟鎹疄渚�
+
+ private void init() {
+ try {
+ String jsonfilename = PlcParameter1Review.class.getResource("/JsonFile/PlcParameter.json").getFile();
+ FileReader fileReader = new FileReader(jsonfilename);
+ BufferedReader bufferedReader = new BufferedReader(fileReader);
+
+ StringBuilder content = new StringBuilder();
+ String line;
+
+ while ((line = bufferedReader.readLine()) != null) {
+ content.append(line);
+ }
+
+ bufferedReader.close();
+ fileReader.close();
+
+ JSONObject jsonfileobj = new JSONObject(content.toString());
+ JSONArray jsonArray = jsonfileobj.getJSONArray("parameteInfor");
+ plcParameterObject.setPlcAddressBegin(jsonfileobj.getStr("plcAddressBegin"));//璁剧疆璧峰浣嶅湴鍧�
+ plcParameterObject.setPlcAddressLength(Integer.valueOf(jsonfileobj.getStr("plcAddressLenght")));//璁剧疆鍦板潃闀垮害
+
+
+ for (int i = 0; i < jsonArray.size(); i++) {
+ JSONObject parameterObj = jsonArray.getJSONObject(i);
+
+ PlcParameterInfo plcParameterInfo = new PlcParameterInfo(jsonfileobj.getStr("plcAddressBegin")); //鍙傛暟瀹炰緥
+ String codeid = parameterObj.getStr("codeId");
+ plcParameterInfo.setCodeId(codeid);
+ plcParameterInfo.setAddressIndex(Integer.valueOf(parameterObj.getStr("addressIndex")));
+ plcParameterInfo.setRatio(Integer.valueOf(parameterObj.getStr("ratio")));
+ plcParameterInfo.setAddressLength(Integer.valueOf(parameterObj.getStr("addressLenght")));
+ plcParameterInfo.setUnit(parameterObj.getStr("unit"));
+ plcParameterObject.addPlcParameter(plcParameterInfo);
+ }
+ System.out.println("");
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ }
+ @Override
+ public void run() {
+ while (this != null) {
+ try {
+ Thread.sleep(1000);
+
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ storageCageService = WebSocketServer.applicationContext.getBean(StorageCageService.class);
+
+ byte[] getplcvlues = S7control.getinstance().ReadByte(plcParameterObject.getPlcAddressBegin(), plcParameterObject.getPlcAddressLength());
+ plcParameterObject.setPlcParameterList(getplcvlues);
+ int index = plcParameterObject.getPlcParameter("conveyorVelocity(AutoFAST)").getAddressIndex();
+ S7control.getinstance().WriteWord(plcParameterObject.getPlcParameter("conveyorVelocity(AutoFAST)").getAddress(index), (short) 100);
+
+ List<String> addresses = new ArrayList<>();
+ addresses.add("conveyorVelocity(AutoFAST)");
+ addresses.add("conveyorVelocity(AutoSLOW)");
+ addresses.add("conveyorVelocity(Manual)");
+ addresses.add("A01A02TURNJOGVelocity");
+ addresses.add("A01A02TRAVELJOGVelocity");
+ // id
+// List<String> addressList1 = Arrays.asList(config.getProperty("Parameter2.id").split(","));
+// List<String> paramlist = S7control.getinstance().readStrings(addressList1);
+// // System.out.println(paramlist);
+// //鎵嬪姩鐘舵��
+// List<String> addresses = Arrays.asList(config.getProperty("Parameter2.state").split(","));
+// List<Short> data = S7control.getinstance().readWords(addresses);
+// //娓呴櫎id
+// List<String> addressList0 = Arrays.asList(config.getProperty("Parameter2.cleanid").split(","));
+// // 鎵爜鏋�
+// List<Boolean> data2 = S7control.getinstance().readBits(addressList0);
+// List<String> addressList3 = Arrays.asList(config.getProperty("Parameter2.scanner").split(","));
+//
+////鎬ュ仠鎸夐挳
+// List<String> niuanaddressList3 = Arrays.asList(config.getProperty("Parameter2.stop").split(","));
+// List<String> timeout = Arrays.asList(config.getProperty("Parameter2.timeout").split(","));
+// String timeout2 = config.getProperty("Parameter2.timeout");
+//
+// Long readtimeout = S7control.getinstance().readtime(timeout2);
+// List<Boolean> anniuread = S7control.getinstance().readBits(niuanaddressList3);
+// List<String> data3 = S7control.getinstance().readStrings(addressList3);
+//// A01 A02 B01 B02
+// List<String> addresses4 = Arrays.asList(config.getProperty("Parameter2.Currentcell").split(","));
+// List<Short> data4 = S7control.getinstance().readWords(addresses4);
+ //System.out.println(data);
+
+
+
+ //
+
+
+//
+// String[] values6 = { ".x1 ","x2 ","x3",";;x4","x5","x6","x7","x8","x9","x10","x11"};
+// List<String> paramlist = new ArrayList<>(Arrays.asList(values6));
+// Short[] values1 = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1};
+// List<Short> data = new ArrayList<>(Arrays.asList(values1));
+// Boolean[] value4 = { false, false, false, false, false, false, false, false, false,
+// false};
+// List<Boolean> data2 = new ArrayList<>(Arrays.asList(value4));
+// String[] values3 = { ".x11 ","x21 "};
+// List<String> data3 = new ArrayList<>(Arrays.asList(values3));
+// Short[] values4 = { 2,2,3,4};
+// List<Short> data4 = new ArrayList<>(Arrays.asList(values4));
+//
+//
+// JSONObject jsonObject = new JSONObject();
+// short[] params = new short[data2.size()];
+// for (int i = 0; i < data2.size(); i++) {
+// boolean value = data2.get(i);
+// params[i] = value ? (short) 1 : (short) 0;
+// }
+////
+// short[] anniuparams = new short[anniuread.size()];
+// for (int i = 0; i < anniuread.size(); i++) {
+// boolean value = anniuread.get(i);
+// anniuparams[i] = value ? (short) 1 : (short) 0;
+// }
+ //boolean杞负0 1
+// short[] params = customS7Control.convertBooleanListToShortArray(data2);
+// short[] anniuparams = customS7Control.convertBooleanListToShortArray(anniuread);
+// JSONObject jsonObject = new JSONObject();
+// jsonObject.append("params", params);
+// jsonObject.append("params", paramlist);
+// jsonObject.append("params", data);
+// jsonObject.append("params", data3);
+// jsonObject.append("params", data4);
+// jsonObject.append("jiting", anniuparams);
+// jsonObject.append("timeout", readtimeout);
+
+
+// WebSocketServer sendwServer = WebSocketServer.getWebSocketServer("Parameter2");
+// if (sendwServer != null) {
+// JSONObject jsonObject = new JSONObject();
+// jsonObject.set("message", "Hello, Parameter2!");
+// sendwServer.sendMessage(jsonObject.toString());
+// }
+// HomeController controller = new HomeController();
+// ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("Parameter2");
+// if (sendwServer != null) {
+// for (WebSocketServer webserver : sendwServer) {
+//
+// webserver.sendMessage(jsonObject.toString());
+//
+//
+// if (webserver != null) {
+//
+// List<String> messages = webserver.getMessages();
+//
+// if (!messages.isEmpty()) {
+// // 灏嗘渶鍚庝竴涓秷鎭浆鎹负鏁存暟绫诲瀷鐨勫垪琛�
+// String lastMessage = messages.get(messages.size() - 1);
+//// System.out.println("lastMessage锛�" + lastMessage);
+// JSONArray messageArray = new JSONArray(lastMessage);
+// //娓呴櫎ID
+// // customS7Control.writeBitToPLC(messageArray, addressList0, 0);
+//
+//
+// try {
+// // 妫�鏌ョ储寮曟槸鍚︽湁鏁�
+// if (messageArray.getJSONArray(0).size() > 0) {
+// // 鑾峰彇娑堟伅鏁扮粍
+// JSONArray jsonArray = messageArray.getJSONArray(0);
+// // 鍒涘缓涓�涓竷灏斿�煎垪琛�
+// List<Boolean> sValue = new ArrayList<>();
+// // 閬嶅巻娑堟伅鏁扮粍
+// for (int i = 0; i < jsonArray.size(); i++) {
+// // 鑾峰彇娑堟伅鏁扮粍涓殑鍊�
+// Object value = jsonArray.get(i);
+// // 妫�鏌ュ�兼槸鍚︽湁鏁�
+// if (value != null && !value.toString().equals("null")) {
+// try {
+// // 绉婚櫎闈炴暟瀛楀拰鏁板瓧瀛楃
+// String cleanedValue = value.toString().replaceAll("[^0-9-]", "");
+// // 瑙f瀽涓哄竷灏斿��
+// boolean val = "1".equals(cleanedValue.trim());
+// // 灏嗗竷灏斿�兼坊鍔犲埌甯冨皵鍊煎垪琛ㄤ腑
+// sValue.add(val);
+// System.out.println("messageValue: " + Arrays.asList(val) + " added to the list");
+//
+//
+// } catch (NumberFormatException e) {
+// // 濡傛灉鏃犳硶瑙f瀽涓� boolean 绫诲瀷锛屽垯蹇界暐璇ラ儴鍒�
+// System.err.println("Could not parse value: " + value);
+// }
+// }
+// }
+////瀹屾垚鍑虹墖
+// boolean containsOne = data.stream().anyMatch(number -> number == 1);
+// for (int i = 1; i <= 5; i++) {
+// boolean value = sValue.get(i);
+// String id = paramlist.get(i);
+// //鍒ゆ柇鏄惁鑷姩鐘舵��
+// if (!containsOne) {
+// //鍒ゆ柇id鏄惁鍖呭惈鏁板瓧
+// if (id.matches(".*\\d.*")) {
+// //鍒ゆ柇娓呮id鏄惁true
+// if (value) {
+// System.out.println(id);
+// switch (i) {
+// case 1:
+// storageCageService.UpdateTask(2, 0, paramlist.get(i));
+// break;
+// case 2:
+// case 3:
+// case 4:
+// case 5:
+// storageCageService.UpdateTask(3, 0, paramlist.get(i));
+// break;
+// default:
+// // 澶勭悊绱㈠紩鍊间笉鍦ㄨ寖鍥村唴鐨勬儏鍐�
+// break;
+// }
+// }
+// }
+//
+// }
+// // 妫�鏌ュ竷灏斿�煎垪琛ㄦ槸鍚︿负绌�
+// if (!sValue.isEmpty()) {
+//
+// // 璋冪敤 S7control.getinstance().WriteBit 鏂规硶灏嗗竷灏斿�煎垪琛ㄥ啓鍏ュ湴鍧�鍒楄〃
+// S7control.getinstance().WriteBit(addressList0, sValue);
+// System.out.println("Values " + sValue + " written to PLC at address " + addressList0);
+// }
+// }
+// }
+// } catch (Exception e) {
+// System.err.println("An error occurred while writing bit to PLC: " + e.getMessage());
+// }
+//
+//
+// //鎬ュ仠
+//// customS7Control.writeBitToPLC(messageArray, niuanaddressList3, 1);
+//
+// try {
+// // 妫�鏌ョ储寮曟槸鍚︽湁鏁�
+// if (messageArray.getJSONArray(1).size() > 0) {
+// // 鑾峰彇娑堟伅鏁扮粍
+// JSONArray jsonArray = messageArray.getJSONArray(1);
+// // 鍒涘缓涓�涓竷灏斿�煎垪琛�
+// List<Boolean> sValue = new ArrayList<>();
+// // 閬嶅巻娑堟伅鏁扮粍
+// for (int i = 0; i < jsonArray.size(); i++) {
+// // 鑾峰彇娑堟伅鏁扮粍涓殑鍊�
+// Object value = jsonArray.get(i);
+// // 妫�鏌ュ�兼槸鍚︽湁鏁�
+// if (value != null && !value.toString().equals("null")) {
+// try {
+// // 绉婚櫎闈炴暟瀛楀拰鏁板瓧瀛楃
+// String cleanedValue = value.toString().replaceAll("[^0-9-]", "");
+// // 瑙f瀽涓哄竷灏斿��
+// boolean val = "1".equals(cleanedValue.trim());
+// // 灏嗗竷灏斿�兼坊鍔犲埌甯冨皵鍊煎垪琛ㄤ腑
+// sValue.add(val);
+// System.out.println("messageValue: " + Arrays.asList(val) + " added to the list");
+//
+//
+// } catch (NumberFormatException e) {
+// // 濡傛灉鏃犳硶瑙f瀽涓� boolean 绫诲瀷锛屽垯蹇界暐璇ラ儴鍒�
+// System.err.println("Could not parse value: " + value);
+// }
+// }
+// }
+//// 缁堟杩涚墖浠诲姟
+// boolean Value1 = sValue.get(0);
+// boolean Value2 = sValue.get(1);
+//
+// if (Value1) {
+// storageCageService.EndTask(0);
+//
+// }
+// if (Value2) {
+// storageCageService.EndTask(1);
+//
+// }
+// // 妫�鏌ュ竷灏斿�煎垪琛ㄦ槸鍚︿负绌�
+// if (!sValue.isEmpty()) {
+//
+// // 璋冪敤 S7control.getinstance().WriteBit 鏂规硶灏嗗竷灏斿�煎垪琛ㄥ啓鍏ュ湴鍧�鍒楄〃
+// S7control.getinstance().WriteBit(niuanaddressList3, sValue);
+// System.out.println("Values " + sValue + " written to PLC at address " + niuanaddressList3);
+// }
+// }
+// } catch (Exception e) {
+// System.err.println("An error occurred while writing bit to PLC: " + e.getMessage());
+// }
+//
+//
+// //瀛樼墖绛夊緟寤惰繜
+// customS7Control.Writetime(messageArray, timeout2, 2);
+//
+//
+// // 娓呯┖娑堟伅鍒楄〃
+// webserver.clearMessages();
+// }
+// }
+// }
+// }
+ }
+ }
+}
+
diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/Plcsign.java b/springboot-vue3/src/main/java/com/example/springboot/component/Plcsign.java
index 2daeaf3..8329678 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/component/Plcsign.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/component/Plcsign.java
@@ -71,7 +71,7 @@
// System.out.println(PlcAddress);
// List<Boolean> plclist = S7control.getinstance().ReadBits(PlcAddress, Plccount);
- List<Boolean> plclist = S7control.getinstance().ReadBits("DB102.0.0", 64);
+ List<Boolean> plclist = S7control.getinstance().ReadBits("DB102.0.0", 112);
// Boolean[] values = { true, true, true, true, true, false, true, false,
// true, false, true, false, true, false,
diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/PlcsignReview.java b/springboot-vue3/src/main/java/com/example/springboot/component/PlcsignReview.java
index ef6af2d..7e9549e 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/component/PlcsignReview.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/component/PlcsignReview.java
@@ -32,11 +32,12 @@
}
return instance;
}
+
PlcBitObject plcBitObject = new PlcBitObject();//璇B鍖烘暟鎹疄渚�
- private void init() {
+ private void init() {
try {
- String jsonfilename= PlcsignReview.class.getResource("/JsonFile/PlcSign.json").getFile();
+ String jsonfilename = PlcsignReview.class.getResource("/JsonFile/PlcSign.json").getFile();
FileReader fileReader = new FileReader(jsonfilename);
BufferedReader bufferedReader = new BufferedReader(fileReader);
@@ -47,31 +48,31 @@
content.append(line);
}
- bufferedReader.close();
+ bufferedReader.close();
fileReader.close();
-
+
JSONObject jsonfileobj = new JSONObject(content.toString());
JSONArray jsonArray = jsonfileobj.getJSONArray("parameteInfor");
- plcBitObject.setPlcAddressBegin(jsonfileobj.getStr("plcAddressBegin"));//璁剧疆璧峰浣嶅湴鍧�
- plcBitObject.setPlcAddressLength(Integer.valueOf(jsonfileobj.getStr("plcAddressLenght")));//璁剧疆鍦板潃闀垮害
-
+ plcBitObject.setPlcAddressBegin(jsonfileobj.getStr("plcAddressBegin"));//璁剧疆璧峰浣嶅湴鍧�
+ plcBitObject.setPlcAddressLength(Integer.valueOf(jsonfileobj.getStr("plcAddressLenght")));//璁剧疆鍦板潃闀垮害
+
for (int i = 0; i < jsonArray.size(); i++) {
- JSONObject parameterObj = jsonArray.getJSONObject(i);
-
+ JSONObject parameterObj = jsonArray.getJSONObject(i);
+
PlcBitInfo plcBitInfo = new PlcBitInfo(jsonfileobj.getStr("plcAddressBegin")); //鍙傛暟瀹炰緥
- String codeid=parameterObj.getStr("codeId");
+ String codeid = parameterObj.getStr("codeId");
plcBitInfo.setCodeId(codeid);
plcBitInfo.setAddressIndex(Integer.valueOf(parameterObj.getStr("addressIndex")));
-
+
plcBitObject.addPlcBit(plcBitInfo);
- }
+ }
System.out.println("");
} catch (IOException e) {
e.printStackTrace();
}
}
-
+
@Override
public void run() {
@@ -81,7 +82,7 @@
} catch (InterruptedException e) {
e.printStackTrace();
}
- List<Boolean> getplcbits=S7control.getinstance().ReadBits(plcBitObject.getPlcAddressBegin(),plcBitObject.getPlcAddressLength());
+ List<Boolean> getplcbits = S7control.getinstance().ReadBits(plcBitObject.getPlcAddressBegin(), plcBitObject.getPlcAddressLength());
plcBitObject.setPlcBitList(getplcbits);
// this.readValue();
// String PlcAddress = this.name;
@@ -89,7 +90,7 @@
// System.out.println(PlcAddress);
// List<Boolean> plclist = S7control.getinstance().ReadBits(PlcAddress, Plccount);
- List<Boolean> plclist = S7control.getinstance().ReadBits("DB102.0.0", 64);
+ List<Boolean> plclist = S7control.getinstance().ReadBits("DB102.0.0", 64);
// Boolean[] values = { true, true, true, true, true, false, true, false,
// true, false, true, false, true, false,
@@ -113,11 +114,19 @@
}
JSONObject jsonObject = new JSONObject();
jsonObject.append("sig", Intlist);
- WebSocketServer sendwServer3 = WebSocketServer.sessionMap.get("Sign");
- if (sendwServer3 != null) {
- sendwServer3.sendMessage(jsonObject.toString());
- }
+ ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("Parameter1");
+ if (sendwServer != null) {
+ for (WebSocketServer webserver : sendwServer) {
+ webserver.sendMessage(jsonObject.toString());
+
+
+ if (webserver != null) {
+ webserver.sendMessage(jsonObject.toString());
+ }
+ }
+
+ }
}
}
}
diff --git a/springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java b/springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java
index 13fbf9e..291008a 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java
@@ -172,7 +172,7 @@
@Select("select ifnull(max(sequence),0)+1 from out_slice ")
Short SelectMaxSquence();
//鏌ヨ鐢ㄦ埛鏉冮檺
- @Select("select rp.* from role_permission rp inner join user r on rp.role_id=r.role_id and r.username=#{username} and (permission_id=32 or permission_id=33 or permission_id=34 or permission_id=35)")
+ @Select("select rp.* from role_permission rp inner join user r on rp.role_id=r.role_id and r.username=#{username} and (permission_id=32 or permission_id=33 or permission_id=34 or permission_id=35 or permission_id=36)")
List<RolePermission> SelectPermissionByUserName(String username);
//鏍规嵁鐜荤拑瀹屾垚鍑虹墖浠诲姟
diff --git a/springboot-vue3/src/main/resources/JsonFile/PlcParameter.json b/springboot-vue3/src/main/resources/JsonFile/PlcParameter.json
index 1a63c24..a64126e 100644
--- a/springboot-vue3/src/main/resources/JsonFile/PlcParameter.json
+++ b/springboot-vue3/src/main/resources/JsonFile/PlcParameter.json
@@ -11,67 +11,376 @@
"unit":"m/min"
},
{
- "codeId": "conveyorVelocity(AutoSLOW)",
- "addressIndex":"6",
+ "codeId": "conveyorVelocity(AutoFAST)",
+ "addressIndex":"2",
"addressLenght":"2",
"ratio":"1",
"unit":"m/min"
},
{
- "codeId": "conveyorVelocity(Manual)",
+ "codeId": "conveyorVelocity(AutoSLOW)",
"addressIndex":"4",
"addressLenght":"2",
"ratio":"1",
"unit":"m/min"
},
{
- "codeId": "A01A02TURNJOGVelocity",
+ "codeId": "conveyorVelocity(Manual)",
"addressIndex":"6",
"addressLenght":"2",
"ratio":"1",
- "unit":"m/min"
+ "unit":"mm/S"
},
{
- "codeId": "A01A02TRAVELJOGVelocity",
+ "codeId": "A01A02TURNJOGVelocity",
"addressIndex":"8",
"addressLenght":"2",
"ratio":"1",
- "unit":"m/min"
+ "unit":"mm/S"
},
{
- "codeId": "B01B02TRAVELJOGVelocity",
+ "codeId": "A01A02TRAVELJOGVelocity",
"addressIndex":"10",
"addressLenght":"2",
"ratio":"1",
- "unit":"m/min"
+ "unit":"mm/S"
},
{
- "codeId": "A01A02TURNPOSVelocityAUTO",
+ "codeId": "B01B02TRAVELJOGVelocity",
"addressIndex":"12",
"addressLenght":"2",
"ratio":"1",
- "unit":"m/min"
+ "unit":"mm/S"
},
{
- "codeId": "A01A02TURNPOSVelocitymanual",
+ "codeId": "A01A02TURNPOSVelocityAUTO",
"addressIndex":"14",
"addressLenght":"2",
"ratio":"1",
- "unit":"m/min"
+ "unit":"mm/S"
},
{
- "codeId": "A01A02TRAVELPOSVelocityAUTO",
+ "codeId": "A01TURNPOSVelocitymanual",
"addressIndex":"16",
"addressLenght":"2",
"ratio":"1",
- "unit":"m/min"
+ "unit":"mm/S"
},
{
- "codeId": "DO1id",
+ "codeId": "A01A02TRAVELPOSVelocityAUTO",
"addressIndex":"18",
- "addressLenght":"14",
+ "addressLenght":"2",
"ratio":"1",
- "unit":"m/min"
- }
+ "unit":"mm/S"
+ },
+ {
+ "codeId": "A01TRAVELPOSVelocitymanual",
+ "addressIndex":"20",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"mm/S"
+ },
+ {
+ "codeId": "B01B02TRAVELPOSVelocityAUTO",
+ "addressIndex":"22",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"mm/S"
+ },
+ {
+ "codeId": "B01TRAVELPOSVelocitymanual",
+ "addressIndex":"24",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"mm/S"
+ },
+ {
+ "codeId": "A01A02conveyorVelocity(Max)",
+ "addressIndex":"26",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"m/min"
+ },
+ {
+ "codeId": "A01A02conveyorVelocity(AutoFAST)",
+ "addressIndex":"28",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"m/min"
+ },
+ {
+ "codeId": "A01A02conveyorVelocity(AutoSLOW)",
+ "addressIndex":"30",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"m/min"
+ },
+ {
+ "codeId": "B01B02conveyorVelocity(Manual)",
+ "addressIndex":"32",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"m/min"
+ },
+ {
+ "codeId": "B01B02conveyorVelocity(Max)",
+ "addressIndex":"34",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"m/min"
+ },
+ {
+ "codeId": "B01B02conveyorVelocity(AutoFAST)",
+ "addressIndex":"36",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"m/min"
+ },
+ {
+ "codeId": "B01B02conveyorVelocity(AutoSLOW)",
+ "addressIndex":"38",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"m/min"
+ },
+ {
+ "codeId": "B01B02conveyorVelocity(Manual)",
+ "addressIndex":"40",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"m/min"
+ },
+ {
+ "codeId": "gridspacing",
+ "addressIndex":"42",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"mm"
+ },
+ {
+ "codeId": "A01Spliceaddresssetting",
+ "addressIndex":"44",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"mm"
+ },
+ {
+ "codeId": "A02Spliceaddresssetting",
+ "addressIndex":"46",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"mm"
+ },
+ {
+ "codeId": "A011#gridaddress",
+ "addressIndex":"48",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"mm"
+ },
+ {
+ "codeId": "A0122#gridaddress",
+ "addressIndex":"50",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"mm"
+ },
+ {
+ "codeId": "A0143#gridaddress",
+ "addressIndex":"52",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"mm"
+ },
+ {
+ "codeId": "A0164#gridaddress",
+ "addressIndex":"54",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"mm"
+ },
+ {
+ "codeId": "A0185#gridaddress",
+ "addressIndex":"56",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"mm"
+ },
+ {
+ "codeId": "A01106#gridaddress",
+ "addressIndex":"58",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"mm"
+ },
+ {
+ "codeId": "A01127#gridaddress",
+ "addressIndex":"60",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"mm"
+ },
+ {
+ "codeId": "A01148#gridaddress",
+ "addressIndex":"62",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"mm"
+ },
+ {
+ "codeId": "A01169#gridaddress",
+ "addressIndex":"64",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"mm"
+ },
+ {
+ "codeId": "A01190#gridaddress",
+ "addressIndex":"66",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"mm"
+ },
+ {
+ "codeId": "A021#gridaddress",
+ "addressIndex":"68",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"mm"
+ },
+ {
+ "codeId": "A0222#gridaddress",
+ "addressIndex":"70",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"mm"
+ },
+ {
+ "codeId": "A0243#gridaddress",
+ "addressIndex":"72",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"mm"
+ },
+ {
+ "codeId": "A0264#gridaddress",
+ "addressIndex":"74",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"mm"
+ },
+ {
+ "codeId": "A0285#gridaddress",
+ "addressIndex":"76",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"mm"
+ },
+ {
+ "codeId": "A02106#gridaddress",
+ "addressIndex":"78",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"mm"
+ },
+ {
+ "codeId": "A02127#gridaddress",
+ "addressIndex":"80",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"mm"
+ },
+ {
+ "codeId": "A02148#gridaddress",
+ "addressIndex":"82",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"mm"
+ },
+ {
+ "codeId": "A02169#gridaddress",
+ "addressIndex":"84",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"mm"
+ },
+ {
+ "codeId": "A02190#gridaddress",
+ "addressIndex":"86",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"mm"
+ },
+ {
+ "codeId": "B011#gridaddress",
+ "addressIndex":"88",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"mm"
+ },
+ {
+ "codeId": "B0122#gridaddress",
+ "addressIndex":"90",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"mm"
+ },
+ {
+ "codeId": "B0143#gridaddress",
+ "addressIndex":"92",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"mm"
+ },
+ {
+ "codeId": "B0164#gridaddress",
+ "addressIndex":"94",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"mm"
+ },
+ {
+ "codeId": "A0243#gridaddress",
+ "addressIndex":"96",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"mm"
+ },
+ {
+ "codeId": "A0243#gridaddress",
+ "addressIndex":"98",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"mm"
+ },
+ {
+ "codeId": "A0243#gridaddress",
+ "addressIndex":"100",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"mm"
+ },
+ {
+ "codeId": "A0243#gridaddress",
+ "addressIndex":"102",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"mm"
+ },
+ {
+ "codeId": "A0243#gridaddress",
+ "addressIndex":"104",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"mm"
+ },
+ {
+ "codeId": "A0243#gridaddress",
+ "addressIndex":"106",
+ "addressLenght":"2",
+ "ratio":"1",
+ "unit":"mm"
+ }
+
]
}
diff --git a/springboot-vue3/src/main/resources/config.properties b/springboot-vue3/src/main/resources/config.properties
index 4e420c3..d84493a 100644
--- a/springboot-vue3/src/main/resources/config.properties
+++ b/springboot-vue3/src/main/resources/config.properties
@@ -100,7 +100,7 @@
#鎵爜鏋�
Parameter2.scanner=DB103.256,DB103.270
#鎬ュ仠
-Parameter2.stop=DB101.10.4,DB101.11.2
+Parameter2.stop=DB101.10.4,DB101.11.2,DB101.DBX11.3
Parameter2.timeout=DB100.194
#褰撳墠鏍煎瓙
--
Gitblit v1.8.0