| | |
| | | import HslCommunication.Profinet.Siemens.SiemensPLCS; |
| | | import HslCommunication.Profinet.Siemens.SiemensS7Net; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.entity.BasCircularShuttle; |
| | | import com.zy.asrs.entity.BasRgv; |
| | | import com.zy.asrs.entity.BasRgvErrLog; |
| | | import com.zy.asrs.entity.BasRgvOpt; |
| | | import com.zy.asrs.service.BasCircularShuttleService; |
| | | import com.zy.asrs.service.BasRgvErrLogService; |
| | | import com.zy.asrs.service.BasRgvOptService; |
| | | import com.zy.asrs.service.BasRgvService; |
| | |
| | | @SuppressWarnings("InfiniteLoopStatement") |
| | | public void run() { |
| | | connectRgv = this.connect(); |
| | | while(!connectRgv){ |
| | | try { |
| | | connectRgv = this.connect(); |
| | | Thread.sleep(100); |
| | | } catch (Exception e){ |
| | | |
| | | } |
| | | } |
| | | |
| | | // 启动线程自动重连 |
| | | new Thread(this::rgvConnect).start(); |
| | |
| | | Thread.sleep(1000); |
| | | if(!connectRgv){ |
| | | try { |
| | | // 根据实时信息更新数据库 |
| | | BasCircularShuttleService basCircularShuttleService = SpringUtils.getBean(BasCircularShuttleService.class); |
| | | BasCircularShuttle basCircularShuttle = basCircularShuttleService.selectOne(new EntityWrapper<BasCircularShuttle>().eq("rgv_no", slave.getId())); |
| | | if (basCircularShuttle.getStatus() != 0){ |
| | | continue; |
| | | } |
| | | } catch (Exception ignore) { |
| | | |
| | | } |
| | | try { |
| | | connectRgv = this.connect(); |
| | | Thread.sleep(100); |
| | | } catch (Exception e){ |