You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
412 lines
13 KiB
412 lines
13 KiB
3 months ago
|
using System;
|
||
|
using System.Collections.Generic;
|
||
|
using DBFactory;
|
||
|
using System.Text;
|
||
|
namespace CommonLib
|
||
|
{
|
||
|
using System;
|
||
|
using System.Data;
|
||
|
using System.ComponentModel;
|
||
|
/// <summary>
|
||
|
/// 20110405�Զ���������ͼ�仯�¼�
|
||
|
/// </summary>
|
||
|
public class CDataChangeEventArgs : EventArgs
|
||
|
{
|
||
|
#region ���ݸ����¼�
|
||
|
private readonly DataView _manDataSource;
|
||
|
|
||
|
public DataView ManDataSource
|
||
|
{
|
||
|
get { return _manDataSource; }
|
||
|
}
|
||
|
|
||
|
private readonly DataView _monDataSource;
|
||
|
|
||
|
public DataView MonDataSource
|
||
|
{
|
||
|
get { return _monDataSource; }
|
||
|
}
|
||
|
|
||
|
public CDataChangeEventArgs(DataView manDataSource,DataView monDataSource)
|
||
|
{
|
||
|
this._manDataSource = manDataSource;
|
||
|
this._monDataSource = monDataSource;
|
||
|
}
|
||
|
#endregion
|
||
|
|
||
|
}
|
||
|
public class CDeviceStateChangeEventArgs : EventArgs
|
||
|
{
|
||
|
#region �豸״̬���ݸ����¼�
|
||
|
Model.MDevice _devinfo;
|
||
|
|
||
|
public Model.MDevice Devinfo
|
||
|
{
|
||
|
get { return _devinfo; }
|
||
|
set { _devinfo = value; }
|
||
|
}
|
||
|
|
||
|
public CDeviceStateChangeEventArgs(Model.MDevice devinfo)
|
||
|
{
|
||
|
this._devinfo = devinfo;
|
||
|
}
|
||
|
#endregion
|
||
|
|
||
|
}
|
||
|
/// <summary>
|
||
|
/// 20110608�Զ����������ݿ��ı仯�¼���ִ��SQL���������ɣ�
|
||
|
/// </summary>
|
||
|
public class CUpdateDBChangeEventArgs : EventArgs
|
||
|
{
|
||
|
|
||
|
#region ���ݿ������¼���ִ��SQL���������ɣ�
|
||
|
private readonly int _taskindex=-1;
|
||
|
|
||
|
public int Taskindex
|
||
|
{
|
||
|
get { return _taskindex; }
|
||
|
}
|
||
|
private readonly int _deviceindex = -1;
|
||
|
|
||
|
public int Deviceindex
|
||
|
{
|
||
|
get { return _deviceindex; }
|
||
|
}
|
||
|
|
||
|
private readonly int _taskstate = -1;
|
||
|
/// <summary>
|
||
|
/// ����ִ��״̬��0���У�1���У�2�������� ������30����
|
||
|
/// </summary>
|
||
|
public int Taskstate
|
||
|
{
|
||
|
get { return _taskstate; }
|
||
|
}
|
||
|
|
||
|
/// <summary>
|
||
|
/// ���翪�ر����ֵ��ֽ�ֵ
|
||
|
/// </summary>
|
||
|
private readonly byte[] _splitbyteValue ;
|
||
|
/// <summary>
|
||
|
/// ����
|
||
|
/// </summary>
|
||
|
public byte[] SplitbyteValue
|
||
|
{
|
||
|
get { return _splitbyteValue; }
|
||
|
}
|
||
|
private readonly DBFactory.DBOperator _dbo;
|
||
|
|
||
|
public DBFactory.DBOperator Dbo
|
||
|
{
|
||
|
get { return _dbo; }
|
||
|
}
|
||
|
|
||
|
|
||
|
private readonly byte[] _devicestates;
|
||
|
public byte[] Devicestates
|
||
|
{
|
||
|
get { return _devicestates; }
|
||
|
}
|
||
|
private readonly StringBuilder _exeSQL = new StringBuilder();
|
||
|
public StringBuilder ExeSQL
|
||
|
{
|
||
|
get { return _exeSQL; }
|
||
|
}
|
||
|
private readonly StringBuilder[] _exeSQLArray;
|
||
|
public StringBuilder[] ExeSQLArray
|
||
|
{
|
||
|
get { return _exeSQLArray; }
|
||
|
}
|
||
|
private readonly StringBuilder[] _DBFactoryArray;
|
||
|
public StringBuilder[] DBFactoryArray
|
||
|
{
|
||
|
get { return _DBFactoryArray; }
|
||
|
}
|
||
|
private readonly DBFactory.DBOperator[] _dboArray;
|
||
|
public DBFactory.DBOperator[] DboArray
|
||
|
{
|
||
|
get { return _dboArray; }
|
||
|
}
|
||
|
/// <summary>
|
||
|
/// һ��������һ�������鷢�����б�ǩ�ĸ���
|
||
|
|
||
|
/// <summary>
|
||
|
/// ÿ������������Ӧ�豸���ͱ�ǩ���Ƽ���
|
||
|
/// </summary>
|
||
|
public StringBuilder[] OPCItemNamesDicInfo { get => _oPCItemNamesDicInfo; set => _oPCItemNamesDicInfo = value; }
|
||
|
/// <summary>
|
||
|
/// ÿ������������Ӧ�豸���ͱ�ǩ��ֵ����
|
||
|
/// </summary>
|
||
|
public StringBuilder[] OPCItemValuesDicInfo { get => _oPCItemValuesDicInfo; set => _oPCItemValuesDicInfo = value; }
|
||
|
/// <summary>
|
||
|
/// ���ص��ڴ��е��豸����״̬��Ϣ���ϣ�key�豸�ţ�Value���ݣ�ָ������,״̬,��������/������,����,���߸߶�/����,����;
|
||
|
/// ״̬(0���У�1���У�2���ɣ�30���Ϲ���)
|
||
|
/// </summary>
|
||
|
public StringBuilder[]DeviceStateInfos { get => _deviceStateInfos; set => _deviceStateInfos = value; }
|
||
|
|
||
|
/// <summary>
|
||
|
/// һ��������һ�������鷢�����б�ǩ�ĸ���
|
||
|
/// </summary>
|
||
|
int _opcSubsTagCount ;
|
||
|
/// <summary>
|
||
|
/// ÿ������������Ӧ�豸���ͱ�ǩ���Ƽ���
|
||
|
/// </summary>
|
||
|
StringBuilder[] _oPCItemNamesDicInfo ;
|
||
|
|
||
|
/// <summary>
|
||
|
/// ÿ������������Ӧ�豸���ͱ�ǩ��ֵ����
|
||
|
/// </summary>
|
||
|
StringBuilder[] _oPCItemValuesDicInfo ;
|
||
|
/// <summary>
|
||
|
/// ���ص��ڴ��е��豸����״̬��Ϣ���ϣ�key�豸�ţ�Value���ݣ�ָ������,״̬,��������/������,����,���߸߶�/����,����;
|
||
|
/// ״̬(0���У�1���У�2���ɣ�30���Ϲ���)
|
||
|
/// </summary>
|
||
|
static StringBuilder[] _deviceStateInfos ;
|
||
|
|
||
|
public CUpdateDBChangeEventArgs(DBFactory.DBOperator dbo, StringBuilder exeSQL)
|
||
|
{
|
||
|
_dbo = dbo;
|
||
|
_exeSQL = exeSQL;
|
||
|
}
|
||
|
/// <summary>
|
||
|
///
|
||
|
/// </summary>
|
||
|
/// <param name="dbFactoryArray">sql������Ӧ�����ݿ��ֵ��"DBFactory"����"ManDBFactory"</param>
|
||
|
/// <param name="exeSQLArray">sql��������</param>
|
||
|
public CUpdateDBChangeEventArgs(StringBuilder[] dbFactoryArray, StringBuilder[] exeSQLArray)
|
||
|
{
|
||
|
_DBFactoryArray = dbFactoryArray;
|
||
|
_exeSQLArray = exeSQLArray;
|
||
|
}
|
||
|
/// <summary>
|
||
|
///
|
||
|
/// </summary>
|
||
|
/// <param name="deviceindex">�豸����</param>
|
||
|
/// <param name="taskindex">�豸ָ������</param>
|
||
|
/// <param name="taskstate">����ִ��״̬��0���У�1���У�2�������� ������30����</param>
|
||
|
public CUpdateDBChangeEventArgs(int deviceindex, int taskindex, int taskstate)
|
||
|
{
|
||
|
_deviceindex = deviceindex;
|
||
|
_taskindex = taskindex;
|
||
|
_taskstate = taskstate;//richard.liu20181205ԭ��һֱ��taskindex
|
||
|
}
|
||
|
/// <summary>
|
||
|
///
|
||
|
/// </summary>
|
||
|
/// <param name="deviceindex">�豸����</param>
|
||
|
/// <param name="taskindex">�豸ָ������</param>
|
||
|
/// <param name="taskstate">����ִ��״̬��0���У�1���У�2�������� ������30����</param>
|
||
|
/// <param name="xCoor">X����</param>
|
||
|
/// <param name="yCoor">Y����</param>
|
||
|
public CUpdateDBChangeEventArgs(int deviceindex,byte[] splitbyteValue,byte[] devicestates)
|
||
|
{
|
||
|
|
||
|
_deviceindex = deviceindex;
|
||
|
_splitbyteValue = splitbyteValue;
|
||
|
_devicestates = devicestates;
|
||
|
}
|
||
|
|
||
|
public CUpdateDBChangeEventArgs(int deviceindex, StringBuilder[] deviceStateInfos, StringBuilder[] oPCItemNamesDicInfo, StringBuilder[] oPCItemValuesDicInfo)
|
||
|
{
|
||
|
_deviceindex = deviceindex;
|
||
|
_deviceStateInfos = deviceStateInfos;
|
||
|
|
||
|
_oPCItemNamesDicInfo = oPCItemNamesDicInfo;
|
||
|
_oPCItemValuesDicInfo = oPCItemValuesDicInfo;
|
||
|
}
|
||
|
|
||
|
public CUpdateDBChangeEventArgs()
|
||
|
{
|
||
|
}
|
||
|
#endregion
|
||
|
}
|
||
|
public class CStringInfoEventArgs : EventArgs
|
||
|
{
|
||
|
|
||
|
private int _deviceindex;
|
||
|
|
||
|
public int Deviceindex
|
||
|
{
|
||
|
get { return _deviceindex; }
|
||
|
set { _deviceindex = value; }
|
||
|
}
|
||
|
private string _barcode;
|
||
|
|
||
|
public string Barcode
|
||
|
{
|
||
|
get { return _barcode; }
|
||
|
set { _barcode = value; }
|
||
|
}
|
||
|
private int _confirm;
|
||
|
|
||
|
public int Confirm
|
||
|
{
|
||
|
get { return _confirm; }
|
||
|
set { _confirm = value; }
|
||
|
}
|
||
|
public CStringInfoEventArgs(int deviceindex, string barcode, int confirm)
|
||
|
{
|
||
|
_deviceindex = deviceindex;
|
||
|
_barcode = barcode;
|
||
|
_confirm = confirm;
|
||
|
}
|
||
|
}
|
||
|
public class CWriteDarkCasketEventArgs : EventArgs
|
||
|
{//20121108
|
||
|
private string _wrnamespace;
|
||
|
|
||
|
public string Wrnamespace
|
||
|
{
|
||
|
get { return _wrnamespace; }
|
||
|
set { _wrnamespace = value; }
|
||
|
}
|
||
|
private string _wrmethod;
|
||
|
|
||
|
public string Wrmethod
|
||
|
{
|
||
|
get { return _wrmethod; }
|
||
|
set { _wrmethod = value; }
|
||
|
}
|
||
|
private string _wrkeyRemark;
|
||
|
|
||
|
public string WrkeyRemark
|
||
|
{
|
||
|
get { return _wrkeyRemark; }
|
||
|
set { _wrkeyRemark = value; }
|
||
|
}
|
||
|
private string _wrdevice;
|
||
|
|
||
|
public string Wrdevice
|
||
|
{
|
||
|
get { return _wrdevice; }
|
||
|
set { _wrdevice = value; }
|
||
|
}
|
||
|
private int[] _wrinfo;
|
||
|
|
||
|
public int[] Wrinfo
|
||
|
{
|
||
|
get { return _wrinfo; }
|
||
|
set { _wrinfo = value; }
|
||
|
}
|
||
|
public CWriteDarkCasketEventArgs(string wrnamespace, string wrmethod,string wrdevice, string wrkeyRemark, int[] wrinfo)
|
||
|
{
|
||
|
_wrnamespace = wrnamespace;
|
||
|
_wrmethod = wrmethod;
|
||
|
_wrdevice = wrdevice;
|
||
|
_wrkeyRemark = wrkeyRemark;
|
||
|
_wrinfo = wrinfo;
|
||
|
}
|
||
|
|
||
|
public CWriteDarkCasketEventArgs(string wrnamespace, string wrmethod, string wrdevice, string wrkeyRemark, byte[] wrinfo)
|
||
|
{
|
||
|
_wrnamespace = wrnamespace;
|
||
|
_wrmethod = wrmethod;
|
||
|
_wrdevice = wrdevice;
|
||
|
_wrkeyRemark = wrkeyRemark;
|
||
|
_wrinfo = new int[wrinfo.Length];
|
||
|
Array.Copy(wrinfo, _wrinfo, wrinfo.Length);
|
||
|
}
|
||
|
}
|
||
|
public class CSendDeviceOrderEventArgs : EventArgs
|
||
|
{//20121108
|
||
|
private int _deviceindex;
|
||
|
|
||
|
public int Deviceindex
|
||
|
{
|
||
|
get { return _deviceindex; }
|
||
|
set { _deviceindex = value; }
|
||
|
}
|
||
|
private string _remoteIP;
|
||
|
|
||
|
public string RemoteIP
|
||
|
{
|
||
|
get { return _remoteIP; }
|
||
|
set { _remoteIP = value; }
|
||
|
}
|
||
|
private int _remotePort;
|
||
|
|
||
|
public int RemotePort
|
||
|
{
|
||
|
get { return _remotePort; }
|
||
|
set { _remotePort = value; }
|
||
|
}
|
||
|
|
||
|
private byte[] _sendrinfo;
|
||
|
|
||
|
public byte[] Sendrinfo
|
||
|
{
|
||
|
get { return _sendrinfo; }
|
||
|
set { _sendrinfo = value; }
|
||
|
}
|
||
|
private string _dBBlock;
|
||
|
|
||
|
public string DBBlock
|
||
|
{
|
||
|
get { return _dBBlock; }
|
||
|
set { _dBBlock = value; }
|
||
|
}
|
||
|
private string _writeData;
|
||
|
|
||
|
public string WriteData
|
||
|
{
|
||
|
get { return _writeData; }
|
||
|
set { _writeData = value; }
|
||
|
}
|
||
|
private StringBuilder[] _opcItemNamesDicInfo;
|
||
|
public StringBuilder[] OpcItemNamesDicInfo
|
||
|
{
|
||
|
get { return _opcItemNamesDicInfo; }
|
||
|
set { _opcItemNamesDicInfo = value; }
|
||
|
}
|
||
|
private StringBuilder[] _opcItemValuesDicInfo;
|
||
|
public StringBuilder[] OpcItemValuesDicInfo
|
||
|
{
|
||
|
get { return _opcItemValuesDicInfo; }
|
||
|
set { _opcItemValuesDicInfo = value; }
|
||
|
}
|
||
|
private int[] _deviceArray;
|
||
|
public int[] DeviceArray
|
||
|
{
|
||
|
get { return _deviceArray; }
|
||
|
set { _deviceArray = value; }
|
||
|
}
|
||
|
private int[] _sendDataArray;
|
||
|
public int[] SendDataArray
|
||
|
{
|
||
|
get { return _sendDataArray; }
|
||
|
set { _sendDataArray = value; }
|
||
|
}
|
||
|
|
||
|
public CSendDeviceOrderEventArgs(int deviceindex, string remoteIP, int remotePort, byte[] sendrinfo)
|
||
|
{
|
||
|
_deviceindex = deviceindex;
|
||
|
_remoteIP = remoteIP;
|
||
|
_remotePort = remotePort;
|
||
|
_sendrinfo = sendrinfo;
|
||
|
}
|
||
|
public CSendDeviceOrderEventArgs(int deviceIndex, string dBBlock, string writeData)
|
||
|
{
|
||
|
_deviceindex = deviceIndex;
|
||
|
_dBBlock = dBBlock;
|
||
|
_writeData = writeData;
|
||
|
|
||
|
}
|
||
|
public CSendDeviceOrderEventArgs(int S7FirstDevice, StringBuilder[] opcItemNamesDicInfo, StringBuilder[] opcItemValuesDicInfo)
|
||
|
{
|
||
|
_deviceindex = S7FirstDevice;
|
||
|
_opcItemNamesDicInfo = opcItemNamesDicInfo;
|
||
|
_opcItemValuesDicInfo = opcItemValuesDicInfo;
|
||
|
}
|
||
|
public CSendDeviceOrderEventArgs(int[] deviceArray, int[] sendDataArray)
|
||
|
{
|
||
|
_deviceArray = deviceArray;
|
||
|
_sendDataArray = sendDataArray;
|
||
|
}
|
||
|
}
|
||
|
public delegate void CWriteDarkCasketEventHandler(object sender, CWriteDarkCasketEventArgs e);//20121108
|
||
|
public delegate void CSendDeviceOrderEventHandler(object sender, CSendDeviceOrderEventArgs e);//20121108
|
||
|
public delegate void CDataSourceChangeEventHandler(object sender, CDataChangeEventArgs e);
|
||
|
public delegate void CUpdateDBEventHandler(object sender, CUpdateDBChangeEventArgs e);
|
||
|
public delegate void CDeviceStateChangeEventHandler(object sender,CDeviceStateChangeEventArgs e);
|
||
|
public delegate void CStringInfoEventHandler(object sender,CStringInfoEventArgs e);
|
||
|
}
|