更新
This commit is contained in:
@@ -40,7 +40,7 @@ import java.util.*;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
@Data
|
@Data
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver , DeviceStageMonitor {
|
public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor {
|
||||||
protected ItemProtocol itemProtocol = new ItemProtocol(this);
|
protected ItemProtocol itemProtocol = new ItemProtocol(this);
|
||||||
@Autowired
|
@Autowired
|
||||||
DeviceAppService deviceAppservice = SpringContextHolder.getBean(DeviceAppService.class);
|
DeviceAppService deviceAppservice = SpringContextHolder.getBean(DeviceAppService.class);
|
||||||
@@ -173,11 +173,11 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
|
|||||||
//无报警
|
//无报警
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if(move ==0 && last_move ==1){
|
if (move == 0 && last_move == 1) {
|
||||||
requireSucess = false;
|
requireSucess = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(finish == 1 && last_finish == 0 && !requireSucess ){
|
if (finish == 1 && last_finish == 0 && !requireSucess) {
|
||||||
//烘箱完成反馈LMS
|
//烘箱完成反馈LMS
|
||||||
apply_finish();
|
apply_finish();
|
||||||
}
|
}
|
||||||
@@ -206,14 +206,13 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected void thingToNothing() {
|
protected void thingToNothing() {
|
||||||
this.setRequireSucess(false);
|
this.setRequireSucess(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void writing(int command) {
|
public void writing(int command) {
|
||||||
String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
|
String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
|
||||||
+ "." +ItemProtocol.item_to_command;
|
+ "." + ItemProtocol.item_to_command;
|
||||||
String opcservcerid = this.getDevice().getOpc_server_id();
|
String opcservcerid = this.getDevice().getOpc_server_id();
|
||||||
Server server = ReadUtil.getServer(opcservcerid);
|
Server server = ReadUtil.getServer(opcservcerid);
|
||||||
Map<String, Object> itemMap = new HashMap<String, Object>();
|
Map<String, Object> itemMap = new HashMap<String, Object>();
|
||||||
@@ -224,7 +223,7 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
|
|||||||
//将扩展表中的字符串数据转换成集合
|
//将扩展表中的字符串数据转换成集合
|
||||||
public List<String> getExtraDeviceCodes(String extraName) {
|
public List<String> getExtraDeviceCodes(String extraName) {
|
||||||
String extraValue = (String) this.getDevice().getExtraValue().get(extraName);
|
String extraValue = (String) this.getDevice().getExtraValue().get(extraName);
|
||||||
if (StrUtil.isEmpty(extraValue)){
|
if (StrUtil.isEmpty(extraValue)) {
|
||||||
return new ArrayList<>();
|
return new ArrayList<>();
|
||||||
}
|
}
|
||||||
String devicesString = extraValue.substring(1, extraValue.length() - 1);
|
String devicesString = extraValue.substring(1, extraValue.length() - 1);
|
||||||
@@ -245,7 +244,7 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
|
|||||||
Server server = ReadUtil.getServer(opcservcerid);
|
Server server = ReadUtil.getServer(opcservcerid);
|
||||||
Map<String, Object> itemMap = new HashMap<String, Object>();
|
Map<String, Object> itemMap = new HashMap<String, Object>();
|
||||||
|
|
||||||
itemMap.put(to_param, value);
|
itemMap.put(to_param, Integer.parseInt(value));
|
||||||
// itemMap.put(to_param, Integer.parseInt(value));
|
// itemMap.put(to_param, Integer.parseInt(value));
|
||||||
ReadUtil.write(itemMap, server);
|
ReadUtil.write(itemMap, server);
|
||||||
}
|
}
|
||||||
@@ -324,7 +323,7 @@ public class HongXiangConveyorDeviceDriver extends AbstractOpcDeviceDriver imple
|
|||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
this.instruction_apply_time = date;
|
this.instruction_apply_time = date;
|
||||||
ApplyLabelingAndBindingRequest applyLabelingAndBindingRequest = new ApplyLabelingAndBindingRequest();
|
ApplyLabelingAndBindingRequest applyLabelingAndBindingRequest = new ApplyLabelingAndBindingRequest();
|
||||||
JSONObject device_json = WQLObject.getWQLObject("acs_storage_cell").query("storage_code ='" + this.device_code + "'").uniqueResult(0);
|
JSONObject device_json = WQLObject.getWQLObject("acs_storage_cell").query("storage_code ='" + this.device_code + "'").uniqueResult(0);
|
||||||
String start_point_code = null;
|
String start_point_code = null;
|
||||||
if (!ObjectUtil.isEmpty(device_json)) {
|
if (!ObjectUtil.isEmpty(device_json)) {
|
||||||
|
|||||||
@@ -332,7 +332,8 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
|||||||
notCreateTaskMessage = "";
|
notCreateTaskMessage = "";
|
||||||
feedMessage = "";
|
feedMessage = "";
|
||||||
} else {
|
} else {
|
||||||
if (!requireSucess) {
|
if (mode == 2) {
|
||||||
|
//if (!requireSucess) {
|
||||||
String remark = "";
|
String remark = "";
|
||||||
if (mode != 2) {
|
if (mode != 2) {
|
||||||
remark = remark + "mode不为2,";
|
remark = remark + "mode不为2,";
|
||||||
@@ -344,6 +345,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
|||||||
remark = remark + "task不为0,";
|
remark = remark + "task不为0,";
|
||||||
}
|
}
|
||||||
this.setNotCreateTaskMessage(remark);
|
this.setNotCreateTaskMessage(remark);
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user