汪菘 1 year ago
parent
commit
c9c87b1ad6
  1. BIN
      acs/nladmin-system/src/main/java/org/nl/acs/device/wql/task_inst.xls
  2. 12
      acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java
  3. 159
      acs/nladmin-system/src/main/java/org/nl/acs/device_driver/driver/AbstractOpcDeviceDriver.java
  4. 6
      acs/nladmin-system/src/main/java/org/nl/acs/device_driver/driver/OpcDeviceDriver.java
  5. 4
      acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_Laminating_machine/LnshLaminatingMachineDeviceDriver.java
  6. 82
      acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_fold_disc_site/LnshFoldDiscSiteDeviceDriver.java
  7. 4
      acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_mixing_mill/LnshMixingMillDeviceDriver.java
  8. 4
      acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_package_pallet_manipulator/LnshPackagePalletManipulatorDeviceDriver.java
  9. 3
      acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator_site/LnshPalletizingManipulatorSiteDeviceDriver.java
  10. 1201
      acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_rgv/LnshRGVDeviceDriver.java
  11. 6
      acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_station/LnshStationDeviceDriver.java
  12. 4
      acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/AcsToWmsData/applyTask/ApplyTaskResponse.java
  13. 16
      acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java
  14. 125
      acs/nladmin-system/src/main/java/org/nl/acs/opc/JsonUtl.java
  15. 4
      acs/nladmin-system/src/main/java/org/nl/acs/task/service/dto/TaskDto.java
  16. 28
      acs/nladmin-system/src/main/java/org/nl/modules/logicflow/service/impl/StageServiceImpl.java
  17. 78
      acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_fold_disc_site.vue
  18. 8
      acs/nladmin-ui/src/views/acs/instruction/index.vue
  19. 8
      acs/nladmin-ui/src/views/acs/task/index.vue

BIN
acs/nladmin-system/src/main/java/org/nl/acs/device/wql/task_inst.xls

Binary file not shown.

12
acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java

