|  |  | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 入出库模式切换函数 | 
 |  |  |      */ | 
 |  |  |     public synchronized void ioConvert() { | 
 |  |  |         try { | 
 |  |  |             // 根据输送线plc遍历 | 
 |  |  |             for (DevpSlave devp : slaveProperties.getDevp()) { | 
 |  |  |                 if (devp.getId() == 2){ | 
 |  |  |                     continue; | 
 |  |  |                 } | 
 |  |  |                 SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId()); | 
 |  |  |  | 
 |  |  |             FyDevpThread devpThread = (FyDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId()); | 
 |  |  |                 for (DevpSlave.Sta inSta : devp.getInSta()) { | 
 |  |  |                     WrkMast pakout = wrkMastMapper.selectWorkingPakout(inSta.getBackSta()); | 
 |  |  |                     switch (inSta.getBackSta()) { | 
 |  |  | 
 |  |  |                                 devpThread.ioModeOf1F1 = IoModeType.PAKIN_MODE; | 
 |  |  |                             } | 
 |  |  |                             break; | 
 |  |  |                         case 117: | 
 |  |  |                             if (pakout != null) { | 
 |  |  |                                 if (devpThread.ioModeOf1F2 != IoModeType.PAKOUT_MODE) { | 
 |  |  |                                     // 出库切换中 | 
 |  |  |                                     devpThread.ioModeOf1F2 = IoModeType.PAKOUT_BOOTING; | 
 |  |  |                                     WrkMast pakin = wrkMastMapper.selectWorkingPakin(inSta.getStaNo()); | 
 |  |  |                                     if (pakin == null && !devpThread.getStation().get(inSta.getStaNo()).isLoading() | 
 |  |  |                                             && !devpThread.getStation().get(inSta.getBackSta()).isLoading() | 
 |  |  |                                             && devpThread.getStation().get(inSta.getBackSta()).getWorkNo() == 0) { | 
 |  |  |                                         // 出库模式 | 
 |  |  |                                         devpThread.ioModeOf1F2 = IoModeType.PAKOUT_MODE; | 
 |  |  |                                     } | 
 |  |  |                                 } | 
 |  |  |                             } else { | 
 |  |  |                                 // 入库模式 | 
 |  |  |                                 devpThread.ioModeOf1F2 = IoModeType.PAKIN_MODE; | 
 |  |  |                             } | 
 |  |  |                             break; | 
 |  |  |                         case 118: | 
 |  |  |                             if (pakout != null) { | 
 |  |  |                                 if (devpThread.ioModeOf1F3 != IoModeType.PAKOUT_MODE) { | 
 |  |  |                                     // 出库切换中 | 
 |  |  |                                     devpThread.ioModeOf1F3 = IoModeType.PAKOUT_BOOTING; | 
 |  |  |                                     WrkMast pakin = wrkMastMapper.selectWorkingPakin(inSta.getStaNo()); | 
 |  |  |                                     if (pakin == null && !devpThread.getStation().get(inSta.getStaNo()).isLoading() | 
 |  |  |                                             && !devpThread.getStation().get(inSta.getBackSta()).isLoading() | 
 |  |  |                                             && devpThread.getStation().get(inSta.getBackSta()).getWorkNo() == 0) { | 
 |  |  |                                         // 出库模式 | 
 |  |  |                                         devpThread.ioModeOf1F3 = IoModeType.PAKOUT_MODE; | 
 |  |  |                                     } | 
 |  |  |                                 } | 
 |  |  |                             } else { | 
 |  |  |                                 // 入库模式 | 
 |  |  |                                 devpThread.ioModeOf1F3 = IoModeType.PAKIN_MODE; | 
 |  |  |                             } | 
 |  |  |                             break; | 
 |  |  |                         case 119: | 
 |  |  |                             if (pakout != null) { | 
 |  |  |                                 if (devpThread.ioModeOf1F4 != IoModeType.PAKOUT_MODE) { | 
 |  |  |                                     // 出库切换中 | 
 |  |  |                                     devpThread.ioModeOf1F4 = IoModeType.PAKOUT_BOOTING; | 
 |  |  |                                     WrkMast pakin = wrkMastMapper.selectWorkingPakin(inSta.getStaNo()); | 
 |  |  |                                     if (pakin == null && !devpThread.getStation().get(inSta.getStaNo()).isLoading() | 
 |  |  |                                             && !devpThread.getStation().get(inSta.getBackSta()).isLoading() | 
 |  |  |                                             && devpThread.getStation().get(inSta.getBackSta()).getWorkNo() == 0) { | 
 |  |  |                                         // 出库模式 | 
 |  |  |                                         devpThread.ioModeOf1F4 = IoModeType.PAKOUT_MODE; | 
 |  |  |                                     } | 
 |  |  |                                 } | 
 |  |  |                             } else { | 
 |  |  |                                 // 入库模式 | 
 |  |  |                                 devpThread.ioModeOf1F4 = IoModeType.PAKIN_MODE; | 
 |  |  |                             } | 
 |  |  |                             break; | 
 |  |  |                         case 120: | 
 |  |  |                             if (pakout != null) { | 
 |  |  |                                 if (devpThread.ioModeOf1F5 != IoModeType.PAKOUT_MODE) { | 
 |  |  |                                     // 出库切换中 | 
 |  |  |                                     devpThread.ioModeOf1F5 = IoModeType.PAKOUT_BOOTING; | 
 |  |  |                                     WrkMast pakin = wrkMastMapper.selectWorkingPakin(inSta.getStaNo()); | 
 |  |  |                                     if (pakin == null && !devpThread.getStation().get(inSta.getStaNo()).isLoading() | 
 |  |  |                                             && !devpThread.getStation().get(inSta.getBackSta()).isLoading() | 
 |  |  |                                             && devpThread.getStation().get(inSta.getBackSta()).getWorkNo() == 0) { | 
 |  |  |                                         // 出库模式 | 
 |  |  |                                         devpThread.ioModeOf1F5 = IoModeType.PAKOUT_MODE; | 
 |  |  |                                     } | 
 |  |  |                                 } | 
 |  |  |                             } else { | 
 |  |  |                                 // 入库模式 | 
 |  |  |                                 devpThread.ioModeOf1F5 = IoModeType.PAKIN_MODE; | 
 |  |  |                             } | 
 |  |  |                             break; | 
 |  |  |                         case 203: | 
 |  |  |                             if (pakout != null) { | 
 |  |  |                                 if (devpThread.ioModeOf2F1 != IoModeType.PAKOUT_MODE) { | 
 |  |  |                                     // 出库切换中 | 
 |  |  |                                     devpThread.ioModeOf2F1 = IoModeType.PAKOUT_BOOTING; | 
 |  |  |                                     WrkMast pakin = wrkMastMapper.selectWorkingPakin(inSta.getStaNo()); | 
 |  |  |                                     if (pakin == null && !devpThread.getStation().get(inSta.getStaNo()).isLoading() | 
 |  |  |                                             && !devpThread.getStation().get(inSta.getBackSta()).isLoading() | 
 |  |  |                                             && devpThread.getStation().get(inSta.getBackSta()).getWorkNo() == 0) { | 
 |  |  |                                         // 出库模式 | 
 |  |  |                                         devpThread.ioModeOf2F1 = IoModeType.PAKOUT_MODE; | 
 |  |  |                                     } | 
 |  |  |                                 } | 
 |  |  |                             } else { | 
 |  |  |                                 // 入库模式 | 
 |  |  |                                 devpThread.ioModeOf2F1 = IoModeType.PAKIN_MODE; | 
 |  |  |                             } | 
 |  |  |                             break; | 
 |  |  |  | 
 |  |  |                         case 207: | 
 |  |  |                             if (pakout != null) { | 
 |  |  |                                 if (devpThread.ioModeOf2F2 != IoModeType.PAKOUT_MODE) { | 
 |  |  |                                     // 出库切换中 | 
 |  |  |                                     devpThread.ioModeOf2F2 = IoModeType.PAKOUT_BOOTING; | 
 |  |  |                                     WrkMast pakin = wrkMastMapper.selectWorkingPakin(inSta.getStaNo()); | 
 |  |  |                                     if (pakin == null && !devpThread.getStation().get(inSta.getStaNo()).isLoading() | 
 |  |  |                                             && !devpThread.getStation().get(inSta.getBackSta()).isLoading() | 
 |  |  |                                             && devpThread.getStation().get(inSta.getBackSta()).getWorkNo() == 0) { | 
 |  |  |                                         // 出库模式 | 
 |  |  |                                         devpThread.ioModeOf2F2 = IoModeType.PAKOUT_MODE; | 
 |  |  |                                     } | 
 |  |  |                                 } | 
 |  |  |                             } else { | 
 |  |  |                                 // 入库模式 | 
 |  |  |                                 devpThread.ioModeOf2F2 = IoModeType.PAKIN_MODE; | 
 |  |  |                             } | 
 |  |  |                             break; | 
 |  |  |  | 
 |  |  |                         case 212: | 
 |  |  |                             if (pakout != null) { | 
 |  |  |                                 if (devpThread.ioModeOf2F3 != IoModeType.PAKOUT_MODE) { | 
 |  |  |                                     // 出库切换中 | 
 |  |  |                                     devpThread.ioModeOf2F3 = IoModeType.PAKOUT_BOOTING; | 
 |  |  |                                     WrkMast pakin = wrkMastMapper.selectWorkingPakin(inSta.getStaNo()); | 
 |  |  |                                     if (pakin == null && !devpThread.getStation().get(inSta.getStaNo()).isLoading() | 
 |  |  |                                             && !devpThread.getStation().get(inSta.getBackSta()).isLoading() | 
 |  |  |                                             && devpThread.getStation().get(inSta.getBackSta()).getWorkNo() == 0) { | 
 |  |  |                                         // 出库模式 | 
 |  |  |                                         devpThread.ioModeOf2F3 = IoModeType.PAKOUT_MODE; | 
 |  |  |                                     } | 
 |  |  |                                 } | 
 |  |  |                             } else { | 
 |  |  |                                 // 入库模式 | 
 |  |  |                                 devpThread.ioModeOf2F3 = IoModeType.PAKIN_MODE; | 
 |  |  |                             } | 
 |  |  |                             break; | 
 |  |  |                     } | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  |         } catch (Exception e) { |