add:新增仙工agv动作块以及优化任务看板
This commit is contained in:
@@ -357,6 +357,38 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
|
||||
jo.put("script_args", script_args);
|
||||
ja.add(jo);
|
||||
}
|
||||
JSONObject jo3 = new JSONObject();
|
||||
//动作块id
|
||||
jo3.put("blockId", IdUtil.simpleUUID());
|
||||
//目的地名称
|
||||
jo3.put("location", pointCode + "INGET");
|
||||
jo3.put("id", pointCode + "INGET");
|
||||
//执行脚本
|
||||
jo3.put("operation", "expand");
|
||||
//通信脚本,动作前后与现场设备交互的场景
|
||||
jo3.put("script_name", "Fork-expand.py");
|
||||
JSONObject script_args = new JSONObject();
|
||||
script_args.put("expandWidth", 0.2);
|
||||
script_args.put("operation", "expand");
|
||||
jo3.put("script_args", script_args);
|
||||
ja.add(jo3);
|
||||
|
||||
JSONObject jo4 = new JSONObject();
|
||||
//动作块id
|
||||
jo4.put("blockId", IdUtil.simpleUUID());
|
||||
//目的地名称
|
||||
jo4.put("location", pointCode + "INGET");
|
||||
jo4.put("id", pointCode + "INGET");
|
||||
//执行脚本
|
||||
jo4.put("operation", "stretch");
|
||||
//通信脚本,动作前后与现场设备交互的场景
|
||||
jo4.put("script_name", "Fork-expand.py");
|
||||
JSONObject script_args1 = new JSONObject();
|
||||
script_args1.put("expandWidth", 0.2);
|
||||
script_args1.put("operation", "stretch");
|
||||
jo4.put("script_args", script_args1);
|
||||
ja.add(jo4);
|
||||
|
||||
//将货物顶起来,机器识别提升高度
|
||||
JSONObject jo1 = new JSONObject();
|
||||
jo1.put("blockId", IdUtil.simpleUUID());
|
||||
|
||||
@@ -22,6 +22,7 @@ import org.nl.acs.device_driver.FeedLmsRealFailed;
|
||||
import org.nl.acs.device_driver.RouteableDeviceDriver;
|
||||
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
|
||||
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
|
||||
import org.nl.acs.device_driver.led.led_screen.LedScreenDeviceDriver;
|
||||
import org.nl.acs.enums.StorageTypeEnum;
|
||||
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
||||
import org.nl.acs.history.ErrorUtil;
|
||||
@@ -41,6 +42,8 @@ import org.nl.acs.task.enums.TaskStatusEnum;
|
||||
import org.nl.acs.task.enums.TaskTypeEnum;
|
||||
import org.nl.acs.task.service.TaskService;
|
||||
import org.nl.acs.task.service.dto.TaskDto;
|
||||
import org.nl.acs.taskscreen.service.TaskScreenService;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.config.SpringContextHolder;
|
||||
import org.nl.config.language.LangProcess;
|
||||
@@ -80,6 +83,8 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
||||
LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean(LuceneExecuteLogService.class);
|
||||
|
||||
ISysParamService paramService = SpringContextHolder.getBean(ISysParamService.class);
|
||||
|
||||
TaskScreenService taskScreenService = SpringContextHolder.getBean(TaskScreenService.class);
|
||||
//工作模式
|
||||
int mode = 0;
|
||||
int last_mode = 0;
|
||||
@@ -227,8 +232,24 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
||||
}
|
||||
if(move !=last_move){
|
||||
if (ObjectUtil.isNotEmpty(inst)){
|
||||
Thread.sleep(10000);
|
||||
led_message = clearMessage();
|
||||
if (move==0){
|
||||
Thread.sleep(10000);
|
||||
led_message = clearMessage();
|
||||
List<String> deviceCodes = this.getExtraDeviceCodes("link_device_code");
|
||||
String device = null;
|
||||
if (ObjectUtil.isNotEmpty(deviceCodes)) {
|
||||
for (String deviceCode : deviceCodes) {
|
||||
Device linkDevice = deviceAppService.findDeviceByCode(deviceCode);
|
||||
if (ObjectUtil.isEmpty(linkDevice)) {
|
||||
throw new BadRequestException("设备:" + device_code + "关联设备->" + deviceCode + "为空!");
|
||||
}
|
||||
if (linkDevice.getDeviceDriver() instanceof LedScreenDeviceDriver){
|
||||
device = deviceCode;
|
||||
}
|
||||
}
|
||||
}
|
||||
taskScreenService.getLedMessage(device);
|
||||
}
|
||||
}
|
||||
requireSucess = false;
|
||||
}
|
||||
@@ -499,6 +520,20 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
||||
list.add(map3);
|
||||
this.writing(list);
|
||||
led_message = getLedMessage(instdto);
|
||||
List<String> deviceCodes = this.getExtraDeviceCodes("link_device_code");
|
||||
String device = null;
|
||||
if (ObjectUtil.isNotEmpty(deviceCodes)) {
|
||||
for (String deviceCode : deviceCodes) {
|
||||
Device linkDevice = deviceAppService.findDeviceByCode(deviceCode);
|
||||
if (ObjectUtil.isEmpty(linkDevice)) {
|
||||
throw new BadRequestException("设备:" + device_code + "关联设备->" + deviceCode + "为空!");
|
||||
}
|
||||
if (linkDevice.getDeviceDriver() instanceof LedScreenDeviceDriver){
|
||||
device = deviceCode;
|
||||
}
|
||||
}
|
||||
}
|
||||
taskScreenService.getLedMessage(device);
|
||||
requireSucess = true;
|
||||
while (!StrUtil.equals(this.getOpcValueAccessor().getValue(this.getOpcServer() + "." + this.getOpcPlc() + "." + this.getDevice_code() + ".task").toString()
|
||||
, instdto.getInstruction_code())) {
|
||||
|
||||
@@ -46,11 +46,15 @@ public class TaskScreenServiceImpl extends CommonServiceImpl<TaskScreenMapper, D
|
||||
private final DeviceService deviceService;
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void autoInitial() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public JSONArray selectLedList() {
|
||||
List<Device> list = new LambdaQueryChainWrapper<Device>(deviceMapper)
|
||||
@@ -90,7 +94,7 @@ public class TaskScreenServiceImpl extends CommonServiceImpl<TaskScreenMapper, D
|
||||
if (device.getDeviceDriver() instanceof ConveyorWithScannerWeightDeviceDriver) {
|
||||
conveyorWithScannerWeightDeviceDriver = (ConveyorWithScannerWeightDeviceDriver) device.getDeviceDriver();
|
||||
if (ObjectUtil.isNotEmpty(conveyorWithScannerWeightDeviceDriver.getLed_message())) {
|
||||
json = conveyorWithScannerWeightDeviceDriver.getLed_message();
|
||||
json = conveyorWithScannerWeightDeviceDriver.getLed_message();
|
||||
}
|
||||
}
|
||||
return json;
|
||||
|
||||
Reference in New Issue
Block a user