wu
2024-11-26 fddf1c716af76c2968e08ce11895eaa1c26319a5
springboot-vue3/src/main/java/com/example/springboot/component/PlcHoldNew.java
@@ -28,11 +28,11 @@
      } catch (InterruptedException e) {
        e.printStackTrace();
      }
      storageCageService = WebSocketServer.applicationContext.getBean(StorageCageService.class);
      spianService = WebSocketServer.applicationContext.getBean(SpianServiceNew.class);
      albaniaMapper = WebSocketServer.applicationContext.getBean(AlbaniaMapper.class);
      // spianService.selectout(1);
      // storageCageService.ScanMatch("123",1,1);
      // spianService.mateOut();
      // 读取DB14区文件
      PlcParameterObject plcmes = PLCAutoMes.PlcMesObject;
@@ -43,6 +43,7 @@
        String IDStatus1 = plcmes.getPlcParameter("IDStatus1").getValue();// 1号任务完成
        String MESToPLCStatus1 = plcmes.getPlcParameter("MESToPLCStatus1").getValue();// 1号确认字
        String MESToPLC = plcmes.getPlcParameter("MESToPLC").getValue();// 发送任务字
        String GaToMES = plcmes.getPlcParameter("GaToMES").getValue();// 测量成功信号
        
        int taskcont = albaniaMapper.SelectTaskcount(); // 正在进行的任务数量
        int outtask = albaniaMapper.SelectOutTaskCount(); // 等待补发的出片任务数量
@@ -81,7 +82,7 @@
            //     .println("出片状态:MESToPLC:" + MESToPLC + "PLCToMES:" + PLCToMES + "MESToPLCStatus1:" + MESToPLCStatus1);
            spianService.selectout(1);
            try {
              Thread.sleep(200); // 每100毫秒检查一次
              Thread.sleep(100); // 每100毫秒检查一次
            } catch (InterruptedException e) {
              Thread.currentThread().interrupt(); // 处理线程中断
            }
@@ -94,15 +95,13 @@
        MESToPLC = plcmes.getPlcParameter("MESToPLC").getValue();// 发送任务字
        // 运送车请求和测量完成请求
        GlassInfo glass = albaniaMapper.SelectGlass();
        if (PLCToMES != null && glass != null && MESToPLC != null && taskcont == 0) {
          if (PLCToMES.equals("1") == true && MESToPLC.equals("0") == true && MESToPLCStatus1.equals("0") == true&&outtask == 0) {
        if (PLCToMES != null && glass != null && MESToPLC != null) {
          if (PLCToMES.equals("1")&& MESToPLC.equals("0")&&("1".equals(GaToMES)||"2".equals(GaToMES))) {
            try {
              Thread.sleep(100); // 每100毫秒检查一次
            } catch (InterruptedException e) {
              Thread.currentThread().interrupt(); // 处理线程中断
            }
            // System.out
            //     .println("进片状态:MESToPLC:" + MESToPLC + "PLCToMES:" + PLCToMES + "MESToPLCStatus1:" + MESToPLCStatus1);
            spianService.selectAll(glass);
          }
        }