IControlBoard.SpecifyInvertedValves instead of InitializeComponent

This commit is contained in:
Milan Hanajik
2021-02-19 16:45:55 +01:00
parent 29d64c69eb
commit 56a9984626
6 changed files with 15 additions and 34 deletions
@@ -9,7 +9,7 @@ namespace TBF.BenchControl.ControlBoard
{
public interface IControlBoard : IDevice, IValveControl
{
void InitializeComponent(object thirdPartyComponent, UInt128 valvesToInvert, double[] tankCapacities);
void SpecifyInvertedValves(UInt128 valvesToInvert);
/// <summary>
/// Display value in a third party component, update UI
@@ -377,7 +377,7 @@ namespace TBF.BenchControl.ControlBoard.Legacy
/// Specific pre-initialization for control board only
/// </summary>
/// <param name="eldeComponent"></param>
public void InitializeComponent(object eldeComponent, UInt128 valvesToInvert, double[] tankCapacities)
public void SpecifyInvertedValves(UInt128 valvesToInvert)
{
this.valvesToInvert = valvesToInvert;
this.benchModelRoute = valvesToInvert;
@@ -388,17 +388,16 @@ namespace TBF.BenchControl.ControlBoard.Legacy
}
else
{
#if !JUZNA_AFRIKA_NEW
controlCom = new ControlComWrap(eldeComponent);
#endif
// controlCom = new ControlComWrap(eldeComponent);
/// Default number of scales (and BalanceRange length) is 2.
/// If there are more scales, BalanceRange length is larger.
int scalesCnt = Math.Max(2, tankCapacities.Length);
BalanceRange = new uint[scalesCnt];
for (int i = 0; i < scalesCnt; i++)
{
BalanceRange[i] = (uint)((i < tankCapacities.Length) ? tankCapacities[i] : 0);
}
// int scalesCnt = Math.Max(2, tankCapacities.Length);
// BalanceRange = new uint[scalesCnt];
// for (int i = 0; i < scalesCnt; i++)
// {
// BalanceRange[i] = (uint)((i < tankCapacities.Length) ? tankCapacities[i] : 0);
// }
}
}
+1 -1
View File
@@ -41,7 +41,7 @@ namespace TBF.BenchControl.ControlBoard.New
}
public void InitializeComponent(object thirdPartyComponent, UInt128 valvesToInvert, double[] tankCapacities)
public void SpecifyInvertedValves(UInt128 valvesToInvert)
{
this.valvesToInvert = valvesToInvert;
this.benchModelRoute = valvesToInvert;
@@ -88,7 +88,7 @@ namespace TBF.BenchControl.ControlBoard.Papouch
log.Warn(this.ToString());
}
public void InitializeComponent(object thirdPartyComponent, UInt128 valvesToInvert, double[] tankCapacities)
public void SpecifyInvertedValves(UInt128 valvesToInvert)
{
this.valvesToInvert = valvesToInvert;
this.benchModelRoute = valvesToInvert;
+2 -20
View File
@@ -216,21 +216,7 @@ namespace TBF.BenchControl
/// <param name="mode">Mode of operation</param>
/// <param name="benchData">A copy of bench data used by the state machine</param>
/// <param name="label">Identifies the initial state</param>
public static void InitializeBoardEtc(IList<Config.Entities.Component> cmpntEntities,
#if DN100
ControlCom2VB.ControlCom2panel
#elif MUNICH || FUZHOU_150
ControlComponent3Munich.UserControl1
#elif FUZHOU_300
ControlComponent3F300.UserControl1
#elif IZRAEL_200 || PUCHONG_200 || GENESIS || BERLIN || GELSENWASSER || SLM_150 || PETERSBURG_200
ControlComponent_Izrael2014.UserControl1
#elif JUZNA_AFRIKA_NEW
object
#else /// other benches
ControlComponent_Torino2015.UserControl1
#endif
ctrlBrdComponent)
public static void InitializeBoardEtc(IList<Config.Entities.Component> cmpntEntities)
{
/// Load the list of components (entities) from the database.
/// Then create the components (derived from IComponent).
@@ -320,13 +306,9 @@ namespace TBF.BenchControl
{
throw new Exception("Control board component is missing");
}
else if (ControlBoard is ControlBoard.Legacy.ControlBoardDev)
{
ControlBoard.InitializeComponent(ctrlBrdComponent, valvesToInvert, tankCapacities);
}
else
{
ControlBoard.InitializeComponent(null, valvesToInvert, tankCapacities);
ControlBoard.SpecifyInvertedValves(valvesToInvert);
}
}