Initial commit almost identical to SVN-repo rev.340
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
|
||||
namespace TBF.BenchControl.Generic
|
||||
{
|
||||
interface IChildComponentCfg : IComponentCfg
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
|
||||
namespace TBF.BenchControl.Generic
|
||||
{
|
||||
public interface IComponent
|
||||
{
|
||||
IComponentCfg Cfg { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace TBF.BenchControl.Generic
|
||||
{
|
||||
public interface IComponentCfg
|
||||
{
|
||||
/// <summary>
|
||||
/// Unique component # (0 .. nr.of components-1)
|
||||
/// </summary>
|
||||
int ItemNr { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Component name
|
||||
/// </summary>
|
||||
string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Reference to the component factory (it is a singleton)
|
||||
/// </summary>
|
||||
IComponentFactory Factory { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Component class / component type name
|
||||
/// </summary>
|
||||
string ParentName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Debug level, 0 = debugging off
|
||||
/// </summary>
|
||||
Entities.DebugMode DebugLevel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Log level, 0 = logging off
|
||||
/// </summary>
|
||||
Entities.LogLevel LogLevel { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Measurement correction values
|
||||
/// </summary>
|
||||
IList<Entities.MeasurementCorrection> Corrections { get; }
|
||||
|
||||
IComponentCfg Clone();
|
||||
TBF.Entities.Component CreateDbEntity();
|
||||
|
||||
string ToString(int i);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
|
||||
namespace TBF.BenchControl.Generic
|
||||
{
|
||||
public interface IComponentCfgCtrl
|
||||
{
|
||||
/// <summary>
|
||||
/// Reference to device configuration class instance
|
||||
/// </summary>
|
||||
IComponentCfg Config { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Verify current user controls for validity.
|
||||
/// Called when user wants to close/save the configuration.
|
||||
/// </summary>
|
||||
/// <returns>See VerifyFlags</returns>
|
||||
CfgVerifyFlags VerifyCfg(ref string message);
|
||||
|
||||
/// <summary>
|
||||
/// Save settings to the configuration class.
|
||||
/// </summary>
|
||||
void Unlock();
|
||||
|
||||
/// <summary>
|
||||
/// Save settings to the configuration class.
|
||||
/// </summary>
|
||||
void UpdateCfg();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace TBF.BenchControl.Generic
|
||||
{
|
||||
public interface IComponentFactory
|
||||
{
|
||||
string ClassName { get; } /// Name of the class of components (for instance "Valve")
|
||||
bool HasProcedureParams { get; } /// true = create an entity with component specific procedure parameters
|
||||
bool HasTestParams { get; } /// true = create an entity with component specific test parameters
|
||||
|
||||
/// <summary>
|
||||
/// Max. number of components of this class in the system: 1, some integer value or int.MaxValue
|
||||
/// </summary>
|
||||
int MaxCount { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the default configuration
|
||||
/// </summary>
|
||||
IComponentCfg DefaultConfig(IList<Entities.Component> components);
|
||||
|
||||
/// <summary>
|
||||
/// Returns the UserControl used inside ComponentConfigForm to display and edit the configuration
|
||||
/// </summary>
|
||||
IComponentCfgCtrl CreateCfgCtrl();
|
||||
|
||||
/// <summary>
|
||||
/// Returns the component
|
||||
/// </summary>
|
||||
IComponent ComponentFromCmpntCfg(IComponentCfg config, IList<Generic.IComponent> components);
|
||||
|
||||
/// <summary>
|
||||
/// Converts an Entities.Component object into an instance of an appropriate class implementing IComponentCfg
|
||||
/// </summary>
|
||||
IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component);
|
||||
|
||||
IParamsProvider GetTestParams(Entities.ComponentTest testParams);
|
||||
IParamsProvider GetProcedureParams(Entities.ComponentProcedure procedureParams);
|
||||
|
||||
|
||||
void ResetStaticProperties();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
namespace TBF.BenchControl.Generic
|
||||
{
|
||||
public interface IDevice
|
||||
{
|
||||
void Initialize();
|
||||
|
||||
/// <summary>
|
||||
/// This function is invoked regularly each 1000 ms (once per second)
|
||||
/// just before Start(), Run() and Stop() functions of acrive operations.
|
||||
///
|
||||
/// It runs in a thread created by class Machine (not the user interface thread).
|
||||
/// The function should not block (otherwise it blocks all other devices) !!!
|
||||
/// In case needed, the device must create its own thread to handle hardware
|
||||
/// without any interference with the rest of the system.
|
||||
/// </summary>
|
||||
void RunDeviceBefore();
|
||||
|
||||
/// <summary>
|
||||
/// This function is invoked regularly each 1000 ms (once per second)
|
||||
/// just before Start(), Run() and Stop() functions of acrive operations.
|
||||
///
|
||||
/// It runs in a thread created by class Machine (not the user interface thread).
|
||||
/// The function should not block (otherwise it blocks all other devices) !!!
|
||||
/// In case needed, the device must create its own thread to handle hardware
|
||||
/// without any interference with the rest of the system.
|
||||
/// </summary>
|
||||
void RunDeviceAfter();
|
||||
|
||||
/// <summary>
|
||||
/// Should be invoked once before state machine is stopped and program exits.
|
||||
/// Only Stop() operations may be called afterwards (No Start() / Run() operation).
|
||||
/// </summary>
|
||||
void StopDevice();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
|
||||
namespace TBF.BenchControl.Generic
|
||||
{
|
||||
public interface IParamsProvider
|
||||
{
|
||||
string ComponentName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Number of parameters
|
||||
/// </summary>
|
||||
int ParamsCount();
|
||||
|
||||
/// <summary>
|
||||
/// Parameter names
|
||||
/// </summary>
|
||||
/// <param name="ix">Zero based index of the parameter</param>
|
||||
string ParamName(int ix);
|
||||
|
||||
/// <summary>
|
||||
/// Parameter values in string form
|
||||
/// </summary>
|
||||
/// <param name="ix">Zero based index of the parameter</param>
|
||||
string ToString(int i);
|
||||
|
||||
/// <summary>
|
||||
/// Validates the string representation of a parameter
|
||||
/// </summary>
|
||||
/// <param name="ix">Zero based index of the parameter</param>
|
||||
/// <param name="strValue">String representation of the parameter</param>
|
||||
/// <param name="message">Warning message in case the string is wrong or null</param>
|
||||
/// <returns>true = string is OK, false = string is wrong (see 'message')</returns>
|
||||
bool ValidateParam(int ix, string strValue, out string message);
|
||||
|
||||
/// <summary>
|
||||
/// Update the parameter from a string
|
||||
/// </summary>
|
||||
/// <param name="ix">Zero based index of the parameter</param>
|
||||
/// <param name="strValue">String representation of the parameter</param>
|
||||
void UpdateParam(int ix, string strValue);
|
||||
|
||||
void UpdateDbEntity();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
|
||||
namespace TBF.BenchControl.Generic
|
||||
{
|
||||
public interface IProcedureParams
|
||||
{
|
||||
Entities.ComponentProcedure ProcedureParamsEntity { get; }
|
||||
TBF.Entities.ComponentProcedure ToDbEntity(IComponent component, Entities.Procedure procedure);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
|
||||
namespace TBF.BenchControl.Generic
|
||||
{
|
||||
public interface ITestParams
|
||||
{
|
||||
Entities.ComponentTest TestParamsEntity { get; }
|
||||
TBF.Entities.ComponentTest ToDbEntity(IComponent component, Entities.Test test);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user