| | |
| | | import com.zy.asrs.domain.vo.SiteTableVo; |
| | | import com.zy.asrs.entity.BasDevp; |
| | | import com.zy.asrs.service.BasDevpService; |
| | | import com.zy.core.Slave; |
| | | import com.zy.core.cache.MessageQueue; |
| | | import com.zy.core.cache.OutputQueue; |
| | | import com.zy.core.cache.SlaveConnection; |
| | |
| | | if (pakMk != null) { |
| | | staProtocol.setPakMk(pakMk.equals("Y")); |
| | | } |
| | | |
| | | staProtocol.setPalletSize((short) 1); |
| | | boolean result = MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | | if (result) { |
| | | return R.ok(); |
| | |
| | | return R.error("plc已掉线"); |
| | | } |
| | | |
| | | @GetMapping("/site/{siteId}") |
| | | public R site(@PathVariable("siteId") Integer siteId){ |
| | | List<DevpSlave> devp = slaveProperties.getDevp(); |
| | | for (DevpSlave slave : devp) { |
| | | DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, slave.getId()); |
| | | Map<Integer, StaProtocol> station = devpThread.getStation(); |
| | | StaProtocol staProtocol = station.get(siteId); |
| | | if (staProtocol == null) { |
| | | continue; |
| | | } |
| | | return R.ok().add(staProtocol); |
| | | } |
| | | return R.error(); |
| | | } |
| | | |
| | | } |