fix:现场测试,大屏显示修改

This commit is contained in:
2023-12-20 11:32:14 +08:00
parent 6560d294f8
commit bc4142feb5
8 changed files with 58 additions and 131 deletions

View File

@@ -23,7 +23,9 @@ import org.nl.acs.device.service.dto.*;
import org.nl.acs.device_driver.DeviceDriver;
import org.nl.acs.device_driver.DeviceDriverDefination;
import org.nl.acs.device_driver.ScannerDeviceDriver;
import org.nl.acs.device_driver.basedriver.indoor_manipulator.IndoorManipulatorDeviceDriver;
import org.nl.acs.device_driver.basedriver.oven_manipulator.OvenGantryManipulatorDeviceDriver;
import org.nl.acs.device_driver.basedriver.paper_tube_device2.PaperTubeConveyor2DeviceDriver;
import org.nl.acs.device_driver.basedriver.siemens_conveyor.SiemensConveyorDeviceDriver;
import org.nl.acs.device_driver.basedriver.siemens_conveyor_ckk.SiemensConveyorCkkDeviceDriver;
import org.nl.acs.device_driver.basedriver.siemens_conveyor_labeling.SiemensConveyorLabelingDeviceDriver;
@@ -759,6 +761,14 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
StandardCoveyorControlWithScannerDeviceDriver standardCoveyorControlWithScannerDeviceDriver
= (StandardCoveyorControlWithScannerDeviceDriver) device.getDeviceDriver();
standardCoveyorControlWithScannerDeviceDriver.setDeviceStatus(form);
}else if (device.getDeviceDriver() instanceof IndoorManipulatorDeviceDriver){
IndoorManipulatorDeviceDriver indoorManipulatorDeviceDriver
= (IndoorManipulatorDeviceDriver) device.getDeviceDriver();
indoorManipulatorDeviceDriver.setDeviceStatus(form);
}else if (device.getDeviceDriver() instanceof PaperTubeConveyor2DeviceDriver){
PaperTubeConveyor2DeviceDriver paperTubeConveyor2DeviceDriver
= (PaperTubeConveyor2DeviceDriver) device.getDeviceDriver();
paperTubeConveyor2DeviceDriver.setDeviceStatus(form);
}
}

View File