@ -217,7 +217,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
//标准版-机械手对接位
if (device.getDeviceDriver() instanceof LnshPalletizingManipulatorSiteDeviceDriver) {
lnshPalletizingManipulatorSiteDeviceDriver = (LnshPalletizingManipulatorSiteDeviceDriver) device.getDeviceDriver();
lnshPalletizingManipulatorSiteDeviceDriver.writing(3);
lnshPalletizingManipulatorSiteDeviceDriver.writing(2);
if (lnshPalletizingManipulatorSiteDeviceDriver.getMode() != 0
&& lnshPalletizingManipulatorSiteDeviceDriver.getMove() != 0
&& (lnshPalletizingManipulatorSiteDeviceDriver.getIo_action() == 3 || lnshPalletizingManipulatorSiteDeviceDriver.getIo_action() == 1)
@ -364,7 +364,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
lnshFoldDiscSiteDeviceDriver = (LnshFoldDiscSiteDeviceDriver) device.getDeviceDriver();
lnshFoldDiscSiteDeviceDriver.writing(3);
if (lnshFoldDiscSiteDeviceDriver.getMode() != 0
&& lnshFoldDiscSiteDeviceDriver.getMove() != 0) {
&& lnshFoldDiscSiteDeviceDriver.getContainer_qty() > 0) {
// && (lnshFoldDiscSiteDeviceDriver.getIo_action() == 3 || lnshFoldDiscSiteDeviceDriver.getIo_action() == 1)
// && (lnshFoldDiscSiteDeviceDriver.getAction() == 3 || lnshFoldDiscSiteDeviceDriver.getAction() == 1)
inst.setExecute_status("1");
@ -453,7 +453,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
//标准版-机械手对接位
if (device.getDeviceDriver() instanceof LnshPalletizingManipulatorSiteDeviceDriver) {
lnshPalletizingManipulatorSiteDeviceDriver = (LnshPalletizingManipulatorSiteDeviceDriver) device.getDeviceDriver();
lnshPalletizingManipulatorSiteDeviceDriver.writing(5);
lnshPalletizingManipulatorSiteDeviceDriver.writing(3);
if (lnshPalletizingManipulatorSiteDeviceDriver.getMode() != 0
&& lnshPalletizingManipulatorSiteDeviceDriver.getMove() == 0
&& (lnshPalletizingManipulatorSiteDeviceDriver.getIo_action() == 3 || lnshPalletizingManipulatorSiteDeviceDriver.getIo_action() == 2)
@ -592,7 +592,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
lnshFoldDiscSiteDeviceDriver = (LnshFoldDiscSiteDeviceDriver) device.getDeviceDriver();
lnshFoldDiscSiteDeviceDriver.writing(5);
if (lnshFoldDiscSiteDeviceDriver.getMode() != 0
&& lnshFoldDiscSiteDeviceDriver.getMove() != 0
&& lnshFoldDiscSiteDeviceDriver.getContainer_qty() == 0
// && (lnshFoldDiscSiteDeviceDriver.getIo_action() == 3 || lnshFoldDiscSiteDeviceDriver.getIo_action() == 2)
) {
inst.setExecute_status("5");
@ -844,7 +844,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
lnshFoldDiscSiteDeviceDriver = (LnshFoldDiscSiteDeviceDriver) device.getDeviceDriver();
lnshFoldDiscSiteDeviceDriver.writing(4);
if (lnshFoldDiscSiteDeviceDriver.getMode() != 0
&& lnshFoldDiscSiteDeviceDriver.getMove() == 0
// && lnshFoldDiscSiteDeviceDriver.getContainer_qty() == 0
// && (lnshFoldDiscSiteDeviceDriver.getIo_action() == 1 || lnshFoldDiscSiteDeviceDriver.getIo_action() == 3)
// && (lnshFoldDiscSiteDeviceDriver.getAction() == 2 || lnshFoldDiscSiteDeviceDriver.getAction() == 3)
) {
@ -1086,7 +1086,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
if (device.getDeviceDriver() instanceof LnshFoldDiscSiteDeviceDriver) {
lnshFoldDiscSiteDeviceDriver = (LnshFoldDiscSiteDeviceDriver) device.getDeviceDriver();
if (lnshFoldDiscSiteDeviceDriver.getMode() != 0
&& lnshFoldDiscSiteDeviceDriver.getMove() != 0
// && lnshFoldDiscSiteDeviceDriver.getMove() != 0
// && (lnshFoldDiscSiteDeviceDriver.getIo_action() == 2 || lnshFoldDiscSiteDeviceDriver.getIo_action() == 3)
) {
inst.setExecute_status("6");

159
acs/nladmin-system/src/main/java/org/nl/acs/device_driver/driver/AbstractOpcDeviceDriver.java

@ -1,18 +1,175 @@
package org.nl.acs.device_driver.driver;
import org.nl.acs.opc.OpcConfig;
import org.nl.acs.opc.*;
import org.nl.acs.udw.UnifiedDataAccessor;
import org.nl.acs.udw.UnifiedDataAccessorFactory;
import org.nl.acs.udw.UnifiedDataAppService;
import org.nl.modules.wql.exception.WDKException;
import org.nl.modules.wql.util.SpringContextHolder;
import org.openscada.opc.lib.da.Group;
import org.openscada.opc.lib.da.Item;
import org.openscada.opc.lib.da.ItemState;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.*;
public class AbstractOpcDeviceDriver extends AbstractDeviceDriver implements OpcDeviceDriver {
UnifiedDataAccessor opcUdw;
@Autowired
private OpcServerService opcServerService = SpringContextHolder.getBean(OpcServerService .class);
public AbstractOpcDeviceDriver() {
this.opcUdw = UnifiedDataAccessorFactory.getAccessor(OpcConfig.udw_opc_value_key);
}
private Date sendTime;
private String last_items;
private int noLog_sendTimeOut;
private Date noLog_sendTime;
private String noLog_last_items;
@Override
public UnifiedDataAccessor getOpcValueAccessor() {
return this.opcUdw;
}
public void checkcontrol(Map<String, Object> itemValues) throws Exception {
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) {
//下发信号
control( itemValues);
Map<String, Object> read = new HashMap();
Map<Item, ItemState> 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);
}
boolean check = true;
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;
}
}
if (check) {
return;
}
if (i > 0) {
ThreadUtl.sleep(300L);
}
if (i > 3) {
throw new WDKException("写入次数超过3次而失败");
}
++i;
}
}
public boolean control(Map<String, Object> itemValues) {
Iterator<Map.Entry<String, Object>> it = itemValues.entrySet().iterator();
ItemValue p2[];
p2 = new ItemValue[itemValues.size()];
int i=0;
while (it.hasNext()) {
Map.Entry<String, Object> entry = it.next();
System.out.println("即将写入值:"+entry.getKey() + ":" + entry.getValue());
p2[i] = new ItemValue();
p2[i].setItem_code(entry.getKey());
p2[i].setItem_value(entry.getValue());
i++;
}
return this.control(p2);
}
public boolean control(ItemValue[] itemValues) {
if (itemValues != null && itemValues.length != 0) {
String this_items = JsonUtl.parseWithoutException(itemValues);
boolean need_write = false;
StringBuilder sb = new StringBuilder();
ItemValue[] var5 = itemValues;
int var6 = itemValues.length;
for (int var7 = 0; var7 < var6; ++var7) {
ItemValue itemValue = var5[var7];
String code = itemValue.getItem_code();
Object udw_value = this.getUdwValue(code);
Object write_value = itemValue.getItem_value();
sb.append(code);
sb.append(":");
sb.append(JsonUtl.parseWithoutException(udw_value));
sb.append(";");
if (!need_write && !UnifiedDataAppService.isEquals(udw_value, write_value)) {
need_write = true;
} else {
//log.warn("下发信号点位{} 当前写入值:{} 与系统内存值:{} 相同,不再写入 ", code, write_value, udw_value );
}
}
// need_write = true;
if (need_write) {
Date date = new Date();
/*if (StringUtl.isEqual(this_items, this.last_items) && date.getTime() - this.sendTime.getTime() < (long) WcsConfig.opc_write_repeat_check) {
log.trace("发送时间因为小于{}毫秒,而被无视", WcsConfig.opc_write_repeat_check);
return false;
}*/
this.last_items = this_items;
this.sendTime = date;
/* this.execute_log.setResource(this.getDevice().getCode(), this.getDevice().getName());
this.execute_log.log("原始记录{}->变更为{}", new Object[]{sb, this_items});
OpcServerService opcServerService = OpcServerFactory.getOpcServerService();*/
OpcServerService opcServerService = SpringContextHolder.getBean(OpcServerServiceImpl.class);
opcServerService.writeInteger(this.getOpcServer(), itemValues);
UnifiedDataAccessor opcValueAccessor = this.getOpcValueAccessor();
ItemValue[] var17 = itemValues;
int var18 = itemValues.length;
for (int var19 = 0; var19 < var18; ++var19) {
ItemValue itemValue = var17[var19];
String code = itemValue.getItem_code();
Object value = itemValue.getItem_value();
opcValueAccessor.setValue(code, value);
}
}
return true;
} else {
throw new WDKException("下发 无内容");
}
}
}

6
acs/nladmin-system/src/main/java/org/nl/acs/device_driver/driver/OpcDeviceDriver.java

@ -58,7 +58,8 @@ public interface OpcDeviceDriver extends DeviceDriver {
}
default Integer getIntegeregerValue(String protocol) {
return (Integer) this.getValue(protocol);
Object value = this.getValue(protocol)==null?"0":this.getValue(protocol);
return Integer.parseInt(value.toString());
}
default int[] getIntegeregerArrayValue(String protocol) {
@ -86,4 +87,7 @@ public interface OpcDeviceDriver extends DeviceDriver {
return this.getOpcServer() + "." + this.getOpcPlc() + "." + this.getDeviceCode() + "." + item;
}
default Object getUdwValue(String protocol) {
return this.getOpcValueAccessor().getValue(protocol);
}
}

4
acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_Laminating_machine/LnshLaminatingMachineDeviceDriver.java

@ -155,12 +155,14 @@ public class LnshLaminatingMachineDeviceDriver extends AbstractOpcDeviceDriver i
request.setVehicle_type(String.valueOf(container_type));
ApplySignalStatusResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)), ApplySignalStatusResponse.class);
message = RequestMethodEnum.getName("real_time_set_point") + "real_time_set_point 接口请求LMS...";
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request)));
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "请求参数:" + JSON.toJSONString(request)));
if (resp.getCode() == 200) {
message = RequestMethodEnum.getName("real_time_set_point") + "real_time_set_point 接口请求成功" + resp.getMessage();;
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "返回参数:" + JSON.toJSONString(request)));
} else {
message = RequestMethodEnum.getName("real_time_set_point") + "real_time_set_point 接口请求失败" + resp.getMessage();;
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "返回参数:" + JSON.toJSONString(request)));
}
}
}

