add 混碾满料反馈重量和混碾机驱动修改
This commit is contained in:
@@ -48,8 +48,7 @@ public enum RequestMethodEnum {
|
||||
|
||||
press_request_material(19, "pressRequestMaterial", "压机叫料","0"),
|
||||
|
||||
wooden_pallet_binding(20,"wooden_pallet_binding","木托盘绑定","0");
|
||||
|
||||
mix_full(21,"mix_full","混碾满料反馈重量","0");
|
||||
|
||||
//驱动索引
|
||||
private int index;
|
||||
|
||||
@@ -310,8 +310,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
|
||||
if (conveyorPressStationDeviceDriver.getMode() != 0
|
||||
&& conveyorPressStationDeviceDriver.getMove() != 0
|
||||
&& (conveyorPressStationDeviceDriver.getIo_action() == 3 || conveyorPressStationDeviceDriver.getIo_action() == 1)
|
||||
&& (conveyorPressStationDeviceDriver.getAction() == 3 || conveyorPressStationDeviceDriver.getAction() == 1)) {
|
||||
) {
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command",2);
|
||||
conveyorPressStationDeviceDriver.writing(map);
|
||||
@@ -433,13 +432,6 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
}
|
||||
}
|
||||
|
||||
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
||||
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
|
||||
standardOrdinarySiteDeviceDriver.setAgvphase(phase);
|
||||
standardOrdinarySiteDeviceDriver.setIndex(index);
|
||||
standardOrdinarySiteDeviceDriver.setInst(inst);
|
||||
}
|
||||
|
||||
if (device.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
}
|
||||
@@ -575,7 +567,6 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
conveyorPressStationDeviceDriver = (ConveyorPressStationDeviceDriver) device.getDeviceDriver();
|
||||
if (conveyorPressStationDeviceDriver.getMode() != 0
|
||||
&& conveyorPressStationDeviceDriver.getMove() == 0
|
||||
&& (conveyorPressStationDeviceDriver.getIo_action() == 3 || conveyorPressStationDeviceDriver.getIo_action() == 2)
|
||||
) {
|
||||
inst.setExecute_status("5");
|
||||
instructionService.update(inst);
|
||||
@@ -686,21 +677,6 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message));
|
||||
}
|
||||
}
|
||||
if (StrUtil.equals(inst.getStart_device_code(), device_code)) {
|
||||
|
||||
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
||||
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
|
||||
standardOrdinarySiteDeviceDriver.setAgvphase(phase);
|
||||
standardOrdinarySiteDeviceDriver.setIndex(index);
|
||||
standardOrdinarySiteDeviceDriver.setInst(inst);
|
||||
}
|
||||
|
||||
if (device.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
|
||||
standardStorageDeviceDriver = (StandardStorageDeviceDriver) device.getDeviceDriver();
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
}
|
||||
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(data)) {
|
||||
logService.deviceExecuteLog(this.device_code, "", "", "agvphase:" + phase + "反馈:" + Bytes2HexString(data));
|
||||
log.info("{},{}", device_code,"agvphase:" + phase + "反馈:" + Bytes2HexString(data));
|
||||
@@ -852,8 +828,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
conveyorPressStationDeviceDriver = (ConveyorPressStationDeviceDriver) device.getDeviceDriver();
|
||||
if (conveyorPressStationDeviceDriver.getMode() != 0
|
||||
&& conveyorPressStationDeviceDriver.getMove() == 0
|
||||
&& (conveyorPressStationDeviceDriver.getIo_action() == 1 || conveyorPressStationDeviceDriver.getIo_action() == 3)
|
||||
&& (conveyorPressStationDeviceDriver.getAction() == 2 || conveyorPressStationDeviceDriver.getAction() == 3)) {
|
||||
) {
|
||||
inst.setExecute_status("3");
|
||||
instructionService.update(inst);
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
@@ -970,19 +945,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message));
|
||||
}
|
||||
}
|
||||
if (StrUtil.equals(inst.getNext_device_code(), device_code)) {
|
||||
|
||||
if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
|
||||
standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
}
|
||||
|
||||
if (device.getDeviceDriver() instanceof StandardStorageDeviceDriver) {
|
||||
standardStorageDeviceDriver = (StandardStorageDeviceDriver) device.getDeviceDriver();
|
||||
data = NDCAgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
}
|
||||
|
||||
}
|
||||
if (flag) {
|
||||
log.info("==================允许AGV放货==================");
|
||||
logService.deviceExecuteLog(device_code, "", "", "允许AGV放货。");
|
||||
@@ -1115,21 +1078,6 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
inst.setExecute_status("6");
|
||||
instructionService.update(inst);
|
||||
TaskDto task=taskService.findByCode(inst.getTask_code());
|
||||
if(ObjectUtil.isNotEmpty(task)){
|
||||
String direction=task.getDirection();
|
||||
if(ObjectUtil.isNotEmpty(direction)){
|
||||
Integer direction1=Integer.parseInt(direction);
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command",5);
|
||||
//困料位写入方向
|
||||
map.put("to_target",direction1);
|
||||
conveyorPressStationDeviceDriver.writing(map);
|
||||
}else{
|
||||
log.info("未输入方向");
|
||||
}
|
||||
}else{
|
||||
log.info("任务号为空");
|
||||
}
|
||||
data = AgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
conveyorPressStationDeviceDriver.setMessage("");
|
||||
flag = true;
|
||||
|
||||
@@ -25,6 +25,7 @@ import org.nl.acs.instruction.service.dto.Instruction;
|
||||
import org.nl.acs.log.service.DeviceExecuteLogService;
|
||||
import org.nl.acs.monitor.DeviceStageMonitor;
|
||||
import org.nl.acs.opc.Device;
|
||||
import org.nl.acs.opc.DeviceAppService;
|
||||
import org.nl.acs.order.service.ProduceshiftorderService;
|
||||
import org.nl.acs.route.service.RouteLineService;
|
||||
import org.nl.acs.task.service.TaskService;
|
||||
@@ -64,6 +65,8 @@ public class LnshMixingMillDeviceDriver extends AbstractOpcDeviceDriver implemen
|
||||
|
||||
ProduceshiftorderService produceshiftorderService = SpringContextHolder.getBean("produceshiftorderServiceImpl");
|
||||
|
||||
DeviceAppService deviceAppService = SpringContextHolder.getBean("deviceAppServiceImpl");
|
||||
|
||||
int mode = 0;
|
||||
int error = 0;
|
||||
int last_mode = 0;
|
||||
@@ -170,7 +173,10 @@ public class LnshMixingMillDeviceDriver extends AbstractOpcDeviceDriver implemen
|
||||
this.setIserror(true);
|
||||
message = "有报警";
|
||||
//无报警
|
||||
} else {
|
||||
} else if (mode == 6) {
|
||||
message = "泥料号输入不正确";
|
||||
}
|
||||
else {
|
||||
this.setIsonline(true);
|
||||
this.setIserror(false);
|
||||
message = "";
|
||||
@@ -423,6 +429,49 @@ public class LnshMixingMillDeviceDriver extends AbstractOpcDeviceDriver implemen
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 申请取走满料盅托盘
|
||||
*
|
||||
* @param
|
||||
*/
|
||||
public synchronized boolean mix_full() {
|
||||
ApplyTaskRequest request = new ApplyTaskRequest();
|
||||
request.setDevice_code(this.getDevice_code());
|
||||
request.setRequest_method_code(Thread.currentThread().getStackTrace()[1].getMethodName());
|
||||
request.setRequest_method_name(RequestMethodEnum.getName(Thread.currentThread().getStackTrace()[1].getMethodName()));
|
||||
request.setWeight(String.valueOf(weight));
|
||||
request.setOrder_code(order_No);
|
||||
// if(ObjectUtil.isNotEmpty(this.getDevice().getExtraValue().get("link_device_code"))){
|
||||
// Device device = deviceAppService.findDeviceByCode(this.getDevice().getExtraValue().get("link_device_code").toString());
|
||||
// if(ObjectUtil.isNotEmpty(device)){
|
||||
// LnshMixingMillDeviceDriver lnshMixingMillDeviceDriver;
|
||||
// if(device.getDeviceDriver() instanceof LnshMixingMillDeviceDriver){
|
||||
// lnshMixingMillDeviceDriver = (LnshMixingMillDeviceDriver) device.getDeviceDriver();
|
||||
// request.setMix_mum(String.valueOf(lnshMixingMillDeviceDriver.getMix_num()));
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class);
|
||||
message = RequestMethodEnum.getName("apply_take_full_vehicle") + "apply_take_full_vehicle 接口请求LMS...";
|
||||
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request)));
|
||||
|
||||
if (resp.getCode() == 200) {
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command",200);
|
||||
this.writing(map);
|
||||
this.setRequireSucess(true);
|
||||
message = RequestMethodEnum.getName("apply_take_full_vehicle") + "apply_take_full_vehicle 接口请求成功" + resp.getMessage();
|
||||
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "返回参数:" + JSON.toJSONString(resp)));
|
||||
} else {
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("to_command",400);
|
||||
this.writing(map);
|
||||
message = RequestMethodEnum.getName("apply_take_full_vehicle") + "apply_take_full_vehicle 接口请求失败" + resp.getMessage();
|
||||
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "返回参数:" + JSON.toJSONString(resp)));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public synchronized boolean order_verify() {
|
||||
if (!"0".equals(order_No) && StrUtil.isNotBlank(order_No)) {
|
||||
ApplyTaskRequest request = new ApplyTaskRequest();
|
||||
|
||||
@@ -1075,6 +1075,7 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic
|
||||
request.setRequest_method_code(Thread.currentThread().getStackTrace()[1].getMethodName());
|
||||
request.setRequest_method_name(RequestMethodEnum.getName(Thread.currentThread().getStackTrace()[1].getMethodName()));
|
||||
request.setVehicle_code(String.valueOf(barcode));
|
||||
request.setQty(String.valueOf(encoder_qty));
|
||||
ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class);
|
||||
|
||||
message = RequestMethodEnum.getName("wooden_pallet_binding") + "wooden_pallet_binding 接口请求LMS...";
|
||||
|
||||
@@ -402,6 +402,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
LnshSplitManipulatorDeviceDriver lnshSplitManipulatorDeviceDriver;
|
||||
if (device.getDeviceDriver() instanceof LnshMixingMillDeviceDriver) {
|
||||
lnshMixingMillDeviceDriver = (LnshMixingMillDeviceDriver) device.getDeviceDriver();
|
||||
lnshMixingMillDeviceDriver.writing(0);
|
||||
if (lnshMixingMillDeviceDriver.getMode() == 0) {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("order_code", order_code);
|
||||
|
||||
@@ -38,7 +38,6 @@ public class LogMessageConstant {
|
||||
public final static String COLOR_RESET = "\u001B[0m";
|
||||
/** 背景颜色:黄色 */
|
||||
public final static String BACKGROUND_YELLOW = "\u001B[43m";
|
||||
|
||||
/** 索引路径 */
|
||||
public final static String INDEX_DIR = "D:\\acshh\\lucene\\index";
|
||||
public final static String INDEX_DIR = "D:\\lucene\\index";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user