| | |
| | | import com.zy.core.properties.SlaveProperties; |
| | | import com.zy.core.thread.BarcodeThread; |
| | | import com.zy.core.thread.LedThread; |
| | | import com.zy.core.thread.SiemensCrnThread; |
| | | import com.zy.core.thread.SiemensDevpThread; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | case 11://入库前判断充电线是否放好 |
| | | olsStatus = 99; |
| | | newStatus = 0; |
| | | newSingle = 11;//不变 |
| | | newSingle = 11;// |
| | | break; |
| | | case 12://充电线放好 |
| | | olsStatus = 99; |
| | |
| | | locMast.setLocSts("O"); |
| | | locMastService.update(locMast,new EntityWrapper<LocMast>() |
| | | .eq("channel",(i+1))); |
| | | //复位PLC信号,借用输送站点实体类 |
| | | StaProtocol staProtocol = new StaProtocol(); |
| | | staProtocol.setSiteId(i*2);//寄存器地址 |
| | | staProtocol.setStaNo(newSingle);//修改PLC寄存器地址值,12==>0 |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(3, staProtocol)); |
| | | if(!result){ |
| | | } |
| | | //复位PLC信号,借用输送站点实体类 |
| | | StaProtocol staProtocol = new StaProtocol(); |
| | | staProtocol.setSiteId(i*2);//寄存器地址 |
| | | staProtocol.setStaNo(newSingle);//修改PLC寄存器地址值,12==>0 |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(3, staProtocol)); |
| | | if(!result){ |
| | | // log.error("更新库位紧急出库信号失败===>>[channel:{},locNo:{},barcode:{}]", i+1, locMast.getLocNo(), locMast.getBarcode()); |
| | | // throw new CoolException("更新测试信号失败===>>" + i); |
| | | } else { |
| | | devpThread.startSignal[i] = newSingle; |
| | | } |
| | | } else { |
| | | devpThread.startSignal[i] = newSingle; |
| | | } |
| | | }else { } |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | @Transactional |
| | | public void fierCrn() { |
| | | try { |
| | | for (CrnSlave crn :slaveProperties.getCrn()) { |
| | | // 获取堆垛机信息 |
| | | CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn, crn.getId()); |
| | | CrnProtocol crnProtocol = crnThread.getCrnProtocol(); |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("fire_status", 1)); |
| | | if (!Cools.isEmpty(locMast)){ |
| | | //xie xin h |
| | | } else { |
| | | //fu wei h |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("火警 ===>> 给堆垛机发送警报失败", e); |
| | | e.printStackTrace(); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | } |
| | | } |
| | | |
| | | } |