@@ -1,5 +1,6 @@
package org.nl.acs.device_driver.agv.ndctwo ;
import cn.hutool.core.util.NumberUtil ;
import cn.hutool.core.util.ObjectUtil ;
import cn.hutool.core.util.StrUtil ;
import com.alibaba.fastjson.JSONObject ;
@@ -21,6 +22,7 @@ import org.nl.acs.device_driver.storage.standard_storage.StandardStorageDeviceDr
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.ext.wms.service.AcsToWmsService ;
import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl ;
import org.nl.acs.history.ErrorUtil ;
@@ -162,6 +164,8 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
HongXiangStationDeviceDriver hongXiangStationDeviceDriver ;
//行架-agv对接位
ManipulatorAgvStationDeviceDriver manipulatorAgvStationDeviceDriver ;
//行架-agv对接位
RangingStationsDeviceDriver rangingStationsDeviceDriver ;
if ( phase = = 0x02 ) {
if ( ObjectUtil . isEmpty ( inst ) ) {
@@ -236,15 +240,15 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
message = " 等待LMS系统进行确认允许取货,设备号: " + device_code + " ,指令号: " + ikey ;
logServer . deviceExecuteLog ( this . device_code , " " , " " , " 等待LMS系统进行确认允许取货,设备号 " + device . getDevice_code ( ) + " ,指令号 " + ikey ) ;
} else {
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 ) ;
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 , 0 , 0 );
}
} else {
} else {
log . info ( " 等待LMS系统进行确认允许取货, 设备号{},指令号{} " , device_code , ikey ) ;
message = " 等待LMS系统进行确认允许取货,设备号: " + device_code + " ,指令号: " + ikey ;
logServer . deviceExecuteLog ( this . device_code , " " , " " , " 等待LMS系统进行确认允许取货,设备号 " + device . getDevice_code ( ) + " ,指令号 " + ikey ) ;
}
} else {
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 ) ;
} else {
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 , 0 , 0 );
}
} else if ( device . getDeviceDriver ( ) instanceof StandardInspectSiteDeviceDriver ) {
standardInspectSiteDeviceDriver = ( StandardInspectSiteDeviceDriver ) device . getDeviceDriver ( ) ;
@@ -256,7 +260,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
}
if ( ( standardInspectSiteDeviceDriver . getMove ( ) = = 1 & & standardInspectSiteDeviceDriver . getAction ( ) = = 1
& & standardInspectSiteDeviceDriver . getError ( ) = = 0 ) ) {
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 ) ;
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 , 0 , 0 );
} else {
message = " 设备号: " + device_code + " 光电信号: " + standardInspectSiteDeviceDriver . getMove ( ) + " ,动作信号: " + standardInspectSiteDeviceDriver . getAction ( ) + " 报警信号: " + standardInspectSiteDeviceDriver . getError ( ) + " ,指令号: " + ikey + " 不满足取货条件 " ;
log . info ( " 设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{} " , device_code , standardInspectSiteDeviceDriver . getMove ( ) , standardInspectSiteDeviceDriver . getAction ( )
@@ -271,7 +275,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
e . printStackTrace ( ) ;
}
if ( ( manipulatorAgvStationDeviceDriver . getAction ( ) = = 1 ) ) {
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 ) ;
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 , 0 , 0 );
} else {
message = " 设备号: " + device_code + " ,动作信号: " + manipulatorAgvStationDeviceDriver . getAction ( ) + " 报警信号: " + " ,指令号: " + ikey + " 不满足取货条件 " ;
log . info ( " 设备{},动作信号{} ,不满足取货条件,指令号{} " , device_code , manipulatorAgvStationDeviceDriver . getAction ( ) , ikey ) ;
@@ -284,7 +288,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
e . printStackTrace ( ) ;
}
if ( hongXiangStationDeviceDriver . getMove ( ) > 0 ) {
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 ) ;
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 , 0 , 0 );
} else {
message = " 设备号: " + device_code + " 光电信号: " + hongXiangStationDeviceDriver . getMove ( ) + " ,动作信号: " + hongXiangStationDeviceDriver . getAction ( ) + " 报警信号: " + hongXiangStationDeviceDriver . getError ( ) + " ,指令号: " + ikey + " 不满足取货条件 " ;
log . info ( " 设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{} " , device_code , hongXiangStationDeviceDriver . getMove ( ) , hongXiangStationDeviceDriver . getAction ( )
@@ -298,14 +302,27 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
e . printStackTrace ( ) ;
}
if ( paperTubePickSiteDeviceDriver . getMove ( ) > 0 ) {
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 ) ;
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 , 0 , 0 );
} else {
message = " 设备号: " + device_code + " 光电信号: " + paperTubePickSiteDeviceDriver . getMove ( ) + " ,动作信号: " + paperTubePickSiteDeviceDriver . getAction ( ) + " 报警信号: " + paperTubePickSiteDeviceDriver . getError ( ) + " ,指令号: " + ikey + " 不满足取货条件 " ;
log . info ( " 设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{} " , device_code , paperTubePickSiteDeviceDriver . getMove ( ) , paperTubePickSiteDeviceDriver . getAction ( )
, paperTubePickSiteDeviceDriver . getError ( ) , ikey ) ;
}
} else if ( device . getDeviceDriver ( ) instanceof RangingStationsDeviceDriver ) {
rangingStationsDeviceDriver = ( RangingStationsDeviceDriver ) device . getDeviceDriver ( ) ;
String length1 = rangingStationsDeviceDriver . getLength1 ( ) ;
Float len = 0 . 0F ;
if ( ObjectUtil . isNotEmpty ( length1 ) & & ! " null " . equals ( length1 ) ) {
len = Float . parseFloat ( length1 ) ;
}
int roundedNumber = ObjectUtil . isNotEmpty ( len ) ? NumberUtil . round ( len , 0 ) . intValue ( ) : 0 ;
if ( roundedNumber = = 0 ) {
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 , 0 , roundedNumber ) ;
} else {
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 , 1 , roundedNumber ) ;
}
} else {
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 ) ;
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 , 0 , 0 );
LuceneLogDto logDto = LuceneLogDto . builder ( )
. device_code ( device_code )
. content ( " agvphase: " + phase + " 反馈: " + data )
@@ -371,9 +388,9 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
& & StrUtil . equals ( " true " , this . device . getExtraValue ( ) . get ( " wait " ) . toString ( ) )
& & StrUtil . equals ( task . getTask_type ( ) , " 1 " ) ) {
standardOrdinarySiteDeviceDriver . setOption ( 0 ) ;
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 ) ;
} else {
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 ) ;
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 , 0 , 0 );
} else {
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 , 0 , 0 );
}
this . setPhase ( phase ) ;
} else if ( device . getDeviceDriver ( ) instanceof ManipulatorAgvStationDeviceDriver ) {
@@ -385,7 +402,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
e . printStackTrace ( ) ;
}
if ( ( manipulatorAgvStationDeviceDriver . getAction ( ) = = 1 ) ) {
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 ) ;
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 , 0 , 0 );
} else {
message = " 设备号: " + device_code + " ,动作信号: " + manipulatorAgvStationDeviceDriver . getAction ( ) + " 报警信号: " + " ,指令号: " + ikey + " 不满足取货条件 " ;
log . info ( " 设备{},动作信号{} ,不满足取货条件,指令号{} " , device_code , manipulatorAgvStationDeviceDriver . getAction ( ) , ikey ) ;
@@ -398,7 +415,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
e . printStackTrace ( ) ;
}
if ( hongXiangStationDeviceDriver . getMove ( ) > 0 ) {
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 ) ;
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 , 0 , 0 );
} else {
message = " 设备号: " + device_code + " 光电信号: " + hongXiangStationDeviceDriver . getMove ( ) + " ,动作信号: " + hongXiangStationDeviceDriver . getAction ( ) + " 报警信号: " + hongXiangStationDeviceDriver . getError ( ) + " ,指令号: " + ikey + " 不满足取货条件 " ;
log . info ( " 设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{} " , device_code , hongXiangStationDeviceDriver . getMove ( ) , hongXiangStationDeviceDriver . getAction ( )
@@ -412,7 +429,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
e . printStackTrace ( ) ;
}
if ( paperTubePickSiteDeviceDriver . getMove ( ) = = 0 ) {
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 ) ;
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 , 0 , 0 );
} else {
message = " 设备号: " + device_code + " 光电信号: " + paperTubePickSiteDeviceDriver . getMove ( ) + " ,动作信号: " + paperTubePickSiteDeviceDriver . getAction ( ) + " 报警信号: " + paperTubePickSiteDeviceDriver . getError ( ) + " ,指令号: " + ikey + " 不满足取货条件 " ;
log . info ( " 设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{} " , device_code , paperTubePickSiteDeviceDriver . getMove ( ) , paperTubePickSiteDeviceDriver . getAction ( )
@@ -427,14 +444,14 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
e . printStackTrace ( ) ;
}
if ( ( standardInspectSiteDeviceDriver . getMove ( ) ! = 1 & & standardInspectSiteDeviceDriver . getAction ( ) = = 1 & & standardInspectSiteDeviceDriver . getError ( ) = = 0 ) ) {
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 ) ;
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 , 0 , 0 );
} else {
message = " 设备号: " + device_code + " 光电信号: " + standardInspectSiteDeviceDriver . getMove ( ) + " ,动作信号: " + standardInspectSiteDeviceDriver . getAction ( ) + " 报警信号: " + standardInspectSiteDeviceDriver . getError ( ) + " ,指令号: " + ikey + " 不满足取货条件 " ;
log . info ( " 设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{} " , device_code , standardInspectSiteDeviceDriver . getMove ( ) , standardInspectSiteDeviceDriver . getAction ( )
, standardInspectSiteDeviceDriver . getError ( ) , ikey ) ;
}
} else {
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 ) ;
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 , 0 , 0 );
LuceneLogDto logDto = LuceneLogDto . builder ( )
. device_code ( device_code )
. content ( " agvphase: " + phase + " 反馈: " + data )
@@ -501,15 +518,15 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
message = " 等待LMS系统进行确认允许取货,设备号: " + device_code + " ,指令号: " + ikey ;
logServer . deviceExecuteLog ( this . device_code , " " , " " , " 等待LMS系统进行确认允许取货,设备号 " + device . getDevice_code ( ) + " ,指令号 " + ikey ) ;
} else {
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 ) ;
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 , 0 , 0 );
}
} else {
log . info ( " 等待LMS系统进行确认允许取货, 设备号{},指令号{} " , device_code , ikey ) ;
message = " 等待LMS系统进行确认允许取货,设备号: " + device_code + " ,指令号: " + ikey ;
logServer . deviceExecuteLog ( this . device_code , " " , " " , " 等待LMS系统进行确认允许取货,设备号 " + device . getDevice_code ( ) ) ;
}
} else {
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 ) ;
} else {
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 , 0 , 0 );
}
} else if ( device . getDeviceDriver ( ) instanceof ManipulatorAgvStationDeviceDriver ) {
manipulatorAgvStationDeviceDriver = ( ManipulatorAgvStationDeviceDriver ) device . getDeviceDriver ( ) ;
@@ -520,7 +537,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
e . printStackTrace ( ) ;
}
if ( ( manipulatorAgvStationDeviceDriver . getAction ( ) = = 1 ) ) {
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 ) ;
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 , 0 , 0 );
} else {
message = " 设备号: " + device_code + " ,动作信号: " + manipulatorAgvStationDeviceDriver . getAction ( ) + " 报警信号: " + " ,指令号: " + ikey + " 不满足取货条件 " ;
log . info ( " 设备{},动作信号{} ,不满足取货条件,指令号{} " , device_code , manipulatorAgvStationDeviceDriver . getAction ( ) , ikey ) ;
@@ -533,7 +550,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
e . printStackTrace ( ) ;
}
if ( paperTubePickSiteDeviceDriver . getMove ( ) = = 1 ) {
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 ) ;
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 , 0 , 0 );
} else {
message = " 设备号: " + device_code + " 光电信号: " + paperTubePickSiteDeviceDriver . getMove ( ) + " ,动作信号: " + paperTubePickSiteDeviceDriver . getAction ( ) + " 报警信号: " + paperTubePickSiteDeviceDriver . getError ( ) + " ,指令号: " + ikey + " 不满足取货条件 " ;
log . info ( " 设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{} " , device_code , paperTubePickSiteDeviceDriver . getMove ( ) , paperTubePickSiteDeviceDriver . getAction ( )
@@ -547,7 +564,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
e . printStackTrace ( ) ;
}
if ( hongXiangStationDeviceDriver . getMove ( ) > 0 ) {
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 ) ;
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 , 0 , 0 );
} else {
message = " 设备号: " + device_code + " 光电信号: " + hongXiangStationDeviceDriver . getMove ( ) + " ,动作信号: " + hongXiangStationDeviceDriver . getAction ( ) + " 报警信号: " + hongXiangStationDeviceDriver . getError ( ) + " ,指令号: " + ikey + " 不满足取货条件 " ;
log . info ( " 设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{} " , device_code , hongXiangStationDeviceDriver . getMove ( ) , hongXiangStationDeviceDriver . getAction ( )
@@ -562,14 +579,27 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
e . printStackTrace ( ) ;
}
if ( ( standardInspectSiteDeviceDriver . getMove ( ) = = 1 & & standardInspectSiteDeviceDriver . getAction ( ) = = 1 & & standardInspectSiteDeviceDriver . getError ( ) = = 0 ) ) {
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 ) ;
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 , 0 , 0 );
} else {
message = " 设备号: " + device_code + " 光电信号: " + standardInspectSiteDeviceDriver . getMove ( ) + " ,动作信号: " + standardInspectSiteDeviceDriver . getAction ( ) + " 报警信号: " + standardInspectSiteDeviceDriver . getError ( ) + " ,指令号: " + ikey + " 不满足取货条件 " ;
log . info ( " 设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{} " , device_code , standardInspectSiteDeviceDriver . getMove ( ) , standardInspectSiteDeviceDriver . getAction ( )
, standardInspectSiteDeviceDriver . getError ( ) , ikey ) ;
}
} else if ( device . getDeviceDriver ( ) instanceof RangingStationsDeviceDriver ) {
rangingStationsDeviceDriver = ( RangingStationsDeviceDriver ) device . getDeviceDriver ( ) ;
String length1 = rangingStationsDeviceDriver . getLength1 ( ) ;
Float len = 0 . 0F ;
if ( ObjectUtil . isNotEmpty ( length1 ) & & ! " null " . equals ( length1 ) ) {
len = Float . parseFloat ( length1 ) ;
}
int roundedNumber = ObjectUtil . isNotEmpty ( len ) ? NumberUtil . round ( len , 0 ) . intValue ( ) : 0 ;
if ( roundedNumber = = 0 ) {
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 , 0 , roundedNumber ) ;
} else {
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 , 1 , roundedNumber ) ;
}
} else {
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 ) ;
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 , 0 , 0 );
LuceneLogDto logDto = LuceneLogDto . builder ( )
. device_code ( device_code )
. content ( " agvphase: " + phase + " 反馈: " + data )
@@ -625,7 +655,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
if ( ObjectUtil . isNotEmpty ( standardOrdinarySiteDeviceDriver . getDevice ( ) . getExtraValue ( ) . get ( " wait " ) )
& & StrUtil . equals ( " true " , standardOrdinarySiteDeviceDriver . getDevice ( ) . getExtraValue ( ) . get ( " wait " ) . toString ( ) ) ) {
standardOrdinarySiteDeviceDriver . setOption ( 0 ) ;
} else {
} else {
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 ) ;
}
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 ) ;
@@ -771,7 +801,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
if ( device . getDeviceDriver ( ) instanceof StandardOrdinarySiteDeviceDriver ) {
standardOrdinarySiteDeviceDriver = ( StandardOrdinarySiteDeviceDriver ) device . getDeviceDriver ( ) ;
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 ) ;
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 , 0 , 0 );
standardOrdinarySiteDeviceDriver . setAgvphase ( phase ) ;
standardOrdinarySiteDeviceDriver . setIndex ( index ) ;
@@ -785,7 +815,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
e . printStackTrace ( ) ;
}
if ( paperTubePickSiteDeviceDriver . getMove ( ) = = 0 ) {
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 ) ;
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 , 0 , 0 );
} else {
message = " 设备号: " + device_code + " 光电信号: " + paperTubePickSiteDeviceDriver . getMove ( ) + " ,动作信号: " + paperTubePickSiteDeviceDriver . getAction ( ) + " 报警信号: " + paperTubePickSiteDeviceDriver . getError ( ) + " ,指令号: " + ikey + " 不满足取货条件 " ;
log . info ( " 设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{} " , device_code , paperTubePickSiteDeviceDriver . getMove ( ) , paperTubePickSiteDeviceDriver . getAction ( )
@@ -800,7 +830,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
e . printStackTrace ( ) ;
}
if ( ( manipulatorAgvStationDeviceDriver . getAction ( ) = = 1 ) ) {
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 ) ;
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 , 0 , 0 );
} else {
message = " 设备号: " + device_code + " ,动作信号: " + manipulatorAgvStationDeviceDriver . getAction ( ) + " 报警信号: " + " ,指令号: " + ikey + " 不满足取货条件 " ;
log . info ( " 设备{},动作信号{} ,不满足取货条件,指令号{} " , device_code , manipulatorAgvStationDeviceDriver . getAction ( ) , ikey ) ;
@@ -813,7 +843,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
e . printStackTrace ( ) ;
}
if ( hongXiangStationDeviceDriver . getMove ( ) = = 0 ) {
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 ) ;
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 , 0 , 0 );
} else {
message = " 设备号: " + device_code + " 光电信号: " + hongXiangStationDeviceDriver . getMove ( ) + " ,动作信号: " + hongXiangStationDeviceDriver . getAction ( ) + " 报警信号: " + hongXiangStationDeviceDriver . getError ( ) + " ,指令号: " + ikey + " 不满足取货条件 " ;
log . info ( " 设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{} " , device_code , hongXiangStationDeviceDriver . getMove ( ) , hongXiangStationDeviceDriver . getAction ( )
@@ -823,14 +853,27 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
standardInspectSiteDeviceDriver = ( StandardInspectSiteDeviceDriver ) device . getDeviceDriver ( ) ;
standardInspectSiteDeviceDriver . writing ( 1 ) ;
if ( ( standardInspectSiteDeviceDriver . getMove ( ) = = 0 & & standardInspectSiteDeviceDriver . getAction ( ) = = 1 & & standardInspectSiteDeviceDriver . getError ( ) = = 0 ) ) {
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 ) ;
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 , 0 , 0 );
} else {
message = " 设备号: " + device_code + " 光电信号: " + standardInspectSiteDeviceDriver . getMove ( ) + " ,动作信号: " + standardInspectSiteDeviceDriver . getAction ( ) + " 报警信号: " + standardInspectSiteDeviceDriver . getError ( ) + " ,指令号: " + ikey + " 不满足放货条件 " ;
log . info ( " 设备{}当前光电信号{},动作信号{} ,报警信号{},不满足放货条件,指令号{} " , device_code , standardInspectSiteDeviceDriver . getMove ( ) , standardInspectSiteDeviceDriver . getAction ( )
, standardInspectSiteDeviceDriver . getError ( ) , ikey ) ;
}
} else if ( device . getDeviceDriver ( ) instanceof RangingStationsDeviceDriver ) {
rangingStationsDeviceDriver = ( RangingStationsDeviceDriver ) device . getDeviceDriver ( ) ;
String length1 = rangingStationsDeviceDriver . getLength1 ( ) ;
Float len = 0 . 0F ;
if ( ObjectUtil . isNotEmpty ( length1 ) & & ! " null " . equals ( length1 ) ) {
len = Float . parseFloat ( length1 ) ;
}
int roundedNumber = ObjectUtil . isNotEmpty ( len ) ? NumberUtil . round ( len , 0 ) . intValue ( ) : 0 ;
if ( roundedNumber = = 0 ) {
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 , 0 , roundedNumber ) ;
} else {
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 , 1 , roundedNumber ) ;
}
} else {
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 ) ;
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 , 0 , 0 );
}
}
//放货完成
@@ -888,7 +931,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
// } else {
// data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
// }
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 ) ;
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 , 0 , 0 );
this . setPhase ( phase ) ;
} else if ( device . getDeviceDriver ( ) instanceof ManipulatorAgvStationDeviceDriver ) {
manipulatorAgvStationDeviceDriver = ( ManipulatorAgvStationDeviceDriver ) device . getDeviceDriver ( ) ;
@@ -899,7 +942,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
e . printStackTrace ( ) ;
}
if ( ( manipulatorAgvStationDeviceDriver . getAction ( ) = = 1 ) ) {
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 ) ;
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 , 0 , 0 );
} else {
message = " 设备号: " + device_code + " ,动作信号: " + manipulatorAgvStationDeviceDriver . getAction ( ) + " 报警信号: " + " ,指令号: " + ikey + " 不满足取货条件 " ;
log . info ( " 设备{},动作信号{} ,不满足取货条件,指令号{} " , device_code , manipulatorAgvStationDeviceDriver . getAction ( ) , ikey ) ;
@@ -912,7 +955,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
e . printStackTrace ( ) ;
}
if ( hongXiangStationDeviceDriver . getMove ( ) > 0 ) {
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 ) ;
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 , 0 , 0 );
} else {
message = " 设备号: " + device_code + " 光电信号: " + hongXiangStationDeviceDriver . getMove ( ) + " ,动作信号: " + hongXiangStationDeviceDriver . getAction ( ) + " 报警信号: " + hongXiangStationDeviceDriver . getError ( ) + " ,指令号: " + ikey + " 不满足取货条件 " ;
log . info ( " 设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{} " , device_code , hongXiangStationDeviceDriver . getMove ( ) , hongXiangStationDeviceDriver . getAction ( )
@@ -926,7 +969,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
e . printStackTrace ( ) ;
}
if ( paperTubePickSiteDeviceDriver . getMove ( ) > 0 ) {
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 ) ;
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 , 0 , 0 );
} else {
message = " 设备号: " + device_code + " 光电信号: " + paperTubePickSiteDeviceDriver . getMove ( ) + " ,动作信号: " + paperTubePickSiteDeviceDriver . getAction ( ) + " 报警信号: " + paperTubePickSiteDeviceDriver . getError ( ) + " ,指令号: " + ikey + " 不满足取货条件 " ;
log . info ( " 设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{} " , device_code , paperTubePickSiteDeviceDriver . getMove ( ) , paperTubePickSiteDeviceDriver . getAction ( )
@@ -936,10 +979,10 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
standardInspectSiteDeviceDriver = ( StandardInspectSiteDeviceDriver ) device . getDeviceDriver ( ) ;
standardInspectSiteDeviceDriver . writing ( 0 ) ;
if ( ( standardInspectSiteDeviceDriver . getMove ( ) = = 1 ) ) {
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 ) ;
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 , 0 , 0 );
}
} else {
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 ) ;
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 , 0 , 0 );
}
}
//到达放货点
@@ -999,7 +1042,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
// } else {
// data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0);
// }
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 ) ;
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 , 0 , 0 );
this . setPhase ( phase ) ;
} else if ( device . getDeviceDriver ( ) instanceof ManipulatorAgvStationDeviceDriver ) {
@@ -1011,7 +1054,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
e . printStackTrace ( ) ;
}
if ( ( manipulatorAgvStationDeviceDriver . getAction ( ) = = 1 ) ) {
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 ) ;
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 , 0 , 0 );
} else {
message = " 设备号: " + device_code + " ,动作信号: " + manipulatorAgvStationDeviceDriver . getAction ( ) + " 报警信号: " + " ,指令号: " + ikey + " 不满足取货条件 " ;
log . info ( " 设备{},动作信号{} ,不满足取货条件,指令号{} " , device_code , manipulatorAgvStationDeviceDriver . getAction ( ) , ikey ) ;
@@ -1024,7 +1067,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
e . printStackTrace ( ) ;
}
if ( hongXiangStationDeviceDriver . getMove ( ) = = 0 ) {
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 ) ;
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 , 0 , 0 );
} else {
message = " 设备号: " + device_code + " 光电信号: " + hongXiangStationDeviceDriver . getMove ( ) + " ,动作信号: " + hongXiangStationDeviceDriver . getAction ( ) + " 报警信号: " + hongXiangStationDeviceDriver . getError ( ) + " ,指令号: " + ikey + " 不满足取货条件 " ;
log . info ( " 设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{} " , device_code , hongXiangStationDeviceDriver . getMove ( ) , hongXiangStationDeviceDriver . getAction ( )
@@ -1038,14 +1081,27 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
e . printStackTrace ( ) ;
}
if ( paperTubePickSiteDeviceDriver . getMove ( ) = = 0 ) {
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 ) ;
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 , 0 , 0 );
} else {
message = " 设备号: " + device_code + " 光电信号: " + paperTubePickSiteDeviceDriver . getMove ( ) + " ,动作信号: " + paperTubePickSiteDeviceDriver . getAction ( ) + " 报警信号: " + paperTubePickSiteDeviceDriver . getError ( ) + " ,指令号: " + ikey + " 不满足取货条件 " ;
log . info ( " 设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{} " , device_code , paperTubePickSiteDeviceDriver . getMove ( ) , paperTubePickSiteDeviceDriver . getAction ( )
, paperTubePickSiteDeviceDriver . getError ( ) , ikey ) ;
}
} else if ( device . getDeviceDriver ( ) instanceof RangingStationsDeviceDriver ) {
rangingStationsDeviceDriver = ( RangingStationsDeviceDriver ) device . getDeviceDriver ( ) ;
String length1 = rangingStationsDeviceDriver . getLength1 ( ) ;
Float len = 0 . 0F ;
if ( ObjectUtil . isNotEmpty ( length1 ) & & ! " null " . equals ( length1 ) ) {
len = Float . parseFloat ( length1 ) ;
}
int roundedNumber = ObjectUtil . isNotEmpty ( len ) ? NumberUtil . round ( len , 0 ) . intValue ( ) : 0 ;
if ( roundedNumber = = 0 ) {
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 , 0 , roundedNumber ) ;
} else {
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 , 1 , roundedNumber ) ;
}
} else {
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 ) ;
data = ndcAgvService . sendAgvTwoModeInst ( phase , index , 0 , 0 , 0 );
}
}
}