fix s7协议驱动修改

This commit is contained in:
周俊杰
2024-06-19 15:03:48 +08:00
parent 4922ea0f6e
commit 30bc589867
28 changed files with 1807 additions and 989 deletions

View File

@@ -87,7 +87,9 @@ public enum DriverTypeEnum {
CONVEYOR_PRESS_STATION(54, "conveyor_press_station", "标准版-压制对接位", "station"),
PACKAGE_SITE(55, "package_site", "包装线工位", "station");
PACKAGE_SITE(55, "package_site", "包装线工位", "station"),
LNSH_JCY(57, "lnsh_jcy", "标准-进出窑", "station");
//驱动索引
private int index;
//驱动编码

View File

@@ -17,7 +17,7 @@ public class ItemProtocol {
public static String item_mode = "mode";
public static String item_move = "move";
public static String item_action = "action";
public static String item_ioaction = "ioaction";
public static String item_io_action = "io_action";
public static String item_height = "height";
public static String item_error = "error";
public static String item_direction = "direction";
@@ -102,7 +102,7 @@ public class ItemProtocol {
list.add(new ItemDto(item_mode, "工作模式", "DB600.B1", Boolean.valueOf(true)));
list.add(new ItemDto(item_move, "光电开关信号", "DB600.B2"));
list.add(new ItemDto(item_action, "取放信号", "DB600.B3"));
list.add(new ItemDto(item_ioaction, "进出类型", "DB600.B4"));
list.add(new ItemDto(item_io_action, "进出类型", "DB600.B4"));
list.add(new ItemDto(item_height, "高度类型", "DB600.B5"));
list.add(new ItemDto(item_error, "报警信号", "DB600.B6"));
list.add(new ItemDto(item_direction, "电机方向", "DB600.B7"));

View File

@@ -17,7 +17,7 @@ public class ItemProtocol {
public static String item_mode = "mode";
public static String item_move = "move";
public static String item_action = "action";
public static String item_ioaction = "ioaction";
public static String item_io_action = "io_action";
public static String item_height = "height";
public static String item_error = "error";
public static String item_direction = "direction";
@@ -57,7 +57,7 @@ public class ItemProtocol {
}
public int getIoAction() {
return this.getOpcIntegerValue(item_ioaction);
return this.getOpcIntegerValue(item_io_action);
}
public int getHeight() {
@@ -141,7 +141,7 @@ public class ItemProtocol {
list.add(new ItemDto(item_mode, "工作模式", "DB600.B1", Boolean.valueOf(true)));
list.add(new ItemDto(item_move, "光电开关信号", "DB600.B2"));
list.add(new ItemDto(item_action, "取放信号", "DB600.B3"));
list.add(new ItemDto(item_ioaction, "进出类型", "DB600.B4"));
list.add(new ItemDto(item_io_action, "进出类型", "DB600.B4"));
list.add(new ItemDto(item_height, "高度类型", "DB600.B5"));
list.add(new ItemDto(item_error, "报警信号", "DB600.B6"));
list.add(new ItemDto(item_direction, "电机方向", "DB600.B7"));

View File

@@ -16,7 +16,7 @@ public class ItemProtocol {
public static String item_heartbeat = "heartbeat";
public static String item_mode = "mode";
public static String item_move = "move";
public static String item_ioaction = "ioaction";
public static String item_io_action = "io_action";
public static String item_error = "error";
public static String item_task = "task";
public static String item_to_command = "to_command";
@@ -43,7 +43,7 @@ public class ItemProtocol {
}
public int getIoaction() {
return this.getOpcIntegerValue(item_ioaction);
return this.getOpcIntegerValue(item_io_action);
}
public int getError() {

View File

@@ -150,7 +150,7 @@ public class ConveyorBarcodeDeviceDriver extends AbstractOpcDeviceDriver impleme
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode));
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode" + last_mode + " -> " + mode);
}
if (move != last_move) {
if (move != last_move && mode>0) {
logServer.deviceItemValue(this.device_code, "move", String.valueOf(move));
logServer.deviceExecuteLog(this.device_code, "", "", "信号move" + last_move + " -> " + move);
if ("true".equals(this.device.getExtraValue().get("sendDeviceStatus"))) {
@@ -217,6 +217,16 @@ public class ConveyorBarcodeDeviceDriver extends AbstractOpcDeviceDriver impleme
} catch (Exception var17) {
return;
}finally {
last_mode = mode;
last_error = error;
last_move = move;
last_task = task;
last_action = action;
last_ioaction = io_action;
last_weight = weight;
last_material = material;
last_barcode = barcode;
}
//急停
@@ -260,15 +270,6 @@ public class ConveyorBarcodeDeviceDriver extends AbstractOpcDeviceDriver impleme
Object ignore_pickup_check = this.getExtraValue().get("ignore_pickup_check");
}
last_mode = mode;
last_error = error;
last_move = move;
last_task = task;
last_action = action;
last_ioaction = io_action;
last_weight = weight;
last_material = material;
last_barcode = barcode;
}

View File

@@ -18,7 +18,7 @@ public class ItemProtocol {
public static String item_mode = "mode";
public static String item_move = "move";
public static String item_action = "action";
public static String item_ioaction = "ioaction";
public static String item_io_action = "io_action";
public static String item_error = "error";
public static String item_task = "task";
public static String item_weight = "weight";
@@ -56,7 +56,7 @@ public class ItemProtocol {
}
public int getIoAction() {
return this.getOpcIntegerValue(item_ioaction);
return this.getOpcIntegerValue(item_io_action);
}
public int getError() {
@@ -131,7 +131,7 @@ public class ItemProtocol {
list.add(new ItemDto(item_mode, "工作模式", "DB51.B1", Boolean.valueOf(true)));
list.add(new ItemDto(item_move, "光电开关信号", "DB51.B2"));
list.add(new ItemDto(item_action, "取放信号", "DB51.B3"));
list.add(new ItemDto(item_ioaction, "进出信号", "DB51.B4"));
list.add(new ItemDto(item_io_action, "进出信号", "DB51.B4"));
list.add(new ItemDto(item_error, "报警信号", "DB51.B5"));
list.add(new ItemDto(item_task, "任务号", "DB51.D6"));
list.add(new ItemDto(item_weight, "重量", "DB51.D10"));

View File

@@ -16,7 +16,7 @@ public class ItemProtocol {
public static String item_mode = "mode";
public static String item_status = "status";
public static String item_open_time = "open_time";
public static String item_close_time = "close_time";
public static String item_error="error";
public static String item_standby_time = "standby_time";
public static String item_production_time = "production_time";
public static String item_error_time = "error_time";
@@ -27,7 +27,6 @@ public class ItemProtocol {
public static String item_move = "move";
public static String item_action = "action";
public static String item_ioaction = "ioaction";
public static String item_error = "error";
public static String item_task = "task";
public static String item_weight = "weight";
public static String item_material = "material";
@@ -53,6 +52,7 @@ public class ItemProtocol {
return this.getOpcIntegerValue(item_move);
}
public int getAction() {
return this.getOpcIntegerValue(item_action);
}
@@ -89,9 +89,7 @@ public class ItemProtocol {
return this.getOpcStringValue(item_open_time);
}
public int getClose_time() {
return this.getOpcIntegerValue(item_close_time);
}
public int getStandby_time() {
return this.getOpcIntegerValue(item_standby_time);
@@ -156,7 +154,7 @@ public class ItemProtocol {
list.add(new ItemDto(item_mode, "工作模式", "DB120.B1", Boolean.valueOf(true)));
list.add(new ItemDto(item_status, "设备状态", "DB120.B2"));
list.add(new ItemDto(item_open_time, "开机时间", "DB120.STRING4.50"));
list.add(new ItemDto(item_close_time, "关机时间", "DB120.D56"));
list.add(new ItemDto(item_error, "故障", "DB120.58"));
list.add(new ItemDto(item_standby_time, "待机时间", "DB120.D60"));
list.add(new ItemDto(item_production_time, "生产时间", "DB120.D64"));
list.add(new ItemDto(item_error_time, "故障时间", "DB120.D68"));

View File

@@ -118,12 +118,10 @@ public class LnshFoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implem
String message = null;
try {
device_code = this.getDeviceCode();
heartbeat = this.itemProtocol.getHeartbeat();
mode = this.itemProtocol.getMode();
status = this.itemProtocol.getStatus();
open_time = this.itemProtocol.getOpen_time();
close_time = this.itemProtocol.getClose_time();
standby_time = this.itemProtocol.getStandby_time();
production_time = this.itemProtocol.getProduction_time();
error_time = this.itemProtocol.getError_time();

View File

@@ -0,0 +1,131 @@
package org.nl.acs.device_driver.lnsh.lnsh_jcy;
import cn.hutool.core.util.StrUtil;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
import java.util.ArrayList;
import java.util.List;
@Slf4j
@Getter
@Setter
public class ItemProtocol {
public static String item_heartbeat = "heartbeat";
public static String item_mode = "mode";
public static String item_move = "move";
public static String item_action = "action";
public static String item_io_action = "io_action";
public static String item_error = "error";
public static String item_task = "task";
public static String item_barcode = "barcode";
public static String item_to_command = "to_command";
public static String item_to_target = "to_target";
public static String item_to_task = "to_task";
Boolean isonline;
private LnshJcyDeviceDriver driver;
public ItemProtocol(LnshJcyDeviceDriver driver) {
this.driver = driver;
}
public int getHeartbeat() {
return this.getOpcIntegerValue(item_heartbeat);
}
public int getMode() {
return this.getOpcIntegerValue(item_mode);
}
public int getMove() {
return this.getOpcIntegerValue(item_move);
}
public int getAction() {
return this.getOpcIntegerValue(item_action);
}
public int getIoAction() {
return this.getOpcIntegerValue(item_io_action);
}
public int getError() {
return this.getOpcIntegerValue(item_error);
}
public int getTask() {
return this.getOpcIntegerValue(item_task);
}
public int getBarcode() {
return this.getOpcIntegerValue(item_barcode);
}
public int getToCommand() {
return this.getOpcIntegerValue(item_to_command);
}
public int getToTarget() {
return this.getOpcIntegerValue(item_to_target);
}
public int getToTask() {
return this.getOpcIntegerValue(item_to_task);
}
//是否有货
public int hasGoods(int move) {
return move;
}
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if (value == null) {
// log.error(this.getDriver().getDeviceCode() + ":protocol " + protocol + " 信号同步异常!");
setIsonline(false);
} else {
setIsonline(true);
return value;
}
return 0;
}
public String getOpcStringValue(String protocol) {
String value = this.driver.getStringValue(protocol);
if (StrUtil.isBlank(value)) {
// log.error("读取错误!");
} else {
return value;
}
return "0";
}
public static List<ItemDto> getReadableItemDtos() {
ArrayList list = new ArrayList();
list.add(new ItemDto(item_heartbeat, "心跳", "DB81.B10"));
list.add(new ItemDto(item_mode, "工作模式", "DB81.B1", Boolean.valueOf(true)));
list.add(new ItemDto(item_move, "光电开关信号", "DB81.B2"));
list.add(new ItemDto(item_action, "取放信号", "DB81.B3"));
list.add(new ItemDto(item_io_action, "进出信号", "DB81.B4"));
list.add(new ItemDto(item_error, "报警信号", "DB81.B5"));
list.add(new ItemDto(item_task, "任务号", "DB81.D6"));
list.add(new ItemDto(item_barcode, "条码", "DB81.W66"));
return list;
}
public static List<ItemDto> getWriteableItemDtos() {
ArrayList list = new ArrayList();
list.add(new ItemDto(item_to_command, "作业命令", "DB71.W0", Boolean.valueOf(true)));
list.add(new ItemDto(item_to_target, "目标站", "DB71.W2"));
list.add(new ItemDto(item_to_task, "任务号", "DB71.D4"));
return list;
}
}

View File

@@ -0,0 +1,58 @@
package org.nl.acs.device_driver.lnsh.lnsh_jcy;
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
import org.nl.acs.device_driver.DeviceDriver;
import org.nl.acs.device_driver.defination.OpcDeviceDriverDefination;
import org.nl.acs.opc.Device;
import org.nl.acs.opc.DeviceType;
import org.springframework.stereotype.Service;
import java.util.LinkedList;
import java.util.List;
@Service
public class LnshJcyDefination implements OpcDeviceDriverDefination {
@Override
public String getDriverCode() {
return "lnsh_jcy";
}
@Override
public String getDriverName() {
return "标准-进出窑";
}
@Override
public String getDriverDescription() {
return "标准-进出窑";
}
@Override
public DeviceDriver getDriverInstance(Device device) {
return (new LnshJcyDeviceDriver()).setDevice(device).setDriverDefination(this);
}
@Override
public Class<? extends DeviceDriver> getDeviceDriverType() {
return LnshJcyDeviceDriver.class;
}
@Override
public List<DeviceType> getFitDeviceTypes() {
List<DeviceType> types = new LinkedList();
types.add(DeviceType.station);
return types;
}
@Override
public List<ItemDto> getReadableItemDtos() {
return ItemProtocol.getReadableItemDtos();
}
@Override
public List<ItemDto> getWriteableItemDtos() {
return ItemProtocol.getWriteableItemDtos();
}
}

View File

@@ -0,0 +1,640 @@
package org.nl.acs.device_driver.lnsh.lnsh_jcy;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.nl.acs.device.device_driver.standard_inspect.ReadUtil;
import org.nl.acs.device.service.DeviceService;
import org.nl.acs.device_driver.DeviceDriver;
import org.nl.acs.device_driver.RequestMethodEnum;
import org.nl.acs.device_driver.RouteableDeviceDriver;
import org.nl.acs.device_driver.StandardRequestMethod;
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.ext.wms.data.AcsToWmsData.applySignalStaus.ApplySignalStatusRequest;
import org.nl.acs.ext.wms.data.AcsToWmsData.applySignalStaus.ApplySignalStatusResponse;
import org.nl.acs.ext.wms.data.AcsToWmsData.applyTask.ApplyTaskRequest;
import org.nl.acs.ext.wms.data.AcsToWmsData.applyTask.ApplyTaskResponse;
import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.instruction.service.dto.Instruction;
import org.nl.acs.log.service.DeviceExecuteLogService;
import org.nl.acs.monitor.DeviceStageMonitor;
import org.nl.acs.opc.Device;
import org.nl.acs.opc.DeviceAppService;
import org.nl.acs.route.service.RouteLineService;
import org.nl.acs.task.service.TaskService;
import org.nl.modules.lucene.service.LuceneExecuteLogService;
import org.nl.modules.lucene.service.dto.LuceneLogDto;
import org.nl.modules.wql.util.SpringContextHolder;
import org.openscada.opc.lib.da.Server;
import java.lang.reflect.Method;
import java.util.*;
@Slf4j
@Getter
@Setter
@RequiredArgsConstructor
public class LnshJcyDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor, StandardRequestMethod {
protected ItemProtocol itemProtocol = new ItemProtocol(this);
LuceneExecuteLogService lucene = SpringContextHolder.getBean("luceneExecuteLogServiceImpl");
InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl");
DeviceService deviceservice = SpringContextHolder.getBean("deviceServiceImpl");
RouteLineService routelineserver = SpringContextHolder.getBean("routeLineServiceImpl");
TaskService taskserver = SpringContextHolder.getBean("taskServiceImpl");
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
DeviceAppService deviceAppService = SpringContextHolder.getBean("deviceAppServiceImpl");
AcsToWmsService acsToWmsService = SpringContextHolder.getBean("acsToWmsServiceImpl");
String device_code;
int mode = 0;
int error = 0;
int move = 0;
int action;
int io_action;
int task = 0;
int last_mode = 0;
int last_error = 0;
int last_move = 0;
int last_task = 0;
int last_action = 0;
int last_ioaction = 0;
Boolean isonline = true;
int hasGoods = 0;
Boolean iserror = false;
protected int instruction_num = 0;
protected int instruction_num_truth = 0;
Integer heartbeat_tag;
private Date instruction_require_time = new Date();
private Date instruction_finished_time = new Date();
private int instruction_require_time_out = 3000;
boolean requireSucess = false;
private int instruction_finished_time_out;
int heartbeat;
int last_heartbeat;
private Date checkHeartbeattime = new Date();
private Date last_checkHeartbeattime = new Date();
int branchProtocol = 0;
//当前指令
Instruction inst = null;
//上次指令
Instruction last_inst = null;
//触摸屏手动触发任务
private Boolean is_has_task = false;
//暂定 0就绪 1请求取货 2取货完成 3请求放货 4放货完成 5取货完成离开 6放货完成离开 7请求进入区域 8请求离开区域
int flag;
String message;
int weight = 0;
int last_weight = 0;
String material;
String last_material;
int barcode;
int last_barcode;
@Override
public Device getDevice() {
return this.device;
}
@Override
public void execute() {
message = null;
try {
device_code = this.getDeviceCode();
mode = this.itemProtocol.getMode();
error = this.itemProtocol.getError();
move = this.itemProtocol.getMove();
task = this.itemProtocol.getTask();
hasGoods = this.itemProtocol.getMove();
io_action = this.itemProtocol.getIoAction();
action = this.itemProtocol.getAction();
barcode = this.itemProtocol.getBarcode();
if (mode != last_mode) {
if(mode==2){
Map<String, Object> map = new LinkedHashMap<>();
map.put("to_command",0);
this.writing(map);
}
this.setRequireSucess(false);
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode));
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode" + last_mode + " -> " + mode);
lucene.deviceItemValue(this.device_code, "mode", String.valueOf(mode));
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "信号mode:" + last_mode + " -> " + mode));
}
if (move != last_move) {
logServer.deviceItemValue(this.device_code, "move", String.valueOf(move));
logServer.deviceExecuteLog(this.device_code, "", "", "信号move" + last_move + " -> " + move);
lucene.deviceItemValue(this.device_code, "move", String.valueOf(move));
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "信号mode:" + last_move + " -> " + move));
if ("true".equals(this.device.getExtraValue().get("sendDeviceStatus"))) {
ApplySignalStatusRequest request = new ApplySignalStatusRequest();
request.setDevice_code(this.getDevice_code());
request.setRequest_method_code(RequestMethodEnum.real_time_set_point.getCode());
request.setRequest_method_name(RequestMethodEnum.real_time_set_point.getName());
request.setMove(String.valueOf(move));
ApplySignalStatusResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)), ApplySignalStatusResponse.class);
message = RequestMethodEnum.getName("real_time_set_point") + "real_time_set_point 接口请求LMS...";
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request)));
if (resp.getCode() == 200) {
message = RequestMethodEnum.getName("real_time_set_point") + "real_time_set_point 接口请求成功" + resp.getMessage();
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "返回参数:" + JSON.toJSONString(request)));
} else {
message = RequestMethodEnum.getName("real_time_set_point") + "real_time_set_point 接口请求失败" + resp.getMessage();;
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "返回参数:" + JSON.toJSONString(request)));
}
}
}
if (error != last_error) {
logServer.deviceItemValue(this.device_code, "error", String.valueOf(error));
logServer.deviceExecuteLog(this.device_code, "", "", "信号error" + last_error + " -> " + error);
lucene.deviceItemValue(this.device_code, "error", String.valueOf(error));
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "信号error" + last_error + " -> " + error));
}
if (task != last_task) {
logServer.deviceItemValue(this.device_code, "task", String.valueOf(task));
logServer.deviceExecuteLog(this.device_code, "", "", "信号task" + last_task + " -> " + task);
lucene.deviceItemValue(this.device_code, "task", String.valueOf(task));
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "信号task" + last_task + " -> " + task));
}
if (action != last_action) {
logServer.deviceItemValue(this.device_code, "action", String.valueOf(action));
logServer.deviceExecuteLog(this.device_code, "", "", "信号action" + last_action + " -> " + action);
lucene.deviceItemValue(this.device_code, "action", String.valueOf(action));
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "信号action" + last_action + " -> " + action));
if ("true".equals(this.device.getExtraValue().get("sendDeviceStatus"))) {
ApplySignalStatusRequest request = new ApplySignalStatusRequest();
request.setDevice_code(this.getDevice_code());
request.setRequest_method_code(RequestMethodEnum.real_time_set_point.getCode());
request.setRequest_method_name(RequestMethodEnum.real_time_set_point.getName());
request.setAction(String.valueOf(action));
ApplySignalStatusResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)), ApplySignalStatusResponse.class);
message = RequestMethodEnum.getName("real_time_set_point") + "real_time_set_point 接口请求LMS...";
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request)));
if (resp.getCode() == 200) {
message = RequestMethodEnum.getName("real_time_set_point") + "real_time_set_point 接口请求成功" + resp.getMessage();;
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "返回参数:" + JSON.toJSONString(request)));
} else {
message = RequestMethodEnum.getName("real_time_set_point") + "real_time_set_point 接口请求失败" + resp.getMessage();;
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "返回参数:" + JSON.toJSONString(request)));
}
}
}
if (io_action != last_ioaction) {
logServer.deviceItemValue(this.device_code, "io_action", String.valueOf(io_action));
logServer.deviceExecuteLog(this.device_code, "", "", "信号io_action: " + last_ioaction + " -> " + io_action);
lucene.deviceItemValue(this.device_code, "io_action", String.valueOf(io_action));
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "信号action" + last_action + " -> " + action));
}
if (weight != last_weight) {
logServer.deviceItemValue(this.device_code, "weight", String.valueOf(weight));
logServer.deviceExecuteLog(this.device_code, "", "", "信号weight: " + last_weight + " -> " + weight);
lucene.deviceItemValue(this.device_code, "weight", String.valueOf(weight));
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "信号weight: " + last_weight + " -> " + weight));
}
if (!StrUtil.equals(material, last_material)) {
logServer.deviceItemValue(this.device_code, "material", material);
logServer.deviceExecuteLog(this.device_code, "", "", "信号material" + last_material + " -> " + material);
lucene.deviceItemValue(this.device_code, "material", String.valueOf(material));
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "信号material" + last_material + " -> " + material));
}
if (barcode != last_barcode) {
logServer.deviceItemValue(this.device_code, "barcode", String.valueOf(barcode));
logServer.deviceExecuteLog(this.device_code, "", "", "信号barcode" + last_barcode + " -> " + barcode);
lucene.deviceItemValue(this.device_code, "barcode", String.valueOf(barcode));
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "信号barcode" + last_barcode + " -> " + barcode));
}
} catch (Exception var17) {
return;
}
//急停
if (this.isStop()) {
//未联机
} else if (mode == 0) {
this.setIsonline(false);
this.setIserror(true);
message = "未联机";
//有报警
} else if (error != 0) {
this.setIsonline(false);
this.setIserror(true);
message = "有报警";
//无报警
} else {
this.setIsonline(true);
this.setIserror(false);
message = "";
Instruction instruction = null;
List toInstructions;
if (mode > 2 && !requireSucess) {
if (ObjectUtil.isNotEmpty(this.device.getExtraValue().get(String.valueOf(mode)))) {
String modethod = this.device.getExtraValue().get(String.valueOf(mode)).toString();
try {
applyRequest(modethod);
} catch (Exception e) {
message = "错误:" + e.getMessage();
this.setIserror(true);
}
} else {
message = "无效模式请求,驱动未配置此请求方法";
}
} else {
message = "无请求";
}
}
last_mode = mode;
last_error = error;
last_move = move;
last_task = task;
last_action = action;
last_ioaction = io_action;
last_weight = weight;
last_material = material;
last_barcode = barcode;
}
public boolean exe_error() {
if (this.error == 0) {
return true;
} else {
log.debug("设备报警");
return false;
}
}
public boolean exe_business() {
return true;
}
protected void executing(Instruction instruction) {
this.executing(1, instruction, "");
}
public void executing(int command, Instruction instruction, String appendMessage) {
String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
+ "." + org.nl.acs.device_driver.lnsh.lnsh_station.ItemProtocol.item_to_command;
String to_target = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
+ "." + org.nl.acs.device_driver.lnsh.lnsh_station.ItemProtocol.item_to_target;
String to_task = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
+ "." + org.nl.acs.device_driver.lnsh.lnsh_station.ItemProtocol.item_to_task;
if (appendMessage == null) {
appendMessage = "";
}
if (instruction != null) {
instruction_num = Integer.parseInt(instruction.getInstruction_code());
}
String opcservcerid = this.getDevice().getOpc_server_id();
Server server = ReadUtil.getServer(opcservcerid);
Map<String, Object> itemMap = new HashMap<String, Object>();
itemMap.put(to_command, 1);
itemMap.put(to_task, instruction_num);
ReadUtil.write(itemMap, server);
server.disconnect();
}
public void executing(Server server, Map<String, Object> itemMap) {
ReadUtil.write(itemMap, server);
server.disconnect();
}
public void writing(int type, int command) {
String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
+ "." + org.nl.acs.device_driver.lnsh.lnsh_station.ItemProtocol.item_to_command;
String to_target = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
+ "." + org.nl.acs.device_driver.lnsh.lnsh_station.ItemProtocol.item_to_target;
String to_task = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
+ "." + org.nl.acs.device_driver.lnsh.lnsh_station.ItemProtocol.item_to_task;
String opcservcerid = this.getDevice().getOpc_server_id();
Server server = ReadUtil.getServer(opcservcerid);
Map<String, Object> itemMap = new HashMap<String, Object>();
if (type == 1) {
itemMap.put(to_command, command);
logServer.deviceExecuteLog(this.device_code, "", "", "to_command 写入 " + command);
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "to_command 写入 " + command));
} else if (type == 2) {
itemMap.put(to_target, command);
logServer.deviceExecuteLog(this.device_code, "", "", "to_target 写入 " + command);
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "to_target 写入 " + command));
} else if (type == 3) {
itemMap.put(to_task, command);
logServer.deviceExecuteLog(this.device_code, "", "", "to_task 写入 " + command);
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "to_task 写入 " + command));
}
ReadUtil.write(itemMap, server);
server.disconnect();
}
/**
* 多个信号一起下发电气
*
* @param map
*/
public void writing(Map<String, Object> map) {
LuceneExecuteLogService lucene = SpringContextHolder.getBean(LuceneExecuteLogService.class);
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
Map<String, Object> itemMap = new LinkedHashMap<>();
map.forEach((key, value) -> {
if (ObjectUtil.isNotEmpty(value)) {
itemMap.put(getToParam() + key, value);
}
});
if (ObjectUtil.isNotEmpty(itemMap)) {
try {
this.checkcontrol(itemMap);
} catch (Exception e) {
e.printStackTrace();
try{
this.checkcontrol(itemMap);
} catch (Exception e1){
e1.printStackTrace();
}
}
logServer.deviceExecuteLog(this.getDevice().getDevice_code(), "", "", "下发多个电气信号:" + itemMap);
lucene.deviceExecuteLog(new LuceneLogDto(this.getDeviceCode(), "下发多个电气信号:" + itemMap));
}
}
/**
* 抽取统一下发电气信号前缀
*
* @return
*/
public String getToParam() {
return this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() + ".";
}
public void writing(String param, String value) {
String to_param = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
+ "." + param;
String opcservcerid = this.getDevice().getOpc_server_id();
Server server = ReadUtil.getServer(opcservcerid);
Map<String, Object> itemMap = new HashMap<String, Object>();
if (value instanceof String) {
itemMap.put(to_param, value);
} else {
itemMap.put(to_param, value);
}
ReadUtil.write(itemMap, server);
server.disconnect();
logServer.deviceExecuteLog(this.device_code, "", "", param + " 写入 " + value);
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + param + " 写入 " + value));
}
public void writing(int command) {
String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
+ "." + ItemProtocol.item_to_command;
String opcservcerid = this.getDevice().getOpc_server_id();
Server server = ReadUtil.getServer(opcservcerid);
Map<String, Object> itemMap = new HashMap<String, Object>();
itemMap.put(to_command, command);
ReadUtil.write(itemMap, server);
ReadUtil.write(itemMap, server);
server.disconnect();
logServer.deviceExecuteLog(this.device_code, "", "", "to_command 写入 " + command);
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "to_command 写入 " + command));
}
public synchronized void OpenOrClose(String type) {
//进入区域
if ("1".equals(type)) {
writing(5);
} else {
//离开区域
writing(6);
}
}
public String toString() {
return "";
}
@Override
public JSONObject getDeviceStatusName() throws Exception {
String move;
String action;
String io_action;
boolean hasGoods;
if (this.move == 0) {
move = "无货";
hasGoods = false;
} else {
move = "有货";
hasGoods = true;
}
switch (this.action) {
case 1:
action = "允许取货";
break;
case 2:
action = "允许放货";
break;
case 3:
action = "允许取放";
break;
default:
action = "禁止取放";
}
switch (this.io_action) {
case 1:
io_action = "允许进入";
break;
case 2:
io_action = "允许离开";
break;
case 3:
io_action = "允许进入离开";
break;
default:
io_action = "禁止进入离开";
}
String error;
switch (this.error) {
case 1:
error = "急停中";
break;
case 2:
error = "光幕报警";
break;
case 3:
error = "本体报警";
break;
case 4:
error = "未排产报警";
break;
case 5:
error = "扫码故障";
break;
default:
error = String.valueOf(this.error);
}
JSONObject jo = new JSONObject();
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode);
Object requestNo = this.getExtraValue().get(String.valueOf(this.mode));
if(ObjectUtil.isNotEmpty(requestNo)){
jo.put("modeName", this.getModeName(String.valueOf(requestNo)));
} else {
jo.put("modeName", "无效的请求,驱动中未配置");
}
jo.put("move", move);
jo.put("action", action);
jo.put("io_action", io_action);
jo.put("error", error);
jo.put("task", task);
jo.put("weight", weight);
jo.put("barcode", barcode);
jo.put("isError", iserror);
jo.put("isOnline", isonline);
jo.put("hasGoods", hasGoods);
jo.put("message", message);
jo.put("hasGoods",hasGoods);
return jo;
}
@Override
public void setDeviceStatus(JSONObject data) {
}
/**
* 请求
*
* @param
*/
public synchronized boolean applyRequest(String modethod) throws Exception {
Object obj1 = this;
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);
return false;
} else {
this.instruction_require_time = date;
Object obj = this.getClass().getDeclaredConstructor().newInstance();
Method method1 = this.getClass().getMethod(modethod, null);
method1.invoke(this, null);
return true;
}
}
/**
* 扫码成功申请
*
* @param
*/
public synchronized boolean barcode_success_apply() {
if(move > 0) {
ApplyTaskRequest request = new ApplyTaskRequest();
request.setDevice_code(this.getDevice_code());
request.setRequest_method_code(Thread.currentThread().getStackTrace()[1].getMethodName());
request.setRequest_method_name(RequestMethodEnum.getName(Thread.currentThread().getStackTrace()[1].getMethodName()));
request.setWeight(String.valueOf(weight));
request.setVehicle_code(String.valueOf(barcode));
ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class);
message = RequestMethodEnum.getName("barcode_success_apply") + "barcode_success_apply 接口请求LMS...";
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request)));
if (resp.getCode() == 200) {
Map<String, Object> map = new LinkedHashMap<>();
map.put("to_command",200);
this.writing(map);
this.setRequireSucess(true);
message = RequestMethodEnum.getName("barcode_success_apply") + "barcode_success_apply 接口请求成功" + resp.getMessage();
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "返回参数:" + JSON.toJSONString(resp)));
} else {
Map<String, Object> map = new LinkedHashMap<>();
map.put("to_command",400);
this.writing(map);
message = RequestMethodEnum.getName("barcode_success_apply") + "barcode_success_apply 接口请求失败" + resp.getMessage();
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "返回参数:" + JSON.toJSONString(resp)));
}
return true;
} else {
message = RequestMethodEnum.getName("barcode_success_apply") + "barcode_success_apply 设备无货未请求LMS...";
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message));
return false;
}
}
/**
* 获取组盘信息
*
* @param
*/
public synchronized boolean get_vehicle_info() {
if(move > 0) {
ApplyTaskRequest request = new ApplyTaskRequest();
request.setDevice_code(this.getDevice_code());
request.setRequest_method_code(Thread.currentThread().getStackTrace()[1].getMethodName());
request.setRequest_method_name(RequestMethodEnum.getName(Thread.currentThread().getStackTrace()[1].getMethodName()));
request.setWeight(String.valueOf(weight));
request.setVehicle_code(String.valueOf(barcode));
ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class);
message = RequestMethodEnum.getName("get_vehicle_info") + "get_vehicle_info 接口请求LMS...";
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request)));
if (resp.getCode() == 200) {
Map<String, Object> map = new LinkedHashMap<>();
map.put("to_command",200);
this.writing(map);
this.setRequireSucess(true);
} else {
Map<String, Object> map = new LinkedHashMap<>();
map.put("to_command",400);
this.writing(map);
message = RequestMethodEnum.getName("get_vehicle_info") + "get_vehicle_info 接口请求失败" + resp.getMessage();;
}
return true;
} else {
message = RequestMethodEnum.getName("get_vehicle_info") + "get_vehicle_info 设备无货未请求LMS...";
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message));
return false;
}
}
}

