IDevice.Initialize( ) ---> IComponent.Initialize( ).

This commit is contained in:
Milan Hanajik
2021-04-02 18:13:00 +02:00
parent 08c2d3b0d8
commit 1bc3e5d6eb
4 changed files with 19 additions and 22 deletions
+3
View File
@@ -49,6 +49,9 @@ namespace TBF.Rig
this.cfg = cfg;
}
/// <summary> Empty implementation, might be overriden in derived classes </summary>
public virtual void Initialize() { }
/// <summary> Empty implementation, might be overriden in derived classes </summary>
public virtual void StartChangeHandler() { }
+7
View File
@@ -23,6 +23,13 @@ namespace TBF.Rig.Generic
IList<Config.Entities.Uncertainty> Uncertainties { get; set; }
/// <summary>
/// Invoked once on program start-up before the state machine is started,
/// before RunDeviceBefore() functions of all devices and before Start()
/// functions of all operations.
/// </summary>
void Initialize();
void StartChangeHandler();
void StopChangeHandler();
-7
View File
@@ -5,13 +5,6 @@ namespace TBF.Rig.Generic
{
public interface IDevice : IComponent
{
/// <summary>
/// Invoked once on program start-up before the state machine is started,
/// before RunDeviceBefore() functions of all devices and before Start()
/// functions of all operations.
/// </summary>
void Initialize();
/// <summary>
/// This function is invoked regularly each 1000 ms (once per second)
/// just before Start(), Run() and Stop() functions of acrive operations.
+9 -15
View File
@@ -163,15 +163,6 @@ namespace TBF.Rig
ProcessData.IperlHeads = new List<TestMethods.iPerlCommunication.iPerlHead.IperlHead>();
}
/// <summary>
/// Add a device to the state machine.
/// </summary>
/// <param name="obj">Device</param>
public static void AddDevice(IDevice device)
{
if (device != null && !devices.Contains(device)) devices.Add(device);
}
/// <summary>
/// Add a state to the state machine.
/// In this way a sequence can be created programtically.
@@ -320,14 +311,17 @@ namespace TBF.Rig
}
IDevice device = cmpnt as IDevice;
if (device != null)
{
if (device != null)
{
CurrentlyInitializedDeviceName = device.Name;
UiBridge.Bridge.OnActivity(null, device.Name); /// Info
UiBridge.Bridge.OnActivity(null, device.Name); /// Info
device.Initialize();
AddDevice(device); /// Only components that were initialized are added
}
devices.Add(device); /// Only components that were initialized are added
}
else
{
cmpnt.Initialize();
}
}
CurrentlyInitializedDeviceName = "---";