(1) ParamsProvider-s added to C..Test/C..Procedure entities, (2) ComponentCfgBase fn-s returning IParamsProvider rewritten, (3) refactoring, ver. 2.18.891

This commit is contained in:
Milan Hanajik 2018-05-10 13:25:46 +02:00
parent 878c89591e
commit d6881bfdf3
77 changed files with 495 additions and 462 deletions

View File

@ -77,6 +77,7 @@
<Compile Include="Entities\IHasItemNr.cs" /> <Compile Include="Entities\IHasItemNr.cs" />
<Compile Include="Entities\IHasName.cs" /> <Compile Include="Entities\IHasName.cs" />
<Compile Include="Entities\IHasValves.cs" /> <Compile Include="Entities\IHasValves.cs" />
<Compile Include="Entities\IParamsProvider.cs" />
<Compile Include="Entities\MeasurementCorrection.cs" /> <Compile Include="Entities\MeasurementCorrection.cs" />
<Compile Include="Entities\MetersPath.cs" /> <Compile Include="Entities\MetersPath.cs" />
<Compile Include="Entities\OutputPath.cs" /> <Compile Include="Entities\OutputPath.cs" />

View File

@ -1,5 +1,5 @@
/// ///
/// Copyright (c) 2013-2017 Sensus Metering Systems /// Copyright (c) 2013-2018 Sensus Slovensko a.s.
/// ///
using System; using System;
using System.IO; using System.IO;
@ -13,13 +13,25 @@ namespace Config.Entities
public virtual string Parameters { get; set; } public virtual string Parameters { get; set; }
public virtual Procedure Procedure { get; set; } public virtual Procedure Procedure { get; set; }
IParamsProvider paramsProvider;
///
public virtual IParamsProvider GetParamsProvider() { return paramsProvider; }
public virtual void SetParamsProvider(IParamsProvider paramsProvider) { this.paramsProvider = paramsProvider; }
protected ComponentProcedure() { }
public ComponentProcedure(string name, string parameters, Procedure procedure)
{
this.CmpntName = name;
this.Parameters = parameters;
this.Procedure = procedure;
}
public virtual ComponentProcedure Clone(Procedure newProcedure) public virtual ComponentProcedure Clone(Procedure newProcedure)
{ {
ComponentProcedure result = new ComponentProcedure(); return new ComponentProcedure(CmpntName, Parameters, newProcedure);
result.CmpntName = CmpntName;
result.Parameters = Parameters;
result.Procedure = newProcedure;
return result;
} }
public virtual void Export(StreamWriter output) public virtual void Export(StreamWriter output)
@ -34,11 +46,16 @@ namespace Config.Entities
if (string.IsNullOrEmpty(firstLine)) return null; if (string.IsNullOrEmpty(firstLine)) return null;
ComponentProcedure result = new ComponentProcedure(); try
result.CmpntName = firstLine; {
result.Parameters = input.ReadLine().Replace("~", Environment.NewLine); string cmptnName = firstLine;
result.Procedure = newProcedure; string parameters = input.ReadLine().Replace("~", Environment.NewLine);
return result; return new ComponentProcedure(cmptnName, parameters, newProcedure);
}
catch (Exception)
{
return null;
}
} }
} }
} }

View File

@ -1,5 +1,5 @@
/// ///
/// Copyright (c) 2013-2017 Sensus Metering Systems /// Copyright (c) 2013-2018 Sensus Slovensko a.s.
/// ///
using System; using System;
using System.IO; using System.IO;
@ -13,13 +13,25 @@ namespace Config.Entities
public virtual string Parameters { get; set; } public virtual string Parameters { get; set; }
public virtual Test Test { get; set; } public virtual Test Test { get; set; }
IParamsProvider paramsProvider;
///
public virtual IParamsProvider GetParamsProvider() { return paramsProvider; }
public virtual void SetParamsProvider(IParamsProvider paramsProvider) { this.paramsProvider = paramsProvider; }
protected ComponentTest() { }
public ComponentTest(string name, string parameters, Test test)
{
this.CmpntName = name;
this.Parameters = parameters;
this.Test = test;
}
public virtual ComponentTest Clone() public virtual ComponentTest Clone()
{ {
ComponentTest result = new ComponentTest(); return new ComponentTest(CmpntName, Parameters, Test);
result.CmpntName = CmpntName;
result.Parameters = Parameters;
result.Test = Test;
return result;
} }
public virtual void Export(StreamWriter output) public virtual void Export(StreamWriter output)
@ -34,11 +46,16 @@ namespace Config.Entities
if (string.IsNullOrEmpty(firstLine)) return null; if (string.IsNullOrEmpty(firstLine)) return null;
ComponentTest result = new ComponentTest(); try
result.CmpntName = firstLine; {
result.Parameters = input.ReadLine().Replace("~", Environment.NewLine); string cmptnName = firstLine;
result.Test = newTest; string parameters = input.ReadLine().Replace("~", Environment.NewLine);
return result; return new ComponentTest(cmptnName, parameters, newTest);
}
catch (Exception)
{
return null;
}
} }
} }
} }

View File

@ -1,10 +1,17 @@
/// ///
/// Copyright (c) 2013-2015 Sensus Metering Systems /// Copyright (c) 2013-2018 Sensus Slovensko a.s.
/// ///
namespace TBF.BenchControl.Generic using System.Xml.Serialization;
namespace Config.Entities
{ {
public interface IParamsProvider public interface IParamsProvider
{ {
/// <summary>
/// Get XML Serializer
/// </summary>
XmlSerializer GetSerializer();
string ComponentName { get; } string ComponentName { get; }
/// <summary> /// <summary>
@ -45,7 +52,7 @@ namespace TBF.BenchControl.Generic
/// <param name="strValue">String representation of the parameter</param> /// <param name="strValue">String representation of the parameter</param>
void UpdateParam(int ix, string strValue); void UpdateParam(int ix, string strValue);
void UpdateDbEntity(); void UpdateEmbeddedDbEntity();
/// <summary> /// <summary>
/// Creates an object copy /// Creates an object copy

View File

@ -225,6 +225,15 @@ namespace Config.Entities
return diff.ToString(); return diff.ToString();
} }
public virtual ComponentProcedure GetProcedureParamsEntity(string cmpntName)
{
foreach (var procPrms in MoreParams)
{
if (procPrms.CmpntName == cmpntName) return procPrms;
}
return null;
}
public override string ToString() public override string ToString()
{ {
return string.Format("{0}, rev.{1}", Name, Revision); return string.Format("{0}, rev.{1}", Name, Revision);

View File

@ -301,6 +301,15 @@ namespace Config.Entities
return diff.ToString(); return diff.ToString();
} }
public virtual ComponentTest GetTestParamsEntity(string cmpntName)
{
foreach (var tstPrms in MoreParams)
{
if (tstPrms.CmpntName == cmpntName) return tstPrms;
}
return null;
}
public virtual float GetErrLimLo(float flow) public virtual float GetErrLimLo(float flow)
{ {
if (ErrLimLo <= ErrLimHi) if (ErrLimLo <= ErrLimHi)

View File

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.18.883.0")] [assembly: AssemblyVersion("2.18.891.0")]
[assembly: AssemblyFileVersion("2.18.883.0")] [assembly: AssemblyFileVersion("2.18.891.0")]

View File

@ -124,56 +124,146 @@ namespace TBF.BenchControl
} }
} }
/// <summary>
/// Default implementation returning null - no test aprameters.
/// In case there are any test parameters, this function override should return
/// a reference to a class that implements IParamsProvider and ITestParams.
/// </summary>
/// <returns>Test parameters obtained by the last UpdateTestParams(test)</returns>
public virtual IParamsProvider GetTestParams()
{
return null;
}
/// <summary> public void LoadTestParamsFromDB(Test test)
/// Default implementation returning null - no procedure parameters.
/// In case there are any procedure parameters, this function override should return
/// a reference to a class that implements IParamsProvider and IProcedureParams.
/// </summary>
/// <returns>Procedure parameters obtained by the last UpdateProcedureParams(procedure)</returns>
public virtual IParamsProvider GetProcedureParams()
{ {
return null; ITestParams tstPrms = (GetRuntimeTestParamsProvider() as ITestParams);
}
public void UpdateTestParams(Test test)
{
ITestParams tstPrms = (GetTestParams() as ITestParams);
if (tstPrms != null) if (tstPrms != null)
{ {
tstPrms.UpdateTestParams(Name, test); tstPrms.FromDbEntity(Name, test);
} }
} }
public void UpdateProcedureParams(Procedure procedure)
public void LoadProcedureParamsFromDB(Procedure procedure)
{ {
IProcedureParams procPrms = (GetProcedureParams() as IProcedureParams); IProcedureParams procPrms = (GetRuntimeProcParamsProvider() as IProcedureParams);
if (procPrms != null) if (procPrms != null)
{ {
procPrms.UpdateProcedureParams(Name, procedure); procPrms.FromDbEntity(Name, procedure);
} }
} }
public virtual IParamsProvider CreateTestParams(Test test) /// <summary>
{ /// If there are any procedure parameters, this function should be overriden
return null; /// by one returning a reference to a newly created object
} /// implementing IParamsProvider and IProcedureParams.
///
/// This default implementation returns null = no procedure parameters.
/// </summary>
/// <returns>Procedure parameters provider for this component or null</returns>
public virtual IParamsProvider CreateProcParamsProvider()
{
return null;
}
public virtual IParamsProvider CreateProcedureParams(Procedure procedure) /// <summary>
{ /// If there are any procedure parameters, this function should be overriden
return null; /// by one returning a reference to an object
} /// implementing IParamsProvider and IProcedureParams used in runtime.
///
/// This default implementation returns null = no procedure parameters.
/// </summary>
/// <returns>Procedure parameters provider for this component or null</returns>
public virtual IParamsProvider GetRuntimeProcParamsProvider()
{
return null;
}
public virtual IParamsProvider GetUIProcParamsProvider(Procedure procedure)
{
if (GetRuntimeProcParamsProvider() == null)
{
/// Component has no test parametes
return null;
}
ComponentProcedure procParamsEntity = procedure.GetProcedureParamsEntity(Name);
if (procParamsEntity != null)
{
if (procParamsEntity.GetParamsProvider() != null)
{
/// Parameters provider for this entity already fetched - return it
return procParamsEntity.GetParamsProvider();
}
else
{
/// Parameters provider for this entity will be created and updated from the entity later on
IParamsProvider paramsProvider = CreateProcParamsProvider();
(paramsProvider as IProcedureParams).UpdateFromDbEntity(procParamsEntity);
procParamsEntity.SetParamsProvider(paramsProvider);
return paramsProvider;
}
}
else
{
IParamsProvider paramsProvider = CreateProcParamsProvider();
(paramsProvider as IProcedureParams).FromDbEntity(Name, procedure);
return paramsProvider;
}
}
/// <summary>
/// If there are any procedure parameters, this function should be overriden
/// by one returning a reference to a newly created object
/// implementing IParamsProvider and ITestParams.
///
/// This default implementation returns null = no test parameters.
/// </summary>
/// <returns>Procedure parameters provider for this component or null</returns>
public virtual IParamsProvider CreateTestParamsProvider()
{
return null;
}
/// <summary>
/// If there are any test parameters, this function should be overriden
/// by one returning a reference to an object
/// implementing IParamsProvider and ITestParams used in runtime.
///
/// This default implementation returns null = no test parameters.
/// </summary>
/// <returns>Test parameters provider for this component or null</returns>
public virtual IParamsProvider GetRuntimeTestParamsProvider()
{
return null;
}
public virtual IParamsProvider GetUITestParamsProvider(Test test)
{
if (GetRuntimeTestParamsProvider() == null)
{
/// Component has no test parametes
return null;
}
ComponentTest testParamsEntity = test.GetTestParamsEntity(Name);
if (testParamsEntity != null)
{
if (testParamsEntity.GetParamsProvider() != null)
{
/// Parameters provider for this entity already fetched - return it
return testParamsEntity.GetParamsProvider();
}
else
{
/// Parameters provider for this entity will be created and updated from the entity later on
IParamsProvider paramsProvider = CreateTestParamsProvider();
(paramsProvider as ITestParams).UpdateFromDbEntity(testParamsEntity);
testParamsEntity.SetParamsProvider(paramsProvider);
return paramsProvider;
}
}
else
{
IParamsProvider paramsProvider = CreateTestParamsProvider();
(paramsProvider as ITestParams).FromDbEntity(Name, test);
return paramsProvider;
}
}
} }
} }