View File

@@ -173,7 +173,8 @@ public class LnshMixingMillDeviceDriver extends AbstractOpcDeviceDriver implemen
this.setIserror(true);
message = "有报警";
//无报警
} else if (mode == 6) {
}
else if (mode == 6) {
message = "泥料号输入不正确";
}
else {

View File

@@ -27,7 +27,7 @@ public class ItemProtocol {
public static String item_production_time = "production_time";
public static String item_error_time = "error_time";
public static String item_order_No = "order_No";
public static String item_formula = "formula";
// public static String item_formula = "formula";
public static String item_product_code = "product_code";
public static String item_AlongSide = "AlongSide";
public static String item_BshortSide = "BshortSide";
@@ -50,7 +50,7 @@ public class ItemProtocol {
public static String item_to_on_vehicle_qty = "to_on_vehicle_qty";
public static String item_to_vehicle_type = "to_vehicle_type";
public static String item_to_tray_qty = "to_tray_qty";
public static String item_to_formula = "to_formula";
// public static String item_to_formula = "to_formula";
private LnshPackagePalletManipulatorDeviceDriver driver;
public ItemProtocol(LnshPackagePalletManipulatorDeviceDriver driver) {
@@ -62,9 +62,9 @@ public class ItemProtocol {
}
public String getFormula() {
return this.getOpcStringValue(item_formula);
}
// public String getFormula() {
// return this.getOpcStringValue(item_formula);
// }
public int getToTrayQty() {
return this.getOpcIntegerValue(item_to_tray_qty);
}
@@ -101,9 +101,9 @@ public class ItemProtocol {
return this.getOpcIntegerValue(item_qty);
}
public int getToFormula() {
return this.getOpcIntegerValue(item_to_formula);
}
// public int getToFormula() {
// return this.getOpcIntegerValue(item_to_formula);
// }
public int getOrder_qty() {
return this.getOpcIntegerValue(item_order_qty);
@@ -243,7 +243,7 @@ public class ItemProtocol {
list.add(new ItemDto(item_order_No, "工单号", "DB80.STRING128.50"));
list.add(new ItemDto(item_grab_station, "当前抓取工位", "DB80.B130"));
list.add(new ItemDto(item_place_station, "当前放置工位", "DB80.B132"));
list.add(new ItemDto(item_formula, "配方代号", "DB80.STRING182.50"));
// list.add(new ItemDto(item_formula, "配方代号", "DB80.STRING182.50"));
// list.add(new ItemDto(item_product_code, "产品编号", "DB1.W184"));
// list.add(new ItemDto(item_AlongSide, "A长边", "DB1.W186"));
// list.add(new ItemDto(item_BshortSide, "B短边", "DB1.W188"));
@@ -267,7 +267,7 @@ public class ItemProtocol {
list.add(new ItemDto(item_to_BshortSide, "B短边", "DB81.W66"));
list.add(new ItemDto(item_to_Htrapezoidal, "H梯形高", "DB81.W68"));
list.add(new ItemDto(item_to_Wthickness, "W厚度", "DB81.W70"));
list.add(new ItemDto(item_to_formula, "配方代号", "DB81.STRING124.50"));
// list.add(new ItemDto(item_to_formula, "配方代号", "DB81.STRING124.50"));
return list;
}

View File

@@ -16,7 +16,7 @@ public class ItemProtocol {
public static String item_mode = "mode";
public static String item_move = "move";
public static String item_action = "action";
public static String item_ioaction = "ioaction";
public static String item_io_action = "io_action";
public static String item_error = "error";
public static String item_vehicle_code = "vehicle_code";
public static String item_vehicle_type = "vehicle_type";
@@ -78,7 +78,7 @@ public class ItemProtocol {
}
public int getIoaction() {
return this.getOpcIntegerValue(item_ioaction);
return this.getOpcIntegerValue(item_io_action);
}
public int getError() {
@@ -139,7 +139,7 @@ public class ItemProtocol {
list.add(new ItemDto(item_mode, "工作模式", "DB51.B1", Boolean.valueOf(true)));
list.add(new ItemDto(item_move, "光电开关信号", "DB51.B2"));
list.add(new ItemDto(item_action, "取放信号", "DB51.B3"));
list.add(new ItemDto(item_ioaction, "进出信号", "DB51.B4"));
list.add(new ItemDto(item_io_action, "进出信号", "DB51.B4"));
list.add(new ItemDto(item_error, "报警信号", "DB51.B5"));
list.add(new ItemDto(item_task, "任务号", "DB51.D6"));
list.add(new ItemDto(item_is_weight, "重量", "DB51.D10"));

View File

@@ -61,7 +61,7 @@ public class LnshPackageSiteDefination implements OpcDeviceDriverDefination {
list.add(new ItemDto(ItemProtocol.item_mode, "工作模式", "DB51.B1", Boolean.TRUE));
list.add(new ItemDto(ItemProtocol.item_move, "光电开关信号", "DB51.B2"));
list.add(new ItemDto(ItemProtocol.item_action, "取放信号", "DB51.B3"));
list.add(new ItemDto(ItemProtocol.item_ioaction, "进出信号", "DB51.B4"));
list.add(new ItemDto(ItemProtocol.item_io_action, "进出信号", "DB51.B4"));
list.add(new ItemDto(ItemProtocol.item_error, "报警信号", "DB51.B5"));
list.add(new ItemDto(ItemProtocol.item_task, "任务号", "DB51.B6"));
list.add(new ItemDto(ItemProtocol.item_is_weight, "重量", "DB51.B10"));

View File

@@ -215,42 +215,42 @@ public class ItemProtocol {
public static List<ItemDto> getReadableItemDtos() {
ArrayList list = new ArrayList();
list.add(new ItemDto(item_heartbeat, "心跳", "DB112.B0"));
list.add(new ItemDto(item_mode, "工作模式", "DB112.B1", Boolean.valueOf(true)));
list.add(new ItemDto(item_status, "设备状态", "DB112.B2"));
list.add(new ItemDto(item_status, "设备动作", "DB112.B3"));
list.add(new ItemDto(item_error, "故障代码", "DB112.B4"));
list.add(new ItemDto(item_open_time, "开机时间", "DB112.STRING6.50"));
list.add(new ItemDto(item_standby_time, "待机时间", "DB112.D58"));
list.add(new ItemDto(item_production_time, "生产时间", "DB112.D62"));
list.add(new ItemDto(item_error_time, "故障时间", "DB112.D66"));
list.add(new ItemDto(item_get_station, "当前抓取工位", "DB112.B70"));
list.add(new ItemDto(item_put_station, "当前放置工位", "DB112.B71"));
list.add(new ItemDto(item_is_qualified, "是否合格", "DB112.B72"));
list.add(new ItemDto(item_laser_marking_code, "激光标刻码", "DB112.STRING74.50"));
list.add(new ItemDto(item_grinding_number, "碾次", "DB112.STRING126.50"));
list.add(new ItemDto(item_height1, "高度1", "DB112.REAL178"));
list.add(new ItemDto(item_height2, "高度2", "DB112.REAL182"));
list.add(new ItemDto(item_height3, "高度3", "DB112.REAL186"));
list.add(new ItemDto(item_height4, "高度4", "DB112.REAL190"));
list.add(new ItemDto(item_width1, "宽度1", "DB112.REAL194"));
list.add(new ItemDto(item_width2, "宽度2", "DB112.REAL198"));
list.add(new ItemDto(item_len, "长度", "DB112.REAL202"));
list.add(new ItemDto(item_volume, "体积", "DB112.REAL206"));
list.add(new ItemDto(item_flatness, "平面度", "DB112.REAL210"));
list.add(new ItemDto(item_unqualified_qty, "缺陷个数", "DB112.REAL214"));
list.add(new ItemDto(item_weight, "重量", "DB112.REAL218"));
list.add(new ItemDto(item_error_cause, "故障原因", "DB112.B223"));
list.add(new ItemDto(item_heartbeat, "心跳", "DB401.B0"));
list.add(new ItemDto(item_mode, "工作模式", "DB401.B1", Boolean.valueOf(true)));
list.add(new ItemDto(item_status, "设备状态", "DB401.B2"));
list.add(new ItemDto(item_status, "设备动作", "DB401.B3"));
list.add(new ItemDto(item_error, "故障代码", "DB401.B4"));
list.add(new ItemDto(item_open_time, "开机时间", "DB401.STRING6.50"));
list.add(new ItemDto(item_standby_time, "待机时间", "DB401.D58"));
list.add(new ItemDto(item_production_time, "生产时间", "DB401.D62"));
list.add(new ItemDto(item_error_time, "故障时间", "DB401.D66"));
list.add(new ItemDto(item_get_station, "当前抓取工位", "DB401.B70"));
list.add(new ItemDto(item_put_station, "当前放置工位", "DB401.B71"));
list.add(new ItemDto(item_is_qualified, "是否合格", "DB401.B72"));
list.add(new ItemDto(item_laser_marking_code, "激光标刻码", "DB401.STRING74.50"));
list.add(new ItemDto(item_grinding_number, "碾次", "DB401.STRING126.50"));
list.add(new ItemDto(item_height1, "高度1", "DB401.REAL178"));
list.add(new ItemDto(item_height2, "高度2", "DB401.REAL182"));
list.add(new ItemDto(item_height3, "高度3", "DB401.REAL186"));
list.add(new ItemDto(item_height4, "高度4", "DB401.REAL190"));
list.add(new ItemDto(item_width1, "宽度1", "DB401.REAL194"));
list.add(new ItemDto(item_width2, "宽度2", "DB401.REAL198"));
list.add(new ItemDto(item_len, "长度", "DB401.REAL202"));
list.add(new ItemDto(item_volume, "体积", "DB401.REAL206"));
list.add(new ItemDto(item_flatness, "平面度", "DB401.REAL210"));
list.add(new ItemDto(item_unqualified_qty, "缺陷个数", "DB401.REAL214"));
list.add(new ItemDto(item_weight, "重量", "DB401.REAL218"));
list.add(new ItemDto(item_error_cause, "故障原因", "DB401.B223"));
return list;
}
public static List<ItemDto> getWriteableItemDtos() {
ArrayList list = new ArrayList();
list.add(new ItemDto(item_to_command, "反馈", "DB113.W0", Boolean.TRUE));
list.add(new ItemDto(item_to_error, "error", "DB113.W2"));
list.add(new ItemDto(item_to_order_No, "工单号", "DB113.STRING4.50"));
list.add(new ItemDto(item_to_weight, "生产重量", "DB113.D56"));
list.add(new ItemDto(item_to_material_code, "下发物料编号", "DB113.STRING60.50"));
list.add(new ItemDto(item_to_command, "反馈", "DB401.W224", Boolean.TRUE));
list.add(new ItemDto(item_to_error, "error", "DB401.W226"));
list.add(new ItemDto(item_to_order_No, "工单号", "DB401.STRING228.50"));
list.add(new ItemDto(item_to_weight, "生产重量", "DB401.D280"));
list.add(new ItemDto(item_to_material_code, "下发物料编号", "DB401.STRING284.50"));
return list;
}

View File

@@ -263,68 +263,68 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic
weight = this.itemProtocol.getWeight();
material = this.itemProtocol.getMaterial();
barcode = this.itemProtocol.getBarcode();
AlongSide = this.itemProtocol.getAlongSide();
BshortSide = this.itemProtocol.getBshortSide();
Htrapezoidal = this.itemProtocol.getHtrapezoidal();
Wthickness = this.itemProtocol.getWthickness();
// AlongSide = this.itemProtocol.getAlongSide();
// BshortSide = this.itemProtocol.getBshortSide();
// Htrapezoidal = this.itemProtocol.getHtrapezoidal();
// Wthickness = this.itemProtocol.getWthickness();
encoder_qty = this.itemProtocol.getEncoder_qty();
unqualified_qty = this.itemProtocol.getUnqualified_qty();
product_code = this.itemProtocol.getProduct_code();
AlongSide = this.itemProtocol.getAlongSide();
BshortSide = this.itemProtocol.getBshortSide();
Htrapezoidal = this.itemProtocol.getHtrapezoidal();
Wthickness = this.itemProtocol.getWthickness();
tray_qty = this.itemProtocol.getTray_qty();
tray_high = this.itemProtocol.getTray_high();
crib_category = this.itemProtocol.getCrib_category();
palletX1_line = this.itemProtocol.getPalletX1_line();
palletY1_row = this.itemProtocol.getPalletY1_row();
palletA1_angle = this.itemProtocol.getPalletA1_angle();
palletX2_line = this.itemProtocol.getPalletX2_line();
palletY2_row = this.itemProtocol.getPalletY2_row();
palletA2_angle = this.itemProtocol.getPalletA2_angle();
palletX3_line = this.itemProtocol.getPalletX3_line();
palletY3_row = this.itemProtocol.getPalletY3_row();
palletA3_angle = this.itemProtocol.getPalletA3_angle();
pressCribX1_line = this.itemProtocol.getPressCribX1_line();
pressCribY1_row = this.itemProtocol.getPressCribY1_row();
pressCribA1_angle = this.itemProtocol.getPressCribA1_angle();
pressCribX2_line = this.itemProtocol.getPressCribX2_line();
pressCribY2_row = this.itemProtocol.getPressCribY2_row();
pressCribA2_angle = this.itemProtocol.getPressCribA2_angle();
pressCribX3_line = this.itemProtocol.getPressCribX3_line();
pressCribY3_row = this.itemProtocol.getPressCribY3_row();
pressCribA3_angle = this.itemProtocol.getPressCribA3_angle();
Zoffset = this.itemProtocol.getZoffset();
pallet_layerQty = this.itemProtocol.getPallet_layerQty();
pressCrib_layerQty = this.itemProtocol.getPressCrib_layerQty();
codeLayerX1_interval = this.itemProtocol.getCodeLayerX1_interval();
codeLayerY1_interval = this.itemProtocol.getCodeLayerY1_interval();
codeLayerX2_interval = this.itemProtocol.getCodeLayerX2_interval();
codeLayerY2_interval = this.itemProtocol.getCodeLayerY2_interval();
codeLayerX3_interval = this.itemProtocol.getCodeLayerX3_interval();
codeLayerY3_interval = this.itemProtocol.getcodeLayerY3_interval();
codeLayerX1_offset = this.itemProtocol.getCodeLayerX1_offset();
codeLayerY1_offset = this.itemProtocol.getCodeLayerY1_offset();
codeLayerX2_offset = this.itemProtocol.getCodeLayerX2_offset();
codeLayerY2_offset = this.itemProtocol.getCodeLayerY2_offset();
codeLayerX3_offset = this.itemProtocol.getCodeLayerX3_offset();
codeLayerY3_offset = this.itemProtocol.getCodeLayerY3_offset();
pressLayerX1_interval = this.itemProtocol.getPressLayerX1_interval();
pressLayerY1_interval = this.itemProtocol.getPressLayerY1_interval();
pressLayerX2_interval = this.itemProtocol.getPressLayerX2_interval();
pressLayerY2_interval = this.itemProtocol.getPressLayerY2_interval();
pressLayerX3_interval = this.itemProtocol.getPressLayerX3_interval();
pressLayerY3_interval = this.itemProtocol.getPressLayerY3_interval();
pressLayerX1_offset = this.itemProtocol.getPressLayerX1_offset();
pressLayerY1_offset = this.itemProtocol.getPressLayerY1_offset();
pressLayerX2_offset = this.itemProtocol.getPressLayerX2_offset();
pressLayerY2_offset = this.itemProtocol.getPressLayerY2_offset();
pressLayerX3_offset = this.itemProtocol.getPressLayerX3_offset();
pressLayerY3_offset = this.itemProtocol.getPressLayerY3_offset();
tool_coordinate = this.itemProtocol.getTool_coordinate();
tool_coordinate = this.itemProtocol.getTool_coordinate();
// product_code = this.itemProtocol.getProduct_code();
// AlongSide = this.itemProtocol.getAlongSide();
// BshortSide = this.itemProtocol.getBshortSide();
// Htrapezoidal = this.itemProtocol.getHtrapezoidal();
// Wthickness = this.itemProtocol.getWthickness();
// tray_qty = this.itemProtocol.getTray_qty();
// tray_high = this.itemProtocol.getTray_high();
// crib_category = this.itemProtocol.getCrib_category();
// palletX1_line = this.itemProtocol.getPalletX1_line();
// palletY1_row = this.itemProtocol.getPalletY1_row();
// palletA1_angle = this.itemProtocol.getPalletA1_angle();
// palletX2_line = this.itemProtocol.getPalletX2_line();
// palletY2_row = this.itemProtocol.getPalletY2_row();
// palletA2_angle = this.itemProtocol.getPalletA2_angle();
// palletX3_line = this.itemProtocol.getPalletX3_line();
// palletY3_row = this.itemProtocol.getPalletY3_row();
// palletA3_angle = this.itemProtocol.getPalletA3_angle();
// pressCribX1_line = this.itemProtocol.getPressCribX1_line();
// pressCribY1_row = this.itemProtocol.getPressCribY1_row();
// pressCribA1_angle = this.itemProtocol.getPressCribA1_angle();
// pressCribX2_line = this.itemProtocol.getPressCribX2_line();
// pressCribY2_row = this.itemProtocol.getPressCribY2_row();
// pressCribA2_angle = this.itemProtocol.getPressCribA2_angle();
// pressCribX3_line = this.itemProtocol.getPressCribX3_line();
// pressCribY3_row = this.itemProtocol.getPressCribY3_row();
// pressCribA3_angle = this.itemProtocol.getPressCribA3_angle();
// Zoffset = this.itemProtocol.getZoffset();
// pallet_layerQty = this.itemProtocol.getPallet_layerQty();
// pressCrib_layerQty = this.itemProtocol.getPressCrib_layerQty();
// codeLayerX1_interval = this.itemProtocol.getCodeLayerX1_interval();
// codeLayerY1_interval = this.itemProtocol.getCodeLayerY1_interval();
// codeLayerX2_interval = this.itemProtocol.getCodeLayerX2_interval();
// codeLayerY2_interval = this.itemProtocol.getCodeLayerY2_interval();
// codeLayerX3_interval = this.itemProtocol.getCodeLayerX3_interval();
// codeLayerY3_interval = this.itemProtocol.getcodeLayerY3_interval();
// codeLayerX1_offset = this.itemProtocol.getCodeLayerX1_offset();
// codeLayerY1_offset = this.itemProtocol.getCodeLayerY1_offset();
// codeLayerX2_offset = this.itemProtocol.getCodeLayerX2_offset();
// codeLayerY2_offset = this.itemProtocol.getCodeLayerY2_offset();
// codeLayerX3_offset = this.itemProtocol.getCodeLayerX3_offset();
// codeLayerY3_offset = this.itemProtocol.getCodeLayerY3_offset();
// pressLayerX1_interval = this.itemProtocol.getPressLayerX1_interval();
// pressLayerY1_interval = this.itemProtocol.getPressLayerY1_interval();
// pressLayerX2_interval = this.itemProtocol.getPressLayerX2_interval();
// pressLayerY2_interval = this.itemProtocol.getPressLayerY2_interval();
// pressLayerX3_interval = this.itemProtocol.getPressLayerX3_interval();
// pressLayerY3_interval = this.itemProtocol.getPressLayerY3_interval();
// pressLayerX1_offset = this.itemProtocol.getPressLayerX1_offset();
// pressLayerY1_offset = this.itemProtocol.getPressLayerY1_offset();
// pressLayerX2_offset = this.itemProtocol.getPressLayerX2_offset();
// pressLayerY2_offset = this.itemProtocol.getPressLayerY2_offset();
// pressLayerX3_offset = this.itemProtocol.getPressLayerX3_offset();
// pressLayerY3_offset = this.itemProtocol.getPressLayerY3_offset();
// tool_coordinate = this.itemProtocol.getTool_coordinate();
// tool_coordinate = this.itemProtocol.getTool_coordinate();
if (mode != last_mode) {
this.setRequireSucess(false);
if(mode==2){
@@ -1268,8 +1268,6 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic
+ "." + ItemProtocol.item_to_target;
String to_task = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
+ "." + ItemProtocol.item_to_task;
String to_tray_qty = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
+ "." + ItemProtocol.item_to_tray_qty;
String opcservcerid = this.getDevice().getOpc_server_id();
Server server = ReadUtil.getServer(opcservcerid);
Map<String, Object> itemMap = new HashMap<String, Object>();
@@ -1279,8 +1277,6 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic
itemMap.put(to_target, command);
} else if (type == 3) {
itemMap.put(to_task, command);
}else if(type==4){
itemMap.put(to_tray_qty, command);
}
ReadUtil.write(itemMap, server);
server.disconnect();
@@ -1465,30 +1461,30 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic
String Zoffset = content.getString("zoffset");
String pallet_layerQty = content.getString("pallet_layerqty");
String pressCrib_layerQty = content.getString("presscrib_layerqty");
String codeLayerX1_interval = content.getString("codelayerx1_interval");
String codeLayerY1_interval = content.getString("codelayery1_interval");
String codeLayerX2_interval = content.getString("codelayerx2_interval");
String codeLayerY2_interval = content.getString("codelayery2_interval");
String codeLayerX3_interval = content.getString("codelayerx3_interval");
String codeLayerY3_interval = content.getString("codelayery3_interval");
String codeLayerX1_offset = content.getString("codelayerx1_offset");
String codeLayerY1_offset = content.getString("codelayery1_offset");
String codeLayerX2_offset = content.getString("codelayerx2_offset");
String codeLayerY2_offset = content.getString("codelayery2_offset");
String codeLayerX3_offset = content.getString("codelayerx3_offset");
String codeLayerY3_offset = content.getString("codelayery3_offset");
String pressLayerX1_interval = content.getString("presslayerx1_interval");
String pressLayerY1_interval = content.getString("presslayery1_interval");
String pressLayerX2_interval = content.getString("presslayerx2_interval");
String pressLayerY2_interval = content.getString("presslayery2_interval");
String pressLayerX3_interval = content.getString("presslayerx3_interval");
String pressLayerY3_interval = content.getString("presslayery3_interval");
String pressLayerX1_offset = content.getString("presslayerx1_offset");
String pressLayerY1_offset = content.getString("presslayery1_offset");
String pressLayerX2_offset = content.getString("presslayerx2_offset");
String pressLayerY2_offset = content.getString("presslayery2_offset");
String pressLayerX3_offset = content.getString("presslayerx3_offset");
String pressLayerY3_offset = content.getString("presslayery3_offset");
// String codeLayerX1_interval = content.getString("codelayerx1_interval");
// String codeLayerY1_interval = content.getString("codelayery1_interval");
// String codeLayerX2_interval = content.getString("codelayerx2_interval");
// String codeLayerY2_interval = content.getString("codelayery2_interval");
// String codeLayerX3_interval = content.getString("codelayerx3_interval");
// String codeLayerY3_interval = content.getString("codelayery3_interval");
// String codeLayerX1_offset = content.getString("codelayerx1_offset");
// String codeLayerY1_offset = content.getString("codelayery1_offset");
// String codeLayerX2_offset = content.getString("codelayerx2_offset");
// String codeLayerY2_offset = content.getString("codelayery2_offset");
// String codeLayerX3_offset = content.getString("codelayerx3_offset");
// String codeLayerY3_offset = content.getString("codelayery3_offset");
// String pressLayerX1_interval = content.getString("presslayerx1_interval");
// String pressLayerY1_interval = content.getString("presslayery1_interval");
// String pressLayerX2_interval = content.getString("presslayerx2_interval");
// String pressLayerY2_interval = content.getString("presslayery2_interval");
// String pressLayerX3_interval = content.getString("presslayerx3_interval");
// String pressLayerY3_interval = content.getString("presslayery3_interval");
// String pressLayerX1_offset = content.getString("presslayerx1_offset");
// String pressLayerY1_offset = content.getString("presslayery1_offset");
// String pressLayerX2_offset = content.getString("presslayerx2_offset");
// String pressLayerY2_offset = content.getString("presslayery2_offset");
// String pressLayerX3_offset = content.getString("presslayerx3_offset");
// String pressLayerY3_offset = content.getString("presslayery3_offset");
String tool_coordinate = content.getString("tool_coordinate");
String product_code = content.getString("product_code");
String AlongSide = content.getString("alongside");
@@ -1527,30 +1523,30 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic
map.put("to_Zoffset", StrUtil.isBlank(Zoffset) ? "0" : Zoffset);
map.put("to_pallet_layerQty", StrUtil.isBlank(pallet_layerQty) ? "0" : pallet_layerQty);
map.put("to_pressCrib_layerQty", StrUtil.isBlank(pressCrib_layerQty) ? "0" : pressCrib_layerQty);
map.put("to_codeLayerX1_interval", StrUtil.isBlank(codeLayerX1_interval) ? "0" : codeLayerX1_interval);
map.put("to_codeLayerY1_interval", StrUtil.isBlank(codeLayerY1_interval) ? "0" : codeLayerY1_interval);
map.put("to_codeLayerX2_interval", StrUtil.isBlank(codeLayerX2_interval) ? "0" : codeLayerX2_interval);
map.put("to_codeLayerY2_interval", StrUtil.isBlank(codeLayerY2_interval) ? "0" : codeLayerY2_interval);
map.put("to_codeLayerX3_interval", StrUtil.isBlank(codeLayerX3_interval) ? "0" : codeLayerX3_interval);
map.put("to_codeLayerY3_interval", StrUtil.isBlank(codeLayerY3_interval) ? "0" : codeLayerY3_interval);
map.put("to_codeLayerX1_offset", StrUtil.isBlank(codeLayerX1_offset) ? "0" : codeLayerX1_offset);
map.put("to_codeLayerY1_offset", StrUtil.isBlank(codeLayerY1_offset) ? "0" : codeLayerY1_offset);
map.put("to_codeLayerX2_offset", StrUtil.isBlank(codeLayerX2_offset) ? "0" : codeLayerX2_offset);
map.put("to_codeLayerY2_offset", StrUtil.isBlank(codeLayerY2_offset) ? "0" : codeLayerY2_offset);
map.put("to_codeLayerX3_offset", StrUtil.isBlank(codeLayerX3_offset) ? "0" : codeLayerX3_offset);
map.put("to_codeLayerY3_offset", StrUtil.isBlank(codeLayerY3_offset) ? "0" : codeLayerY3_offset);
map.put("to_pressLayerX1_interval", StrUtil.isBlank(pressLayerX1_interval) ? "0" : pressLayerX1_interval);
map.put("to_pressLayerY1_interval", StrUtil.isBlank(pressLayerY1_interval) ? "0" : pressLayerY1_interval);
map.put("to_pressLayerX2_interval", StrUtil.isBlank(pressLayerX2_interval) ? "0" : pressLayerX2_interval);
map.put("to_pressLayerY2_interval", StrUtil.isBlank(pressLayerY2_interval) ? "0" : pressLayerY2_interval);
map.put("to_pressLayerX3_interval", StrUtil.isBlank(pressLayerX3_interval) ? "0" : pressLayerX3_interval);
map.put("to_pressLayerY3_interval", StrUtil.isBlank(pressLayerY3_interval) ? "0" : pressLayerY3_interval);
map.put("to_pressLayerX1_offset", StrUtil.isBlank(pressLayerX1_offset) ? "0" : pressLayerX1_offset);
map.put("to_pressLayerY1_offset", StrUtil.isBlank(pressLayerY1_offset) ? "0" : pressLayerY1_offset);
map.put("to_pressLayerX2_offset", StrUtil.isBlank(pressLayerX2_offset) ? "0" : pressLayerX2_offset);
map.put("to_pressLayerY2_offset", StrUtil.isBlank(pressLayerY2_offset) ? "0" : pressLayerY2_offset);
map.put("to_pressLayerX3_offset", StrUtil.isBlank(pressLayerX3_offset) ? "0" : pressLayerX3_offset);
map.put("to_pressLayerY3_offset", StrUtil.isBlank(pressLayerY3_offset) ? "0" : pressLayerY3_offset);
// map.put("to_codeLayerX1_interval", StrUtil.isBlank(codeLayerX1_interval) ? "0" : codeLayerX1_interval);
// map.put("to_codeLayerY1_interval", StrUtil.isBlank(codeLayerY1_interval) ? "0" : codeLayerY1_interval);
// map.put("to_codeLayerX2_interval", StrUtil.isBlank(codeLayerX2_interval) ? "0" : codeLayerX2_interval);
// map.put("to_codeLayerY2_interval", StrUtil.isBlank(codeLayerY2_interval) ? "0" : codeLayerY2_interval);
// map.put("to_codeLayerX3_interval", StrUtil.isBlank(codeLayerX3_interval) ? "0" : codeLayerX3_interval);
// map.put("to_codeLayerY3_interval", StrUtil.isBlank(codeLayerY3_interval) ? "0" : codeLayerY3_interval);
// map.put("to_codeLayerX1_offset", StrUtil.isBlank(codeLayerX1_offset) ? "0" : codeLayerX1_offset);
// map.put("to_codeLayerY1_offset", StrUtil.isBlank(codeLayerY1_offset) ? "0" : codeLayerY1_offset);
// map.put("to_codeLayerX2_offset", StrUtil.isBlank(codeLayerX2_offset) ? "0" : codeLayerX2_offset);
// map.put("to_codeLayerY2_offset", StrUtil.isBlank(codeLayerY2_offset) ? "0" : codeLayerY2_offset);
// map.put("to_codeLayerX3_offset", StrUtil.isBlank(codeLayerX3_offset) ? "0" : codeLayerX3_offset);
// map.put("to_codeLayerY3_offset", StrUtil.isBlank(codeLayerY3_offset) ? "0" : codeLayerY3_offset);
// map.put("to_pressLayerX1_interval", StrUtil.isBlank(pressLayerX1_interval) ? "0" : pressLayerX1_interval);
// map.put("to_pressLayerY1_interval", StrUtil.isBlank(pressLayerY1_interval) ? "0" : pressLayerY1_interval);
// map.put("to_pressLayerX2_interval", StrUtil.isBlank(pressLayerX2_interval) ? "0" : pressLayerX2_interval);
// map.put("to_pressLayerY2_interval", StrUtil.isBlank(pressLayerY2_interval) ? "0" : pressLayerY2_interval);
// map.put("to_pressLayerX3_interval", StrUtil.isBlank(pressLayerX3_interval) ? "0" : pressLayerX3_interval);
// map.put("to_pressLayerY3_interval", StrUtil.isBlank(pressLayerY3_interval) ? "0" : pressLayerY3_interval);
// map.put("to_pressLayerX1_offset", StrUtil.isBlank(pressLayerX1_offset) ? "0" : pressLayerX1_offset);
// map.put("to_pressLayerY1_offset", StrUtil.isBlank(pressLayerY1_offset) ? "0" : pressLayerY1_offset);
// map.put("to_pressLayerX2_offset", StrUtil.isBlank(pressLayerX2_offset) ? "0" : pressLayerX2_offset);
// map.put("to_pressLayerY2_offset", StrUtil.isBlank(pressLayerY2_offset) ? "0" : pressLayerY2_offset);
// map.put("to_pressLayerX3_offset", StrUtil.isBlank(pressLayerX3_offset) ? "0" : pressLayerX3_offset);
// map.put("to_pressLayerY3_offset", StrUtil.isBlank(pressLayerY3_offset) ? "0" : pressLayerY3_offset);
map.put("to_tool_coordinate", StrUtil.isBlank(tool_coordinate) ? "0" : tool_coordinate);
map.put("to_command",200);
this.writing(map);
@@ -1622,30 +1618,30 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic
json.put("Zoffset", Zoffset);
json.put("pallet_layerQty", pallet_layerQty);
json.put("pressCrib_layerQty", pressCrib_layerQty);
json.put("codeLayerX1_interval", codeLayerX1_interval);
json.put("codeLayerY1_interval", codeLayerY1_interval);
json.put("codeLayerX2_interval", codeLayerX2_interval);
json.put("codeLayerY2_interval", codeLayerY2_interval);
json.put("codeLayerX3_interval", codeLayerX3_interval);
json.put("codeLayerY3_interval", codeLayerY3_interval);
json.put("codeLayerX1_offset", codeLayerX1_offset);
json.put("codeLayerY1_offset", codeLayerY1_offset);
json.put("codeLayerX2_offset", codeLayerX2_offset);
json.put("codeLayerY2_offset", codeLayerY2_offset);
json.put("codeLayerX3_offset", codeLayerX3_offset);
json.put("codeLayerY3_offset", codeLayerY3_offset);
json.put("pressLayerX1_interval", pressLayerX1_interval);
json.put("pressLayerY1_interval", pressLayerY1_interval);
json.put("pressLayerX2_interval", pressLayerX2_interval);
json.put("pressLayerY2_interval", pressLayerY2_interval);
json.put("pressLayerX3_interval", pressLayerX3_interval);
json.put("pressLayerY3_interval", pressLayerY3_interval);
json.put("pressLayerX1_offset", pressLayerX1_offset);
json.put("pressLayerY1_offset", pressLayerY1_offset);
json.put("pressLayerX2_offset", pressLayerX2_offset);
json.put("pressLayerY2_offset", pressLayerY2_offset);
json.put("pressLayerX3_offset", pressLayerX3_offset);
json.put("pressLayerY3_offset", pressLayerY3_offset);
// json.put("codeLayerX1_interval", codeLayerX1_interval);
// json.put("codeLayerY1_interval", codeLayerY1_interval);
// json.put("codeLayerX2_interval", codeLayerX2_interval);
// json.put("codeLayerY2_interval", codeLayerY2_interval);
// json.put("codeLayerX3_interval", codeLayerX3_interval);
// json.put("codeLayerY3_interval", codeLayerY3_interval);
// json.put("codeLayerX1_offset", codeLayerX1_offset);
// json.put("codeLayerY1_offset", codeLayerY1_offset);
// json.put("codeLayerX2_offset", codeLayerX2_offset);
// json.put("codeLayerY2_offset", codeLayerY2_offset);
// json.put("codeLayerX3_offset", codeLayerX3_offset);
// json.put("codeLayerY3_offset", codeLayerY3_offset);
// json.put("pressLayerX1_interval", pressLayerX1_interval);
// json.put("pressLayerY1_interval", pressLayerY1_interval);
// json.put("pressLayerX2_interval", pressLayerX2_interval);
// json.put("pressLayerY2_interval", pressLayerY2_interval);
// json.put("pressLayerX3_interval", pressLayerX3_interval);
// json.put("pressLayerY3_interval", pressLayerY3_interval);
// json.put("pressLayerX1_offset", pressLayerX1_offset);
// json.put("pressLayerY1_offset", pressLayerY1_offset);
// json.put("pressLayerX2_offset", pressLayerX2_offset);
// json.put("pressLayerY2_offset", pressLayerY2_offset);
// json.put("pressLayerX3_offset", pressLayerX3_offset);
// json.put("pressLayerY3_offset", pressLayerY3_offset);
json.put("tool_coordinate", tool_coordinate);
HttpResponse result = acsToWmsService.applyTaskManipulatorToWms(json);
if (ObjectUtil.isNotEmpty(result)) {

View File

@@ -207,46 +207,46 @@ public class ItemProtocol {
public static List<ItemDto> getReadableItemDtos() {
ArrayList list = new ArrayList();
list.add(new ItemDto(item_heartbeat, "心跳", "DB112.B0"));
list.add(new ItemDto(item_mode, "工作模式", "DB112.B1", Boolean.valueOf(true)));
list.add(new ItemDto(item_status, "设备状态", "DB112.B2"));
list.add(new ItemDto(item_error, "故障", "DB112.B3"));
list.add(new ItemDto(item_open_time, "开机时间", "DB112.STRING4.50"));
list.add(new ItemDto(item_standby_time, "待机时间", "DB112.D56"));
list.add(new ItemDto(item_production_time, "生产时间", "DB112.D60"));
list.add(new ItemDto(item_error_time, "故障时间", "DB112.D64"));
list.add(new ItemDto(item_material, "当前生产物料", "DB112.STRING68.50"));
list.add(new ItemDto(item_qty, "当前已生产数量", "DB112.D120"));
list.add(new ItemDto(item_weight, "当前已生产重量", "DB112.D124"));
list.add(new ItemDto(item_qualified, "当前已生产合格数", "DB112.D128"));
list.add(new ItemDto(item_unqualified, "当前已生产不合格数", "DB112.D132"));
list.add(new ItemDto(item_order_No, "工单号", "DB112.STRING136.50"));
list.add(new ItemDto(item_heartbeat, "心跳", "DB400.B0"));
list.add(new ItemDto(item_mode, "工作模式", "DB400.B1", Boolean.valueOf(true)));
list.add(new ItemDto(item_status, "设备状态", "DB400.B2"));
list.add(new ItemDto(item_error, "故障", "DB400.B3"));
list.add(new ItemDto(item_open_time, "开机时间", "DB400.STRING4.50"));
list.add(new ItemDto(item_standby_time, "待机时间", "DB400.D56"));
list.add(new ItemDto(item_production_time, "生产时间", "DB400.D60"));
list.add(new ItemDto(item_error_time, "故障时间", "DB400.D64"));
list.add(new ItemDto(item_material, "当前生产物料", "DB400.STRING68.50"));
list.add(new ItemDto(item_qty, "当前已生产数量", "DB400.D120"));
list.add(new ItemDto(item_weight, "当前已生产重量", "DB400.D124"));
list.add(new ItemDto(item_qualified, "当前已生产合格数", "DB400.D128"));
list.add(new ItemDto(item_unqualified, "当前已生产不合格数", "DB400.D132"));
list.add(new ItemDto(item_order_No, "工单号", "DB400.STRING136.50"));
return list;
}
public static List<ItemDto> getWriteableItemDtos() {
ArrayList list = new ArrayList();
list.add(new ItemDto(item_to_command, "反馈", "DB113.W0", Boolean.valueOf(true)));
list.add(new ItemDto(item_to_error, "error", "DB113.W2"));
list.add(new ItemDto(item_to_order_No, "工单号", "DB113.STRING4.50"));
list.add(new ItemDto(item_to_qty, "生产重量", "DB113.D56"));
list.add(new ItemDto(item_to_material_code, "下发物料编号", "DB113.STRING60.50"));
list.add(new ItemDto(item_to_brick_code, "砖型代号", "DB113.STRING112.50"));
list.add(new ItemDto(item_to_formula, "配方代号", "DB113.STRING164.50"));
list.add(new ItemDto(item_to_product_code, "产品编号", "DB113.W216"));
list.add(new ItemDto(item_to_AlongSide, "A长边", "DB113.W218"));
list.add(new ItemDto(item_to_BshortSide, "B短边", "DB113.W220"));
list.add(new ItemDto(item_to_Htrapezoidal, "H梯形高", "DB113.W222"));
list.add(new ItemDto(item_to_Wthickness, "W厚度", "DB113.W224"));
list.add(new ItemDto(item_to_size_error, "尺寸允许误差", "DB113.REAL228"));
list.add(new ItemDto(item_to_single_weight, "单重允许误差", "DB113.REAL232"));
list.add(new ItemDto(item_to_drawing_address, "图纸地址", "DB113.REAL236"));
list.add(new ItemDto(item_to_standard_weight, "标准重量", "DB113.REAL240"));
list.add(new ItemDto(item_to_detection_error, "检测误差值", "DB113.REAL244"));
list.add(new ItemDto(item_to_standard_size_height1, "标准尺寸高度1", "DB113.REAL248"));
list.add(new ItemDto(item_to_standard_size_height2, "标准尺寸高度2", "DB113.REAL252"));
list.add(new ItemDto(item_to_standard_size_height3, "标准尺寸高度3", "DB113.REAL256"));
list.add(new ItemDto(item_to_standard_size_height4, "标准尺寸高度4", "DB113.REAL260"));
list.add(new ItemDto(item_to_command, "反馈", "DB400.W188", Boolean.valueOf(true)));
list.add(new ItemDto(item_to_error, "error", "DB400.W190"));
list.add(new ItemDto(item_to_order_No, "工单号", "DB400.STRING192.50"));
list.add(new ItemDto(item_to_qty, "生产重量", "DB400.D244"));
list.add(new ItemDto(item_to_material_code, "下发物料编号", "DB400.STRING248.50"));
list.add(new ItemDto(item_to_brick_code, "砖型代号", "DB400.STRING300.50"));
list.add(new ItemDto(item_to_formula, "配方代号", "DB400.STRING352.50"));
list.add(new ItemDto(item_to_product_code, "产品编号", "DB400.W404"));
list.add(new ItemDto(item_to_AlongSide, "A长边", "DB400.W406"));
list.add(new ItemDto(item_to_BshortSide, "B短边", "DB400.W408"));
list.add(new ItemDto(item_to_Htrapezoidal, "H梯形高", "DB400.W410"));
list.add(new ItemDto(item_to_Wthickness, "W厚度", "DB400.W412"));
list.add(new ItemDto(item_to_size_error, "尺寸允许误差", "DB400.REAL414"));
list.add(new ItemDto(item_to_single_weight, "单重允许误差", "DB400.REAL418"));
list.add(new ItemDto(item_to_drawing_address, "图纸地址", "DB400.REAL422"));
list.add(new ItemDto(item_to_standard_weight, "标准重量", "DB400.REAL426"));
list.add(new ItemDto(item_to_detection_error, "检测误差值", "DB400.REAL430"));
list.add(new ItemDto(item_to_standard_size_height1, "标准尺寸高度1", "DB400.REAL434"));
list.add(new ItemDto(item_to_standard_size_height2, "标准尺寸高度2", "DB400.REAL438"));
list.add(new ItemDto(item_to_standard_size_height3, "标准尺寸高度3", "DB400.REAL442"));
list.add(new ItemDto(item_to_standard_size_height4, "标准尺寸高度4", "DB400.REAL446"));
return list;
}

View File

@@ -198,11 +198,11 @@ public class LnshPressDeviceDriver extends AbstractOpcDeviceDriver implements De
logServer.deviceItemValue(this.device_code, "order_No", order_No);
logServer.deviceExecuteLog(this.device_code, "", "", "信号order_No" + last_order_No + " -> " + order_No);
}
if (errorDeviceRecord) {
this.errorDeviceRecord();
}
// if (errorDeviceRecord) {
// this.errorDeviceRecord();
// }
} catch (Exception var17) {
log.info(var17.getMessage());
log.info("压机错误为{}",var17.getMessage());
message = "错误:" + var17.getMessage();
return;
}
@@ -224,8 +224,6 @@ public class LnshPressDeviceDriver extends AbstractOpcDeviceDriver implements De
message = "";
Instruction instruction = null;
List toInstructions;
if (mode > 2 && !requireSucess) {
if (ObjectUtil.isNotEmpty(this.device.getExtraValue().get(String.valueOf(mode)))) {
String modethod = this.device.getExtraValue().get(String.valueOf(mode)).toString();

View File

@@ -20,7 +20,7 @@ public class ItemProtocol {
public static String item_move1 = "move1";
public static String item_move2 = "move2";
public static String item_action1 = "action1";
public static String item_action2 = "action2";
public static String item_actoin2 = "actoin2";
public static String item_walk_y = "walk_y";
public static String item_error = "error";
public static String item_task1 = "task1";
@@ -88,8 +88,8 @@ public class ItemProtocol {
return this.getOpcIntegerValue(item_action1);
}
public int getAction2() {
return this.getOpcIntegerValue(item_action2);
public int getActoin2() {
return this.getOpcIntegerValue(item_actoin2);
}
public int getWalk_y() {
@@ -174,7 +174,7 @@ public class ItemProtocol {
list.add(new ItemDto(item_move1, "前工位光电信号", "DB50.B3"));
list.add(new ItemDto(item_move2, "后工位光电信号", "DB50.B4"));
list.add(new ItemDto(item_action1, "前工位动作信号", "DB50.B5"));
list.add(new ItemDto(item_action2, "后工位动作信号", "DB50.B6"));
list.add(new ItemDto(item_actoin2, "后工位动作信号", "DB50.B6"));
list.add(new ItemDto(item_walk_y, "行走列", "DB50.B7"));
list.add(new ItemDto(item_error, "车体报警", "DB50.B8"));
list.add(new ItemDto(item_task1, "前工位任务号", "DB50.D10"));

View File

@@ -63,7 +63,7 @@ public class LnshRGVDefination implements OpcDeviceDriverDefination {
list.add(new ItemDto(ItemProtocol.item_move1, "前工位光电信号", "DB50.B3"));
list.add(new ItemDto(ItemProtocol.item_move2, "后工位光电信号", "DB50.B4"));
list.add(new ItemDto(ItemProtocol.item_action1, "前工位动作信号", "DB50.B5"));
list.add(new ItemDto(ItemProtocol.item_action2, "后工位动作信号", "DB50.B6"));
list.add(new ItemDto(ItemProtocol.item_actoin2, "后工位动作信号", "DB50.B6"));
list.add(new ItemDto(ItemProtocol.item_walk_y, "行走列", "DB50.B7"));
list.add(new ItemDto(ItemProtocol.item_error, "车体报警", "DB50.B8"));
list.add(new ItemDto(ItemProtocol.item_task1, "前工位任务号", "DB50.D10"));

View File

@@ -112,8 +112,8 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi
int last_move2 = 0;
int action1 = 0;
int last_action1 = 0;
int action2 = 0;
int last_action2 = 0;
int actoin2 = 0;
int last_actoin2 = 0;
int walk_y = 0;
int last_walk_y = 0;
int task1 = 0;
@@ -201,7 +201,7 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi
move1 = this.itemProtocol.getMove1();
move2 = this.itemProtocol.getMove2();
action1 = this.itemProtocol.getAction1();
action2 = this.itemProtocol.getAction2();
actoin2 = this.itemProtocol.getActoin2();
walk_y = this.itemProtocol.getWalk_y();
error = this.itemProtocol.getError();
task1 = this.itemProtocol.getTask1();
@@ -261,8 +261,8 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi
if (action1 != last_action1) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号action1" + last_action1 + "->" + action1);
}
if (action2 != last_action2) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号action2" + last_action2 + "->" + action2);
if (actoin2 != last_actoin2) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号actoin2" + last_actoin2 + "->" + actoin2);
}
if (walk_y != last_walk_y) {
logServer.deviceExecuteLog(this.device_code, "", "", "信号walk_y" + last_walk_y + "->" + walk_y);
@@ -325,7 +325,7 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi
}
//前工位取货时判断取货位光电信号
if (mode == 3 && error == 0 && status != 3 && action1 == 0 && move1 == 0 && task1 > 0 && action2 == 2) {
if (mode == 3 && error == 0 && status != 3 && action1 == 0 && move1 == 0 && task1 > 0 && actoin2 == 2) {
Instruction inst1 = instructionService.findByCodeFromCache(String.valueOf(task1));
String start_device_code = inst1.getStart_device_code();
Device startDevice = deviceAppservice.findDeviceByCode(start_device_code);
@@ -362,7 +362,7 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi
}
//前工位放货时判断放货位光电信号
if (mode == 3 && error == 0 && status != 3 && action1 == 2 && move1 != 0 && task1 > 0 && action2 != 1) {
if (mode == 3 && error == 0 && status != 3 && action1 == 2 && move1 != 0 && task1 > 0 && actoin2 != 1) {
Instruction inst1 = instructionService.findByCodeFromCache(String.valueOf(task1));
String next_device_code = inst1.getNext_device_code();
Device nextDevice = deviceAppservice.findDeviceByCode(next_device_code);
@@ -428,7 +428,7 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi
}
//后工位取货时判断取货位光电信号 没问题
if (mode == 2 && error == 0 && status != 3 && action2 == 1 && move2 == 0 && task2 > 0) {
if (mode == 2 && error == 0 && status != 3 && actoin2 == 1 && move2 == 0 && task2 > 0) {
Instruction inst1 = instructionService.findByCodeFromCache(String.valueOf(task2));
String start_device_code = inst1.getStart_device_code();
Device startDevice = deviceAppservice.findDeviceByCode(start_device_code);
@@ -485,7 +485,7 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi
}
//后工位放货时判断放货位光电信号
if (mode == 3 && error == 0 && status != 3 && action2 == 2 && move2 != 0 && task2 > 0 && action1 != 1) {
if (mode == 3 && error == 0 && status != 3 && actoin2 == 2 && move2 != 0 && task2 > 0 && action1 != 1) {
Instruction inst1 = instructionService.findByCodeFromCache(String.valueOf(task2));
String next_device_code = inst1.getNext_device_code();
String start_device_code=inst1.getStart_device_code();
@@ -565,7 +565,7 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi
return;
case 2:
logServer.deviceExecuteLog(this.device_code, "", "", "前工位光电信号" + move1 + "后工位光电信号" + move2+"复位标记"+ requireSucess1+"模式"+mode);
if (move1 == 0 && move2 == 0 && !requireSucess1 &&mode==2 && action2 == 0 && action1==0&& task1==0&& task2==0) {
if (move1 == 0 && move2 == 0 && !requireSucess1 &&mode==2 && actoin2 == 0 && action1==0&& task1==0&& task2==0) {
instruction_require();
}
break;
@@ -592,7 +592,7 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi
last_move1 = move1;
last_move2 = move2;
last_action1 = action1;
last_action2 = action2;
last_actoin2 = actoin2;
last_walk_y = walk_y;
last_task1 = task1;
last_task2 = task2;
@@ -964,7 +964,7 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi
String move1 = "";
String move2 = "";
String action1 = "";
String action2 = "";
String actoin2 = "";
String walk_y = "";
String mode = "";
String status = "";
@@ -1014,16 +1014,16 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi
}else if (this.getAction1() == 0) {
action1 = "无动作";
}
if (this.getAction2() == 1) {
action2 = "取货中";
} else if (this.getAction2() == 2) {
action2 = "取货完成";
} else if (this.getAction2() == 3) {
action2 = "放货中";
} else if (this.getAction2() == 4) {
action2 = "放货完成";
}else if (this.getAction2() == 0) {
action2 = "无动作";
if (this.getActoin2() == 1) {
actoin2 = "取货中";
} else if (this.getActoin2() == 2) {
actoin2 = "取货完成";
} else if (this.getActoin2() == 3) {
actoin2 = "放货中";
} else if (this.getActoin2() == 4) {
actoin2 = "放货完成";
}else if (this.getActoin2() == 0) {
actoin2 = "无动作";
}
if (this.getWalk_y() == 0) {
@@ -1038,7 +1038,7 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi
jo.put("move1", move1);
jo.put("move2", move2);
jo.put("action1", action1);
jo.put("action2", action2);
jo.put("actoin2", actoin2);
jo.put("walk_y", walk_y);
if (this.getIserror()) {
jo.put("error", "设备有故障");
@@ -1083,7 +1083,7 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi
} else {
this.instruction_update_time = date;
if (task1 > 0 && task2 > 0 && action1 == 4 && action2 == 4 && move1 == 0 && move2 == 0) {
if (task1 > 0 && task2 > 0 && action1 == 4 && actoin2 == 4 && move1 == 0 && move2 == 0) {
//inst_message
inst1 = checkInst();
if (inst1 != null) {
@@ -1113,7 +1113,7 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi
}
//单独的后工位任务
} else if (action2 == 4 && move2 == 0 && task2 > 0 && action1 == 0 && move2 == 0 && task1 == 0) {
} else if (actoin2 == 4 && move2 == 0 && task2 > 0 && action1 == 0 && move2 == 0 && task1 == 0) {
//inst_message
inst2 = checkInst();
if (inst2 != null) {
@@ -1132,7 +1132,7 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi
writing("to_task2", "0");
writing("to_task2", "0");
}
} else if (action1 == 4 && move1 == 0 && task1 > 0 && action2 == 0 && move2 == 0 && task2 == 0) {
} else if (action1 == 4 && move1 == 0 && task1 > 0 && actoin2 == 0 && move2 == 0 && task2 == 0) {
inst1 = checkInst();
if (inst1 != null) {
try {

View File

@@ -18,7 +18,7 @@ public class ItemProtocol {
public static String item_mode = "mode";
public static String item_move = "move";
public static String item_action = "action";
public static String item_ioaction = "ioaction";
public static String item_io_action = "io_action";
public static String item_error = "error";
public static String item_task = "task";
public static String item_weight = "weight";
@@ -54,7 +54,7 @@ public class ItemProtocol {
}
public int getIoAction() {
return this.getOpcIntegerValue(item_ioaction);
return this.getOpcIntegerValue(item_io_action);
}
public int getError() {
@@ -118,24 +118,24 @@ public class ItemProtocol {
public static List<ItemDto> getReadableItemDtos() {
ArrayList list = new ArrayList();
list.add(new ItemDto(item_heartbeat, "心跳", "DB81.B10"));
list.add(new ItemDto(item_mode, "工作模式", "DB81.B1", Boolean.valueOf(true)));
list.add(new ItemDto(item_move, "光电开关信号", "DB81.B2"));
list.add(new ItemDto(item_action, "取放信号", "DB81.B3"));
list.add(new ItemDto(item_ioaction, "进出信号", "DB81.B4"));
list.add(new ItemDto(item_error, "报警信号", "DB81.B5"));
list.add(new ItemDto(item_task, "任务号", "DB81.D6"));
list.add(new ItemDto(item_weight, "重量", "DB81.D10"));
list.add(new ItemDto(item_material, "物料", "DB81.STRING14.50"));
list.add(new ItemDto(item_barcode, "条码", "DB81.W66"));
list.add(new ItemDto(item_heartbeat, "心跳", "DB402.B10"));
list.add(new ItemDto(item_mode, "工作模式", "DB402.B1", Boolean.valueOf(true)));
list.add(new ItemDto(item_move, "光电开关信号", "DB402.B2"));
list.add(new ItemDto(item_action, "取放信号", "DB402.B3"));
list.add(new ItemDto(item_io_action, "进出信号", "DB402.B4"));
list.add(new ItemDto(item_error, "报警信号", "DB402.B5"));
list.add(new ItemDto(item_task, "任务号", "DB402.D6"));
list.add(new ItemDto(item_weight, "重量", "DB402.D10"));
list.add(new ItemDto(item_material, "物料", "DB402.STRING14.50"));
list.add(new ItemDto(item_barcode, "条码", "DB402.W66"));
return list;
}
public static List<ItemDto> getWriteableItemDtos() {
ArrayList list = new ArrayList();
list.add(new ItemDto(item_to_command, "作业命令", "DB71.W0", Boolean.valueOf(true)));
list.add(new ItemDto(item_to_target, "目标站", "DB71.W2"));
list.add(new ItemDto(item_to_task, "任务号", "DB71.D4"));
list.add(new ItemDto(item_to_command, "作业命令", "DB402.W68", Boolean.valueOf(true)));
list.add(new ItemDto(item_to_target, "目标站", "DB402.W70"));
list.add(new ItemDto(item_to_task, "任务号", "DB402.D72"));
return list;
}

View File

@@ -17,7 +17,7 @@ public class ItemProtocol {
public static String item_mode = "mode";
public static String item_move = "move";
public static String item_action = "action";
public static String item_ioaction = "ioaction";
public static String item_io_action = "io_action";
public static String item_error = "error";
public static String item_vehicle_code = "vehicle_code";
public static String item_vehicle_type = "vehicle_type";
@@ -26,10 +26,11 @@ public class ItemProtocol {
public static String item_to_vehicle_code = "to_vehicle_code";
public static String item_to_vehicle_type = "to_vehicle_type";
public static String item_to_is_package = "to_is_package";
public static String item_is_weight = "is_weight";
public static String item_weight = "weight";
public static String item_material = "material";
public static String item_barcode = "barcode";
public static String item_to_target = "to_target";
public static String item_to_is_coating= "to_is_coating";
public static String item_to_task= "to_task";
public static String item_to_message= "to_message";
Boolean isonline;
@@ -67,7 +68,7 @@ public class ItemProtocol {
public int getTask() { return this.getOpcIntegerValue(item_task); }
public int getWeight() { return this.getOpcIntegerValue(item_is_weight);}
public int getWeight() { return this.getOpcIntegerValue(item_weight);}
public int getMove() {
return this.getOpcIntegerValue(item_move);
@@ -77,8 +78,12 @@ public class ItemProtocol {
return this.getOpcIntegerValue(item_action);
}
public int getTo_is_coating() {
return this.getOpcIntegerValue(item_to_is_coating);
}
public int getIoaction() {
return this.getOpcIntegerValue(item_ioaction);
return this.getOpcIntegerValue(item_io_action);
}
public int getError() {
@@ -139,10 +144,10 @@ public class ItemProtocol {
list.add(new ItemDto(item_mode, "工作模式", "DB51.B1", Boolean.valueOf(true)));
list.add(new ItemDto(item_move, "光电开关信号", "DB51.B2"));
list.add(new ItemDto(item_action, "取放信号", "DB51.B3"));
list.add(new ItemDto(item_ioaction, "进出信号", "DB51.B4"));
list.add(new ItemDto(item_io_action, "进出信号", "DB51.B4"));
list.add(new ItemDto(item_error, "报警信号", "DB51.B5"));
list.add(new ItemDto(item_task, "任务号", "DB51.D6"));
list.add(new ItemDto(item_is_weight, "重量", "DB51.D10"));
list.add(new ItemDto(item_weight, "重量", "DB51.D10"));
list.add(new ItemDto(item_material, "物料", "DB51.STRING14.50"));
list.add(new ItemDto(item_barcode, "条码", "DB51.W66"));
return list;
@@ -155,6 +160,7 @@ public class ItemProtocol {
list.add(new ItemDto(item_to_task, "下发任务号", "DB51.B4"));
list.add(new ItemDto(item_to_is_package, "下发是否包装", "DB51.B8"));
list.add(new ItemDto(item_to_message, "下发信息反馈", "DB62.STRING10.50"));
list.add(new ItemDto(item_to_is_coating, "是否裹膜", "DB51.B12"));
return list;
}

View File

@@ -366,18 +366,8 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
String Wthickness = orderDto.getW();
String formula = orderDto.getFormula();
String brick_code = orderDto.getProduct_code();
String size_error = orderDto.getSize_error();
String single_weight = orderDto.getSingle_weight();
String drawing_address = orderDto.getDrawing_address();
String standard_size_height1 = orderDto.getStandard_size_height1();
String standard_size_height2 = orderDto.getStandard_size_height2();
String standard_size_height3 = orderDto.getStandard_size_height3();
String standard_size_height4 = orderDto.getStandard_size_height4();
String standard_weight = orderDto.getStandard_weight();
String detection_error = orderDto.getDetection_error();
//混碾泥料号
String material_model=orderDto.getMaterial_model();
if (StrUtil.isEmpty(order_code)) {
JSONObject json = new JSONObject();
json.put("order_code", order_code);
@@ -431,7 +421,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
Map<String, Object> map = new LinkedHashMap<>();
map.put("to_order_No", order_code);
map.put("to_weight", qty);
map.put("to_material_code", material_code);
map.put("to_material_code", material_model);
map.put("to_command",100);
lnshMixingMillDeviceDriver.writing(map);
is_flag = true;
@@ -465,13 +455,12 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
Map<String, Object> map = new LinkedHashMap<>();
map.put("to_order_No", order_code);
map.put("to_material", material_code);
map.put("to_product_code", product_code);
map.put("to_AlongSide", AlongSide);
map.put("to_BshortSide", BshortSide);
map.put("to_Htrapezoidal", Htrapezoidal);
map.put("to_Wthickness", Wthickness);
map.put("to_brick_code", product_code+formula);
map.put("to_formula", order_number);
// map.put("to_formula", order_number);
map.put("to_feedback",100);
lnshPackagePalletManipulatorDeviceDriver.writing(map);
is_flag = true;
@@ -507,7 +496,6 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
map.put("to_order_No", order_code);
map.put("to_qty", qty);
map.put("to_material_code", material_code);
map.put("to_product_code", product_code);
map.put("to_AlongSide", AlongSide);
map.put("to_BshortSide", BshortSide);
map.put("to_Htrapezoidal", Htrapezoidal);
@@ -938,7 +926,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
jo.put("move1", lnshRGVDeviceDriver.getMove1());
jo.put("move2", lnshRGVDeviceDriver.getMove2());
jo.put("action1", lnshRGVDeviceDriver.getAction1());
jo.put("action2", lnshRGVDeviceDriver.getAction2());
jo.put("action2", lnshRGVDeviceDriver.getActoin2());
jo.put("walk_y", lnshRGVDeviceDriver.getWalk_y());
jo.put("error", lnshRGVDeviceDriver.getError());
jo.put("task1", lnshRGVDeviceDriver.getTask1());
@@ -1147,7 +1135,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
jo.put("move_1", lnshRGVDeviceDriver.getMove1());
jo.put("move_2", lnshRGVDeviceDriver.getMove2());
jo.put("action_1", lnshRGVDeviceDriver.getAction1());
jo.put("action_2", lnshRGVDeviceDriver.getAction2());
jo.put("action_2", lnshRGVDeviceDriver.getActoin2());
jo.put("walk_y", lnshRGVDeviceDriver.getWalk_y());
jo.put("error", lnshRGVDeviceDriver.getError());
jo.put("task1", lnshRGVDeviceDriver.getTask1());

View File

@@ -765,13 +765,13 @@ public class StageServiceImpl implements StageService {
action_1 = "放货完成";
}
if (lnshRGVDeviceDriver.getAction2() == 1) {
if (lnshRGVDeviceDriver.getActoin2() == 1) {
action_2 = "取货中";
} else if (lnshRGVDeviceDriver.getAction2() == 2) {
} else if (lnshRGVDeviceDriver.getActoin2() == 2) {
action_2 = "取货完成";
} else if (lnshRGVDeviceDriver.getAction2() == 3) {
} else if (lnshRGVDeviceDriver.getActoin2() == 3) {
action_2 = "放货中";
} else if (lnshRGVDeviceDriver.getAction2() == 4) {
} else if (lnshRGVDeviceDriver.getActoin2() == 4) {
action_2 = "放货完成";
}

View File

@@ -39,6 +39,7 @@ import java.io.DataOutputStream;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
@@ -258,7 +259,7 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
} catch (Exception e) {
System.out.println("OneAgv链接异常");
log.info("OneAgv链接异常");
log.error("agv连接出现异常:{}", e);
log.error("agv连接出现异常:{}", Arrays.toString(e.getStackTrace()));
logServer.deviceExecuteLog("1", "", "", "agv异常" + e.getMessage());
logServer.deviceExecuteLog("1", "", "", "agv异常" + e);
if (ObjectUtil.isNotEmpty(s)) {