opt: agv偏移实现两个点位调整,设备信号优化

This commit is contained in:
yanps
2024-05-31 16:58:01 +08:00
parent dddfe51684
commit 5c1aadb43c
11 changed files with 272 additions and 199 deletions

View File

@@ -121,4 +121,16 @@ public interface AcsConfig {
* 日志级别 * 日志级别
*/ */
String LOGLEVEL = "log_level"; String LOGLEVEL = "log_level";
/**
* AGV偏移量A点
*/
String OFFSET_A = "offSet_A";
/**
* AGV偏移量B点
*/
String OFFSET_B = "offSet_B";
/**
* 选择A点还是B点
*/
String CHOOSE = "choose";
} }

View File

@@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSONObject;
import lombok.Data; import lombok.Data;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.nl.acs.AcsConfig;
import org.nl.acs.agv.server.NDCAgvService; import org.nl.acs.agv.server.NDCAgvService;
import org.nl.acs.auto.run.TwoNDCSocketConnectionAutoRun; import org.nl.acs.auto.run.TwoNDCSocketConnectionAutoRun;
import org.nl.acs.common.base.CommonFinalParam; import org.nl.acs.common.base.CommonFinalParam;
@@ -39,6 +40,7 @@ import org.nl.acs.task.service.TaskService;
import org.nl.acs.task.service.dto.TaskDto; import org.nl.acs.task.service.dto.TaskDto;
import org.nl.acs.task.service.impl.TaskServiceImpl; import org.nl.acs.task.service.impl.TaskServiceImpl;
import org.nl.config.language.LangProcess; import org.nl.config.language.LangProcess;
import org.nl.config.lucene.enums.LogTypeEnum;
import org.nl.config.lucene.service.LuceneExecuteLogService; import org.nl.config.lucene.service.LuceneExecuteLogService;
import org.nl.config.lucene.service.dto.LuceneLogDto; import org.nl.config.lucene.service.dto.LuceneLogDto;
import org.nl.system.service.param.ISysParamService; import org.nl.system.service.param.ISysParamService;
@@ -310,6 +312,8 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
} }
} else if (device.getDeviceDriver() instanceof RangingStationsDeviceDriver) { } else if (device.getDeviceDriver() instanceof RangingStationsDeviceDriver) {
rangingStationsDeviceDriver = (RangingStationsDeviceDriver) device.getDeviceDriver(); rangingStationsDeviceDriver = (RangingStationsDeviceDriver) device.getDeviceDriver();
ISysParamService paramService = SpringContextHolder.getBean(ISysParamService.class);
String choose = paramService.findByCode(AcsConfig.CHOOSE).getValue();
String length1 = rangingStationsDeviceDriver.getLength1(); String length1 = rangingStationsDeviceDriver.getLength1();
String length2 = rangingStationsDeviceDriver.getLength2(); String length2 = rangingStationsDeviceDriver.getLength2();
Float len1 = 0.0F; Float len1 = 0.0F;
@@ -318,6 +322,19 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
len1 = Float.parseFloat(length1); len1 = Float.parseFloat(length1);
len2 = Float.parseFloat(length2); len2 = Float.parseFloat(length2);
} }
if("A".equals(choose)){
String offSet_A = paramService.findByCode(AcsConfig.OFFSET_A).getValue();
if(ObjectUtil.isNotEmpty(offSet_A) && !"null".equals(offSet_A)){
Integer integer = Integer.valueOf(offSet_A);
len1 = len1 - integer;
}
}else if("B".equals(choose)){
String offSet_B = paramService.findByCode(AcsConfig.OFFSET_B).getValue();
if(ObjectUtil.isNotEmpty(offSet_B) && !"null".equals(offSet_B)){
Integer integer = Integer.valueOf(offSet_B);
len1 = integer + len1;
}
}
if(len1 * len2 < 1 ){ if(len1 * len2 < 1 ){
int roundedNumber = ObjectUtil.isNotEmpty(len1) ? NumberUtil.round(len1, 0).intValue() : 0; int roundedNumber = ObjectUtil.isNotEmpty(len1) ? NumberUtil.round(len1, 0).intValue() : 0;
if (roundedNumber == 0) { if (roundedNumber == 0) {

View File

@@ -20,8 +20,8 @@ public class ItemProtocol {
public static String item_to_target = "to_target"; public static String item_to_target = "to_target";
public static String item_to_task = "to_task"; public static String item_to_task = "to_task";
public static String item_weight = "weight"; public static String item_weight = "weight";
public static String item_material_type = "material_type"; /*public static String item_material_type = "material_type";
public static String item_barcode = "barcode"; public static String item_barcode = "barcode";*/
private StandardInspectSiteDeviceDriver driver; private StandardInspectSiteDeviceDriver driver;
@@ -50,13 +50,13 @@ public class ItemProtocol {
} }
public int getMaterialType() { /*public int getMaterialType() {
return this.getOpcIntegerValue(item_material_type); return this.getOpcIntegerValue(item_material_type);
} }
public int getBarcode() { public int getBarcode() {
return this.getOpcIntegerValue(item_barcode); return this.getOpcIntegerValue(item_barcode);
} }*/
public int getToCommand() { public int getToCommand() {
return this.getOpcIntegerValue(item_to_command); return this.getOpcIntegerValue(item_to_command);
@@ -98,9 +98,9 @@ public class ItemProtocol {
list.add(new ItemDto(item_mode, "工作状态", "DB600.B2", Boolean.valueOf(true))); list.add(new ItemDto(item_mode, "工作状态", "DB600.B2", Boolean.valueOf(true)));
list.add(new ItemDto(item_move, "光电开关信号", "DB600.B3")); list.add(new ItemDto(item_move, "光电开关信号", "DB600.B3"));
list.add(new ItemDto(item_action, "取放信号", "DB600.B4")); list.add(new ItemDto(item_action, "取放信号", "DB600.B4"));
list.add(new ItemDto(item_material_type, "物料类型", "DB600.D6")); /*list.add(new ItemDto(item_material_type, "物料类型", "DB600.D6"));*/
list.add(new ItemDto(item_error, "报警信号", "DB600.B7")); list.add(new ItemDto(item_error, "报警信号", "DB600.B7"));
list.add(new ItemDto(item_barcode, "条码", "DB600.D8")); /*list.add(new ItemDto(item_barcode, "条码", "DB600.D8"));*/
return list; return list;
} }

View File

@@ -178,8 +178,8 @@ public class StandardInspectSiteDeviceDriver extends AbstractOpcDeviceDriver imp
move = this.itemProtocol.getMove(); move = this.itemProtocol.getMove();
hasGoods = this.itemProtocol.getMove(); hasGoods = this.itemProtocol.getMove();
action = this.itemProtocol.getAction(); action = this.itemProtocol.getAction();
material_type = this.itemProtocol.getMaterialType(); /*material_type = this.itemProtocol.getMaterialType();
barcode = this.itemProtocol.getBarcode(); barcode = this.itemProtocol.getBarcode();*/
if (mode != last_mode) { if (mode != last_mode) {
this.setRequireSucess(false); this.setRequireSucess(false);
if (mode == 2) { if (mode == 2) {

View File

@@ -27,9 +27,9 @@ public class ItemProtocol {
//报警 //报警
public static String item_error = "error"; public static String item_error = "error";
//x轴坐标 //x轴坐标
public static String item_x_position = "x_position"; public static String item_x_position = "x";
//y轴坐标 //y轴坐标
public static String item_y_position = "y_position"; public static String item_y_position = "y";
//下发命令 //下发命令
public static String item_to_command = "to_command"; public static String item_to_command = "to_command";

View File

@@ -18,9 +18,9 @@ public class ItemProtocol {
//工作模式 //工作模式
public static String item_mode = "mode"; public static String item_mode = "mode";
//光电信号 //光电信号
public static String item_move = "move"; public static String item_move = "move1";
//动作信号 //动作信号
public static String item_action = "action"; public static String item_action = "action1";
//任务号 //任务号
public static String item_task = "task"; public static String item_task = "task";
//报警 //报警

View File

@@ -164,6 +164,8 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
String device_code; String device_code;
String message = null; String message = null;
private Date instruction_require_time = new Date();
private int instruction_require_time_out = 3000;
@Override @Override
public Device getDevice() { public Device getDevice() {
@@ -300,56 +302,62 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
* 申请套管 * 申请套管
*/ */
private synchronized void apply_casing(int mode) throws Exception { private synchronized void apply_casing(int mode) throws Exception {
ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest(); Date date = new Date();
ApplyPlugPullSitResponse applyPlugPullSitResponse; if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) {
applyPlugPullSiteRequest.setDevice_code(device_code); log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
applyPlugPullSiteRequest.setType(CommonFinalParam.TYPE_ONE); return;
//气涨轴尺寸
applyPlugPullSiteRequest.setSize(String.valueOf(size));
applyPlugPullSitResponse = acsToWmsService.applyPlugPullSiteRequest(applyPlugPullSiteRequest);
if (applyPlugPullSitResponse.getCode() == CommonFinalParam.STATUS_OPEN) {
Map<String, String> data = applyPlugPullSitResponse.getData();
String number = data.get("number");
String leftSize = data.get("leftSize");
String rightSize = data.get("rightSize");
//套管1物料
String to_material1 = data.get("left");
//套管2物料
String to_material2 = data.get("right");
//套管1规格
String to_spec1 = data.get("leftSpec");
//套管2规格
String to_spec2 = data.get("rightSpec");
Map<String, Object> map = new LinkedHashMap<>();
//下发纸管信息
map.put("to_material1", to_material1);
map.put("to_material2", to_material2);
if (StrUtil.isNotEmpty(leftSize)){
map.put("to_size1", leftSize);
}
if (StrUtil.isNotEmpty(rightSize)){
map.put("to_size2", rightSize);
}
map.put("to_spec1", to_spec1);
if (ObjectUtil.isNotEmpty(to_spec2)) {
map.put("to_spec2", to_spec2);
}
map.put("to_command", mode);
map.put("to_qty1", number);
this.writing(map);
requireSucess = true;
logServer.deviceExecuteLog(this.device_code, "", "", "申请套管,返回参数:" + applyPlugPullSitResponse);
message = "申请套管成功";
} else { } else {
message = applyPlugPullSitResponse.getMessage(); ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest();
Map<String, Object> map = new LinkedHashMap<>(); ApplyPlugPullSitResponse applyPlugPullSitResponse;
map.put("to_command", 99); applyPlugPullSiteRequest.setDevice_code(device_code);
this.writing(map); applyPlugPullSiteRequest.setType(CommonFinalParam.TYPE_ONE);
requireSucess = true; //气涨轴尺寸
message = "申请套管失败"; applyPlugPullSiteRequest.setSize(String.valueOf(size));
logServer.deviceExecuteLog(this.device_code, "", "", "申请套管反馈失败,返回参数:" + applyPlugPullSitResponse); applyPlugPullSitResponse = acsToWmsService.applyPlugPullSiteRequest(applyPlugPullSiteRequest);
if (applyPlugPullSitResponse.getCode() == CommonFinalParam.STATUS_OPEN) {
Map<String, String> data = applyPlugPullSitResponse.getData();
String number = data.get("number");
String leftSize = data.get("leftSize");
String rightSize = data.get("rightSize");
//套管1物料
String to_material1 = data.get("left");
//套管2物料
String to_material2 = data.get("right");
//套管1规格
String to_spec1 = data.get("leftSpec");
//套管2规格
String to_spec2 = data.get("rightSpec");
Map<String, Object> map = new LinkedHashMap<>();
//下发纸管信息
map.put("to_material1", to_material1);
map.put("to_material2", to_material2);
if (StrUtil.isNotEmpty(leftSize)) {
map.put("to_size1", leftSize);
}
if (StrUtil.isNotEmpty(rightSize)) {
map.put("to_size2", rightSize);
}
map.put("to_spec1", to_spec1);
if (ObjectUtil.isNotEmpty(to_spec2)) {
map.put("to_spec2", to_spec2);
}
map.put("to_command", mode);
map.put("to_qty1", number);
this.writing(map);
requireSucess = true;
logServer.deviceExecuteLog(this.device_code, "", "", "申请套管,返回参数:" + applyPlugPullSitResponse);
message = "申请套管成功";
} else {
message = applyPlugPullSitResponse.getMessage();
Map<String, Object> map = new LinkedHashMap<>();
map.put("to_command", 99);
this.writing(map);
requireSucess = true;
message = "申请套管失败";
logServer.deviceExecuteLog(this.device_code, "", "", "申请套管反馈失败,返回参数:" + applyPlugPullSitResponse);
}
} }
} }
@@ -357,28 +365,34 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
* 套管完成 * 套管完成
*/ */
private synchronized void bushingSucess(int mode) throws Exception { private synchronized void bushingSucess(int mode) throws Exception {
ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest(); Date date = new Date();
ApplyPlugPullSitResponse applyPlugPullSitResponse; if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) {
applyPlugPullSiteRequest.setDevice_code(device_code); log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
//上报规格和重量 return;
applyPlugPullSiteRequest.setWeight1(String.valueOf(weight1));
applyPlugPullSiteRequest.setMaterial1(String.valueOf(material1));
applyPlugPullSiteRequest.setWeight2(String.valueOf(weight2));
applyPlugPullSiteRequest.setMaterial2(String.valueOf(material2));
applyPlugPullSiteRequest.setType(CommonFinalParam.TYPE_TWO);
applyPlugPullSitResponse = acsToWmsService.applyPlugPullSiteRequest(applyPlugPullSiteRequest);
if (applyPlugPullSitResponse.getCode() == CommonFinalParam.STATUS_OPEN) {
this.writeSignal(mode);
logServer.deviceExecuteLog(this.device_code, "", "", "反馈套管完成,返回参数:" + applyPlugPullSitResponse);
message = "套管完成成功";
} else { } else {
message = applyPlugPullSitResponse.getMessage(); ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest();
Map<String, Object> map = new LinkedHashMap<>(); ApplyPlugPullSitResponse applyPlugPullSitResponse;
map.put("to_command", 99); applyPlugPullSiteRequest.setDevice_code(device_code);
this.writing(map); //上报规格和重量
requireSucess = true; applyPlugPullSiteRequest.setWeight1(String.valueOf(weight1));
message = "申请套管失败"; applyPlugPullSiteRequest.setMaterial1(String.valueOf(material1));
logServer.deviceExecuteLog(this.device_code, "", "", "申请套管反馈失败,返回参数:" + applyPlugPullSitResponse); applyPlugPullSiteRequest.setWeight2(String.valueOf(weight2));
applyPlugPullSiteRequest.setMaterial2(String.valueOf(material2));
applyPlugPullSiteRequest.setType(CommonFinalParam.TYPE_TWO);
applyPlugPullSitResponse = acsToWmsService.applyPlugPullSiteRequest(applyPlugPullSiteRequest);
if (applyPlugPullSitResponse.getCode() == CommonFinalParam.STATUS_OPEN) {
this.writeSignal(mode);
logServer.deviceExecuteLog(this.device_code, "", "", "反馈套管完成,返回参数:" + applyPlugPullSitResponse);
message = "套管完成成功";
} else {
message = applyPlugPullSitResponse.getMessage();
Map<String, Object> map = new LinkedHashMap<>();
map.put("to_command", 99);
this.writing(map);
requireSucess = true;
message = "申请套管失败";
logServer.deviceExecuteLog(this.device_code, "", "", "申请套管反馈失败,返回参数:" + applyPlugPullSitResponse);
}
} }
} }
@@ -387,27 +401,33 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
* 拔轴完成 * 拔轴完成
*/ */
private synchronized void pullShaftSucess(int mode) throws Exception { private synchronized void pullShaftSucess(int mode) throws Exception {
ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest(); Date date = new Date();
ApplyPlugPullSitResponse applyPlugPullSitResponse; if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) {
applyPlugPullSiteRequest.setDevice_code(device_code); log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
applyPlugPullSiteRequest.setBarcode(String.valueOf(barcode)); return;
applyPlugPullSiteRequest.setType(CommonFinalParam.TYPE_THREE);
applyPlugPullSitResponse = acsToWmsService.applyPlugPullSiteRequest(applyPlugPullSiteRequest);
if (applyPlugPullSitResponse.getCode() == CommonFinalParam.STATUS_OPEN) {
Map<String, Object> map = new LinkedHashMap<>();
map.put("to_command", mode);
this.writing(map);
requireSucess = true;
logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴,返回参数:" + applyPlugPullSitResponse);
message = "拔轴完成成功";
} else { } else {
message = applyPlugPullSitResponse.getMessage(); ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest();
Map<String, Object> map = new LinkedHashMap<>(); ApplyPlugPullSitResponse applyPlugPullSitResponse;
map.put("to_command", 99); applyPlugPullSiteRequest.setDevice_code(device_code);
this.writing(map); applyPlugPullSiteRequest.setBarcode(String.valueOf(barcode));
requireSucess = true; applyPlugPullSiteRequest.setType(CommonFinalParam.TYPE_THREE);
message = "拔轴完成失败"; applyPlugPullSitResponse = acsToWmsService.applyPlugPullSiteRequest(applyPlugPullSiteRequest);
logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴反馈失败,返回参数:" + applyPlugPullSitResponse); if (applyPlugPullSitResponse.getCode() == CommonFinalParam.STATUS_OPEN) {
Map<String, Object> map = new LinkedHashMap<>();
map.put("to_command", mode);
this.writing(map);
requireSucess = true;
logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴,返回参数:" + applyPlugPullSitResponse);
message = "拔轴完成成功";
} else {
message = applyPlugPullSitResponse.getMessage();
Map<String, Object> map = new LinkedHashMap<>();
map.put("to_command", 99);
this.writing(map);
requireSucess = true;
message = "拔轴完成失败";
logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴反馈失败,返回参数:" + applyPlugPullSitResponse);
}
} }
} }
@@ -415,55 +435,61 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
* 申请拔轴 * 申请拔轴
*/ */
private synchronized void applyPullShaft(int mode) throws Exception { private synchronized void applyPullShaft(int mode) throws Exception {
ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest(); Date date = new Date();
ApplyPlugPullSitResponse applyPlugPullSitResponse; if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) {
applyPlugPullSiteRequest.setDevice_code(device_code); log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
applyPlugPullSiteRequest.setQzz_no(String.valueOf(barcode)); return;
applyPlugPullSiteRequest.setType(CommonFinalParam.TYPE_FOUR);
applyPlugPullSitResponse = acsToWmsService.applyPlugPullSiteRequest(applyPlugPullSiteRequest);
if (applyPlugPullSitResponse.getCode() == CommonFinalParam.STATUS_OPEN) {
Map<String, String> data = applyPlugPullSitResponse.getData();
//拔管1物料
Object to_material3 = data.get("currentLeft");
//拔管2物料
Object to_material4 = data.get("currentRight");
//拔管1尺寸
Object to_size3 = data.get("currentLeftSize");
//拔管2尺寸
Object to_size4 = data.get("currentRightSize");
//拔管1规格
Object to_spec3 = data.get("currentLeftSpec");
//拔管2规格
Object to_spec4 = data.get("currentRightSpec");
Object to_qty2 = data.get("pullCount");
Map<String, Object> map = new LinkedHashMap<>();
map.put("to_material3", to_material3);
if (ObjectUtil.isNotEmpty(to_material4)) {
map.put("to_material4", to_material4);
}
map.put("to_size3", to_size3);
if (ObjectUtil.isNotEmpty(to_size4)) {
map.put("to_size4", to_size4);
}
map.put("to_spec3", to_spec3);
if (ObjectUtil.isNotEmpty(to_spec4)) {
map.put("to_spec4", to_spec4);
}
map.put("to_qty2", to_qty2);
map.put("to_qzz_type", size);
map.put("to_command", mode);
this.writing(map);
requireSucess = true;
logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴,返回参数:" + applyPlugPullSitResponse);
message = "申请拔轴成功";
} else { } else {
message = applyPlugPullSitResponse.getMessage(); ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest();
Map<String, Object> map = new LinkedHashMap<>(); ApplyPlugPullSitResponse applyPlugPullSitResponse;
map.put("to_command", 99); applyPlugPullSiteRequest.setDevice_code(device_code);
this.writing(map); applyPlugPullSiteRequest.setQzz_no(String.valueOf(barcode));
requireSucess = true; applyPlugPullSiteRequest.setType(CommonFinalParam.TYPE_FOUR);
message = "申请拔轴失败"; applyPlugPullSitResponse = acsToWmsService.applyPlugPullSiteRequest(applyPlugPullSiteRequest);
logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴反馈失败,返回参数:" + applyPlugPullSitResponse); if (applyPlugPullSitResponse.getCode() == CommonFinalParam.STATUS_OPEN) {
Map<String, String> data = applyPlugPullSitResponse.getData();
//拔管1物料
Object to_material3 = data.get("currentLeft");
//拔管2物料
Object to_material4 = data.get("currentRight");
//拔管1尺寸
Object to_size3 = data.get("currentLeftSize");
//拔管2尺寸
Object to_size4 = data.get("currentRightSize");
//拔管1规格
Object to_spec3 = data.get("currentLeftSpec");
//拔管2规格
Object to_spec4 = data.get("currentRightSpec");
Object to_qty2 = data.get("pullCount");
Map<String, Object> map = new LinkedHashMap<>();
map.put("to_material3", to_material3);
if (ObjectUtil.isNotEmpty(to_material4)) {
map.put("to_material4", to_material4);
}
map.put("to_size3", to_size3);
if (ObjectUtil.isNotEmpty(to_size4)) {
map.put("to_size4", to_size4);
}
map.put("to_spec3", to_spec3);
if (ObjectUtil.isNotEmpty(to_spec4)) {
map.put("to_spec4", to_spec4);
}
map.put("to_qty2", to_qty2);
map.put("to_qzz_type", size);
map.put("to_command", mode);
this.writing(map);
requireSucess = true;
logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴,返回参数:" + applyPlugPullSitResponse);
message = "申请拔轴成功";
} else {
message = applyPlugPullSitResponse.getMessage();
Map<String, Object> map = new LinkedHashMap<>();
map.put("to_command", 99);
this.writing(map);
requireSucess = true;
message = "申请拔轴失败";
logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴反馈失败,返回参数:" + applyPlugPullSitResponse);
}
} }
} }
@@ -471,24 +497,30 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
* 缓存线已满,生成行架任务 * 缓存线已满,生成行架任务
*/ */
private synchronized void applyTask(int mode) throws Exception { private synchronized void applyTask(int mode) throws Exception {
ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest(); Date date = new Date();
ApplyPlugPullSitResponse applyPlugPullSitResponse; if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) {
applyPlugPullSiteRequest.setDevice_code(device_code); log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
applyPlugPullSiteRequest.setSize(String.valueOf(size)); return;
applyPlugPullSiteRequest.setType(CommonFinalParam.TYPE_FIVE);
applyPlugPullSitResponse = acsToWmsService.applyPlugPullSiteRequest(applyPlugPullSiteRequest);
if (applyPlugPullSitResponse.getCode() == CommonFinalParam.STATUS_OPEN) {
Map<String, Object> map = new LinkedHashMap<>();
map.put("to_command", mode);
this.writing(map);
logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴,返回参数:" + applyPlugPullSitResponse);
message = "生成行架任务成功";
requireSucess = true;
} else { } else {
message = applyPlugPullSitResponse.getMessage(); ApplyPlugPullSiteRequest applyPlugPullSiteRequest = new ApplyPlugPullSiteRequest();
requireSucess = true; ApplyPlugPullSitResponse applyPlugPullSitResponse;
message = "申请行架任务失败"; applyPlugPullSiteRequest.setDevice_code(device_code);
logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴反馈失败,返回参数:" + applyPlugPullSitResponse); applyPlugPullSiteRequest.setSize(String.valueOf(size));
applyPlugPullSiteRequest.setType(CommonFinalParam.TYPE_FIVE);
applyPlugPullSitResponse = acsToWmsService.applyPlugPullSiteRequest(applyPlugPullSiteRequest);
if (applyPlugPullSitResponse.getCode() == CommonFinalParam.STATUS_OPEN) {
Map<String, Object> map = new LinkedHashMap<>();
map.put("to_command", mode);
this.writing(map);
logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴,返回参数:" + applyPlugPullSitResponse);
message = "生成行架任务成功";
requireSucess = true;
} else {
message = applyPlugPullSitResponse.getMessage();
requireSucess = true;
message = "申请行架任务失败";
logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴反馈失败,返回参数:" + applyPlugPullSitResponse);
}
} }
} }
@@ -632,7 +664,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
jo.put("mode", mode); jo.put("mode", mode);
jo.put("move", move); jo.put("move", move);
/*jo.put("action", action);*/ /*jo.put("action", action);*/
jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError()))); jo.put("error", ErrorUtil.getDictDetail("cbj_error_type", String.valueOf(this.getError())));
jo.put("isOnline", this.getIsonline()); jo.put("isOnline", this.getIsonline());
jo.put("isError", this.getIserror()); jo.put("isError", this.getIserror());
jo.put("message", message); jo.put("message", message);

View File

@@ -27,9 +27,9 @@ public class ItemProtocol {
//报警 //报警
public static String item_error = "error"; public static String item_error = "error";
//x轴坐标 //x轴坐标
public static String item_x_position = "x_position"; public static String item_x_position = "x";
//y轴坐标 //y轴坐标
public static String item_y_position = "y_position"; public static String item_y_position = "y";
//下发命令 //下发命令
public static String item_to_command = "to_command"; public static String item_to_command = "to_command";
@@ -42,7 +42,7 @@ public class ItemProtocol {
//是否拔轴 //是否拔轴
public static String item_to_pull = "to_pull"; public static String item_to_pull = "to_pull";
//是否套轴 //是否套轴
public static String item_to_sleeve = "to_sleeve"; public static String item_to_sleeve = "is_bushing";
//尺寸 //尺寸
public static String item_to_size = "to_size"; public static String item_to_size = "to_size";

View File

@@ -32,9 +32,9 @@ public class ItemProtocol {
*/ */
public static String item_walk_y = "walk_y"; public static String item_walk_y = "walk_y";
//x坐标 //x坐标
public static String item_x_position = "x_position"; public static String item_x_position = "x";
//动作信号 //动作信号
public static String item_y_position = "y_position"; public static String item_y_position = "y";
/** /**
* 报警 * 报警
*/ */

View File

@@ -224,20 +224,26 @@ public class WasteFoilWeighingStationDriver extends AbstractOpcDeviceDriver impl
* 取消称重 * 取消称重
*/ */
public synchronized void cancelWeight() { public synchronized void cancelWeight() {
GetWasteFoilWeightRequest getWasteFoilWeightRequest = new GetWasteFoilWeightRequest(); Date date = new Date();
GetWasteFoilWeightResponse getWasteFoilWeightResponse; if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) {
getWasteFoilWeightRequest.setDevice_code(device_code); log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
getWasteFoilWeightRequest.setType("3"); return;
getWasteFoilWeightRequest.setLastWeight(String.valueOf(old_weight)); } else {
getWasteFoilWeightRequest.setCurrentWeight(String.valueOf(weight)); GetWasteFoilWeightRequest getWasteFoilWeightRequest = new GetWasteFoilWeightRequest();
getWasteFoilWeightRequest.setWeightGap(String.valueOf(gap_weight)); GetWasteFoilWeightResponse getWasteFoilWeightResponse;
getWasteFoilWeightResponse = acsToWmsService.feedbackWeight(getWasteFoilWeightRequest); getWasteFoilWeightRequest.setDevice_code(device_code);
if (getWasteFoilWeightResponse.getstatus()==200){ getWasteFoilWeightRequest.setType("3");
feedbackSucess = true; getWasteFoilWeightRequest.setLastWeight(String.valueOf(old_weight));
message = "取消称重成功..."; getWasteFoilWeightRequest.setCurrentWeight(String.valueOf(weight));
}else { getWasteFoilWeightRequest.setWeightGap(String.valueOf(gap_weight));
feedbackSucess = false; getWasteFoilWeightResponse = acsToWmsService.feedbackWeight(getWasteFoilWeightRequest);
message = "取消称重失败"; if (getWasteFoilWeightResponse.getstatus() == 200) {
feedbackSucess = true;
message = "取消称重成功...";
} else {
feedbackSucess = false;
message = "取消称重失败";
}
} }
} }
@@ -245,17 +251,23 @@ public class WasteFoilWeighingStationDriver extends AbstractOpcDeviceDriver impl
* 申请任务 * 申请任务
*/ */
public synchronized void applyTask() { public synchronized void applyTask() {
GetWasteFoilWeightRequest getWasteFoilWeightRequest = new GetWasteFoilWeightRequest(); Date date = new Date();
GetWasteFoilWeightResponse getWasteFoilWeightResponse; if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) {
getWasteFoilWeightRequest.setDevice_code(device_code); log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
getWasteFoilWeightRequest.setType("4"); return;
getWasteFoilWeightResponse = acsToWmsService.feedbackWeight(getWasteFoilWeightRequest); } else {
if (getWasteFoilWeightResponse.getstatus()==200){ GetWasteFoilWeightRequest getWasteFoilWeightRequest = new GetWasteFoilWeightRequest();
feedbackSucess = true; GetWasteFoilWeightResponse getWasteFoilWeightResponse;
message = "申请任务成功..."; getWasteFoilWeightRequest.setDevice_code(device_code);
}else { getWasteFoilWeightRequest.setType("4");
feedbackSucess = false; getWasteFoilWeightResponse = acsToWmsService.feedbackWeight(getWasteFoilWeightRequest);
message = "申请任务失败"; if (getWasteFoilWeightResponse.getstatus() == 200) {
feedbackSucess = true;
message = "申请任务成功...";
} else {
feedbackSucess = false;
message = "申请任务失败";
}
} }
} }

View File

@@ -264,7 +264,7 @@ public class OnlineUserService {
String tokenValue = StpUtil.getTokenValue(); String tokenValue = StpUtil.getTokenValue();
SaCookieConfig cfg = SaManager.getConfig().getCookie(); SaCookieConfig cfg = SaManager.getConfig().getCookie();
SaCookie cookie = new SaCookie() SaCookie cookie = new SaCookie()
.setName(StpUtil.getTokenValue()) .setName("Authorization")
.setValue(tokenValue) .setValue(tokenValue)
.setMaxAge(-1) .setMaxAge(-1)
.setDomain(cfg.getDomain()) .setDomain(cfg.getDomain())