| | |
| | | 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; |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 将火警报警信号写入到堆垛机PLC中 |
| | | */ |
| | | @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)){ |
| | | //报警信号写入1 |
| | | if (!MessageQueue.offer(SlaveType.Crn, locMast.getCrnNo(), new Task(4, (short)1))) { |
| | | log.error("火警 ===>> 给堆垛机发送报警信号失败"); |
| | | } |
| | | } else { |
| | | //报警信号没有后,复位地址 |
| | | if (!MessageQueue.offer(SlaveType.Crn, locMast.getCrnNo(), new Task(4, (short)0))) { |
| | | log.error("火警 ===>> 给堆垛机清零复位报警信号失败"); |
| | | } |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("火警 ===>> 给堆垛机发送警报失败", e); |
| | | e.printStackTrace(); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | } |
| | | } |
| | | |
| | | } |