This commit is contained in:
2022-10-26 19:38:15 +08:00
parent 8a0d1e2caa
commit 93b6ca1055
3 changed files with 11 additions and 12 deletions

View File

@@ -18,17 +18,17 @@ import java.util.List;
public class HaiLiangPackingDefination implements OpcDeviceDriverDefination {
@Override
public String getDriverCode() {
return "lamp_three_color";
return "lamp_three_color1";
}
@Override
public String getDriverName() {
return "标准版-三色灯";
return "海亮包裝機";
}
@Override
public String getDriverDescription() {
return "标准版-三色灯";
return "海亮包裝機";
}
@Override

View File

@@ -49,13 +49,11 @@ public class LampThreecolorDeviceDriver extends AbstractOpcDeviceDriver implemen
int mode = 0;
int action = 0;
int error = 0;
int move = 0;
int task = 0;
int last_action = 0;
int last_mode = 0;
int last_error = 0;
int last_move = 0;
int last_task = 0;
boolean hasVehicle = false;
boolean isReady = false;

View File

@@ -7,6 +7,7 @@ import net.sf.json.JSONObject;
import org.nl.acs.agv.server.AgvService;
import org.nl.acs.device_driver.electric_fence.ElectricFenceDeviceDriver;
import org.nl.acs.device_driver.hailiang.hailiang_packing.HaiLiangPackingDeviceDriver;
import org.nl.acs.device_driver.lamp_three_color.LampThreecolorDeviceDriver;
import org.nl.acs.device_driver.ndxy_special_two.NdxySpecialTwoDeviceDriver;
import org.nl.acs.device_driver.weighing_site.WeighingSiteDeviceDriver;
import org.nl.acs.instruction.service.InstructionService;
@@ -50,7 +51,7 @@ public class QueryMagicAgvDeviceStatus {
List<Device> allDevice = appService.findAllDevice();
WeighingSiteDeviceDriver weighingSiteDeviceDriver;
NdxySpecialTwoDeviceDriver ndxySpecialTwoDeviceDriver;
HaiLiangPackingDeviceDriver haiLiangPackingDeviceDriver;
LampThreecolorDeviceDriver lampThreecolorDeviceDriver;
for (int z = 0; z < allDevice.size(); z++) {
Device deviceBycode = allDevice.get(z);
if (deviceBycode.getDeviceDriver() instanceof WeighingSiteDeviceDriver) {
@@ -66,14 +67,14 @@ public class QueryMagicAgvDeviceStatus {
// ndxySpecialTwoDeviceDriver.writing("to_agv_status",0);
// }
// }
if (deviceBycode.getDeviceDriver() instanceof HaiLiangPackingDeviceDriver){
haiLiangPackingDeviceDriver = (HaiLiangPackingDeviceDriver) deviceBycode.getDeviceDriver();
if (deviceBycode.getDeviceDriver() instanceof LampThreecolorDeviceDriver){
lampThreecolorDeviceDriver = (LampThreecolorDeviceDriver) deviceBycode.getDeviceDriver();
if(jo.optString("state").equals("IDLE") || jo.optString("state").equals("EXECUTING")){
haiLiangPackingDeviceDriver.writing(0);
lampThreecolorDeviceDriver.writing(0);
flag = false;
} else if (jo.optString("state").equals("ERROR")){
if (!flag){
haiLiangPackingDeviceDriver.writing(3);
lampThreecolorDeviceDriver.writing(3);
flag = true;
}
}