Browse Source

现场光电测试修改

k 1 year ago
parent
commit
d45b10fbac

+ 2 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warewms/test/ModbusTestController.java

@@ -31,11 +31,11 @@ public class ModbusTestController {
     /**
      * 读
      *
-     * @param offset 0 光电1号 | 1 光电2号 | 2 光电3号 | 3 光电4号
+     * @param offset 0 光电1号 | 1 光电2号 | 2 光电3号
      * @return
      * @throws Exception
      */
-    @ApiOperation("读光电,称重数据,0 光电1号|1 光电2号|2 光电3号|3 光电4号")
+    @ApiOperation("读光电,称重数据,0 光电1号|1 光电2号|2 光电3号")
     @RequestMapping(value = "/read", method = RequestMethod.POST)
     @ResponseBody
     public AjaxResult read(Integer offset) throws Exception {

+ 5 - 5
warewms-ams/src/main/java/com/ruoyi/ams/agv/ndc/thread/AutoPhotoelectricTask.java

@@ -24,21 +24,21 @@ public class AutoPhotoelectricTask {
     public void run() {
         boolean b = modbusTcpWeigherClient.readPhotoelectricity01();
         if (b) {
-            photoelectricTask(EMPTY_PALLET_POINT_01, "1号光电");
+            photoelectricTask(EMPTY_PALLET_POINT_03, "3号光电");
         }
     }
 
     public void run01() {
-        boolean b = modbusTcpWeigherClient.readPhotoelectricity01();
+        boolean b = modbusTcpWeigherClient.readPhotoelectricity02();
         if (b) {
-            photoelectricTask(EMPTY_PALLET_POINT_02, "2号光电");
+            photoelectricTask(EMPTY_PALLET_POINT_01, "1号光电");
         }
     }
 
     public void run02() {
-        boolean b = modbusTcpWeigherClient.readPhotoelectricity01();
+        boolean b = modbusTcpWeigherClient.readPhotoelectricity03();
         if (b) {
-            photoelectricTask(EMPTY_PALLET_POINT_03, "2号光电");
+            photoelectricTask(EMPTY_PALLET_POINT_02, "2号光电");
         }
     }
 

+ 1 - 3
warewms-hard/src/main/java/com/ruoyi/hard/modbus/tcp/ModbusTcpWeigherClient.java

@@ -66,11 +66,9 @@ public class ModbusTcpWeigherClient {
     /**
      * 读光电3信号
      *
-     * @param slaveId
-     * @param offset
      * @return
      */
-    public boolean readPhotoelectricity03(int slaveId, int offset) {
+    public boolean readPhotoelectricity03() {
         ModbusMasterUtil modbusMasterUtil = modbusTcpMasterTemplateFirst.getModbusMasterUtil();
         Number number = modbusMasterUtil.readHoldingRegister(1, 2, DATA_TYPE_WRAPPER.TWO_BYTE_INT_UNSIGNED);
         int i = number.intValue();