| | |
| | | import com.zy.asrs.framework.common.SpringUtils; |
| | | import com.zy.asrs.wcs.core.entity.BasConveyor; |
| | | import com.zy.asrs.wcs.core.entity.BasConveyorSta; |
| | | import com.zy.asrs.wcs.core.entity.DeviceBarcode; |
| | | import com.zy.asrs.wcs.core.service.BasConveyorService; |
| | | import com.zy.asrs.wcs.core.service.BasConveyorStaService; |
| | | import com.zy.asrs.wcs.core.service.DeviceBarcodeService; |
| | | import com.zy.asrs.wcs.core.utils.RedisUtil; |
| | | import com.zy.asrs.wcs.rcs.News; |
| | | import com.zy.asrs.wcs.rcs.cache.OutputQueue; |
| | | import com.zy.asrs.wcs.rcs.cache.SlaveConnection; |
| | | import com.zy.asrs.wcs.rcs.entity.Device; |
| | | import com.zy.asrs.wcs.rcs.model.dto.WorkModeTypeDto; |
| | | import com.zy.asrs.wcs.rcs.model.enums.SlaveType; |
| | | import com.zy.asrs.wcs.rcs.model.enums.WorkModeType; |
| | | import com.zy.asrs.wcs.rcs.model.protocol.StaProtocol; |
| | | import com.zy.asrs.wcs.rcs.thread.BarcodeThread; |
| | | import com.zy.asrs.wcs.rcs.thread.DevpThread; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | |
| | | staProtocol.setInEnable(siemensS7Net.getByteTransform().TransInt16(result.Content, i * 40 + 14) == 1); // 可入 |
| | | staProtocol.setOutEnable(siemensS7Net.getByteTransform().TransInt16(result.Content, i * 40 + 14) == 2);// 可出 |
| | | staProtocol.setWorkMode((int) siemensS7Net.getByteTransform().TransInt16(result.Content, i * 40 + 8));// 工作模式 |
| | | |
| | | String barcode = siemensS7Net.getByteTransform().TransString(result.Content,58,8, "UTF-8");// 条码 |
| | | BasConveyorStaService basConveyorStaService = SpringUtils.getBean(BasConveyorStaService.class); |
| | | DeviceBarcodeService deviceBarcodeService = SpringUtils.getBean(DeviceBarcodeService.class); |
| | | BasConveyorSta basConveyorSta = basConveyorStaService.getOne(new LambdaQueryWrapper<BasConveyorSta>().eq(BasConveyorSta::getSiteNo, siteId)); |
| | | if (basConveyorSta != null) { |
| | | DeviceBarcode deviceBarcode = deviceBarcodeService.getById(basConveyorSta.getBarcodeId()); |
| | | if (deviceBarcode != null) { |
| | | BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, Integer.parseInt(deviceBarcode.getDeviceId())); |
| | | if (barcodeThread != null) { |
| | | barcodeThread.setBarcode(barcode); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // staProtocol.setEmptyMk(status[4]); // 空板信号 |
| | | // staProtocol.setFullPlt(status[5]); // 满托盘 |
| | | // staProtocol.setHigh(status[6]); // 高库位 |