82
acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_fold_disc_site/LnshFoldDiscSiteDeviceDriver.java

@ -2,6 +2,7 @@ package org.nl.acs.device_driver.lnsh.lnsh_fold_disc_site;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.http.HttpResponse;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import lombok.Getter;
import lombok.Setter;
@ -10,9 +11,12 @@ import lombok.extern.slf4j.Slf4j;
import org.nl.acs.device.device_driver.standard_inspect.ReadUtil;
import org.nl.acs.device.service.DeviceService;
import org.nl.acs.device_driver.DeviceDriver;
import org.nl.acs.device_driver.RequestMethodEnum;
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.ext.wms.data.AcsToWmsData.applyTask.ApplyTaskRequest;
import org.nl.acs.ext.wms.data.AcsToWmsData.applyTask.ApplyTaskResponse;
import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.instruction.service.dto.Instruction;
@ -21,11 +25,14 @@ import org.nl.acs.monitor.DeviceStageMonitor;
import org.nl.acs.opc.Device;
import org.nl.acs.route.service.RouteLineService;
import org.nl.acs.task.service.TaskService;
import org.nl.modules.lucene.service.LuceneExecuteLogService;
import org.nl.modules.lucene.service.dto.LuceneLogDto;
import org.nl.modules.wql.util.SpringContextHolder;
import org.openscada.opc.lib.da.Server;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import java.lang.reflect.Method;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
@ -41,6 +48,8 @@ import java.util.Map;
public class LnshFoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor {
protected ItemProtocol itemProtocol = new ItemProtocol(this);
LuceneExecuteLogService lucene = SpringContextHolder.getBean("luceneExecuteLogServiceImpl");
InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl");
DeviceService deviceservice = SpringContextHolder.getBean("deviceServiceImpl");
@ -190,17 +199,21 @@ public class LnshFoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implem
message = "";
Instruction instruction = null;
List toInstructions;
switch (mode) {
case 1:
log.debug("设备运转模式:等待工作");
break;
case 2:
// int max_emptypalletnum = Integer.parseInt(this.getDevice().getExtraValue().get("max_emptypalletnum").toString());
// //当前数量等于最大数量,则生成搬运任务
// if (!requireSucess && container_qty >= max_emptypalletnum) {
// putStorage();
// }
break;
if (mode > 2 && !requireSucess) {
if (ObjectUtil.isNotEmpty(this.device.getExtraValue().get(String.valueOf(mode)))) {
String modethod = this.device.getExtraValue().get(String.valueOf(mode)).toString();
try {
applyRequest(modethod);
} catch (Exception e) {
message = "错误:" + e.getMessage();
this.setIserror(true);
}
} else {
message = "无效模式请求,驱动未配置此请求方法";
}
} else {
message = "无请求";
}
}
@ -216,34 +229,57 @@ public class LnshFoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implem
/**
* 拆垛完成
* 请求
*
* @param
*/
public synchronized boolean palletizing() {
public synchronized boolean applyRequest(String modethod) throws Exception {
Object obj1 = this;
Date date = new Date();
if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) {
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
return false;
} else {
this.instruction_require_time = date;
JSONObject json = new JSONObject();
json.put("device_code", device_code);
json.put("type", "3");
HttpResponse result = acsToWmsService.lnshApplyTaskToWms(json);
if (ObjectUtil.isNotEmpty(result)) {
if (result.getStatus() == HttpStatus.OK.value()) {
JSONObject jsonObject = JSONObject.parseObject(result.body());
if (ObjectUtil.isNotEmpty(jsonObject) && "200".equals(jsonObject.getString("status"))) {
this.writing(200);
requireSucess = true;
Object obj = this.getClass().getDeclaredConstructor().newInstance();
Method method1 = this.getClass().getMethod(modethod, null);
method1.invoke(this, null);
return true;
}
}
/**
* 申请取走空料盅托盘
*
* @param
*/
public synchronized boolean apply_take_empty_vehicle() {
if(move == 1) {
ApplyTaskRequest request = new ApplyTaskRequest();
request.setDevice_code(this.getDevice_code());
request.setRequest_medthod_code(Thread.currentThread().getStackTrace()[1].getMethodName());
request.setRequest_medthod_name(RequestMethodEnum.getName(Thread.currentThread().getStackTrace()[1].getMethodName()));
ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class);
message = RequestMethodEnum.getName("apply_take_empty_vehicle") + "apply_take_empty_vehicle 接口请求LMS...";
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request)));
if (resp.getCode() == 200) {
this.writing(200);
this.setRequireSucess(true);
} else {
this.writing(400);
message = RequestMethodEnum.getName("apply_take_empty_vehicle") + "apply_take_empty_vehicle 接口请求失败" + resp.getMessage();;
}
return true;
} else {
message = RequestMethodEnum.getName("apply_take_empty_vehicle") + "apply_take_empty_vehicle 设备无货未请求LMS...";
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message));
return false;
}
}
public void writing(String param, String value) {
String to_param = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()

4
acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_mixing_mill/LnshMixingMillDeviceDriver.java

@ -400,7 +400,7 @@ public class LnshMixingMillDeviceDriver extends AbstractOpcDeviceDriver implemen
ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class);
if (resp.getCode() == 200) {
this.writing(200);
this.writing(101);
this.setRequireSucess(true);
} else {
this.writing(400);
@ -423,7 +423,7 @@ public class LnshMixingMillDeviceDriver extends AbstractOpcDeviceDriver implemen
ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class);
if (resp.getCode() == 200) {
this.writing(200);
this.writing(102);
this.setRequireSucess(true);
} else {
this.writing(400);

4
acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_package_pallet_manipulator/LnshPackagePalletManipulatorDeviceDriver.java

@ -429,7 +429,7 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD
ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class);
if (resp.getCode() == 200) {
this.writing(200);
this.writing(101);
this.setRequireSucess(true);
} else {
this.writing(400);
@ -452,7 +452,7 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD
ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class);
if (resp.getCode() == 200) {
this.writing(200);
this.writing(102);
this.setRequireSucess(true);
} else {
this.writing(400);

3
acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator_site/LnshPalletizingManipulatorSiteDeviceDriver.java

@ -330,6 +330,9 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic
tool_coordinate = this.itemProtocol.getTool_coordinate();
if (mode != last_mode) {
this.setRequireSucess(false);
if(mode==2){
writing(0);
}
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode));
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + " -> " + mode);
}

