wuyouming666
2023-12-02 17b583422095aff6bb91bd8ddff5faeb41c8edb2
更新电气管理通讯逻辑
32个文件已修改
2个文件已删除
2570 ■■■■■ 已修改文件
CanadaMes-ui/package-lock.json 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/package.json 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/configuration/Manualoneposition.json 626 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/configuration/Manualoneposition2.json 258 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/configuration/ServoManualone.json 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/configuration/parameter2.json 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/lang/locales/en-US.json 204 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/layout/index.vue 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/main.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/router/index.js 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/store/index.js 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/store/module/tags.js 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/views/Electrical/Action.vue 102 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/views/Electrical/AutomaticParameterSetting.vue 51 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/views/Electrical/ManualJog.vue 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/views/Electrical/ManualonePosition.vue 84 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/views/Electrical/ManualonePosition2.vue 71 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/views/Electrical/Parameter.vue 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/views/Electrical/Parameter1.vue 55 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/views/Electrical/Parameter2.vue 151 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/views/Electrical/Positioning1.vue 45 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/views/Electrical/Positioning2.vue 45 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/views/Electrical/ServoManualone.vue 224 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/views/Electrical/Sign.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/views/Electrical/State.vue 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
CanadaMes-ui/src/views/Electrical/alarm.vue 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/pom.xml 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/PlcHold.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/PlcParameter.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/PlcParameter2.java 54 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/PlcServoManualone.java 248 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/Plcaction.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/component/S7control.java 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/config/AppRunnerConfig.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
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",
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",
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
    }
  ]
]
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
      }
    }
  ]
]
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"
            }
          },
          {
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,
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"
              }
}
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;
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');
CanadaMes-ui/src/router/index.js
@@ -134,7 +134,10 @@
const router = new VueRouter({
  // base: '/canadames/',  
  routes
  routes,
  meta:{
keepAlive:false
  }
});
// 路由控制守卫,解决需要登录才可以访问的页面
@@ -144,8 +147,6 @@
  // 获取token
  const hasToken = getToken();
  const isExist = Vue.prototype.$tagList.some(tag => tag.path === to.fullPath);
CanadaMes-ui/src/store/index.js
File was deleted
CanadaMes-ui/src/store/module/tags.js
File was deleted
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);
    },
  }
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)
    }
  }
}
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>
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)
    }
  }
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)
    }
  }
CanadaMes-ui/src/views/Electrical/Parameter.vue
@@ -167,6 +167,9 @@
        socket.onerror = function () {
          console.log("websocket发生了错误");
        };
        this.$router.afterEach(function(){
          socket.close();
        })
      }
    },
    send () {
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 () {
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的value:', 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; // 正则表达式匹配非字母、数字、下划线和空格的字符
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 () {
     
     
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 () {
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 () {
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('所有Type为0的value:', 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>
CanadaMes-ui/src/views/Electrical/Sign.vue
@@ -59,9 +59,13 @@
    }
  },
  created () {
    this.init();
    //this.showdata();
  },
  activated(){
    this.init();
 },
  methods: {
    showdata () {
      console.log(1111);
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; // 将按钮颜色设置为蓝色
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();
        })
      }
    },
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>
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 @@
        // 当B02小车汇报完成时更改玻璃状态为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小车收到
      }
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));
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()) {
          // 将最后一个消息转换为整数类型的列表
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();
        }
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 };
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) {
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();
    //