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;