1201
acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_rgv/LnshRGVDeviceDriver.java

File diff suppressed because it is too large

6
acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_station/LnshStationDeviceDriver.java

@ -258,8 +258,6 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
} else {
message = "无请求";
}
Object ignore_pickup_check = this.getExtraValue().get("ignore_pickup_check");
}
last_mode = mode;
@ -599,7 +597,7 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
* @param
*/
public synchronized boolean apply_take_empty_vehicle() {
if(move == 0) {
if(move == 1) {
ApplyTaskRequest request = new ApplyTaskRequest();
request.setDevice_code(this.getDevice_code());
request.setRequest_medthod_code(Thread.currentThread().getStackTrace()[1].getMethodName());
@ -619,7 +617,7 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
}
return true;
} else {
message = RequestMethodEnum.getName("apply_take_empty_vehicle") + "apply_take_empty_vehicle 设备货未请求LMS...";
message = RequestMethodEnum.getName("apply_take_empty_vehicle") + "apply_take_empty_vehicle 设备货未请求LMS...";
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message));
return false;
}

4
acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/AcsToWmsData/applyTask/ApplyTaskResponse.java

@ -22,4 +22,8 @@ public class ApplyTaskResponse extends BaseResponse {
private String mix_num;
private String weight;
//private String is_order_finish;
}

