更新
This commit is contained in:
@@ -448,16 +448,18 @@ public class MagicAgvServiceImpl implements MagicAgvService {
|
||||
lnshStationDeviceDriver = (LnshStationDeviceDriver) addressdevice.getDeviceDriver();
|
||||
//请求取货
|
||||
if ("Load".equals(action)) {
|
||||
if (lnshStationDeviceDriver.getMode() == 2 && lnshStationDeviceDriver.getMove() > 0) {
|
||||
if (lnshStationDeviceDriver.getMode() != 0 && lnshStationDeviceDriver.getMove() > 0) {
|
||||
inst.setExecute_status("1");
|
||||
lnshStationDeviceDriver.setFlag(1);
|
||||
// lnshStationDeviceDriver.setFlag(1);
|
||||
lnshStationDeviceDriver.writing(5);
|
||||
is_feedback = true;
|
||||
}
|
||||
//请求放货
|
||||
} else if ("Unload".equals(action)) {
|
||||
if (lnshStationDeviceDriver.getMode() == 2 && lnshStationDeviceDriver.getMove() == 0) {
|
||||
if (lnshStationDeviceDriver.getMode() != 0 && lnshStationDeviceDriver.getMove() == 0) {
|
||||
inst.setExecute_status("3");
|
||||
lnshStationDeviceDriver.setFlag(3);
|
||||
// lnshStationDeviceDriver.setFlag(3);
|
||||
lnshStationDeviceDriver.writing(6);
|
||||
is_feedback = true;
|
||||
}
|
||||
} else if ("NOP".equals(action)) {
|
||||
@@ -483,16 +485,14 @@ public class MagicAgvServiceImpl implements MagicAgvService {
|
||||
lnshLaminatingMachineDeviceDriver = (LnshLaminatingMachineDeviceDriver) addressdevice.getDeviceDriver();
|
||||
//请求取货
|
||||
if ("Load".equals(action)) {
|
||||
if (lnshLaminatingMachineDeviceDriver.getMode() == 2 && lnshLaminatingMachineDeviceDriver.getMove() > 0) {
|
||||
if (lnshLaminatingMachineDeviceDriver.getMode() != 0 && lnshLaminatingMachineDeviceDriver.getMove() > 0) {
|
||||
inst.setExecute_status("1");
|
||||
lnshLaminatingMachineDeviceDriver.setFlag(1);
|
||||
is_feedback = true;
|
||||
}
|
||||
//请求放货
|
||||
} else if ("Unload".equals(action)) {
|
||||
if (lnshLaminatingMachineDeviceDriver.getMode() == 2 && lnshLaminatingMachineDeviceDriver.getMove() == 0) {
|
||||
if (lnshLaminatingMachineDeviceDriver.getMode() != 0 && lnshLaminatingMachineDeviceDriver.getMove() == 0) {
|
||||
inst.setExecute_status("3");
|
||||
lnshLaminatingMachineDeviceDriver.setFlag(3);
|
||||
is_feedback = true;
|
||||
}
|
||||
} else if ("NOP".equals(action)) {
|
||||
@@ -520,14 +520,14 @@ public class MagicAgvServiceImpl implements MagicAgvService {
|
||||
if ("Load".equals(action)) {
|
||||
if (lnshPalletizingManipulatorSiteDeviceDriver.getMode() == 2 && lnshPalletizingManipulatorSiteDeviceDriver.getMove() > 0) {
|
||||
inst.setExecute_status("1");
|
||||
lnshPalletizingManipulatorSiteDeviceDriver.setFlag(1);
|
||||
lnshPalletizingManipulatorSiteDeviceDriver.writing(12);
|
||||
is_feedback = true;
|
||||
}
|
||||
//请求放货
|
||||
} else if ("Unload".equals(action)) {
|
||||
if (lnshPalletizingManipulatorSiteDeviceDriver.getMode() == 2 && lnshPalletizingManipulatorSiteDeviceDriver.getMove() == 0) {
|
||||
inst.setExecute_status("3");
|
||||
lnshPalletizingManipulatorSiteDeviceDriver.setFlag(3);
|
||||
lnshPalletizingManipulatorSiteDeviceDriver.writing(13);
|
||||
is_feedback = true;
|
||||
}
|
||||
}
|
||||
@@ -587,18 +587,39 @@ public class MagicAgvServiceImpl implements MagicAgvService {
|
||||
lnshStationDeviceDriver = (LnshStationDeviceDriver) addressdevice.getDeviceDriver();
|
||||
//取货完成
|
||||
if ("Load".equals(action)) {
|
||||
if (lnshStationDeviceDriver.getMode() == 2 && lnshStationDeviceDriver.getMove() == 0) {
|
||||
if (lnshStationDeviceDriver.getMode() != 0 && lnshStationDeviceDriver.getMove() == 0) {
|
||||
inst.setExecute_device_code(processingVehicle);
|
||||
inst.setExecute_status("2");
|
||||
lnshStationDeviceDriver.setFlag(2);
|
||||
lnshStationDeviceDriver.writing(2);
|
||||
is_feedback = true;
|
||||
}
|
||||
//放货完成
|
||||
} else if ("Unload".equals(action)) {
|
||||
if (lnshStationDeviceDriver.getMode() == 2 && lnshStationDeviceDriver.getMove() > 0) {
|
||||
if (lnshStationDeviceDriver.getMode() != 0 && lnshStationDeviceDriver.getMove() > 0) {
|
||||
inst.setExecute_device_code(address);
|
||||
inst.setExecute_status("4");
|
||||
lnshStationDeviceDriver.setFlag(4);
|
||||
lnshStationDeviceDriver.writing(3);
|
||||
is_feedback = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
//嘉耐缓存货架
|
||||
if (addressdevice.getDeviceDriver() instanceof LnshLaminatingMachineDeviceDriver) {
|
||||
lnshLaminatingMachineDeviceDriver = (LnshLaminatingMachineDeviceDriver) addressdevice.getDeviceDriver();
|
||||
//取货完成
|
||||
if ("Load".equals(action)) {
|
||||
if (lnshLaminatingMachineDeviceDriver.getMode() != 0 && lnshLaminatingMachineDeviceDriver.getMove() == 0) {
|
||||
inst.setExecute_device_code(processingVehicle);
|
||||
inst.setExecute_status("2");
|
||||
lnshLaminatingMachineDeviceDriver.writing(2);
|
||||
is_feedback = true;
|
||||
}
|
||||
//放货完成
|
||||
} else if ("Unload".equals(action)) {
|
||||
if (lnshLaminatingMachineDeviceDriver.getMode() != 0 && lnshLaminatingMachineDeviceDriver.getMove() > 0) {
|
||||
inst.setExecute_device_code(address);
|
||||
inst.setExecute_status("4");
|
||||
lnshLaminatingMachineDeviceDriver.writing(3);
|
||||
is_feedback = true;
|
||||
}
|
||||
}
|
||||
@@ -611,7 +632,7 @@ public class MagicAgvServiceImpl implements MagicAgvService {
|
||||
if (lnshPalletizingManipulatorSiteDeviceDriver.getMode() == 2 && lnshPalletizingManipulatorSiteDeviceDriver.getMove() == 0) {
|
||||
inst.setExecute_device_code(processingVehicle);
|
||||
inst.setExecute_status("2");
|
||||
lnshPalletizingManipulatorSiteDeviceDriver.setFlag(2);
|
||||
lnshPalletizingManipulatorSiteDeviceDriver.writing(10);
|
||||
is_feedback = true;
|
||||
}
|
||||
//放货完成
|
||||
@@ -619,7 +640,7 @@ public class MagicAgvServiceImpl implements MagicAgvService {
|
||||
if (lnshPalletizingManipulatorSiteDeviceDriver.getMode() == 2 && lnshPalletizingManipulatorSiteDeviceDriver.getMove() > 0) {
|
||||
inst.setExecute_device_code(address);
|
||||
inst.setExecute_status("4");
|
||||
lnshPalletizingManipulatorSiteDeviceDriver.setFlag(4);
|
||||
lnshPalletizingManipulatorSiteDeviceDriver.writing(11);
|
||||
is_feedback = true;
|
||||
}
|
||||
}
|
||||
@@ -730,6 +751,7 @@ public class MagicAgvServiceImpl implements MagicAgvService {
|
||||
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver;
|
||||
StandardStorageDeviceDriver standardStorageDeviceDriver;
|
||||
LnshStationDeviceDriver lnshStationDeviceDriver;
|
||||
LnshPalletizingManipulatorSiteDeviceDriver lnshPalletizingManipulatorSiteDeviceDriver;
|
||||
|
||||
//mes = AgvClientXZ.mes(zlbh, device, type);
|
||||
//暂定 0就绪 1请求取货 2取货完成 3请求放货 4放货完成 5取货完成离开 6放货完成离开 7请求进入区域 8请求离开区域
|
||||
@@ -759,22 +781,41 @@ public class MagicAgvServiceImpl implements MagicAgvService {
|
||||
|
||||
if (addressdevice.getDeviceDriver() instanceof LnshStationDeviceDriver) {
|
||||
lnshStationDeviceDriver = (LnshStationDeviceDriver) addressdevice.getDeviceDriver();
|
||||
flag = true;
|
||||
// flag = true;
|
||||
log.info("agvstatus:" + lnshStationDeviceDriver.getFlag() + "");
|
||||
//取货完成离开
|
||||
if (lnshStationDeviceDriver.getFlag() == 2) {
|
||||
// if (lnshStationDeviceDriver.getFlag() == 1) {
|
||||
if (lnshStationDeviceDriver.getMove() == 0) {
|
||||
flag = true;
|
||||
lnshStationDeviceDriver.setFlag(5);
|
||||
lnshStationDeviceDriver.writing(2);
|
||||
}
|
||||
}
|
||||
// }
|
||||
//放货完成离开
|
||||
if (lnshStationDeviceDriver.getFlag() == 4) {
|
||||
// if (lnshStationDeviceDriver.getFlag() == 3) {
|
||||
if (lnshStationDeviceDriver.getMove() == 1) {
|
||||
flag = true;
|
||||
lnshStationDeviceDriver.setFlag(6);
|
||||
lnshStationDeviceDriver.writing(3);
|
||||
}
|
||||
}
|
||||
// }
|
||||
}
|
||||
if (addressdevice.getDeviceDriver() instanceof LnshPalletizingManipulatorSiteDeviceDriver) {
|
||||
lnshPalletizingManipulatorSiteDeviceDriver = (LnshPalletizingManipulatorSiteDeviceDriver) addressdevice.getDeviceDriver();
|
||||
// flag = true;
|
||||
log.info("agvstatus:" + lnshPalletizingManipulatorSiteDeviceDriver.getFlag() + "");
|
||||
//取货完成离开
|
||||
// if (lnshPalletizingManipulatorSiteDeviceDriver.getFlag() == 1) {
|
||||
if (lnshPalletizingManipulatorSiteDeviceDriver.getMove() == 0) {
|
||||
flag = true;
|
||||
lnshPalletizingManipulatorSiteDeviceDriver.writing(10);
|
||||
}
|
||||
// }
|
||||
//放货完成离开
|
||||
// if (lnshPalletizingManipulatorSiteDeviceDriver.getFlag() == 3) {
|
||||
if (lnshPalletizingManipulatorSiteDeviceDriver.getMove() == 1) {
|
||||
flag = true;
|
||||
lnshPalletizingManipulatorSiteDeviceDriver.writing(11);
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
if (addressdevice.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
||||
|
||||
@@ -212,13 +212,13 @@ public class LnshLaminatingMachineDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
|
||||
switch (flag) {
|
||||
//取货完成
|
||||
case 1:
|
||||
writing(2);
|
||||
return;
|
||||
//放货完成
|
||||
case 2:
|
||||
writing(3);
|
||||
return;
|
||||
// case 1:
|
||||
// writing(2);
|
||||
// return;
|
||||
// //放货完成
|
||||
// case 2:
|
||||
// writing(3);
|
||||
// return;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -98,6 +98,7 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
|
||||
//暂定 0就绪 1请求取货 2取货完成 3请求放货 4放货完成 5取货完成离开 6放货完成离开 7请求进入区域 8请求离开区域
|
||||
int flag;
|
||||
int last_flag;
|
||||
|
||||
String message;
|
||||
int weight = 0;
|
||||
@@ -182,6 +183,26 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
logServer.deviceItemValue(this.device_code,"specifications", specifications);
|
||||
logServer.deviceExecuteLog(this.device_code,"","","信号specifications:" + last_specifications + "->" + specifications);
|
||||
}
|
||||
// if (flag != last_flag) {
|
||||
// switch (flag) {
|
||||
// //请求取货
|
||||
// case 1:
|
||||
// writing(5);
|
||||
// return;
|
||||
// //取货完成
|
||||
// case 2:
|
||||
// writing(2);
|
||||
// return;
|
||||
// //请求放货
|
||||
// case 3:
|
||||
// writing(6);
|
||||
// return;
|
||||
// //放货完成
|
||||
// case 4:
|
||||
// writing(3);
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
|
||||
} catch (Exception var17) {
|
||||
return;
|
||||
@@ -233,7 +254,7 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
case 6:
|
||||
//申请入库
|
||||
if (!requireSucess && this.move != 0) {
|
||||
putStorage();
|
||||
putStorage("1");
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
@@ -254,26 +275,32 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
outKiln();
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
//送空托盘
|
||||
if (!requireSucess && this.move != 0) {
|
||||
putStorage("3");
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
switch (flag) {
|
||||
//请求取货
|
||||
case 1:
|
||||
writing(5);
|
||||
return;
|
||||
//取货完成
|
||||
case 2:
|
||||
writing(2);
|
||||
return;
|
||||
//请求放货
|
||||
case 3:
|
||||
writing(6);
|
||||
return;
|
||||
//放货完成
|
||||
case 4:
|
||||
writing(3);
|
||||
return;
|
||||
}
|
||||
// switch (flag) {
|
||||
// //请求取货
|
||||
// case 1:
|
||||
// writing(5);
|
||||
// return;
|
||||
// //取货完成
|
||||
// case 2:
|
||||
// writing(2);
|
||||
// return;
|
||||
// //请求放货
|
||||
// case 3:
|
||||
// writing(6);
|
||||
// return;
|
||||
// //放货完成
|
||||
// case 4:
|
||||
// writing(3);
|
||||
// return;
|
||||
// }
|
||||
}
|
||||
|
||||
last_mode = mode;
|
||||
@@ -287,6 +314,7 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
last_barcode = barcode;
|
||||
last_specifications = specifications;
|
||||
last_batch = batch;
|
||||
last_flag = flag;
|
||||
}
|
||||
|
||||
|
||||
@@ -553,7 +581,7 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
*
|
||||
* @param
|
||||
*/
|
||||
public synchronized boolean putStorage() {
|
||||
public synchronized boolean putStorage(String type) {
|
||||
Date date = new Date();
|
||||
if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) {
|
||||
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
|
||||
@@ -562,7 +590,7 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
this.instruction_require_time = date;
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("device_code",this.device_code);
|
||||
json.put("type","1");
|
||||
json.put("type",type);
|
||||
json.put("material",material);
|
||||
json.put("vehicle_code",barcode);
|
||||
json.put("is_full","1");
|
||||
@@ -657,12 +685,12 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
public synchronized void OpenOrClose(String type) {
|
||||
|
||||
//进入区域
|
||||
if ("1".equals(type)) {
|
||||
writing(5);
|
||||
} else {
|
||||
//离开区域
|
||||
writing(6);
|
||||
}
|
||||
// if ("1".equals(type)) {
|
||||
// writing(5);
|
||||
// } else {
|
||||
// //离开区域
|
||||
// writing(6);
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ public class SendEmptyVehicleTask extends AbstractAcsTask {
|
||||
//假如起点是KTPHCW3,就需要送到堆叠位
|
||||
if (StrUtil.equals(start_point_code, "KTPDDW3")) {
|
||||
WQLObject point_table = WQLObject.getWQLObject("sch_base_point");
|
||||
JSONArray pointArr = point_table.query("area_type='" + AreaEnum.KTTHCQ + "'").getResultJSONArray(0);
|
||||
JSONArray pointArr = point_table.query("area_type='" + AreaEnum.KTTHCQ.getCode() + "'").getResultJSONArray(0);
|
||||
//更新点位
|
||||
PointUpdateUtil.updatePoint(pointArr);
|
||||
//查询有没有空的点位
|
||||
|
||||
Reference in New Issue
Block a user