Merge branch 'master' of http://121.40.234.130:8899/root/lanzhouhailiang_one
# Conflicts: # acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor_labeling/SiemensConveyorLabelingDeviceDriver.java # acs/nladmin-system/src/main/java/org/nl/acs/device_driver/driver/AbstractOpcDeviceDriver.java
This commit is contained in:
@@ -164,7 +164,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
inst1.setInstruction_status("1");
|
||||
inst1.setExecute_device_code(this.device_code);
|
||||
instructionService.update(inst1);
|
||||
// TaskDto taskDto = taskserver.findByCodeFromCache(inst1.getTask_code());
|
||||
// TaskDto tas未反馈电气信号原因kDto = taskserver.findByCodeFromCache(inst1.getTask_code());
|
||||
// if (ObjectUtil.isNotEmpty(taskDto)) {
|
||||
// if (StrUtil.isNotEmpty(taskDto.getExt_task_id())) {
|
||||
// JSONArray array = new JSONArray();
|
||||
@@ -408,15 +408,15 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
|
||||
} catch (Exception var17) {
|
||||
feedMessage = var17.getMessage();
|
||||
logServer.deviceExecuteLog(this.getDevice_code(), "", "", "读取信号值时出现异常:" + var17.getMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.itemProtocol.getIsonline()) {
|
||||
this.setIsonline(false);
|
||||
this.setIserror(true);
|
||||
message = "信号量同步异常";
|
||||
//未联机
|
||||
} else if (mode == 0) {
|
||||
// if (!this.itemProtocol.getIsonline()) {
|
||||
// this.setIsonline(false);
|
||||
// this.setIserror(true);
|
||||
// message = "信号量同步异常";
|
||||
// //未联机
|
||||
// } else
|
||||
if (mode == 0) {
|
||||
this.setIsonline(false);
|
||||
this.setIserror(true);
|
||||
message = "未联机";
|
||||
|
||||
@@ -216,7 +216,6 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
} catch (Exception var17) {
|
||||
inst_message = var17.getMessage();
|
||||
logServer.deviceExecuteLog(this.getDevice_code(), "", "", "读取信号值时出现异常:" + var17.getMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
// if (!this.itemProtocol.getIsonline()) {
|
||||
@@ -553,10 +552,10 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
map3.put("value", "1");
|
||||
list.add(map3);
|
||||
this.writing(list);
|
||||
// if (task != Integer.parseInt(inst.getInstruction_code())) {
|
||||
// this.writing(list);
|
||||
// logServer.deviceExecuteLog(device_code, "", "", inst.getInstruction_code() + "再次下发电气信号");
|
||||
// }
|
||||
if (task != Integer.parseInt(inst.getInstruction_code())) {
|
||||
this.writing(list);
|
||||
logServer.deviceExecuteLog(device_code, "", "", inst.getInstruction_code() + "再次下发电气信号");
|
||||
}
|
||||
message = "下发电气任务号成功";
|
||||
requireSucess = true;
|
||||
return true;
|
||||
@@ -659,10 +658,10 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
map3.put("value", "1");
|
||||
list.add(map3);
|
||||
this.writing(list);
|
||||
// if (task != Integer.parseInt(inst.getInstruction_code())) {
|
||||
// this.writing(list);
|
||||
// logServer.deviceExecuteLog(device_code, "", "", inst.getInstruction_code() + "再次下发电气信号");
|
||||
// }
|
||||
if (task != Integer.parseInt(inst.getInstruction_code())) {
|
||||
this.writing(list);
|
||||
logServer.deviceExecuteLog(device_code, "", "", inst.getInstruction_code() + "再次下发电气信号");
|
||||
}
|
||||
} else {
|
||||
//如果不存在则直接找对应指令
|
||||
Instruction inst = instructionService.findByDeviceCodeFromCache(this.device_code);
|
||||
@@ -690,10 +689,10 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
map3.put("value", "1");
|
||||
list.add(map3);
|
||||
this.writing(list);
|
||||
// if (task != Integer.parseInt(inst.getInstruction_code())) {
|
||||
// this.writing(list);
|
||||
// logServer.deviceExecuteLog(device_code, "", "", inst.getInstruction_code() + "再次下发电气信号");
|
||||
// }
|
||||
if (task != Integer.parseInt(inst.getInstruction_code())) {
|
||||
this.writing(list);
|
||||
logServer.deviceExecuteLog(device_code, "", "", inst.getInstruction_code() + "再次下发电气信号");
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -213,7 +213,7 @@ public class SiemensConveyorLabelingDeviceDriver extends AbstractOpcDeviceDriver
|
||||
} catch (Exception var17) {
|
||||
inst_message = var17.getMessage();
|
||||
logServer.deviceExecuteLog(this.getDevice_code(), "", "", "读取信号值时出现异常:" + var17.getMessage());
|
||||
return;
|
||||
// return;
|
||||
}
|
||||
|
||||
// if (!this.itemProtocol.getIsonline()) {
|
||||
@@ -620,7 +620,7 @@ public class SiemensConveyorLabelingDeviceDriver extends AbstractOpcDeviceDriver
|
||||
instructionService.create(instdto);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("指令创建失败!",e.getMessage());
|
||||
log.error("指令创建异常!");
|
||||
return false;
|
||||
}
|
||||
// 创建指令后修改任务状态
|
||||
|
||||
@@ -673,15 +673,16 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
|
||||
} catch (Exception var17) {
|
||||
feedMessage = var17.getMessage();
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "读取信号值时出现异常:" + var17.getMessage());
|
||||
return;
|
||||
// return;
|
||||
}
|
||||
|
||||
if (!this.itemProtocol.getIsonline()) {
|
||||
this.setIsonline(false);
|
||||
this.setIserror(true);
|
||||
message = "信号量同步异常";
|
||||
//未联机
|
||||
} else if (mode == 0) {
|
||||
// if (!this.itemProtocol.getIsonline()) {
|
||||
// this.setIsonline(false);
|
||||
// this.setIserror(true);
|
||||
// message = "信号量同步异常";
|
||||
// //未联机
|
||||
// } else
|
||||
if (mode == 0) {
|
||||
this.setIsonline(false);
|
||||
this.setIserror(true);
|
||||
message = "未联机";
|
||||
|
||||
@@ -729,7 +729,6 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
||||
requireSucess = true;
|
||||
applySucess = false;
|
||||
} else {
|
||||
requireSucess = false;
|
||||
message = jo.get("message").toString();
|
||||
List list = new ArrayList();
|
||||
Map map = new HashMap();
|
||||
@@ -746,6 +745,7 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
||||
list.add(map3);
|
||||
this.writing(list);
|
||||
message = "申请任务失败下发退回,"+message;
|
||||
requireSucess = true;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
package org.nl.acs.device_driver.driver;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.acs.ext.wms.data.JsonUtl;
|
||||
import org.nl.acs.opc.OpcConfig;
|
||||
import org.nl.acs.opc.OpcServerService;
|
||||
import org.nl.acs.opc.OpcServerServiceImpl;
|
||||
import org.nl.acs.opc.WcsConfig;
|
||||
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;
|
||||
|
||||
@@ -37,19 +40,21 @@ public class AbstractOpcDeviceDriver extends AbstractDeviceDriver implements Opc
|
||||
|
||||
ItemValue p2[];
|
||||
p2 = new ItemValue[itemValues.size()];
|
||||
int i = 0;
|
||||
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());
|
||||
p2[i].setItem_value(entry.getValue());
|
||||
i++;
|
||||
}
|
||||
|
||||
return this.control(p2);
|
||||
return this.control(p2);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public boolean control(ItemValue[] itemValues) {
|
||||
if (itemValues != null && itemValues.length != 0) {
|
||||
String this_items = JsonUtl.parseWithoutException(itemValues);
|
||||
@@ -67,9 +72,9 @@ public class AbstractOpcDeviceDriver extends AbstractDeviceDriver implements Opc
|
||||
sb.append(":");
|
||||
sb.append(JsonUtl.parseWithoutException(udw_value));
|
||||
sb.append(";");
|
||||
// if (!need_write && !UnifiedDataAppService.isEquals(udw_value, write_value)) {
|
||||
// need_write = true;
|
||||
// }
|
||||
// if (!need_write && !UnifiedDataAppService.isEquals(udw_value, write_value)) {
|
||||
// need_write = true;
|
||||
// }
|
||||
}
|
||||
need_write = true;
|
||||
|
||||
|
||||
@@ -219,6 +219,8 @@ public class LiKuToAcsServiceImpl implements LiKuToAcsService {
|
||||
}
|
||||
} else if(StrUtil.equals(type,"2")){
|
||||
siemensConveyorDeviceDriver.writing("to_command","3");
|
||||
siemensConveyorDeviceDriver.writing("to_command","3");
|
||||
|
||||
result.put("result", "true");
|
||||
result.put("comment", "");
|
||||
}
|
||||
|
||||
@@ -267,7 +267,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
}
|
||||
|
||||
@Override
|
||||
public void create(Instruction dto) throws Exception {
|
||||
public void create(Instruction dto) {
|
||||
dto = foramte(dto);
|
||||
String task_code = dto.getTask_code();
|
||||
TaskDto task = taskService.findByCodeFromCache(task_code);
|
||||
@@ -369,6 +369,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
} catch (Exception e) {
|
||||
dto.setSend_status("2");
|
||||
e.printStackTrace();
|
||||
log.error("");
|
||||
}
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("acs_instruction");
|
||||
|
||||
Reference in New Issue
Block a user