16
acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java

@ -855,10 +855,10 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
jo.put("device_code", device.getDevice_code());
jo.put("mode", lnshRGVDeviceDriver.getMode());
jo.put("status", lnshRGVDeviceDriver.getStatus());
jo.put("move1", lnshRGVDeviceDriver.getMove1());
jo.put("move2", lnshRGVDeviceDriver.getMove2());
jo.put("action1", lnshRGVDeviceDriver.getAction1());
jo.put("action2", lnshRGVDeviceDriver.getAction2());
jo.put("move1", lnshRGVDeviceDriver.getMove_1());
jo.put("move2", lnshRGVDeviceDriver.getMove_2());
jo.put("action1", lnshRGVDeviceDriver.getAction_1());
jo.put("action2", lnshRGVDeviceDriver.getAction_2());
jo.put("walk_y", lnshRGVDeviceDriver.getWalk_y());
jo.put("error", lnshRGVDeviceDriver.getError());
jo.put("task1", lnshRGVDeviceDriver.getTask1());
@ -1064,10 +1064,10 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
jo.put("device_code", device.getDevice_code());
jo.put("mode", lnshRGVDeviceDriver.getMode());
jo.put("status", lnshRGVDeviceDriver.getStatus());
jo.put("move_1", lnshRGVDeviceDriver.getMove1());
jo.put("move_2", lnshRGVDeviceDriver.getMove2());
jo.put("action_1", lnshRGVDeviceDriver.getAction1());
jo.put("action_2", lnshRGVDeviceDriver.getAction2());
jo.put("move_1", lnshRGVDeviceDriver.getMove_1());
jo.put("move_2", lnshRGVDeviceDriver.getMove_2());
jo.put("action_1", lnshRGVDeviceDriver.getAction_1());
jo.put("action_2", lnshRGVDeviceDriver.getAction_2());
jo.put("walk_y", lnshRGVDeviceDriver.getWalk_y());
jo.put("error", lnshRGVDeviceDriver.getError());
jo.put("task1", lnshRGVDeviceDriver.getTask1());

