@ -23,10 +23,7 @@ import org.nl.acs.task.service.mapper.TaskMapper;
import org.nl.config.SpringContextHolder ;
import org.openscada.opc.lib.da.Server ;
import java.util.Date ;
import java.util.HashMap ;
import java.util.List ;
import java.util.Map ;
import java.util.* ;
/ * *
* 检测站点驱动
@ -130,6 +127,17 @@ public class SsxSiteDeviceDriver extends AbstractOpcDeviceDriver implements Devi
String devicecode ;
int device_type = 0 ;
int last_device_type = 0 ;
int frame_type = 0 ;
int last_frame_type = 0 ;
int mother_type = 0 ;
int last_mother_type = 0 ;
int sub_type = 0 ;
int last_sub_type = 0 ;
int error_code = 0 ;
int last_error_code = 0 ;
@Override
public Device getDevice ( ) {
return this . device ;
@ -149,6 +157,11 @@ public class SsxSiteDeviceDriver extends AbstractOpcDeviceDriver implements Devi
weight = this . itemProtocol . getWeight ( ) ;
mother_tray = this . itemProtocol . getMotherTray ( ) ;
sub_tray = this . itemProtocol . getSubTray ( ) ;
device_type = this . itemProtocol . getDeviceType ( ) ;
frame_type = this . itemProtocol . getFrameType ( ) ;
mother_type = this . itemProtocol . getMotherType ( ) ;
sub_type = this . itemProtocol . getSubType ( ) ;
error_code = this . itemProtocol . getErrorCode ( ) ;
if ( mode ! = last_mode ) {
this . setRequireSucess ( false ) ;
if ( mode = = 2 ) {
@ -159,10 +172,56 @@ public class SsxSiteDeviceDriver extends AbstractOpcDeviceDriver implements Devi
if ( error ! = last_error ) {
}
if ( mode ! = last_mode ) {
this . setRequireSucess ( false ) ;
if ( move ! = last_move ) {
JSONObject json = new JSONObject ( ) ;
json . put ( "point_qty" , move ) ;
acsToWmsService . notify ( json ) ;
}
if ( ! Objects . equals ( mother_tray , last_mother_tray ) ) {
JSONObject json = new JSONObject ( ) ;
json . put ( "mother_tray" , mother_tray ) ;
acsToWmsService . notify ( json ) ;
}
if ( ! Objects . equals ( sub_tray , last_sub_tray ) ) {
JSONObject json = new JSONObject ( ) ;
json . put ( "sub_tray" , sub_tray ) ;
acsToWmsService . notify ( json ) ;
}
if ( device_type ! = last_device_type ) {
JSONObject json = new JSONObject ( ) ;
json . put ( "device_type" , device_type ) ;
acsToWmsService . notify ( json ) ;
}
if ( frame_type ! = last_frame_type ) {
JSONObject json = new JSONObject ( ) ;
json . put ( "frame_type" , frame_type ) ;
acsToWmsService . notify ( json ) ;
}
if ( mother_type ! = last_mother_type ) {
JSONObject json = new JSONObject ( ) ;
json . put ( "sub_type" , sub_type ) ;
acsToWmsService . notify ( json ) ;
}
if ( sub_type ! = last_sub_type ) {
JSONObject json = new JSONObject ( ) ;
json . put ( "sub_type" , sub_type ) ;
acsToWmsService . notify ( json ) ;
}
if ( error_code ! = last_error_code ) {
JSONObject json = new JSONObject ( ) ;
json . put ( "error" , error_code ) ;
acsToWmsService . notify ( json ) ;
}
} catch ( Exception var17 ) {
return ;
@ -222,6 +281,11 @@ public class SsxSiteDeviceDriver extends AbstractOpcDeviceDriver implements Devi
last_sub_tray = sub_tray ;
last_mother_tray = mother_tray ;
last_action = action ;
last_device_type = device_type ;
last_frame_type = frame_type ;
last_mother_type = mother_type ;
last_sub_type = sub_type ;
last_error_code = error_code ;
}