View File

@ -14,7 +14,7 @@ namespace TBF.BenchControl.Elde.FixedStartRegisterReader
public class RRProcedureParams : ProcedureParamsBase, IParamsProvider, IProcedureParams public class RRProcedureParams : ProcedureParamsBase, IParamsProvider, IProcedureParams
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(RRProcedureParams) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(RRProcedureParams) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } public override XmlSerializer GetSerializer() { return Serializer; }
public double PulsesPerLtr; /// Target low limit of the flow increase or decrease public double PulsesPerLtr; /// Target low limit of the flow increase or decrease
@ -81,7 +81,7 @@ namespace TBF.BenchControl.Elde.FixedStartRegisterReader
return pars; return pars;
} }
public override void UpdateProcedureParams(ComponentProcedure dbEntity) public override void UpdateFromDbEntity(ComponentProcedure dbEntity)
{ {
if (dbEntity == null) return; if (dbEntity == null) return;
try try

View File

@ -20,20 +20,15 @@ namespace TBF.BenchControl.Elde.FixedStartRegisterReader
/// <summary> Procedure parameters </summary> /// <summary> Procedure parameters </summary>
[XmlIgnore] [XmlIgnore]
public RRProcedureParams ProcParams; public RRProcedureParams ProcParams;
public override IParamsProvider GetProcedureParams() { return ProcParams; } public override IParamsProvider GetRuntimeProcParamsProvider() { return ProcParams; }
public override IParamsProvider CreateProcedureParams(Procedure procedure) public override IParamsProvider CreateProcParamsProvider() { return new RRProcedureParams(true); }
{
RRProcedureParams procParams = new RRProcedureParams(true);
procParams.UpdateProcedureParams(Name, procedure);
return procParams;
}
/// Private parameterless constructor invoked by all other (public) constructors /// Private parameterless constructor invoked by all other (public) constructors
RegisterReaderCfg() RegisterReaderCfg()
{ {
Name = "Dummy"; Name = "Dummy";
ParentName = "CB"; ParentName = "CB";
ProcParams = new RRProcedureParams(true); ProcParams = new RRProcedureParams(true);
} }
public RegisterReaderCfg(IComponentFactory factory) public RegisterReaderCfg(IComponentFactory factory)

View File

@ -14,7 +14,7 @@ namespace TBF.BenchControl.Elde.RegisterReader
public class RRProcedureParams : ProcedureParamsBase, IParamsProvider, IProcedureParams public class RRProcedureParams : ProcedureParamsBase, IParamsProvider, IProcedureParams
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(RRProcedureParams) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(RRProcedureParams) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } public override XmlSerializer GetSerializer() { return Serializer; }
public double PulsesPerLtr; /// [l^-1] public double PulsesPerLtr; /// [l^-1]
@ -81,7 +81,7 @@ namespace TBF.BenchControl.Elde.RegisterReader
return pars; return pars;
} }
public override void UpdateProcedureParams(ComponentProcedure dbEntity) public override void UpdateFromDbEntity(ComponentProcedure dbEntity)
{ {
if (dbEntity == null) return; if (dbEntity == null) return;
try try

View File

@ -10,7 +10,7 @@ namespace TBF.BenchControl.Elde.RegisterReader
public class RegisterReaderCfg : ComponentCfgBase, Generic.IChildComponentCfg public class RegisterReaderCfg : ComponentCfgBase, Generic.IChildComponentCfg
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(RegisterReaderCfg) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(RegisterReaderCfg) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } protected override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new RegisterReaderCfgCtrl(); } public IComponentCfgCtrl GetControl() { return new RegisterReaderCfgCtrl(); }
@ -22,18 +22,13 @@ namespace TBF.BenchControl.Elde.RegisterReader
/// <summary> Procedure parameters </summary> /// <summary> Procedure parameters </summary>
[XmlIgnore] [XmlIgnore]
public RRProcedureParams ProcParams; public RRProcedureParams ProcParams;
public override IParamsProvider GetProcedureParams() { return ProcParams; } public override IParamsProvider GetRuntimeProcParamsProvider() { return ProcParams; }
public override IParamsProvider CreateProcedureParams(Procedure procedure) public override IParamsProvider CreateProcParamsProvider() { return new RRProcedureParams(true); }
{
RRProcedureParams procParams = new RRProcedureParams(true);
procParams.UpdateProcedureParams(Name, procedure);
return procParams;
}
/// Private parameterless constructor invoked by all other (public) constructors /// Private parameterless constructor invoked by all other (public) constructors
RegisterReaderCfg() RegisterReaderCfg()
{ {
ProcParams = new RRProcedureParams(true); ProcParams = new RRProcedureParams(true);
} }
public RegisterReaderCfg(string name, IComponentFactory factory) public RegisterReaderCfg(string name, IComponentFactory factory)

View File

@ -2,6 +2,7 @@
/// Copyright (c) 2013-2016 Sensus Metering Systems /// Copyright (c) 2013-2016 Sensus Metering Systems
/// ///
using System.Collections.Generic; using System.Collections.Generic;
using Config.Entities;
namespace TBF.BenchControl.Generic namespace TBF.BenchControl.Generic
{ {
@ -52,19 +53,51 @@ namespace TBF.BenchControl.Generic
/// ///
IComponentCfgCtrl GetControl(); IComponentCfgCtrl GetControl();
///
/// Procedure parameters provider support /// <summary>
/// /// Creates a procedure parameters provider (specific for each component).
IParamsProvider GetProcedureParams(); /// </summary>
void UpdateProcedureParams(Config.Entities.Procedure procedure); /// <returns>Prodedure parameters provider or null</returns>
IParamsProvider CreateProcedureParams(Config.Entities.Procedure procedure); IParamsProvider CreateProcParamsProvider();
/// <summary>
/// Returns runtime procedure parameters provider - one per component updated by LoadProcedureParamsFromDB(...).
/// </summary>
/// <returns>Prodedure parameters provider or null</returns>
IParamsProvider GetRuntimeProcParamsProvider();
/// <summary>
/// Returns UI procedure parameters provider - one per ComponentProcedure DB entity.
/// </summary>
/// <returns>Prodedure parameters provider or null</returns>
IParamsProvider GetUIProcParamsProvider(Config.Entities.Procedure procedure);
/// <summary>
/// Creates a test parameters provider (specific for each component).
/// </summary>
/// <returns>Test parameters provider or null</returns>
IParamsProvider CreateTestParamsProvider();
/// <summary>
/// Returns runtime test parameters provider - one per component updated by LoadtestParamsFromDB(...).
/// </summary>
/// <returns>Test parameters provider or null</returns>
IParamsProvider GetRuntimeTestParamsProvider();
/// <summary>
/// Returns UI test parameters provider - one per ComponentTest DB entity.
/// </summary>
/// <returns>Test parameters provider or null</returns>
IParamsProvider GetUITestParamsProvider(Config.Entities.Test test);
///
/// Used in run time when a procedure is loaded or a test is started
///
void LoadProcedureParamsFromDB(Config.Entities.Procedure procedure);
void LoadTestParamsFromDB(Config.Entities.Test test);
///
/// Test parameters provider support
///
IParamsProvider GetTestParams();
void UpdateTestParams(Config.Entities.Test test);
IParamsProvider CreateTestParams(Config.Entities.Test test);
string ToString(int i); string ToString(int i);
} }

View File

@ -1,11 +1,14 @@
/// ///
/// Copyright (c) 2013-2015 Sensus Metering Systems /// Copyright (c) 2013-2018 Sensus Slovensko a.s.
/// ///
using Config.Entities;
namespace TBF.BenchControl.Generic namespace TBF.BenchControl.Generic
{ {
public interface IProcedureParams public interface IProcedureParams
{ {
void UpdateProcedureParams(string componentName, Config.Entities.Procedure procedure); void UpdateFromDbEntity(ComponentProcedure dbEntity);
Config.Entities.ComponentProcedure ToDbEntity(string componentName, Config.Entities.Procedure procedure); void FromDbEntity(string componentName, Procedure procedure);
ComponentProcedure ToDbEntity(string componentName, Procedure procedure);
} }
} }

View File

@ -1,11 +1,14 @@
/// ///
/// Copyright (c) 2013-2015 Sensus Metering Systems /// Copyright (c) 2013-2018 Sensus Slovensko a.s.
/// ///
using Config.Entities;
namespace TBF.BenchControl.Generic namespace TBF.BenchControl.Generic
{ {
public interface ITestParams public interface ITestParams
{ {
void UpdateTestParams(string componentName, Config.Entities.Test test); void UpdateFromDbEntity(ComponentTest dbEntity);
Config.Entities.ComponentTest ToDbEntity(string componentName, Config.Entities.Test test); void FromDbEntity(string componentName, Test test);
ComponentTest ToDbEntity(string componentName, Test test);
} }
} }

View File