125
acs/nladmin-system/src/main/java/org/nl/acs/opc/JsonUtl.java

@ -0,0 +1,125 @@
package org.nl.acs.opc;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.databind.type.TypeFactory;
import java.io.IOException;
import java.util.List;
import java.util.Map;
public class JsonUtl {
private static ObjectMapper objectMapper = null;
private static ObjectMapper objectMapperLog = null;
private JsonUtl() {
}
private static ObjectMapper init() {
ObjectMapper objectMapper = new ObjectMapper();
SimpleModule simpleModule = new SimpleModule();
// simpleModule.addSerializer(Enum.class, new EnumSerializer());
// simpleModule.addSerializer(Date.class, new DateSerializer());
// simpleModule.addDeserializer(Enum.class, new EnumDeserializer());
// simpleModule.addDeserializer(Date.class, new DateDeserializers.DateDeserializer());
objectMapper.registerModule(simpleModule);
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
return objectMapper;
}
public static ObjectMapper getInstance() {
if (objectMapper == null) {
Class var0 = JsonUtl.class;
synchronized(JsonUtl.class) {
if (objectMapper == null) {
objectMapper = init();
}
}
}
return objectMapper;
}
public static ObjectMapper getInstanceLog() {
if (objectMapperLog == null) {
Class var0 = JsonUtl.class;
synchronized(JsonUtl.class) {
if (objectMapperLog == null) {
objectMapperLog = init();
objectMapperLog.setSerializationInclusion(Include.NON_NULL);
}
}
}
return objectMapperLog;
}
public static ObjectMapper getObjectMapper() {
return getInstance();
}
public static String parse(Object object) throws RuntimeException {
try {
return getObjectMapper().writeValueAsString(object);
} catch (JsonProcessingException var2) {
throw new RuntimeException(var2);
}
}
public static String parseWithoutException(Object object) {
try {
return parse(object);
} catch (Exception var2) {
return null;
}
}
public static String parseLog(Object object) {
try {
return getInstanceLog().writeValueAsString(object);
} catch (Exception var2) {
return null;
}
}
public static <T> T format(String json, Class<T> clazz) throws RuntimeException {
try {
return getObjectMapper().readValue(json, clazz);
} catch (IOException var3) {
throw new RuntimeException(var3);
}
}
public static <T> List<T> formatList(String json, Class<T> clazz) throws RuntimeException {
try {
JavaType type = getObjectMapper().getTypeFactory().constructParametricType(List.class, new Class[]{clazz});
return (List)getObjectMapper().readValue(json, type);
} catch (IOException var3) {
throw new RuntimeException(var3);
}
}
public static <T, U> Map<T, U> formatMap(String json, Class<T> clazzKey, Class<U> clazzValue) throws RuntimeException {
try {
JavaType type = getObjectMapper().getTypeFactory().constructParametricType(Map.class, new Class[]{clazzKey, clazzValue});
return (Map)getObjectMapper().readValue(json, type);
} catch (IOException var4) {
throw new RuntimeException(var4);
}
}
public static <T> List<List<T>> formatListTwo(String json, Class<T> clazz) throws RuntimeException {
try {
TypeFactory typeFactory = getObjectMapper().getTypeFactory();
JavaType type = typeFactory.constructParametrizedType(List.class, List.class, new Class[]{clazz});
type = typeFactory.constructParametrizedType(List.class, List.class, new JavaType[]{type});
return (List)getObjectMapper().readValue(json, type);
} catch (IOException var4) {
throw new RuntimeException(var4);
}
}
}

