更新
This commit is contained in:
@@ -77,9 +77,11 @@ public class HailiangEngravingCacheDeviceDriver extends AbstractOpcDeviceDriver
|
||||
String container;
|
||||
|
||||
int move = 0;//光电信号
|
||||
int mode = 0;//模式
|
||||
//出入库模式
|
||||
int operation_type = 0;
|
||||
int last_move = 0;//光电信号
|
||||
int last_mode = 0;//光电信号
|
||||
|
||||
|
||||
|
||||
@@ -151,6 +153,11 @@ public class HailiangEngravingCacheDeviceDriver extends AbstractOpcDeviceDriver
|
||||
try {
|
||||
device_code = this.getDeviceCode();
|
||||
move = this.itemProtocol.getItem_move();//光电信号
|
||||
mode = this.itemProtocol.getItem_mode();//模式
|
||||
if (mode != last_mode) {
|
||||
logServer.deviceLog(this.device_code,"mode" ,String.valueOf(mode));
|
||||
logServer.deviceLogToacs(this.device_code,"","","信号mode:" + last_mode + "->" + mode);
|
||||
}
|
||||
if (move != last_move) {
|
||||
if (move == 1) {
|
||||
thingToNothing();
|
||||
@@ -278,6 +285,7 @@ public class HailiangEngravingCacheDeviceDriver extends AbstractOpcDeviceDriver
|
||||
}
|
||||
}
|
||||
last_move = move ;//光电信号
|
||||
last_mode = mode ;//光电信号
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ public class ItemProtocol {
|
||||
|
||||
public static String item_heartbeat = "heartbeat";
|
||||
public static String item_move = "move";//光电信号
|
||||
public static String item_mode = "mode";//模式
|
||||
|
||||
//
|
||||
public static String item_to_cache_write = "to_cache_write";
|
||||
@@ -32,7 +33,9 @@ public class ItemProtocol {
|
||||
public int getItem_move() {
|
||||
return this.getOpcIntegerValue(item_move);
|
||||
}
|
||||
|
||||
public int getItem_mode() {
|
||||
return this.getOpcIntegerValue(item_mode);
|
||||
}
|
||||
//是否有货
|
||||
public int hasGoods(int move) {
|
||||
return move;
|
||||
@@ -56,6 +59,7 @@ public class ItemProtocol {
|
||||
ArrayList list = new ArrayList();
|
||||
list.add(new ItemDto(item_heartbeat, "心跳", "DB1.D82"));
|
||||
list.add(new ItemDto(item_move, "光电信号", "DB1.W22"));
|
||||
list.add(new ItemDto(item_mode, "模式", "DB1.B0.6"));
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@@ -349,7 +349,8 @@ public class HailiangEngravingMachineDeviceDriver extends AbstractOpcDeviceDrive
|
||||
produceshiftorderService.updateByOrderCode(dto);
|
||||
this.writing("to_confirm_finished","1");
|
||||
this.writing("to_pause","0");
|
||||
|
||||
}else {
|
||||
logServer.deviceLogToacs(this.device_code,"","",device_code+":,move:"+move + ",order_finish>"+ order_finish +",last_order_finish>"+last_order_finish);
|
||||
}
|
||||
|
||||
if(!requireSucess){
|
||||
|
||||
@@ -288,6 +288,8 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
}
|
||||
}
|
||||
this.writing("to_confirm_finished","1");
|
||||
} else {
|
||||
logServer.deviceLogToacs(this.device_code,"","",device_code+":,move:"+move + ",order_finish>"+ order_finish +",last_order_finish>"+last_order_finish);
|
||||
}
|
||||
|
||||
if(ObjectUtil.isEmpty(inst)){
|
||||
|
||||
@@ -384,7 +384,8 @@ public class HailiangSpecialDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
}
|
||||
this.writing("to_confirm_finished","1");
|
||||
this.writing("to_pause","0");
|
||||
|
||||
} else {
|
||||
logServer.deviceLogToacs(this.device_code,"","",device_code+":,order_finish>"+ finish +",last_finish>"+last_finish);
|
||||
}
|
||||
}
|
||||
last_mode = mode;
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.acs.device_driver.DeviceDriver;
|
||||
import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_cleaning_machine_storage_station.HailiangCleaningMachineStorageStationDeviceDriver;
|
||||
import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_engraving_cache.HailiangEngravingCacheDeviceDriver;
|
||||
import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_packer_station.HailiangPackerStationDeviceDriver;
|
||||
@@ -414,11 +415,18 @@ public class StageActorServiceImpl implements StageActorService {
|
||||
} else if (hailiangEngravingCacheDeviceDriver.getMove() == 1) {
|
||||
move = "空料斗";
|
||||
jo.put("hasGoods", 1);
|
||||
}
|
||||
else if (hailiangEngravingCacheDeviceDriver.getMove() == 2) {
|
||||
} else if (hailiangEngravingCacheDeviceDriver.getMove() == 2) {
|
||||
move = "满料斗";
|
||||
jo.put("hasGoods", 2);
|
||||
}
|
||||
if (hailiangEngravingCacheDeviceDriver.getMode() == 0) {
|
||||
mode = "未联机";
|
||||
jo.put("isOnline", false);
|
||||
} else if (hailiangEngravingCacheDeviceDriver.getMode() == 1) {
|
||||
mode = "联机";
|
||||
jo.put("isOnline", true);
|
||||
}
|
||||
jo.put("mode",mode);
|
||||
jo.put("move", move);
|
||||
jo.put("is_click", true);
|
||||
jo.put("device_type",device.getDevice_type());
|
||||
@@ -428,6 +436,13 @@ public class StageActorServiceImpl implements StageActorService {
|
||||
|
||||
}else if (device.getDeviceDriver() instanceof HailiangPackerStationDeviceDriver) {
|
||||
hailiangPackerStationDeviceDriver = (HailiangPackerStationDeviceDriver) device.getDeviceDriver();
|
||||
if (hailiangPackerStationDeviceDriver.getMode() == 0) {
|
||||
mode = "未联机";
|
||||
jo.put("isOnline", false);
|
||||
} else if (hailiangPackerStationDeviceDriver.getMode() == 1) {
|
||||
mode = "联机";
|
||||
jo.put("isOnline", true);
|
||||
}
|
||||
if (hailiangPackerStationDeviceDriver.getMove() == 0) {
|
||||
move = "无货";
|
||||
jo.put("hasGoods",0);
|
||||
@@ -435,6 +450,7 @@ public class StageActorServiceImpl implements StageActorService {
|
||||
move = "有货";
|
||||
jo.put("hasGoods", 1);
|
||||
}
|
||||
jo.put("mode",mode);
|
||||
jo.put("move", move);
|
||||
String lack_req = "";
|
||||
if (hailiangPackerStationDeviceDriver.getLack_req() == 0) {
|
||||
@@ -454,11 +470,15 @@ public class StageActorServiceImpl implements StageActorService {
|
||||
jo.put("device_type",device.getDevice_type());
|
||||
Boolean requireSucess = hailiangPackerStationDeviceDriver.getRequireSucess();
|
||||
String require = "";
|
||||
String requestSuccess = "";
|
||||
if (requireSucess == false){
|
||||
require = "0";
|
||||
requestSuccess = "否";
|
||||
} else {
|
||||
require = "1";
|
||||
requestSuccess = "是";
|
||||
}
|
||||
jo.put("requestSucess",requestSuccess);
|
||||
jo.put("requireSucess",require);
|
||||
jo.put("driver_type",device.getDeviceDriverDefination().getDriverCode());
|
||||
obj.put("device_name", hailiangPackerStationDeviceDriver.getDevice().getDevice_name());
|
||||
|
||||
Reference in New Issue
Block a user