@ -11,7 +11,7 @@ namespace TBF.BenchControl.Modbus.Easytherm
public class EasythermCfg : ComponentCfgBase, Generic.IChildComponentCfg public class EasythermCfg : ComponentCfgBase, Generic.IChildComponentCfg
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(EasythermCfg) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(EasythermCfg) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } protected override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new EasythermCfgCtrl(); } public IComponentCfgCtrl GetControl() { return new EasythermCfgCtrl(); }
@ -25,13 +25,8 @@ namespace TBF.BenchControl.Modbus.Easytherm
/// <summary> Procedure parameters </summary> /// <summary> Procedure parameters </summary>
[XmlIgnore] [XmlIgnore]
public ProcParams ProcParams; public ProcParams ProcParams;
public override IParamsProvider GetProcedureParams() { return ProcParams; } public override IParamsProvider GetRuntimeProcParamsProvider() { return ProcParams; }
public override IParamsProvider CreateProcedureParams(Procedure procedure) public override IParamsProvider CreateProcParamsProvider() { return new ProcParams(true); }
{
ProcParams procParams = new ProcParams(true);
procParams.UpdateProcedureParams(Name, procedure);
return procParams;
}
/// Private parameterless constructor invoked by all other (public) constructors /// Private parameterless constructor invoked by all other (public) constructors
@ -40,7 +35,7 @@ namespace TBF.BenchControl.Modbus.Easytherm
Name = "Easytherm"; Name = "Easytherm";
ParentName = "Modbus"; ParentName = "Modbus";
ModbusAddress = 49; ModbusAddress = 49;
ProcParams = new ProcParams(true); ProcParams = CreateProcParamsProvider() as ProcParams;
} }
public EasythermCfg(IComponentFactory factory) public EasythermCfg(IComponentFactory factory)

View File

@ -12,7 +12,7 @@ namespace TBF.BenchControl.Modbus.Easytherm
public class ProcParams : ProcedureParamsBase, IParamsProvider, IProcedureParams public class ProcParams : ProcedureParamsBase, IParamsProvider, IProcedureParams
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(ProcParams) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(ProcParams) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } public override XmlSerializer GetSerializer() { return Serializer; }
public float RequiredTemp; /// [°C] target temperature for a temperature controller or 0=not communicated to the controller public float RequiredTemp; /// [°C] target temperature for a temperature controller or 0=not communicated to the controller
@ -99,7 +99,7 @@ namespace TBF.BenchControl.Modbus.Easytherm
return pars; return pars;
} }
public override void UpdateProcedureParams(ComponentProcedure dbEntity) public override void UpdateFromDbEntity(ComponentProcedure dbEntity)
{ {
if (dbEntity == null) return; if (dbEntity == null) return;
try try

View File

@ -14,7 +14,7 @@ namespace TBF.BenchControl.Network.Camera.Roi
public class ProcedureParams : ProcedureParamsBase, IParamsProvider, IProcedureParams public class ProcedureParams : ProcedureParamsBase, IParamsProvider, IProcedureParams
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(ProcedureParams) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(ProcedureParams) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } public override XmlSerializer GetSerializer() { return Serializer; }
public double PulsesPerLtr; /// [l^-1] public double PulsesPerLtr; /// [l^-1]
public int DetectionImagesCount; public int DetectionImagesCount;
@ -113,7 +113,7 @@ namespace TBF.BenchControl.Network.Camera.Roi
return pars; return pars;
} }
public override void UpdateProcedureParams(ComponentProcedure dbEntity) public override void UpdateFromDbEntity(ComponentProcedure dbEntity)
{ {
if (dbEntity == null) return; if (dbEntity == null) return;
try try

View File

@ -28,13 +28,8 @@ namespace TBF.BenchControl.Network.Camera.Roi
/// <summary> Procedure parameters </summary> /// <summary> Procedure parameters </summary>
[XmlIgnore] [XmlIgnore]
public ProcedureParams ProcParams; public ProcedureParams ProcParams;
public override IParamsProvider GetProcedureParams() { return ProcParams; } public override IParamsProvider GetRuntimeProcParamsProvider() { return ProcParams; }
public override IParamsProvider CreateProcedureParams(Procedure procedure) public override IParamsProvider CreateProcParamsProvider() { return new ProcedureParams(true); }
{
ProcedureParams procParams = new ProcedureParams(true);
procParams.UpdateProcedureParams(Name, procedure);
return procParams;
}
public int DetectionImagesCount { get { return ProcParams.DetectionImagesCount; } } public int DetectionImagesCount { get { return ProcParams.DetectionImagesCount; } }
public int DetectionPeriod1 { get { return ProcParams.DetectionPeriod1; } } public int DetectionPeriod1 { get { return ProcParams.DetectionPeriod1; } }
@ -45,7 +40,7 @@ namespace TBF.BenchControl.Network.Camera.Roi
/// Private parameterless constructor invoked by all other (public) constructors /// Private parameterless constructor invoked by all other (public) constructors
RoiCfg() RoiCfg()
{ {
ProcParams = new ProcedureParams(true); ProcParams = new ProcedureParams(true);
} }
public RoiCfg(string name, IComponentFactory factory) public RoiCfg(string name, IComponentFactory factory)

View File

@ -12,7 +12,7 @@ namespace TBF.BenchControl.Network.Camera.RoiForFixedStart
public class ProcedureParams : ProcedureParamsBase, IParamsProvider, IProcedureParams public class ProcedureParams : ProcedureParamsBase, IParamsProvider, IProcedureParams
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(ProcedureParams) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(ProcedureParams) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } public override XmlSerializer GetSerializer() { return Serializer; }
public double PulsesPerLtr; /// [l^-1] public double PulsesPerLtr; /// [l^-1]
@ -79,7 +79,7 @@ namespace TBF.BenchControl.Network.Camera.RoiForFixedStart
return pars; return pars;
} }
public override void UpdateProcedureParams(ComponentProcedure dbEntity) public override void UpdateFromDbEntity(ComponentProcedure dbEntity)
{ {
if (dbEntity == null) return; if (dbEntity == null) return;
try try

View File

@ -10,7 +10,7 @@ namespace TBF.BenchControl.Network.Camera.RoiForFixedStart
public class RoiCfg : ComponentCfgBase, IChildComponentCfg public class RoiCfg : ComponentCfgBase, IChildComponentCfg
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(RoiCfg) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(RoiCfg) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } protected override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new RoiCfgCtrl(); } public IComponentCfgCtrl GetControl() { return new RoiCfgCtrl(); }
@ -24,19 +24,14 @@ namespace TBF.BenchControl.Network.Camera.RoiForFixedStart
/// <summary> Procedure parameters </summary> /// <summary> Procedure parameters </summary>
[XmlIgnore] [XmlIgnore]
public ProcedureParams ProcParams; public ProcedureParams ProcParams;
public override IParamsProvider GetProcedureParams() { return ProcParams; } public override IParamsProvider GetRuntimeProcParamsProvider() { return ProcParams; }
public override IParamsProvider CreateProcedureParams(Procedure procedure) public override IParamsProvider CreateProcParamsProvider() { return new ProcedureParams(true); }
{
ProcedureParams procParams = new ProcedureParams(true);
procParams.UpdateProcedureParams(Name, procedure);
return procParams;
}
/// Private parameterless constructor invoked by all other (public) constructors /// Private parameterless constructor invoked by all other (public) constructors
RoiCfg() RoiCfg()
{ {
ProcParams = new ProcedureParams(true); ProcParams = new ProcedureParams(true);
} }
public RoiCfg(string name, IComponentFactory factory) public RoiCfg(string name, IComponentFactory factory)
: this() : this()

View File

@ -14,7 +14,7 @@ namespace TBF.BenchControl
{ {
protected ComponentProcedure procedureParamsEntity; protected ComponentProcedure procedureParamsEntity;
protected virtual XmlSerializer GetSerializer() { return new XmlSerializer(GetType()); } public virtual XmlSerializer GetSerializer() { return new XmlSerializer(GetType()); }
public string ComponentName { get { return componentName; } } public string ComponentName { get { return componentName; } }
protected string componentName; protected string componentName;
@ -36,46 +36,37 @@ namespace TBF.BenchControl
} }
/// <summary> To be overridden </summary> /// <summary> To be overridden </summary>
public virtual void UpdateProcedureParams(ComponentProcedure dbEntity) public virtual void UpdateFromDbEntity(ComponentProcedure dbEntity)
{ {
} }
public void UpdateProcedureParams(string cmpntName, Procedure procedure) public void FromDbEntity(string cmpntName, Procedure procedure)
{ {
/// Search for an existing matching entity ComponentProcedure componentProc = procedure.GetProcedureParamsEntity(cmpntName);
foreach (var procPrms in procedure.MoreParams) if (componentProc != null)
{ {
if (procPrms.CmpntName.Equals(cmpntName)) UpdateFromDbEntity(componentProc);
{ return;
UpdateProcedureParams(procPrms); }
return;
}
}
/// Create a new entity and add it to the list test.MoreParams /// Create a new entity and add it to the list test.MoreParams
this.procedureParamsEntity = this.ToDbEntity(cmpntName, procedure); this.procedureParamsEntity = this.ToDbEntity(cmpntName, procedure);
this.procedure = procedure; this.procedureParamsEntity.SetParamsProvider(this as IParamsProvider);
this.procedure = procedure;
this.componentName = cmpntName; this.componentName = cmpntName;
procedure.MoreParams.Add(procedureParamsEntity); procedure.MoreParams.Add(procedureParamsEntity);
} }
public ComponentProcedure ToDbEntity(string componentName, Procedure procedure) public ComponentProcedure ToDbEntity(string cmpntName, Procedure procedure)
{ {
using (var writer = new StringWriter()) using (var writer = new StringWriter())
{ {
/// Serialize this class with parameters GetSerializer().Serialize(writer, this); /// Serialize this class with parameters
GetSerializer().Serialize(writer, this); return new ComponentProcedure(cmpntName, writer.ToString(), procedure); /// Return new ComponentProcedure entity
/// Create and return the ComponentProcedure entity
ComponentProcedure entity = new ComponentProcedure();
entity.CmpntName = componentName;
entity.Parameters = writer.ToString();
entity.Procedure = procedure;
return entity;
} }
} }
public void UpdateDbEntity() public void UpdateEmbeddedDbEntity()
{ {
using (var writer = new StringWriter()) using (var writer = new StringWriter())
{ {

View File

@ -1478,7 +1478,7 @@ namespace TBF.BenchControl.Sequences
Generic.IComponent testMethodComp = TbfComponents.FindComponent(test.Method); Generic.IComponent testMethodComp = TbfComponents.FindComponent(test.Method);
if (testMethodComp == null) break; if (testMethodComp == null) break;
testMethodComp.Cfg.UpdateTestParams(test); testMethodComp.Cfg.LoadTestParamsFromDB(test);
ISimultTestMethod simultTest = testMethodComp as ISimultTestMethod; ISimultTestMethod simultTest = testMethodComp as ISimultTestMethod;
MetersPath sensPath = StateMachine.GetMetersPath(test); MetersPath sensPath = StateMachine.GetMetersPath(test);
@ -1495,7 +1495,7 @@ namespace TBF.BenchControl.Sequences
} }
simultWithPurgingTests.Add(test); simultWithPurgingTests.Add(test);
simultWithPurgingParams.Add(testMethodComp.Cfg.GetTestParams().Clone() as Generic.ITestParams); simultWithPurgingParams.Add(testMethodComp.Cfg.GetRuntimeTestParamsProvider().Clone() as Generic.ITestParams);
simultWithPurgingCount++; simultWithPurgingCount++;
} }
@ -1514,7 +1514,7 @@ namespace TBF.BenchControl.Sequences
Generic.IComponent testMethodComp = TbfComponents.FindComponent(test.Method); Generic.IComponent testMethodComp = TbfComponents.FindComponent(test.Method);
if (testMethodComp == null) break; if (testMethodComp == null) break;
testMethodComp.Cfg.UpdateTestParams(test); testMethodComp.Cfg.LoadTestParamsFromDB(test);
ISimultTestMethod simultTest = testMethodComp as ISimultTestMethod; ISimultTestMethod simultTest = testMethodComp as ISimultTestMethod;
MetersPath sensPath = StateMachine.GetMetersPath(test); MetersPath sensPath = StateMachine.GetMetersPath(test);
@ -1531,7 +1531,7 @@ namespace TBF.BenchControl.Sequences
} }
simultWithEvacuationTests.Insert(0, test); simultWithEvacuationTests.Insert(0, test);
simultWithEvacuationParams.Insert(0, testMethodComp.Cfg.GetTestParams().Clone() as Generic.ITestParams); simultWithEvacuationParams.Insert(0, testMethodComp.Cfg.GetRuntimeTestParamsProvider().Clone() as Generic.ITestParams);
simultWithEvacuationCount++; simultWithEvacuationCount++;
} }
} }

