Initialization( ) changed, is abstract in ComponentBase, builds OK.

This commit is contained in:
Milan Hanajik
2021-04-03 09:39:17 +02:00
parent a58fe1f997
commit c53cb8ace0
106 changed files with 441 additions and 312 deletions
+10 -7
View File
@@ -20,10 +20,10 @@ namespace TBF.Rig.Uni.FlowMetersInParallel
readonly IFlowMeter flowMeter1;
readonly IFlowMeter flowMeter2;
readonly IFlowMeter flowMeter3;
readonly double nominalFlow;
readonly double ltrPerPulse;
readonly int flowMetersCount;
readonly int flowMetersBitfield;
double nominalFlow;
double ltrPerPulse;
int flowMetersCount;
int flowMetersBitfield;
public int Idx1 { get { return flowMetersBitfield; } }
public double NominalFlow { get { return nominalFlow; } }
@@ -113,6 +113,11 @@ namespace TBF.Rig.Uni.FlowMetersInParallel
if (!string.IsNullOrEmpty(flowMeterCfg.Flowmeter2)) flowMeter2 = TbfComponents.FindComponent(flowMeterCfg.Flowmeter2, components) as IFlowMeter;
if (!string.IsNullOrEmpty(flowMeterCfg.Flowmeter3)) flowMeter3 = TbfComponents.FindComponent(flowMeterCfg.Flowmeter3, components) as IFlowMeter;
log.Warn(this.ToString());
}
public override void Initialize()
{
nominalFlow = 0;
flowMetersCount = 0;
flowMetersBitfield = 0;
@@ -124,9 +129,7 @@ namespace TBF.Rig.Uni.FlowMetersInParallel
refFreq = new double[4];
refPulses = new int[4];
log.Warn(this.ToString());
}
}
public double ReadFlow()
{
+4 -2
View File
@@ -69,11 +69,13 @@ namespace TBF.Rig.Uni.RegValveAnalog
uniCB = TbfComponents.FindComponent(cfg.ParentName, components) as UniCB;
if (uniCB == null) throw new Exception("Cannot find " + Name + " parent");
this.dict = new Dictionary<double, double>();
log.Warn(this.ToString());
}
public override void Initialize()
{
this.dict = new Dictionary<double, double>();
}
/// <summary>
/// Operation to set the water flow within tolerances
+10 -10
View File
@@ -26,8 +26,8 @@ namespace TBF.Rig.Uni.RegValveTandem
readonly TBF.Rig.Uni.RegValve.RegValve regValve;
readonly TBF.Rig.Uni.RegValve.RegValve fixedRV;
readonly float fixedPctLo; /// [%]
readonly float fixedPctHi; /// [%]
float fixedPctLo; /// [%]
float fixedPctHi; /// [%]
public int FlowStableSec { get { return RegulValveTandemCfg.FlowStableSec; } } /// 0..60 sec
///
@@ -39,9 +39,7 @@ namespace TBF.Rig.Uni.RegValveTandem
}
public RegValveTandem()
{
}
public RegValveTandem() { }
public RegValveTandem(Generic.IComponentCfg cfg, IList<Generic.IComponent> components)
: base(cfg)
@@ -54,14 +52,16 @@ namespace TBF.Rig.Uni.RegValveTandem
fixedRV = TbfComponents.FindComponent(RegulValveTandemCfg.FixedRVName, components) as TBF.Rig.Uni.RegValve.RegValve;
if (fixedRV == null) throw new Exception("Cannot find fixed RV");
fixedPctLo = Math.Max(0.0f, RegulValveTandemCfg.FixedRVPosition - 3.0f);
fixedPctHi = Math.Min(100.0f, RegulValveTandemCfg.FixedRVPosition + 3.0f);
this.dict = new Dictionary<double, double>();
log.Warn(this.ToString());
}
public override void Initialize()
{
fixedPctLo = Math.Max(0.0f, RegulValveTandemCfg.FixedRVPosition - 3.0f);
fixedPctHi = Math.Min(100.0f, RegulValveTandemCfg.FixedRVPosition + 3.0f);
this.dict = new Dictionary<double, double>();
}
/// <summary>
/// Operation to set the water flow within tolerances
/// Events: Event.None, Event.FlowReached, Event.FlowTimeOut