fix: lms联调修改
This commit is contained in:
@@ -22,6 +22,7 @@ import org.nl.acs.device_driver.DeviceDriver;
|
|||||||
import org.nl.acs.device_driver.RouteableDeviceDriver;
|
import org.nl.acs.device_driver.RouteableDeviceDriver;
|
||||||
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
|
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
|
||||||
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
|
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
|
||||||
|
import org.nl.acs.device_driver.one_conveyor.fold_disc_site.FoldDiscSiteDeviceDriver;
|
||||||
import org.nl.acs.device_driver.one_manipulator.box_package_manipulator.InteractionJsonDTO;
|
import org.nl.acs.device_driver.one_manipulator.box_package_manipulator.InteractionJsonDTO;
|
||||||
import org.nl.acs.enums.AcsToLmsApplyTaskTypeEnum;
|
import org.nl.acs.enums.AcsToLmsApplyTaskTypeEnum;
|
||||||
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
||||||
@@ -647,6 +648,8 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
|
|||||||
}
|
}
|
||||||
//判断下一个输送线点位是否有货
|
//判断下一个输送线点位是否有货
|
||||||
BeltConveyorDeviceDriver beltConveyorDeviceDriver;
|
BeltConveyorDeviceDriver beltConveyorDeviceDriver;
|
||||||
|
//异常位到叠盘位
|
||||||
|
FoldDiscSiteDeviceDriver foldDiscSiteDeviceDriver;
|
||||||
if (nextdevice.getDeviceDriver() instanceof BeltConveyorDeviceDriver) {
|
if (nextdevice.getDeviceDriver() instanceof BeltConveyorDeviceDriver) {
|
||||||
beltConveyorDeviceDriver = (BeltConveyorDeviceDriver) nextdevice.getDeviceDriver();
|
beltConveyorDeviceDriver = (BeltConveyorDeviceDriver) nextdevice.getDeviceDriver();
|
||||||
if (beltConveyorDeviceDriver.getMode() != 2 || beltConveyorDeviceDriver.getMove() == 1) {
|
if (beltConveyorDeviceDriver.getMode() != 2 || beltConveyorDeviceDriver.getMove() == 1) {
|
||||||
@@ -654,6 +657,13 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
|
|||||||
this.setNotCreateInstMessage("universal_notCreateInstMessage4");
|
this.setNotCreateInstMessage("universal_notCreateInstMessage4");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}else if (nextdevice.getDeviceDriver() instanceof FoldDiscSiteDeviceDriver){
|
||||||
|
foldDiscSiteDeviceDriver = (FoldDiscSiteDeviceDriver) nextdevice.getDeviceDriver();
|
||||||
|
if (foldDiscSiteDeviceDriver.getMode() != 2 || foldDiscSiteDeviceDriver.getMove() == 1) {
|
||||||
|
log.error("输送机,{}未联机或执行中", next_device_code);
|
||||||
|
this.setNotCreateInstMessage("universal_notCreateInstMessage4");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
//下一个设备不是输送线指令
|
//下一个设备不是输送线指令
|
||||||
this.setNotCreateInstMessage("universal_notCreateInstMessage6");
|
this.setNotCreateInstMessage("universal_notCreateInstMessage6");
|
||||||
|
|||||||
@@ -243,7 +243,7 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements
|
|||||||
|
|
||||||
|
|
||||||
//申请空托盘出库
|
//申请空托盘出库
|
||||||
if (mode == 8 && move == 1 && !requireSucess){
|
if (mode == 8 && !requireSucess){
|
||||||
applyEmptyTask(StorageTypeEnum.DISKS_OUT.getType(),mode);
|
applyEmptyTask(StorageTypeEnum.DISKS_OUT.getType(),mode);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -448,6 +448,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
|||||||
.device_code(device_code)
|
.device_code(device_code)
|
||||||
.content("木箱、子卷入库申请入库任务,参数:" + param)
|
.content("木箱、子卷入库申请入库任务,参数:" + param)
|
||||||
.build();
|
.build();
|
||||||
|
logDto.setLog_level(4);
|
||||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||||
String response = acsToWmsService.applyTwo(param);
|
String response = acsToWmsService.applyTwo(param);
|
||||||
JSONObject jo = JSON.parseObject(response);
|
JSONObject jo = JSON.parseObject(response);
|
||||||
@@ -456,6 +457,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
|||||||
.device_code(device_code)
|
.device_code(device_code)
|
||||||
.content("木箱、子卷入库申请入库任务,参数,接口返回:" + jo)
|
.content("木箱、子卷入库申请入库任务,参数,接口返回:" + jo)
|
||||||
.build();
|
.build();
|
||||||
|
logDto2.setLog_level(4);
|
||||||
luceneExecuteLogService.deviceExecuteLog(logDto2);
|
luceneExecuteLogService.deviceExecuteLog(logDto2);
|
||||||
List list1 = new ArrayList();
|
List list1 = new ArrayList();
|
||||||
Map map = new HashMap();
|
Map map = new HashMap();
|
||||||
@@ -469,6 +471,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
|||||||
.device_code(device_code)
|
.device_code(device_code)
|
||||||
.content("木箱、子卷入库申请入库任务,返回参数:" + jo.getString("body"))
|
.content("木箱、子卷入库申请入库任务,返回参数:" + jo.getString("body"))
|
||||||
.build();
|
.build();
|
||||||
|
logDto2.setLog_level(4);
|
||||||
luceneExecuteLogService.deviceExecuteLog(logDto2);
|
luceneExecuteLogService.deviceExecuteLog(logDto2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,10 +56,7 @@ public class ItemProtocol {
|
|||||||
*/
|
*/
|
||||||
public static String item_y = "y";
|
public static String item_y = "y";
|
||||||
|
|
||||||
/**
|
|
||||||
* 行走开关信号
|
|
||||||
*/
|
|
||||||
public static String item_move = "move";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 载货台开关信号
|
* 载货台开关信号
|
||||||
@@ -96,10 +93,7 @@ public class ItemProtocol {
|
|||||||
*/
|
*/
|
||||||
public static String item_forkLocation = "forkLocation";
|
public static String item_forkLocation = "forkLocation";
|
||||||
|
|
||||||
/**
|
|
||||||
* 货叉动作信号
|
|
||||||
*/
|
|
||||||
public static String item_forkAction = "forkAction";
|
|
||||||
/**
|
/**
|
||||||
* 特殊开关量1
|
* 特殊开关量1
|
||||||
*/
|
*/
|
||||||
@@ -129,43 +123,10 @@ public class ItemProtocol {
|
|||||||
* 轴运行次数
|
* 轴运行次数
|
||||||
*/
|
*/
|
||||||
public static String item_stacker_runing_time = "stacker_runing time";
|
public static String item_stacker_runing_time = "stacker_runing time";
|
||||||
/**
|
|
||||||
* 轴工作时间(小时)
|
|
||||||
*/
|
|
||||||
public static String item_stacker_workingHours = "stacker_workingHours";
|
|
||||||
/**
|
|
||||||
* 载货台速度(转/分钟)
|
|
||||||
*/
|
|
||||||
public static String item_cargo_rpm = "cargo_rpm";
|
|
||||||
/**
|
|
||||||
* 载货台电流
|
|
||||||
*/
|
|
||||||
public static String item_cargo_electric_Current = "cargo_electric Current";
|
|
||||||
/**
|
|
||||||
* 载货台轴工作小时数
|
|
||||||
*/
|
|
||||||
public static String item_cargo_workingHours = "cargo_workingHours";
|
|
||||||
/**
|
|
||||||
* 载货台轴运行次数
|
|
||||||
*/
|
|
||||||
public static String item_cargo_runingTimes = "cargo_runingTimes";
|
|
||||||
/**
|
|
||||||
* 货叉速度(转/分钟
|
|
||||||
*/
|
|
||||||
public static String item_fork_rpm = "fork_rpm";
|
|
||||||
/**
|
|
||||||
* 货叉电流
|
|
||||||
*/
|
|
||||||
public static String item_fork_electric_Current = "fork_electric Current";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 货叉轴工作时间(小时
|
|
||||||
*/
|
|
||||||
public static String item_fork_workingHours = "fork_workingHours";
|
|
||||||
/**
|
|
||||||
* 货叉轴运行次数
|
|
||||||
*/
|
|
||||||
public static String item_fork_runingTimes = "fork_runingTimes";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 心跳
|
* 心跳
|
||||||
@@ -200,10 +161,7 @@ public class ItemProtocol {
|
|||||||
* 作业层
|
* 作业层
|
||||||
*/
|
*/
|
||||||
public static String item_to_y = "to_y";
|
public static String item_to_y = "to_y";
|
||||||
/**
|
|
||||||
* 托盘号
|
|
||||||
*/
|
|
||||||
public static String item_to_trayCode = "to_trayCode";
|
|
||||||
|
|
||||||
|
|
||||||
Boolean isonline;
|
Boolean isonline;
|
||||||
@@ -252,9 +210,6 @@ public class ItemProtocol {
|
|||||||
return this.getOpcIntegerValue(item_y);
|
return this.getOpcIntegerValue(item_y);
|
||||||
}
|
}
|
||||||
|
|
||||||
public float getItem_move() {
|
|
||||||
return this.getOpcFloatValue(item_move);
|
|
||||||
}
|
|
||||||
|
|
||||||
public float getItem_cargoMove() {
|
public float getItem_cargoMove() {
|
||||||
return this.getOpcFloatValue(item_cargoMove);
|
return this.getOpcFloatValue(item_cargoMove);
|
||||||
@@ -284,9 +239,7 @@ public class ItemProtocol {
|
|||||||
return this.getOpcFloatValue(item_forkLocation);
|
return this.getOpcFloatValue(item_forkLocation);
|
||||||
}
|
}
|
||||||
|
|
||||||
public float getItem_forkAction() {
|
|
||||||
return this.getOpcFloatValue(item_forkAction);
|
|
||||||
}
|
|
||||||
|
|
||||||
public float getItem_special1() {
|
public float getItem_special1() {
|
||||||
return this.getOpcFloatValue(item_special1);
|
return this.getOpcFloatValue(item_special1);
|
||||||
@@ -312,45 +265,16 @@ public class ItemProtocol {
|
|||||||
return this.getOpcIntegerValue(item_stacker_electricCurrent);
|
return this.getOpcIntegerValue(item_stacker_electricCurrent);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getItem_stacker_workingHours() {
|
|
||||||
return this.getOpcIntegerValue(item_stacker_workingHours);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getItem_stacker_runing_time() {
|
public Integer getItem_stacker_runing_time() {
|
||||||
return this.getOpcIntegerValue(item_stacker_runing_time);
|
return this.getOpcIntegerValue(item_stacker_runing_time);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getItem_cargo_rpm() {
|
|
||||||
return this.getOpcIntegerValue(item_cargo_rpm);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getItem_cargo_electric_Current() {
|
|
||||||
return this.getOpcIntegerValue(item_cargo_electric_Current);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getItem_cargo_workingHours() {
|
|
||||||
return this.getOpcIntegerValue(item_cargo_workingHours);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getItem_cargo_runingTimes() {
|
|
||||||
return this.getOpcIntegerValue(item_cargo_runingTimes);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getItem_fork_rpm() {
|
|
||||||
return this.getOpcIntegerValue(item_fork_rpm);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getItem_fork_electric_Current() {
|
|
||||||
return this.getOpcIntegerValue(item_fork_electric_Current);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getItem_fork_workingHours() {
|
|
||||||
return this.getOpcIntegerValue(item_fork_workingHours);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getItem_fork_runingTimes() {
|
|
||||||
return this.getOpcIntegerValue(item_fork_runingTimes);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public int getOpcIntegerValue(String protocol) {
|
public int getOpcIntegerValue(String protocol) {
|
||||||
@@ -420,7 +344,6 @@ public class ItemProtocol {
|
|||||||
list.add(new ItemDto(item_z, "行走排号", "DB101.B38"));
|
list.add(new ItemDto(item_z, "行走排号", "DB101.B38"));
|
||||||
list.add(new ItemDto(item_x, "行走列号", "DB101.B39"));
|
list.add(new ItemDto(item_x, "行走列号", "DB101.B39"));
|
||||||
list.add(new ItemDto(item_y, "行走层号", "DB101.B40"));
|
list.add(new ItemDto(item_y, "行走层号", "DB101.B40"));
|
||||||
list.add(new ItemDto(item_move, "行走开关信号", "DB101.B4"));
|
|
||||||
list.add(new ItemDto(item_cargoMove, "载货台开关信号", "DB101.B41"));
|
list.add(new ItemDto(item_cargoMove, "载货台开关信号", "DB101.B41"));
|
||||||
list.add(new ItemDto(item_action, "行走动作信号", "DB101.B5"));
|
list.add(new ItemDto(item_action, "行走动作信号", "DB101.B5"));
|
||||||
list.add(new ItemDto(item_distancex, "行走激光数值", "DB101.D16"));
|
list.add(new ItemDto(item_distancex, "行走激光数值", "DB101.D16"));
|
||||||
@@ -428,23 +351,13 @@ public class ItemProtocol {
|
|||||||
list.add(new ItemDto(item_cargoError, "载货台超限信号", "DB101.B43"));
|
list.add(new ItemDto(item_cargoError, "载货台超限信号", "DB101.B43"));
|
||||||
list.add(new ItemDto(item_forkCargo, "货叉探货信号", "DB101.B48"));
|
list.add(new ItemDto(item_forkCargo, "货叉探货信号", "DB101.B48"));
|
||||||
list.add(new ItemDto(item_forkLocation, "货叉位置信号", "DB101.B49"));
|
list.add(new ItemDto(item_forkLocation, "货叉位置信号", "DB101.B49"));
|
||||||
list.add(new ItemDto(item_forkAction, "货叉动作信号", "DB101.B50"));
|
|
||||||
list.add(new ItemDto(item_special1, "特殊开关量1", "DB101.B10"));
|
list.add(new ItemDto(item_special1, "特殊开关量1", "DB101.B10"));
|
||||||
list.add(new ItemDto(item_special2, "特殊开关量2", "DB101.B11"));
|
list.add(new ItemDto(item_special2, "特殊开关量2", "DB101.B11"));
|
||||||
list.add(new ItemDto(item_trayCode, "托盘条码", "DB101.B30.20"));
|
list.add(new ItemDto(item_trayCode, "托盘条码", "DB101.B30.20"));
|
||||||
list.add(new ItemDto(item_storage_cache, "水箱和消防缓存位有无货", "DB101.B50"));
|
list.add(new ItemDto(item_storage_cache, "水箱和消防缓存位有无货", "DB101.B50"));
|
||||||
list.add(new ItemDto(item_stacker_rpm, "速度(转/分钟)", "DB101.W52"));
|
list.add(new ItemDto(item_stacker_rpm, "速度(转/分钟)", "DB101.W52"));
|
||||||
list.add(new ItemDto(item_stacker_electricCurrent, "电流", "DB101.W54"));
|
list.add(new ItemDto(item_stacker_electricCurrent, "电流", "DB101.W54"));
|
||||||
list.add(new ItemDto(item_stacker_workingHours, "轴工作时间(小时)", "DB101.D56"));
|
|
||||||
list.add(new ItemDto(item_stacker_runing_time, "轴运行次数", "DB101.D60"));
|
list.add(new ItemDto(item_stacker_runing_time, "轴运行次数", "DB101.D60"));
|
||||||
list.add(new ItemDto(item_cargo_rpm, "载货台速度(转/分钟)", "DB101.W64"));
|
|
||||||
list.add(new ItemDto(item_cargo_electric_Current, "载货台电流", "DB101.W66"));
|
|
||||||
list.add(new ItemDto(item_cargo_workingHours, "载货台轴工作小时数", "DB101.D68"));
|
|
||||||
list.add(new ItemDto(item_cargo_runingTimes, "载货台轴运行次数", "DB101.D72"));
|
|
||||||
list.add(new ItemDto(item_fork_rpm, "货叉速度(转/分钟)", "DB101.W76"));
|
|
||||||
list.add(new ItemDto(item_fork_electric_Current, "货叉电流", "DB101.W78"));
|
|
||||||
list.add(new ItemDto(item_fork_workingHours, "货叉轴工作时间(小时)", "DB101.D80"));
|
|
||||||
list.add(new ItemDto(item_fork_runingTimes, "货叉轴运行次数", "DB101.D84"));
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -458,7 +371,6 @@ public class ItemProtocol {
|
|||||||
list.add(new ItemDto(item_to_z, "作业排", "DB100.B6"));
|
list.add(new ItemDto(item_to_z, "作业排", "DB100.B6"));
|
||||||
list.add(new ItemDto(item_to_x, "作业列", "DB100.B7"));
|
list.add(new ItemDto(item_to_x, "作业列", "DB100.B7"));
|
||||||
list.add(new ItemDto(item_to_y, "作业层", "DB100.B8"));
|
list.add(new ItemDto(item_to_y, "作业层", "DB100.B8"));
|
||||||
list.add(new ItemDto(item_to_trayCode, "托盘号", "DB100.B11.20"));
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import org.nl.acs.device_driver.conveyor.belt_conveyor.BeltConveyorDeviceDriver;
|
|||||||
import org.nl.acs.device_driver.conveyor.siemens_conveyor.SiemensConveyorDeviceDriver;
|
import org.nl.acs.device_driver.conveyor.siemens_conveyor.SiemensConveyorDeviceDriver;
|
||||||
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
|
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
|
||||||
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
|
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
|
||||||
|
import org.nl.acs.device_driver.storage.standard_storage.StandardStorageDeviceDriver;
|
||||||
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
||||||
import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl;
|
import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl;
|
||||||
import org.nl.acs.history.ErrorUtil;
|
import org.nl.acs.history.ErrorUtil;
|
||||||
@@ -311,7 +312,6 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
z = this.itemProtocol.getItem_z();
|
z = this.itemProtocol.getItem_z();
|
||||||
x = this.itemProtocol.getItem_x();
|
x = this.itemProtocol.getItem_x();
|
||||||
y = this.itemProtocol.getItem_y();
|
y = this.itemProtocol.getItem_y();
|
||||||
move = this.itemProtocol.getItem_move();
|
|
||||||
cargoMove = this.itemProtocol.getItem_cargoMove();
|
cargoMove = this.itemProtocol.getItem_cargoMove();
|
||||||
action = this.itemProtocol.getItem_action();
|
action = this.itemProtocol.getItem_action();
|
||||||
distancex = this.itemProtocol.getItem_distancex();
|
distancex = this.itemProtocol.getItem_distancex();
|
||||||
@@ -319,7 +319,6 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
cargoError = this.itemProtocol.getItem_cargoError();
|
cargoError = this.itemProtocol.getItem_cargoError();
|
||||||
forkCargo = this.itemProtocol.getItem_forkCargo();
|
forkCargo = this.itemProtocol.getItem_forkCargo();
|
||||||
forkLocation = this.itemProtocol.getItem_forkLocation();
|
forkLocation = this.itemProtocol.getItem_forkLocation();
|
||||||
forkAction = this.itemProtocol.getItem_forkAction();
|
|
||||||
special1 = this.itemProtocol.getItem_special1();
|
special1 = this.itemProtocol.getItem_special1();
|
||||||
special2 = this.itemProtocol.getItem_special2();
|
special2 = this.itemProtocol.getItem_special2();
|
||||||
trayCode = this.itemProtocol.getItem_trayCode();
|
trayCode = this.itemProtocol.getItem_trayCode();
|
||||||
@@ -396,24 +395,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
String next_device_code = instruction2.getNext_device_code();
|
String next_device_code = instruction2.getNext_device_code();
|
||||||
Device nextDevice = deviceAppService.findDeviceByCode(next_device_code);
|
Device nextDevice = deviceAppService.findDeviceByCode(next_device_code);
|
||||||
if (StrUtil.equals(nextDevice.getDevice_type(), DeviceType.conveyor.name())) {
|
if (StrUtil.equals(nextDevice.getDevice_type(), DeviceType.conveyor.name())) {
|
||||||
if (ObjectUtil.isNotEmpty(nextDevice.getExtraValue().get("z"))) {
|
packageDevicePoint(nextDevice, list);
|
||||||
Map map = new HashMap();
|
|
||||||
map.put("code", "to_x");
|
|
||||||
map.put("value", nextDevice.getExtraValue().get("z"));
|
|
||||||
list.add(map);
|
|
||||||
}
|
|
||||||
if (ObjectUtil.isNotEmpty(nextDevice.getExtraValue().get("x"))) {
|
|
||||||
Map<String, Object> map = new HashMap<>();
|
|
||||||
map.put("code", "to_z");
|
|
||||||
map.put("value", nextDevice.getExtraValue().get("x"));
|
|
||||||
list.add(map);
|
|
||||||
}
|
|
||||||
if (ObjectUtil.isNotEmpty(nextDevice.getExtraValue().get("y"))) {
|
|
||||||
Map<String, Object> map = new HashMap<>();
|
|
||||||
map.put("code", "to_y");
|
|
||||||
map.put("value", nextDevice.getExtraValue().get("y"));
|
|
||||||
list.add(map);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (StrUtil.equals(nextDevice.getDevice_type(), DeviceType.storage.name())) {
|
if (StrUtil.equals(nextDevice.getDevice_type(), DeviceType.storage.name())) {
|
||||||
String pattern = "\\d+";
|
String pattern = "\\d+";
|
||||||
@@ -558,6 +540,27 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
last_fork_runingTimes = fork_runingTimes;*/
|
last_fork_runingTimes = fork_runingTimes;*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void packageDevicePoint(Device nextDevice, List list) {
|
||||||
|
if (ObjectUtil.isNotEmpty(nextDevice.getExtraValue().get("z"))) {
|
||||||
|
Map map = new HashMap();
|
||||||
|
map.put("code", "to_x");
|
||||||
|
map.put("value", nextDevice.getExtraValue().get("z"));
|
||||||
|
list.add(map);
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(nextDevice.getExtraValue().get("x"))) {
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
map.put("code", "to_z");
|
||||||
|
map.put("value", nextDevice.getExtraValue().get("x"));
|
||||||
|
list.add(map);
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(nextDevice.getExtraValue().get("y"))) {
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
map.put("code", "to_y");
|
||||||
|
map.put("value", nextDevice.getExtraValue().get("y"));
|
||||||
|
list.add(map);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private boolean updateCommand(String toCommand) {
|
private boolean updateCommand(String toCommand) {
|
||||||
Instruction instruction0 = checkInst();
|
Instruction instruction0 = checkInst();
|
||||||
if (ObjectUtil.isEmpty(instruction0)) {
|
if (ObjectUtil.isEmpty(instruction0)) {
|
||||||
@@ -668,7 +671,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
String x = point.getExtraValue().get("x").toString();
|
String x = point.getExtraValue().get("x").toString();
|
||||||
String y = split[1];
|
String y = split[1];
|
||||||
String z = split[2];
|
String z = split[2];
|
||||||
pakagePLCData(list, x,y,z,"2",task);
|
pakagePLCData(list, x, y, z, "2", task.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//取货潜货位阻挡做完移库任务
|
//取货潜货位阻挡做完移库任务
|
||||||
@@ -697,7 +700,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void pakagePLCData(List list, String x, String y, String z, String toCommand, Integer task) {
|
private void pakagePLCData(List list, String x, String y, String z, String toCommand, String task) {
|
||||||
HashMap map1 = new HashMap();
|
HashMap map1 = new HashMap();
|
||||||
map1.put("code", "to_x");
|
map1.put("code", "to_x");
|
||||||
map1.put("value", y);
|
map1.put("value", y);
|
||||||
@@ -766,20 +769,6 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void pakageData1(Instruction instruction, Instruction instructionUpdate, Device starPoint, String[] split, TaskDto taskUpdate) {
|
|
||||||
instructionUpdate.setFrom_x(starPoint.getExtraValue().get("x").toString());
|
|
||||||
instructionUpdate.setFrom_y(split[1]);
|
|
||||||
instructionUpdate.setFrom_z(split[2]);
|
|
||||||
instructionUpdate.setInstruction_code(String.valueOf(task));
|
|
||||||
taskUpdate.setFrom_x(starPoint.getExtraValue().get("x").toString());
|
|
||||||
taskUpdate.setFrom_y(split[1]);
|
|
||||||
taskUpdate.setFrom_z(split[2]);
|
|
||||||
taskUpdate.setTask_code(instruction.getTask_code());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void pakageData2(Instruction instruction, Instruction instructionUpdate, Device starPoint, String[] split, TaskDto taskUpdate) {
|
private void pakageData2(Instruction instruction, Instruction instructionUpdate, Device starPoint, String[] split, TaskDto taskUpdate) {
|
||||||
instructionUpdate.setTo_x(starPoint.getExtraValue().get("x").toString());
|
instructionUpdate.setTo_x(starPoint.getExtraValue().get("x").toString());
|
||||||
instructionUpdate.setTo_y(split[1]);
|
instructionUpdate.setTo_y(split[1]);
|
||||||
@@ -806,11 +795,58 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
//维修解警后重新向堆垛机下发指令
|
//维修解警后重新向堆垛机下发指令
|
||||||
Instruction instructionErro = checkInst();
|
Instruction instructionErro = checkInst();
|
||||||
if (ObjectUtil.isNotEmpty(instructionErro) && InstructionStatusEnum.BUSY.getIndex().equals(instructionErro.getInstruction_status()) && StrUtil.isNotEmpty(instructionErro.getExecute_code())) {
|
if (ObjectUtil.isNotEmpty(instructionErro) && InstructionStatusEnum.BUSY.getIndex().equals(instructionErro.getInstruction_status()) && StrUtil.isNotEmpty(instructionErro.getExecute_code())) {
|
||||||
|
String start_device_code = instructionErro.getStart_device_code();
|
||||||
|
Device startDevice = deviceAppService.findDeviceByCode(start_device_code);
|
||||||
|
if (startDevice.getDeviceDriver() instanceof BeltConveyorDeviceDriver) {
|
||||||
|
//放货完成
|
||||||
|
if (forkCargo==0) {
|
||||||
|
//取货中或者取货完成(分入库出库)
|
||||||
|
if ("1".equals(instructionErro.getExecute_code())||"2".equals(instructionErro.getExecute_code())) {
|
||||||
List list = new ArrayList();
|
List list = new ArrayList();
|
||||||
pakagePLCData(list, String.valueOf(z),String.valueOf(x),String.valueOf(y),instructionErro.getExecute_code(),task);
|
String startDeviceCode = instructionErro.getStart_device_code();
|
||||||
|
Device startDeviceError = deviceAppService.findDeviceByCode(startDeviceCode);
|
||||||
|
if (StrUtil.equals(startDevice.getDevice_type(), DeviceType.conveyor.name())) {
|
||||||
|
pakagePLCData(list, startDeviceError.getExtraValue().get("x").toString(), startDeviceError.getExtraValue().get("y").toString(), startDeviceError.getExtraValue().get("z").toString(), instructionErro.getExecute_code(), instructionErro.getInstruction_code());
|
||||||
requireSucess = true;
|
requireSucess = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//放货中报警
|
||||||
|
if ("3".equals(instructionErro.getExecute_code())&&forkCargo==2) {
|
||||||
|
List list = new ArrayList();
|
||||||
|
if (StrUtil.equals(startDevice.getDevice_type(), DeviceType.conveyor.name())) {
|
||||||
|
pakagePLCData(list, instructionErro.getTo_x(), instructionErro.getTo_y(), instructionErro.getTo_z(), instructionErro.getExecute_code(), instructionErro.getInstruction_code());
|
||||||
|
requireSucess = true;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//出库报警
|
||||||
|
if (startDevice.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
|
||||||
|
//取货报警
|
||||||
|
if ("1".equals(instructionErro.getExecute_code())||"2".equals(instructionErro.getExecute_code())) {
|
||||||
|
List list = new ArrayList();
|
||||||
|
if (StrUtil.equals(startDevice.getDevice_type(), DeviceType.storage.name())) {
|
||||||
|
pakagePLCData(list, instructionErro.getFrom_x(), instructionErro.getFrom_y(), instructionErro.getFrom_z(), instructionErro.getExecute_code(), instructionErro.getInstruction_code());
|
||||||
|
requireSucess = true;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//放货中报警
|
||||||
|
if ("3".equals(instructionErro.getExecute_code())&&forkCargo==2) {
|
||||||
|
String next_device_code = instructionErro.getNext_device_code();
|
||||||
|
Device nextDevice = deviceAppService.findDeviceByCode(next_device_code);
|
||||||
|
List list = new ArrayList();
|
||||||
|
if (StrUtil.equals(startDevice.getDevice_type(), DeviceType.conveyor.name())) {
|
||||||
|
pakagePLCData(list, nextDevice.getExtraValue().get("x").toString(), nextDevice.getExtraValue().get("y").toString(), nextDevice.getExtraValue().get("z").toString(), instructionErro.getExecute_code(), instructionErro.getInstruction_code());
|
||||||
|
requireSucess = true;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
this.instruction_require_time = date;
|
this.instruction_require_time = date;
|
||||||
//暂停任务
|
//暂停任务
|
||||||
|
|||||||
Reference in New Issue
Block a user