From 17b583422095aff6bb91bd8ddff5faeb41c8edb2 Mon Sep 17 00:00:00 2001
From: wuyouming666 <2265557248@qq.com>
Date: 星期六, 02 十二月 2023 09:06:24 +0800
Subject: [PATCH] 更新电气管理通讯逻辑
---
CanadaMes-ui/src/views/Electrical/Positioning2.vue | 45
springboot-vue3/src/main/java/com/example/springboot/component/PlcParameter2.java | 54
CanadaMes-ui/src/router/index.js | 7
springboot-vue3/src/main/java/com/example/springboot/component/S7control.java | 23
CanadaMes-ui/src/views/Electrical/Parameter2.vue | 151 ++
CanadaMes-ui/src/views/Electrical/State.vue | 10
CanadaMes-ui/src/views/Electrical/Parameter.vue | 3
springboot-vue3/src/main/java/com/example/springboot/component/PlcServoManualone.java | 248 +++--
CanadaMes-ui/src/layout/index.vue | 50
CanadaMes-ui/package.json | 3
CanadaMes-ui/src/views/Electrical/Positioning1.vue | 45
springboot-vue3/src/main/java/com/example/springboot/component/PlcParameter.java | 2
CanadaMes-ui/src/views/Electrical/AutomaticParameterSetting.vue | 51
CanadaMes-ui/src/views/Electrical/alarm.vue | 24
springboot-vue3/pom.xml | 14
CanadaMes-ui/src/views/Electrical/Action.vue | 102 +
CanadaMes-ui/src/main.js | 4
CanadaMes-ui/package-lock.json | 15
CanadaMes-ui/src/configuration/parameter2.json | 43 +
springboot-vue3/src/main/java/com/example/springboot/component/Plcaction.java | 2
CanadaMes-ui/src/views/Electrical/ManualonePosition2.vue | 71 +
CanadaMes-ui/src/views/Electrical/Sign.vue | 6
springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java | 4
CanadaMes-ui/src/views/Electrical/ManualonePosition.vue | 84 +
CanadaMes-ui/src/configuration/ServoManualone.json | 32
CanadaMes-ui/src/configuration/Manualoneposition2.json | 258 +++---
/dev/null | 27
springboot-vue3/src/main/java/com/example/springboot/config/AppRunnerConfig.java | 2
CanadaMes-ui/src/lang/locales/en-US.json | 204 ++++
CanadaMes-ui/src/views/Electrical/ManualJog.vue | 43
CanadaMes-ui/src/views/Electrical/Parameter1.vue | 55
CanadaMes-ui/src/views/Electrical/ServoManualone.vue | 224 +++-
CanadaMes-ui/src/configuration/Manualoneposition.json | 626 +++++++-------
33 files changed, 1,665 insertions(+), 867 deletions(-)
diff --git a/CanadaMes-ui/package-lock.json b/CanadaMes-ui/package-lock.json
index 4330e50..124ad55 100644
--- a/CanadaMes-ui/package-lock.json
+++ b/CanadaMes-ui/package-lock.json
@@ -20,7 +20,6 @@
"vue": "^2.6.11",
"vue-i18n": "^8.26.5",
"vue-router": "^3.3.4"
-
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
@@ -13325,14 +13324,6 @@
"integrity": "sha1-HuO8mhbsv1EYvjNLsV+cRvgvWCU=",
"dev": true
},
- "node_modules/vuex": {
- "version": "3.6.2",
- "resolved": "https://registry.npmmirror.com/vuex/-/vuex-3.6.2.tgz",
- "integrity": "sha512-ETW44IqCgBpVomy520DT5jf8n0zoCac+sxWnn+hMe/CzaSejb/eVw2YToiXYX+Ex/AuHHia28vWTq4goAexFbw==",
- "peerDependencies": {
- "vue": "^2.0.0"
- }
- },
"node_modules/watchpack": {
"version": "1.7.5",
"resolved": "https://registry.npm.taobao.org/watchpack/download/watchpack-1.7.5.tgz",
@@ -25436,12 +25427,6 @@
"resolved": "https://registry.npm.taobao.org/vue-template-es2015-compiler/download/vue-template-es2015-compiler-1.9.1.tgz",
"integrity": "sha1-HuO8mhbsv1EYvjNLsV+cRvgvWCU=",
"dev": true
- },
- "vuex": {
- "version": "3.6.2",
- "resolved": "https://registry.npmmirror.com/vuex/-/vuex-3.6.2.tgz",
- "integrity": "sha512-ETW44IqCgBpVomy520DT5jf8n0zoCac+sxWnn+hMe/CzaSejb/eVw2YToiXYX+Ex/AuHHia28vWTq4goAexFbw==",
- "requires": {}
},
"watchpack": {
"version": "1.7.5",
diff --git a/CanadaMes-ui/package.json b/CanadaMes-ui/package.json
index 741fcd8..033f287 100644
--- a/CanadaMes-ui/package.json
+++ b/CanadaMes-ui/package.json
@@ -19,8 +19,7 @@
"moment": "^2.29.4",
"vue": "^2.6.11",
"vue-i18n": "^8.26.5",
- "vue-router": "^3.3.4",
- "vuex": "^3.6.2"
+ "vue-router": "^3.3.4"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
diff --git a/CanadaMes-ui/src/configuration/Manualoneposition.json b/CanadaMes-ui/src/configuration/Manualoneposition.json
index 69edafb..c9a50e8 100644
--- a/CanadaMes-ui/src/configuration/Manualoneposition.json
+++ b/CanadaMes-ui/src/configuration/Manualoneposition.json
@@ -1,314 +1,314 @@
-[
- [
- {
- "name": "A01鎵嬪姩鏍煎瓙",
- "value": 0,
- "sending": 0,
- "type": "0",
- "address": "DB100.0",
- "count": 3,
- "state": 1
- },
- {
- "name": "A01瀹氫綅閫熷害",
- "value": 0,
- "sending": 0,
- "address": "DB100.0",
- "type": "0",
- "state": 1
- },
- {
- "name": "A01褰撳墠鏍煎瓙",
- "value": 0,
- "sending": 0,
- "address": "DB100.0",
- "type": "0",
- "state": 1
- },
- {
- "button": {
- "name": "A01鍚姩",
- "value": 0,
- "address": "DB10.0",
- "state": 1
- }
- },
- {
- "button": {
- "name": "鏁呴殰",
- "value": 1,
- "address": "DB10.0",
- "state": 1
- }
- },
- {
- "button": {
- "name": "澶嶄綅",
- "value": 0,
- "address": "DB10.0",
- "state": 1
- }
- },
- {
- "button": {
- "name": "鏈洖闆�",
- "value": 0,
- "address": "DB10.0",
- "state": 0
- }
- },
- {
- "button": {
- "name": "鍥為浂",
- "value": 0,
- "address": "DB10.0",
- "state": 0
- }
- }
- ],
- [
- {
- "name": "A02鎵嬪姩鏍煎瓙",
- "value": 0,
- "sending": 0,
- "type": "0",
- "address": "DB100.0",
- "count": 3,
- "state": 1
- },
- {
- "name": "A02瀹氫綅閫熷害",
- "value": 0,
- "sending": 0,
- "address": "DB100.0",
- "type": "0",
- "state": 1
- },
- {
- "name": "A02褰撳墠鏍煎瓙",
- "value": 0,
- "sending": 0,
- "address": "DB100.0",
- "type": "0",
- "state": 1
- },
- {
- "button": {
- "name": "A02鍚姩",
- "value": 0,
- "address": "DB10.0",
- "state": 1
- }
- },
- {
- "button": {
- "name": "鏁呴殰",
- "value": 0,
- "address": "DB10.0",
- "state": 1
- }
- },
- {
- "button": {
- "name": "澶嶄綅",
- "value": 0,
- "address": "DB10.0",
- "state": 1
- }
- },
- {
- "button": {
- "name": "鏈洖闆�",
- "value": 0,
- "address": "DB10.0",
- "state": 0
- }
- },
- {
- "button": {
- "name": "鍥為浂",
- "value": 0,
- "address": "DB10.0",
- "state": 0
- }
- }
- ],
- [
- {
- "name": "B01鎵嬪姩鏍煎瓙",
- "value": 0,
- "sending": 0,
- "type": "0",
- "address": "DB100.0",
- "count": 3,
- "state": 1
- },
- {
- "name": "B01瀹氫綅閫熷害",
- "value": 0,
- "sending": 0,
- "address": "DB100.0",
- "type": "0",
- "state": 1
- },
- {
- "name": "B01褰撳墠鏍煎瓙",
- "value": 0,
- "sending": 0,
- "address": "DB100.0",
- "type": "0",
- "state": 1
- },
- {
- "button": {
- "name": "B01鍚姩",
- "value": 0,
- "address": "DB10.0",
- "state": 1
- }
- },
- {
- "button": {
- "name": "鏁呴殰",
- "value": 0,
- "address": "DB10.0",
- "state": 1
- }
- },
- {
- "button": {
- "name": "澶嶄綅",
- "value": 0,
- "address": "DB10.0",
- "state": 1
- }
- },
- {
- "button": {
- "name": "鏈洖闆�",
- "value": 0,
- "address": "DB10.0",
- "state": 1
- }
- },
- {
- "button": {
- "name": "鍥為浂",
- "value": 0,
- "address": "DB10.0",
- "state": 1
- }
- }
- ],
- [
- {
- "name": "B02鎵嬪姩鏍煎瓙",
- "value": 0,
- "sending": 0,
- "type": "0",
- "address": "DB100.0",
- "count": 3,
- "state": 1
- },
- {
- "name": "B02瀹氫綅閫熷害",
- "value": 0,
- "sending": 0,
- "address": "DB100.0",
- "type": "0",
- "state": 1
- },
- {
- "name": "B02褰撳墠鏍煎瓙",
- "value": 0,
- "sending": 0,
- "address": "DB100.0",
- "type": "0",
- "state": 1
- },
- {
- "button": {
- "name": "B02鍚姩",
- "value": 0,
- "address": "DB10.0",
- "state": 1
- }
- },
- {
- "button": {
- "name": "鏁呴殰",
- "value": 1,
- "address": "DB10.0",
- "state": 1
- }
- },
- {
- "button": {
- "name": "澶嶄綅",
- "value": 0,
- "address": "DB10.0",
- "state": 1
- }
- },
- {
- "button": {
- "name": "鏈洖闆�",
- "value": 0,
- "address": "DB10.0",
- "state": 1
- }
- },
- {
- "button": {
- "name": "鍥為浂",
- "value": 0,
- "address": "DB10.0",
- "state": 1
- }
- }
- ],
- [
- {
- "name": "A01瀹炴椂浣嶇疆",
- "value": 0,
- "sending": 4,
- "type": "0",
- "address": "DB100.0",
- "count": 3,
- "state": 1
- }
- ],
- [
- {
- "name": "A02瀹炴椂浣嶇疆",
- "value": 0,
- "sending": 5,
- "type": "0",
- "address": "DB100.0",
- "count": 3,
- "state": 1
- }
- ],
- [
- {
- "name": "B01瀹炴椂浣嶇疆",
- "value": 0,
- "sending": 6,
- "type": "0",
- "address": "DB100.0",
- "count": 3,
- "state": 1
- }
- ],
- [
- {
- "name": "B02瀹炴椂浣嶇疆",
- "value": 0,
- "sending": 7,
- "type": "0",
- "address": "DB100.0",
- "count": 3,
- "state": 1
- }
- ]
+[
+ [
+ {
+ "name": "A01鎵嬪姩鏍煎瓙",
+ "value": 0,
+ "sending": 0,
+ "type": "0",
+ "address": "DB100.0",
+ "count": 3,
+ "state": 1
+ },
+ {
+ "name": "A01瀹氫綅閫熷害",
+ "value": 0,
+ "sending": 0,
+ "address": "DB100.0",
+ "type": "0",
+ "state": 1
+ },
+ {
+ "name": "A01褰撳墠鏍煎瓙",
+ "value": 0,
+ "sending": 0,
+ "address": "DB100.0",
+ "type": "0",
+ "state": 1
+ },
+ {
+ "button": {
+ "name": "A01鍚姩",
+ "value": 0,
+ "address": "DB10.0",
+ "state": 1
+ }
+ },
+ {
+ "button": {
+ "name": "A01鏁呴殰",
+ "value": 1,
+ "address": "DB10.0",
+ "state": 1
+ }
+ },
+ {
+ "button": {
+ "name": "A01澶嶄綅",
+ "value": 0,
+ "address": "DB10.0",
+ "state": 1
+ }
+ },
+ {
+ "button": {
+ "name": "A01鏈洖闆�",
+ "value": 0,
+ "address": "DB10.0",
+ "state": 0
+ }
+ },
+ {
+ "button": {
+ "name": "A01鍥為浂",
+ "value": 0,
+ "address": "DB10.0",
+ "state": 0
+ }
+ }
+ ],
+ [
+ {
+ "name": "A02鎵嬪姩鏍煎瓙",
+ "value": 0,
+ "sending": 0,
+ "type": "0",
+ "address": "DB100.0",
+ "count": 3,
+ "state": 1
+ },
+ {
+ "name": "A02瀹氫綅閫熷害",
+ "value": 0,
+ "sending": 0,
+ "address": "DB100.0",
+ "type": "0",
+ "state": 1
+ },
+ {
+ "name": "A02褰撳墠鏍煎瓙",
+ "value": 0,
+ "sending": 0,
+ "address": "DB100.0",
+ "type": "0",
+ "state": 1
+ },
+ {
+ "button": {
+ "name": "A02鍚姩",
+ "value": 0,
+ "address": "DB10.0",
+ "state": 1
+ }
+ },
+ {
+ "button": {
+ "name": "A02鏁呴殰",
+ "value": 0,
+ "address": "DB10.0",
+ "state": 1
+ }
+ },
+ {
+ "button": {
+ "name": "A02澶嶄綅",
+ "value": 0,
+ "address": "DB10.0",
+ "state": 1
+ }
+ },
+ {
+ "button": {
+ "name": "鏈洖闆�",
+ "value": 0,
+ "address": "DB10.0",
+ "state": 0
+ }
+ },
+ {
+ "button": {
+ "name": "鍥為浂",
+ "value": 0,
+ "address": "DB10.0",
+ "state": 0
+ }
+ }
+ ],
+ [
+ {
+ "name": "B01鎵嬪姩鏍煎瓙",
+ "value": 0,
+ "sending": 0,
+ "type": "0",
+ "address": "DB100.0",
+ "count": 3,
+ "state": 1
+ },
+ {
+ "name": "B01瀹氫綅閫熷害",
+ "value": 0,
+ "sending": 0,
+ "address": "DB100.0",
+ "type": "0",
+ "state": 1
+ },
+ {
+ "name": "B01褰撳墠鏍煎瓙",
+ "value": 0,
+ "sending": 0,
+ "address": "DB100.0",
+ "type": "0",
+ "state": 1
+ },
+ {
+ "button": {
+ "name": "B01鍚姩",
+ "value": 0,
+ "address": "DB10.0",
+ "state": 1
+ }
+ },
+ {
+ "button": {
+ "name": "B01鏁呴殰",
+ "value": 0,
+ "address": "DB10.0",
+ "state": 1
+ }
+ },
+ {
+ "button": {
+ "name": "B01澶嶄綅",
+ "value": 0,
+ "address": "DB10.0",
+ "state": 1
+ }
+ },
+ {
+ "button": {
+ "name": "B01鏈洖闆�",
+ "value": 0,
+ "address": "DB10.0",
+ "state": 1
+ }
+ },
+ {
+ "button": {
+ "name": "B01鍥為浂",
+ "value": 0,
+ "address": "DB10.0",
+ "state": 1
+ }
+ }
+ ],
+ [
+ {
+ "name": "B02鎵嬪姩鏍煎瓙",
+ "value": 0,
+ "sending": 0,
+ "type": "0",
+ "address": "DB100.0",
+ "count": 3,
+ "state": 1
+ },
+ {
+ "name": "B02瀹氫綅閫熷害",
+ "value": 0,
+ "sending": 0,
+ "address": "DB100.0",
+ "type": "0",
+ "state": 1
+ },
+ {
+ "name": "B02褰撳墠鏍煎瓙",
+ "value": 0,
+ "sending": 0,
+ "address": "DB100.0",
+ "type": "0",
+ "state": 1
+ },
+ {
+ "button": {
+ "name": "B02鍚姩",
+ "value": 0,
+ "address": "DB10.0",
+ "state": 1
+ }
+ },
+ {
+ "button": {
+ "name": "B02鏁呴殰",
+ "value": 1,
+ "address": "DB10.0",
+ "state": 1
+ }
+ },
+ {
+ "button": {
+ "name": "B02澶嶄綅",
+ "value": 0,
+ "address": "DB10.0",
+ "state": 1
+ }
+ },
+ {
+ "button": {
+ "name": "B02鏈洖闆�",
+ "value": 0,
+ "address": "DB10.0",
+ "state": 1
+ }
+ },
+ {
+ "button": {
+ "name": "B02鍥為浂",
+ "value": 0,
+ "address": "DB10.0",
+ "state": 1
+ }
+ }
+ ],
+ [
+ {
+ "name": "A01瀹炴椂浣嶇疆",
+ "value": 0,
+ "sending": 4,
+ "type": "0",
+ "address": "DB100.0",
+ "count": 3,
+ "state": 1
+ }
+ ],
+ [
+ {
+ "name": "A02瀹炴椂浣嶇疆",
+ "value": 0,
+ "sending": 5,
+ "type": "0",
+ "address": "DB100.0",
+ "count": 3,
+ "state": 1
+ }
+ ],
+ [
+ {
+ "name": "B01瀹炴椂浣嶇疆",
+ "value": 0,
+ "sending": 6,
+ "type": "0",
+ "address": "DB100.0",
+ "count": 3,
+ "state": 1
+ }
+ ],
+ [
+ {
+ "name": "B02瀹炴椂浣嶇疆",
+ "value": 0,
+ "sending": 7,
+ "type": "0",
+ "address": "DB100.0",
+ "count": 3,
+ "state": 1
+ }
+ ]
]
\ No newline at end of file
diff --git a/CanadaMes-ui/src/configuration/Manualoneposition2.json b/CanadaMes-ui/src/configuration/Manualoneposition2.json
index 4f43f7c..67105f2 100644
--- a/CanadaMes-ui/src/configuration/Manualoneposition2.json
+++ b/CanadaMes-ui/src/configuration/Manualoneposition2.json
@@ -1,130 +1,130 @@
-[
- [
- {
- "name": "鎵嬪姩浣嶇疆",
- "value": 0,
- "sending": 0,
- "type": "0",
- "address": "DB100.0",
- "count": 3
- },
- {
- "name": "瀹氫綅閫熷害",
- "value": 0,
- "sending": 0,
- "address": "DB100.0",
- "type": "0"
- },
- {
- "name": "A01缈昏浆瀹炴椂浣嶇疆",
- "value": 0,
- "sending": 0,
- "address": "DB100.0",
- "type": "0"
- },
- {
- "button": {
- "name": "A01缈昏浆鍚姩",
- "value": 0,
- "address": "DB10.0",
- "state": 1
- }
- },
- {
- "button": {
- "name": "鏁呴殰",
- "value": 0,
- "address": "DB10.0",
- "state": 1
- }
- },
- {
- "button": {
- "name": "澶嶄綅",
- "value": 0,
- "address": "DB10.0",
- "state": 1
- }
- },
- {
- "button": {
- "name": "鏈洖闆�",
- "value": 0,
- "address": "DB10.0",
- "state": 1
- }
- },
- {
- "button": {
- "name": "鍥為浂",
- "value": 0,
- "address": "DB10.0",
- "state": 1
- }
- }
- ],
- [
- {
- "name": "鎵嬪姩浣嶇疆",
- "value": 0,
- "sending": 0,
- "type": "0",
- "address": "DB100.0",
- "count": 3
- },
- {
- "name": "瀹氫綅閫熷害",
- "value": 0,
- "sending": 0,
- "address": "DB100.0",
- "type": "0"
- },
- {
- "name": "A02缈昏浆瀹炴椂浣嶇疆",
- "value": 0,
- "sending": 0,
- "address": "DB100.0",
- "type": "0"
- },
- {
- "button": {
- "name": "A02缈昏浆鍚姩",
- "value": 0,
- "address": "DB10.0",
- "state": 1
- }
- },
- {
- "button": {
- "name": "鏁呴殰",
- "value": 0,
- "address": "DB10.0",
- "state": 1
- }
- },
- {
- "button": {
- "name": "澶嶄綅",
- "value": 0,
- "address": "DB10.0",
- "state": 1
- }
- },
- {
- "button": {
- "name": "鏈洖闆�",
- "value": 0,
- "address": "DB10.0",
- "state": 1
- }
- },
- {
- "button": {
- "name": "鍥為浂",
- "value": 0,
- "address": "DB10.0",
- "state": 1
- }
- }
- ]
+[
+ [
+ {
+ "name": "A01鎵嬪姩浣嶇疆",
+ "value": 0,
+ "sending": 0,
+ "type": "0",
+ "address": "DB100.0",
+ "count": 3
+ },
+ {
+ "name": "A01瀹氫綅閫熷害",
+ "value": 0,
+ "sending": 0,
+ "address": "DB100.0",
+ "type": "0"
+ },
+ {
+ "name": "A01缈昏浆瀹炴椂浣嶇疆",
+ "value": 0,
+ "sending": 0,
+ "address": "DB100.0",
+ "type": "0"
+ },
+ {
+ "button": {
+ "name": "A01缈昏浆鍚姩",
+ "value": 0,
+ "address": "DB10.0",
+ "state": 1
+ }
+ },
+ {
+ "button": {
+ "name": "A01鏁呴殰",
+ "value": 0,
+ "address": "DB10.0",
+ "state": 1
+ }
+ },
+ {
+ "button": {
+ "name": "A01澶嶄綅",
+ "value": 0,
+ "address": "DB10.0",
+ "state": 1
+ }
+ },
+ {
+ "button": {
+ "name": "A01鏈洖闆�",
+ "value": 0,
+ "address": "DB10.0",
+ "state": 1
+ }
+ },
+ {
+ "button": {
+ "name": "A01鍥為浂",
+ "value": 0,
+ "address": "DB10.0",
+ "state": 1
+ }
+ }
+ ],
+ [
+ {
+ "name": "A02鎵嬪姩浣嶇疆",
+ "value": 0,
+ "sending": 0,
+ "type": "0",
+ "address": "DB100.0",
+ "count": 3
+ },
+ {
+ "name": "A02瀹氫綅閫熷害",
+ "value": 0,
+ "sending": 0,
+ "address": "DB100.0",
+ "type": "0"
+ },
+ {
+ "name": "A02缈昏浆瀹炴椂浣嶇疆",
+ "value": 0,
+ "sending": 0,
+ "address": "DB100.0",
+ "type": "0"
+ },
+ {
+ "button": {
+ "name": "A02缈昏浆鍚姩",
+ "value": 0,
+ "address": "DB10.0",
+ "state": 1
+ }
+ },
+ {
+ "button": {
+ "name": "A02鏁呴殰",
+ "value": 0,
+ "address": "DB10.0",
+ "state": 1
+ }
+ },
+ {
+ "button": {
+ "name": "A02澶嶄綅",
+ "value": 0,
+ "address": "DB10.0",
+ "state": 1
+ }
+ },
+ {
+ "button": {
+ "name": "A02鏈洖闆�",
+ "value": 0,
+ "address": "DB10.0",
+ "state": 1
+ }
+ },
+ {
+ "button": {
+ "name": "A02鍥為浂",
+ "value": 0,
+ "address": "DB10.0",
+ "state": 1
+ }
+ }
+ ]
]
\ No newline at end of file
diff --git a/CanadaMes-ui/src/configuration/ServoManualone.json b/CanadaMes-ui/src/configuration/ServoManualone.json
index d0a65e1..48bb45c 100644
--- a/CanadaMes-ui/src/configuration/ServoManualone.json
+++ b/CanadaMes-ui/src/configuration/ServoManualone.json
@@ -19,15 +19,7 @@
},
- {
- "name": "杩涚墖ID",
- "read": 33,
- "sending": 0,
- "type": "0",
- "value":0
-
- },
{
"name": "闀垮害",
"read": 33,
@@ -59,6 +51,15 @@
"sending": 0,
"type": "0",
"value":0
+ },
+ {
+ "name": "杩涚墖ID",
+ "read": 9999,
+ "sending": 0,
+ "type": "0",
+ "value":0
+
+
},
{
"button": {
@@ -124,7 +125,7 @@
},
{
"name": "鍙栫墖ID",
- "read": 33,
+ "read": 8888,
"sending": 0,
"type": "0",
"value":0
@@ -191,7 +192,8 @@
"button": {
"name": "鏈洖闆�",
"value":0,
- "address":"DB10.0"
+ "address":"DB10.0",
+ "type":"66"
}
},
{
@@ -231,7 +233,8 @@
"button": {
"name": "鏈洖闆�",
"value":0,
- "address":"DB10.0"
+ "address":"DB10.0",
+ "type":"66"
}
},
{
@@ -275,8 +278,10 @@
} ,{
"button": {
"name": "鏈洖闆�",
+
"value":0,
- "address":"DB10.0"
+ "address":"DB10.0",
+ "type":"66"
}
},
{
@@ -324,7 +329,8 @@
"button": {
"name": "鏈洖闆�",
"value":0,
- "address":"DB10.0"
+ "address":"DB10.0",
+ "type":"66"
}
},
{
diff --git a/CanadaMes-ui/src/configuration/parameter2.json b/CanadaMes-ui/src/configuration/parameter2.json
index 442b36e..884e9d9 100644
--- a/CanadaMes-ui/src/configuration/parameter2.json
+++ b/CanadaMes-ui/src/configuration/parameter2.json
@@ -172,6 +172,25 @@
"sending": 0,
"type": "0",
"value": 0
+ }
+
+ ],
+ [
+ {
+ "button": {
+ "name": "A01鎵嬪姩鐘舵��",
+ "value": 0,
+ "address": "DB10.0"
+ },
+ "type": "4"
+ },
+ {
+ "button": {
+ "name": "娓呴櫎ID",
+ "value": 0,
+ "address": "DB10.0"
+ },
+ "type": "3"
},
{
"name": "ID2",
@@ -180,6 +199,7 @@
"type": "0",
"value": 0
}
+
],
[
{
@@ -259,6 +279,13 @@
[
{
"name": "鎵弿鏋壂鐮佺殑ID",
+ "read": 0,
+ "sending": 0,
+
+ "value": 0
+ },
+ {
+ "name": "ID1",
"read": 66,
"sending": 0,
"type": "0",
@@ -267,6 +294,22 @@
],
[
{
+ "name": "鎵弿鏋壂鐮佺殑ID",
+ "read": 0,
+ "sending": 0,
+
+ "value": 0
+ },
+ {
+ "name": "ID2",
+ "read": 666,
+ "sending": 0,
+ "type": "0",
+ "value": 0
+ }
+ ],
+ [
+ {
"name": "A01褰撳墠鏍煎瓙",
"read": 333,
"sending": 0,
diff --git a/CanadaMes-ui/src/lang/locales/en-US.json b/CanadaMes-ui/src/lang/locales/en-US.json
index 4c7a184..e7a6d17 100644
--- a/CanadaMes-ui/src/lang/locales/en-US.json
+++ b/CanadaMes-ui/src/lang/locales/en-US.json
@@ -311,5 +311,207 @@
"Outing":"Outing",
"Suspend":"Suspend",
"Stop":"Stop",
- "Start":"Start"
+ "Start":"Start",
+ "ServoManualone": {
+ "A01 鎵�鍦ㄦ牸瀛�": "A01 Current Grid",
+ "鏁伴噺": "Quantity",
+ "杩涚墖ID": "IncomingId",
+ "闀垮害": "Length",
+ "楂樺害": "Height",
+ "鍙栫墖鏍煎瓙": "Pickupgrid address",
+ "瀛樼墖鏍煎瓙": "Storagegrid address",
+ "A01缈昏浆瀹炴椂浣嶇疆": "A01FlipPosition",
+ "A02缈昏浆瀹炴椂浣嶇疆": "A02FlipPosition",
+ "鏁呴殰": "Fault",
+ "澶嶄綅": "Reset",
+ "鏈洖闆�": "NotZero",
+ "鍥為浂": "Home",
+ "鐩爣鏍煎瓙": "Target Grid",
+ "A02 鎵�鍦ㄦ牸瀛�": "A02 Current Grid",
+ "鍙栫墖ID": "PickupId",
+ "A01鍗婅嚜鍔�": "A01 Semi-Auto",
+ "A01鍗婅嚜鍔ㄥ惎鍔�": "A01 Semi-Auto Start",
+ "A02鍗婅嚜鍔�": "A02 Semi-Auto",
+ "A02鍗婅嚜鍔ㄥ惎鍔�": "A02 Semi-Auto Start",
+ "B01 鎵�鍦ㄦ牸瀛�": "B01 Current Grid",
+ "B02 鎵�鍦ㄦ牸瀛�": "B02 Current Grid"
+ },
+ "langParameter1": {
+
+ "A01~A02杈撻��": "A01~A02 Conveying",
+ "B01~B02杈撻��": "B01~B02 Conveying",
+ "D01~D02杈撻��": "D01~D02 Conveying",
+ "缈昏浆鐐瑰姩閫熷害": "Flip Jog Speed",
+ "灏忚溅鐐瑰姩閫熷害": "Cart Jog Speed",
+ "鏈�楂橀�熷害": "Max Speed",
+ "楂橀�熺嚎閫熷害": "High-Speed Line Speed",
+ "浣庨�熺嚎閫熷害": "Low-Speed Line Speed",
+ "鎵嬪姩閫熷害": "Manual Speed"
+ },
+
+ "langParameter2": {
+ "D01鎵嬪姩鐘舵��": "D01 Manual Status",
+ "娓呴櫎ID": "Clear ID",
+ "ID": "ID",
+ "D02鎵嬪姩鐘舵��": "D02 Manual Status",
+ "D03鎵嬪姩鐘舵��": "D03 Manual Status",
+ "D04鎵嬪姩鐘舵��": "D04 Manual Status",
+ "D05鎵嬪姩鐘舵��": "D05 Manual Status",
+ "D06鎵嬪姩鐘舵��": "D06 Manual Status",
+ "A01鎵嬪姩鐘舵��": "A01 Manual Status",
+ "ID1": "ID1",
+ "ID2": "ID2",
+ "A02鎵嬪姩鐘舵��": "A02 Manual Status",
+ "B01鎵嬪姩鐘舵��": "B01 Manual Status",
+ "B02鎵嬪姩鐘舵��": "B02 Manual Status",
+ "鎵弿鏋壂鐮佺殑ID": "Scanned ID",
+ "A01褰撳墠鏍煎瓙": "A01 Current Grid",
+ "A02鎵�鍦ㄦ牸瀛�": "A02 Current Grid",
+ "B01鎵�鍦ㄦ牸瀛�": "B01 Current Grid",
+ "B02鎵�鍦ㄦ牸瀛�": "B02 Current Grid"
+ },
+ "langPositioning1": {
+ "鏍煎瓙闂磋窛": "GridSpacing",
+ "瀛樼墖鎺ョ墖鍦板潃": "StorageReceivingAddress",
+ "鍑虹墖鎺ョ墖鍦板潃": "OutgoingReceivingAddress",
+ "瀛樼墖鏍间綅缃瀹�": "StorageGridPositionSetting",
+ "1#鏍煎湴鍧�": "grid address1# ",
+ "22#鏍煎湴鍧�": "grid address22#",
+ "43#鏍煎湴鍧�": "grid address43#",
+ "64#鏍煎湴鍧�": "grid address64#",
+ "85#鏍煎湴鍧�": "grid address85#",
+ "106#鏍煎湴鍧�": "grid address106#",
+ "127#鏍煎湴鍧�": "grid address127#",
+ "148#鏍煎湴鍧�": "grid address148#",
+ "169#鏍煎湴鍧�": "grid address169#",
+ "190#鏍煎湴鍧�": "grid address190#",
+ "鍑虹墖鏍间綅缃瀹�": "OutgoingGridPositionSetting",
+ "A01鎵�鍦ㄦ牸瀛�": "A01 grid address",
+ "鏁伴噺": "Quantity",
+ "杩涚墖ID": "IncomingId",
+ "闀垮害": "Length",
+ "楂樺害": "Height",
+ "鍙栫墖鏍煎瓙": "Pickupgrid address",
+ "缈昏浆瀹炴椂浣嶇疆": "FlipPosition",
+ "鏁呴殰": "Fault",
+ "澶嶄綅": "Reset",
+ "鏈洖闆�": "NotZero",
+ "鍥為浂": "Zero",
+ "鐩爣鏍煎瓙": "Target Grid"
+ },
+ "langPositioning2": {
+ "鏍煎瓙闂磋窛": "GridSpacing",
+ "瀛樼墖鎺ョ墖鍦板潃": "StorageReceivingAddress",
+ "鍑虹墖鎺ョ墖鍦板潃": "OutgoingReceivingAddress",
+ "瀛樼墖鏍间綅缃瀹�": "StorageGridPositionSetting",
+ "1#鏍煎湴鍧�": "grid address1# ",
+ "22#鏍煎湴鍧�": "grid address22#",
+ "43#鏍煎湴鍧�": "grid address43#",
+ "64#鏍煎湴鍧�": "grid address64#",
+ "85#鏍煎湴鍧�": "grid address85#",
+ "106#鏍煎湴鍧�": "grid address106#",
+ "127#鏍煎湴鍧�": "grid address127#",
+ "148#鏍煎湴鍧�": "grid address148#",
+ "169#鏍煎湴鍧�": "grid address169#",
+ "190#鏍煎湴鍧�": "grid address190#",
+ "鍑虹墖鏍间綅缃瀹�": "OutgoingGridPositionSetting",
+ "B01鏍间綅缃瀹�":"B01PositionSetting",
+ "B02浣嶇疆璁惧畾":"B02PositionSetting"
+ },"ManualonePositionlang": {
+ "A01鎵嬪姩鏍煎瓙": "A01 Target grid(Manual)",
+ "A01瀹氫綅閫熷害": "A01 TRAVEL POS Velocity manual",
+ "A01褰撳墠鏍煎瓙": "A01 Current Grid",
+ "A01鍚姩": "A01 Start",
+ "A01鏁呴殰": "A01 Fault",
+ "A01澶嶄綅": "A01 Reset",
+ "A02鎵嬪姩鏍煎瓙": "A02 Target grid(Manual)",
+ "A02瀹氫綅閫熷害": "A02 TRAVEL POS Velocity manual",
+ "A02褰撳墠鏍煎瓙": "A02 Current Grid",
+ "A02鍚姩": "A02 Start",
+ "A02鏁呴殰": "A02 Fault",
+ "A02澶嶄綅": "A02 Reset",
+ "B01鎵嬪姩鏍煎瓙": "B01 Target grid(Manual)",
+ "B01瀹氫綅閫熷害": "B01 TRAVEL POS Velocity manual",
+ "B01褰撳墠鏍煎瓙": "B01 Current Grid",
+ "B01鍚姩": "Start",
+ "B01鏁呴殰": "Fault",
+ "B01澶嶄綅": "Reset",
+ "B01鍥為浂": "Zero",
+ "B01鏈洖闆�": "NotZero",
+ "B02鎵嬪姩鏍煎瓙": "B02 Target grid(Manual)",
+ "B02瀹氫綅閫熷害": "B02 TRAVEL POS Velocity manual",
+ "B02褰撳墠鏍煎瓙": "B02 Current Grid",
+ "B02鍚姩": "Start",
+ "B02鏁呴殰": "Fault",
+ "B02澶嶄綅": "Reset",
+ "B02鍥為浂": "Zero",
+ "B02鏈洖闆�": "NotZero",
+ "A01瀹炴椂浣嶇疆": "A01 tavel Actual Position",
+ "A02瀹炴椂浣嶇疆": "A02 tavel Actual Position",
+ "B01瀹炴椂浣嶇疆": "B02 tavel Actual Position",
+ "B02瀹炴椂浣嶇疆": "B02 tavel Actual Position"
+ },
+ "Manualoneposition2lang": {
+ "A01鎵嬪姩浣嶇疆": "A01 turn Target Angle(Manual)",
+ "A01瀹氫綅閫熷害": "A01 TURN POS Velocity manual",
+ "A01缈昏浆瀹炴椂浣嶇疆": "A01 turn Actual angle",
+ "A01缈昏浆鍚姩": "A01 SERVE TURN",
+ "A01鏁呴殰": "Fault",
+ "A01澶嶄綅": "Reset",
+ "A01鏈洖闆�": "NotZero",
+ "A01鍥為浂": "Zero",
+ "A02鎵嬪姩浣嶇疆": "A02 turn Target Angle(Manual)",
+ "A02瀹氫綅閫熷害": "A02 TURN POS Velocity manual",
+ "A02缈昏浆瀹炴椂浣嶇疆": "A02 turn Actual angle",
+ "A02缈昏浆鍚姩": "SERVE TURN",
+ "A02鏁呴殰": "Fault",
+ "A02澶嶄綅": "Reset",
+ "A02鏈洖闆�": "NotZero",
+ "A02鍥為浂": "Zero"
+ },
+ "AutomaticParameterSettinglang": {
+ "A01琛岃蛋楂橀�熻搴�": "A01 turn Angle1",
+ "A01琛岃蛋浣庨�熻搴�": "A01 turn Angle2",
+ "A01杈撻�佹帴鐗囪搴�": "A01 turn Angle3",
+ "A01绗煎瓙瑙掑害": "A01 turn Angle4",
+ "A02琛岃蛋楂橀�熻搴�": "A02 turn Angle1",
+ "A02琛岃蛋浣庨�熻搴�": "A02 turn Angle2",
+ "A02杈撻�佹帴鐗囪搴�": "A02 turn Angle3",
+ "A02绗煎瓙瑙掑害": "A02 turn Angle4",
+ "澶ц溅鑷姩閫熷害": "A01 A02 TRAVEL POS Velocity AUTO",
+ "灏忚溅鑷姩閫熷害": "B01 B02 TRAVEL POS Velocity AUTO",
+ "鑷姩缈昏浆閫熷害": "A01 A02 TURN POS Velocity AUTO"
+ },
+ "ManualJoglang": {
+ "D01杈撻��": "D01 VFD conveyor",
+ "D02杈撻��": "D02 VFD conveyor",
+ "D03杈撻��": "D03 VFD conveyor",
+ "D04杈撻��": "D04 VFD conveyor",
+ "D05杈撻��": "D05 VFD conveyor",
+ "D06杈撻��": "D06 VFD conveyor",
+ "A01杈撻�佹鍚�": "A01 VFD conveyor",
+ "A02杈撻�佹鍚�": "A02 VFD conveyor",
+ "B01杈撻��": "B01 VFD conveyor",
+ "B02杈撻��": "B02 VFD conveyor",
+ "A01缈昏浆": "A01 SERVE TURN",
+ "A02缈昏浆": "A02 SERVE TURN",
+ "A01琛岃蛋鐐瑰姩": "A01 SERVE TRAVEL",
+ "A02琛岃蛋鐐瑰姩": "A02 SERVE TRAVEL",
+ "B01琛岃蛋鐐瑰姩": "B01 SERVE TRAVEL",
+ "B02琛岃蛋鐐瑰姩": "B02 SERVE TRAVEL",
+ "B02缈昏浆姘旂几": "B02 YV TURN",
+ "B02鍗囬檷姘旂几": "B02 YV UP DOWN",
+ "B02鐢电闃�": "B02 YV Gassing",
+ "B01缈昏浆姘旂几": "B01 YV TURN",
+ "B01鍗囬檷姘旂几": "B01 YV UP DOWN",
+ "B01鐢电闃�": "B01 YV Gassing",
+ "A01杈撻�佸弽鍚�": "A01 VFD conveyor reverse",
+ "A02杈撻�佸弽鍚�": "A02 VFD conveyor reverse",
+ "A01娉ㄧ數娉�": "A01 oil pump",
+ "A02娉ㄧ數娉�": "A02 oil pump"
+ }
+
+
+
+
}
\ No newline at end of file
diff --git a/CanadaMes-ui/src/layout/index.vue b/CanadaMes-ui/src/layout/index.vue
index c235d51..fbf513e 100644
--- a/CanadaMes-ui/src/layout/index.vue
+++ b/CanadaMes-ui/src/layout/index.vue
@@ -34,7 +34,7 @@
<el-menu-item :index="'/'+menu.router"
v-for="menu in item.menuLists" :key="menu.id"
- @click="addTag(menu.router)">
+ >
<template slot="title">
<!--鍥炬爣-->
<i :class="menu.icon"></i>
@@ -56,9 +56,9 @@
<div class="header-left">
<el-button :icon="isCollapse ? 'el-icon-s-unfold' : 'el-icon-s-fold'" @click="toggleCollapse" style="height:30px;"></el-button>
</div>
- <div class="tagContainer" style="display: flex;">
+ <!-- <div class="tagContainer" style="display: flex;">
<tag v-for="(tag, index) in tags" :key="index" :tag="tag" @removeTag="removeTag(index)" @switchTag="switchTag(index)"></tag>
-</div>
+</div> -->
<template>
<el-submenu index="1" class="custom-submenu" >
<template slot="title">
@@ -103,13 +103,13 @@
import { changePassword } from '../api/user'
import { removeToken } from "../utils/auth";
import LanguageMixin from '../lang/LanguageMixin'
-import { mapState, mapMutations } from 'vuex';
-import Tag from '../layout/tag.vue';
-import store from '../store';
+// import { mapState, mapMutations } from 'vuex';
+// import Tag from '../layout/tag.vue';
+// import store from '../store';
export default {
name: "Layout",
- store,
+ // store,
mixins: [LanguageMixin],
data() {
return {
@@ -130,9 +130,9 @@
}
}
},
- components: {
- Tag
- },
+ // components: {
+ // Tag
+ // },
created() {
selectList(this.menuListForm).then(res => {
this.menuList = res.data
@@ -142,11 +142,11 @@
this.replaceChineseWithEnglish(this.menuList);
}
// 璁板綍涓婁竴娆℃縺娲荤殑鑿滃崟
- this.activePath = window.sessionStorage.getItem('activePath')
+ // this.activePath = window.sessionStorage.getItem('activePath')
});
},
computed: {
- ...mapState('tags', ['tags'])
+ // ...mapState('tags', ['tags'])
},
methods: {
@@ -158,22 +158,22 @@
this.$router.push('/home');
},
- ...mapMutations('tags', ['addTag', 'removeTag', 'switchTag']),
- addTag(router) {
- let submenuItem;
- const menuItem = this.menuList.find(item => item.menuLists.some(menu => menu.router === router));
- if (menuItem) {
- submenuItem = menuItem.menuLists.find(menu => menu.router === router);
- }
- if (submenuItem) {
- const tag = submenuItem.router;
- this.$store.commit('tags/addTag', tag);
- }
+ // ...mapMutations('tags', ['addTag', 'removeTag', 'switchTag']),
+ addTag() {
+ // let submenuItem;
+ // const menuItem = this.menuList.find(item => item.menuLists.some(menu => menu.router === router));
+ // if (menuItem) {
+ // submenuItem = menuItem.menuLists.find(menu => menu.router === router);
+ // }
+ // if (submenuItem) {
+ // const tag = submenuItem.router;
+ // this.$store.commit('tags/addTag', tag);
+ // }
},
- removeTag(index) {
- this.$store.commit('tags/removeTag', index); // 浠� Vuex Store 涓Щ闄ゆ爣绛�
+ removeTag() {
+ // this.$store.commit('tags/removeTag', index); // 浠� Vuex Store 涓Щ闄ゆ爣绛�
},
showChangePasswordDialog() {
this.dialogVisible = true;
diff --git a/CanadaMes-ui/src/main.js b/CanadaMes-ui/src/main.js
index 07eff9c..197ff46 100644
--- a/CanadaMes-ui/src/main.js
+++ b/CanadaMes-ui/src/main.js
@@ -10,7 +10,7 @@
import VueI18n from 'vue-i18n'
import zhCN from './lang/locales/zh-CN.json' // 涓枃璇█鍖�
import enUS from './lang/locales/en-US.json' // 鑻辨枃璇█鍖�
-import store from './store'
+// import store from './store'
// import store from './store'
Vue.use(VueI18n)
@@ -37,7 +37,7 @@
new Vue({
router,
i18n,
- store,
+ // store,
render: h => h(App)
}).$mount('#app');
diff --git a/CanadaMes-ui/src/router/index.js b/CanadaMes-ui/src/router/index.js
index 00c33a3..594f4db 100644
--- a/CanadaMes-ui/src/router/index.js
+++ b/CanadaMes-ui/src/router/index.js
@@ -134,7 +134,10 @@
const router = new VueRouter({
// base: '/canadames/',
- routes
+ routes,
+ meta:{
+keepAlive:false
+ }
});
// 璺敱鎺у埗瀹堝崼,瑙e喅闇�瑕佺櫥褰曟墠鍙互璁块棶鐨勯〉闈�
@@ -144,8 +147,6 @@
// 鑾峰彇token
const hasToken = getToken();
-
-
const isExist = Vue.prototype.$tagList.some(tag => tag.path === to.fullPath);
diff --git a/CanadaMes-ui/src/store/index.js b/CanadaMes-ui/src/store/index.js
deleted file mode 100644
index a10adaa..0000000
--- a/CanadaMes-ui/src/store/index.js
+++ /dev/null
@@ -1,38 +0,0 @@
-// src/store/index.js
-
-import Vue from 'vue';
-import Vuex from 'vuex';
-import tags from './module/tags';
-
-Vue.use(Vuex);
-
-export default new Vuex.Store({
- modules: {
- tags,
- },
- // state: {
- // tagData: {} // 瀛樺偍鏍囩鏁版嵁鐨勫璞�
- // },
- mutations: {
- // 鏇存柊鏍囩鏁版嵁
- updateTagData(state, payload) {
- state.tagData[payload.tag] = payload.data;
- }
- },
- actions: {
- // 寮傛鎿嶄綔鏇存柊鏍囩鏁版嵁
- updateTagDataAsync({ commit }, payload) {
- // 鎵ц寮傛鎿嶄綔锛屾瘮濡傚彂閫佽姹傝幏鍙栨暟鎹�
- // 鐒跺悗閫氳繃commit瑙﹀彂mutation鏉ユ洿鏂版暟鎹�
- setTimeout(() => {
- commit('updateTagData', payload);
- }, 1000);
- }
- },
- getters: {
- getTagData: (state) => (tag) => {
- return state.tagData[tag] || null; // 鑾峰彇鎸囧畾鏍囩鐨勬暟鎹�
- }
- }
- // 鍏朵粬閰嶇疆
-});
diff --git a/CanadaMes-ui/src/store/module/tags.js b/CanadaMes-ui/src/store/module/tags.js
deleted file mode 100644
index a16623a..0000000
--- a/CanadaMes-ui/src/store/module/tags.js
+++ /dev/null
@@ -1,27 +0,0 @@
-const state = {
- tags: []
-}
-
-const mutations = {
- addTag(state, tag) {
- if (!state.tags.includes(tag)) {
- state.tags.push(tag);
- }
- },
- removeTag(state, index) {
- state.tags.splice(index, 1);
- },
- removeAllTags(state) {
- state.tags = [];
- },
- switchTag(tag) {
- this.$emit('switchTag', tag);
- this.$router.push('/' + tag); // 娣诲姞杩欒浠g爜浠ュ垏鎹㈣矾鐢�
- }
-}
-
-export default {
- namespaced: true,
- state,
- mutations
-}
diff --git a/CanadaMes-ui/src/views/Electrical/Action.vue b/CanadaMes-ui/src/views/Electrical/Action.vue
index f27af2a..7a9e3a3 100644
--- a/CanadaMes-ui/src/views/Electrical/Action.vue
+++ b/CanadaMes-ui/src/views/Electrical/Action.vue
@@ -2,7 +2,7 @@
<div class="app">
<!--闈㈠寘灞戝鑸尯鍩�-->
<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 to="/Electrical/ServoManualone" 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>
@@ -12,11 +12,10 @@
}}</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('ServoManual')
+ <router-link to="/Electrical/Servomanual" tag="el-button" type="text" active-class="blue-button">{{ $t('Servo Manual')
}}</router-link>
</el-breadcrumb>
-
+
<div>Action</div>
<el-form label-width="100px" style="display: flex;flex-wrap: wrap;" :model="{ messagepack }">
<!-- <div class="kuai_div" v-for="item in record.xyData" :key="item.value">
@@ -48,10 +47,62 @@
jsonData: data,
activeButton: '',
record: {
- params: [],
-
+ params: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
+ canshu: [
+ 'D01 VFD conveyor',
+ 'D02 VFD conveyor',
+ 'D03 VFD conveyor',
+ 'D04 VFD conveyor',
+ 'D05 VFD conveyor',
+ 'D06 VFD conveyor',
+ 'A01 VFD conveyor',
+ 'A02 VFD conveyor',
+ 'B01 VFD conveyor',
+ 'B02 VFD conveyor',
+ 'A01 SERVE TURN JOG+',
+ 'A02 SERVE TURN JOG-',
+ 'A01 SERVE TRAVEL JOG+',
+ 'A02 SERVE TRAVEL JOG-',
+ 'B01 SERVE TRAVEL JOG+',
+ 'B02 SERVE TRAVEL JOG-',
+ 'A01 SERVE TURN POS',
+ 'A02 SERVE TURN POS',
+ 'A01 SERVE TRAVEL POS',
+ 'A02 SERVE TRAVEL POS',
+ 'B01 SERVE TRAVEL POS',
+ 'B02 SERVE TRAVEL POS',
+ 'B01 YV TURN',
+ 'B01 YV UP DOWN',
+ 'B02 YV TURN',
+ 'B02 YV UP DOWN',
+ ],
xyData: [
-
+ { name: 'D01 VFD conveyor', value: "0" },
+ { name: 'D02 VFD conveyor', value: "0" },
+ { name: 'D03 VFD conveyor', value: "0" },
+ { name: 'D04 VFD conveyor', value: "0" },
+ { name: 'D05 VFD conveyor', value: "0" },
+ { name: 'D06 VFD conveyor', value: "0" },
+ { name: 'A01 VFD conveyor', value: "0" },
+ { name: 'A02 VFD conveyor', value: "0" },
+ { name: 'B01 VFD conveyor', value: "0" },
+ { name: 'B02 VFD conveyor', value: "0" },
+ { name: 'A01 SERVE TURN JOG+', value: "0" },
+ { name: 'A02 SERVE TURN JOG-', value: "0" },
+ { name: 'A01 SERVE TRAVEL JOG+', value: "0" },
+ { name: 'A02 SERVE TRAVEL JOG-', value: "0" },
+ { name: 'B01 SERVE TRAVEL JOG+', value: "0" },
+ { name: 'B02 SERVE TRAVEL JOG-', value: "0" },
+ { name: 'A01 SERVE TURN POS', value: "0" },
+ { name: 'A02 SERVE TURN POS', value: "0" },
+ { name: 'A01 SERVE TRAVEL POS', value: "0" },
+ { name: 'A02 SERVE TRAVEL POS', value: "0" },
+ { name: 'B01 SERVE TRAVEL POS', value: "0" },
+ { name: 'B02 SERVE TRAVEL POS', value: "0" },
+ { name: 'B01 YV TURN', value: "0" },
+ { name: 'B01 YV UP DOWN', value: "0" },
+ { name: 'B02 YV TURN', value: "0" },
+ { name: 'B02 YV UP DOWN', value: "0" },
]
,
},
@@ -67,9 +118,13 @@
}
},
- created () {
+ // created () {
+ // this.init();
+ // },
+ activated(){
+
this.init();
- },
+ },
methods: {
setActiveButton (buttonName) {
@@ -102,25 +157,13 @@
}
let obj = JSON.parse(msg.data);
- this.record.params[0] = obj.params[0];
- // console.log(obj.params);
+
if (obj.params) {
-
- this.record.xyData = this.jsonData.action;
-
- for (let a = 0; a < this.record.xyData.length; a++) {
- if (this.record.params[0][a]) {
- this.record.xyData[a].value = this.record.params[0][a].toString();
- }
-
+ this.record.params[0] = obj.params[0];
+ for (let a = 0; a <= this.record.params[0].length - 1; a++) {
+ this.record.xyData[a].name = this.jsonData.action[a].name;
+ this.record.xyData[a].value = this.record.params[0][a].toString();
}
-
- this.record.xyData = this.jsonData.action.filter(item => {
- return item.state != 0;
- }
-
- );
-
const language = this.$i18n.locale;
if (language === 'en-US') {
this.replaceChineseWithEnglish();
@@ -140,19 +183,22 @@
socket.onerror = function () {
console.log("websocket鍙戠敓浜嗛敊璇�");
}
+ this.$router.afterEach(function(){
+ socket.close();
+ })
}
},
send () {
this.messagepack.data = this.record.xyData.map(item => parseInt(item.value)); // 杞崲涓烘暣鏁版暟缁�
- console.log(this.messagepack);
+ //console.log(this.messagepack);
socket?.send(JSON.stringify(this.messagepack));
},
//璇█杞崲
replaceChineseWithEnglish () {
const translation = this.$t('langActions');
this.record.xyData = this.record.xyData.map(item => { return { name: translation[item.name] || item.name, value: item.value }; });
-
+ console.log(translation);
},
}
diff --git a/CanadaMes-ui/src/views/Electrical/AutomaticParameterSetting.vue b/CanadaMes-ui/src/views/Electrical/AutomaticParameterSetting.vue
index 64b71e0..8f34e82 100644
--- a/CanadaMes-ui/src/views/Electrical/AutomaticParameterSetting.vue
+++ b/CanadaMes-ui/src/views/Electrical/AutomaticParameterSetting.vue
@@ -47,10 +47,10 @@
<el-row :gutter="20">
<el-col :span="12" v-for="(dataGroup, groupIndex) in jsonData" :key="groupIndex">
- <el-card class="json-block" style="width:485px;">
+ <el-card class="json-block" style="width:585px;">
<div v-for="(item, itemIndex) in dataGroup" :key="itemIndex" class="item-container">
<div class="item-row" v-if="item.type === '0'">
- <span class="name" v-if="item.type === '0'" style="width:150px;">{{ item.name }}</span>
+ <span class="name" v-if="item.type === '0'" style="width:300px;">{{ item.name }}</span>
<el-input style="width:250px;" v-if="item.type === '0'" v-model="item.value" class="input-box"
@keyup.enter.native="submitDataToBackend"></el-input>
</div>
@@ -76,12 +76,23 @@
jsonData: data // 鍔犺浇鏁翠釜data.json鏂囦欢浣滀负jsonData
}
},
- created () {
+ activated () {
+
this.initWebSocket();
- // console.log('jsonData:', this.jsonData);
+ const language = this.$i18n.locale;
+ console.log(language);
+ if (language === 'en-US') {
+ this.replaceChineseWithEnglish();
+ }
+ this.$forceUpdate();
+
},
methods: {
+ closeSocket () {
+ // 鍏抽棴 WebSocket 杩炴帴
+ socket.close();
+ },
updateButtonValue (dataGroup, itemIndex) {
this.$set(dataGroup[itemIndex].button, 'value', 1); // 鐐瑰嚮鎸夐挳鍚庡皢鍊兼敼涓�1
},
@@ -146,7 +157,7 @@
let obj = JSON.parse(msg.data);
const jsonData2 = this.jsonData;
-console.log(obj);
+ console.log(obj);
const handleMouseMove = throttle(function (event) {
const inputBox = document.querySelectorAll('.el-card__body');
@@ -205,20 +216,40 @@
socket.onerror = function () {
console.log("websocket鍙戠敓浜嗛敊璇�");
};
+ this.$router.afterEach(function () {
+ socket.close();
+ })
}
},
- replaceChineseWithEnglish () {
- const translation = this.$t('AutomaticParameterSetting');
- this.jsonData = this.jsonData.map(item => { return { name: translation[item.name] || item.name, value: item.value }; });
- // console.log(translation);
- },
send () {
socket?.send(JSON.stringify(this.messagepack));
},
+ replaceChineseWithEnglish () {
+
+
+ const nameMap = this.$t('AutomaticParameterSettinglang')
+ this.jsonData = this.jsonData.map((item) => {
+ return item.map((obj) => {
+ if (obj.name) {
+ const newName = nameMap[obj.name] || obj.name;
+ return { ...obj, name: newName };
+ } else if (obj.button && obj.button.name) {
+ const newName = nameMap[obj.button.name] || obj.button.name;
+ return { ...obj, button: { ...obj.button, name: newName } };
+ } else {
+ return obj;
+ }
+ });
+ });
+
+
+ console.log(this.jsonData)
+
+ }
}
}
diff --git a/CanadaMes-ui/src/views/Electrical/ManualJog.vue b/CanadaMes-ui/src/views/Electrical/ManualJog.vue
index 48c925a..a222e42 100644
--- a/CanadaMes-ui/src/views/Electrical/ManualJog.vue
+++ b/CanadaMes-ui/src/views/Electrical/ManualJog.vue
@@ -76,12 +76,23 @@
jsonData: data // 鍔犺浇鏁翠釜data.json鏂囦欢浣滀负jsonData
}
},
- created () {
+ activated () {
+
this.initWebSocket();
- // console.log('jsonData:', this.jsonData);
+ const language = this.$i18n.locale;
+ console.log(language);
+ if (language === 'en-US') {
+ this.replaceChineseWithEnglish();
+ }
+ this.$forceUpdate();
+
},
methods: {
+ closeSocket () {
+ // 鍏抽棴 WebSocket 杩炴帴
+ socket.close();
+ },
updateButtonValue (dataGroup, itemIndex) {
this.$set(dataGroup[itemIndex].button, 'value', 1); // 鐐瑰嚮鎸夐挳鍚庡皢鍊兼敼涓�1
},
@@ -178,14 +189,40 @@
socket.onerror = function () {
console.log("websocket鍙戠敓浜嗛敊璇�");
};
+ this.$router.afterEach(function () {
+ socket.close();
+ })
}
},
send () {
socket?.send(JSON.stringify(this.messagepack));
+ },
+ replaceChineseWithEnglish () {
+
+
+ const nameMap = this.$t('ManualJoglang')
+ this.jsonData = this.jsonData.map((item) => {
+ return item.map((obj) => {
+ if (obj.name) {
+ const newName = nameMap[obj.name] || obj.name;
+ return { ...obj, name: newName };
+ } else if (obj.button && obj.button.name) {
+ const newName = nameMap[obj.button.name] || obj.button.name;
+ return { ...obj, button: { ...obj.button, name: newName } };
+ } else {
+ return obj;
+ }
+ });
+ });
+
+
+ console.log(this.jsonData)
+
}
- }
+ },
+
}
</script>
diff --git a/CanadaMes-ui/src/views/Electrical/ManualonePosition.vue b/CanadaMes-ui/src/views/Electrical/ManualonePosition.vue
index dbd4dc2..99a722d 100644
--- a/CanadaMes-ui/src/views/Electrical/ManualonePosition.vue
+++ b/CanadaMes-ui/src/views/Electrical/ManualonePosition.vue
@@ -23,8 +23,8 @@
}}</router-link>
<router-link to="/Electrical/Parameter1" tag="el-button" type="text" active-class="blue-button">{{ $t('Parameter1')
}}</router-link>
- <!-- <router-link to="/Electrical/Parameter2" tag="el-button" type="text" active-class="blue-button">{{ $t('Parameter2')
- }}</router-link> -->
+ <router-link to="/Electrical/Parameter2" tag="el-button" type="text" active-class="blue-button">{{ $t('Parameter2')
+ }}</router-link>
<router-link to="/Electrical/Positioning1" tag="el-button" type="text" active-class="blue-button">{{
$t('Positioning1')
}}</router-link>
@@ -47,10 +47,10 @@
<el-row :gutter="10">
<el-col :span="12" v-for="(dataGroup, groupIndex) in jsonData" :key="groupIndex">
- <el-card class="json-block" style="width:485px;">
+ <el-card class="json-block" style="width:585px;">
<div v-for="(item, itemIndex) in dataGroup" :key="itemIndex" class="item-container">
<div class="item-row">
- <span class="name" style="width:100px;">{{ item.name }}</span>
+ <span class="name" style="width:300px;">{{ item.name }}</span>
<el-input style="width:250px;" v-if="item.state != 0 && item.type === '0'" v-model="item.value"
class="input-box"></el-input>
</div>
@@ -58,7 +58,8 @@
<div class="button-row" style="display: flex; justify-content: space-between;">
<div v-for="(item, itemIndex) in dataGroup" :key="itemIndex">
<el-button v-if="item.button && item.button.state != 0" :name="item.button.name" v-model="item.button.value"
- :class="{ 'action-button': true, 'error-button': item.button.name === '鏁呴殰' && item.button.value === 1 }"
+ :class="{ 'action-button': true, 'error-button': item.button.name === $t('鏁呴殰')
+ && item.button.value === 1 }"
@click="updateButtonValue(dataGroup, itemIndex); submitDataToBackend(item.button.name);">{{
item.button.name }}</el-button>
</div>
@@ -85,12 +86,23 @@
// 鍔犺浇鏁翠釜data.json鏂囦欢浣滀负jsonData
}
},
- created () {
+ activated () {
+
this.initWebSocket();
- // console.log('jsonData:', this.jsonData);
+ const language = this.$i18n.locale;
+ console.log(language);
+ if (language === 'en-US') {
+ this.replaceChineseWithEnglish();
+ }
+ this.$forceUpdate();
+
},
methods: {
+ closeSocket () {
+ // 鍏抽棴 WebSocket 杩炴帴
+ socket.close();
+ },
updateButtonValue (dataGroup, itemIndex) {
// 灏嗗綋鍓嶆寜閽殑鍊艰涓�1
@@ -100,7 +112,7 @@
},
submitDataToBackend (currentButtonName) {
- if (currentButtonName === 'A01鍚姩') {
+ if (currentButtonName === 'A01鍚姩' || currentButtonName === 'A01 Start' ) {
const data = [];
for (let i = 0; i < 1; i++) {
@@ -124,7 +136,7 @@
}
- if (currentButtonName === 'A02鍚姩') {
+ if (currentButtonName === 'A02鍚姩' || currentButtonName === 'A02 Start') {
const data = [];
for (let i = 1; i < 2; i++) {
@@ -148,7 +160,7 @@
}
- if (currentButtonName === 'B01鍚姩') {
+ if (currentButtonName === 'B01鍚姩' || currentButtonName === 'B01 Start') {
const data = [];
for (let i = 2; i < 3; i++) {
@@ -172,7 +184,7 @@
}
- if (currentButtonName === 'B02鍚姩') {
+ if (currentButtonName === 'B02鍚姩' || currentButtonName === 'B02 Start') {
const data = [];
for (let i = 3; i < 4; i++) {
@@ -196,11 +208,12 @@
}
- if (currentButtonName === '鏁呴殰') {
+ if (currentButtonName === '鏁呴殰' || currentButtonName === 'Fault') {
const data2 = [];
const resetButtonValues = this.jsonData.map(item => {
- const buttonItem = item.find(subItem => subItem.button && subItem.button.name === '鏁呴殰');
+ // const buttonItem = item.find(subItem => subItem.button && subItem.button.name === '鏁呴殰' || subItem.button.name === 'Fault');
+ const buttonItem = item.find(subItem => subItem.button && ['鏁呴殰', 'Fault'].includes(subItem.button.name));
return buttonItem ? buttonItem.button.value : null;
}).filter(value => value !== null);
@@ -217,11 +230,12 @@
}
- if (currentButtonName === '澶嶄綅') {
+ if (currentButtonName === '澶嶄綅' || currentButtonName === 'Reset') {
const data2 = [];
const resetButtonValues = this.jsonData.map(item => {
- const buttonItem = item.find(subItem => subItem.button && subItem.button.name === '澶嶄綅');
+ const buttonItem = item.find(subItem => subItem.button && ['澶嶄綅', 'Reset'].includes(subItem.button.name));
+
return buttonItem ? buttonItem.button.value : null;
}).filter(value => value !== null);
@@ -234,15 +248,18 @@
const jsonString2 = JSON.stringify(jsonObject2);
console.log('鎵�鏈夊浣嶇殑value:', jsonString2);
socket?.send(jsonString2);
-
+ setTimeout(()=>
+ window.location.reload(),2000
+ )
}
- if (currentButtonName === '鍥為浂') {
+ if (currentButtonName === '鍥為浂' || currentButtonName === 'Zero') {
const data2 = [];
const resetButtonValues = this.jsonData.map(item => {
- const buttonItem = item.find(subItem => subItem.button && subItem.button.name === '鍥為浂');
+ const buttonItem = item.find(subItem => subItem.button && ['鍥為浂', 'Zero'].includes(subItem.button.name));
+
return buttonItem ? buttonItem.button.value : null;
}).filter(value => value !== null);
@@ -255,7 +272,9 @@
const jsonString2 = JSON.stringify(jsonObject2);
console.log('鎵�鏈夊洖闆剁殑value:', jsonString2);
socket?.send(jsonString2);
-
+ setTimeout(()=>
+ window.location.reload(),2000
+ )
}
@@ -339,7 +358,7 @@
for (let k = 0; k < section.length; k++) {
const item = section[k];
- if (item.button && item.button.name === "鏁呴殰") {
+ if (item.button && (item.button.name === "鏁呴殰" || item.button.name === "Fault")) {
// 鏇存柊value灞炴��
item.button.value = guzhangValue;
break;
@@ -371,6 +390,9 @@
socket.onerror = function () {
console.log("websocket鍙戠敓浜嗛敊璇�");
};
+ this.$router.afterEach(function () {
+ socket.close();
+ })
}
},
@@ -378,6 +400,28 @@
socket?.send(JSON.stringify(this.messagepack));
+ },
+ replaceChineseWithEnglish () {
+
+
+ const nameMap = this.$t('ManualonePositionlang')
+ this.jsonData = this.jsonData.map((item) => {
+ return item.map((obj) => {
+ if (obj.name) {
+ const newName = nameMap[obj.name] || obj.name;
+ return { ...obj, name: newName };
+ } else if (obj.button && obj.button.name) {
+ const newName = nameMap[obj.button.name] || obj.button.name;
+ return { ...obj, button: { ...obj.button, name: newName } };
+ } else {
+ return obj;
+ }
+ });
+ });
+
+
+ console.log(this.jsonData)
+
}
}
diff --git a/CanadaMes-ui/src/views/Electrical/ManualonePosition2.vue b/CanadaMes-ui/src/views/Electrical/ManualonePosition2.vue
index a79506e..27661b4 100644
--- a/CanadaMes-ui/src/views/Electrical/ManualonePosition2.vue
+++ b/CanadaMes-ui/src/views/Electrical/ManualonePosition2.vue
@@ -47,10 +47,10 @@
<el-row :gutter="20">
<el-col :span="12" v-for="(dataGroup, groupIndex) in jsonData" :key="groupIndex">
- <el-card class="json-block" style="width:485px;">
+ <el-card class="json-block" style="width:600px;">
<div v-for="(item, itemIndex) in dataGroup" :key="itemIndex" class="item-container">
<div class="item-row">
- <span class="name" style="width:100px;">{{ item.name }}</span>
+ <span class="name" style="width:300px;">{{ item.name }}</span>
<el-input style="width:250px;" v-if="item.state != 0 && item.type === '0'" v-model="item.value"
class="input-box"></el-input>
</div>
@@ -58,7 +58,8 @@
<div class="button-row" style="display: flex; justify-content: space-between;">
<div v-for="(item, itemIndex) in dataGroup" :key="itemIndex">
<el-button v-if="item.button && item.button.state != 0" :name="item.button.name" v-model="item.button.value"
- :class="{ 'action-button': true, 'error-button': item.button.name === '鏁呴殰' && item.button.value === 1 }"
+ :class="{ 'action-button': true, 'error-button': item.button.name === $t('鏁呴殰')
+ && item.button.value === 1 }"
@click="updateButtonValue(dataGroup, itemIndex); submitDataToBackend(item.button.name);">{{
item.button.name }}</el-button>
</div>
@@ -83,12 +84,25 @@
jsonData: data // 鍔犺浇鏁翠釜data.json鏂囦欢浣滀负jsonData
}
},
- created () {
+
+ activated () {
+
this.initWebSocket();
- // console.log('jsonData:', this.jsonData);
+ const language = this.$i18n.locale;
+ console.log(language);
+ if (language === 'en-US') {
+ this.replaceChineseWithEnglish();
+ }
+ this.$forceUpdate();
+
},
+
methods: {
+ closeSocket () {
+ // 鍏抽棴 WebSocket 杩炴帴
+ socket.close();
+ },
updateButtonValue (dataGroup, itemIndex) {
// 灏嗗綋鍓嶆寜閽殑鍊艰涓�1
@@ -98,7 +112,7 @@
},
submitDataToBackend (currentButtonName) {
- if (currentButtonName === 'A01缈昏浆鍚姩') {
+ if (currentButtonName === 'A01缈昏浆鍚姩' || currentButtonName === 'A01 SERVE TURN') {
const data = [];
for (let i = 0; i < 1; i++) {
@@ -122,7 +136,7 @@
}
- if (currentButtonName === 'A02缈昏浆鍚姩') {
+ if (currentButtonName === 'A02缈昏浆鍚姩' || currentButtonName === 'A02 SERVE TURN') {
const data = [];
for (let i = 1; i < 2; i++) {
@@ -146,11 +160,12 @@
}
- if (currentButtonName === '鏁呴殰') {
+ if (currentButtonName === '鏁呴殰' || currentButtonName === 'Fault') {
const data2 = [];
const resetButtonValues = this.jsonData.map(item => {
- const buttonItem = item.find(subItem => subItem.button && subItem.button.name === '鏁呴殰');
+ const buttonItem = item.find(subItem => subItem.button && ['鏁呴殰', 'Fault'].includes(subItem.button.name));
+
return buttonItem ? buttonItem.button.value : null;
}).filter(value => value !== null);
@@ -167,11 +182,12 @@
}
- if (currentButtonName === '澶嶄綅') {
+ if (currentButtonName === '澶嶄綅' || currentButtonName === 'Reset') {
const data2 = [];
const resetButtonValues = this.jsonData.map(item => {
- const buttonItem = item.find(subItem => subItem.button && subItem.button.name === '澶嶄綅');
+ const buttonItem = item.find(subItem => subItem.button && ['澶嶄綅', 'Reset'].includes(subItem.button.name));
+
return buttonItem ? buttonItem.button.value : null;
}).filter(value => value !== null);
@@ -188,11 +204,12 @@
}
- if (currentButtonName === '鍥為浂') {
+ if (currentButtonName === '鍥為浂' || currentButtonName === 'Zero') {
const data2 = [];
const resetButtonValues = this.jsonData.map(item => {
- const buttonItem = item.find(subItem => subItem.button && subItem.button.name === '鍥為浂');
+ const buttonItem = item.find(subItem => subItem.button && ['鍥為浂', 'Zero'].includes(subItem.button.name));
+
return buttonItem ? buttonItem.button.value : null;
}).filter(value => value !== null);
@@ -286,7 +303,8 @@
for (let k = 0; k < section.length; k++) {
const item = section[k];
- if (item.button && item.button.name === "鏁呴殰") {
+
+ if (item.button && (item.button.name === "鏁呴殰" || item.button.name === "Fault")) {
// 鏇存柊value灞炴��
item.button.value = guzhangValue;
break;
@@ -318,6 +336,9 @@
socket.onerror = function () {
console.log("websocket鍙戠敓浜嗛敊璇�");
};
+ this.$router.afterEach(function () {
+ socket.close();
+ })
}
},
@@ -325,6 +346,28 @@
socket?.send(JSON.stringify(this.messagepack));
+ },
+ replaceChineseWithEnglish () {
+
+
+ const nameMap = this.$t('Manualoneposition2lang')
+ this.jsonData = this.jsonData.map((item) => {
+ return item.map((obj) => {
+ if (obj.name) {
+ const newName = nameMap[obj.name] || obj.name;
+ return { ...obj, name: newName };
+ } else if (obj.button && obj.button.name) {
+ const newName = nameMap[obj.button.name] || obj.button.name;
+ return { ...obj, button: { ...obj.button, name: newName } };
+ } else {
+ return obj;
+ }
+ });
+ });
+
+
+ console.log(this.jsonData)
+
}
}
diff --git a/CanadaMes-ui/src/views/Electrical/Parameter.vue b/CanadaMes-ui/src/views/Electrical/Parameter.vue
index 8cbe3c1..bb15ca4 100644
--- a/CanadaMes-ui/src/views/Electrical/Parameter.vue
+++ b/CanadaMes-ui/src/views/Electrical/Parameter.vue
@@ -167,6 +167,9 @@
socket.onerror = function () {
console.log("websocket鍙戠敓浜嗛敊璇�");
};
+ this.$router.afterEach(function(){
+ socket.close();
+ })
}
},
send () {
diff --git a/CanadaMes-ui/src/views/Electrical/Parameter1.vue b/CanadaMes-ui/src/views/Electrical/Parameter1.vue
index 5455274..be9b91f 100644
--- a/CanadaMes-ui/src/views/Electrical/Parameter1.vue
+++ b/CanadaMes-ui/src/views/Electrical/Parameter1.vue
@@ -79,11 +79,18 @@
return {
jsonData: data // 鍔犺浇鏁翠釜data.json鏂囦欢浣滀负jsonData
}
- }, created () {
- this.initWebSocket();
- // console.log('jsonData:', this.jsonData);
+ },
+ activated(){
+
+ this.initWebSocket ();
+ const language = this.$i18n.locale;
+ console.log(language);
+ if (language === 'en-US') {
+ this.replaceChineseWithEnglish();
+ }
+ this.$forceUpdate();
- },
+ },
methods: {
updateButtonValue (dataGroup, itemIndex) {
this.$set(dataGroup[itemIndex].button, 'value', 1); // 鐐瑰嚮鎸夐挳鍚庡皢鍊兼敼涓�1
@@ -155,7 +162,7 @@
const parms = obj.params;
const fanzhuan = obj.fanzhuan;
const xiaoche = obj.xiaoche;
- console.log(obj);
+ // console.log(obj);
// console.log('parms:', parms);
// console.log('fanzhuan:', fanzhuan);
// console.log('xiaoche:', xiaoche);
@@ -188,9 +195,6 @@
-
-
-
// 鍏抽棴浜嬩欢
socket.onclose = function () {
console.log("websocket宸插叧闂�");
@@ -200,16 +204,39 @@
socket.onerror = function () {
console.log("websocket鍙戠敓浜嗛敊璇�");
};
-
+ this.$router.afterEach(function(){
+ socket.close();
+ })
}
},
- replaceChineseWithEnglish () {
- const translation = this.$t('Parameter1');
- this.jsonData = this.jsonData.map(item => { return { name: translation[item.name] || item.name, value: item.value }; });
- // console.log(translation);
- },
+ replaceChineseWithEnglish() {
+
+
+ const nameMap= this.$t('langParameter1')
+
+ this.jsonData = this.jsonData.map((item) => {
+ return item.map((obj) => {
+ if (obj.name) {
+ const newName = nameMap[obj.name] || obj.name;
+ return { ...obj, name: newName };
+ } else if (obj.button && obj.button.name) {
+ const newName = nameMap[obj.button.name] || obj.button.name;
+ return { ...obj, button: { ...obj.button, name: newName } };
+ } else if (obj.title && obj.title.name) {
+ const newName = nameMap[obj.title.name] || obj.title.name;
+ return { ...obj, title: { ...obj.title, name: newName } };
+ } else {
+ return obj;
+ }
+ });
+});
+
+
+// console.log(this.jsonData)
+
+},
send () {
diff --git a/CanadaMes-ui/src/views/Electrical/Parameter2.vue b/CanadaMes-ui/src/views/Electrical/Parameter2.vue
index 5dd7b0d..986805b 100644
--- a/CanadaMes-ui/src/views/Electrical/Parameter2.vue
+++ b/CanadaMes-ui/src/views/Electrical/Parameter2.vue
@@ -26,11 +26,23 @@
}}</router-link>
<router-link to="/Electrical/Positioning2" tag="el-button" type="text" active-class="blue-button">{{ $t('Positioning2')
}}</router-link>
+ <router-link to="/Electrical/ManualonePosition" tag="el-button" type="text" active-class="blue-button">{{
+ $t('ManualonePosition')
+ }}</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('AutomaticParameterSetting')
+ }}</router-link>
+ <router-link to="/Electrical/ManualJog" tag="el-button" type="text" active-class="blue-button">{{
+ $t('ManualJog')
+ }}</router-link>
</el-breadcrumb>
<el-row :gutter="40">
<el-col :span="6" v-for="(dataGroup, groupIndex) in jsonData" :key="groupIndex" style="margin-bottom: -20px;">
- <el-card class="json-block" style="width:260px;margin-bottom: 2px;">
+ <el-card class="json-block" style="width:300px;margin-bottom: 2px;">
<div class="button-row" style="display: flex; justify-content: space-between;">
<div v-for="(item, itemIndex) in dataGroup" :key="itemIndex">
<span v-if="item.title" :name="item.title.name" class="action-button" >{{ item.title.name }}</span>
@@ -39,16 +51,27 @@
<div class="button-row" style="display: flex; justify-content: space-between;">
<div v-for="(item, itemIndex) in dataGroup" :key="itemIndex">
- <el-button v-if="item.button" :name="item.button.name" v-model="item.button.value" class="action-button"
+ <el-button v-if="item.button && language==='en-US'" :name="item.button.name" v-model="item.button.value" class="action-button"
@click="updateButtonValue(dataGroup, itemIndex);submitDataToBackend(item.button.name)"
- :class="{ 'green-button': item.button.value === 0 && item.button.name !== '娓呴櫎ID','red-button': item.button.value === 2 && item.button.name !== '娓呴櫎ID' ,'yellow-button': item.button.value === 1 && item.button.name !== '娓呴櫎ID' }">{{ item.button.name }}</el-button>
- </div>
+ :class="{ 'green-button': (item.button.value === 0 && item.button.name !== 'Clear ID' ) ,'red-button': item.button.value === 2 && (item.button.name !== 'Clear ID' ) ,'yellow-button': item.button.value === 1 && (item.button.name !== 'Clear ID' ) }">{{ item.button.name }}</el-button>
+
+
+ <el-button v-if="item.button && language==='zh-CN'" :name="item.button.name" v-model="item.button.value" class="action-button"
+ @click="updateButtonValue(dataGroup, itemIndex);submitDataToBackend(item.button.name)"
+ :class="{ 'green-button': (item.button.value === 0 && item.button.name !== '娓呴櫎ID' ) ,'red-button': item.button.value === 2 && (item.button.name !== '娓呴櫎ID' ) ,'yellow-button': item.button.value === 1 && (item.button.name !== '娓呴櫎ID' ) }">{{ item.button.name }}</el-button>
+
+</div>
</div>
<div v-for="(item, itemIndex) in dataGroup" :key="itemIndex" class="item-container">
<div class="item-row">
- <span class="name" style="width:150px;">{{ item.name }}</span>
- <el-input v-if="item.type === '0'" v-model="item.value" readonly="readonly" style="width:400px;" class="input-box"></el-input>
+
+ <span class="name" v-if="groupIndex === 13" style="width:250px;">{{ item.name }}</span>
+ <span class="name" v-else style="width:150px;">{{ item.name }}</span>
+ <el-input v-if="item.type === '0'" v-model="item.value" readonly="readonly" style="width:400px;" class="input-box"></el-input>
+
+
+
</div>
</div>
@@ -63,6 +86,10 @@
import LanguageMixin from '../../lang/LanguageMixin'
import data from '../../configuration/parameter2'
let socket;
+
+ // window.onload=function(){
+ // console.log("44");
+ // }
export default {
destroyed() {
socket.close();
@@ -72,27 +99,48 @@
data() {
return {
jsonData: data ,
+ inputValue: '',
+ language:this.$i18n.locale,
// 鍔犺浇鏁翠釜data.json鏂囦欢浣滀负jsonData
}
},
- created () {
- this.initWebSocket();
- // console.log('jsonData:', this.jsonData);
+
+ activated(){
+
+ this.initWebSocket ();
+ this.filteredData();
+ const language = this.$i18n.locale;
+ console.log(language);
+ if (language === 'en-US') {
+ this.replaceChineseWithEnglish();
+ }
+ this.$forceUpdate();
+ },
+
+
+ computed: {
- },
- mounted() {
- window.addEventListener('beforeunload', this.closeSocket);
- },
+
+},
- beforeUnmount() {
- window.removeEventListener('beforeunload', this.closeSocket);
- },
+
+
methods: {
- closeSocket() {
- // 鍏抽棴 WebSocket 杩炴帴
- socket.close();
- },
+ filteredData() {
+ return this.jsonData.map(item => {
+ const filteredValue = item.map(obj => {
+ if (typeof obj.button !== 'undefined' && typeof obj.button.value !== 'undefined') {
+ obj.button.value = obj.button.value.toString().replace(/[^a-zA-Z0-9]/g, '');
+ } else if (typeof obj.value !== 'undefined') {
+ obj.value = obj.value.toString().replace(/[^a-zA-Z0-9]/g, '');
+ }
+ return obj;
+ });
+ return filteredValue;
+ });
+ },
+
updateButtonValue(dataGroup, itemIndex) {
// 灏嗗綋鍓嶆寜閽殑鍊艰涓�1
@@ -103,7 +151,7 @@
},
submitDataToBackend(currentButtonName) {
- if (currentButtonName === '娓呴櫎ID') {
+ if (currentButtonName === '娓呴櫎ID' || currentButtonName === 'Clear ID' ) {
const inputData = this.jsonData.map(dataGroup => {
return dataGroup.map(item => {
if (item.type === '3') {
@@ -120,7 +168,9 @@
const jsonString = JSON.stringify(jsonObject);
console.log('Type涓�3鐨剉alue:', jsonString);
socket?.send(jsonString);
- window.location.reload();
+ setTimeout(()=>
+ window.location.reload(),2000
+ )
}
},
initWebSocket () {
@@ -160,7 +210,7 @@
const parms = obj.params;
// const xiaoche = obj.params[3];
- // console.log(parms);
+ // console.log(parms);
//娓呴櫎id
for (let i = 0; i < jsonData2.length; i++) {
let arr = jsonData2[i];
@@ -174,17 +224,23 @@
}
//ID
- for (let i = 0; i < jsonData2.length; i++) {
+const specialChars = /[^\w\s]/g; // 姝e垯琛ㄨ揪寮忓尮閰嶉潪瀛楁瘝銆佹暟瀛椼�佷笅鍒掔嚎鍜岀┖鏍肩殑瀛楃
+
+for (let i = 0; i < jsonData2.length; i++) {
let arr = jsonData2[i];
for (let j = 0; j < arr.length; j++) {
let obj = arr[j];
- if (obj.type === '0') {
- obj.value = parms[1][i];
- }
- }
-
+ if (obj.type === '0') {
+ if (parms[1] && parms[1][i]) {
+ obj.value = parms[1][i].replace(specialChars, '');
+ // console.log(obj.value);
+ }
}
+
+ }
+}
+
//鎵嬪姩鐘舵��
for (let i = 0; i < jsonData2.length; i++) {
let arr = jsonData2[i];
@@ -198,10 +254,18 @@
}
//鎵弿鏋壂鐮佺殑ID
+
jsonData2.forEach((item) => {
item.forEach((subItem) => {
if (subItem.read === 66) {
- subItem.value = parms[3][0];
+ subItem.value = parms[3][0].replace(specialChars, '');
+ }
+ });
+});
+jsonData2.forEach((item) => {
+ item.forEach((subItem) => {
+ if (subItem.read === 666) {
+ subItem.value = parms[3][1].replace(specialChars, '');
}
});
});
@@ -246,10 +310,35 @@
socket.onerror = function () {
console.log("websocket鍙戠敓浜嗛敊璇�");
};
-
+
+ this.$router.afterEach(function(){
+ socket.close();
+ })
}
},
+ replaceChineseWithEnglish() {
+
+
+ const nameMap= this.$t('langParameter2')
+ this.jsonData = this.jsonData.map((item) => {
+return item.map((obj) => {
+if (obj.name) {
+ const newName = nameMap[obj.name] || obj.name;
+ return { ...obj, name: newName };
+} else if (obj.button && obj.button.name) {
+ const newName = nameMap[obj.button.name] || obj.button.name;
+ return { ...obj, button: { ...obj.button, name: newName } };
+} else {
+ return obj;
+}
+});
+});
+
+
+// console.log(this.jsonData)
+
+},
send () {
diff --git a/CanadaMes-ui/src/views/Electrical/Positioning1.vue b/CanadaMes-ui/src/views/Electrical/Positioning1.vue
index 81621ee..c0c51e7 100644
--- a/CanadaMes-ui/src/views/Electrical/Positioning1.vue
+++ b/CanadaMes-ui/src/views/Electrical/Positioning1.vue
@@ -85,11 +85,16 @@
jsonData: data // 鍔犺浇鏁翠釜data.json鏂囦欢浣滀负jsonData
}
},
- created () {
- this.initWebSocket();
- // console.log('jsonData:', this.jsonData);
-
- },
+ activated(){
+
+ this.initWebSocket ();
+ const language = this.$i18n.locale;
+ console.log(language);
+ if (language === 'en-US') {
+ this.replaceChineseWithEnglish();
+ }
+ this.$forceUpdate();
+ },
methods: {
updateButtonValue (dataGroup, itemIndex) {
this.$set(dataGroup[itemIndex].button, 'value', 1); // 鐐瑰嚮鎸夐挳鍚庡皢鍊兼敼涓�1
@@ -160,7 +165,7 @@
// 濡傛灉榧犳爣涓嶅湪杈撳叆妗嗗唴锛屾洿鏂拌緭鍏ユ鐨勫��
// this.submitDataToBackend()
const parms = obj.params;
- console.log(parms)
+ // console.log(parms)
let index = 0;
@@ -197,9 +202,37 @@
socket.onerror = function () {
console.log("websocket鍙戠敓浜嗛敊璇�");
};
+ this.$router.afterEach(function(){
+ socket.close();
+ })
}
},
+ replaceChineseWithEnglish() {
+
+
+ const nameMap= this.$t('langPositioning1')
+ this.jsonData = this.jsonData.map((item) => {
+ return item.map((obj) => {
+ if (obj.name) {
+ const newName = nameMap[obj.name] || obj.name;
+ return { ...obj, name: newName };
+ } else if (obj.button && obj.button.name) {
+ const newName = nameMap[obj.button.name] || obj.button.name;
+ return { ...obj, button: { ...obj.button, name: newName } };
+ } else if (obj.title && obj.title.name) {
+ const newName = nameMap[obj.title.name] || obj.title.name;
+ return { ...obj, title: { ...obj.title, name: newName } };
+ } else {
+ return obj;
+ }
+ });
+});
+
+
+// console.log(this.jsonData)
+
+},
send () {
diff --git a/CanadaMes-ui/src/views/Electrical/Positioning2.vue b/CanadaMes-ui/src/views/Electrical/Positioning2.vue
index 56a5093..d922fbf 100644
--- a/CanadaMes-ui/src/views/Electrical/Positioning2.vue
+++ b/CanadaMes-ui/src/views/Electrical/Positioning2.vue
@@ -80,11 +80,16 @@
jsonData: data // 鍔犺浇鏁翠釜data.json鏂囦欢浣滀负jsonData
}
},
- created () {
- this.initWebSocket();
- // console.log('jsonData:', this.jsonData);
-
- },
+ activated(){
+
+ this.initWebSocket ();
+ const language = this.$i18n.locale;
+ console.log(language);
+ if (language === 'en-US') {
+ this.replaceChineseWithEnglish();
+ }
+ this.$forceUpdate();
+ },
methods: {
updateButtonValue (dataGroup, itemIndex) {
this.$set(dataGroup[itemIndex].button, 'value', 1); // 鐐瑰嚮鎸夐挳鍚庡皢鍊兼敼涓�1
@@ -156,7 +161,7 @@
// this.submitDataToBackend()
const parms = obj.params;
- console.log(parms)
+ // console.log(parms)
let index = 0;
for (let i = 0; i < jsonData2.length; i++) {
let arr = jsonData2[i];
@@ -186,9 +191,37 @@
socket.onerror = function () {
console.log("websocket鍙戠敓浜嗛敊璇�");
};
+ this.$router.afterEach(function(){
+ socket.close();
+ })
}
},
+ replaceChineseWithEnglish() {
+
+
+ const nameMap= this.$t('langPositioning2')
+ this.jsonData = this.jsonData.map((item) => {
+ return item.map((obj) => {
+ if (obj.name) {
+ const newName = nameMap[obj.name] || obj.name;
+ return { ...obj, name: newName };
+ } else if (obj.button && obj.button.name) {
+ const newName = nameMap[obj.button.name] || obj.button.name;
+ return { ...obj, button: { ...obj.button, name: newName } };
+ } else if (obj.title && obj.title.name) {
+ const newName = nameMap[obj.title.name] || obj.title.name;
+ return { ...obj, title: { ...obj.title, name: newName } };
+ } else {
+ return obj;
+ }
+ });
+});
+
+
+// console.log(this.jsonData)
+
+},
send () {
diff --git a/CanadaMes-ui/src/views/Electrical/ServoManualone.vue b/CanadaMes-ui/src/views/Electrical/ServoManualone.vue
index 37f5fea..1fb5565 100644
--- a/CanadaMes-ui/src/views/Electrical/ServoManualone.vue
+++ b/CanadaMes-ui/src/views/Electrical/ServoManualone.vue
@@ -27,6 +27,18 @@
}}</router-link>
<router-link to="/Electrical/Positioning2" tag="el-button" type="text" active-class="blue-button">{{ $t('Positioning2')
}}</router-link>
+ <router-link to="/Electrical/ManualonePosition" tag="el-button" type="text" active-class="blue-button">{{
+ $t('ManualonePosition')
+ }}</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('AutomaticParameterSetting')
+ }}</router-link>
+ <router-link to="/Electrical/ManualJog" tag="el-button" type="text" active-class="blue-button">{{
+ $t('ManualJog')
+ }}</router-link>
</el-breadcrumb>
<el-row :gutter="26">
@@ -44,8 +56,8 @@
</el-row>
<div class="button-row" style="display: flex; justify-content: space-between;">
<div v-for="(item, itemIndex) in dataGroup" :key="itemIndex">
- <el-button v-if="item.button" :name="item.button.name" v-model="item.button.value" :class="{'action-button': true, 'error-button': item.button.name === '鏁呴殰' && item.button.value === 1}" @click="updateButtonValue(dataGroup, itemIndex); submitDataToBackend(item.button.name);">{{ item.button.name }}</el-button>
-
+ <el-button v-if="item.button && language === 'en-US' " :name="item.button.name" v-model="item.button.value" :class="{'action-button': true, 'error-button': item.button.name === 'Fault' && item.button.value === 1,'error-button2': item.button.name === 'NotZero' && item.button.value === 0}" @click="updateButtonValue(dataGroup, itemIndex); submitDataToBackend(item.button.name);">{{ item.button.name }}</el-button>
+ <el-button v-if="item.button && language === 'zh-CN' " :name="item.button.name" v-model="item.button.value" :class="{'action-button': true, 'error-button': item.button.name === '鏁呴殰' && item.button.value === 1,'error-button2': item.button.name === '鏈洖闆�' && item.button.value === 0}" @click="updateButtonValue(dataGroup, itemIndex); submitDataToBackend(item.button.name);">{{ item.button.name }}</el-button>
</div>
</div>
</el-card>
@@ -69,22 +81,27 @@
data() {
return {
jsonData: data ,
-
+language:this.$i18n.locale,
// 鍔犺浇鏁翠釜data.json鏂囦欢浣滀负jsonData
}
},
- created () {
+
+ activated(){
+
this.initWebSocket();
- // console.log('jsonData:', this.jsonData);
-
- },
- mounted() {
- window.addEventListener('beforeunload', this.closeSocket);
- },
-
- beforeUnmount() {
- window.removeEventListener('beforeunload', this.closeSocket);
- },
+ const language = this.$i18n.locale;
+ console.log(language);
+ if (language === 'en-US') {
+ this.replaceChineseWithEnglish();
+ }
+ this.$forceUpdate();
+
+
+ },
+// destroyed(){
+// this.close();
+// this.$router.go(0);
+// },
methods: {
closeSocket() {
// 鍏抽棴 WebSocket 杩炴帴
@@ -104,19 +121,34 @@
// });
},
submitDataToBackend(currentButtonName) {
- if (currentButtonName === 'A01鍗婅嚜鍔ㄥ惎鍔�') {
+ if (currentButtonName === 'A01鍗婅嚜鍔ㄥ惎鍔�' ||currentButtonName === 'A01 Semi-Auto Start') {
const data = [];
for (let i = 0; i < 1; i++) {
- const inputData = this.jsonData[i].filter(item => item.type === '0').map(item => {
+ const inputData = this.jsonData[i].filter(item => item.type === '0' && item.read !== 9999).map(item => {
return { value: item.value };
});
const values = inputData.map(item => item.value);
data.push(values);
+
}
+
+data.push([], [], []);
+
+for (let i = 0; i < 1; i++) {
+ const inputData = this.jsonData[i].filter(item => item.type === '0' && item.read == 9999).map(item => {
+ return { value: item.value };
+ });
+
+ const values = inputData.map(item => item.value);
+
+ data.push(values);
+
+}
+data.push([]);
const jsonObject = { data };
@@ -127,11 +159,11 @@
}
- if (currentButtonName === 'A02鍗婅嚜鍔ㄥ惎鍔�') {
+ if (currentButtonName === 'A02鍗婅嚜鍔ㄥ惎鍔�' ||currentButtonName === 'A02 Semi-Auto Start') {
const data2 = [];
for (let i = 1; i < 2; i++) {
- const inputData = this.jsonData[i].filter(item => item.type === '0').map(item => {
+ const inputData = this.jsonData[i].filter(item => item.type === '0' && item.read !== 8888).map(item => {
return { value: item.value };
});
@@ -141,6 +173,22 @@
}
data2.unshift([]);
+
+data2.push([], [], []);
+
+for (let i = 1; i < 2; i++) {
+ const inputData = this.jsonData[i].filter(item => item.type === '0' && item.read == 8888).map(item => {
+ return { value: item.value };
+ });
+
+ const values2 = inputData.map(item => item.value);
+
+ data2.push(values2);
+
+}
+
+
+
const jsonObject = { data:data2 };
// 鎻愪氦鏁版嵁鍒板悗绔�
@@ -150,10 +198,12 @@
}
- if (currentButtonName === '澶嶄綅') {
+ if (currentButtonName === '澶嶄綅' || currentButtonName === 'Reset') {
const data2 = [];
const resetButtonValues = this.jsonData.map(item => {
- const buttonItem = item.find(subItem => subItem.button && subItem.button.name === '澶嶄綅');
+ const buttonItem = item.find(subItem => subItem.button && ['澶嶄綅', 'Reset'].includes(subItem.button.name));
+
+
return buttonItem ? buttonItem.button.value : null;
}).filter(value => value !== null);
@@ -170,13 +220,17 @@
const jsonString2 = JSON.stringify(jsonObject2);
console.log('鎵�鏈塗ype涓�0鐨剉alue:', jsonString2);
socket?.send(jsonString2);
- window.location.reload();
+ setTimeout(()=>
+ window.location.reload(),2000
+ )
+
}
-if (currentButtonName === '鍥為浂') {
+if (currentButtonName === '鍥為浂' || currentButtonName === 'Home') {
const data3 = [];
const resetButtonValues3 = this.jsonData.map(item => {
- const buttonItem3 = item.find(subItem => subItem.button && subItem.button.name === '鍥為浂');
+ const buttonItem3 = item.find(subItem => subItem.button && ['鍥為浂', 'Home'].includes(subItem.button.name));
+
return buttonItem3 ? buttonItem3.button.value : null;
}).filter(value => value !== null);
@@ -193,13 +247,15 @@
const jsonString3 = JSON.stringify(jsonObject3);
console.log('鍥為浂:', jsonString3);
socket?.send(jsonString3);
- window.location.reload();
+ setTimeout(()=>
+ window.location.reload(),2000
+ )
}
- if (currentButtonName === 'A01鍗婅嚜鍔�') {
+ if (currentButtonName === 'A01鍗婅嚜鍔�' || currentButtonName === 'A01 Semi-Auto' ) {
const elements = document.getElementsByClassName('special-class');
for (let i = 0; i < elements.length; i++) {
if (elements[i].style.display === 'none') {
@@ -207,8 +263,7 @@
}
}
}
-
- if (currentButtonName === 'A02鍗婅嚜鍔�') {
+ if (currentButtonName === 'A02鍗婅嚜鍔�' || currentButtonName === 'A02 Semi-Auto' ) {
const elements = document.getElementsByClassName('special-class2');
for (let i = 0; i < elements.length; i++) {
if (elements[i].style.display === 'none') {
@@ -252,7 +307,8 @@
}
let obj = JSON.parse(msg.data);
- console.log(obj)
+ // console.log(obj)
+const weihuiling=obj.weihuiling;
const jsonData2 = this.jsonData;
const handleMouseMove = throttle(function(event) {
@@ -262,62 +318,68 @@
// 鎵ц鏇存柊閫昏緫
for (let i = 0; i < 6; i++) {
jsonData2[i].forEach((item, index) => {
- if (typeof item.value !== 'undefined' && typeof obj[`zuhe${i+1}`][0][index] !== 'undefined') {
+ if (typeof item.value !== 'undefined' && typeof obj[`zuhe${i+1}`][0][index] !== 'undefined'&& item.read !== '9999' && item.read !== '8888') {
item.value = obj[`zuhe${i+1}`][0][index];
}
});
}
-// 閬嶅巻guzhang鏁扮粍
-for (let i = 0; i < obj.guzhang[0].length; i++) {
- const guzhangValue = obj.guzhang[0][i];
-
- // 鏌ユ壘jsonData2涓甫鏈�"button"鐨勫璞★紝骞朵笖name绛変簬"鏁呴殰"
- for (let j = 0; j < jsonData2.length; j++) {
- const section = jsonData2[j];
-
- for (let k = 0; k < section.length; k++) {
- const item = section[k];
-
- if (item.button && item.button.name === "鏁呴殰") {
- // 鏇存柊value灞炴��
- item.button.value = guzhangValue;
- break;
- }
+
+
+
+for (let i = 0; i < jsonData2.length; i++) {
+ let arr = jsonData2[i];
+ for (let j = 0; j < arr.length; j++) {
+ let obj2 = arr[j];
+ if (obj2.button && (obj2.button.name === "鏁呴殰" || obj2.button.name === "Fault")) {
+ obj2.button.value = obj.guzhang[0][i];
+ // console.log(obj2.button.value)
}
-
-
}
+
+
}
-for (let i = 0; i < obj.weihuiling[0].length; i++) {
- const weihuilingValue = obj.weihuiling[0][i];
-
- // 鏌ユ壘jsonData2涓甫鏈�"button"鐨勫璞★紝骞朵笖name绛変簬"鏁呴殰"
- for (let j = 0; j < jsonData2.length; j++) {
- const section = jsonData2[j];
-
- for (let k = 0; k < section.length; k++) {
- const item = section[k];
-
- if (item.button && item.button.name === "鏈洖闆�") {
- // 鏇存柊value灞炴��
- item.button.value = weihuilingValue;
- break;
- }
+for (let i = 3; i < jsonData2.length; i++) {
+ let arr2 = jsonData2[i];
+ for (let j = 3; j < arr2.length; j++) {
+ let obj3 = arr2[j];
+ if(obj3.button){
+ if (obj3.button && (obj3.button.name === "鏈洖闆�" || obj3.button.name === "NotZero" )) {
+ obj3.button.value = weihuiling[0][i];
+ // console.log(obj3.button.value)
}
-
-
+
+ }
+
}
+
+
}
+// console.log(jsonData2)
+jsonData2.forEach((item) => {
+ item.forEach((subItem) => {
+ if (subItem.read === 9999) {
+ subItem.value = obj.jinpianid[0];
+ }
+ });
+});
+jsonData2.forEach((item) => {
+ item.forEach((subItem) => {
+ if (subItem.read === 8888) {
+ subItem.value = obj.qupianid[0];
+ }
+ });
+});
}
-}, 500);
+}, 50);
document.addEventListener('mouseover', handleMouseMove);
+
};
@@ -332,6 +394,9 @@
socket.onerror = function () {
console.log("websocket鍙戠敓浜嗛敊璇�");
};
+ this.$router.afterEach(function(){
+ socket.close();
+ })
}
},
@@ -339,7 +404,32 @@
socket?.send(JSON.stringify(this.messagepack));
+ },
+ replaceChineseWithEnglish() {
+
+
+ const nameMap= this.$t('ServoManualone')
+ this.jsonData = this.jsonData.map((item) => {
+ return item.map((obj) => {
+ if (obj.name) {
+ const newName = nameMap[obj.name] || obj.name;
+ return { ...obj, name: newName };
+ } else if (obj.button && obj.button.name) {
+ const newName = nameMap[obj.button.name] || obj.button.name;
+ return { ...obj, button: { ...obj.button, name: newName } };
+ } else if (obj.title && obj.title.name) {
+ const newName = nameMap[obj.title.name] || obj.title.name;
+ return { ...obj, title: { ...obj.title, name: newName } };
+ } else {
+ return obj;
}
+ });
+});
+
+
+// console.log(this.jsonData)
+
+ },
}
}
@@ -366,5 +456,9 @@
background-color: red;
}
+.error-button2 {
+ background-color: red;
+}
+
</style>
\ No newline at end of file
diff --git a/CanadaMes-ui/src/views/Electrical/Sign.vue b/CanadaMes-ui/src/views/Electrical/Sign.vue
index 7dc4d0e..d5da76a 100644
--- a/CanadaMes-ui/src/views/Electrical/Sign.vue
+++ b/CanadaMes-ui/src/views/Electrical/Sign.vue
@@ -59,9 +59,13 @@
}
},
created () {
- this.init();
+
//this.showdata();
},
+ activated(){
+ this.init();
+
+ },
methods: {
showdata () {
console.log(1111);
diff --git a/CanadaMes-ui/src/views/Electrical/State.vue b/CanadaMes-ui/src/views/Electrical/State.vue
index 50d5bf9..80bfc28 100644
--- a/CanadaMes-ui/src/views/Electrical/State.vue
+++ b/CanadaMes-ui/src/views/Electrical/State.vue
@@ -72,10 +72,16 @@
}
},
- created () {
+ // created () {
+ // this.init();
+ // this.replaceChineseWithEnglish();
+ // },
+
+ activated(){
this.init();
this.replaceChineseWithEnglish();
- },
+ },
+
methods: {
onButtonClick () {
this.isButtonClicked = true; // 灏嗘寜閽鑹茶缃负钃濊壊
diff --git a/CanadaMes-ui/src/views/Electrical/alarm.vue b/CanadaMes-ui/src/views/Electrical/alarm.vue
index 14f8fd3..50dc757 100644
--- a/CanadaMes-ui/src/views/Electrical/alarm.vue
+++ b/CanadaMes-ui/src/views/Electrical/alarm.vue
@@ -102,10 +102,23 @@
},
- created () {
+ // created () {
+ // this.init();
+
+
+ // if (this.shijian1 == "" || this.shijian2 == "") {
+ // //鏌ヨ褰撳ぉ鎶ヨ淇℃伅
+ // this.load();
+ // }
+ // else {
+ // //鏍规嵁鏃堕棿鏌ヨ鎶ヨ淇℃伅
+ // this.selectTime();
+ // }
+
+ // },
+ activated(){
+
this.init();
-
-
if (this.shijian1 == "" || this.shijian2 == "") {
//鏌ヨ褰撳ぉ鎶ヨ淇℃伅
this.load();
@@ -115,7 +128,7 @@
this.selectTime();
}
- },
+ },
methods: {
load () {
@@ -198,6 +211,9 @@
socket.onerror = function () {
console.log("websocket鍙戠敓浜嗛敊璇�");
}
+ this.$router.afterEach(function(){
+ socket.close();
+ })
}
},
diff --git a/springboot-vue3/pom.xml b/springboot-vue3/pom.xml
index 32b4261..c4a06f2 100644
--- a/springboot-vue3/pom.xml
+++ b/springboot-vue3/pom.xml
@@ -28,18 +28,8 @@
</properties>
<dependencies>
- <dependencies>
- <dependency>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- <version>2.8.7</version>
- </dependency>
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <version>2.10.0</version>
- </dependency>
- </dependencies>
+
+
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java b/springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java
index da4a94e..9911c40 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java
@@ -64,7 +64,7 @@
spianMapper.Updatetask(1, 0);// 鏇存敼杩涚墖浠诲姟鐘舵�佷负1
spianMapper.overqueue(B01glassid.toString(), 0);// 鏇存敼涓婄墖浠诲姟琛ㄧ殑鐘舵�佷负0
S7control.getinstance().WriteWord("DB106.60", (short) 0);// 鎭㈠B01灏忚溅搴旂瓟鏀逛负0
- S7control.getinstance().WriteWord("DB105.48", (short) 1);//姹囨姤B01灏忚溅鏀跺埌
+ //S7control.getinstance().WriteWord("DB105.48", (short) 1);//姹囨姤B01灏忚溅鏀跺埌
}
// 褰撳嚭鐗囧皬杞﹀畬鎴愪换鍔℃椂
@@ -72,7 +72,7 @@
// 褰揃02灏忚溅姹囨姤瀹屾垚鏃舵洿鏀圭幓鐠冪姸鎬佷负0
spianMapper.UpdateCageOver(B02glassid.toString(), 0);// 鏇存敼绗煎瓙琛ㄥ嚭鐗囩姸鎬�
spianMapper.UpdatetaskOut(B02glassid.toString()); // 瀹屾垚涓婁竴娆″嚭鐗囨垨鑰呰皟搴︿换鍔�
- S7control.getinstance().WriteWord("DB105.50", (short) 0);// 鎭㈠B02灏忚溅搴旂瓟鏀逛负0
+ S7control.getinstance().WriteWord("DB106.62", (short) 0);// 鎭㈠B02灏忚溅搴旂瓟鏀逛负0
// S7control.getinstance().WriteWord("DB105.50", (short) 1);//姹囨姤B02灏忚溅鏀跺埌
}
diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/PlcParameter.java b/springboot-vue3/src/main/java/com/example/springboot/component/PlcParameter.java
index 0399888..6a5dfaa 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/component/PlcParameter.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/component/PlcParameter.java
@@ -78,7 +78,7 @@
// Integer Plccount = this.count;
// System.out.println(stt);
- List<Short> arraylist = S7control.getinstance().ReadWord("DB100.0", 72);
+ List<Short> arraylist = S7control.getinstance().ReadWord("DB100.0", 60);
List<Short> state = S7control.getinstance().ReadWord("DB103.0", 10);
// Short[] values1 = { 1231, 1, 1, 1, 1, 1, 2, 33, 2, 3, 4, 5 ,1231, 1, 1, 1, 1, 1, 2, 33, 2, 3, 4, 5 };
// List<Short> arraylist = new ArrayList<>(Arrays.asList(values1));
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 59124ce..fd033a7 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
@@ -69,17 +69,7 @@
List<String> addressList1 = new ArrayList<>();
-// addressList1.add("DB103.32~45");
-// addressList1.add("DB103.46~59");
-// addressList1.add("DB103.60~73");
-// addressList1.add("DB103.74~101");
-// addressList1.add("DB103.102~115");
-// addressList1.add("DB103.116~143");
-// addressList1.add("DB103.144~157");
-// addressList1.add("DB103.158~171");
-// addressList1.add("DB103.172~185");
-// addressList1.add("DB103.200~213");
-// addressList1.add("DB103.228~241");
+
addressList1.add("DB103.44");//D01
addressList1.add("DB103.58");//D02
addressList1.add("DB103.72");//D03
@@ -87,13 +77,14 @@
addressList1.add("DB103.100");//D05
addressList1.add("DB103.114");//D06
addressList1.add("DB103.128");//A01
- addressList1.add("DB103.156");//A01 2
- addressList1.add("DB103.142");//A02
- addressList1.add("DB103.212");//B01
- addressList1.add("DB103.184");//B02
+ addressList1.add("DB103.142");//A01 2
+ addressList1.add("DB103.156");//A02
+ addressList1.add("DB103.184");//B01
+ addressList1.add("DB103.212");//B02
List<String> paramlist = S7control.getinstance().readStrings(addressList1);
+
List<String> addresses = new ArrayList<>();
@@ -113,7 +104,8 @@
List<Boolean> data2 = S7control.getinstance().ReadBits("DB101.9.2", 10);
List<String> addressList3 = new ArrayList<>();
- addressList3.add("DB106.64");
+ addressList3.add("DB103.256");
+ addressList3.add("DB103.270");
List<String> data3 = S7control.getinstance().readStrings(addressList3);
List<String> addresses4 = new ArrayList<>();
@@ -125,25 +117,26 @@
List<Short> data4 = S7control.getinstance().readWords(addresses4);
-// Boolean[] values = { false, true, true, true, true, true, true, true, true,
-// true};
-// List<Boolean> paramlist = new ArrayList<>(Arrays.asList(values));
+// String[] values6 = { ".x1 ","x2 ","x3",";;x4","x5","x6","x7","x8","x9","x10","x11"};
+// List<String> paramlist = new ArrayList<>(Arrays.asList(values6));
// Short[] values1 = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
// List<Short> data = new ArrayList<>(Arrays.asList(values1));
-// Short[] values2 = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
-// List<Short> data2 = new ArrayList<>(Arrays.asList(values2));
-// Short[] values3 = { 11};
+// Boolean[] value4 = { false, true, true, true, true, true, true, true, true,
+// true};
+// List<Boolean> data2 = new ArrayList<>(Arrays.asList(value4));
+// Short[] values3 = { 22,33};
// List<Short> 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;
}
+
jsonObject.append("params", params);
jsonObject.append("params", paramlist);
jsonObject.append("params", data);
@@ -160,8 +153,19 @@
if (webSocketServer != null) {
List<String> messages = webSocketServer.getMessages();
+ List<String> addressList = new ArrayList<>();
- String addressList = "DB101.9.2";
+ addressList.add("DB101.9.2");
+ addressList.add("DB101.9.3");
+ addressList.add("DB101.9.4");
+ addressList.add("DB101.9.5");
+ addressList.add("DB101.9.6");
+ addressList.add("DB101.9.7");
+ addressList.add("DB101.10.0");
+ addressList.add("DB101.10.1");
+ addressList.add("DB101.10.2");
+ addressList.add("DB101.10.3");
+
if (!messages.isEmpty()) {
// 灏嗘渶鍚庝竴涓秷鎭浆鎹负鏁存暟绫诲瀷鐨勫垪琛�
diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/PlcServoManualone.java b/springboot-vue3/src/main/java/com/example/springboot/component/PlcServoManualone.java
index 9a45abc..465dfe3 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/component/PlcServoManualone.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/component/PlcServoManualone.java
@@ -2,6 +2,7 @@
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
+import com.google.common.primitives.Bytes;
import org.apache.commons.io.FileUtils;
import java.io.*;
@@ -21,23 +22,51 @@
- public void insertDataToList(List<Short> list, String rangeAddress, int insertIndex) {
- if (list.size() >= insertIndex + 14) {
- List<Short> rangeData = new ArrayList<>();
- byte[] byteData = S7control.getinstance().ReadByte(rangeAddress, 14);
- if (byteData != null && byteData.length == 14) {
- for (byte b : byteData) {
- rangeData.add((short) b);
- }
- } else {
- // 璇诲彇鏁版嵁澶辫触锛屾坊鍔犻粯璁ゅ��
- for (int i = 0; i < 14; i++) {
- rangeData.add((short) -1);
- }
- }
+// public void insertDataToList(List<Short> list, String rangeAddress, int insertIndex) {
+// if (list.size() >= insertIndex + 14) {
+// List<Short> rangeData = new ArrayList<>();
+// byte[] byteData = S7control.getinstance().ReadByte(rangeAddress, 14);
+// if (byteData != null && byteData.length >= 13) {
+// for (byte b : byteData) {
+// rangeData.add((short) b);
+// }
+// } else {
+// // 璇诲彇鏁版嵁澶辫触锛屾坊鍔犻粯璁ゅ��
+// for (int i = 0; i < 14; i++) {
+// rangeData.add((short) -1);
+// }
+// }
+//
+// list.addAll(insertIndex, rangeData);
+// }else{
+// List<Short> rangeData = new ArrayList<>();
+// rangeData.add((short) 0);
+// list.addAll(insertIndex, rangeData);
+// }
+// }
- list.addAll(insertIndex, rangeData);
+ public StringBuilder queGlassid(String address,int count) {
+ StringBuilder writedstrIdOut = new StringBuilder();
+ byte[] writedglassidbytesOut = S7control.getinstance().ReadByte(address, count);
+ if (writedglassidbytesOut != null) {
+ // 鑾峰彇鐜荤拑id
+ for (byte iditem : writedglassidbytesOut) {
+ writedstrIdOut.append((char) iditem);
+ }
}
+ return writedstrIdOut;
+ }
+
+ public void outmesid(String glassid,String address) {
+ //System.out.println("outmesid:" + glassid);
+ List<Byte> glassidlist = new ArrayList();
+ char ds[]=glassid.toCharArray();
+ for (char iditem : ds) {
+ glassidlist.add((byte)iditem);
+ }
+ byte[] bytes = Bytes.toArray(glassidlist);
+ System.out.println("outmesidbytes:" + bytes.length);
+ S7control.getinstance().WriteByte(address, bytes);// 娲惧彂鍑虹墖id
}
@Override
@@ -51,54 +80,100 @@
}
-// List<String> addresses = new ArrayList<>();
-// addresses.add("DB103.25");
-// addresses.add("DB100.144");
-//
-// addresses.add("DB100.184");
-// addresses.add("DB100.186");
-// addresses.add("DB100.180");
-// addresses.add("DB100.182");
-//
-// List<Short> arraylist = S7control.getinstance().readWords(addresses);
-//
-//// String rangeAddress = "DB100.148-161";
+ List<String> addresses = new ArrayList<>();
+ addresses.add("DB103.32");
+ addresses.add("DB100.144");
+ addresses.add("DB100.184");
+ addresses.add("DB100.186");
+ addresses.add("DB100.180");
+ addresses.add("DB100.182");
+
+ List<Short> arraylist = S7control.getinstance().readWords(addresses);
+
+// String rangeAddress = "DB100.148-161";
// String rangeAddress = "DB100.148";
// int insertIndex = 2;
// insertDataToList(arraylist, rangeAddress, insertIndex);
-//
-//
-// List<String> addresses2 = new ArrayList<>();
-// addresses2.add("DB103.26");
-// addresses2.add("DB100.188");
-// addresses2.add("DB100.190");
-// addresses2.add("DB100.146");
-//// addresses2.add("DB100.162-175");
-// List<Short> arraylist2 = S7control.getinstance().readWords(addresses2);
-//// String rangeAddress2 = "DB100.148-161";
+
+
+ List<String> addresses2 = new ArrayList<>();
+ addresses2.add("DB103.26");
+ addresses2.add("DB100.188");
+ addresses2.add("DB100.190");
+ addresses2.add("DB100.146");
+// addresses2.add("DB100.162-175");
+ List<Short> arraylist2 = S7control.getinstance().readWords(addresses2);
+// String rangeAddress2 = "DB100.148-161";
// String rangeAddress2 = "DB100.162";
// int insertIndex2 = 4;
// insertDataToList(arraylist2, rangeAddress2, insertIndex2);
-//// System.out.println(arraylist2);
-// List<String> addresses3 = new ArrayList<>();
-// addresses3.add("DB103.42");
-// List<Short> arraylist3 = S7control.getinstance().readWords(addresses3);
+// System.out.println(arraylist2);
+ List<String> addresses3 = new ArrayList<>();
+ addresses3.add("DB103.42");
+ List<Short> arraylist3 = S7control.getinstance().readWords(addresses3);
+
+ List<String> addresses4 = new ArrayList<>();
+ addresses4.add("DB103.46");
+ List<Short> arraylist4 = S7control.getinstance().readWords(addresses4);
+
+ List<Short> arraylist5 = S7control.getinstance().ReadWord("DB103.27", 2);
+ List<Short> arraylist6 = S7control.getinstance().ReadWord("DB103.29", 2);
+ List<String> addresses7 = new ArrayList<>();
+ addresses7.add("DB104.1.4");
+ addresses7.add("DB104.1.5");
+ addresses7.add("DB104.1.2");
+ addresses7.add("DB104.1.3");
+ addresses7.add("DB104.1.6");
+ addresses7.add("DB104.1.7");
+ List<Boolean> arraylist7 = S7control.getinstance().readBits(addresses7);
+
+
+ short[] params2 = new short[arraylist7.size()];
+ for (int i = 0; i < arraylist7.size(); i++) {
+ boolean value = arraylist7.get(i);
+ params2[i] = value ? (short) 1 : (short) 0;
+ }
+
+ List<String> addresses8 = new ArrayList<>();
+ addresses8.add("DB104.9.0");
+ addresses8.add("DB104.9.1");
+ addresses8.add("DB104.9.0");
+ addresses8.add("DB104.9.1");
+ addresses8.add("DB104.9.4");
+ addresses8.add("DB104.9.5");
+ List<Boolean> arraylist8 = S7control.getinstance().readBits(addresses8);
+ short[] params = new short[arraylist8.size()];
+ for (int i = 0; i < arraylist8.size(); i++) {
+ boolean value = arraylist8.get(i);
+ params[i] = value ? (short) 1 : (short) 0;
+ }
+
+
+ StringBuilder queueid1 = queGlassid("DB100.148", 14);
+ StringBuilder queueid2 = queGlassid("DB100.162", 14);
+
+
+
+// Short[] values1 = { 1, 2, 3, 4, 5, 6, 7};
+// List<Short> arraylist = new ArrayList<>(Arrays.asList(values1));
+// Short[] values2 = { 1, 2, 3, 4, 5};
+// List<Short> arraylist2 = new ArrayList<>(Arrays.asList(values2));
//
-// List<String> addresses4 = new ArrayList<>();
-// addresses4.add("DB103.46");
-// List<Short> arraylist4 = S7control.getinstance().readWords(addresses4);
+// Short[] values3 = {1};
+// List<Short> arraylist3 = new ArrayList<>(Arrays.asList(values3));
+// Short[] values4 = {2};
+// List<Short> arraylist4 = new ArrayList<>(Arrays.asList(values4));
+// Short[] values5 = {3,3};
+// List<Short> arraylist5 = new ArrayList<>(Arrays.asList(values5));
+// Short[] values6 = { 4,4};
+// List<Short> arraylist6 = new ArrayList<>(Arrays.asList(values6));
+// Boolean[] values7 = { false, true, true, true, true, true};
+// List<Boolean> arraylist7 = new ArrayList<>(Arrays.asList(values7));
+// Boolean[] values8 = { false, true, true, true, true, true};
+// List<Boolean> arraylist8 = new ArrayList<>(Arrays.asList(values8));
//
-// List<Short> arraylist5 = S7control.getinstance().ReadWord("DB103.27", 2);
-// List<Short> arraylist6 = S7control.getinstance().ReadWord("DB103.29", 2);
-// List<String> addresses7 = new ArrayList<>();
-// addresses7.add("DB104.1.4");
-// addresses7.add("DB104.1.5");
-// addresses7.add("DB104.1.2");
-// addresses7.add("DB104.1.3");
-// addresses7.add("DB104.1.6");
-// addresses7.add("DB104.1.7");
-// List<Boolean> arraylist7 = S7control.getinstance().readBits(addresses7);
-//
+// String queueid1 = "x1234567890123";
+// String queueid2 = "x1234567890123";
//
// short[] params2 = new short[arraylist7.size()];
// for (int i = 0; i < arraylist7.size(); i++) {
@@ -106,37 +181,12 @@
// params2[i] = value ? (short) 1 : (short) 0;
// }
//
-// List<String> addresses8 = new ArrayList<>();
-// addresses8.add("DB101.3.7");
-// addresses8.add("DB101.4.2");
-// addresses8.add("DB101.4.5");
-// addresses8.add("DB101.4.7");
-// List<Boolean> arraylist8 = S7control.getinstance().readBits(addresses8);
+//
// short[] params = new short[arraylist8.size()];
// for (int i = 0; i < arraylist8.size(); i++) {
// boolean value = arraylist8.get(i);
// params[i] = value ? (short) 1 : (short) 0;
// }
-
-
- Short[] values1 = { 1, 2, 3, 4, 5, 6, 7};
- List<Short> arraylist = new ArrayList<>(Arrays.asList(values1));
- Short[] values2 = { 1, 2, 3, 4, 5};
- List<Short> arraylist2 = new ArrayList<>(Arrays.asList(values2));
-
- Short[] values3 = {1};
- List<Short> arraylist3 = new ArrayList<>(Arrays.asList(values3));
- Short[] values4 = {2};
- List<Short> arraylist4 = new ArrayList<>(Arrays.asList(values4));
- Short[] values5 = {3,3};
- List<Short> arraylist5 = new ArrayList<>(Arrays.asList(values5));
- Short[] values6 = { 4,4};
- List<Short> arraylist6 = new ArrayList<>(Arrays.asList(values6));
- Short[] values7 = { 1,1,1,1,1,1};
- List<Short> arraylist7 = new ArrayList<>(Arrays.asList(values7));
- Short[] values8 = { 1,1,1,1,1,1};
- List<Short> arraylist8 = new ArrayList<>(Arrays.asList(values8));
-
JSONObject jsonObject = new JSONObject();
@@ -146,8 +196,10 @@
jsonObject.append("zuhe4", arraylist4);
jsonObject.append("zuhe5", arraylist5);
jsonObject.append("zuhe6", arraylist6);
-// jsonObject.append("guzhang", params2);
-// jsonObject.append("weihuiling", params);
+ jsonObject.append("guzhang", params2);
+ jsonObject.append("weihuiling", params);
+ jsonObject.append("jinpianid", queueid1);
+ jsonObject.append("qupianid", queueid2);
@@ -160,9 +212,9 @@
if (webSocketServer != null) {
List<String> messages = webSocketServer.getMessages();
List<String> waddresses1 = new ArrayList<>();
- waddresses1.add("DB103.25");
+ waddresses1.add("DB103.32");
waddresses1.add("DB100.144");
- waddresses1.add("DB100.148-161");
+// waddresses1.add("DB100.148-161");
waddresses1.add("DB100.184");
waddresses1.add("DB100.186");
waddresses1.add("DB100.180");
@@ -173,7 +225,7 @@
waddresses2.add("DB100.188");
waddresses2.add("DB100.190");
waddresses2.add("DB100.146");
- waddresses2.add("DB100.162-175");
+// waddresses2.add("DB100.162-175");
List<String> waddresses3 = new ArrayList<>();
waddresses3.add("DB101.4.0");
@@ -193,7 +245,8 @@
-
+String waddresses5="DB100.148";
+String waddresses6="DB100.162";
@@ -305,6 +358,27 @@
}
}
+ if (messageArray.getJSONArray(4).size() > 0) {
+// JSONArray jsonArray5 = messageArray.getJSONArray(4);
+ String jsonArray5 = String.valueOf(messageArray.getJSONArray(4));
+ if (!jsonArray5.isEmpty()) {
+// String value = (String) jsonArray5.get(0);
+ jsonArray5 = jsonArray5.replaceAll("[\\[\\]\"]", ""); // 鍘婚櫎鏂规嫭鍙峰拰鍙屽紩鍙�
+ outmesid( jsonArray5,waddresses5);
+ System.out.println("Values " + jsonArray5 + " written to PLC at address " + waddresses5);
+ }
+ }
+
+ if (messageArray.getJSONArray(5).size() > 0) {
+ JSONArray jsonArray6 = messageArray.getJSONArray(5);
+
+ if (!jsonArray6.isEmpty()) {
+ String value2 = (String) jsonArray6.get(0);
+ outmesid( value2,waddresses6);
+ System.out.println("Values " + value2 + " written to PLC at address " + waddresses6);
+ }
+ }
+
// 娓呯┖娑堟伅鍒楄〃
webSocketServer.clearMessages();
}
diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/Plcaction.java b/springboot-vue3/src/main/java/com/example/springboot/component/Plcaction.java
index 400aefe..269125f 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/component/Plcaction.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/component/Plcaction.java
@@ -71,7 +71,7 @@
// Integer Plccount = this.count;
// System.out.println(PlcAddress);
- List<Boolean> paramlist = S7control.getinstance().ReadBits("DB2.0.0", 26);
+ List<Boolean> paramlist = S7control.getinstance().ReadBits("DB102.0.0", 10);
// Boolean[] values = { false, true, true, true, true, true, true, true, true,
// true, true, true, true, true, true, true, true, true, true, true, true, true, true,
// true, false, true };
diff --git a/springboot-vue3/src/main/java/com/example/springboot/component/S7control.java b/springboot-vue3/src/main/java/com/example/springboot/component/S7control.java
index b6afa91..8db324e 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/component/S7control.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/component/S7control.java
@@ -10,6 +10,7 @@
import com.github.xingshuangs.iot.protocol.s7.service.MultiAddressWrite;
import com.github.xingshuangs.iot.protocol.s7.service.S7PLC;
import com.google.common.primitives.Bytes;
+import org.apache.ibatis.jdbc.Null;
public class S7control {
@@ -238,11 +239,25 @@
for (String address : addressList) {
byte[] bytes = s7PLC.readByte(address, 14);
-
- if (bytes != null) {
- String str = new String(bytes, StandardCharsets.US_ASCII);
+// System.out.println(bytes.toString());
+ if (bytes != null) {
+ String str = new String(bytes, StandardCharsets.UTF_8);
+// System.out.println(str);
+// if(str == null ){
+// str = "";
+// }
result.add(str);
}
+// if ( bytes.toString().contains("@")) {
+// String str = "";
+//
+// result.add(str);
+// }else{
+//
+// String str = new String(bytes, StandardCharsets.US_ASCII);
+// result.add(str);
+// }
+// System.out.println(bytes.toString());
}
return result;
@@ -266,7 +281,7 @@
}
public void outmesid(String data, String addr) {
- System.out.println("outmesid: " + data);
+// System.out.println("outmesid: " + data);
List<Byte> glassidlist = new ArrayList<>();
String[] parts = addr.split("-");
if (parts.length == 2) {
diff --git a/springboot-vue3/src/main/java/com/example/springboot/config/AppRunnerConfig.java b/springboot-vue3/src/main/java/com/example/springboot/config/AppRunnerConfig.java
index 4661acd..97fcae5 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/config/AppRunnerConfig.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/config/AppRunnerConfig.java
@@ -35,7 +35,7 @@
//
System.out.println("鍚姩瀹屾垚");
- new PlcHold().start();
+// new PlcHold().start();
new Plcaction().start();
//
--
Gitblit v1.8.0