View File

@ -415,7 +415,7 @@ namespace TBF.BenchControl
{ {
foreach (var cmpnt in components) foreach (var cmpnt in components)
{ {
cmpnt.Cfg.UpdateProcedureParams(procedure); cmpnt.Cfg.LoadProcedureParamsFromDB(procedure);
} }
} }
@ -423,7 +423,7 @@ namespace TBF.BenchControl
{ {
foreach (var cmpnt in components) foreach (var cmpnt in components)
{ {
cmpnt.Cfg.UpdateTestParams(test); cmpnt.Cfg.LoadTestParamsFromDB(test);
} }
} }

View File

@ -14,7 +14,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
public class CombinedWithDetTestParams : TestParamsBase, IParamsProvider, ITestParams public class CombinedWithDetTestParams : TestParamsBase, IParamsProvider, ITestParams
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(CombinedWithDetTestParams) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(CombinedWithDetTestParams) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } public override XmlSerializer GetSerializer() { return Serializer; }
public float TargetQ; /// Target=terminal flow durning detection when increasing or decreasing the flow public float TargetQ; /// Target=terminal flow durning detection when increasing or decreasing the flow
public float RelativeQfrom; /// Tested flow low range related to the detected flow public float RelativeQfrom; /// Tested flow low range related to the detected flow
@ -119,7 +119,7 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
return pars; return pars;
} }
public override void UpdateTestParams(ComponentTest dbEntity) public override void UpdateFromDbEntity(ComponentTest dbEntity)
{ {
if (dbEntity == null) return; if (dbEntity == null) return;
try try

View File

@ -13,20 +13,15 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection
public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestMethodCfg) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestMethodCfg) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } protected override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); } public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); }
/// <summary> Test parameters </summary> /// <summary> Test parameters </summary>
[XmlIgnore] [XmlIgnore]
public CombinedWithDetTestParams TestParams; public CombinedWithDetTestParams TestParams;
public override IParamsProvider GetTestParams() { return TestParams; } public override IParamsProvider GetRuntimeTestParamsProvider() { return TestParams; }
public override IParamsProvider CreateTestParams(Test test) public override IParamsProvider CreateTestParamsProvider() { return new CombinedWithDetTestParams(true); }
{
CombinedWithDetTestParams testParams = new CombinedWithDetTestParams(true);
testParams.UpdateTestParams(Name, test);
return testParams;
}
/// Private parameterless constructor invoked by all other (public) constructors /// Private parameterless constructor invoked by all other (public) constructors
TestMethodCfg() TestMethodCfg()

View File

@ -23,16 +23,11 @@ namespace TBF.BenchControl.TestMethods.Endurance
/// <summary> Test parameters </summary> /// <summary> Test parameters </summary>
[XmlIgnore] [XmlIgnore]
public TestParams TestParams; public TestParams TestParams;
public override IParamsProvider GetTestParams() { return TestParams; } public override IParamsProvider GetRuntimeTestParamsProvider() { return TestParams; }
public override IParamsProvider CreateTestParams(Test test) public override IParamsProvider CreateTestParamsProvider() { return new TestParams(true); }
{
TestParams testParams = new TestParams(true);
testParams.UpdateTestParams(Name, test);
return testParams;
}
#endif #endif
/// Private parameterless constructor invoked by all other (public) constructors /// Private parameterless constructor invoked by all other (public) constructors
TestMethodCfg() TestMethodCfg()
{ {
#if false #if false

View File

@ -14,7 +14,7 @@ namespace TBF.BenchControl.TestMethods.Endurance
public class TestParams : TestParamsBase, IParamsProvider, ITestParams public class TestParams : TestParamsBase, IParamsProvider, ITestParams
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestParams) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestParams) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } public override XmlSerializer GetSerializer() { return Serializer; }
public bool BooleanParam; /// Main meter readings are ignored during test (suitable for small flows) public bool BooleanParam; /// Main meter readings are ignored during test (suitable for small flows)
@ -79,7 +79,7 @@ namespace TBF.BenchControl.TestMethods.Endurance
return pars; return pars;
} }
public override void UpdateTestParams(ComponentTest dbEntity) public override void UpdateFromDbEntity(ComponentTest dbEntity)
{ {
if (dbEntity == null) return; if (dbEntity == null) return;
try try

View File

@ -13,20 +13,15 @@ namespace TBF.BenchControl.TestMethods.FixedStart.HeatMeters
public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestMethodCfg) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestMethodCfg) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } protected override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); } public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); }
/// <summary> Test parameters </summary> /// <summary> Test parameters </summary>
[XmlIgnore] [XmlIgnore]
public TestParams TestParams; public TestParams TestParams;
public override IParamsProvider GetTestParams() { return TestParams; } public override IParamsProvider GetRuntimeTestParamsProvider() { return TestParams; }
public override IParamsProvider CreateTestParams(Test test) public override IParamsProvider CreateTestParamsProvider() { return new TestParams(true); }
{
TestParams testParams = new TestParams(true);
testParams.UpdateTestParams(Name, test);
return testParams;
}
/// Private parameterless constructor invoked by all other (public) constructors /// Private parameterless constructor invoked by all other (public) constructors
TestMethodCfg() TestMethodCfg()

View File

@ -14,7 +14,7 @@ namespace TBF.BenchControl.TestMethods.FixedStart.HeatMeters
public class TestParams : TestParamsBase, IParamsProvider, ITestParams public class TestParams : TestParamsBase, IParamsProvider, ITestParams
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestParams) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestParams) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } public override XmlSerializer GetSerializer() { return Serializer; }
public float ErrorLimitLo; /// [%] public float ErrorLimitLo; /// [%]
public float ErrorLimitHi; /// [%] public float ErrorLimitHi; /// [%]
@ -157,7 +157,7 @@ namespace TBF.BenchControl.TestMethods.FixedStart.HeatMeters
return pars; return pars;
} }
public override void UpdateTestParams(ComponentTest dbEntity) public override void UpdateFromDbEntity(ComponentTest dbEntity)
{ {
if (dbEntity == null) return; if (dbEntity == null) return;
try try

View File

@ -13,20 +13,15 @@ namespace TBF.BenchControl.TestMethods.FixedStartDeferredEvaluation.HeatMeters
public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestMethodCfg) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestMethodCfg) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } protected override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); } public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); }
/// <summary> Test parameters </summary> /// <summary> Test parameters </summary>
[XmlIgnore] [XmlIgnore]
public TestParams TestParams; public TestParams TestParams; /// Created in constructor
public override IParamsProvider GetTestParams() { return TestParams; } public override IParamsProvider GetRuntimeTestParamsProvider() { return TestParams; }
public override IParamsProvider CreateTestParams(Test test) public override IParamsProvider CreateTestParamsProvider() { return new TestParams(true); }
{
TestParams testParams = new TestParams(true);
testParams.UpdateTestParams(Name, test);
return testParams;
}
/// Private parameterless constructor invoked by all other (public) constructors /// Private parameterless constructor invoked by all other (public) constructors
TestMethodCfg() TestMethodCfg()

View File

@ -14,7 +14,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartDeferredEvaluation.HeatMeters
public class TestParams : TestParamsBase, IParamsProvider, ITestParams public class TestParams : TestParamsBase, IParamsProvider, ITestParams
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestParams) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestParams) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } public override XmlSerializer GetSerializer() { return Serializer; }
public float ErrorLimitLo; /// [%] public float ErrorLimitLo; /// [%]
public float ErrorLimitHi; /// [%] public float ErrorLimitHi; /// [%]
@ -157,7 +157,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartDeferredEvaluation.HeatMeters
return pars; return pars;
} }
public override void UpdateTestParams(ComponentTest dbEntity) public override void UpdateFromDbEntity(ComponentTest dbEntity)
{ {
if (dbEntity == null) return; if (dbEntity == null) return;
try try

View File

@ -13,20 +13,15 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection.HeatMeters
public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestMethodCfg) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestMethodCfg) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } protected override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); } public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); }
/// <summary> Test parameters </summary> /// <summary> Test parameters </summary>
[XmlIgnore] [XmlIgnore]
public TestParams TestParams; public TestParams TestParams;
public override IParamsProvider GetTestParams() { return TestParams; } public override IParamsProvider GetRuntimeTestParamsProvider() { return TestParams; }
public override IParamsProvider CreateTestParams(Test test) public override IParamsProvider CreateTestParamsProvider() { return new TestParams(true); }
{
TestParams testParams = new TestParams(true);
testParams.UpdateTestParams(Name, test);
return testParams;
}
/// Private parameterless constructor invoked by all other (public) constructors /// Private parameterless constructor invoked by all other (public) constructors
TestMethodCfg() TestMethodCfg()

View File

@ -14,7 +14,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection.HeatMeters
public class TestParams : TestParamsBase, IParamsProvider, ITestParams public class TestParams : TestParamsBase, IParamsProvider, ITestParams
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestParams) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestParams) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } public override XmlSerializer GetSerializer() { return Serializer; }
public float ErrorLimitLo; /// [%] public float ErrorLimitLo; /// [%]
public float ErrorLimitHi; /// [%] public float ErrorLimitHi; /// [%]
@ -157,7 +157,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection.HeatMeters
return pars; return pars;
} }
public override void UpdateTestParams(ComponentTest dbEntity) public override void UpdateFromDbEntity(ComponentTest dbEntity)
{ {
if (dbEntity == null) return; if (dbEntity == null) return;
try try

View File

@ -13,20 +13,15 @@ namespace TBF.BenchControl.TestMethods.FlyingStart.Compound
public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestMethodCfg) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestMethodCfg) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } protected override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); } public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); }
/// <summary> Test parameters </summary> /// <summary> Test parameters </summary>
[XmlIgnore] [XmlIgnore]
public TestParams TestParams; public TestParams TestParams;
public override IParamsProvider GetTestParams() { return TestParams; } public override IParamsProvider GetRuntimeTestParamsProvider() { return TestParams; }
public override IParamsProvider CreateTestParams(Test test) public override IParamsProvider CreateTestParamsProvider() { return new TestParams(true); }
{
TestParams testParams = new TestParams(true);
testParams.UpdateTestParams(Name, test);
return testParams;
}
/// Private parameterless constructor invoked by all other (public) constructors /// Private parameterless constructor invoked by all other (public) constructors
TestMethodCfg() TestMethodCfg()

