rev 工作模式
This commit is contained in:
@@ -108,14 +108,17 @@ public class HailiangCleaningMachineStorageStationDeviceDriver extends AbstractO
|
||||
public void execute() {
|
||||
try {
|
||||
device_code = this.getDeviceCode();
|
||||
mode = this.itemProtocol.getItem_mode();
|
||||
error = this.itemProtocol.getItem_error();
|
||||
running = this.itemProtocol.getItem_running();
|
||||
is_open = this.itemProtocol.getItem_is_open();
|
||||
silo_weight = this.itemProtocol.getItem_silo_weight();
|
||||
full_number = this.itemProtocol.getItem_full_number();
|
||||
silo_material_no = this.itemProtocol.getItem_silo_material_no();
|
||||
if (mode != last_mode) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode);
|
||||
}
|
||||
if (running != last_running) {
|
||||
logServer.deviceItemValue(this.device_code, "running", String.valueOf(running));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号running:" + last_running + "->" + running);
|
||||
}
|
||||
if (error != last_error) {
|
||||
@@ -150,6 +153,8 @@ public class HailiangCleaningMachineStorageStationDeviceDriver extends AbstractO
|
||||
//this.setIserror(true);
|
||||
message = "信号量同步异常";
|
||||
//未联机
|
||||
} else if (mode == 0) {
|
||||
message = "未联机";
|
||||
} else {
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
@@ -200,6 +205,7 @@ public class HailiangCleaningMachineStorageStationDeviceDriver extends AbstractO
|
||||
}
|
||||
}
|
||||
}
|
||||
last_mode = mode;
|
||||
last_running = running;
|
||||
last_is_open = is_open; //是否启动
|
||||
last_error = error; //报警信号
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_ealing_machine;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Data;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -37,7 +38,7 @@ public class EalingMachineDeviceDriver extends AbstractOpcDeviceDriver implement
|
||||
|
||||
|
||||
int heartbeat = 0;
|
||||
int status = 0;
|
||||
int mode = 0;
|
||||
int ealing_error = 0;
|
||||
int ealing_running = 0;
|
||||
int order_finish = 0;
|
||||
@@ -62,7 +63,7 @@ public class EalingMachineDeviceDriver extends AbstractOpcDeviceDriver implement
|
||||
int order = 0;
|
||||
|
||||
int last_heartbeat = 0;
|
||||
int last_status = 0;
|
||||
int last_mode = 0;
|
||||
int last_ealing_error = 0;
|
||||
int last_ealing_running = 0;
|
||||
int last_order_finish = 0;
|
||||
@@ -109,7 +110,7 @@ public class EalingMachineDeviceDriver extends AbstractOpcDeviceDriver implement
|
||||
public void execute() {
|
||||
try {
|
||||
device_code = this.getDeviceCode();
|
||||
status = this.itemProtocol.getItem_status();
|
||||
mode = this.itemProtocol.getItem_mode();
|
||||
ealing_error = this.itemProtocol.getItem_ealing_error();
|
||||
ealing_running = this.itemProtocol.getItem_ealing_running();
|
||||
order_finish = this.itemProtocol.getItem_order_finish();
|
||||
@@ -130,8 +131,8 @@ public class EalingMachineDeviceDriver extends AbstractOpcDeviceDriver implement
|
||||
no_pass_bag_num = this.itemProtocol.getItem_no_pass_bag_num();
|
||||
order = this.itemProtocol.getItem_order();
|
||||
|
||||
if (status != last_status) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号status:" + last_status + "->" + status + "复位请求标记");
|
||||
if (mode != last_mode) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode + "复位请求标记");
|
||||
}
|
||||
if (ealing_error != last_ealing_error) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号ealing_error:" + last_ealing_error + "->" + ealing_error + "复位请求标记");
|
||||
@@ -190,28 +191,28 @@ public class EalingMachineDeviceDriver extends AbstractOpcDeviceDriver implement
|
||||
if (order != last_order) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号order:" + last_order + "->" + order + "复位请求标记");
|
||||
}
|
||||
|
||||
|
||||
} catch (Exception var17) {
|
||||
|
||||
|
||||
var17.printStackTrace();
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17);
|
||||
}
|
||||
|
||||
if (1 == 2) {
|
||||
this.setIsonline(false);
|
||||
if (!this.itemProtocol.getIsonline()) {
|
||||
//this.setIsonline(false);
|
||||
//this.setIserror(true);
|
||||
message = "信号量同步异常";
|
||||
//未联机
|
||||
} else if (mode == 0) {
|
||||
// this.setIsonline(false);
|
||||
message = "未联机";
|
||||
//有报警
|
||||
|
||||
} else {
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
//this.setIsonline(true);
|
||||
//this.setIserror(false);
|
||||
message = "";
|
||||
Instruction instruction = null;
|
||||
List toInstructions;
|
||||
|
||||
|
||||
}
|
||||
last_status = status;
|
||||
last_mode = mode;
|
||||
last_ealing_error = ealing_error;
|
||||
last_ealing_running = ealing_running;
|
||||
last_order_finish = order_finish;
|
||||
|
||||
@@ -13,7 +13,7 @@ public class ItemProtocol {
|
||||
//心跳
|
||||
public static String item_heartbeat = "heartbeat";
|
||||
//装箱机状态
|
||||
public static String item_status = "status";
|
||||
public static String item_mode = "mode";
|
||||
//装箱机故障
|
||||
public static String item_ealing_error = "ealing_error";
|
||||
//装箱机运行状态
|
||||
@@ -160,8 +160,8 @@ public class ItemProtocol {
|
||||
}
|
||||
|
||||
|
||||
public int getItem_status() {
|
||||
return this.getOpcIntegerValue(item_heartbeat);
|
||||
public int getItem_mode() {
|
||||
return this.getOpcIntegerValue(item_mode);
|
||||
}
|
||||
|
||||
public int getItem_ealing_error() {
|
||||
@@ -276,7 +276,7 @@ public class ItemProtocol {
|
||||
public static List<ItemDto> getReadableItemDtos() {
|
||||
ArrayList list = new ArrayList();
|
||||
list.add(new ItemDto(item_heartbeat, "心跳", "DB1.W82"));
|
||||
list.add(new ItemDto(item_status, "装箱机状态", "DB1.B0.0"));
|
||||
list.add(new ItemDto(item_mode, "工作模式", "DB1.B0.0"));
|
||||
list.add(new ItemDto(item_ealing_error, "装箱机故障", "DB1.B0.2"));
|
||||
list.add(new ItemDto(item_ealing_running, "装箱机运行状态", "DB1.B0.3"));
|
||||
list.add(new ItemDto(item_order_finish, "订单完成", "DB1.B1.2"));
|
||||
|
||||
@@ -14,7 +14,7 @@ public class ItemProtocol {
|
||||
//心跳
|
||||
public static String item_heartbeat = "heartbeat";
|
||||
//开箱机状态
|
||||
public static String item_status = "status";
|
||||
public static String item_mode = "mode";
|
||||
//开箱机故障
|
||||
public static String item_unboxing_error = "unboxing_error";
|
||||
//开箱机运行状态
|
||||
@@ -69,53 +69,37 @@ public class ItemProtocol {
|
||||
}
|
||||
|
||||
|
||||
public int getItem_status() {
|
||||
return this.getOpcIntegerValue(item_status);
|
||||
}
|
||||
|
||||
;
|
||||
public int getItem_mode() {
|
||||
return this.getOpcIntegerValue(item_mode);
|
||||
};
|
||||
|
||||
public int getItem_unboxing_error() {
|
||||
return this.getOpcIntegerValue(item_unboxing_error);
|
||||
}
|
||||
|
||||
;
|
||||
};
|
||||
|
||||
public int getItem_unboxing_running() {
|
||||
return this.getOpcIntegerValue(item_unboxing_running);
|
||||
}
|
||||
|
||||
;
|
||||
};
|
||||
|
||||
public int getItem_unboxing_ready() {
|
||||
return this.getOpcIntegerValue(item_unboxing_ready);
|
||||
}
|
||||
|
||||
;
|
||||
};
|
||||
|
||||
public int getItem_order_finish() {
|
||||
return this.getOpcIntegerValue(item_order_finish);
|
||||
}
|
||||
|
||||
;
|
||||
};
|
||||
|
||||
public int getItem_order_compel_finish() {
|
||||
return this.getOpcIntegerValue(item_order_compel_finish);
|
||||
}
|
||||
|
||||
;
|
||||
};
|
||||
|
||||
public int getItem_error() {
|
||||
return this.getOpcIntegerValue(item_error);
|
||||
}
|
||||
|
||||
;
|
||||
};
|
||||
|
||||
public int getItem_now_order_num() {
|
||||
return this.getOpcIntegerValue(item_now_order_num);
|
||||
}
|
||||
|
||||
;
|
||||
};
|
||||
|
||||
public int getItem_task() {
|
||||
return this.getOpcIntegerValue(item_task);
|
||||
@@ -125,27 +109,19 @@ public class ItemProtocol {
|
||||
|
||||
public int getItem_open_ready_time() {
|
||||
return this.getOpcIntegerValue(item_open_ready_time);
|
||||
}
|
||||
|
||||
;
|
||||
};
|
||||
|
||||
public int getItem_device_running_time() {
|
||||
return this.getOpcIntegerValue(item_device_running_time);
|
||||
}
|
||||
|
||||
;
|
||||
};
|
||||
|
||||
public int getItem_await_time() {
|
||||
return this.getOpcIntegerValue(item_await_time);
|
||||
}
|
||||
|
||||
;
|
||||
};
|
||||
|
||||
public int getItem_order() {
|
||||
return this.getOpcIntegerValue(item_order);
|
||||
}
|
||||
|
||||
;
|
||||
};
|
||||
|
||||
|
||||
Boolean isonline;
|
||||
@@ -166,7 +142,7 @@ public class ItemProtocol {
|
||||
public static List<ItemDto> getReadableItemDtos() {
|
||||
ArrayList list = new ArrayList();
|
||||
list.add(new ItemDto(item_heartbeat, "心跳", "DB1.W82"));
|
||||
list.add(new ItemDto(item_status, "开箱机状态", "DB1.B0.0"));
|
||||
list.add(new ItemDto(item_mode, "工作模式", "DB1.B0.0"));
|
||||
list.add(new ItemDto(item_unboxing_error, "开箱机故障", "DB1.B0.1"));
|
||||
list.add(new ItemDto(item_unboxing_running, "开箱机运行状态", "DB1.B0.2"));
|
||||
list.add(new ItemDto(item_unboxing_ready, "开箱机就绪", "DB1.B0.3"));
|
||||
|
||||
@@ -17,7 +17,6 @@ import org.nl.acs.opc.Device;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -37,7 +36,7 @@ public class UnboxingMachineDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
|
||||
|
||||
int heartbeat = 0;
|
||||
int status = 0;
|
||||
int mode = 0;
|
||||
int unboxing_error = 0;
|
||||
int unboxing_running = 0;
|
||||
int unboxing_ready = 0;
|
||||
@@ -52,7 +51,7 @@ public class UnboxingMachineDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
int order = 0;
|
||||
|
||||
int last_heartbeat = 0;
|
||||
int last_status = 0;
|
||||
int last_mode = 0;
|
||||
int last_unboxing_error = 0;
|
||||
int last_unboxing_running = 0;
|
||||
int last_unboxing_ready = 0;
|
||||
@@ -87,7 +86,7 @@ public class UnboxingMachineDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
public void execute() {
|
||||
try {
|
||||
device_code = this.getDeviceCode();
|
||||
status = this.itemProtocol.getItem_status();
|
||||
mode = this.itemProtocol.getItem_mode();
|
||||
unboxing_error = this.itemProtocol.getItem_unboxing_error();
|
||||
unboxing_running = this.itemProtocol.getItem_unboxing_running();
|
||||
unboxing_ready = this.itemProtocol.getItem_unboxing_ready();
|
||||
@@ -98,8 +97,8 @@ public class UnboxingMachineDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
task = this.itemProtocol.getItem_task();
|
||||
order = this.itemProtocol.getItem_order();
|
||||
|
||||
if (status != last_status) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号status:" + last_status + "->" + status + "复位请求标记");
|
||||
if (mode != last_mode) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode + "复位请求标记");
|
||||
}
|
||||
if (unboxing_error != last_unboxing_error) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号unboxing_error:" + last_unboxing_error + "->" + unboxing_error + "复位请求标记");
|
||||
@@ -128,29 +127,24 @@ public class UnboxingMachineDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
if (order != last_order) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号order:" + last_order + "->" + order + "复位请求标记");
|
||||
}
|
||||
|
||||
|
||||
} catch (Exception var17) {
|
||||
|
||||
|
||||
var17.printStackTrace();
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17);
|
||||
}
|
||||
|
||||
if (1 == 2) {
|
||||
this.setIsonline(false);
|
||||
if (!this.itemProtocol.getIsonline()) {
|
||||
//this.setIsonline(false);
|
||||
//this.setIserror(true);
|
||||
message = "信号量同步异常";
|
||||
//未联机
|
||||
} else if (mode == 0) {
|
||||
message = "未联机";
|
||||
//有报警
|
||||
|
||||
} else {
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
|
||||
message = "";
|
||||
Instruction instruction = null;
|
||||
List toInstructions;
|
||||
|
||||
|
||||
}
|
||||
last_status = status;
|
||||
last_mode = mode;
|
||||
last_unboxing_error = unboxing_error;
|
||||
last_unboxing_running = unboxing_running;
|
||||
last_unboxing_ready = unboxing_ready;
|
||||
|
||||
Reference in New Issue
Block a user