IDevice.Initialize( ) ---> IComponent.Initialize( ).
This commit is contained in:
@@ -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() { }
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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
@@ -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 = "---";
|
||||
|
||||
Reference in New Issue
Block a user