View File

@ -14,7 +14,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStart.Compound
public class TestParams : TestParamsBase, IParamsProvider, ITestParams public class TestParams : TestParamsBase, IParamsProvider, ITestParams
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestParams) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestParams) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } public override XmlSerializer GetSerializer() { return Serializer; }
public bool SupressTrills; /// Main meter readings are ignored during test (suitable for small flows) public bool SupressTrills; /// Main meter readings are ignored during test (suitable for small flows)
@ -79,7 +79,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStart.Compound
return pars; return pars;
} }
public override void UpdateTestParams(ComponentTest dbEntity) public override void UpdateFromDbEntity(ComponentTest dbEntity)
{ {
if (dbEntity == null) return; if (dbEntity == null) return;
try try

View File

@ -13,20 +13,15 @@ namespace TBF.BenchControl.TestMethods.FlyingStart.HeatMeters
public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestMethodCfg) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestMethodCfg) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } protected override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); } public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); }
/// <summary> Test parameters </summary> /// <summary> Test parameters </summary>
[XmlIgnore] [XmlIgnore]
public TestParams TestParams; public TestParams TestParams;
public override IParamsProvider GetTestParams() { return TestParams; } public override IParamsProvider GetRuntimeTestParamsProvider() { return TestParams; }
public override IParamsProvider CreateTestParams(Test test) public override IParamsProvider CreateTestParamsProvider() { return new TestParams(true); }
{
TestParams testParams = new TestParams(true);
testParams.UpdateTestParams(Name, test);
return testParams;
}
/// Private parameterless constructor invoked by all other (public) constructors /// Private parameterless constructor invoked by all other (public) constructors
TestMethodCfg() TestMethodCfg()

View File

@ -14,7 +14,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStart.HeatMeters
public class TestParams : TestParamsBase, IParamsProvider, ITestParams public class TestParams : TestParamsBase, IParamsProvider, ITestParams
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestParams) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestParams) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } public override XmlSerializer GetSerializer() { return Serializer; }
public float ErrorLimitLo; /// [%] public float ErrorLimitLo; /// [%]
public float ErrorLimitHi; /// [%] public float ErrorLimitHi; /// [%]
@ -157,7 +157,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStart.HeatMeters
return pars; return pars;
} }
public override void UpdateTestParams(ComponentTest dbEntity) public override void UpdateFromDbEntity(ComponentTest dbEntity)
{ {
if (dbEntity == null) return; if (dbEntity == null) return;
try try

View File

@ -13,20 +13,15 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl.Compoun
public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestMethodCfg) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestMethodCfg) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } protected override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); } public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); }
/// <summary> Test parameters </summary> /// <summary> Test parameters </summary>
[XmlIgnore] [XmlIgnore]
public TestParams TestParams; public TestParams TestParams;
public override IParamsProvider GetTestParams() { return TestParams; } public override IParamsProvider GetRuntimeTestParamsProvider() { return TestParams; }
public override IParamsProvider CreateTestParams(Test test) public override IParamsProvider CreateTestParamsProvider() { return new TestParams(true); }
{
TestParams testParams = new TestParams(true);
testParams.UpdateTestParams(Name, test);
return testParams;
}
/// Private parameterless constructor invoked by all other (public) constructors /// Private parameterless constructor invoked by all other (public) constructors
TestMethodCfg() TestMethodCfg()

View File

@ -14,7 +14,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl.Compoun
public class TestParams : TestParamsBase, IParamsProvider, ITestParams public class TestParams : TestParamsBase, IParamsProvider, ITestParams
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestParams) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestParams) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } public override XmlSerializer GetSerializer() { return Serializer; }
public float NextTestVolume; public float NextTestVolume;
public bool SupressTrills; /// Main meter readings are ignored during test (suitable for small flows) public bool SupressTrills; /// Main meter readings are ignored during test (suitable for small flows)
@ -89,7 +89,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl.Compoun
return pars; return pars;
} }
public override void UpdateTestParams(ComponentTest dbEntity) public override void UpdateFromDbEntity(ComponentTest dbEntity)
{ {
if (dbEntity == null) return; if (dbEntity == null) return;
try try

View File

@ -13,20 +13,15 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl.HeatMet
public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestMethodCfg) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestMethodCfg) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } protected override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); } public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); }
/// <summary> Test parameters </summary> /// <summary> Test parameters </summary>
[XmlIgnore] [XmlIgnore]
public TestParams TestParams; public TestParams TestParams;
public override IParamsProvider GetTestParams() { return TestParams; } public override IParamsProvider GetRuntimeTestParamsProvider() { return TestParams; }
public override IParamsProvider CreateTestParams(Test test) public override IParamsProvider CreateTestParamsProvider() { return new TestParams(true); }
{
TestParams testParams = new TestParams(true);
testParams.UpdateTestParams(Name, test);
return testParams;
}
/// Private parameterless constructor invoked by all other (public) constructors /// Private parameterless constructor invoked by all other (public) constructors
TestMethodCfg() TestMethodCfg()

View File

@ -14,7 +14,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl.HeatMet
public class TestParams : TestParamsBase, IParamsProvider, ITestParams public class TestParams : TestParamsBase, IParamsProvider, ITestParams
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestParams) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestParams) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } public override XmlSerializer GetSerializer() { return Serializer; }
public float NextTestVolume; /// [l] public float NextTestVolume; /// [l]
public float ErrorLimitLo; /// [%] public float ErrorLimitLo; /// [%]
@ -166,7 +166,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl.HeatMet
return pars; return pars;
} }
public override void UpdateTestParams(ComponentTest dbEntity) public override void UpdateFromDbEntity(ComponentTest dbEntity)
{ {
if (dbEntity == null) return; if (dbEntity == null) return;
try try

View File

@ -13,20 +13,15 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl.Single
public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestMethodCfg) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestMethodCfg) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } protected override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); } public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); }
/// <summary> Test parameters </summary> /// <summary> Test parameters </summary>
[XmlIgnore] [XmlIgnore]
public TestParams TestParams; public TestParams TestParams;
public override IParamsProvider GetTestParams() { return TestParams; } public override IParamsProvider GetRuntimeTestParamsProvider() { return TestParams; }
public override IParamsProvider CreateTestParams(Test test) public override IParamsProvider CreateTestParamsProvider() { return new TestParams(true); }
{
TestParams testParams = new TestParams(true);
testParams.UpdateTestParams(Name, test);
return testParams;
}
/// Private parameterless constructor invoked by all other (public) constructors /// Private parameterless constructor invoked by all other (public) constructors
TestMethodCfg() TestMethodCfg()

View File

@ -14,7 +14,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl.Single
public class TestParams : TestParamsBase, IParamsProvider, ITestParams public class TestParams : TestParamsBase, IParamsProvider, ITestParams
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestParams) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestParams) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } public override XmlSerializer GetSerializer() { return Serializer; }
public float NextTestVolume; /// [l] public float NextTestVolume; /// [l]
@ -80,7 +80,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl.Single
return pars; return pars;
} }
public override void UpdateTestParams(ComponentTest dbEntity) public override void UpdateFromDbEntity(ComponentTest dbEntity)
{ {
if (dbEntity == null) return; if (dbEntity == null) return;
try try

View File

@ -13,20 +13,15 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged.Compound
public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestMethodCfg) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestMethodCfg) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } protected override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); } public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); }
/// <summary> Test parameters </summary> /// <summary> Test parameters </summary>
[XmlIgnore] [XmlIgnore]
public TestParams TestParams; public TestParams TestParams;
public override IParamsProvider GetTestParams() { return TestParams; } public override IParamsProvider GetRuntimeTestParamsProvider() { return TestParams; }
public override IParamsProvider CreateTestParams(Test test) public override IParamsProvider CreateTestParamsProvider() { return new TestParams(true); }
{
TestParams testParams = new TestParams(true);
testParams.UpdateTestParams(Name, test);
return testParams;
}
/// Private parameterless constructor invoked by all other (public) constructors /// Private parameterless constructor invoked by all other (public) constructors
TestMethodCfg() TestMethodCfg()

View File

@ -14,7 +14,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged.Compound
public class TestParams : TestParamsBase, IParamsProvider, ITestParams public class TestParams : TestParamsBase, IParamsProvider, ITestParams
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestParams) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestParams) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } public override XmlSerializer GetSerializer() { return Serializer; }
public float VolumeToTank; public float VolumeToTank;
public bool SupressTrills; /// Main meter readings are ignored during test (suitable for small flows) public bool SupressTrills; /// Main meter readings are ignored during test (suitable for small flows)
@ -89,7 +89,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged.Compound
return pars; return pars;
} }
public override void UpdateTestParams(ComponentTest dbEntity) public override void UpdateFromDbEntity(ComponentTest dbEntity)
{ {
if (dbEntity == null) return; if (dbEntity == null) return;
try try

View File

@ -13,20 +13,15 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged.HeatMeters
public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestMethodCfg) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestMethodCfg) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } protected override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); } public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); }
/// <summary> Test parameters </summary> /// <summary> Test parameters </summary>
[XmlIgnore] [XmlIgnore]
public TestParams TestParams; public TestParams TestParams;
public override IParamsProvider GetTestParams() { return TestParams; } public override IParamsProvider GetRuntimeTestParamsProvider() { return TestParams; }
public override IParamsProvider CreateTestParams(Test test) public override IParamsProvider CreateTestParamsProvider() { return new TestParams(true); }
{
TestParams testParams = new TestParams(true);
testParams.UpdateTestParams(Name, test);
return testParams;
}
/// Private parameterless constructor invoked by all other (public) constructors /// Private parameterless constructor invoked by all other (public) constructors
TestMethodCfg() TestMethodCfg()

View File

@ -14,7 +14,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged.HeatMeters
public class TestParams : TestParamsBase, IParamsProvider, ITestParams public class TestParams : TestParamsBase, IParamsProvider, ITestParams
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestParams) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestParams) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } public override XmlSerializer GetSerializer() { return Serializer; }
public float VolumeToTank; /// [l] public float VolumeToTank; /// [l]
public float ErrorLimitLo; /// [%] public float ErrorLimitLo; /// [%]
@ -166,7 +166,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged.HeatMeters
return pars; return pars;
} }
public override void UpdateTestParams(ComponentTest dbEntity) public override void UpdateFromDbEntity(ComponentTest dbEntity)
{ {
if (dbEntity == null) return; if (dbEntity == null) return;
try try

View File

@ -13,20 +13,15 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged.Single
public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestMethodCfg) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestMethodCfg) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } protected override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); } public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); }
/// <summary> Test parameters </summary> /// <summary> Test parameters </summary>
[XmlIgnore] [XmlIgnore]
public TestParams TestParams; public TestParams TestParams;
public override IParamsProvider GetTestParams() { return TestParams; } public override IParamsProvider GetRuntimeTestParamsProvider() { return TestParams; }
public override IParamsProvider CreateTestParams(Test test) public override IParamsProvider CreateTestParamsProvider() { return new TestParams(true); }
{
TestParams testParams = new TestParams(true);
testParams.UpdateTestParams(Name, test);
return testParams;
}
/// Private parameterless constructor invoked by all other (public) constructors /// Private parameterless constructor invoked by all other (public) constructors
TestMethodCfg() TestMethodCfg()

