ToString( ) methods of all components are equal, start with ClassName.
This commit is contained in:
@@ -9,18 +9,13 @@ namespace TBF.Rig.Network.Adapter
|
||||
public class Netadapter : ComponentBase, GenericDevices.INetworkAdapter
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(Netadapter));
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("Component={0} IPAddress={1} NetMask={2} Description={3}", Cfg.Name, IPAddress, NetMask, (Cfg as NetadapterCfg).Description);
|
||||
}
|
||||
|
||||
public bool Running { get { return running; } }
|
||||
bool running;
|
||||
public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(-1)); }
|
||||
|
||||
readonly NetadapterCfg netadapterCfg;
|
||||
readonly IPAddress ipAddress;
|
||||
readonly IPAddress netMask;
|
||||
readonly IPAddress broadcastAddress;
|
||||
|
||||
IPAddress ipAddress;
|
||||
IPAddress netMask;
|
||||
IPAddress broadcastAddress;
|
||||
|
||||
public IPAddress IPAddress { get { return ipAddress; } }
|
||||
public IPAddress NetMask { get { return netMask; } }
|
||||
@@ -33,17 +28,16 @@ namespace TBF.Rig.Network.Adapter
|
||||
: base(cfg)
|
||||
{
|
||||
netadapterCfg = cfg as NetadapterCfg;
|
||||
AdapterInfo.RefreshNetAdaptersInfo();
|
||||
AdapterInfo netadapter = AdapterInfo.GetNetAdapter(netadapterCfg.Description);
|
||||
ipAddress = netadapter.IPAddress;
|
||||
netMask = netadapter.NetMask;
|
||||
broadcastAddress = netadapter.GetBroadcastAddress();
|
||||
|
||||
running = false;
|
||||
|
||||
log.Warn(this.ToString());
|
||||
}
|
||||
|
||||
public override void Initialize() { }
|
||||
public override void Initialize()
|
||||
{
|
||||
AdapterInfo.RefreshNetAdaptersInfo();
|
||||
AdapterInfo netadapter = AdapterInfo.GetNetAdapter(netadapterCfg.Description);
|
||||
ipAddress = netadapter.IPAddress;
|
||||
netMask = netadapter.NetMask;
|
||||
broadcastAddress = netadapter.GetBroadcastAddress();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace TBF.Rig.Network.Camera.Display
|
||||
public class Display : ComponentBase, IOperation, ICameraDisplay
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(Display));
|
||||
public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(1)); }
|
||||
public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(-1)); }
|
||||
|
||||
public readonly DisplayCfg DisplayCfg;
|
||||
|
||||
|
||||
@@ -15,14 +15,8 @@ namespace TBF.Rig.Network.Camera.Roi
|
||||
/// TODO: Implement support for sharing one camera by multiple ROI-s
|
||||
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(Roi));
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("{0}({1})", this.GetType().Namespace.Substring(8), Cfg.ToString(1));
|
||||
}
|
||||
public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(-1)); }
|
||||
|
||||
///
|
||||
/// Cfg
|
||||
///
|
||||
public readonly RoiCfg RoiCfg;
|
||||
|
||||
public readonly CLP1611.Camera NetCamera;
|
||||
@@ -141,6 +135,13 @@ namespace TBF.Rig.Network.Camera.Roi
|
||||
Clear();
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
pulsesDelta = -cameraPulses;
|
||||
timeDelta = -cameraTime;
|
||||
wmRefPulses = 0;
|
||||
}
|
||||
|
||||
#region Configuration Change Handling
|
||||
|
||||
public static void OnCfgChange(object sender, CfgChangeArgs args)
|
||||
@@ -170,14 +171,6 @@ namespace TBF.Rig.Network.Camera.Roi
|
||||
|
||||
#endregion Configuration Change Handling
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
pulsesDelta = -cameraPulses;
|
||||
timeDelta = -cameraTime;
|
||||
wmRefPulses = 0;
|
||||
}
|
||||
|
||||
|
||||
public IOperation RoiDetectionOp()
|
||||
{
|
||||
if (NetCamera != null && RoiCfg.DebugLevel != DebugMode.Simulate)
|
||||
|
||||
@@ -14,14 +14,8 @@ namespace TBF.Rig.Network.Camera.RoiForFixedStart
|
||||
/// TODO: Implement support for sharing one camera by multiple ROI-s
|
||||
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(Roi));
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("{0}({1})", this.GetType().Namespace.Substring(8), Cfg.ToString(1));
|
||||
}
|
||||
public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(-1)); }
|
||||
|
||||
///
|
||||
/// Cfg
|
||||
///
|
||||
readonly RoiCfg roiCfg;
|
||||
|
||||
///
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace TBF.Rig.Network.Comet.Ambient
|
||||
public class Ambient : ComponentBase, IDevice, IOperation, GenericDevices.IAmbient
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(Ambient));
|
||||
public override string ToString() { return string.Format("Ambient({0})", Cfg.ToString(-1)); }
|
||||
public override string ToString() { return string.Format("{0}({1})", ClassName, Cfg.ToString(-1)); }
|
||||
|
||||
readonly AmbientCfg myCfg;
|
||||
readonly IPAddress ipAddress;
|
||||
|
||||
Reference in New Issue
Block a user