From 84f42d7198729df0823483183e9f9918db92fc17 Mon Sep 17 00:00:00 2001
From: 野心家 <1051256694@qq.com>
Date: 星期六, 11 三月 2023 15:38:53 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java | 439 ++++++++++++++++++++++++++++++++++--------------------
1 files changed, 273 insertions(+), 166 deletions(-)
diff --git a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
index f89fb2a..8a63999 100644
--- a/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -122,13 +122,12 @@
if (!Cools.isEmpty(barcode) && (staProtocol.getWorkNo() != 9998 || staProtocol.getWorkNo() != 9996)) {
log.info("{}鍙锋潯鐮佹壂鎻忓櫒妫�娴嬫潯鐮佷俊鎭細{}", inSta.getBarcode(), barcode);
if ("NG".endsWith(barcode) || "NoRead".equals(barcode)) {
+ String errorMsg = "15绔欐壂鐮佸け璐ワ紝宸查��鍥�14绔�";
staProtocol.setWorkNo((short) 9998);
staProtocol.setStaNo((short) 14);
devpThread.setPakMk(staProtocol.getSiteId(), false);
- MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol));
// led 寮傚父鏄剧ず
if (ledThread != null) {
- String errorMsg = "鎵爜澶辫触锛岃閲嶈瘯";
News.error(methodName + ":鎵爜澶辫触锛岃閲嶈瘯");
MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errorMsg));
}
@@ -137,16 +136,6 @@
} else {
continue;
}
-
- // 鑾峰彇鍏ュ簱绔欎俊鎭�
-// SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId());
-
-
- // 鍏ュ嚭搴撴ā寮忓垽鏂�
-// if ( inSta.getStaNo()==203 && devpThread.ioModeOf2F != IoModeType.PAKIN_MODE) { continue; }
-// if (inSta.getStaNo() == 203 && devpThread.ioModeOf2F == IoModeType.PAKOUT_MODE) {
-// continue;
-// }
// 鍒ゆ柇鏄惁婊¤冻鍏ュ簱鏉′欢
if (staProtocol.isAutoing()
@@ -173,6 +162,10 @@
WrkMast wrkMast = wrkMastMapper.selectPakInStep1(inSta.getStaNo(), barcode);
if (wrkMast != null) {
News.error(methodName + ":宸ヤ綔妗d腑宸插瓨鍦ㄨ绔欑姸鎬佷负锛� 2.璁惧涓婅蛋 锛夌殑鏁版嵁,宸ヤ綔鍙�={}", wrkMast.getWrkNo());
+ if (ledThread != null) {
+ News.error(methodName + ":鎵爜澶辫触锛岃閲嶈瘯");
+ MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, "宸ヤ綔妗d腑宸插瓨鍦ㄨ绔欑姸鎬佷负锛� 2.璁惧涓婅蛋 锛夌殑鏁版嵁,宸ヤ綔鍙�={"+ wrkMast.getWrkNo() + "}, 璇锋墜鍔ㄥ彇娑堝凡瀛樺湪宸ヤ綔妗�"));
+ }
continue;
}
@@ -213,10 +206,7 @@
throw new CoolException("鏇存柊plc绔欑偣淇℃伅澶辫触");
}
- if (ledThread != null) {
- String successMsg = "鍏ュ簱宸ヤ綔妗�--宸ヤ綔鍙�:" + dto.getWorkNo() + " 鐩爣搴撲綅:" + dto.getLocNo();
- MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, successMsg));
- }
+
} else {
staProtocol.setWorkNo((short) 9998);
staProtocol.setStaNo((short) 14);
@@ -325,9 +315,9 @@
}
// // 鍏ュ嚭搴撴ā寮忓垽鏂�
- if (inSta.getStaNo() == 203 && devpThread.ioModeOf2F != IoModeType.PAKIN_MODE) {
- continue;
- }
+// if (inSta.getStaNo() == 203 && devpThread.ioModeOf2F != IoModeType.PAKIN_MODE) {
+// continue;
+// }
// 鍒ゆ柇鏄惁婊¤冻鍏ュ簱鏉′欢
if (staProtocol.isAutoing() && staProtocol.isLoading() && staProtocol.isInEnable()
@@ -527,8 +517,35 @@
String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
for (CrnSlave crnSlave : slaveProperties.getCrn()) {
- // 閬嶅巻鍫嗗灈鏈哄嚭搴撶珯
- for (CrnSlave.CrnStn crnStn : crnSlave.getCrnOutStn()) {
+ //鏌ヨ宸ヤ綔妗�
+ List<WrkMast> wrkMasts= wrkMastService.selectList(new EntityWrapper<WrkMast>()
+ .eq("crn_no",crnSlave.getCrnOutStn())
+ .and()
+ .gt("io_type",100)
+ .orderBy("appe_time")
+ );
+ if(Cools.isEmpty(wrkMasts)){
+ continue;
+ }
+ //閬嶅巻浠诲姟妗o紝鎸夌敓鎴愭椂闂磋繘琛屾帓搴�
+ for (WrkMast wrkMast: wrkMasts) {
+ // 鍒ゆ柇宸ヤ綔妗f潯浠�
+ if (wrkMast.getStaNo() == null || wrkMast.getSourceStaNo() == null) {
+ continue;
+ }
+ CrnSlave.CrnStn crnStn = null;
+ for (CrnSlave.CrnStn crnStn1 : crnSlave.getCrnOutStn()) {
+ if (crnStn1.getStaNo() == wrkMast.getSourceStaNo()) {
+ crnStn = crnStn1;
+ break;
+ } else {
+ continue;
+ }
+ }
+ if (Cools.isEmpty(crnStn)) {
+ continue;
+ }
+
// 鑾峰彇鍫嗗灈鏈哄嚭搴撶珯淇℃伅
DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, crnStn.getDevpPlcId());
StaProtocol staProtocol = devpThread.getStation().get(crnStn.getStaNo());
@@ -538,15 +555,8 @@
staProtocol = staProtocol.clone();
}
if (staProtocol.isAutoing() && staProtocol.isLoading() && (staProtocol.getWorkNo() == 0 || staProtocol.getStaNo() == null)) {
- // 鏌ヨ宸ヤ綔妗�
- WrkMast wrkMast = wrkMastMapper.selectPakOutStep2(staProtocol.getSiteId());
- if (wrkMast == null) {
- continue;
- }
- // 鍒ゆ柇宸ヤ綔妗f潯浠�
- if (wrkMast.getIoType() < 100 || wrkMast.getStaNo() == null || wrkMast.getSourceStaNo() == null) {
- continue;
- }
+
+
// 鍒ゆ柇鍚婅溅鏄惁瀹為檯宸插畬鎴愶紝涓旂數鑴戠姸鎬佸湪move涓紝浠ュ鐢佃剳杩涜鏇存柊宸ヤ綔妗�
CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn, wrkMast.getCrnNo());
CrnProtocol crnProtocol = crnThread.getCrnProtocol();
@@ -584,6 +594,68 @@
}
}
}
+
+// public synchronized void crnStnToOutStn1() {
+// String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
+//
+// for (CrnSlave crnSlave : slaveProperties.getCrn()) {
+// // 閬嶅巻鍫嗗灈鏈哄嚭搴撶珯
+// for (CrnSlave.CrnStn crnStn : crnSlave.getCrnOutStn()) {
+// // 鑾峰彇鍫嗗灈鏈哄嚭搴撶珯淇℃伅
+// DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, crnStn.getDevpPlcId());
+// StaProtocol staProtocol = devpThread.getStation().get(crnStn.getStaNo());
+// if (staProtocol == null) {
+// continue;
+// } else {
+// staProtocol = staProtocol.clone();
+// }
+// if (staProtocol.isAutoing() && staProtocol.isLoading() && (staProtocol.getWorkNo() == 0 || staProtocol.getStaNo() == null)) {
+// // 鏌ヨ宸ヤ綔妗�
+// WrkMast wrkMast = wrkMastMapper.selectPakOutStep2(staProtocol.getSiteId());
+// if (wrkMast == null) {
+// continue;
+// }
+// // 鍒ゆ柇宸ヤ綔妗f潯浠�
+// if (wrkMast.getIoType() < 100 || wrkMast.getStaNo() == null || wrkMast.getSourceStaNo() == null) {
+// continue;
+// }
+// // 鍒ゆ柇鍚婅溅鏄惁瀹為檯宸插畬鎴愶紝涓旂數鑴戠姸鎬佸湪move涓紝浠ュ鐢佃剳杩涜鏇存柊宸ヤ綔妗�
+// CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn, wrkMast.getCrnNo());
+// CrnProtocol crnProtocol = crnThread.getCrnProtocol();
+// if (crnProtocol.statusType == CrnStatusType.FETCHING || crnProtocol.statusType == CrnStatusType.PUTTING) {
+// // 绉诲姩涓�
+// continue;
+// }
+// // 鍒ゆ柇鍫嗗灈鏈虹姸鎬佺瓑寰呯‘璁�
+// if (crnProtocol.modeType == CrnModeType.AUTO && crnProtocol.getTaskNo().equals(wrkMast.getWrkNo().shortValue())
+// && crnProtocol.statusType == CrnStatusType.WAITING
+// && crnProtocol.forkPosType == CrnForkPosType.HOME) {
+//
+// // 鍛戒护涓嬪彂鍖� --------------------------------------------------------------------------
+//
+// // 涓嬪彂绔欑偣淇℃伅
+// staProtocol.setWorkNo(wrkMast.getWrkNo().shortValue());
+// staProtocol.setStaNo(wrkMast.getStaNo().shortValue());
+// if (!MessageQueue.offer(SlaveType.Devp, crnStn.getDevpPlcId(), new Task(2, staProtocol))) {
+// continue;
+// }
+//
+// // 鏇存柊宸ヤ綔妗g姸鎬佷负14澶辫触
+// wrkMast.setWrkSts(14L);
+// wrkMast.setCrnEndTime(new Date());
+// if (wrkMastMapper.updateById(wrkMast) != 0) {
+// // 澶嶄綅鍫嗗灈鏈�
+// crnThread.setResetFlag(true);
+// } else {
+// News.error(methodName + ":鏇存柊宸ヤ綔妗g殑宸ヤ綔鐘舵�佷负14澶辫触锛侊紒锛� [宸ヤ綔鍙�:{}]", wrkMast.getWrkNo());
+// }
+//
+// }
+//
+// }
+// }
+// }
+// }
/**
* 鍏ュ嚭搴� ===>> 鍫嗗灈鏈哄叆鍑哄簱浣滀笟涓嬪彂
@@ -871,9 +943,9 @@
// // 鍏ュ嚭搴撴ā寮忓垽鏂�
// if (devpThread.ioMode != IoModeType.PAKOUT_MODE) { continue; }
- if (wrkMast.getStaNo() == 204 && devpThread.ioModeOf2F != IoModeType.PAKOUT_MODE) {
- continue;
- }
+// if (wrkMast.getStaNo() == 204 && devpThread.ioModeOf2F != IoModeType.PAKOUT_MODE) {
+// continue;
+// }
// 鏌ヨ绔欑偣璇︾粏淇℃伅
BasDevp staDetl = basDevpService.selectById(crnStn.getStaNo());
@@ -1498,109 +1570,144 @@
* 鍑哄簱 ===>> 宸ヤ綔妗d俊鎭啓鍏ed鏄剧ず鍣�
*/
public synchronized void ledExecute() {
- String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
+// String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
for (LedSlave led : slaveProperties.getLed()) {
// 鑾峰彇杈撻�佺嚎plc绾跨▼
DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, led.getDevpPlcId());
- // 鍛戒护闆嗗悎
- List<LedCommand> commands = new ArrayList<>();
- // 宸ヤ綔妗i泦鍚�
- List<WrkMast> wrkMasts = new ArrayList<>();
+// // 鍛戒护闆嗗悎
+// List<LedCommand> commands = new ArrayList<>();
+// // 宸ヤ綔妗i泦鍚�
+// List<WrkMast> wrkMasts = new ArrayList<>();
for (Integer staNo : led.getStaArr()) {
// 鑾峰彇鍙夎溅绔欑偣
StaProtocol staProtocol = devpThread.getStation().get(staNo);
if (null == staProtocol || null == staProtocol.getWorkNo() || 0 == staProtocol.getWorkNo() || !staProtocol.isLoading()) {
+ MessageQueue.offer(SlaveType.Led, led.getId(), new Task(3, ""));
continue;
} else {
staProtocol = staProtocol.clone();
}
// 鑾峰彇宸ヤ綔妗f暟鎹�
WrkMast wrkMast = wrkMastMapper.selectById(staProtocol.getWorkNo());
-// if (null == wrkMast || wrkMast.getWrkSts() < 14 || wrkMast.getIoType() < 100) { continue; }
if (null == wrkMast) {
+ MessageQueue.offer(SlaveType.Led, led.getId(), new Task(3, ""));
continue;
}
- wrkMasts.add(wrkMast);
- // 缁勮鍛戒护
+ ArrayList<MatDto> matDtos = new ArrayList<>();
+ Wrapper<WrkDetl> detlWrapper = new EntityWrapper<WrkDetl>()
+ .eq("wrk_no", wrkMast.getWrkNo());
LedCommand ledCommand = new LedCommand();
ledCommand.setWorkNo(wrkMast.getWrkNo());
+ ledCommand.setStaNo(wrkMast.getStaNo());
+ ledCommand.setSourceStaNo(wrkMast.getSourceStaNo());
+ ledCommand.setLocNo(wrkMast.getLocNo());
+ ledCommand.setSourceLocNo(wrkMast.getSourceLocNo());
ledCommand.setIoType(wrkMast.getIoType());
- // 鍑哄簱妯″紡
- switch (wrkMast.getIoType()) {
- case -1:
- ledCommand.setTitle("鍏ㄦ澘鍏ュ簱");
- break;
+ ledCommand.setTitle(wrkMast.getIoType$());
+
+ switch (wrkMast.getIoType()){
case 10:
- ledCommand.setTitle("绌烘澘鍏ュ簱");
- break;
- case 10-1:
- ledCommand.setTitle("鍏ㄦ澘鍑哄簱");
- break;
- case 103:
- ledCommand.setTitle("鎷f枡鍑哄簱");
- break;
- case 104:
- ledCommand.setTitle("骞舵澘鍑哄簱");
- break;
- case 107:
- ledCommand.setTitle("鐩樼偣鍑哄簱");
- break;
case 110:
- ledCommand.setTitle("绌烘澘鍑哄簱");
ledCommand.setEmptyMk(true);
break;
default:
- News.error(methodName + ":浠诲姟鍏ュ嚭搴撶被鍨嬮敊璇紒锛侊紒[宸ヤ綔鍙凤細{}] [鍏ュ嚭搴撶被鍨嬶細{}]", wrkMast.getWrkNo(), wrkMast.getIoType());
+ ledCommand.setBarcode(wrkMast.getBarcode());
+ List<WrkDetl> wrkDetls = wrkDetlService.selectList(detlWrapper);
+ for (WrkDetl wrkDetl : wrkDetls) {
+ MatDto matDto = new MatDto();
+ matDto.setMaknx(wrkDetl.getMaktx());
+ matDto.setMatNo(wrkDetl.getMatnr());
+ matDto.setCount(wrkDetl.getAnfme());
+ matDtos.add(matDto);
+ }
break;
+
+
}
- ledCommand.setSourceLocNo(wrkMast.getSourceLocNo());
- ledCommand.setLocNo(wrkMast.getLocNo());
- ledCommand.setStaNo(wrkMast.getStaNo());
-// ledCommand.setSourceStaNo(wrkMast.getSourceStaNo());
- if (wrkMast.getIoType() != 110 && wrkMast.getIoType() != 10) {
- List<WrkDetl> wrkDetls = wrkDetlService.findByWorkNo(wrkMast.getWrkNo());
- wrkDetls.forEach(wrkDetl -> ledCommand.getMatDtos().add(new MatDto(wrkDetl.getMatnr(), wrkDetl.getMaktx(), wrkDetl.getAnfme())));
- }
- commands.add(ledCommand);
- }
- Set<Integer> workNos = wrkMasts.stream().map(WrkMast::getWrkNo).collect(Collectors.toSet());
- // 鑾峰彇LED绾跨▼
- LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, led.getId());
- // 鐩稿悓宸ヤ綔鍙烽泦鍚堝垯杩囨护
-// if (CollectionUtils.equals(ledThread.getWorkNos(), workNos)) {
-// continue;
+ ledCommand.setMatDtos(matDtos);
+ MessageQueue.offer(SlaveType.Led, led.getId(), new Task(3, ledCommand.toString()));
+
+// wrkMasts.add(wrkMast);
+// // 缁勮鍛戒护
+// LedCommand ledCommand = new LedCommand();
+// ledCommand.setWorkNo(wrkMast.getWrkNo());
+// ledCommand.setIoType(wrkMast.getIoType());
+// // 鍑哄簱妯″紡
+// switch (wrkMast.getIoType()) {
+// case -1:
+// ledCommand.setTitle("鍏ㄦ澘鍏ュ簱");
+// break;
+// case 10:
+// ledCommand.setTitle("绌烘澘鍏ュ簱");
+// break;
+// case 10-1:
+// ledCommand.setTitle("鍏ㄦ澘鍑哄簱");
+// break;
+// case 103:
+// ledCommand.setTitle("鎷f枡鍑哄簱");
+// break;
+// case 104:
+// ledCommand.setTitle("骞舵澘鍑哄簱");
+// break;
+// case 107:
+// ledCommand.setTitle("鐩樼偣鍑哄簱");
+// break;
+// case 110:
+// ledCommand.setTitle("绌烘澘鍑哄簱");
+// ledCommand.setEmptyMk(true);
+// break;
+// default:
+// News.error(methodName + ":浠诲姟鍏ュ嚭搴撶被鍨嬮敊璇紒锛侊紒[宸ヤ綔鍙凤細{}] [鍏ュ嚭搴撶被鍨嬶細{}]", wrkMast.getWrkNo(), wrkMast.getIoType());
+// break;
+// }
+// ledCommand.setSourceLocNo(wrkMast.getSourceLocNo());
+// ledCommand.setLocNo(wrkMast.getLocNo());
+// ledCommand.setStaNo(wrkMast.getStaNo());
+//// ledCommand.setSourceStaNo(wrkMast.getSourceStaNo());
+// if (wrkMast.getIoType() != 110 && wrkMast.getIoType() != 10) {
+// List<WrkDetl> wrkDetls = wrkDetlService.findByWorkNo(wrkMast.getWrkNo());
+// wrkDetls.forEach(wrkDetl -> ledCommand.getMatDtos().add(new MatDto(wrkDetl.getMatnr(), wrkDetl.getMaktx(), wrkDetl.getAnfme())));
+// }
+// commands.add(ledCommand);
// }
- // 鍛戒护涓嬪彂 -------------------------------------------------------------------------------
- if (!commands.isEmpty()) {
- String errMsg = "";
- if (!MessageQueue.offer(SlaveType.Led, led.getId(), new Task(3, commands))) {
- News.error(methodName + ":{}鍙稬ED鍛戒护涓嬪彂澶辫触锛侊紒锛乕ip锛歿}] [port锛歿}]", led.getId(), led.getIp(), led.getPort());
- continue;
- } else {
- ledThread.setLedMk(false);
- }
-
-
+// Set<Integer> workNos = wrkMasts.stream().map(WrkMast::getWrkNo).collect(Collectors.toSet());
+// // 鑾峰彇LED绾跨▼
+// LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, led.getId());
+// // 鐩稿悓宸ヤ綔鍙烽泦鍚堝垯杩囨护
+//// if (CollectionUtils.equals(ledThread.getWorkNos(), workNos)) {
+//// continue;
+//// }
+// // 鍛戒护涓嬪彂 -------------------------------------------------------------------------------
+// if (!commands.isEmpty()) {
+// String errMsg = "";
+// if (!MessageQueue.offer(SlaveType.Led, led.getId(), new Task(3, commands))) {
+// News.error(methodName + ":{}鍙稬ED鍛戒护涓嬪彂澶辫触锛侊紒锛乕ip锛歿}] [port锛歿}]", led.getId(), led.getIp(), led.getPort());
+// continue;
+// } else {
+// ledThread.setLedMk(false);
+// }
+//
+//
}
-
- try {
- // 淇敼涓绘。led鏍囪
- for (WrkMast wrkMast : wrkMasts) {
- wrkMast.setOveMk("Y");
- wrkMast.setModiTime(new Date());
- if (wrkMastMapper.updateById(wrkMast) == 0) {
- throw new CoolException("鏇存柊宸ヤ綔妗eけ璐�");
- }
- }
-
- // 鏇存柊绾跨▼褰撳墠宸ヤ綔鍙烽泦鍚�
- ledThread.setWorkNos(workNos);
-
- } catch (Exception e) {
- e.printStackTrace();
- TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
- }
+//
+// try {
+// // 淇敼涓绘。led鏍囪
+// for (WrkMast wrkMast : wrkMasts) {
+// wrkMast.setOveMk("Y");
+// wrkMast.setModiTime(new Date());
+// if (wrkMastMapper.updateById(wrkMast) == 0) {
+// throw new CoolException("鏇存柊宸ヤ綔妗eけ璐�");
+// }
+// }
+//
+// // 鏇存柊绾跨▼褰撳墠宸ヤ綔鍙烽泦鍚�
+// ledThread.setWorkNos(workNos);
+//
+// } catch (Exception e) {
+// e.printStackTrace();
+// TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+// }
}
}
@@ -2033,65 +2140,65 @@
/**
* 鍏ュ嚭搴撴ā寮忓垏鎹㈠嚱鏁�
*/
- public synchronized void ioConvert() {
- try {
- // 鏍规嵁杈撻�佺嚎plc閬嶅巻
- for (DevpSlave devp : slaveProperties.getDevp()) {
- SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId());
-
- for (DevpSlave.Sta inSta : devp.getInSta()) {
- if (inSta.getStaNo() == 2) {
- continue;
- }
- WrkMast pakout = wrkMastMapper.selectWorkingPakout(inSta.getStaNo());
- switch (inSta.getStaNo()) {
- case 203://1F
- if (pakout != null) {
- if (devpThread.ioModeOf2F != IoModeType.PAKOUT_MODE) {
- // 鍑哄簱鍒囨崲涓�
- devpThread.ioModeOf2F = IoModeType.PAKOUT_BOOTING;
- WrkMast pakin = wrkMastMapper.selectWorkingPakin(inSta.getStaNo());
- if (pakin == null && !devpThread.getStation().get(inSta.getStaNo()).isLoading()
- && !devpThread.getStation().get(inSta.getStaNo() + 1).isLoading()
- && devpThread.getStation().get(inSta.getStaNo() + 1).getWorkNo() == 0) {
- // 鍑哄簱妯″紡
- devpThread.ioModeOf2F = IoModeType.PAKOUT_MODE;
- }
- }
- } else {
- // 鍏ュ簱妯″紡
- devpThread.ioModeOf2F = IoModeType.PAKIN_MODE;
- }
- break;
- case 401://1F
- if (pakout != null) {
- if (devpThread.ioModeOf4F != IoModeType.PAKOUT_MODE) {
- // 鍑哄簱鍒囨崲涓�
- devpThread.ioModeOf4F = IoModeType.PAKOUT_BOOTING;
- WrkMast pakin = wrkMastMapper.selectWorkingPakin(inSta.getStaNo());
- if (pakin == null && !devpThread.getStation().get(inSta.getStaNo()).isLoading()
- && !devpThread.getStation().get(inSta.getStaNo() + 1).isLoading()
- && devpThread.getStation().get(inSta.getStaNo() + 1).getWorkNo() == 0) {
- // 鍑哄簱妯″紡
- devpThread.ioModeOf4F = IoModeType.PAKOUT_MODE;
- }
- }
- } else {
- // 鍏ュ簱妯″紡
- devpThread.ioModeOf4F = IoModeType.PAKIN_MODE;
- }
- break;
- }
- }
-
- }
-
- } catch (Exception e) {
- e.printStackTrace();
- }
-
-
- }
+// public synchronized void ioConvert() {
+// try {
+// // 鏍规嵁杈撻�佺嚎plc閬嶅巻
+// for (DevpSlave devp : slaveProperties.getDevp()) {
+// SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId());
+//
+// for (DevpSlave.Sta inSta : devp.getInSta()) {
+// if (inSta.getStaNo() == 2) {
+// continue;
+// }
+// WrkMast pakout = wrkMastMapper.selectWorkingPakout(inSta.getStaNo());
+// switch (inSta.getStaNo()) {
+// case 203://1F
+// if (pakout != null) {
+// if (devpThread.ioModeOf2F != IoModeType.PAKOUT_MODE) {
+// // 鍑哄簱鍒囨崲涓�
+// devpThread.ioModeOf2F = IoModeType.PAKOUT_BOOTING;
+// WrkMast pakin = wrkMastMapper.selectWorkingPakin(inSta.getStaNo());
+// if (pakin == null && !devpThread.getStation().get(inSta.getStaNo()).isLoading()
+// && !devpThread.getStation().get(inSta.getStaNo() + 1).isLoading()
+// && devpThread.getStation().get(inSta.getStaNo() + 1).getWorkNo() == 0) {
+// // 鍑哄簱妯″紡
+// devpThread.ioModeOf2F = IoModeType.PAKOUT_MODE;
+// }
+// }
+// } else {
+// // 鍏ュ簱妯″紡
+// devpThread.ioModeOf2F = IoModeType.PAKIN_MODE;
+// }
+// break;
+// case 401://1F
+// if (pakout != null) {
+// if (devpThread.ioModeOf4F != IoModeType.PAKOUT_MODE) {
+// // 鍑哄簱鍒囨崲涓�
+// devpThread.ioModeOf4F = IoModeType.PAKOUT_BOOTING;
+// WrkMast pakin = wrkMastMapper.selectWorkingPakin(inSta.getStaNo());
+// if (pakin == null && !devpThread.getStation().get(inSta.getStaNo()).isLoading()
+// && !devpThread.getStation().get(inSta.getStaNo() + 1).isLoading()
+// && devpThread.getStation().get(inSta.getStaNo() + 1).getWorkNo() == 0) {
+// // 鍑哄簱妯″紡
+// devpThread.ioModeOf4F = IoModeType.PAKOUT_MODE;
+// }
+// }
+// } else {
+// // 鍏ュ簱妯″紡
+// devpThread.ioModeOf4F = IoModeType.PAKIN_MODE;
+// }
+// break;
+// }
+// }
+//
+// }
+//
+// } catch (Exception e) {
+// e.printStackTrace();
+// }
+//
+//
+// }
public synchronized void outOfDevp() {
List<WrkMast> wrkMasts = wrkMastMapper.selectPick();
--
Gitblit v1.9.1