@@ -21,6 +21,8 @@ import org.nl.acs.instruction.service.dto.Instruction;
import org.nl.acs.log.service.LogServer ;
import org.nl.acs.opc.Device ;
import org.nl.acs.opc.WcsConfig ;
import org.nl.acs.order.service.ProduceshiftorderService ;
import org.nl.acs.order.service.dto.ProduceshiftorderDto ;
import org.nl.acs.route.service.RouteLineService ;
import org.nl.acs.route.service.dto.RouteLineDto ;
import org.nl.acs.task.service.TaskService ;
@@ -53,6 +55,8 @@ public class LnshSplitManipulatorDeviceDriver extends AbstractOpcDeviceDriver im
LogServer logServer = SpringContextHolder . getBean ( " logServerImpl " ) ;
@Autowired
AcsToWmsService acsToWmsService = SpringContextHolder . getBean ( " acsToWmsServiceImpl " ) ;
@Autowired
ProduceshiftorderService produceshiftorderService = SpringContextHolder . getBean ( " produceshiftorderServiceImpl " ) ;
int mode = 0 ;
int error = 0 ;
@@ -106,6 +110,10 @@ public class LnshSplitManipulatorDeviceDriver extends AbstractOpcDeviceDriver im
String last_material ;
int total_split = 0 ;
int last_total_split = 0 ;
int order_qty = 0 ;
int last_order_qty = 0 ;
String order_No = " " ;
String last_order_No = " " ;
//开关机状态 0关机 1开机
int onoff_status = 0 ;
@@ -118,6 +126,125 @@ public class LnshSplitManipulatorDeviceDriver extends AbstractOpcDeviceDriver im
int qty = 0 ;
int last_qty = 0 ;
//垛型参数
int product_code = 0 ;
int AlongSide = 0 ;
int BshortSide = 0 ;
int Htrapezoidal = 0 ;
int Wthickness = 0 ;
int tray_qty = 0 ;
int tray_high = 0 ;
int crib_category = 0 ;
int palletX1_line = 0 ;
int palletY1_row = 0 ;
int palletA1_angle = 0 ;
int palletX2_line = 0 ;
int palletY2_row = 0 ;
int palletA2_angle = 0 ;
int palletX3_line = 0 ;
int palletY3_row = 0 ;
int palletA3_angle = 0 ;
int pressCribX1_line = 0 ;
int pressCribY1_row = 0 ;
int pressCribA1_angle = 0 ;
int pressCribX2_line = 0 ;
int pressCribY2_row = 0 ;
int pressCribA2_angle = 0 ;
int pressCribX3_line = 0 ;
int pressCribY3_row = 0 ;
int pressCribA3_angle = 0 ;
int Zoffset = 0 ;
int pallet_layerQty = 0 ;
int pressCrib_layerQty = 0 ;
int codeLayerX1_interval = 0 ;
int codeLayerY1_interval = 0 ;
int codeLayerX2_interval = 0 ;
int codeLayerY2_interval = 0 ;
int codeLayerX3_interval = 0 ;
int codeLayerY3_interval = 0 ;
int codeLayerX1_offset = 0 ;
int codeLayerY1_offset = 0 ;
int codeLayerX2_offset = 0 ;
int codeLayerY2_offset = 0 ;
int codeLayerX3_offset = 0 ;
int codeLayerY3_offset = 0 ;
int pressLayerX1_interval = 0 ;
int pressLayerY1_interval = 0 ;
int pressLayerX2_interval = 0 ;
int pressLayerY2_interval = 0 ;
int pressLayerX3_interval = 0 ;
int pressLayerY3_interval = 0 ;
int pressLayerX1_offset = 0 ;
int pressLayerY1_offset = 0 ;
int pressLayerX2_offset = 0 ;
int pressLayerY2_offset = 0 ;
int pressLayerX3_offset = 0 ;
int pressLayerY3_offset = 0 ;
int one_cribTotal = 0 ;
int two_cribTotal = 0 ;
int one_qty = 0 ;
int two_qty = 0 ;
int tool_coordinate = 0 ;
int last_product_code = 0 ;
int last_AlongSide = 0 ;
int last_BshortSide = 0 ;
int last_Htrapezoidal = 0 ;
int last_Wthickness = 0 ;
int last_tray_qty = 0 ;
int last_tray_high = 0 ;
int last_crib_category = 0 ;
int last_palletX1_line = 0 ;
int last_palletY1_row = 0 ;
int last_palletA1_angle = 0 ;
int last_palletX2_line = 0 ;
int last_palletY2_row = 0 ;
int last_palletA2_angle = 0 ;
int last_palletX3_line = 0 ;
int last_palletY3_row = 0 ;
int last_palletA3_angle = 0 ;
int last_pressCribX1_line = 0 ;
int last_pressCribY1_row = 0 ;
int last_pressCribA1_angle = 0 ;
int last_pressCribX2_line = 0 ;
int last_pressCribY2_row = 0 ;
int last_pressCribA2_angle = 0 ;
int last_pressCribX3_line = 0 ;
int last_pressCribY3_row = 0 ;
int last_pressCribA3_angle = 0 ;
int last_Zoffset = 0 ;
int last_pallet_layerQty = 0 ;
int last_pressCrib_layerQty = 0 ;
int last_codeLayerX1_interval = 0 ;
int last_codeLayerY1_interval = 0 ;
int last_codeLayerX2_interval = 0 ;
int last_codeLayerY2_interval = 0 ;
int last_codeLayerX3_interval = 0 ;
int last_codeLayerY3_interval = 0 ;
int last_codeLayerX1_offset = 0 ;
int last_codeLayerY1_offset = 0 ;
int last_codeLayerX2_offset = 0 ;
int last_codeLayerY2_offset = 0 ;
int last_codeLayerX3_offset = 0 ;
int last_codeLayerY3_offset = 0 ;
int last_pressLayerX1_interval = 0 ;
int last_pressLayerY1_interval = 0 ;
int last_pressLayerX2_interval = 0 ;
int last_pressLayerY2_interval = 0 ;
int last_pressLayerX3_interval = 0 ;
int last_pressLayerY3_interval = 0 ;
int last_pressLayerX1_offset = 0 ;
int last_pressLayerY1_offset = 0 ;
int last_pressLayerX2_offset = 0 ;
int last_pressLayerY2_offset = 0 ;
int last_pressLayerX3_offset = 0 ;
int last_pressLayerY3_offset = 0 ;
int last_one_cribTotal = 0 ;
int last_two_cribTotal = 0 ;
int last_one_qty = 0 ;
int last_two_qty = 0 ;
int last_tool_coordinate = 0 ;
@Override
public Device getDevice ( ) {
return this . device ;
@@ -143,6 +270,67 @@ public class LnshSplitManipulatorDeviceDriver extends AbstractOpcDeviceDriver im
batch = this . itemProtocol . getBatch ( ) ;
specifications = this . itemProtocol . getSpecifications ( ) ;
qty = this . itemProtocol . getQty ( ) ;
order_qty = this . itemProtocol . getOrder_qty ( ) ;
order_No = this . itemProtocol . getOrder_No ( ) ;
product_code = this . itemProtocol . getProduct_code ( ) ;
AlongSide = this . itemProtocol . getAlongSide ( ) ;
BshortSide = this . itemProtocol . getBshortSide ( ) ;
Htrapezoidal = this . itemProtocol . getHtrapezoidal ( ) ;
Wthickness = this . itemProtocol . getWthickness ( ) ;
tray_qty = this . itemProtocol . getTray_qty ( ) ;
tray_high = this . itemProtocol . getTray_high ( ) ;
crib_category = this . itemProtocol . getCrib_category ( ) ;
palletX1_line = this . itemProtocol . getPalletX1_line ( ) ;
palletY1_row = this . itemProtocol . getPalletY1_row ( ) ;
palletA1_angle = this . itemProtocol . getPalletA1_angle ( ) ;
palletX2_line = this . itemProtocol . getPalletX2_line ( ) ;
palletY2_row = this . itemProtocol . getPalletY2_row ( ) ;
palletA2_angle = this . itemProtocol . getPalletA2_angle ( ) ;
palletX3_line = this . itemProtocol . getPalletX3_line ( ) ;
palletY3_row = this . itemProtocol . getPalletY3_row ( ) ;
palletA3_angle = this . itemProtocol . getPalletA3_angle ( ) ;
pressCribX1_line = this . itemProtocol . getPressCribX1_line ( ) ;
pressCribY1_row = this . itemProtocol . getPressCribY1_row ( ) ;
pressCribA1_angle = this . itemProtocol . getPressCribA1_angle ( ) ;
pressCribX2_line = this . itemProtocol . getPressCribX2_line ( ) ;
pressCribY2_row = this . itemProtocol . getPressCribY2_row ( ) ;
pressCribA2_angle = this . itemProtocol . getPressCribA2_angle ( ) ;
pressCribX3_line = this . itemProtocol . getPressCribX3_line ( ) ;
pressCribY3_row = this . itemProtocol . getPressCribY3_row ( ) ;
pressCribA3_angle = this . itemProtocol . getPressCribA3_angle ( ) ;
Zoffset = this . itemProtocol . getZoffset ( ) ;
pallet_layerQty = this . itemProtocol . getPallet_layerQty ( ) ;
pressCrib_layerQty = this . itemProtocol . getPressCrib_layerQty ( ) ;
codeLayerX1_interval = this . itemProtocol . getCodeLayerX1_interval ( ) ;
codeLayerY1_interval = this . itemProtocol . getCodeLayerY1_interval ( ) ;
codeLayerX2_interval = this . itemProtocol . getCodeLayerX2_interval ( ) ;
codeLayerY2_interval = this . itemProtocol . getCodeLayerY2_interval ( ) ;
codeLayerX3_interval = this . itemProtocol . getCodeLayerX3_interval ( ) ;
codeLayerY3_interval = this . itemProtocol . getcodeLayerY3_interval ( ) ;
codeLayerX1_offset = this . itemProtocol . getCodeLayerX1_offset ( ) ;
codeLayerY1_offset = this . itemProtocol . getCodeLayerY1_offset ( ) ;
codeLayerX2_offset = this . itemProtocol . getCodeLayerX2_offset ( ) ;
codeLayerY2_offset = this . itemProtocol . getCodeLayerY2_offset ( ) ;
codeLayerX3_offset = this . itemProtocol . getCodeLayerX3_offset ( ) ;
codeLayerY3_offset = this . itemProtocol . getCodeLayerY3_offset ( ) ;
pressLayerX1_interval = this . itemProtocol . getPressLayerX1_interval ( ) ;
pressLayerY1_interval = this . itemProtocol . getPressLayerY1_interval ( ) ;
pressLayerX2_interval = this . itemProtocol . getPressLayerX2_interval ( ) ;
pressLayerY2_interval = this . itemProtocol . getPressLayerY2_interval ( ) ;
pressLayerX3_interval = this . itemProtocol . getPressLayerX3_interval ( ) ;
pressLayerY3_interval = this . itemProtocol . getPressLayerY3_interval ( ) ;
pressLayerX1_offset = this . itemProtocol . getPressLayerX1_offset ( ) ;
pressLayerY1_offset = this . itemProtocol . getPressLayerY1_offset ( ) ;
pressLayerX2_offset = this . itemProtocol . getPressLayerX2_offset ( ) ;
pressLayerY2_offset = this . itemProtocol . getPressLayerY2_offset ( ) ;
pressLayerX3_offset = this . itemProtocol . getPressLayerX3_offset ( ) ;
pressLayerY3_offset = this . itemProtocol . getPressLayerY3_offset ( ) ;
one_cribTotal = this . itemProtocol . getOne_cribTotal ( ) ;
two_cribTotal = this . itemProtocol . getTwo_cribTotal ( ) ;
one_qty = this . itemProtocol . getOne_qty ( ) ;
two_qty = this . itemProtocol . getTwo_qty ( ) ;
tool_coordinate = this . itemProtocol . getTool_coordinate ( ) ;
if ( mode ! = last_mode ) {
this . setRequireSucess ( false ) ;
@@ -201,6 +389,246 @@ public class LnshSplitManipulatorDeviceDriver extends AbstractOpcDeviceDriver im
logServer . deviceLog ( this . device_code , " qty " , String . valueOf ( qty ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号qty: " + last_qty + " -> " + qty ) ;
}
if ( order_qty ! = last_order_qty ) {
logServer . deviceLog ( this . device_code , " order_qty " , String . valueOf ( order_qty ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号order_qty: " + last_order_qty + " -> " + order_qty ) ;
}
if ( ! StrUtil . equals ( order_No , last_order_No ) ) {
logServer . deviceLog ( this . device_code , " order_No " , order_No ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号order_No: " + last_order_No + " -> " + order_No ) ;
}
if ( product_code ! = last_product_code ) {
logServer . deviceLog ( this . device_code , " product_code " , String . valueOf ( product_code ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号product_code: " + last_product_code + " -> " + product_code ) ;
}
if ( AlongSide ! = last_AlongSide ) {
logServer . deviceLog ( this . device_code , " AlongSide " , String . valueOf ( AlongSide ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号AlongSide: " + last_AlongSide + " -> " + AlongSide ) ;
}
if ( BshortSide ! = last_BshortSide ) {
logServer . deviceLog ( this . device_code , " BshortSide " , String . valueOf ( BshortSide ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号BshortSide: " + last_BshortSide + " -> " + BshortSide ) ;
}
if ( Htrapezoidal ! = last_Htrapezoidal ) {
logServer . deviceLog ( this . device_code , " Htrapezoidal " , String . valueOf ( Htrapezoidal ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号Htrapezoidal: " + last_Htrapezoidal + " -> " + Htrapezoidal ) ;
}
if ( Wthickness ! = last_Wthickness ) {
logServer . deviceLog ( this . device_code , " Wthickness " , String . valueOf ( Wthickness ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号Wthickness: " + last_Wthickness + " -> " + Wthickness ) ;
}
if ( tray_qty ! = last_tray_qty ) {
logServer . deviceLog ( this . device_code , " tray_qty " , String . valueOf ( tray_qty ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号tray_qty: " + last_tray_qty + " -> " + tray_qty ) ;
}
if ( tray_high ! = last_tray_high ) {
logServer . deviceLog ( this . device_code , " tray_high " , String . valueOf ( tray_high ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号tray_high: " + last_tray_high + " -> " + tray_high ) ;
}
if ( crib_category ! = last_crib_category ) {
logServer . deviceLog ( this . device_code , " crib_category " , String . valueOf ( crib_category ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号crib_category: " + last_crib_category + " -> " + crib_category ) ;
}
if ( palletX1_line ! = last_palletX1_line ) {
logServer . deviceLog ( this . device_code , " palletX1_line " , String . valueOf ( palletX1_line ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号palletX1_line: " + last_palletX1_line + " -> " + palletX1_line ) ;
}
if ( palletY1_row ! = last_palletY1_row ) {
logServer . deviceLog ( this . device_code , " palletY1_row " , String . valueOf ( palletY1_row ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号palletY1_row: " + last_palletY1_row + " -> " + palletY1_row ) ;
}
if ( palletA1_angle ! = last_palletA1_angle ) {
logServer . deviceLog ( this . device_code , " palletA1_angle " , String . valueOf ( palletA1_angle ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号palletA1_angle: " + last_palletA1_angle + " -> " + palletA1_angle ) ;
}
if ( palletX2_line ! = last_palletX2_line ) {
logServer . deviceLog ( this . device_code , " palletX2_line " , String . valueOf ( palletX2_line ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号palletX2_line: " + last_palletX2_line + " -> " + palletX2_line ) ;
}
if ( palletY2_row ! = last_palletY2_row ) {
logServer . deviceLog ( this . device_code , " palletY2_row " , String . valueOf ( palletY2_row ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号palletY2_row: " + last_palletY2_row + " -> " + palletY2_row ) ;
}
if ( palletA2_angle ! = last_palletA2_angle ) {
logServer . deviceLog ( this . device_code , " palletA2_angle " , String . valueOf ( palletA2_angle ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号palletA2_angle: " + last_palletA2_angle + " -> " + palletA2_angle ) ;
}
if ( palletX3_line ! = last_palletX3_line ) {
logServer . deviceLog ( this . device_code , " palletX3_line " , String . valueOf ( palletX3_line ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号palletX3_line: " + last_palletX3_line + " -> " + palletX3_line ) ;
}
if ( palletY3_row ! = last_palletY3_row ) {
logServer . deviceLog ( this . device_code , " palletY3_row " , String . valueOf ( palletY3_row ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号palletY3_row: " + last_palletY3_row + " -> " + palletY3_row ) ;
}
if ( palletA3_angle ! = last_palletA3_angle ) {
logServer . deviceLog ( this . device_code , " palletA3_angle " , String . valueOf ( palletA3_angle ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号palletA3_angle: " + last_palletA3_angle + " -> " + palletA3_angle ) ;
}
if ( pressCribX1_line ! = last_pressCribX1_line ) {
logServer . deviceLog ( this . device_code , " pressCribX1_line " , String . valueOf ( pressCribX1_line ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号pressCribX1_line: " + last_pressCribX1_line + " -> " + pressCribX1_line ) ;
}
if ( pressCribY1_row ! = last_pressCribY1_row ) {
logServer . deviceLog ( this . device_code , " pressCribY1_row " , String . valueOf ( pressCribY1_row ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号pressCribY1_row: " + last_pressCribY1_row + " -> " + pressCribY1_row ) ;
}
if ( pressCribA1_angle ! = last_pressCribA1_angle ) {
logServer . deviceLog ( this . device_code , " pressCribA1_angle " , String . valueOf ( pressCribA1_angle ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号pressCribA1_angle: " + last_pressCribA1_angle + " -> " + pressCribA1_angle ) ;
}
if ( pressCribX2_line ! = last_pressCribX2_line ) {
logServer . deviceLog ( this . device_code , " pressCribX2_line " , String . valueOf ( pressCribX2_line ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号pressCribX2_line: " + last_pressCribX2_line + " -> " + pressCribX2_line ) ;
}
if ( pressCribY2_row ! = last_pressCribY2_row ) {
logServer . deviceLog ( this . device_code , " pressCribY2_row " , String . valueOf ( pressCribY2_row ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号pressCribY2_row: " + last_pressCribY2_row + " -> " + pressCribY2_row ) ;
}
if ( pressCribA2_angle ! = last_pressCribA2_angle ) {
logServer . deviceLog ( this . device_code , " pressCribA2_angle " , String . valueOf ( pressCribA2_angle ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号pressCribA2_angle: " + last_pressCribA2_angle + " -> " + pressCribA2_angle ) ;
}
if ( pressCribX3_line ! = last_pressCribX3_line ) {
logServer . deviceLog ( this . device_code , " pressCribX3_line " , String . valueOf ( pressCribX3_line ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号pressCribX3_line: " + last_pressCribX3_line + " -> " + pressCribX3_line ) ;
}
if ( pressCribY3_row ! = last_pressCribY3_row ) {
logServer . deviceLog ( this . device_code , " pressCribY3_row " , String . valueOf ( pressCribY3_row ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号pressCribY3_row: " + last_pressCribY3_row + " -> " + pressCribY3_row ) ;
}
if ( pressCribA3_angle ! = last_pressCribA3_angle ) {
logServer . deviceLog ( this . device_code , " pressCribA3_angle " , String . valueOf ( pressCribA3_angle ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号pressCribA3_angle: " + last_pressCribA3_angle + " -> " + pressCribA3_angle ) ;
}
if ( Zoffset ! = last_Zoffset ) {
logServer . deviceLog ( this . device_code , " Zoffset " , String . valueOf ( Zoffset ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号Zoffset: " + last_Zoffset + " -> " + Zoffset ) ;
}
if ( pallet_layerQty ! = last_pallet_layerQty ) {
logServer . deviceLog ( this . device_code , " pallet_layerQty " , String . valueOf ( pallet_layerQty ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号pallet_layerQty: " + last_pallet_layerQty + " -> " + pallet_layerQty ) ;
}
if ( pressCrib_layerQty ! = last_pressCrib_layerQty ) {
logServer . deviceLog ( this . device_code , " pressCrib_layerQty " , String . valueOf ( pressCrib_layerQty ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号pressCrib_layerQty: " + last_pressCrib_layerQty + " -> " + pressCrib_layerQty ) ;
}
if ( codeLayerX1_interval ! = last_codeLayerX1_interval ) {
logServer . deviceLog ( this . device_code , " codeLayerX1_interval " , String . valueOf ( codeLayerX1_interval ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号codeLayerX1_interval: " + last_codeLayerX1_interval + " -> " + codeLayerX1_interval ) ;
}
if ( codeLayerY1_interval ! = last_codeLayerY1_interval ) {
logServer . deviceLog ( this . device_code , " codeLayerY1_interval " , String . valueOf ( codeLayerY1_interval ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号codeLayerY1_interval: " + last_codeLayerY1_interval + " -> " + codeLayerY1_interval ) ;
}
if ( codeLayerX2_interval ! = last_codeLayerX2_interval ) {
logServer . deviceLog ( this . device_code , " codeLayerX2_interval " , String . valueOf ( codeLayerX2_interval ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号codeLayerX2_interval: " + last_codeLayerX2_interval + " -> " + codeLayerX2_interval ) ;
}
if ( codeLayerY2_interval ! = last_codeLayerY2_interval ) {
logServer . deviceLog ( this . device_code , " codeLayerY2_interval " , String . valueOf ( codeLayerY2_interval ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号codeLayerY2_interval: " + last_codeLayerY2_interval + " -> " + codeLayerY2_interval ) ;
}
if ( codeLayerX3_interval ! = last_codeLayerX3_interval ) {
logServer . deviceLog ( this . device_code , " codeLayerX3_interval " , String . valueOf ( codeLayerX3_interval ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号codeLayerX3_interval: " + last_codeLayerX3_interval + " -> " + codeLayerX3_interval ) ;
}
if ( codeLayerY3_interval ! = last_codeLayerY3_interval ) {
logServer . deviceLog ( this . device_code , " codeLayerY3_interval " , String . valueOf ( codeLayerY3_interval ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号codeLayerY3_interval: " + last_codeLayerY3_interval + " -> " + codeLayerY3_interval ) ;
}
if ( codeLayerX1_offset ! = last_codeLayerX1_offset ) {
logServer . deviceLog ( this . device_code , " codeLayerX1_offset " , String . valueOf ( codeLayerX1_offset ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号codeLayerX1_offset: " + last_codeLayerX1_offset + " -> " + codeLayerX1_offset ) ;
}
if ( codeLayerY1_offset ! = last_codeLayerY1_offset ) {
logServer . deviceLog ( this . device_code , " codeLayerY1_offset " , String . valueOf ( codeLayerY1_offset ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号codeLayerY1_offset: " + last_codeLayerY1_offset + " -> " + codeLayerY1_offset ) ;
}
if ( codeLayerX2_offset ! = last_codeLayerX2_offset ) {
logServer . deviceLog ( this . device_code , " codeLayerX2_offset " , String . valueOf ( codeLayerX2_offset ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号codeLayerX2_offset: " + last_codeLayerX2_offset + " -> " + codeLayerX2_offset ) ;
}
if ( codeLayerY2_offset ! = last_codeLayerY2_offset ) {
logServer . deviceLog ( this . device_code , " codeLayerY2_offset " , String . valueOf ( codeLayerY2_offset ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号codeLayerY2_offset: " + last_codeLayerY2_offset + " -> " + codeLayerY2_offset ) ;
}
if ( codeLayerX3_offset ! = last_codeLayerX3_offset ) {
logServer . deviceLog ( this . device_code , " codeLayerX3_offset " , String . valueOf ( codeLayerX3_offset ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号codeLayerX3_offset: " + last_codeLayerX3_offset + " -> " + codeLayerX3_offset ) ;
}
if ( codeLayerY3_offset ! = last_codeLayerY3_offset ) {
logServer . deviceLog ( this . device_code , " codeLayerY3_offset " , String . valueOf ( codeLayerY3_offset ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号codeLayerY3_offset: " + last_codeLayerY3_offset + " -> " + codeLayerY3_offset ) ;
}
if ( pressLayerX1_interval ! = last_pressLayerX1_interval ) {
logServer . deviceLog ( this . device_code , " pressLayerX1_interval " , String . valueOf ( pressLayerX1_interval ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号pressLayerX1_interval: " + last_pressLayerX1_interval + " -> " + pressLayerX1_interval ) ;
}
if ( pressLayerY1_interval ! = last_pressLayerY1_interval ) {
logServer . deviceLog ( this . device_code , " pressLayerY1_interval " , String . valueOf ( pressLayerY1_interval ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号pressLayerY1_interval: " + last_pressLayerY1_interval + " -> " + pressLayerY1_interval ) ;
}
if ( pressLayerX2_interval ! = last_pressLayerX2_interval ) {
logServer . deviceLog ( this . device_code , " pressLayerX2_interval " , String . valueOf ( pressLayerX2_interval ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号pressLayerX2_interval: " + last_pressLayerX2_interval + " -> " + pressLayerX2_interval ) ;
}
if ( pressLayerY2_interval ! = last_pressLayerY2_interval ) {
logServer . deviceLog ( this . device_code , " pressLayerY2_interval " , String . valueOf ( pressLayerY2_interval ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号pressLayerY2_interval: " + last_pressLayerY2_interval + " -> " + pressLayerY2_interval ) ;
}
if ( pressLayerX3_interval ! = last_pressLayerX3_interval ) {
logServer . deviceLog ( this . device_code , " pressLayerX3_interval " , String . valueOf ( pressLayerX3_interval ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号pressLayerX3_interval: " + last_pressLayerX3_interval + " -> " + pressLayerX3_interval ) ;
}
if ( pressLayerY3_interval ! = last_pressLayerY3_interval ) {
logServer . deviceLog ( this . device_code , " pressLayerY3_interval " , String . valueOf ( pressLayerY3_interval ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号pressLayerY3_interval: " + last_pressLayerY3_interval + " -> " + pressLayerY3_interval ) ;
}
if ( pressLayerX1_offset ! = last_pressLayerX1_offset ) {
logServer . deviceLog ( this . device_code , " pressLayerX1_offset " , String . valueOf ( pressLayerX1_offset ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号pressLayerX1_offset: " + last_pressLayerX1_offset + " -> " + pressLayerX1_offset ) ;
}
if ( pressLayerY1_offset ! = last_pressLayerY1_offset ) {
logServer . deviceLog ( this . device_code , " pressLayerY1_offset " , String . valueOf ( pressLayerY1_offset ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号pressLayerY1_offset: " + last_pressLayerY1_offset + " -> " + pressLayerY1_offset ) ;
}
if ( pressLayerX2_offset ! = last_pressLayerX2_offset ) {
logServer . deviceLog ( this . device_code , " pressLayerX2_offset " , String . valueOf ( pressLayerX2_offset ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号pressLayerX2_offset: " + last_pressLayerX2_offset + " -> " + pressLayerX2_offset ) ;
}
if ( pressLayerY2_offset ! = last_pressLayerY2_offset ) {
logServer . deviceLog ( this . device_code , " pressLayerY2_offset " , String . valueOf ( pressLayerY2_offset ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号pressLayerY2_offset: " + last_pressLayerY2_offset + " -> " + pressLayerY2_offset ) ;
}
if ( pressLayerX3_offset ! = last_pressLayerX3_offset ) {
logServer . deviceLog ( this . device_code , " pressLayerX3_offset " , String . valueOf ( pressLayerX3_offset ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号pressLayerX3_offset: " + last_pressLayerX3_offset + " -> " + pressLayerX3_offset ) ;
}
if ( pressLayerY3_offset ! = last_pressLayerY3_offset ) {
logServer . deviceLog ( this . device_code , " pressLayerY3_offset " , String . valueOf ( pressLayerY3_offset ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号pressLayerY3_offset: " + last_pressLayerY3_offset + " -> " + pressLayerY3_offset ) ;
}
if ( one_cribTotal ! = last_one_cribTotal ) {
logServer . deviceLog ( this . device_code , " one_cribTotal " , String . valueOf ( one_cribTotal ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号one_cribTotal: " + last_one_cribTotal + " -> " + one_cribTotal ) ;
}
if ( two_cribTotal ! = last_two_cribTotal ) {
logServer . deviceLog ( this . device_code , " two_cribTotal " , String . valueOf ( two_cribTotal ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号two_cribTotal: " + last_two_cribTotal + " -> " + two_cribTotal ) ;
}
if ( one_qty ! = last_one_qty ) {
logServer . deviceLog ( this . device_code , " one_qty " , String . valueOf ( one_qty ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号one_qty: " + last_one_qty + " -> " + one_qty ) ;
}
if ( two_qty ! = last_two_qty ) {
logServer . deviceLog ( this . device_code , " two_qty " , String . valueOf ( two_qty ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号two_qty: " + last_two_qty + " -> " + two_qty ) ;
}
if ( tool_coordinate ! = last_tool_coordinate ) {
logServer . deviceLog ( this . device_code , " tool_coordinate " , String . valueOf ( tool_coordinate ) ) ;
logServer . deviceLogToacs ( this . device_code , " " , " " , " 信号tool_coordinate: " + last_tool_coordinate + " -> " + tool_coordinate ) ;
}
} catch ( Exception var17 ) {
return ;
@@ -235,15 +663,15 @@ public class LnshSplitManipulatorDeviceDriver extends AbstractOpcDeviceDriver im
break ;
case 4 :
//排产单确认
// if (!requireSucess && ! order_No. equals("0")) {
// JSONObject json = new JSONObject() ;
// json.put(" producetask_code", order_No) ;
// json.put("device_code",this. device_code) ;
// json.put(" material_code", material) ;
// json.put("qty",qty) ;
// json.put("type","1") ;
// enterProduction(json) ;
// }
if ( ! requireSucess & & ! order_No. equals( " 0 " ) ) {
JSONObject json = new JSONObject( ) ;
json. put ( " producetask_code" , order_No) ;
json. put ( " device_code " , this . device_code) ;
json. put ( " material_code" , material) ;
json. put ( " qty " , qty ) ;
json. put ( " type " , " 1 " ) ;
enterProduction( json ) ;
}
break ;
case 5 :
//叫料出库
@@ -270,15 +698,15 @@ public class LnshSplitManipulatorDeviceDriver extends AbstractOpcDeviceDriver im
// }
case 9 :
//工单完成
// if (!requireSucess && ! order_No. equals("0")) {
// JSONObject json = new JSONObject() ;
// json.put(" producetask_code", order_No) ;
// json.put("device_code",this. device_code) ;
// json.put(" material_code", material) ;
// json.put("qty",qty) ;
// json.put("type","3") ;
// enterProduction(json) ;
// }
if ( ! requireSucess & & ! order_No. equals( " 0 " ) ) {
JSONObject json = new JSONObject( ) ;
json. put ( " producetask_code" , order_No) ;
json. put ( " device_code " , this . device_code) ;
json. put ( " material_code" , material) ;
json. put ( " qty " , qty ) ;
json. put ( " type " , " 3 " ) ;
enterProduction( json ) ;
}
break ;
}
@@ -308,6 +736,67 @@ public class LnshSplitManipulatorDeviceDriver extends AbstractOpcDeviceDriver im
last_onoff_status = onoff_status ;
last_batch = batch ;
last_specifications = specifications ;
last_order_No = order_No ;
last_order_qty = order_qty ;
last_product_code = product_code ;
last_AlongSide = AlongSide ;
last_BshortSide = BshortSide ;
last_Htrapezoidal = Htrapezoidal ;
last_Wthickness = Wthickness ;
last_tray_qty = tray_qty ;
last_tray_high = tray_high ;
last_crib_category = crib_category ;
last_palletX1_line = palletX1_line ;
last_palletY1_row = palletY1_row ;
last_palletA1_angle = palletA1_angle ;
last_palletX2_line = palletX2_line ;
last_palletY2_row = palletY2_row ;
last_palletA2_angle = palletA2_angle ;
last_palletX3_line = palletX3_line ;
last_palletY3_row = palletY3_row ;
last_palletA3_angle = palletA3_angle ;
last_pressCribX1_line = pressCribX1_line ;
last_pressCribY1_row = pressCribY1_row ;
last_pressCribA1_angle = pressCribA1_angle ;
last_pressCribX2_line = pressCribX2_line ;
last_pressCribY2_row = pressCribY2_row ;
last_pressCribA2_angle = pressCribA2_angle ;
last_pressCribX3_line = pressCribX3_line ;
last_pressCribY3_row = pressCribY3_row ;
last_pressCribA3_angle = pressCribA3_angle ;
last_Zoffset = Zoffset ;
last_pallet_layerQty = pallet_layerQty ;
last_pressCrib_layerQty = pressCrib_layerQty ;
last_codeLayerX1_interval = codeLayerX1_interval ;
last_codeLayerY1_interval = codeLayerY1_interval ;
last_codeLayerX2_interval = codeLayerX2_interval ;
last_codeLayerY2_interval = codeLayerY2_interval ;
last_codeLayerX3_interval = codeLayerX3_interval ;
last_codeLayerY3_interval = codeLayerY3_interval ;
last_codeLayerX1_offset = codeLayerX1_offset ;
last_codeLayerY1_offset = codeLayerY1_offset ;
last_codeLayerX2_offset = codeLayerX2_offset ;
last_codeLayerY2_offset = codeLayerY2_offset ;
last_codeLayerX3_offset = codeLayerX3_offset ;
last_codeLayerY3_offset = codeLayerY3_offset ;
last_pressLayerX1_interval = pressLayerX1_interval ;
last_pressLayerY1_interval = pressLayerY1_interval ;
last_pressLayerX2_interval = pressLayerX2_interval ;
last_pressLayerY2_interval = pressLayerY2_interval ;
last_pressLayerX3_interval = pressLayerX3_interval ;
last_pressLayerY3_interval = pressLayerY3_interval ;
last_pressLayerX1_offset = pressLayerX1_offset ;
last_pressLayerY1_offset = pressLayerY1_offset ;
last_pressLayerX2_offset = pressLayerX2_offset ;
last_pressLayerY2_offset = pressLayerY2_offset ;
last_pressLayerX3_offset = pressLayerX3_offset ;
last_pressLayerY3_offset = pressLayerY3_offset ;
last_one_cribTotal = one_cribTotal ;
last_two_cribTotal = two_cribTotal ;
last_one_qty = one_qty ;
last_two_qty = two_qty ;
last_tool_coordinate = tool_coordinate ;
}
@@ -355,6 +844,38 @@ public class LnshSplitManipulatorDeviceDriver extends AbstractOpcDeviceDriver im
}
}
/**
* 排产单确认
*
* @param
*/
public synchronized boolean enterProduction ( JSONObject json ) {
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 ;
HttpResponse result = acsToWmsService . enterOrder ( json ) ;
if ( ObjectUtil . isNotEmpty ( result ) ) {
JSONObject jsonObject = JSONObject . parseObject ( result . body ( ) ) ;
if ( result . getStatus ( ) = = 200 & & jsonObject . get ( " status " ) . equals ( " 200 " ) ) {
this . writing ( this . mode ) ;
ProduceshiftorderDto dto = produceshiftorderService . findByCode ( order_No ) ;
if ( this . mode = = 4 ) {
dto . setOrder_status ( " 0 " ) ;
} else if ( this . mode = = 9 ) {
dto . setOrder_status ( " 2 " ) ;
}
produceshiftorderService . update ( dto ) ;
}
}
this . setRequireSucess ( true ) ;
return true ;
}
}
/**
* 申请空盘入库
*
@@ -463,14 +984,16 @@ public class LnshSplitManipulatorDeviceDriver extends AbstractOpcDeviceDriver im
JSONObject json = new JSONObject ( ) ;
json . put ( " device_code " , this . device_code ) ;
json . put ( " type " , " 4 " ) ;
json. put ( " qty " , total_split) ;
json. put ( " vehicle_code" , barcode) ;
// json.put("qty", total_split) ;
// json.put(" vehicle_code", barcode) ;
HttpResponse result = acsToWmsService . lnshApplyTaskToWms ( json ) ;
if ( result . getStatus ( ) = = 200 ) {
this . writing ( this . m ode ) ;
if ( ObjectUtil . isNotEmpty ( result ) ) {
JSONObject jsonObject = JSONObject . parseObject ( result . b ody ( ) ) ;
if ( result . getStatus ( ) = = 200 & & jsonObject . get ( " status " ) . equals ( " 200 " ) ) {
this . writing ( this . mode ) ;
}
}
requireSucess = true ;
this . setRequireSucess ( true ) ;
return true ;
}
}