View File

@ -14,7 +14,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged.Single
public class TestParams : TestParamsBase, IParamsProvider, ITestParams public class TestParams : TestParamsBase, IParamsProvider, ITestParams
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestParams) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestParams) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } public override XmlSerializer GetSerializer() { return Serializer; }
public float VolumeToTank; /// [l] public float VolumeToTank; /// [l]
@ -80,7 +80,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged.Single
return pars; return pars;
} }
public override void UpdateTestParams(ComponentTest dbEntity) public override void UpdateFromDbEntity(ComponentTest dbEntity)
{ {
if (dbEntity == null) return; if (dbEntity == null) return;
try try

View File

@ -14,7 +14,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection.Compound
public class CombinedTestParams : TestParamsBase, IParamsProvider, ITestParams public class CombinedTestParams : TestParamsBase, IParamsProvider, ITestParams
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(CombinedTestParams) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(CombinedTestParams) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } public override XmlSerializer GetSerializer() { return Serializer; }
public bool SupressTrills; /// Main meter readings are ignored during test (suitable for small flows) public bool SupressTrills; /// Main meter readings are ignored during test (suitable for small flows)
@ -79,7 +79,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection.Compound
return pars; return pars;
} }
public override void UpdateTestParams(ComponentTest dbEntity) public override void UpdateFromDbEntity(ComponentTest dbEntity)
{ {
if (dbEntity == null) return; if (dbEntity == null) return;
try try

View File

@ -13,20 +13,15 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection.Compound
public class TestMethodCfg : ComponentCfgBase, IComponentCfg public class TestMethodCfg : ComponentCfgBase, IComponentCfg
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestMethodCfg) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestMethodCfg) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } protected override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); } public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); }
/// <summary> Test parameters </summary> /// <summary> Test parameters </summary>
[XmlIgnore] [XmlIgnore]
public CombinedTestParams TestParams; public CombinedTestParams TestParams;
public override IParamsProvider GetTestParams() { return TestParams; } public override IParamsProvider GetRuntimeTestParamsProvider() { return TestParams; }
public override IParamsProvider CreateTestParams(Test test) public override IParamsProvider CreateTestParamsProvider() { return new CombinedTestParams(true); }
{
CombinedTestParams testParams = new CombinedTestParams(true);
testParams.UpdateTestParams(Name, test);
return testParams;
}
/// Private parameterless constructor invoked by all other (public) constructors /// Private parameterless constructor invoked by all other (public) constructors
TestMethodCfg() TestMethodCfg()

View File

@ -13,20 +13,15 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection.HeatMeters
public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestMethodCfg) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestMethodCfg) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } protected override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); } public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); }
/// <summary> Test parameters </summary> /// <summary> Test parameters </summary>
[XmlIgnore] [XmlIgnore]
public TestParams TestParams; public TestParams TestParams;
public override IParamsProvider GetTestParams() { return TestParams; } public override IParamsProvider GetRuntimeTestParamsProvider() { return TestParams; }
public override IParamsProvider CreateTestParams(Test test) public override IParamsProvider CreateTestParamsProvider() { return new TestParams(true); }
{
TestParams testParams = new TestParams(true);
testParams.UpdateTestParams(Name, test);
return testParams;
}
/// Private parameterless constructor invoked by all other (public) constructors /// Private parameterless constructor invoked by all other (public) constructors
TestMethodCfg() TestMethodCfg()

View File

@ -14,7 +14,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection.HeatMeters
public class TestParams : TestParamsBase, IParamsProvider, ITestParams public class TestParams : TestParamsBase, IParamsProvider, ITestParams
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestParams) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestParams) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } public override XmlSerializer GetSerializer() { return Serializer; }
public float ErrorLimitLo; /// [%] public float ErrorLimitLo; /// [%]
public float ErrorLimitHi; /// [%] public float ErrorLimitHi; /// [%]
@ -157,7 +157,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection.HeatMeters
return pars; return pars;
} }
public override void UpdateTestParams(ComponentTest dbEntity) public override void UpdateFromDbEntity(ComponentTest dbEntity)
{ {
if (dbEntity == null) return; if (dbEntity == null) return;
try try

View File

@ -14,7 +14,7 @@ namespace TBF.BenchControl.TestMethods.LeakTest
public class LeakTestParams : TestParamsBase, IParamsProvider, ITestParams public class LeakTestParams : TestParamsBase, IParamsProvider, ITestParams
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(LeakTestParams) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(LeakTestParams) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } public override XmlSerializer GetSerializer() { return Serializer; }
public float PressureLo; /// Presure range low limit in [bar] public float PressureLo; /// Presure range low limit in [bar]
public float PressureHi; /// Presure range high limit in [bar] public float PressureHi; /// Presure range high limit in [bar]
@ -104,7 +104,7 @@ namespace TBF.BenchControl.TestMethods.LeakTest
return pars; return pars;
} }
public override void UpdateTestParams(ComponentTest dbEntity) public override void UpdateFromDbEntity(ComponentTest dbEntity)
{ {
if (dbEntity == null) return; if (dbEntity == null) return;
try try

View File

@ -13,20 +13,15 @@ namespace TBF.BenchControl.TestMethods.LeakTest
public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestMethodCfg) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestMethodCfg) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } protected override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); } public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); }
/// <summary> Test parameters </summary> /// <summary> Test parameters </summary>
[XmlIgnore] [XmlIgnore]
public LeakTestParams TestParams; public LeakTestParams TestParams;
public override IParamsProvider GetTestParams() { return TestParams; } public override IParamsProvider GetRuntimeTestParamsProvider() { return TestParams; }
public override IParamsProvider CreateTestParams(Test test) public override IParamsProvider CreateTestParamsProvider() { return new LeakTestParams(true); }
{
LeakTestParams testParams = new LeakTestParams(true);
testParams.UpdateTestParams(Name, test);
return testParams;
}
/// Private parameterless constructor invoked by all other (public) constructors /// Private parameterless constructor invoked by all other (public) constructors
TestMethodCfg() TestMethodCfg()

View File

@ -14,7 +14,7 @@ namespace TBF.BenchControl.TestMethods.PMaxTest
public class PMaxTestParams : TestParamsBase, IParamsProvider, ITestParams public class PMaxTestParams : TestParamsBase, IParamsProvider, ITestParams
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(PMaxTestParams) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(PMaxTestParams) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } public override XmlSerializer GetSerializer() { return Serializer; }
public float PressureLo; /// Presure range low limit in [bar] public float PressureLo; /// Presure range low limit in [bar]
public float PressureHi; /// Presure range high limit in [bar] public float PressureHi; /// Presure range high limit in [bar]
@ -97,7 +97,7 @@ namespace TBF.BenchControl.TestMethods.PMaxTest
return pars; return pars;
} }
public override void UpdateTestParams(ComponentTest dbEntity) public override void UpdateFromDbEntity(ComponentTest dbEntity)
{ {
if (dbEntity == null) return; if (dbEntity == null) return;
try try

View File

@ -13,20 +13,15 @@ namespace TBF.BenchControl.TestMethods.PMaxTest
public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestMethodCfg) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestMethodCfg) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } protected override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); } public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); }
/// <summary> Test parameters </summary> /// <summary> Test parameters </summary>
[XmlIgnore] [XmlIgnore]
public PMaxTestParams TestParams; public PMaxTestParams TestParams;
public override IParamsProvider GetTestParams() { return TestParams; } public override IParamsProvider GetRuntimeTestParamsProvider() { return TestParams; }
public override IParamsProvider CreateTestParams(Test test) public override IParamsProvider CreateTestParamsProvider() { return new PMaxTestParams(true); }
{
PMaxTestParams testParams = new PMaxTestParams(true);
testParams.UpdateTestParams(Name, test);
return testParams;
}
/// Private parameterless constructor invoked by all other (public) constructors /// Private parameterless constructor invoked by all other (public) constructors
TestMethodCfg() TestMethodCfg()

View File

@ -14,7 +14,7 @@ namespace TBF.BenchControl.TestMethods.SensitivityTest
public class SensitivityTestParams : TestParamsBase, IParamsProvider, ITestParams public class SensitivityTestParams : TestParamsBase, IParamsProvider, ITestParams
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(SensitivityTestParams) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(SensitivityTestParams) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } public override XmlSerializer GetSerializer() { return Serializer; }
public float TargetQ; /// Target=terminal flow durning detection when increasing or decreasing the flow public float TargetQ; /// Target=terminal flow durning detection when increasing or decreasing the flow
public float RateOfChange; /// Each step is calculated as (TargetQfrom - Qfrom) * RateOfChange, text form is displayed in % (*100) public float RateOfChange; /// Each step is calculated as (TargetQfrom - Qfrom) * RateOfChange, text form is displayed in % (*100)
@ -103,7 +103,7 @@ namespace TBF.BenchControl.TestMethods.SensitivityTest
return pars; return pars;
} }
public override void UpdateTestParams(ComponentTest dbEntity) public override void UpdateFromDbEntity(ComponentTest dbEntity)
{ {
if (dbEntity == null) return; if (dbEntity == null) return;
try try

View File

@ -13,20 +13,15 @@ namespace TBF.BenchControl.TestMethods.SensitivityTest
public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestMethodCfg) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestMethodCfg) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } protected override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); } public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); }
/// <summary> Test parameters </summary> /// <summary> Test parameters </summary>
[XmlIgnore] [XmlIgnore]
public SensitivityTestParams TestParams; public SensitivityTestParams TestParams;
public override IParamsProvider GetTestParams() { return TestParams; } public override IParamsProvider GetRuntimeTestParamsProvider() { return TestParams; }
public override IParamsProvider CreateTestParams(Test test) public override IParamsProvider CreateTestParamsProvider() { return new SensitivityTestParams(true); }
{
SensitivityTestParams testParams = new SensitivityTestParams(true);
testParams.UpdateTestParams(Name, test);
return testParams;
}
/// Private parameterless constructor invoked by all other (public) constructors /// Private parameterless constructor invoked by all other (public) constructors
TestMethodCfg() TestMethodCfg()

View File

@ -13,7 +13,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestMethodCfg) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestMethodCfg) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } protected override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); } public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); }
@ -33,13 +33,9 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
/// <summary> Test parameters </summary> /// <summary> Test parameters </summary>
[XmlIgnore] [XmlIgnore]
public iPerlCommunicationParams TestParams; public iPerlCommunicationParams TestParams;
public override IParamsProvider GetTestParams() { return TestParams; }
public override IParamsProvider CreateTestParams(Test test) public override IParamsProvider GetRuntimeTestParamsProvider() { return TestParams; }
{ public override IParamsProvider CreateTestParamsProvider() { return new iPerlCommunicationParams(true); }
iPerlCommunicationParams testParams = new iPerlCommunicationParams(true);
testParams.UpdateTestParams(Name, test);
return testParams;
}
/// Private parameterless constructor invoked by all other (public) constructors /// Private parameterless constructor invoked by all other (public) constructors
TestMethodCfg() TestMethodCfg()
@ -55,7 +51,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
RfidPortNrBoard1 = 53; RfidPortNrBoard1 = 53;
RfidPortNrBoard1 = 54; RfidPortNrBoard1 = 54;
TestParams = new iPerlCommunicationParams(true); TestParams = CreateTestParamsProvider() as iPerlCommunicationParams;
} }
public TestMethodCfg(IComponentFactory factory) public TestMethodCfg(IComponentFactory factory)

