add:增加收片机工作模式。

This commit is contained in:
2024-09-24 19:33:45 +08:00
parent 8faa7335a2
commit 9b15f6cb76
5 changed files with 15 additions and 5 deletions

View File

@@ -60,6 +60,8 @@ public class BaoshijianSiteDeviceDriver extends AbstractOpcDeviceDriver implemen
private Date time = new Date();
int mode = 0;
int mode1 = 0;
int mode2 = 0;
int error = 0;
int move = 0;
int task = 0;
@@ -189,9 +191,13 @@ public class BaoshijianSiteDeviceDriver extends AbstractOpcDeviceDriver implemen
if (x1 != last_x1 && x1 == 0) {
log.info("设备{}反馈收片任务完成", this.device_code);
//DJW01运行中
mode1 =0;
this.writing("x6", 0);
this.writing("x8", 0);
} else if (x1 != last_x1 && x1 == 1 &&!in && x6==0 && x8==0) {
//DJW01收片完成
mode1 =1;
in = false;
JSONObject jsonObject = new JSONObject();
String device_code = this.device_code + "DJW01";
@@ -209,9 +215,13 @@ public class BaoshijianSiteDeviceDriver extends AbstractOpcDeviceDriver implemen
if (x2 != last_x2 && x2 == 0) {
log.info("设备{}反馈上空架完成", this.device_code);
//DJW02运行中
mode2 =0;
this.writing("x5", 0);
this.writing("x7", 0);
} else if (x2 != last_x2 && x2 == 1 && !out && x5==0 && x7==0) {
//DJW02申请空盘
mode2 =1;
out = false;
JSONObject jsonObject = new JSONObject();
String device_code = this.device_code + "DJW02";

View File

@@ -413,7 +413,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
}
}
//todo 增加lms任务id
dto.setExt_task_id(task.getExt_task_id());
dto.setExt_task_id(task.getExt_task_id());
dto.setCreate_by(ObjectUtil.isNotEmpty(currentUsername) ? currentUsername : "admin");
dto.setUpdate_by(ObjectUtil.isNotEmpty(currentUsername) ? currentUsername : "admin");
dto.setUpdate_time(now);

View File

@@ -1283,6 +1283,7 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
instdto.setNext_point_code2(next_point_code2);
instdto.setAgv_system_type(agv_system_type);
instdto.setAgv_inst_type("1");
instdto.setExt_task_id(acsTask.getExt_task_id());
instructionservice.create2(instdto);
// acsTask.setTask_status("1");

View File

@@ -100,12 +100,12 @@ public class SyncDeviceStatus {
JSONObject json = new JSONObject();
json.put("device_code", baoshijianSiteDeviceDriver.getDeviceCode() + "DJW01");
json.put("move", baoshijianSiteDeviceDriver.getX1());
json.put("mode", baoshijianSiteDeviceDriver.getX0());
json.put("mode", baoshijianSiteDeviceDriver.getMode1()== 1 ? "收片完成" : "运行");
baoshijian.add(json);
JSONObject json1 = new JSONObject();
json1.put("device_code", baoshijianSiteDeviceDriver.getDeviceCode() + "DJW02");
json1.put("move", baoshijianSiteDeviceDriver.getX2() == 1 ? 0 : 1);
json.put("mode", baoshijianSiteDeviceDriver.getX0());
json1.put("mode", baoshijianSiteDeviceDriver.getMode2()== 1 ? "申请空盘" : "运行");
baoshijian.add(json1);
} else if (device.getDeviceDriver() instanceof GuhuashiSiteDeviceDriver) {
GuhuashiSiteDeviceDriver guhuashiSiteDeviceDriver=(GuhuashiSiteDeviceDriver)device.getDeviceDriver();

View File

@@ -563,8 +563,7 @@ public class CockpitServiceImpl implements CockpitService {
JSONObject jsonObject = (JSONObject) object;
if (pointObj.getPoint_code().equals(jsonObject.getString("device_code"))) {
one.put("move", jsonObject.getString("move") == null ? "0" : jsonObject.getString("move"));
//todo 模式,信号缺失
one.put("mode", jsonObject.getString("mode") == null ? "0" : jsonObject.getString("mode"));
one.put("mode", StringUtils.isBlank(jsonObject.getString("mode"))? "运行" : jsonObject.getString("mode"));
//todo 错误码(中文),信号缺失
one.put("error", jsonObject.getString("error") == null ? "0" : jsonObject.getString("error"));
}