|
@@ -6,7 +6,6 @@ import com.warewms.hailiang.init.PlcConnectServiceRunner;
|
|
|
import com.warewms.hailiang.init.TcpServiceRunner;
|
|
|
import com.warewms.hailiang.service.ProcessRealizationService;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
@@ -55,11 +54,12 @@ public class TraceJob {
|
|
|
* 获取喷码信号
|
|
|
*/
|
|
|
public void getTheChamferCompletionSignal() {
|
|
|
-// boolean b = plcConnectServiceRunner.getPlcServer(DeviceNameEnum.DAOJIAOPLC.getDeviceName()).readBoolean(DaoJiaoPlcEnum.CHECKFINISH.getMetadata());
|
|
|
-// log.info("喷码信号:{}", b);
|
|
|
-// if (b) {
|
|
|
+ Integer i = plcConnectServiceRunner.getPlcServer(DeviceNameEnum.DAOJIAOPLC.getDeviceName()).readInt32(DaoJiaoPlcEnum.CHECKFINISH.getMetadata());
|
|
|
+ log.info("喷码信号:{}", i);
|
|
|
+ if (i.equals(6)) {
|
|
|
processRealizationService.DaoJiaoCodingCodeProcess();
|
|
|
-// }
|
|
|
+ plcConnectServiceRunner.getPlcServer(DeviceNameEnum.DAOJIAOPLC.getDeviceName()).writeInt32(DaoJiaoPlcEnum.CHECKFINISH.getMetadata(),0);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -67,44 +67,44 @@ public class TraceJob {
|
|
|
*/
|
|
|
|
|
|
public void obtainTheChamferingMachineCodeReadingSignal (){
|
|
|
-// boolean b = plcConnectServiceRunner.getPlcServer(DeviceNameEnum.DAOJIAOPLC.getDeviceName()).readBoolean(DaoJiaoPlcEnum.READCODE.getMetadata());
|
|
|
-// log.info("倒角机读码信号,{}",b);
|
|
|
-// if (b) {
|
|
|
+ Integer i = plcConnectServiceRunner.getPlcServer(DeviceNameEnum.DAOJIAOPLC.getDeviceName()).readInt32(DaoJiaoPlcEnum.READCODE.getMetadata());
|
|
|
+ log.info("倒角机读码信号,{}",i);
|
|
|
+ if (i.equals(16)) {
|
|
|
processRealizationService.CodeReadingProcess("CodeReader3");
|
|
|
-// }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取铣面读码信号
|
|
|
*/
|
|
|
public void obtainTheMillingFaceReadingSignal() {
|
|
|
-// boolean b = plcConnectServiceRunner.getPlcServer(DeviceNameEnum.XIMIANPLC.getDeviceName()).readBoolean(XiMianPlcEnum.ISREAD.getMetadata());
|
|
|
-// log.info("铣面读码信号:{}", b);
|
|
|
-// if (b) {
|
|
|
+ boolean b = plcConnectServiceRunner.getPlcServer(DeviceNameEnum.XIMIANPLC.getDeviceName()).readBoolean(XiMianPlcEnum.ISREAD.getMetadata());
|
|
|
+ log.info("铣面读码信号:{}", b);
|
|
|
+ if (b) {
|
|
|
processRealizationService.CodeReadingProcess("CodeReader5");
|
|
|
-// }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取轧制读码信号
|
|
|
*/
|
|
|
public void getARollingReadingSignal() {
|
|
|
-// boolean b = plcConnectServiceRunner.getPlcServer(DeviceNameEnum.ZHAZHIPLC.getDeviceName()).readBoolean(ZhaZhiPlcEnum.ISREAD.getMetadata());
|
|
|
-// log.info("轧制读码信号:{}", b);
|
|
|
-// if (b) {
|
|
|
+ boolean b = plcConnectServiceRunner.getPlcServer(DeviceNameEnum.ZHAZHIPLC.getDeviceName()).readBoolean(ZhaZhiPlcEnum.ISREAD.getMetadata());
|
|
|
+ log.info("轧制读码信号:{}", b);
|
|
|
+ if (b) {
|
|
|
processRealizationService.CodeReadingProcess("CodeReader6");
|
|
|
-// }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取行车1读码信号
|
|
|
*/
|
|
|
public void getTheDriving1CodeReadingSignal() {
|
|
|
-// boolean b = plcConnectServiceRunner.getPlcServer(DeviceNameEnum.DASANPANPLC.getDeviceName()).readBoolean(DaSanPanPlcEnum.ISREAD_one.getMetadata());
|
|
|
-// log.info("大散盘1号行车读码信号:{}", b);
|
|
|
-// if (b) {
|
|
|
+ boolean b = plcConnectServiceRunner.getPlcServer(DeviceNameEnum.DASANPANPLC.getDeviceName()).readBoolean(DaSanPanPlcEnum.ISREAD_one.getMetadata());
|
|
|
+ log.info("大散盘1号行车读码信号:{}", b);
|
|
|
+ if (b) {
|
|
|
processRealizationService.CodeReadingProcess("CodeReader7");
|
|
|
-// }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -125,32 +125,32 @@ public class TraceJob {
|
|
|
* 获取行车4读码信号
|
|
|
*/
|
|
|
public void getTheDriving4CodeReadingSignal() {
|
|
|
-// boolean b = plcConnectServiceRunner.getPlcServer(DeviceNameEnum.DASANPANPLC.getDeviceName()).readBoolean(DaSanPanPlcEnum.ISREAD_fourth.getMetadata());
|
|
|
-// log.info("大散盘4号行车读码信号:{}", b);
|
|
|
-// if (b) {
|
|
|
+ boolean b = plcConnectServiceRunner.getPlcServer(DeviceNameEnum.DASANPANPLC.getDeviceName()).readBoolean(DaSanPanPlcEnum.ISREAD_fourth.getMetadata());
|
|
|
+ log.info("大散盘4号行车读码信号:{}", b);
|
|
|
+ if (b) {
|
|
|
processRealizationService.CodeReadingProcess("CodeReader12");
|
|
|
-// }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取上料读码信号
|
|
|
*/
|
|
|
public void obtainTheLoadingReadingSignal() {
|
|
|
-// boolean b = plcConnectServiceRunner.getPlcServer(DeviceNameEnum.TUIHUOUPPLC.getDeviceName()).readBoolean(TuiHuoUPPlcEnum.ISREAD.getMetadata());
|
|
|
-// log.info("大散盘4号行车读码信号:{}", b);
|
|
|
-// if (b) {
|
|
|
+ boolean b = plcConnectServiceRunner.getPlcServer(DeviceNameEnum.TUIHUOUPPLC.getDeviceName()).readBoolean(TuiHuoUPPlcEnum.ISREAD.getMetadata());
|
|
|
+ log.info("大散盘4号行车读码信号:{}", b);
|
|
|
+ if (b) {
|
|
|
processRealizationService.CodeReadingProcess("CodeReader13");
|
|
|
-// }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取下料读码信号
|
|
|
*/
|
|
|
public void obtainTheUnloadingReadingSignal() {
|
|
|
-// boolean b = plcConnectServiceRunner.getPlcServer(DeviceNameEnum.TuiHuoDownPcl.getDeviceName()).readBoolean(TuiHuoDownPlcEnum.ISREAD.getMetadata());
|
|
|
-// log.info("大散盘4号行车读码信号:{}", b);
|
|
|
-// if (b) {
|
|
|
+ boolean b = plcConnectServiceRunner.getPlcServer(DeviceNameEnum.TuiHuoDownPcl.getDeviceName()).readBoolean(TuiHuoDownPlcEnum.ISREAD.getMetadata());
|
|
|
+ log.info("大散盘4号行车读码信号:{}", b);
|
|
|
+ if (b) {
|
|
|
processRealizationService.CodeReadingProcess("CodeReader14");
|
|
|
-// }
|
|
|
+ }
|
|
|
}
|
|
|
}
|