Everything works OK after serious changes:
- all components, componentCfg-s and parameter providers use base classes - less boilerplate code, simpler access to test/procedure parameters from code - CreateTestParams(test), CreateProcedureParams(procedure) methods added - TestBenchSim class is made static, it is not inheritted by any device anymore
This commit is contained in:
@@ -3,6 +3,16 @@ namespace TBF.BenchControl.Generic
|
||||
{
|
||||
public interface IComponent
|
||||
{
|
||||
string Name { get; }
|
||||
|
||||
string ClassName { get; }
|
||||
|
||||
string ParentName { get; }
|
||||
|
||||
Entities.DebugMode DebugLevel { get; }
|
||||
|
||||
Entities.LogLevel LogLevel { get; }
|
||||
|
||||
IComponentCfg Cfg { get; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,8 +39,25 @@ namespace TBF.BenchControl.Generic
|
||||
/// </summary>
|
||||
IList<Entities.MeasurementCorrection> Corrections { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new database entity 'Component' from the parameters
|
||||
/// </summary>
|
||||
TBF.Entities.Component CreateDbEntity();
|
||||
|
||||
///
|
||||
/// Procedure parameters provider support
|
||||
///
|
||||
IParamsProvider GetProcedureParams();
|
||||
void UpdateProcedureParams(Entities.Procedure procedure);
|
||||
IParamsProvider CreateProcedureParams(Entities.Procedure procedure);
|
||||
|
||||
///
|
||||
/// Test parameters provider support
|
||||
///
|
||||
IParamsProvider GetTestParams();
|
||||
void UpdateTestParams(Entities.Test test);
|
||||
IParamsProvider CreateTestParams(Entities.Test test);
|
||||
|
||||
string ToString(int i);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,8 +5,6 @@ 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
|
||||
@@ -33,9 +31,6 @@ namespace TBF.BenchControl.Generic
|
||||
/// </summary>
|
||||
IComponentCfg CmpntCfgFromCmpntEntity(Entities.Component component);
|
||||
|
||||
IParamsProvider GetTestParams(Entities.ComponentTest testParams);
|
||||
IParamsProvider GetProcedureParams(Entities.ComponentProcedure procedureParams);
|
||||
|
||||
|
||||
void ResetStaticProperties();
|
||||
}
|
||||
|
||||
@@ -20,7 +20,12 @@ namespace TBF.BenchControl.Generic
|
||||
/// Parameter values in string form
|
||||
/// </summary>
|
||||
/// <param name="ix">Zero based index of the parameter</param>
|
||||
string ToString(int i);
|
||||
string ToString(int ix);
|
||||
|
||||
/// <summary>
|
||||
/// Initialize values of all parameters
|
||||
/// </summary>
|
||||
void InitializeAll();
|
||||
|
||||
/// <summary>
|
||||
/// Validates the string representation of a parameter
|
||||
|
||||
@@ -3,7 +3,7 @@ namespace TBF.BenchControl.Generic
|
||||
{
|
||||
public interface IProcedureParams
|
||||
{
|
||||
Entities.ComponentProcedure ProcedureParamsEntity { get; }
|
||||
TBF.Entities.ComponentProcedure ToDbEntity(IComponent component, Entities.Procedure procedure);
|
||||
void UpdateProcedureParams(string componentName, Entities.Procedure procedure);
|
||||
TBF.Entities.ComponentProcedure ToDbEntity(string componentName, Entities.Procedure procedure);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ namespace TBF.BenchControl.Generic
|
||||
{
|
||||
public interface ITestParams
|
||||
{
|
||||
Entities.ComponentTest TestParamsEntity { get; }
|
||||
TBF.Entities.ComponentTest ToDbEntity(IComponent component, Entities.Test test);
|
||||
void UpdateTestParams(string componentName, Entities.Test test);
|
||||
TBF.Entities.ComponentTest ToDbEntity(string componentName, Entities.Test test);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user