add:新增仙工agv动作块以及优化任务看板
This commit is contained in:
@@ -357,6 +357,38 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
|
|||||||
jo.put("script_args", script_args);
|
jo.put("script_args", script_args);
|
||||||
ja.add(jo);
|
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();
|
JSONObject jo1 = new JSONObject();
|
||||||
jo1.put("blockId", IdUtil.simpleUUID());
|
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.RouteableDeviceDriver;
|
||||||
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
|
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
|
||||||
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
|
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.enums.StorageTypeEnum;
|
||||||
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
||||||
import org.nl.acs.history.ErrorUtil;
|
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.enums.TaskTypeEnum;
|
||||||
import org.nl.acs.task.service.TaskService;
|
import org.nl.acs.task.service.TaskService;
|
||||||
import org.nl.acs.task.service.dto.TaskDto;
|
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.common.utils.SecurityUtils;
|
||||||
import org.nl.config.SpringContextHolder;
|
import org.nl.config.SpringContextHolder;
|
||||||
import org.nl.config.language.LangProcess;
|
import org.nl.config.language.LangProcess;
|
||||||
@@ -80,6 +83,8 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
|||||||
LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean(LuceneExecuteLogService.class);
|
LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean(LuceneExecuteLogService.class);
|
||||||
|
|
||||||
ISysParamService paramService = SpringContextHolder.getBean(ISysParamService.class);
|
ISysParamService paramService = SpringContextHolder.getBean(ISysParamService.class);
|
||||||
|
|
||||||
|
TaskScreenService taskScreenService = SpringContextHolder.getBean(TaskScreenService.class);
|
||||||
//工作模式
|
//工作模式
|
||||||
int mode = 0;
|
int mode = 0;
|
||||||
int last_mode = 0;
|
int last_mode = 0;
|
||||||
@@ -227,8 +232,24 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
|||||||
}
|
}
|
||||||
if(move !=last_move){
|
if(move !=last_move){
|
||||||
if (ObjectUtil.isNotEmpty(inst)){
|
if (ObjectUtil.isNotEmpty(inst)){
|
||||||
Thread.sleep(10000);
|
if (move==0){
|
||||||
led_message = clearMessage();
|
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;
|
requireSucess = false;
|
||||||
}
|
}
|
||||||
@@ -499,6 +520,20 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
|
|||||||
list.add(map3);
|
list.add(map3);
|
||||||
this.writing(list);
|
this.writing(list);
|
||||||
led_message = getLedMessage(instdto);
|
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;
|
requireSucess = true;
|
||||||
while (!StrUtil.equals(this.getOpcValueAccessor().getValue(this.getOpcServer() + "." + this.getOpcPlc() + "." + this.getDevice_code() + ".task").toString()
|
while (!StrUtil.equals(this.getOpcValueAccessor().getValue(this.getOpcServer() + "." + this.getOpcPlc() + "." + this.getDevice_code() + ".task").toString()
|
||||||
, instdto.getInstruction_code())) {
|
, instdto.getInstruction_code())) {
|
||||||
|
|||||||
@@ -46,11 +46,15 @@ public class TaskScreenServiceImpl extends CommonServiceImpl<TaskScreenMapper, D
|
|||||||
private final DeviceService deviceService;
|
private final DeviceService deviceService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void autoInitial() throws Exception {
|
public void autoInitial() throws Exception {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JSONArray selectLedList() {
|
public JSONArray selectLedList() {
|
||||||
List<Device> list = new LambdaQueryChainWrapper<Device>(deviceMapper)
|
List<Device> list = new LambdaQueryChainWrapper<Device>(deviceMapper)
|
||||||
@@ -90,7 +94,7 @@ public class TaskScreenServiceImpl extends CommonServiceImpl<TaskScreenMapper, D
|
|||||||
if (device.getDeviceDriver() instanceof ConveyorWithScannerWeightDeviceDriver) {
|
if (device.getDeviceDriver() instanceof ConveyorWithScannerWeightDeviceDriver) {
|
||||||
conveyorWithScannerWeightDeviceDriver = (ConveyorWithScannerWeightDeviceDriver) device.getDeviceDriver();
|
conveyorWithScannerWeightDeviceDriver = (ConveyorWithScannerWeightDeviceDriver) device.getDeviceDriver();
|
||||||
if (ObjectUtil.isNotEmpty(conveyorWithScannerWeightDeviceDriver.getLed_message())) {
|
if (ObjectUtil.isNotEmpty(conveyorWithScannerWeightDeviceDriver.getLed_message())) {
|
||||||
json = conveyorWithScannerWeightDeviceDriver.getLed_message();
|
json = conveyorWithScannerWeightDeviceDriver.getLed_message();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return json;
|
return json;
|
||||||
|
|||||||
@@ -152,7 +152,8 @@ export default {
|
|||||||
// 定时器
|
// 定时器
|
||||||
const timer = setInterval(() => {
|
const timer = setInterval(() => {
|
||||||
this.settime()// 你所加载数据的方法
|
this.settime()// 你所加载数据的方法
|
||||||
}, 1000)
|
this.getMessage()
|
||||||
|
}, 10000)
|
||||||
// 销毁定时器
|
// 销毁定时器
|
||||||
this.$once('hook:beforeDestroy', () => {
|
this.$once('hook:beforeDestroy', () => {
|
||||||
clearInterval(timer)
|
clearInterval(timer)
|
||||||
@@ -183,6 +184,11 @@ export default {
|
|||||||
this.initStatus()
|
this.initStatus()
|
||||||
}, 10000)
|
}, 10000)
|
||||||
},
|
},
|
||||||
|
getMessage() {
|
||||||
|
deviceCrud.getLedMessage(this.device).then(data => {
|
||||||
|
this.form = data
|
||||||
|
})
|
||||||
|
},
|
||||||
settime() {
|
settime() {
|
||||||
const _this = this
|
const _this = this
|
||||||
const yy = new Date().getFullYear()
|
const yy = new Date().getFullYear()
|
||||||
|
|||||||
Reference in New Issue
Block a user