|
|
@@ -16,21 +16,23 @@ namespace BPA.SingleDevice.Business |
|
|
|
{ |
|
|
|
string IpAddress { get; set; } |
|
|
|
EDeviceType DeviceType { get; set; } |
|
|
|
int Port { get; set; } |
|
|
|
public Action<EDeviceType> Complete { get; set; } |
|
|
|
ModbusTcp mt { get; set; } = new ModbusTcp(); |
|
|
|
public Action<int> ArrivalFingerPos { get; set; } |
|
|
|
public bool AllowBatching { get; set; } |
|
|
|
public bool[] DeviceStationDetection { get; set; } = new bool[4]; |
|
|
|
|
|
|
|
public void SetPar(string ip, EDeviceType deviceType) |
|
|
|
public void SetPar(string ip, EDeviceType deviceType, int port = 502) |
|
|
|
{ |
|
|
|
IpAddress = ip; |
|
|
|
DeviceType = deviceType; |
|
|
|
Port = port; |
|
|
|
} |
|
|
|
|
|
|
|
public void Start() |
|
|
|
{ |
|
|
|
mt.WithModbusTcp(IpAddress).UseConnected(() => |
|
|
|
mt.WithModbusTcp(IpAddress, Port).UseConnected(() => |
|
|
|
{ |
|
|
|
TaskManage.GetInstance.StartLong(new Action(() => |
|
|
|
{ |
|
|
|