4
acs/nladmin-system/src/main/java/org/nl/acs/task/service/dto/TaskDto.java

@ -248,4 +248,8 @@ public class TaskDto implements Serializable {
*/
private String direction;
/**
* 放货设备编号(覆膜机)
*/
private String put_device_code;
}

28
acs/nladmin-system/src/main/java/org/nl/modules/logicflow/service/impl/StageServiceImpl.java

@ -740,39 +740,39 @@ public class StageServiceImpl implements StageService {
status = "故障";
}
if (lnshRGVDeviceDriver.getMove1() == 0) {
if (lnshRGVDeviceDriver.getMove_1() == 0) {
move_1 = "无货";
} else if (lnshRGVDeviceDriver.getMove1() == 1) {
} else if (lnshRGVDeviceDriver.getMove_1() == 1) {
move_1 = "有货";
} else if (lnshRGVDeviceDriver.getMove1() == 2) {
} else if (lnshRGVDeviceDriver.getMove_1() == 2) {
move_1 = "有托盘有货";
}
if (lnshRGVDeviceDriver.getMove2() == 0) {
if (lnshRGVDeviceDriver.getMove_2() == 0) {
move_2 = "无货";
} else if (lnshRGVDeviceDriver.getMove2() == 1) {
} else if (lnshRGVDeviceDriver.getMove_2() == 1) {
move_2 = "有货";
} else if (lnshRGVDeviceDriver.getMove2() == 2) {
} else if (lnshRGVDeviceDriver.getMove_2() == 2) {
move_2 = "有托盘有货";
}
if (lnshRGVDeviceDriver.getAction1() == 1) {
if (lnshRGVDeviceDriver.getAction_1() == 1) {
action_1 = "取货中";
} else if (lnshRGVDeviceDriver.getAction1() == 2) {
} else if (lnshRGVDeviceDriver.getAction_1() == 2) {
action_1 = "取货完成";
} else if (lnshRGVDeviceDriver.getAction1() == 3) {
} else if (lnshRGVDeviceDriver.getAction_1() == 3) {
action_1 = "放货中";
} else if (lnshRGVDeviceDriver.getAction1() == 4) {
} else if (lnshRGVDeviceDriver.getAction_1() == 4) {
action_1 = "放货完成";
}
if (lnshRGVDeviceDriver.getAction2() == 1) {
if (lnshRGVDeviceDriver.getAction_2() == 1) {
action_2 = "取货中";
} else if (lnshRGVDeviceDriver.getAction2() == 2) {
} else if (lnshRGVDeviceDriver.getAction_2() == 2) {
action_2 = "取货完成";
} else if (lnshRGVDeviceDriver.getAction2() == 3) {
} else if (lnshRGVDeviceDriver.getAction_2() == 3) {
action_2 = "放货中";
} else if (lnshRGVDeviceDriver.getAction2() == 4) {
} else if (lnshRGVDeviceDriver.getAction_2() == 4) {
action_2 = "放货完成";
}

78
acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_fold_disc_site.vue

@ -166,6 +166,68 @@
</el-form>
</el-card>
<el-card class="box-card" shadow="never">
<div slot="header" class="clearfix">
<span class="role-span">交互相关</span>
</div>
<div class="crud-opts2" style="margin-bottom: 5px;">
<span class="crud-opts-right2">
<!--左侧插槽-->
<slot name="left" />
<el-button
slot="left"
class="filter-item"
type="primary"
icon="el-icon-plus"
size="mini"
@click="insertdtl()"
>
新增一行
</el-button>
</span>
</div>
<div class="app-container">
<el-table :data="modeform.tableData" border fit highlight-current-row style="width: 100%;" class="tb-edit">
<el-table-column label="mode" prop="模式" width="180">
<template scope="scope">
<el-input-number value="3" :min="3" v-model="scope.row.mode" size="mini" />
<span v-show="scope.row.edit">{{ scope.row.mode }}</span>
</template>
</el-table-column>
<el-table-column label="request" prop="请求方法" width="500">
<template scope="scope">
<el-select
v-model="scope.row.request"
filterable
clearable
placeholder="请选择"
style="width: 450px"
>
<el-option
v-for="item in requestMethodList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</template>
</el-table-column>
<el-table-column align="center" label="操作" width="170" >
<template scope="scope">
<el-button
type="danger"
class="filter-item"
size="mini"
icon="el-icon-delete"
@click.native.prevent="deleteRow(scope.$index, modeform.tableData)"
/>
</template>
</el-table-column>
</el-table>
</div>
</el-card>
<el-card class="box-card" shadow="never">
<div slot="header" class="clearfix">
<span class="role-span">PLC读取字段</span>
@ -301,11 +363,20 @@ export default {
opc_id: '',
opc_code: '',
configLoading: false,
requestMethodList: [],
dataOpcservers: [],
dataOpcPlcs: [],
deviceList: [],
data1: [],
data2: [],
modeform: {
tableData: [
{
mode: '8',
request: 'apply_force_take_full_vehicle'
}
]
},
form: {
inspect_in_stocck: true,
ignore_pickup_check: true,
@ -360,9 +431,16 @@ export default {
deviceCrud.selectDeviceList().then(data => {
this.deviceList = data
})
deviceCrud.selectRequestMethodList().then(data => {
this.requestMethodList = data
})
})
},
methods: {
deleteRow(index, rows) {
debugger
rows.splice(index, 1)
},
finishReadEdit(data) {
// code,mode
if (data.code.indexOf('mode') !== -1) {

8
acs/nladmin-ui/src/views/acs/instruction/index.vue

@ -127,9 +127,13 @@
</template>
</el-table-column>
<el-table-column prop="start_point_code" label="起点" min-width="100" show-overflow-tooltip />
<el-table-column prop="start_parent_code" label="父起点点位" min-width="100" show-overflow-tooltip />
<!-- <el-table-column prop="start_parent_code" label="父起点点位" min-width="100" show-overflow-tooltip />-->
<el-table-column prop="next_point_code" label="终点" min-width="100" show-overflow-tooltip />
<el-table-column prop="next_parent_code" label="父终点点位" min-width="100" show-overflow-tooltip />
<!-- <el-table-column prop="next_parent_code" label="父终点点位" min-width="100" show-overflow-tooltip />-->
<el-table-column prop="start_point_code2" label="起点2" min-width="100" show-overflow-tooltip />
<el-table-column prop="next_point_code2" label="终点2" min-width="100" show-overflow-tooltip />
<el-table-column prop="next_device_code" label="放货位" min-width="100" show-overflow-tooltip />
<el-table-column prop="carno" label="车号" />
<el-table-column prop="compound_inst" label="复合指令">
<template slot-scope="scope">

8
acs/nladmin-ui/src/views/acs/task/index.vue

@ -261,9 +261,13 @@
</el-table-column>
<el-table-column prop="priority" label="任务优先级" min-width="100" show-overflow-tooltip />
<el-table-column prop="start_point_code" label="起点" min-width="100" show-overflow-tooltip />
<el-table-column prop="start_parent_code" label="父起点点位" min-width="100" show-overflow-tooltip />
<!-- <el-table-column prop="start_parent_code" label="父起点点位" min-width="100" show-overflow-tooltip />-->
<el-table-column prop="next_point_code" label="终点" min-width="100" show-overflow-tooltip />
<el-table-column prop="next_parent_code" label="父终点点位" min-width="100" show-overflow-tooltip />
<!-- <el-table-column prop="next_parent_code" label="父终点点位" min-width="100" show-overflow-tooltip />-->
<el-table-column prop="start_point_code2" label="起点2" min-width="100" show-overflow-tooltip />
<el-table-column prop="next_point_code2" label="终点2" min-width="100" show-overflow-tooltip />
<el-table-column prop="next_device_code" label="放货位" min-width="100" show-overflow-tooltip />
<el-table-column prop="compound_task" label="复合任务">
<template slot-scope="scope">
<span v-if="scope.row.compound_task==='0' "></span>

Loading…
Cancel
Save