View File

@ -14,7 +14,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
public class iPerlCommunicationParams : TestParamsBase, IParamsProvider, ITestParams public class iPerlCommunicationParams : TestParamsBase, IParamsProvider, ITestParams
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(iPerlCommunicationParams) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(iPerlCommunicationParams) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } public override XmlSerializer GetSerializer() { return Serializer; }
public string Activity; /// Communication activity public string Activity; /// Communication activity
public bool SimultWithPrevious; public bool SimultWithPrevious;
@ -94,7 +94,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
return pars; return pars;
} }
public override void UpdateTestParams(ComponentTest dbEntity) public override void UpdateFromDbEntity(ComponentTest dbEntity)
{ {
if (dbEntity == null) return; if (dbEntity == null) return;
try try

View File

@ -16,7 +16,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
public class IperlHeadCfg : ComponentCfgBase, Generic.IComponentCfg public class IperlHeadCfg : ComponentCfgBase, Generic.IComponentCfg
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(IperlHeadCfg) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(IperlHeadCfg) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } protected override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new IperlHeadCfgCtrl(); } public IComponentCfgCtrl GetControl() { return new IperlHeadCfgCtrl(); }
@ -34,13 +34,8 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
/// <summary> Procedure parameters </summary> /// <summary> Procedure parameters </summary>
[XmlIgnore] [XmlIgnore]
public ProcParams ProcParams; public ProcParams ProcParams;
public override IParamsProvider GetProcedureParams() { return ProcParams; } public override IParamsProvider GetRuntimeProcParamsProvider() { return ProcParams; }
public override IParamsProvider CreateProcedureParams(Procedure procedure) public override IParamsProvider CreateProcParamsProvider() { return new ProcParams(true); }
{
ProcParams procParams = new ProcParams(true);
procParams.UpdateProcedureParams(Name, procedure);
return procParams;
}
[XmlIgnore] [XmlIgnore]
public MeterType MeterType { get { return (ProcParams != null) ? ProcParams.MeterType : MeterType.AutoDetect; } } public MeterType MeterType { get { return (ProcParams != null) ? ProcParams.MeterType : MeterType.AutoDetect; } }
@ -54,8 +49,8 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
OptoComPortNr = 10; OptoComPortNr = 10;
RfidComPortNr = 0; /// = use mux. board RfidComPortNr = 0; /// = use mux. board
MuxBoardNr = 1; MuxBoardNr = 1;
ProcParams = new ProcParams(true); ProcParams = CreateProcParamsProvider() as ProcParams;
} }
public IperlHeadCfg(IComponentFactory factory) public IperlHeadCfg(IComponentFactory factory)
: this() : this()

View File

@ -14,7 +14,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
public class ProcParams : ProcedureParamsBase, IParamsProvider, IProcedureParams public class ProcParams : ProcedureParamsBase, IParamsProvider, IProcedureParams
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(ProcParams) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(ProcParams) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } public override XmlSerializer GetSerializer() { return Serializer; }
public MeterType MeterType; public MeterType MeterType;
public float CalibTarget; /// Target error after calibration in [%] public float CalibTarget; /// Target error after calibration in [%]
@ -143,7 +143,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
return pars; return pars;
} }
public override void UpdateProcedureParams(ComponentProcedure dbEntity) public override void UpdateFromDbEntity(ComponentProcedure dbEntity)
{ {
if (dbEntity == null) return; if (dbEntity == null) return;
try try

View File

@ -14,7 +14,7 @@ namespace TBF.BenchControl
{ {
protected ComponentTest testParamsEntity; protected ComponentTest testParamsEntity;
protected virtual XmlSerializer GetSerializer() { return new XmlSerializer(GetType()); } public virtual XmlSerializer GetSerializer() { return new XmlSerializer(GetType()); }
public string ComponentName { get { return componentName; } } public string ComponentName { get { return componentName; } }
protected string componentName; protected string componentName;
@ -36,47 +36,38 @@ namespace TBF.BenchControl
} }
/// <summary> To be overridden </summary> /// <summary> To be overridden </summary>
public virtual void UpdateTestParams(ComponentTest dbEntity) public virtual void UpdateFromDbEntity(ComponentTest dbEntity)
{ {
} }
public void UpdateTestParams(string cmpntName, Test test) public void FromDbEntity(string cmpntName, Test test)
{ {
/// Search for an existing matching entity ComponentTest componentTest = test.GetTestParamsEntity(cmpntName);
foreach (var tstPrms in test.MoreParams) if (componentTest != null)
{ {
if (tstPrms.CmpntName.Equals(cmpntName)) UpdateFromDbEntity(componentTest);
{ return;
UpdateTestParams(tstPrms);
return;
}
} }
/// Create a new entity and add it to the list test.MoreParams /// Create a new entity and add it to the list test.MoreParams
InitializeAll(); InitializeAll();
this.testParamsEntity = this.ToDbEntity(cmpntName, test); this.testParamsEntity = this.ToDbEntity(cmpntName, test);
this.testParamsEntity.SetParamsProvider(this as IParamsProvider);
this.test = test; this.test = test;
this.componentName = cmpntName; this.componentName = cmpntName;
test.MoreParams.Add(testParamsEntity); test.MoreParams.Add(testParamsEntity);
} }
public ComponentTest ToDbEntity(string componentName, Test test) public ComponentTest ToDbEntity(string cmpntName, Test test)
{ {
using (var writer = new StringWriter()) using (var writer = new StringWriter())
{ {
/// Serialize this class with parameters GetSerializer().Serialize(writer, this); /// Serialize this class with parameters
GetSerializer().Serialize(writer, this); return new ComponentTest(cmpntName, writer.ToString(), test); /// Return new ComponentTest entity
/// Create and return the ComponentTest entity
ComponentTest entity = new ComponentTest();
entity.CmpntName = componentName;
entity.Parameters = writer.ToString();
entity.Test = test;
return entity;
} }
} }
public void UpdateDbEntity() public void UpdateEmbeddedDbEntity()
{ {
using (var writer = new StringWriter()) using (var writer = new StringWriter())
{ {

View File

@ -10,7 +10,7 @@ namespace TBF.BenchControl.Various.ErrorFlags
public class ErrorsCfg : ComponentCfgBase, IComponentCfg public class ErrorsCfg : ComponentCfgBase, IComponentCfg
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(ErrorsCfg) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(ErrorsCfg) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } protected override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new ErrorsCfgCtrl(); } public IComponentCfgCtrl GetControl() { return new ErrorsCfgCtrl(); }
@ -24,13 +24,8 @@ namespace TBF.BenchControl.Various.ErrorFlags
/// <summary> Test parameters </summary> /// <summary> Test parameters </summary>
[XmlIgnore] [XmlIgnore]
public TestParams TestParams; public TestParams TestParams;
public override IParamsProvider GetTestParams() { return TestParams; } public override IParamsProvider GetRuntimeTestParamsProvider() { return TestParams; }
public override IParamsProvider CreateTestParams(Test test) public override IParamsProvider CreateTestParamsProvider() { return new TestParams(true); }
{
TestParams procParams = new TestParams(true);
procParams.UpdateTestParams(Name, test);
return procParams;
}
/// Private parameterless constructor invoked by all other (public) constructors /// Private parameterless constructor invoked by all other (public) constructors
ErrorsCfg() ErrorsCfg()

View File

@ -12,7 +12,7 @@ namespace TBF.BenchControl.Various.ErrorFlags
public class TestParams : TestParamsBase, IParamsProvider, ITestParams public class TestParams : TestParamsBase, IParamsProvider, ITestParams
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestParams) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestParams) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } public override XmlSerializer GetSerializer() { return Serializer; }
public ErrorFlagsMode Mode; /// 0 = Off, 1 = Info (show only), 2 = On (show and evaluate) public ErrorFlagsMode Mode; /// 0 = Off, 1 = Info (show only), 2 = On (show and evaluate)
public bool E1; public bool E1;
@ -338,7 +338,7 @@ namespace TBF.BenchControl.Various.ErrorFlags
return pars; return pars;
} }
public override void UpdateTestParams(ComponentTest dbEntity) public override void UpdateFromDbEntity(ComponentTest dbEntity)
{ {
if (dbEntity == null) return; if (dbEntity == null) return;
try try

View File

@ -14,7 +14,7 @@ namespace TBF.BenchControl.WaterMeters.Munich
public class ProcParams : ProcedureParamsBase, IParamsProvider, IProcedureParams public class ProcParams : ProcedureParamsBase, IParamsProvider, IProcedureParams
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(ProcParams) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(ProcParams) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } public override XmlSerializer GetSerializer() { return Serializer; }
public string ProductName; /// Znak fabryczny (PL) public string ProductName; /// Znak fabryczny (PL)
public string Producer; /// Producent (PL), Hersteller (D) public string Producer; /// Producent (PL), Hersteller (D)
@ -164,7 +164,7 @@ namespace TBF.BenchControl.WaterMeters.Munich
return pars; return pars;
} }
public override void UpdateProcedureParams(ComponentProcedure dbEntity) public override void UpdateFromDbEntity(ComponentProcedure dbEntity)
{ {
if (dbEntity == null) return; if (dbEntity == null) return;
try try

View File

@ -14,28 +14,23 @@ namespace TBF.BenchControl.WaterMeters.Munich
public class WaterMeterCfg : ComponentCfgBase, Generic.IComponentCfg public class WaterMeterCfg : ComponentCfgBase, Generic.IComponentCfg
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(WaterMeterCfg) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(WaterMeterCfg) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } protected override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new WaterMeterCfgCtrl(); } public IComponentCfgCtrl GetControl() { return new WaterMeterCfgCtrl(); }
/// <summary> Procedure parameters </summary> /// <summary> Procedure parameters </summary>
[XmlIgnore] [XmlIgnore]
public ProcParams ProcParams; public ProcParams ProcParams;
public override IParamsProvider GetProcedureParams() { return ProcParams; } public override IParamsProvider GetRuntimeProcParamsProvider() { return ProcParams; }
public override IParamsProvider CreateProcedureParams(Procedure procedure) public override IParamsProvider CreateProcParamsProvider() { return new ProcParams(true); }
{
ProcParams procParams = new ProcParams(true);
procParams.UpdateProcedureParams(Name, procedure);
return procParams;
}
/// Private parameterless constructor invoked by all other (public) constructors /// Private parameterless constructor invoked by all other (public) constructors
WaterMeterCfg() WaterMeterCfg()
{ {
Name = "WM"; Name = "WM";
ParentName = string.Empty; ParentName = string.Empty;
ProcParams = new ProcParams(true); ProcParams = CreateProcParamsProvider() as ProcParams;
} }
public WaterMeterCfg(IComponentFactory factory) public WaterMeterCfg(IComponentFactory factory)
: this() : this()

