tbf/TBF/BenchControl/DataEntry/DataStream/OpenConnectionEventArgs.cs

36 lines
1.2 KiB
C#
Raw Normal View History

2021-07-14 14:52:27 +00:00
///
/// Copyright (c) 2021 Sensus Slovensko a.s.
///
using System;
namespace TBF.BenchControl.DataEntry.DataStream
{
public class OpenConnectionEventArgs : EventArgs
2021-07-14 14:52:27 +00:00
{
public int WMNr0; /// 0-based water meter position
public bool IsLast;
2021-07-14 14:52:27 +00:00
public Results.Entities.WaterMeter Wm;
public bool Connected;
public string WaterMeterID;
public OpenConnectionEventArgs(int wmNr0, bool isLast, Results.Entities.WaterMeter wm = null, bool connected = false, string waterMeterID = null)
2021-07-14 14:52:27 +00:00
{
this.WMNr0 = wmNr0;
this.IsLast = isLast;
2021-07-14 14:52:27 +00:00
this.Wm = wm;
this.Connected = connected;
this.WaterMeterID = connected ? waterMeterID : null;
2021-07-14 14:52:27 +00:00
}
public override string ToString()
{
return string.Format("WMNr0={0} Last={1} WMPos={2} connected={3} S/N={4}",
2021-07-14 14:52:27 +00:00
WMNr0,
IsLast,
2021-07-14 14:52:27 +00:00
Wm.WMPosition,
Connected,
string.IsNullOrEmpty(WaterMeterID) ? string.Empty : WaterMeterID);
2021-07-14 14:52:27 +00:00
}
}
}