opt: 现场与设备联调测试优化
This commit is contained in:
@@ -226,13 +226,10 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
container_type = this.itemProtocol.getContainer_type();
|
||||
error = this.itemProtocol.getError();
|
||||
task = this.itemProtocol.getTask();
|
||||
container_no = this.itemProtocol.getContainer_no();
|
||||
material_barcode= this.itemProtocol.getMaterialBarcode();
|
||||
to_command = this.itemProtocol.getTo_command();
|
||||
to_target = this.itemProtocol.getTotarget();
|
||||
to_task = this.itemProtocol.getTo_task();
|
||||
to_container_no = this.itemProtocol.getContainer_direction();
|
||||
to_container_type = this.itemProtocol.getContainer_no();
|
||||
|
||||
|
||||
if (mode != last_mode) {
|
||||
@@ -547,28 +544,30 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
}
|
||||
|
||||
private void writeData(String next_addr, List list, Instruction inst) {
|
||||
List list1 = new ArrayList();
|
||||
Map map = new HashMap();
|
||||
map.put("code", "to_target");
|
||||
map.put("value", next_addr);
|
||||
list.add(map);
|
||||
list1.add(map);
|
||||
this.writing(list1);
|
||||
List list2 = new ArrayList();
|
||||
Map map1 = new HashMap();
|
||||
map1.put("code", "to_task");
|
||||
map1.put("value", inst.getInstruction_code());
|
||||
list.add(map1);
|
||||
Map map2 = new HashMap();
|
||||
map2.put("code", "to_command");
|
||||
map2.put("value", "1");
|
||||
list.add(map2);
|
||||
list2.add(map);
|
||||
this.writing(list2);
|
||||
List list4 = new ArrayList();
|
||||
Map map3 = new HashMap();
|
||||
map3.put("code", "to_container_type");
|
||||
map3.put("value", inst.getVehicle_type());
|
||||
list.add(map3);
|
||||
Map map4 = new HashMap();
|
||||
map4.put("code", "to_container_no");
|
||||
map4.put("value", "1");
|
||||
list.add(map4);
|
||||
|
||||
this.writing(list);
|
||||
list4.add(map3);
|
||||
this.writing(list4);
|
||||
List list3 = new ArrayList();
|
||||
Map map2 = new HashMap();
|
||||
map2.put("code", "to_command");
|
||||
map2.put("value", "1");
|
||||
list3.add(map2);
|
||||
this.writing(list3);
|
||||
}
|
||||
|
||||
private static void packageData(Instruction instdto, String route_plan_code, TaskDto taskdto, String taskid, String taskcode, String start_device_code, String next_device_code, String start_point_code, String next_point_code, String priority) {
|
||||
@@ -678,32 +677,19 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
jo.put("mode", mode);
|
||||
jo.put("message", LangProcess.msg(message));
|
||||
jo.put("error", this.getError());
|
||||
String move = "无货";
|
||||
if(this.move == 1){
|
||||
move = "有货";
|
||||
}
|
||||
jo.put("move", move);
|
||||
jo.put("task", task);
|
||||
jo.put("type", container_type);
|
||||
jo.put("is_click", true);
|
||||
jo.put("isOnline", this.getIsonline());
|
||||
jo.put("requireSucess", requireSucess);
|
||||
return jo;
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 获取任务信息
|
||||
// */
|
||||
// public JSONObject getLedMessage(Instruction instdto) {
|
||||
// JSONObject json = new JSONObject();
|
||||
// json.put("task_code", instdto.getTask_code());
|
||||
// json.put("inst_code", instdto.getInstruction_code());
|
||||
// json.put("start_device_code", instdto.getStart_device_code());
|
||||
// json.put("next_device_code", instdto.getNext_device_code());
|
||||
// json.put("material_type", instdto.getMaterial());
|
||||
// json.put("quantity", instdto.getQuantity());
|
||||
// json.put("vehicle_code", instdto.getVehicle_code());
|
||||
// json.put("instruction_status", instdto.getInstruction_status());
|
||||
// json.put("entry_time", instdto.getCreate_time());
|
||||
// String acsIp = paramService.findByCode(AcsConfig.ACSIP).getValue();
|
||||
// json.put("ip", acsIp);
|
||||
// return json;
|
||||
// }
|
||||
|
||||
|
||||
/**
|
||||
* 更新指令状态
|
||||
|
||||
@@ -45,15 +45,6 @@ public class ItemProtocol {
|
||||
* 任务号
|
||||
*/
|
||||
public static String item_task = "task";
|
||||
/**
|
||||
* 出数字托盘号
|
||||
*/
|
||||
public static String item_container_no = "container_no";
|
||||
|
||||
/**
|
||||
* 子卷条码
|
||||
*/
|
||||
public static String item_material_barcode = "material_barcode";
|
||||
|
||||
/**
|
||||
* 下发命令
|
||||
@@ -63,10 +54,6 @@ public class ItemProtocol {
|
||||
* 下发托盘类型
|
||||
*/
|
||||
public static String item_to_container_type = "to_container_type";
|
||||
/**
|
||||
* 下发接纯数字托盘号
|
||||
*/
|
||||
public static String item_to_container_no = "to_container_no";
|
||||
/**
|
||||
* 下发任务号
|
||||
*/
|
||||
@@ -76,11 +63,6 @@ public class ItemProtocol {
|
||||
*/
|
||||
public static String item_to_target = "to_target";
|
||||
|
||||
/**
|
||||
* 托盘条码
|
||||
*/
|
||||
public static String item_barcode = "barcode";
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -90,9 +72,6 @@ public class ItemProtocol {
|
||||
this.driver = driver;
|
||||
}
|
||||
|
||||
public String getMaterialBarcode() {
|
||||
return this.getOpcStringValue(item_material_barcode);
|
||||
}
|
||||
public int getHeartbeat() {
|
||||
return this.getOpcIntegerValue(item_heartbeat);
|
||||
}
|
||||
@@ -117,9 +96,6 @@ public class ItemProtocol {
|
||||
return this.getOpcIntegerValue(item_action);
|
||||
}
|
||||
|
||||
public int getContainer_no() {
|
||||
return this.getOpcIntegerValue(item_container_no);
|
||||
}
|
||||
|
||||
public int getError() {
|
||||
return this.getOpcIntegerValue(item_error);
|
||||
@@ -133,9 +109,6 @@ public class ItemProtocol {
|
||||
return this.getOpcIntegerValue(item_to_task);
|
||||
}
|
||||
|
||||
public String getBarcode() {
|
||||
return this.getOpcStringValue(item_barcode);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -151,9 +124,6 @@ public class ItemProtocol {
|
||||
return this.getOpcIntegerValue(item_to_container_type);
|
||||
}
|
||||
|
||||
public int getTo_container_no() {
|
||||
return this.getOpcIntegerValue(item_to_container_no);
|
||||
}
|
||||
|
||||
Boolean isonline;
|
||||
|
||||
@@ -198,12 +168,9 @@ public class ItemProtocol {
|
||||
list.add(new ItemDto(item_move, "光电信号", "DB101.B3"));
|
||||
list.add(new ItemDto(item_container_direction, "托盘方向", "DB101.B4"));
|
||||
list.add(new ItemDto(item_container_type, "托盘类型", "DB101.B5"));
|
||||
list.add(new ItemDto(item_container_no, "纯数字托盘号", "DB101.D7"));
|
||||
list.add(new ItemDto(item_action, "动作类型", "DB101.B6"));
|
||||
list.add(new ItemDto(item_error, "报警", "DB101.B58"));
|
||||
list.add(new ItemDto(item_task, "任务号", "DB101.D68"));
|
||||
list.add(new ItemDto(item_material_barcode, "子卷条码", "DB601.STRING1.50"));
|
||||
list.add(new ItemDto(item_barcode, "托盘条码", "DB602.STRING1.50"));
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -212,7 +179,6 @@ public class ItemProtocol {
|
||||
list.add(new ItemDto(item_to_target, "下发仓位号", "DB102.W2"));
|
||||
list.add(new ItemDto(item_to_command, "下发命令", "DB102.W4"));
|
||||
list.add(new ItemDto(item_to_task, "下发任务号", "DB102.D1"));
|
||||
list.add(new ItemDto(item_to_container_no, "下发接纯数字托盘号", "DB102.D3"));
|
||||
list.add(new ItemDto(item_to_container_type, "下发托盘类型", "DB102.B5"));
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ public class ItemProtocol {
|
||||
/**
|
||||
*木箱宽度
|
||||
*/
|
||||
public static String item_to_weight = "to_weight";
|
||||
public static String item_to_weight = "to_width";
|
||||
/**
|
||||
*木箱高度
|
||||
*/
|
||||
|
||||
@@ -144,9 +144,9 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
||||
|
||||
String hand_material_barcode = null;
|
||||
|
||||
//数量
|
||||
int qty = 0;
|
||||
int last_qty = 0;
|
||||
//高度
|
||||
int height = 0;
|
||||
int last_height = 0;
|
||||
|
||||
//托盘方向
|
||||
int carrier_direction = 0;
|
||||
@@ -219,7 +219,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
||||
to_container_type = this.itemProtocol.getTo_container_type();
|
||||
container_type = this.itemProtocol.getContainer_type();
|
||||
carrier_direction = this.itemProtocol.getCarrier_direction();
|
||||
qty = this.itemProtocol.getQty();
|
||||
height = this.itemProtocol.getHeight();
|
||||
weight = this.itemProtocol.getWeight();
|
||||
barcode = this.itemProtocol.getBarcode();
|
||||
material_barcode = this.itemProtocol.getMaterialBarcode();
|
||||
@@ -338,7 +338,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
||||
last_hj_task = hj_task;
|
||||
last_container_type = container_type;
|
||||
last_carrier_direction = carrier_direction;
|
||||
last_qty = qty;
|
||||
last_height = height;
|
||||
last_weight = weight;
|
||||
last_barcode = barcode;
|
||||
}
|
||||
|
||||
@@ -32,9 +32,9 @@ public class ItemProtocol {
|
||||
*/
|
||||
public static String item_error = "error";
|
||||
/**
|
||||
* 数量
|
||||
* 高度
|
||||
*/
|
||||
public static String item_qty = "qty";
|
||||
public static String item_height = "height";
|
||||
/**
|
||||
* 任务号
|
||||
*/
|
||||
@@ -112,8 +112,8 @@ public class ItemProtocol {
|
||||
return this.getOpcIntegerValue(item_task);
|
||||
}
|
||||
|
||||
public int getQty(){
|
||||
return this.getOpcIntegerValue(item_qty);
|
||||
public int getHeight(){
|
||||
return this.getOpcIntegerValue(item_height);
|
||||
}
|
||||
|
||||
public int getCarrier_direction(){
|
||||
@@ -189,7 +189,7 @@ public class ItemProtocol {
|
||||
list.add(new ItemDto(item_task, "任务号", "DB1.D6"));
|
||||
list.add(new ItemDto(item_container_type, "托盘类型", "DB1.B7"));
|
||||
list.add(new ItemDto(item_carrier_direction, "托盘方向", "DB1.B8"));
|
||||
list.add(new ItemDto(item_qty, "数量", "DB1.B9"));
|
||||
list.add(new ItemDto(item_height, "高度", "DB1.B9"));
|
||||
list.add(new ItemDto(item_weight, "重量", "DB1.B10"));
|
||||
list.add(new ItemDto(item_barcode, "托盘条码", "DB602.STRING1.50"));
|
||||
list.add(new ItemDto(item_material_barcode, "子卷条码", "DB601.STRING1.50"));
|
||||
|
||||
@@ -11,7 +11,7 @@ public class InteractionJsonDTO {
|
||||
private String maxNo;
|
||||
|
||||
/**
|
||||
*木箱最大数量
|
||||
*木箱放入数量
|
||||
*/
|
||||
private String boxNo;
|
||||
|
||||
|
||||
@@ -233,8 +233,8 @@ public class BoxStorageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
}
|
||||
}
|
||||
|
||||
//放货完成
|
||||
if (action == 4 && move == 0) {
|
||||
//任务完成
|
||||
if (action == 5 && move == 0) {
|
||||
if (inst != null) {
|
||||
try {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "放货完成");
|
||||
@@ -351,7 +351,7 @@ public class BoxStorageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
notCreateInstMessage = "universal_notCreateInstMessage1";
|
||||
throw new BadRequestException("设备:" + nextDevice.getDevice_code() + "未设置电气调度号!");
|
||||
}
|
||||
//存在托盘才可以申请任务
|
||||
/*//存在托盘才可以申请任务
|
||||
BeltConveyorDeviceDriver beltConveyorDeviceDriver;
|
||||
if (nextDevice.getDeviceDriver() instanceof BeltConveyorDeviceDriver) {
|
||||
beltConveyorDeviceDriver = (BeltConveyorDeviceDriver) nextDevice.getDeviceDriver();
|
||||
@@ -359,7 +359,7 @@ public class BoxStorageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
notCreateInstMessage = "universal_notCreateInstMessage2";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
String taskid = taskDto.getTask_id();
|
||||
@@ -451,6 +451,12 @@ public class BoxStorageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
map9.put("value", interactionJsonDTO.getLayer());
|
||||
list.add(map9);
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(interactionJsonDTO.getContainerType())) {
|
||||
Map<String, Object> map10 = new HashMap<>();
|
||||
map10.put("code", "to_type");
|
||||
map10.put("value", interactionJsonDTO.getContainerType());
|
||||
list.add(map10);
|
||||
}
|
||||
}
|
||||
this.writing(list);
|
||||
}
|
||||
|
||||
@@ -28,4 +28,9 @@ public class InteractionJsonDTO {
|
||||
*/
|
||||
private String layer;
|
||||
|
||||
/**
|
||||
* 托盘类型
|
||||
*/
|
||||
private String containerType;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user