@@ -411,7 +411,7 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i
} else if (this.getMode() == 1) {
mode = "单机";
} else if (this.getMode() == 2) {
mode = "联机";
mode = "联机";
} else if (this.getMode() == 3) {
mode = "运行中";
} else if (this.getMode() == 4) {

View File

@@ -501,6 +501,8 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
String to_new_getpoint = device.getExtraValue().get("address").toString();
Map<String, Object> map = new LinkedHashMap<>();
map.put("to_command", 4);
map.put("inflatableShaftVersion", applyManipulatorActionResponse.getVersion());
map.put("to_new_getpoint", Integer.parseInt(to_new_getpoint));
this.writing(map);
feedbackSucess = true;
@@ -737,6 +739,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
jo.put("x", x_position);
jo.put("y", y_position);
jo.put("inflatable_shaft_size", this.inflatable_shaft_size);
jo.put("driver_type", "station");
return jo;
}
@@ -750,95 +753,6 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
}
}
public void checkcontrol(Map<String, Object> itemValues) throws JIException, AddFailedException {
Group group = opcServerService.getServer(this.getOpcServer());
Map<String, Object> write = new HashMap();
Map<String, Item> readitems = new LinkedHashMap();
List<String> itemsString = new ArrayList();
itemsString = new ArrayList<> (itemValues.keySet());
Iterator is = itemsString.iterator();
while (is.hasNext()) {
String string = (String) is.next();
try {
readitems.put(string, group.addItem(string));
} catch (Exception e) {
e.printStackTrace();
}
}
int i = 0;
while(true) {
//下发信号
try{
if(i == 0){
control( itemValues);
} else {
controlByNewConn( itemValues);
}
} catch (Exception e){
e.printStackTrace();
}
Map<String, Object> read = new HashMap();
Map<Item, ItemState> itemStatus = null;
boolean check = true;
try{
if(i>0){
group = opcServerService.getServer(this.getOpcServer());
itemsString = new ArrayList<> (itemValues.keySet());
Iterator nis = itemsString.iterator();
while (nis.hasNext()) {
String string = (String) nis.next();
try {
readitems.put(string, group.addItem(string));
} catch (Exception e) {
e.printStackTrace();
}
}
itemStatus = group.read(true, (Item[])readitems.values().toArray(new Item[0]));
} else {
itemStatus = group.read(true, (Item[])readitems.values().toArray(new Item[0]));
}
Set<Item> items = itemStatus.keySet();
Iterator var15 = items.iterator();
while(var15.hasNext()) {
Item item = (Item)var15.next();
ItemState itemState = (ItemState)itemStatus.get(item);
Object value = OpcUtl.getValue(item, itemState);
read.put(item.getId(), value);
}
Iterator var24 = itemsString.iterator();
while(var24.hasNext()) {
String itemString = (String)var24.next();
if (!ObjectUtl.isEquals(itemValues.get(itemString), JsonUtl.parse(read.get(itemString)))) {
check = false;
}
}
} catch (Exception e){
e.printStackTrace();
check = false;
}
if (check) {
return;
}
if (i > 0) {
ThreadUtl.sleep(300L);
}
if (i > 3) {
log.info("写入次数超过3次而失败");
throw new WDKException("写入次数超过3次而失败");
}
++i;
}
}
public void writing(String param, String value) {
String to_param = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
@@ -1020,6 +934,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
map.put("to_onset", Integer.parseInt(start_addr));
map.put("to_task", Integer.parseInt(instdto.getInstruction_code()));
map.put("to_target", Integer.parseInt(next_addr));
if(!StrUtil.isEmpty(task.getVersion())){map.put("inflatableShaftVersion", task.getVersion());}
this.writing(map);
this.setRequireSucess(true);
notCreateInstMessage = "";

View File

@@ -701,10 +701,8 @@ public class PaperTubeConveyor2DeviceDriver extends AbstractOpcDeviceDriver impl
@Override
public JSONObject getDeviceStatusName() {
//JSONObject jo = new JSONObject();
String mode = "";
String move = "";
if (this.getMode() == 0) {
mode = "未联机";
} else if (this.getMode() == 1) {
@@ -721,40 +719,9 @@ public class PaperTubeConveyor2DeviceDriver extends AbstractOpcDeviceDriver impl
}else if(this.getMove() == 1){
move = "有托盘";
}
/*jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode);
jo.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError())));
jo.put("inventory_qty", item_qty1);
jo.put("move", move);
jo.put("out_finish", out_finish);
jo.put("isOnline", this.getIsonline());
jo.put("material1", this.getItem_material1());
jo.put("z_qty1", this.getItem_qty1());
jo.put("material2", this.getItem_material2());
jo.put("z_qty2", this.getItem_qty2());
jo.put("material3", this.getItem_material3());
jo.put("z_qty3", this.getItem_qty3());
jo.put("material4", this.getItem_material4());
jo.put("z_qty4", this.getItem_qty4());
jo.put("material5", this.getItem_material5());
jo.put("z_qty5", this.getItem_qty5());
jo.put("material6", this.getItem_material6());
jo.put("z_qty6", this.getItem_qty6());
jo.put("material7", this.getItem_material7());
jo.put("z_qty7", this.getItem_qty7());
jo.put("material8", this.getItem_material8());
jo.put("z_qty8", this.getItem_qty8());
jo.put("material9", this.getItem_material9());
jo.put("z_qty9", this.getItem_qty9());
jo.put("material10", this.getItem_material10());
jo.put("z_qty10", this.getItem_qty10());
jo.put("material11", this.getItem_material11());
jo.put("z_qty11", this.getItem_qty11());
jo.put("material12", this.getItem_material12());
jo.put("z_qty12", this.getItem_qty12());*/
Map<String, Object> map = new LinkedHashMap<>();
map.put("device_name", this.getDevice().getDevice_name());
map.put("is_click", true);
map.put("mode", mode);
map.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError())));
map.put("move", move);
@@ -785,8 +752,12 @@ public class PaperTubeConveyor2DeviceDriver extends AbstractOpcDeviceDriver impl
map.put("z_qty11", this.getItem_qty11());
map.put("material12", this.getItem_material12());
map.put("z_qty12", this.getItem_qty12());
String requireSucess = "0";
if (this.requireSucess) {
requireSucess = "1";
}
map.put("requireSucess", requireSucess);
map.put("driver_type", "conveyor");
JSONObject jo = new JSONObject(map);
return jo;
}
@@ -976,7 +947,12 @@ public class PaperTubeConveyor2DeviceDriver extends AbstractOpcDeviceDriver impl
@Override
public void setDeviceStatus(JSONObject data) {
String requestSucess = data.getString("requireSucess");
if (StrUtil.equals(requestSucess, "0")) {
this.requireSucess = false;
} else if (StrUtil.equals(requestSucess, "1")) {
this.requireSucess = true;
}
}
public static boolean arrayEquals(int[] a, int[] b) {

View File

@@ -325,7 +325,7 @@ public class TaskDto implements Serializable {
/**
* 气胀轴代数
*/
private String version;
private String version = "0";
/**
* 是否套管