|
|
|
|
@@ -24,6 +24,7 @@ import org.nl.acs.device_driver.driver.AbstractDeviceDriver;
|
|
|
|
|
import org.nl.acs.device_driver.two_conveyor.hongxiang_conveyor.HongXiangStationDeviceDriver;
|
|
|
|
|
import org.nl.acs.device_driver.two_conveyor.manipulator_agv_station.ManipulatorAgvStationDeviceDriver;
|
|
|
|
|
import org.nl.acs.device_driver.two_conveyor.ranging_stations.RangingStationsDeviceDriver;
|
|
|
|
|
import org.nl.acs.device_driver.two_conveyor.waste_foil_weighing_station.WasteFoilWeighingStationDriver;
|
|
|
|
|
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
|
|
|
|
import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl;
|
|
|
|
|
import org.nl.acs.history.ErrorUtil;
|
|
|
|
|
@@ -46,6 +47,7 @@ import org.nl.config.lucene.service.dto.LuceneLogDto;
|
|
|
|
|
import org.nl.system.service.param.ISysParamService;
|
|
|
|
|
import org.nl.config.SpringContextHolder;
|
|
|
|
|
|
|
|
|
|
import java.util.LinkedHashMap;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -168,6 +170,8 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|
|
|
|
ManipulatorAgvStationDeviceDriver manipulatorAgvStationDeviceDriver;
|
|
|
|
|
//行架-agv对接位
|
|
|
|
|
RangingStationsDeviceDriver rangingStationsDeviceDriver;
|
|
|
|
|
//废箔称重位
|
|
|
|
|
WasteFoilWeighingStationDriver wasteFoilWeighingStationDriver;
|
|
|
|
|
|
|
|
|
|
if (phase == 0x02) {
|
|
|
|
|
if (ObjectUtil.isEmpty(inst)) {
|
|
|
|
|
@@ -314,7 +318,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|
|
|
|
} else if (device.getDeviceDriver() instanceof RangingStationsDeviceDriver) {
|
|
|
|
|
rangingStationsDeviceDriver = (RangingStationsDeviceDriver) device.getDeviceDriver();
|
|
|
|
|
ISysParamService paramService = SpringContextHolder.getBean(ISysParamService.class);
|
|
|
|
|
String choose = paramService.findByCode(AcsConfig.CHOOSE).getValue();
|
|
|
|
|
String device_code1 = device.getDevice_code();
|
|
|
|
|
String length1 = rangingStationsDeviceDriver.getLength1();
|
|
|
|
|
String length2 = rangingStationsDeviceDriver.getLength2();
|
|
|
|
|
Float len1 = 0.0F;
|
|
|
|
|
@@ -323,26 +327,49 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|
|
|
|
len1 = Float.parseFloat(length1);
|
|
|
|
|
len2 = Float.parseFloat(length2);
|
|
|
|
|
}
|
|
|
|
|
if("A".equals(choose)){
|
|
|
|
|
String offSet_A = paramService.findByCode(AcsConfig.OFFSET_A).getValue();
|
|
|
|
|
if(ObjectUtil.isNotEmpty(offSet_A) && !"null".equals(offSet_A)){
|
|
|
|
|
Integer integer = Integer.valueOf(offSet_A);
|
|
|
|
|
len1 = len1 - integer;
|
|
|
|
|
if (len1 * len2 < 0) {
|
|
|
|
|
if (ObjectUtil.isNotEmpty(device_code1) && (('A') == (device_code1.charAt(device_code1.length()-1)))) {
|
|
|
|
|
String offSet_A = paramService.findByCode(AcsConfig.OFFSET_A).getValue();
|
|
|
|
|
if (ObjectUtil.isNotEmpty(offSet_A) && !"null".equals(offSet_A)) {
|
|
|
|
|
Integer integer = Integer.valueOf(offSet_A);
|
|
|
|
|
len1 = len1 - integer;
|
|
|
|
|
}
|
|
|
|
|
} else if (ObjectUtil.isNotEmpty(device_code1) && (('B') == (device_code1.charAt(device_code1.length()-1)))) {
|
|
|
|
|
String offSet_B = paramService.findByCode(AcsConfig.OFFSET_B).getValue();
|
|
|
|
|
if (ObjectUtil.isNotEmpty(offSet_B) && !"null".equals(offSet_B)) {
|
|
|
|
|
Integer integer = Integer.valueOf(offSet_B);
|
|
|
|
|
len1 = integer + len1;
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
log.info("{}设备名不符合条件,指令号{}", device_code, ikey);
|
|
|
|
|
}
|
|
|
|
|
}else if("B".equals(choose)){
|
|
|
|
|
String offSet_B = paramService.findByCode(AcsConfig.OFFSET_B).getValue();
|
|
|
|
|
if(ObjectUtil.isNotEmpty(offSet_B) && !"null".equals(offSet_B)){
|
|
|
|
|
Integer integer = Integer.valueOf(offSet_B);
|
|
|
|
|
len1 = integer + len1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(len1 * len2 < 1 ){
|
|
|
|
|
int roundedNumber = ObjectUtil.isNotEmpty(len1) ? NumberUtil.round(len1, 0).intValue() : 0;
|
|
|
|
|
if (roundedNumber == 0) {
|
|
|
|
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, roundedNumber);
|
|
|
|
|
} else {
|
|
|
|
|
} else if(roundedNumber > -50 || roundedNumber < 50){
|
|
|
|
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 1, roundedNumber);
|
|
|
|
|
}else if(roundedNumber > 50 || roundedNumber < -50){
|
|
|
|
|
log.info("设备{},偏移数据超出范围导致未反馈{},指令号{}", device_code, roundedNumber, ikey);
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
log.info("设备{},偏移数据出错导致未反馈{},指令号{}", device_code, rangingStationsDeviceDriver.getLength1() + ","+ rangingStationsDeviceDriver.getLength2(), ikey);
|
|
|
|
|
}
|
|
|
|
|
} else if (device.getDeviceDriver() instanceof WasteFoilWeighingStationDriver) {
|
|
|
|
|
wasteFoilWeighingStationDriver = (WasteFoilWeighingStationDriver) device.getDeviceDriver();
|
|
|
|
|
if(wasteFoilWeighingStationDriver.getMove() == 1 && wasteFoilWeighingStationDriver.getAction() == 1
|
|
|
|
|
&& wasteFoilWeighingStationDriver.getError() == 0 && wasteFoilWeighingStationDriver.getMode() == 2){
|
|
|
|
|
try {
|
|
|
|
|
Map<String, Object> map = new LinkedHashMap<>();
|
|
|
|
|
map.put("to_command", "2");
|
|
|
|
|
wasteFoilWeighingStationDriver.writing(map);
|
|
|
|
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
message = "设备号:" + device_code + "光电信号:" + wasteFoilWeighingStationDriver.getMove() + ",动作信号:" + wasteFoilWeighingStationDriver.getAction() + "报警信号:" + wasteFoilWeighingStationDriver.getError() + ",指令号:" + ikey + "不满足取货条件";
|
|
|
|
|
log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足取货条件,指令号{}", device_code, wasteFoilWeighingStationDriver.getMove(), wasteFoilWeighingStationDriver.getAction()
|
|
|
|
|
, wasteFoilWeighingStationDriver.getError(), wasteFoilWeighingStationDriver.getMode(), ikey);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
|
|
|
|
@@ -474,6 +501,23 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|
|
|
|
log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, standardInspectSiteDeviceDriver.getMove(), standardInspectSiteDeviceDriver.getAction()
|
|
|
|
|
, standardInspectSiteDeviceDriver.getError(), ikey);
|
|
|
|
|
}
|
|
|
|
|
} else if (device.getDeviceDriver() instanceof WasteFoilWeighingStationDriver) {
|
|
|
|
|
wasteFoilWeighingStationDriver = (WasteFoilWeighingStationDriver) device.getDeviceDriver();
|
|
|
|
|
if(wasteFoilWeighingStationDriver.getMove() == 0 && wasteFoilWeighingStationDriver.getAction() == 1
|
|
|
|
|
&& wasteFoilWeighingStationDriver.getError() == 0 && wasteFoilWeighingStationDriver.getMode() == 2){
|
|
|
|
|
try {
|
|
|
|
|
Map<String, Object> map = new LinkedHashMap<>();
|
|
|
|
|
map.put("to_command", "3");
|
|
|
|
|
wasteFoilWeighingStationDriver.writing(map);
|
|
|
|
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
message = "设备号:" + device_code + "光电信号:" + wasteFoilWeighingStationDriver.getMove() + ",动作信号:" + wasteFoilWeighingStationDriver.getAction() + "报警信号:" + wasteFoilWeighingStationDriver.getError() + ",指令号:" + ikey + "不满足取货条件";
|
|
|
|
|
log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足取货条件,指令号{}", device_code, wasteFoilWeighingStationDriver.getMove(), wasteFoilWeighingStationDriver.getAction()
|
|
|
|
|
, wasteFoilWeighingStationDriver.getError(), wasteFoilWeighingStationDriver.getMode(), ikey);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
|
|
|
|
LuceneLogDto logDto = LuceneLogDto.builder()
|
|
|
|
|
@@ -612,6 +656,8 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|
|
|
|
}
|
|
|
|
|
} else if (device.getDeviceDriver() instanceof RangingStationsDeviceDriver) {
|
|
|
|
|
rangingStationsDeviceDriver = (RangingStationsDeviceDriver) device.getDeviceDriver();
|
|
|
|
|
ISysParamService paramService = SpringContextHolder.getBean(ISysParamService.class);
|
|
|
|
|
String device_code1 = device.getDevice_code();
|
|
|
|
|
String length1 = rangingStationsDeviceDriver.getLength1();
|
|
|
|
|
String length2 = rangingStationsDeviceDriver.getLength2();
|
|
|
|
|
Float len1 = 0.0F;
|
|
|
|
|
@@ -620,13 +666,32 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|
|
|
|
len1 = Float.parseFloat(length1);
|
|
|
|
|
len2 = Float.parseFloat(length2);
|
|
|
|
|
}
|
|
|
|
|
if(len1 * len2 < 1 ){
|
|
|
|
|
if (len1 * len2 < 1) {
|
|
|
|
|
if (ObjectUtil.isNotEmpty(device_code1) && device_code1.contains("A")) {
|
|
|
|
|
String offSet_A = paramService.findByCode(AcsConfig.OFFSET_A).getValue();
|
|
|
|
|
if (ObjectUtil.isNotEmpty(offSet_A) && !"null".equals(offSet_A)) {
|
|
|
|
|
Integer integer = Integer.valueOf(offSet_A);
|
|
|
|
|
len1 = len1 - integer;
|
|
|
|
|
}
|
|
|
|
|
} else if (ObjectUtil.isNotEmpty(device_code1) && device_code1.contains("B")) {
|
|
|
|
|
String offSet_B = paramService.findByCode(AcsConfig.OFFSET_B).getValue();
|
|
|
|
|
if (ObjectUtil.isNotEmpty(offSet_B) && !"null".equals(offSet_B)) {
|
|
|
|
|
Integer integer = Integer.valueOf(offSet_B);
|
|
|
|
|
len1 = integer + len1;
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
log.info("{}设备名不符合条件,指令号{}", device_code, ikey);
|
|
|
|
|
}
|
|
|
|
|
int roundedNumber = ObjectUtil.isNotEmpty(len1) ? NumberUtil.round(len1, 0).intValue() : 0;
|
|
|
|
|
if (roundedNumber == 0) {
|
|
|
|
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, roundedNumber);
|
|
|
|
|
} else {
|
|
|
|
|
} else if(roundedNumber > -50 || roundedNumber < 50){
|
|
|
|
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 1, roundedNumber);
|
|
|
|
|
}else if(roundedNumber > 50 || roundedNumber < -50){
|
|
|
|
|
log.info("设备{},偏移数据超出范围导致未反馈{},指令号{}", device_code, roundedNumber, ikey);
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
log.info("设备{},偏移数据出错导致未反馈{},指令号{}", device_code, rangingStationsDeviceDriver.getLength1() + ","+ rangingStationsDeviceDriver.getLength2(), ikey);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
|
|
|
|
@@ -892,6 +957,8 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|
|
|
|
}
|
|
|
|
|
} else if (device.getDeviceDriver() instanceof RangingStationsDeviceDriver) {
|
|
|
|
|
rangingStationsDeviceDriver = (RangingStationsDeviceDriver) device.getDeviceDriver();
|
|
|
|
|
ISysParamService paramService = SpringContextHolder.getBean(ISysParamService.class);
|
|
|
|
|
String device_code1 = device.getDevice_code();
|
|
|
|
|
String length1 = rangingStationsDeviceDriver.getLength1();
|
|
|
|
|
String length2 = rangingStationsDeviceDriver.getLength2();
|
|
|
|
|
Float len1 = 0.0F;
|
|
|
|
|
@@ -900,13 +967,49 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|
|
|
|
len1 = Float.parseFloat(length1);
|
|
|
|
|
len2 = Float.parseFloat(length2);
|
|
|
|
|
}
|
|
|
|
|
if(len1 * len2 < 1 ){
|
|
|
|
|
if (len1 * len2 < 1) {
|
|
|
|
|
if (ObjectUtil.isNotEmpty(device_code1) && device_code1.contains("A")) {
|
|
|
|
|
String offSet_A = paramService.findByCode(AcsConfig.OFFSET_A).getValue();
|
|
|
|
|
if (ObjectUtil.isNotEmpty(offSet_A) && !"null".equals(offSet_A)) {
|
|
|
|
|
Integer integer = Integer.valueOf(offSet_A);
|
|
|
|
|
len1 = len1 - integer;
|
|
|
|
|
}
|
|
|
|
|
} else if (ObjectUtil.isNotEmpty(device_code1) && device_code1.contains("B")) {
|
|
|
|
|
String offSet_B = paramService.findByCode(AcsConfig.OFFSET_B).getValue();
|
|
|
|
|
if (ObjectUtil.isNotEmpty(offSet_B) && !"null".equals(offSet_B)) {
|
|
|
|
|
Integer integer = Integer.valueOf(offSet_B);
|
|
|
|
|
len1 = integer + len1;
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
log.info("{}设备名不符合条件,指令号{}", device_code, ikey);
|
|
|
|
|
}
|
|
|
|
|
int roundedNumber = ObjectUtil.isNotEmpty(len1) ? NumberUtil.round(len1, 0).intValue() : 0;
|
|
|
|
|
if (roundedNumber == 0) {
|
|
|
|
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, roundedNumber);
|
|
|
|
|
} else {
|
|
|
|
|
} else if(roundedNumber > -50 || roundedNumber < 50){
|
|
|
|
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 1, roundedNumber);
|
|
|
|
|
}else if(roundedNumber > 50 || roundedNumber < -50){
|
|
|
|
|
log.info("设备{},偏移数据超出范围导致未反馈{},指令号{}", device_code, roundedNumber, ikey);
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
log.info("设备{},偏移数据出错导致未反馈{},指令号{}", device_code, rangingStationsDeviceDriver.getLength1() + ","+ rangingStationsDeviceDriver.getLength2(), ikey);
|
|
|
|
|
}
|
|
|
|
|
} else if (device.getDeviceDriver() instanceof WasteFoilWeighingStationDriver) {
|
|
|
|
|
wasteFoilWeighingStationDriver = (WasteFoilWeighingStationDriver) device.getDeviceDriver();
|
|
|
|
|
if(wasteFoilWeighingStationDriver.getMove() == 0 && wasteFoilWeighingStationDriver.getAction() == 1
|
|
|
|
|
&& wasteFoilWeighingStationDriver.getError() == 0 && wasteFoilWeighingStationDriver.getMode() == 2){
|
|
|
|
|
try {
|
|
|
|
|
Map<String, Object> map = new LinkedHashMap<>();
|
|
|
|
|
map.put("to_command", "4");
|
|
|
|
|
wasteFoilWeighingStationDriver.writing(map);
|
|
|
|
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
message = "设备号:" + device_code + "光电信号:" + wasteFoilWeighingStationDriver.getMove() + ",动作信号:" + wasteFoilWeighingStationDriver.getAction() + "报警信号:" + wasteFoilWeighingStationDriver.getError() + ",指令号:" + ikey + "不满足取货条件";
|
|
|
|
|
log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足取货条件,指令号{}", device_code, wasteFoilWeighingStationDriver.getMove(), wasteFoilWeighingStationDriver.getAction()
|
|
|
|
|
, wasteFoilWeighingStationDriver.getError(), wasteFoilWeighingStationDriver.getMode(), ikey);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
|
|
|
|
@@ -1018,6 +1121,23 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|
|
|
|
if ((standardInspectSiteDeviceDriver.getMove() == 1)) {
|
|
|
|
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
|
|
|
|
}
|
|
|
|
|
} else if (device.getDeviceDriver() instanceof WasteFoilWeighingStationDriver) {
|
|
|
|
|
wasteFoilWeighingStationDriver = (WasteFoilWeighingStationDriver) device.getDeviceDriver();
|
|
|
|
|
if(wasteFoilWeighingStationDriver.getMove() == 1 && wasteFoilWeighingStationDriver.getAction() == 1
|
|
|
|
|
&& wasteFoilWeighingStationDriver.getError() == 0 && wasteFoilWeighingStationDriver.getMode() == 2){
|
|
|
|
|
try {
|
|
|
|
|
Map<String, Object> map = new LinkedHashMap<>();
|
|
|
|
|
map.put("to_command", "5");
|
|
|
|
|
wasteFoilWeighingStationDriver.writing(map);
|
|
|
|
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
message = "设备号:" + device_code + "光电信号:" + wasteFoilWeighingStationDriver.getMove() + ",动作信号:" + wasteFoilWeighingStationDriver.getAction() + "报警信号:" + wasteFoilWeighingStationDriver.getError() + ",指令号:" + ikey + "不满足取货条件";
|
|
|
|
|
log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足取货条件,指令号{}", device_code, wasteFoilWeighingStationDriver.getMove(), wasteFoilWeighingStationDriver.getAction()
|
|
|
|
|
, wasteFoilWeighingStationDriver.getError(), wasteFoilWeighingStationDriver.getMode(), ikey);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
|
|
|
|
}
|
|
|
|
|
@@ -1126,6 +1246,8 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|
|
|
|
}
|
|
|
|
|
} else if (device.getDeviceDriver() instanceof RangingStationsDeviceDriver) {
|
|
|
|
|
rangingStationsDeviceDriver = (RangingStationsDeviceDriver) device.getDeviceDriver();
|
|
|
|
|
ISysParamService paramService = SpringContextHolder.getBean(ISysParamService.class);
|
|
|
|
|
String device_code1 = device.getDevice_code();
|
|
|
|
|
String length1 = rangingStationsDeviceDriver.getLength1();
|
|
|
|
|
String length2 = rangingStationsDeviceDriver.getLength2();
|
|
|
|
|
Float len1 = 0.0F;
|
|
|
|
|
@@ -1134,13 +1256,32 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
|
|
|
|
len1 = Float.parseFloat(length1);
|
|
|
|
|
len2 = Float.parseFloat(length2);
|
|
|
|
|
}
|
|
|
|
|
if(len1 * len2 < 1 ){
|
|
|
|
|
if (len1 * len2 < 1) {
|
|
|
|
|
if (ObjectUtil.isNotEmpty(device_code1) && device_code1.contains("A")) {
|
|
|
|
|
String offSet_A = paramService.findByCode(AcsConfig.OFFSET_A).getValue();
|
|
|
|
|
if (ObjectUtil.isNotEmpty(offSet_A) && !"null".equals(offSet_A)) {
|
|
|
|
|
Integer integer = Integer.valueOf(offSet_A);
|
|
|
|
|
len1 = len1 - integer;
|
|
|
|
|
}
|
|
|
|
|
} else if (ObjectUtil.isNotEmpty(device_code1) && device_code1.contains("B")) {
|
|
|
|
|
String offSet_B = paramService.findByCode(AcsConfig.OFFSET_B).getValue();
|
|
|
|
|
if (ObjectUtil.isNotEmpty(offSet_B) && !"null".equals(offSet_B)) {
|
|
|
|
|
Integer integer = Integer.valueOf(offSet_B);
|
|
|
|
|
len1 = integer + len1;
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
log.info("{}设备名不符合条件,指令号{}", device_code, ikey);
|
|
|
|
|
}
|
|
|
|
|
int roundedNumber = ObjectUtil.isNotEmpty(len1) ? NumberUtil.round(len1, 0).intValue() : 0;
|
|
|
|
|
if (roundedNumber == 0) {
|
|
|
|
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, roundedNumber);
|
|
|
|
|
} else {
|
|
|
|
|
} else if(roundedNumber > -50 || roundedNumber < 50){
|
|
|
|
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 1, roundedNumber);
|
|
|
|
|
}else if(roundedNumber > 50 || roundedNumber < -50){
|
|
|
|
|
log.info("设备{},偏移数据超出范围导致未反馈{},指令号{}", device_code, roundedNumber, ikey);
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
log.info("设备{},偏移数据出错导致未反馈{},指令号{}", device_code, rangingStationsDeviceDriver.getLength1() + ","+ rangingStationsDeviceDriver.getLength2(), ikey);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0);
|
|
|
|
|
|