@ -5,6 +5,7 @@ using Mesnac.DeviceAdapterNet;
using System ;
using System.Collections.Generic ;
using System.ComponentModel ;
using System.Linq ;
using System.Reflection ;
using System.Text ;
using System.Threading ;
@ -18,9 +19,9 @@ namespace Highway.Assemble.EquipClient
public Action < List < DeviceInfo > > EquipStateAction ;
public Action < int , List < TagInfo > > ReadDataAction ;
public Action < string , List < TagInfo > > ReadDataAction ;
public Action < int , List < TagInfo > > RecSendDataAction ;
public Action < string , List < TagInfo > > RecSendDataAction ;
public Action < int , int , int > RecGetDataAction ;
@ -61,7 +62,7 @@ namespace Highway.Assemble.EquipClient
for ( int i = 0 ; i < m_SensorInfoList . Count ; i + + )
{
AntInfo a = new AntInfo ( ) ;
a . m_iCombineId = Convert. ToInt32 ( m_SensorInfoList[ i ] . combineid ) ;
a . m_iCombineId = m_SensorInfoList[ i ] . combineid ;
AntList [ i ] = a ;
}
}
@ -213,7 +214,7 @@ namespace Highway.Assemble.EquipClient
item . m_ConnectState = 1 ;
break ;
case 2 :
item . m_ConnectState = 2 ;
item . m_ConnectState = 0 ;
item . m_IDeviceAdapter . Device_Destroy ( ) ;
break ;
default :
@ -249,11 +250,11 @@ namespace Highway.Assemble.EquipClient
/// <param name="sensorType"></param>
private void RecvIdentifyDataToMES_Instance ( ushort iLen , byte [ ] pData , byte Antenna , ushort iDeviceId , string strId , string sensorType )
{
uint iCombineId = 0 u ;
string iCombineId = "" ;
try
{
iCombineId = GetCombineIdByDeviceIdAndSer ( Antenna , iDeviceId , sensorType ) ;
if ( iCombineId ! = 0 )
if ( iCombineId ! = "" )
{
if ( iLen > 0 )
{
@ -267,14 +268,14 @@ namespace Highway.Assemble.EquipClient
LogInfo . Info ( "------------------------------------------------------------------------------------------------------" ) ;
LogInfo . Info ( "MES主动读取合并编号[" + iCombineId + "]的第[" + Antenna + "]号传感器自报数据: NoData" ) ;
LogInfo . Info ( "------------------------------------------------------------------------------------------------------" ) ;
ReadDataAction ? . Invoke ( Convert . ToInt32 ( iCombineId ) , null ) ;
//ReadDataAction?.Invoke(Convert.ToInt32(iCombineId), null) ;
}
}
}
catch ( Exception ex )
{
LogInfo . Info ( "RecvIdentifyDataToMES_Instance:" + ex . ToString ( ) ) ;
ReadDataAction ? . Invoke ( Convert . ToInt32 ( iCombineId ) , null ) ;
//ReadDataAction?.Invoke(Convert.ToInt32(iCombineId), null) ;
}
}
@ -285,20 +286,40 @@ namespace Highway.Assemble.EquipClient
/// <param name="iDeviceId">设备编号</param>
/// <param name="sensorType">传感器类型</param>
/// <returns></returns>
private uint GetCombineIdByDeviceIdAndSer ( byte iSensorSer , ushort iDeviceId , string sensorType )
private string GetCombineIdByDeviceIdAndSer ( byte iSensorSer , ushort iDeviceId , string sensorType )
{
uint iCombineId = 0 u ;
string iCombineId = "" ;
for ( int i = 0 ; i < m_SensorInfoList . Count ; i + + )
{
if ( iSensorSer = = Convert . ToUInt16 ( m_SensorInfoList [ i ] . sensorser ) & & iDeviceId = = Convert . ToUInt16 ( m_SensorInfoList [ i ] . deviceId ) & & sensorType = = m_SensorInfoList [ i ] . sensortypeid )
{
iCombineId = Convert. ToUInt32 ( m_SensorInfoList[ i ] . combineid ) ;
iCombineId = m_SensorInfoList[ i ] . combineid ;
break ;
}
}
return iCombineId ;
}
private string GetFilterDataByDeviceIdAndSer ( byte iSensorSer , UInt16 iDeviceId )
{
string FilterData = "" ;
for ( int i = 0 ; i < m_SensorInfoList . Count ; i + + )
{
if ( ( iSensorSer = = Convert . ToUInt16 ( m_SensorInfoList [ i ] . sensorser ) ) & & ( iDeviceId = = Convert . ToUInt16 ( m_SensorInfoList [ i ] . deviceId ) ) )
{
FilterData = m_SensorInfoList [ i ] . FilterData ;
break ;
}
}
return FilterData ;
}
private static List < TagInfo > FilterByEPCString ( List < TagInfo > tagList , string searchText )
{
return tagList
. Where ( tag = > tag . EPCstring ! = null & & tag . EPCstring . Contains ( searchText ) )
. ToList ( ) ;
}
/// <summary>
/// 监听自动上报后数据返回事件
/// </summary>
@ -310,11 +331,13 @@ namespace Highway.Assemble.EquipClient
/// <param name="sensorType">传感器类型</param>
public void RecvIdentifyData_Instance ( ushort iLen , List < TagInfo > tagInfos , byte Antenna , ushort iDeviceId , string strId , string sensorType )
{
uint iCombineId = 0 u ;
string iCombineId = "" ;
string FilterData = "" ;
try
{
iCombineId = GetCombineIdByDeviceIdAndSer ( Antenna , iDeviceId , sensorType ) ;
if ( iCombineId = = 0 )
FilterData = GetFilterDataByDeviceIdAndSer ( Antenna , iDeviceId ) ;
if ( iCombineId = = "" )
{
return ;
}
@ -329,8 +352,9 @@ namespace Highway.Assemble.EquipClient
// return;
//}
LogInfo . Info ( "------------------------------------------------------------------------------------------------------" ) ;
//LogInfo.Info("读写器自报合并编号[" + iCombineId + "]的第[" + Antenna + "]号传感器,自报数据:" + Encoding.ASCII.GetString(pData, 0, pData.Length) + ",原始数据:" + bytesToHexStr(pData, pData.Length)) ;
LogInfo . Info ( "读写器自报合并编号[" + iCombineId + "]的第[" + Antenna + "]号传感器,过滤规则[" + FilterData + "],自报数据:" + string . Join ( "," , tagInfos . Select ( item = > item . EPCstring ) ) ) ;
LogInfo . Info ( "------------------------------------------------------------------------------------------------------" ) ;
tagInfos = tagInfos . Where ( ( x , i ) = > tagInfos . FindIndex ( z = > z . EPCstring = = x . EPCstring ) = = i ) . ToList ( ) ;
AntInfo [ ] antList = AntList ;
foreach ( AntInfo item in antList )
{
@ -339,7 +363,11 @@ namespace Highway.Assemble.EquipClient
item . IsReading = false ;
item . ReadData = new byte [ tagInfos [ 0 ] . EPC . Length ] ;
Array . Copy ( tagInfos [ 0 ] . EPC , 0 , item . ReadData , 0 , tagInfos [ 0 ] . EPC . Length ) ;
RecSendDataAction ? . Invoke ( Convert . ToInt32 ( iCombineId ) , tagInfos ) ;
if ( ! string . IsNullOrEmpty ( FilterData ) )
{
tagInfos = FilterByEPCString ( tagInfos , FilterData ) ;
}
RecSendDataAction ? . Invoke ( iCombineId , tagInfos ) ;
}
}
}
@ -348,7 +376,7 @@ namespace Highway.Assemble.EquipClient
LogInfo . Info ( "------------------------------------------------------------------------------------------------------" ) ;
LogInfo . Info ( "自报合并编号[" + iCombineId + "]的第[" + Antenna + "]号传感器自报数据: NoData" ) ;
LogInfo . Info ( "------------------------------------------------------------------------------------------------------" ) ;
RecSendDataAction ? . Invoke ( Convert. ToInt32 ( iCombineId) , null ) ;
RecSendDataAction ? . Invoke ( iCombineId, null ) ;
}
}
catch ( Exception ex )
@ -356,7 +384,7 @@ namespace Highway.Assemble.EquipClient
LogInfo . Info ( "空间名:" + ex . Source + "; \n方法名: " + ex . TargetSite ? . ToString ( ) + "\n故障点: " + ex . StackTrace . Substring ( ex . StackTrace . LastIndexOf ( "\\" ) + 1 , ex . StackTrace . Length - ex . StackTrace . LastIndexOf ( "\\" ) - 1 ) + "\n错误提示: " + ex . Message ) ;
if ( iLen = = 0 )
{
Rec Auto DataAction? . Invoke ( Convert. ToInt32 ( iCombineId) , null ) ;
Rec Send DataAction? . Invoke ( iCombineId, null ) ;
}
}
}
@ -394,7 +422,7 @@ namespace Highway.Assemble.EquipClient
try
{
LogInfo . Info ( "接收到MES主动读取数据命令, 合并编号: " + num ) ;
pDeviceInfo = GetIDeviceInfoByCombineId ( Convert . ToUInt32 ( num ) ) ;
//pDeviceInfo = GetIDeviceInfoByCombineId(Convert.ToUInt32(num)) ;
pSensorInfo = GetSensorInfoByCombineId ( Convert . ToUInt32 ( num ) ) ;
if ( pDeviceInfo . m_IDeviceAdapter ! = null )
{
@ -410,19 +438,19 @@ namespace Highway.Assemble.EquipClient
LogInfo . Info ( "------------------------------------------------------------------------------------------------------" ) ;
LogInfo . Info ( "MES主动读取数据成功, 合并编号: [" + num + "],读取数据:NoData" ) ;
LogInfo . Info ( "------------------------------------------------------------------------------------------------------" ) ;
ReadDataAction ? . Invoke ( num , null ) ;
//ReadDataAction?.Invoke(num, null) ;
}
}
else
{
LogInfo . Info ( "MES主动读取失败, 合并编号: " + num ) ;
ReadDataAction ? . Invoke ( num , null ) ;
//ReadDataAction?.Invoke(num, null) ;
}
}
catch ( Exception ex )
{
LogInfo . Info ( "MES主动读取异常:" + ex . ToString ( ) ) ;
ReadDataAction ? . Invoke ( num , null ) ;
//ReadDataAction?.Invoke(num, null) ;
}
}
@ -448,12 +476,12 @@ namespace Highway.Assemble.EquipClient
/// </summary>
/// <param name="iCombineId">传感器编号</param>
/// <returns>设备信息</returns>
private DeviceInfo GetIDeviceInfoByCombineId ( uint iCombineId )
private DeviceInfo GetIDeviceInfoByCombineId ( string iCombineId )
{
DeviceInfo pDeviceInfo = null ;
for ( int i = 0 ; i < m_SensorInfoList . Count ; i + + )
{
if ( iCombineId = = Convert. ToUInt32 ( m_SensorInfoList[ i ] . combineid ) )
if ( iCombineId = = m_SensorInfoList[ i ] . combineid )
{
pDeviceInfo = GetDeviceInfoByDeviceId ( Convert . ToUInt16 ( m_SensorInfoList [ i ] . deviceId ) ) ;
if ( pDeviceInfo ! = null )
@ -525,7 +553,7 @@ namespace Highway.Assemble.EquipClient
LogInfo . Info ( "方法: WriteData, 接收合并编号[" + num + "]的第[" + Antenna + "]路IO, 打开报警灯闪亮命令" ) ;
break ;
}
pDeviceInfo = GetIDeviceInfoByCombineId ( Convert . ToUInt32 ( num ) ) ;
//pDeviceInfo = GetIDeviceInfoByCombineId(Convert.ToUInt32(num)) ;
pSensorInfo = GetSensorInfoByCombineId ( Convert . ToUInt32 ( num ) ) ;
try
{
@ -558,7 +586,7 @@ namespace Highway.Assemble.EquipClient
byte [ ] array = null ;
try
{
LogInfo . Info ( "合并编号:" + id + ",识别单次标签命令自报" ) ;
//LogInfo.Info("合并编号:" + id + ",识别单次标签命令自报") ;
//array = GetOneEpcByCombineId(Convert.ToUInt32(id));
if ( array ! = null )
{
@ -572,35 +600,42 @@ namespace Highway.Assemble.EquipClient
LogInfo . Info ( "------------------------------------------------------------------------------------------------------" ) ;
LogInfo . Info ( "识别单次标签成功,合并编号[" + id + "], 读取标签数据: NoData" ) ;
LogInfo . Info ( "------------------------------------------------------------------------------------------------------" ) ;
ReadDataAction ? . Invoke ( id , null ) ;
//ReadDataAction?.Invoke(id, null) ;
}
}
catch ( Exception ex )
{
LogInfo . Info ( "Deal_IdentifyOneEpc异常:" + ex . ToString ( ) ) ;
ReadDataAction ? . Invoke ( id , null ) ;
//ReadDataAction?.Invoke(id, null) ;
}
} ) ;
}
public void ReadRFID ( int id , out List < TagInfo > rfiddata )
public List < TagInfo > ReadRFID( string id )
{
List < TagInfo > tags = new List < TagInfo > ( ) ;
byte [ ] array = null ;
rfiddata = null ;
string FilterData = "" ;
try
{
LogInfo . Info ( "合并编号:" + id + ",识别单次标签命令自报" ) ;
tags = GetOneEpcByCombineId ( Convert . ToUInt32 ( id ) ) ;
//LogInfo.Info("合并编号:" + id + ",识别单次标签命令自报");
FilterData = m_SensorInfoList . Find ( x = > x . combineid = = id ) . FilterData ;
tags = GetOneEpcByCombineId ( id ) ;
if ( tags ! = null )
{
//LogInfo.Info("-------------------------------------------------------------------------------------------------------------");
//LogInfo.Info("识别单次标签成功,合并编号[" + id + "],读取标签数据:" + Encoding.ASCII.GetString(array, 0, array.Length) + ",原始数据:" + bytesToHexStr(array, array.Length));
//LogInfo.Info("-------------------------------------------------------------------------------------------------------------");
//rfiddata = Encoding.ASCII.GetString(array, 0, array.Length);
rfiddata = tags ;
//有过滤
LogInfo . Info ( "-------------------------------------------------------------------------------------------------------------" ) ;
LogInfo . Info ( "识别单次标签成功,合并编号[" + id + "],过滤规则[" + FilterData + "],读取标签数据:" + string . Join ( "," , tags . Select ( item = > item . EPCstring ) ) ) ;
LogInfo . Info ( "-------------------------------------------------------------------------------------------------------------" ) ;
tags = tags . Where ( ( x , i ) = > tags . FindIndex ( z = > z . EPCstring = = x . EPCstring ) = = i ) . ToList ( ) ;
//新增工位过滤
if ( ! string . IsNullOrEmpty ( FilterData ) )
{
tags = FilterByEPCString ( tags , FilterData ) ;
}
ReadDataAction ? . Invoke ( id , tags ) ;
return tags ;
}
else
@ -609,12 +644,14 @@ namespace Highway.Assemble.EquipClient
LogInfo . Info ( "识别单次标签成功,合并编号[" + id + "], 读取标签数据: NoData" ) ;
LogInfo . Info ( "------------------------------------------------------------------------------------------------------" ) ;
ReadDataAction ? . Invoke ( id , null ) ;
return tags ;
}
}
catch ( Exception ex )
{
LogInfo . Info ( " Deal_IdentifyOneEpc 异常:" + ex . ToString ( ) ) ;
LogInfo . Info ( " 异常:" + ex . ToString ( ) ) ;
ReadDataAction ? . Invoke ( id , null ) ;
return tags ;
}
}
@ -624,24 +661,31 @@ namespace Highway.Assemble.EquipClient
/// </summary>
/// <param name="iCombineId">传感器编号</param>
/// <returns>原始数据</returns>
private List < TagInfo > GetOneEpcByCombineId ( uint iCombineId )
private List < TagInfo > GetOneEpcByCombineId ( string iCombineId )
{
List < TagInfo > tagInfos = null ;
byte [ ] pReturnResult = null ;
IDeviceAdapter pDeviceAdapter = null ;
byte iEpcLen = 0 ;
for ( int i = 0 ; i < m_SensorInfoList . Count ; i + + )
{
if ( iCombineId ! = Convert. ToUInt32 ( m_SensorInfoList[ i ] . combineid ) )
if ( iCombineId ! = m_SensorInfoList[ i ] . combineid )
{
continue ;
}
pDeviceAdapter = GetDeviceAdapterByDeviceId ( Convert . ToUInt16 ( m_SensorInfoList [ i ] . deviceId ) ) ;
if ( pDeviceAdapter ! = null )
{
tagInfos = pDeviceAdapter . Device_GetAllIdentifyData ( Convert . ToByte ( m_SensorInfoList [ i ] . sensorser ) , Convert . ToUInt16 ( m_SensorInfoList [ i ] . DelayTime ) , 1 ) ;
if ( string . IsNullOrEmpty ( m_SensorInfoList [ i ] . readInterval ) )
{
m_SensorInfoList [ i ] . readInterval = "1000" ;
}
tagInfos = pDeviceAdapter . Device_GetAllIdentifyData ( Convert . ToByte ( m_SensorInfoList [ i ] . sensorser ) , Convert . ToUInt16 ( m_SensorInfoList [ i ] . readInterval ) , 1 ) ;
if ( tagInfos . Count > 0 )
{
//新增工位过滤
//if (!string.IsNullOrEmpty(m_SensorInfoList[i].FilterData))
//{
// tagInfos = FilterByEPCString(tagInfos, m_SensorInfoList[i].FilterData);
//}
return tagInfos ;
}
return null ;
@ -683,12 +727,12 @@ namespace Highway.Assemble.EquipClient
RecGetDataAction = action ;
}
public void RecSendData ( Action < int , List < TagInfo > > action )
public void RecSendData ( Action < string , List < TagInfo > > action )
{
RecSendDataAction = action ;
}
public void RetReadData ( Action < int , List < TagInfo > > action )
public void RetReadData ( Action < string , List < TagInfo > > action )
{
ReadDataAction = action ;
}
@ -706,7 +750,7 @@ namespace Highway.Assemble.EquipClient
/// 根据传感器合并编号处理数据
/// </summary>
/// <param name="num">传感器合并编号</param>
private void Deal_Data ( int num )
private void Deal_Data ( string num )
{
AntInfo [ ] antList = AntList ;
foreach ( AntInfo item in antList )
@ -737,12 +781,12 @@ namespace Highway.Assemble.EquipClient
/// 开始连续盘点
/// </summary>
/// <param name="num">传感器合并编号</param>
public void Device_BeginIdentify ( int num )
public void Device_BeginIdentify ( string num )
{
bool bResult = false ;
DeviceInfo pDeviceInfo = null ;
Sensor pSensorInfo = null ;
pDeviceInfo = GetIDeviceInfoByCombineId ( Convert . ToUInt32 ( num ) ) ;
//pDeviceInfo = GetIDeviceInfoByCombineId(Convert.ToUInt32(num)) ;
pSensorInfo = GetSensorInfoByCombineId ( Convert . ToUInt32 ( num ) ) ;
AntInfo [ ] antList = AntList ;
foreach ( AntInfo item in antList )
@ -762,13 +806,13 @@ namespace Highway.Assemble.EquipClient
{
if ( pDeviceInfo . m_IDeviceAdapter ! = null )
{
bResult = pDeviceInfo . m_IDeviceAdapter . Device_BeginIdentify ( Convert . ToByte ( pSensorInfo . sensorser ) , Convert . ToInt32 ( pSensorInfo . timeout ) , AutoRead : true , num ) ;
//bResult = pDeviceInfo.m_IDeviceAdapter.Device_BeginIdentify(Convert.ToByte(pSensorInfo.sensorser), Convert.ToInt32(pSensorInfo.timeout), AutoRead: true, num) ;
if ( ! bResult )
{
bResult = pDeviceInfo . m_IDeviceAdapter . Device_BeginIdentify ( Convert . ToByte ( pSensorInfo . sensorser ) , Convert . ToInt32 ( pSensorInfo . timeout ) , AutoRead : true , num ) ;
//bResult = pDeviceInfo.m_IDeviceAdapter.Device_BeginIdentify(Convert.ToByte(pSensorInfo.sensorser), Convert.ToInt32(pSensorInfo.timeout), AutoRead: true, num) ;
if ( ! bResult )
{
bResult = pDeviceInfo . m_IDeviceAdapter . Device_BeginIdentify ( Convert . ToByte ( pSensorInfo . sensorser ) , Convert . ToInt32 ( pSensorInfo . timeout ) , AutoRead : true , num ) ;
//bResult = pDeviceInfo.m_IDeviceAdapter.Device_BeginIdentify(Convert.ToByte(pSensorInfo.sensorser), Convert.ToInt32(pSensorInfo.timeout), AutoRead: true, num) ;
}
}
Thread . Sleep ( 1 ) ;
@ -782,7 +826,7 @@ namespace Highway.Assemble.EquipClient
{
item2 . IsReading = false ;
item2 . readType = 0 ;
DealNoData ( num , v : true ) ;
//DealNoData(num, v: true) ;
item2 . ReadData = null ;
}
}
@ -815,12 +859,12 @@ namespace Highway.Assemble.EquipClient
if ( v )
{
LogInfo . Info ( "》》》触发读取时间超时, 返回Nodata, 合并编号: " + num ) ;
RecSendDataAction ? . Invoke ( Convert . ToInt32 ( num ) , null ) ;
//RecSendDataAction?.Invoke(Convert.ToInt32(num), null) ;
}
else
{
LogInfo . Info ( "》》》MES主动读取时间超时, 返回Nodata, 合并编号: " + num ) ;
ReadDataAction ? . Invoke ( Convert . ToInt32 ( num ) , null ) ;
//ReadDataAction?.Invoke(Convert.ToInt32(num), null) ;
}
Device_StopIdentify ( num ) ;
if ( ! Device_StopIdentify ( num ) )
@ -842,7 +886,7 @@ namespace Highway.Assemble.EquipClient
bool bResult = false ;
DeviceInfo pDeviceInfo = null ;
Sensor pSensorInfo = null ;
pDeviceInfo = GetIDeviceInfoByCombineId ( Convert . ToUInt32 ( num ) ) ;
//pDeviceInfo = GetIDeviceInfoByCombineId(num) ;
pSensorInfo = GetSensorInfoByCombineId ( Convert . ToUInt32 ( num ) ) ;
LogInfo . Info ( "合并编号:" + num + ",发送停止连续读取标签命令自报" ) ;
try
@ -871,14 +915,14 @@ namespace Highway.Assemble.EquipClient
/// </summary>
/// <param name="num">传感器合并编号</param>
/// <returns></returns>
public async Task Device_MESBeginIdentify ( int num )
public async Task Device_MESBeginIdentify ( string num )
{
await Task . Run ( delegate
{
bool flag = false ;
DeviceInfo deviceInfo = null ;
Sensor sensor = null ;
deviceInfo = GetIDeviceInfoByCombineId ( Convert. ToUInt32 ( num) ) ;
deviceInfo = GetIDeviceInfoByCombineId ( num) ;
sensor = GetSensorInfoByCombineId ( Convert . ToUInt32 ( num ) ) ;
LogInfo . Info ( "合并编号:" + num + ",MES主动发送连续读取标签命令" ) ;
AntInfo [ ] antList = AntList ;
@ -899,7 +943,7 @@ namespace Highway.Assemble.EquipClient
{
if ( deviceInfo . m_IDeviceAdapter ! = null )
{
flag = deviceInfo . m_IDeviceAdapter . Device_BeginIdentify ( Convert . ToByte ( sensor . sensorser ) , Convert . ToInt32 ( sensor . timeout ) , AutoRead : false , num ) ;
//flag = deviceInfo.m_IDeviceAdapter.Device_BeginIdentify(Convert.ToByte(sensor.sensorser), Convert.ToInt32(sensor.timeout), AutoRead: false, num) ;
AntInfo [ ] antList2 = AntList ;
foreach ( AntInfo item in antList2 )
{
@ -909,7 +953,7 @@ namespace Highway.Assemble.EquipClient
} ) . Wait ( Convert . ToInt32 ( sensor . timeout ) ) )
{
item . IsReading = false ;
DealNoData ( num , v : false ) ;
//DealNoData(num, v: false) ;
item . ReadData = null ;
}
}
@ -951,25 +995,25 @@ namespace Highway.Assemble.EquipClient
LogInfo . Info ( "------------------------------------------------------------------------------------------------------" ) ;
LogInfo . Info ( "识别单次标签成功,合并编号[" + id + "], 读取标签数据: NoData" ) ;
LogInfo . Info ( "------------------------------------------------------------------------------------------------------" ) ;
ReadDataAction ? . Invoke ( id , null ) ;
//ReadDataAction?.Invoke(id, null) ;
}
}
catch ( Exception ex )
{
LogInfo . Info ( "Deal_IdentifyOneEpc异常:" + ex . ToString ( ) ) ;
ReadDataAction ? . Invoke ( id , null ) ;
//ReadDataAction?.Invoke(id, null) ;
}
return m_data ;
}
public void WriteAlarmLight ( int num , string code )
public void WriteAlarmLight ( string num , string code )
{
bool flag = false ;
try
{
DeviceInfo deviceInfo = null ;
//Sensor sensor = null;
deviceInfo = GetIDeviceInfoByCombineId ( Convert. ToUInt32 ( num) ) ;
deviceInfo = GetIDeviceInfoByCombineId ( num) ;
//sensor = GetSensorInfoByCombineId(Convert.ToUInt32(num));
if ( deviceInfo . m_IDeviceAdapter ! = null )
{