View File

@ -14,7 +14,7 @@ namespace TBF.BenchControl.WaterMeters.WaterMeter
public class ProcParams : ProcedureParamsBase, IParamsProvider, IProcedureParams public class ProcParams : ProcedureParamsBase, IParamsProvider, IProcedureParams
{ {
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(ProcParams) })[0]; public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(ProcParams) })[0];
protected override XmlSerializer GetSerializer() { return Serializer; } public override XmlSerializer GetSerializer() { return Serializer; }
public string ProductName; /// Znak fabryczny (PL) public string ProductName; /// Znak fabryczny (PL)
@ -305,7 +305,7 @@ namespace TBF.BenchControl.WaterMeters.WaterMeter
return pars; return pars;
} }
public override void UpdateProcedureParams(ComponentProcedure dbEntity) public override void UpdateFromDbEntity(ComponentProcedure dbEntity)
{ {
if (dbEntity == null) return; if (dbEntity == null) return;
try try

View File

@ -18,21 +18,16 @@ namespace TBF.BenchControl.WaterMeters.WaterMeter
/// <summary> Procedure parameters </summary> /// <summary> Procedure parameters </summary>
[XmlIgnore] [XmlIgnore]
public ProcParams ProcParams; public ProcParams ProcParams;
public override IParamsProvider GetProcedureParams() { return ProcParams; } public override IParamsProvider GetRuntimeProcParamsProvider() { return ProcParams; }
public override IParamsProvider CreateProcedureParams(Procedure procedure) public override IParamsProvider CreateProcParamsProvider() { return new ProcParams(true); }
{
ProcParams procParams = new ProcParams(true);
procParams.UpdateProcedureParams(Name, procedure);
return procParams;
}
/// Private parameterless constructor invoked by all other (public) constructors /// Private parameterless constructor invoked by all other (public) constructors
WaterMeterCfg() WaterMeterCfg()
{ {
Name = "WM"; Name = "WM";
ParentName = string.Empty; ParentName = string.Empty;
ProcParams = new ProcParams(true); ProcParams = CreateProcParamsProvider() as ProcParams;
} }
public WaterMeterCfg(IComponentFactory factory) public WaterMeterCfg(IComponentFactory factory)
: this() : this()

View File

@ -179,7 +179,7 @@ namespace TBF
/// Create a tab with a TestParamsCtrl control for each used test method /// Create a tab with a TestParamsCtrl control for each used test method
foreach (var method in UsedTestMethods) foreach (var method in UsedTestMethods)
{ {
if (method.Cfg.GetTestParams() != null) if (method.Cfg.GetRuntimeTestParamsProvider() != null)
{ {
TabPage nwTab = new TabPage(method.Cfg.Name); TabPage nwTab = new TabPage(method.Cfg.Name);
TestParamsCtrl nwCtrl = new TestParamsCtrl(this, method, true); TestParamsCtrl nwCtrl = new TestParamsCtrl(this, method, true);
@ -192,7 +192,7 @@ namespace TBF
/// Create a control for another component with Test parameters which was not handled yet /// Create a control for another component with Test parameters which was not handled yet
foreach (var cmpnt in TbfComponents) foreach (var cmpnt in TbfComponents)
{ {
if ((cmpnt.Cfg.GetTestParams() != null) && !(cmpnt is ITestMethod)) if ((cmpnt.Cfg.GetRuntimeTestParamsProvider() != null) && !(cmpnt is ITestMethod))
{ {
TabPage nwTab = new TabPage(cmpnt.Cfg.Name); TabPage nwTab = new TabPage(cmpnt.Cfg.Name);
TestParamsCtrl nwCtrl = new TestParamsCtrl(this, cmpnt, true); TestParamsCtrl nwCtrl = new TestParamsCtrl(this, cmpnt, true);
@ -2136,7 +2136,7 @@ namespace TBF
DetectionPeriod2 = roiData.P2, DetectionPeriod2 = roiData.P2,
RoiParams = roiData.GetRoiParams() RoiParams = roiData.GetRoiParams()
}; };
roiParams.UpdateProcedureParams(cmpnt.Name, LoadedProcedure); roiParams.FromDbEntity(cmpnt.Name, LoadedProcedure);
} }
} }
} }

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("2.18.890.0")] [assembly: AssemblyVersion("2.18.891.0")]
[assembly: AssemblyFileVersion("2.18.890.0")] [assembly: AssemblyFileVersion("2.18.891.0")]

View File

@ -1465,7 +1465,6 @@
<Compile Include="BenchControl\GenericDevices\IWaterMeter.cs" /> <Compile Include="BenchControl\GenericDevices\IWaterMeter.cs" />
<Compile Include="BenchControl\GenericDevices\ValveBase.cs" /> <Compile Include="BenchControl\GenericDevices\ValveBase.cs" />
<Compile Include="BenchControl\Generic\IChildComponentCfg.cs" /> <Compile Include="BenchControl\Generic\IChildComponentCfg.cs" />
<Compile Include="BenchControl\Generic\IParamsProvider.cs" />
<Compile Include="BenchControl\Generic\IProcedureParams.cs" /> <Compile Include="BenchControl\Generic\IProcedureParams.cs" />
<Compile Include="BenchControl\Generic\ITestParams.cs" /> <Compile Include="BenchControl\Generic\ITestParams.cs" />
<Compile Include="BenchControl\Elde\Valve\ValveCfgCtrl.cs"> <Compile Include="BenchControl\Elde\Valve\ValveCfgCtrl.cs">

View File

@ -4,6 +4,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Windows.Forms; using System.Windows.Forms;
using Config.Entities;
using TBF.BenchControl.Generic; using TBF.BenchControl.Generic;
using TBF.Resources; using TBF.Resources;
@ -67,19 +68,19 @@ namespace TBF.UiControls
foreach (var cmpnt in selectedCmpnts) foreach (var cmpnt in selectedCmpnts)
{ {
if (cmpnt != null && (cmpnt.Cfg.GetProcedureParams() != null)) IParamsProvider procedureParams = null;
{
IParamsProvider procedureParams = cmpnt.Cfg.CreateProcedureParams(parent.LoadedProcedure); if (cmpnt != null)
if (sampleToCreateHeader == null || procedureParams.ParamsCount() > sampleToCreateHeader.ParamsCount()) {
procedureParams = cmpnt.Cfg.GetUIProcParamsProvider(parent.LoadedProcedure);
if ((sampleToCreateHeader == null) ||
((procedureParams != null) && (procedureParams.ParamsCount() > sampleToCreateHeader.ParamsCount())))
{ {
sampleToCreateHeader = procedureParams; sampleToCreateHeader = procedureParams;
} }
cmpntsParams.Add(procedureParams); }
}
else cmpntsParams.Add(procedureParams);
{
cmpntsParams.Add(null);
}
} }
if (sampleToCreateHeader != null) if (sampleToCreateHeader != null)
@ -189,7 +190,7 @@ namespace TBF.UiControls
foreach (ListViewItem lvi in listViewEx.Items) foreach (ListViewItem lvi in listViewEx.Items)
{ {
if (lvi.Tag is IParamsProvider) (lvi.Tag as IParamsProvider).UpdateDbEntity(); if (lvi.Tag is IParamsProvider) (lvi.Tag as IParamsProvider).UpdateEmbeddedDbEntity();
} }
} }
} }

View File

@ -92,28 +92,18 @@ namespace TBF.UiControls
IList<IParamsProvider> GetTestParamsProviders(IList<Test> tests, out IParamsProvider sampleToCreateHeader) IList<IParamsProvider> GetTestParamsProviders(IList<Test> tests, out IParamsProvider sampleToCreateHeader)
{ {
IList<IParamsProvider> result = new List<IParamsProvider>(); IList<IParamsProvider> providers = new List<IParamsProvider>();
sampleToCreateHeader = null; sampleToCreateHeader = null;
/// For each test (with an appropriate method in case of ITestMethod-s) /// For each test (with an appropriate method in case of ITestMethod-s)
foreach (var test in tests) foreach (var test in tests)
{ {
if ((cmpnt.Cfg.GetTestParams() != null) && IParamsProvider testParams = cmpnt.Cfg.GetUITestParamsProvider(test);
(!(cmpnt is BenchControl.GenericDevices.ITestMethod) || (test.Method == cmpnt.Cfg.Name))) if (sampleToCreateHeader == null) sampleToCreateHeader = testParams;
{ providers.Add(testParams);
/// Load ComponentTest entity or create it if it does not exist
IParamsProvider testParams = cmpnt.Cfg.CreateTestParams(test);
if (sampleToCreateHeader == null) sampleToCreateHeader = testParams;
result.Add(testParams);
}
else
{
/// In case of ITestMethod: Insert null for a test without an appropriate method.
result.Add(null);
}
} }
return result; return providers;
} }
private void listViewEx_SubItemClicked(object sender, Results.Forms.SubItemEventArgs e) private void listViewEx_SubItemClicked(object sender, Results.Forms.SubItemEventArgs e)
@ -207,12 +197,17 @@ namespace TBF.UiControls
{ {
if (test.Method == cmpnt.Cfg.Name) if (test.Method == cmpnt.Cfg.Name)
{ {
ComponentTest entity = new ComponentTest(); IParamsProvider testParams = cmpnt.Cfg.CreateTestParamsProvider(); /// Load or create ComponentTest entity
entity.CmpntName = test.Method; if (testParams != null)
entity.Test = test; {
IParamsProvider testParams = cmpnt.Cfg.CreateTestParams(test); /// Load or create ComponentTest entity var writer = new System.IO.StringWriter();
testParamsProviders.Add(testParams); testParams.GetSerializer().Serialize(writer, testParams); /// Serialize this class with parameters
DrawOne(testParams, test.Name);
ComponentTest entity = new ComponentTest(test.Method, writer.ToString(), test);
entity.SetParamsProvider(testParams);
testParamsProviders.Add(testParams);
}
DrawOne(testParams, test.Name);
} }
else else
{ {
@ -227,7 +222,7 @@ namespace TBF.UiControls
foreach (ListViewItem lvi in listViewEx.Items) foreach (ListViewItem lvi in listViewEx.Items)
{ {
if (lvi.Tag is IParamsProvider) (lvi.Tag as IParamsProvider).UpdateDbEntity(); if (lvi.Tag is IParamsProvider) (lvi.Tag as IParamsProvider).UpdateEmbeddedDbEntity();
} }
} }
} }

View File

@ -1,3 +1,9 @@
Igor
- cerveny RV
- testovanie citlivosti vodomera
- zivotnostne: menit prietok 15 min.
- diverter test (prietok 1x, vahy bud vzdy alebo 1x)
iPerl: iPerl:
- neukladat process data pre UnknownPcbNr... vodomery - neukladat process data pre UnknownPcbNr... vodomery