string Test.TempControl and string TestData.TempControl added and used in sequences.

This commit is contained in:
Milan Hanajik 2022-05-19 15:58:13 +02:00
parent dab575dc49
commit aa1d9e4b3b
19 changed files with 76 additions and 79 deletions

View File

@ -34,10 +34,10 @@ namespace Config.Entities
public virtual int Repeats { get; set; }
public virtual bool DoDraining { get; set; }
public virtual bool DoDrainingAfter { get; set; }
public virtual bool DoControlWaterTemp { get; set; }
public virtual float TempLimLo { get; set; } /// Lower limit for the controlled temperature
public virtual float TempLimHi { get; set; } /// Upper limit for the controlled temperature
public virtual float PumpPower { get; set; } /// Power of the pump in [%] in the range 0 .. 100.0f, use values 0% and 100% for non-FM pumps
public virtual string TempControl { get; set; } /// Water temperature controller, null or empty = Do not control water temp
public virtual float PumpPower { get; set; } /// Power of the pump in [%] in the range 0 .. 100.0f, use values 0% and 100% for non-FM pumps
public virtual int MassRepeats { get; set; } /// Number of mass. measurements at the beginning/end of test, 0 = default (=5)
public virtual float MassSpread { get; set; } /// Max spread of mass. measurements at the beginning/end of test, 0 = default
public virtual MassMethod MassMethod { get; set; } /// method of mass. measurement at the beginning/end of test: false=slow (precise), true=using immediate mass measurement and evaluation
@ -91,25 +91,25 @@ namespace Config.Entities
Profile = TestProfile.UserDefined;
Publish = (sbyte)Common.Publish.Always;
DoEvaluate = true;
Repeats = 1;
ErrLimLo = -2.0f; /// [%] lower error limit
ErrLimHi = 2.0f; /// [%] upper error limit
Uncertainty = 0;
Repeats = 1;
DoDraining = false;
DoDrainingAfter = false;
DoControlWaterTemp = false;
TempLimLo = 15.0f;
TempLimHi = 25.0f;
ErrLimLo = -2.0f; /// [%] lower error limit
ErrLimHi = 2.0f; /// [%] upper error limit
Uncertainty = 0;
TempControl = string.Empty;
PumpPower = 60.0f; /// [%]
MassRepeats = 0; /// default
MassSpread = 0; /// default
MassMethod = MassMethod.Scale; /// default
MassMethod = MassMethod.Scale; /// default
TimeBeforeFlow = 10; /// [s] time before the start of flow control in [s]
TimeFlow2Mass = 5; /// [s] time from the flow stable to the 1st mass measurement in [s]
TimePump2StartV = 1; /// [s] time from the 1st mass measurement to the test start in [s]
TimeStop2Mass = 5; /// [s] between the test end and the final mass measurement
ShortPulses = 0; /// = Filter parameter
TransBefore = string.Empty;
ShortPulses = 0; /// Short pulses parameter (0 or 1)
TransBefore = string.Empty;
TransBetween = string.Empty;
TransAfter = string.Empty;
}
@ -169,10 +169,10 @@ namespace Config.Entities
result.Repeats = Repeats;
result.DoDraining = DoDraining;
result.DoDrainingAfter = DoDrainingAfter;
result.DoControlWaterTemp = DoControlWaterTemp;
result.TempLimLo = TempLimLo;
result.TempLimHi = TempLimHi;
result.PumpPower = PumpPower;
result.TempControl = TempControl;
result.PumpPower = PumpPower;
result.MassRepeats = MassRepeats;
result.MassSpread = MassSpread;
result.MassMethod = MassMethod;
@ -223,10 +223,10 @@ namespace Config.Entities
output.WriteLine(Repeats.ToString(ci));
output.WriteLine(DoDraining.ToString());
output.WriteLine(DoDrainingAfter.ToString());
output.WriteLine(DoControlWaterTemp.ToString());
output.WriteLine(TempLimLo.ToString(ci));
output.WriteLine(TempLimHi.ToString(ci));
output.WriteLine(PumpPower.ToString(ci));
output.WriteLine(TempControl);
output.WriteLine(PumpPower.ToString(ci));
output.WriteLine(MassRepeats.ToString(ci));
output.WriteLine(MassSpread.ToString(ci));
output.WriteLine(((byte)MassMethod).ToString(ci));
@ -274,10 +274,10 @@ namespace Config.Entities
tst.Repeats = int.Parse(input.ReadLine(), ci);
tst.DoDraining = bool.Parse(input.ReadLine());
tst.DoDrainingAfter = bool.Parse(input.ReadLine());
tst.DoControlWaterTemp = bool.Parse(input.ReadLine());
tst.TempLimLo = float.Parse(input.ReadLine(), ci);
tst.TempLimHi = float.Parse(input.ReadLine(), ci);
tst.PumpPower = float.Parse(input.ReadLine(), ci);
tst.TempControl = input.ReadLine();
tst.PumpPower = float.Parse(input.ReadLine(), ci);
tst.MassRepeats = int.Parse(input.ReadLine(), ci);
tst.MassSpread = float.Parse(input.ReadLine(), ci);
tst.MassMethod = (MassMethod)byte.Parse(input.ReadLine(), ci);
@ -336,9 +336,9 @@ namespace Config.Entities
ln = inp.ReadLine(); if (ln != Repeats.ToString(ci)) { diff.AppendFormat(fmt, "Repeats", Repeats.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != DoDraining.ToString(ci)) { diff.AppendFormat(fmt, "Draining", DoDraining.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != DoDrainingAfter.ToString(ci)) { diff.AppendFormat(fmt, "Zeroing", DoDrainingAfter.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != DoControlWaterTemp.ToString()) { diff.AppendFormat(fmt, "DoControlWaterTemp", DoControlWaterTemp.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != TempLimLo.ToString(ci)) { diff.AppendFormat(fmt, "TempLimLo", TempLimLo.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != TempLimHi.ToString(ci)) { diff.AppendFormat(fmt, "TempLimHi", TempLimHi.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != TempControl) { diff.AppendFormat(fmt, "TempController", TempControl, ln); };
ln = inp.ReadLine(); if (ln != PumpPower.ToString(ci)) { diff.AppendFormat(fmt, "PumpPower", PumpPower.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != MassRepeats.ToString(ci)) { diff.AppendFormat(fmt, "MassRepeats", MassRepeats.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != MassSpread.ToString(ci)) { diff.AppendFormat(fmt, "MassSpread", MassSpread.ToString(ci), ln); };

View File

@ -29,10 +29,10 @@ namespace Config.Mappings
.Column("Emptying");
Map(x => x.DoDrainingAfter)
.Column("Zeroing");
Map(x => x.DoControlWaterTemp);
Map(x => x.TempLimLo);
Map(x => x.TempLimHi);
Map(x => x.PumpPower);
Map(x => x.TempControl);
Map(x => x.PumpPower);
Map(x => x.MassRepeats);
Map(x => x.MassSpread);
Map(x => x.MassMethod)

View File

@ -1,5 +1,5 @@
///
/// Copyright (c) 2016-2020 Sensus Slovensko a.s.
/// Copyright (c) 2016-2022 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
@ -26,10 +26,10 @@ namespace Results.Entities
public virtual double ErrLimLo { get; set; } /// [%] usually < 0, in case of heat meters: 1=class1, 2=class2, 3=class3
public virtual double ErrLimHi { get; set; } /// [%] usually > 0, in case of heat meters: -Qn in m3/h
public virtual double ErrLimMargin { get; set; } /// [%] makes error limits tighter: 0 <= ErrLimMargin <= abs(ErrLimXx)
public virtual bool DoControlWaterTemp { get; set; }
public virtual float TempLimLo { get; set; }
public virtual float TempLimHi { get; set; }
public virtual sbyte Publish { get; set; } /// 0=no, 1=in all protocols, 2=on screen, 3=internal
public virtual string TempControl { get; set; }
public virtual sbyte Publish { get; set; } /// 0=no, 1=in all protocols, 2=on screen, 3=internal
public virtual bool Evaluate { get; set; }
@ -45,22 +45,22 @@ namespace Results.Entities
public TestData(Test test)
: this()
{
Name = test.Name;
Repeats = test.Repeats;
Qtg = (double)test.Qtg;
Qfrom = (double)test.Qfrom;
Qto = (double)test.Qto;
TargetVolume = (double)test.Volume;
TargetTime = (double)test.TestTime;
Method = test.Method;
ErrLimLo = (double)test.ErrLimLo;
ErrLimHi = (double)test.ErrLimHi;
ErrLimMargin = (double)test.Uncertainty;
DoControlWaterTemp = test.DoControlWaterTemp;
TempLimLo = test.TempLimLo;
TempLimHi = test.TempLimHi;
Publish = test.Publish;
Evaluate = test.DoEvaluate;
Name = test.Name;
Repeats = test.Repeats;
Qtg = test.Qtg;
Qfrom = test.Qfrom;
Qto = test.Qto;
TargetVolume = test.Volume;
TargetTime = test.TestTime;
Method = test.Method;
ErrLimLo = test.ErrLimLo;
ErrLimHi = test.ErrLimHi;
ErrLimMargin = test.Uncertainty;
TempLimLo = test.TempLimLo;
TempLimHi = test.TempLimHi;
TempControl = test.TempControl;
Publish = test.Publish;
Evaluate = test.DoEvaluate;
}
/// <summary>
@ -68,22 +68,22 @@ namespace Results.Entities
/// </summary>
public TestData(TestData oriTestData)
{
Name = oriTestData.Name;
Repeats = oriTestData.Repeats;
Qtg = oriTestData.Qtg;
Qfrom = oriTestData.Qfrom;
Qto = oriTestData.Qto;
TargetVolume = oriTestData.TargetVolume;
TargetTime = oriTestData.TargetTime;
Method = oriTestData.Method;
ErrLimLo = oriTestData.ErrLimLo;
ErrLimHi = oriTestData.ErrLimHi;
ErrLimMargin = oriTestData.ErrLimMargin;
DoControlWaterTemp = oriTestData.DoControlWaterTemp;
TempLimLo = oriTestData.TempLimLo;
TempLimHi = oriTestData.TempLimHi;
Publish = oriTestData.Publish;
Evaluate = oriTestData.Evaluate;
Name = oriTestData.Name;
Repeats = oriTestData.Repeats;
Qtg = oriTestData.Qtg;
Qfrom = oriTestData.Qfrom;
Qto = oriTestData.Qto;
TargetVolume = oriTestData.TargetVolume;
TargetTime = oriTestData.TargetTime;
Method = oriTestData.Method;
ErrLimLo = oriTestData.ErrLimLo;
ErrLimHi = oriTestData.ErrLimHi;
ErrLimMargin = oriTestData.ErrLimMargin;
TempLimLo = oriTestData.TempLimLo;
TempLimHi = oriTestData.TempLimHi;
TempControl = oriTestData.TempControl;
Publish = oriTestData.Publish;
Evaluate = oriTestData.Evaluate;
}
@ -105,13 +105,10 @@ namespace Results.Entities
if (ErrLimLo != td.ErrLimLo) return false;
if (ErrLimHi != td.ErrLimHi) return false;
if (ErrLimMargin != td.ErrLimMargin) return false;
if (DoControlWaterTemp != td.DoControlWaterTemp) return false;
if (DoControlWaterTemp)
{
if (TempLimLo != td.TempLimLo) return false;
if (TempLimHi != td.TempLimHi) return false;
}
if (Publish != td.Publish) return false;
if (TempLimLo != td.TempLimLo) return false;
if (TempLimHi != td.TempLimHi) return false;
if (TempControl != td.TempControl) return false;
if (Publish != td.Publish) return false;
if (Evaluate != td.Evaluate) return false;
return true;
@ -150,9 +147,9 @@ namespace Results.Entities
writer.Write(ErrLimLo);
writer.Write(ErrLimHi);
writer.Write(ErrLimMargin);
writer.Write(DoControlWaterTemp);
writer.Write(TempLimLo);
writer.Write(TempLimHi);
writer.Write(TempControl);
writer.Write(Publish);
writer.Write(Evaluate);
}
@ -171,9 +168,9 @@ namespace Results.Entities
ErrLimLo = reader.ReadDouble();
ErrLimHi = reader.ReadDouble();
ErrLimMargin = reader.ReadDouble();
DoControlWaterTemp = reader.ReadBoolean();
TempLimLo = reader.ReadSingle();
TempLimHi = reader.ReadSingle();
TempControl = reader.ReadString();
Publish = reader.ReadSByte();
Evaluate = reader.ReadBoolean();
}

View File

@ -249,7 +249,7 @@ namespace TBF.Rig.TestMethods.Adjustment
flowSetTime = StateMachine.Time - flowSetTime0;
if (test.DoControlWaterTemp && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
if (!string.IsNullOrEmpty(test.TempControl) && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
{
//---------------------------------------------------
Bridge.OnActivity(this, Strings.Setting_temperature);

View File

@ -285,7 +285,7 @@ namespace TBF.Rig.TestMethods.DiverterTest
int flowSetTime = StateMachine.Time - flowSetTime0;
double currentFlow = RefFlow.Val;
if (test.DoControlWaterTemp && (benchPath.TempMtrUp != null) && (benchPath.TempMtrDown != null))
if (!string.IsNullOrEmpty(test.TempControl) && (benchPath.TempMtrUp != null) && (benchPath.TempMtrDown != null))
{
//---------------------------------------------------
Bridge.OnActivity(this, Strings.Setting_temperature);

View File

@ -183,7 +183,7 @@ namespace TBF.Rig.TestMethods.Endurance
double currentFlow = RefFlow.Val;
if (test.DoControlWaterTemp && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
if (!string.IsNullOrEmpty(test.TempControl) && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
{
//---------------------------------------------------
Bridge.OnActivity(this, Strings.Setting_temperature);

View File

@ -328,7 +328,7 @@ namespace TBF.Rig.TestMethods.FixedStart
}
while (true);
}
else if (test.DoControlWaterTemp && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
else if (!string.IsNullOrEmpty(test.TempControl) && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
{
//---------------------------------------------------
Bridge.OnActivity(this, Strings.Setting_temperature);

View File

@ -347,7 +347,7 @@ namespace TBF.Rig.TestMethods.FixedStartDeferredEval
}
while (true);
}
else if (test.DoControlWaterTemp && (benchPath.TempMtrUp != null) && (benchPath.TempMtrDown != null))
else if (!string.IsNullOrEmpty(test.TempControl) && (benchPath.TempMtrUp != null) && (benchPath.TempMtrDown != null))
{
//---------------------------------------------------
Bridge.OnActivity(this, Strings.Setting_temperature);

View File

@ -420,7 +420,7 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollDeferredEval
}
while (true);
}
else if (test.DoControlWaterTemp && (benchPath.TempMtrUp != null) && (benchPath.TempMtrDown != null))
else if (!string.IsNullOrEmpty(test.TempControl) && (benchPath.TempMtrUp != null) && (benchPath.TempMtrDown != null))
{
//---------------------------------------------------
Bridge.OnActivity(this, Strings.Setting_temperature);

View File

@ -401,7 +401,7 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollection
}
while (true);
}
else if (test.DoControlWaterTemp && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
else if (!string.IsNullOrEmpty(test.TempControl) && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
{
//---------------------------------------------------
Bridge.OnActivity(this, Strings.Setting_temperature);

View File

@ -295,7 +295,7 @@ namespace TBF.Rig.TestMethods.FixedStartTankCollection
int flowSetTime = StateMachine.Time - flowSetTime0;
if (test.DoControlWaterTemp && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
if (!string.IsNullOrEmpty(test.TempControl) && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
{
//---------------------------------------------------
Bridge.OnActivity(this, Strings.Setting_temperature);

View File

@ -286,7 +286,7 @@ namespace TBF.Rig.TestMethods.FlyingStart
}
while (true);
}
else if (test.DoControlWaterTemp && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
else if (!string.IsNullOrEmpty(test.TempControl) && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
{
//---------------------------------------------------
Bridge.OnActivity(this, Strings.Setting_temperature);

View File

@ -370,7 +370,7 @@ namespace TBF.Rig.TestMethods.FlyingStartFirstRepetWithMassColl
}
while (true);
}
else if (test.DoControlWaterTemp && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
else if (!string.IsNullOrEmpty(test.TempControl) && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
{
//---------------------------------------------------
Bridge.OnActivity(this, Strings.Setting_temperature);

View File

@ -382,7 +382,7 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollComparative
}
while (true);
}
else if (test.DoControlWaterTemp && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
else if (!string.IsNullOrEmpty(test.TempControl) && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
{
//---------------------------------------------------
Bridge.OnActivity(this, Strings.Setting_temperature);

View File

@ -369,7 +369,7 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollProlonged
}
while (true);
}
else if (test.DoControlWaterTemp && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
else if (!string.IsNullOrEmpty(test.TempControl) && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
{
//---------------------------------------------------
Bridge.OnActivity(this, Strings.Setting_temperature);

View File

@ -364,7 +364,7 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollection
}
while (true);
}
else if (test.DoControlWaterTemp && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
else if (!string.IsNullOrEmpty(test.TempControl) && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
{
//---------------------------------------------------
Bridge.OnActivity(this, Strings.Setting_temperature);

View File

@ -256,7 +256,7 @@ namespace TBF.Rig.TestMethods.FlyingStartTankCollection
int flowSetTime = StateMachine.Time - flowSetTime0;
double currentFlow = RefFlow.Val;
if (test.DoControlWaterTemp && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
if (!string.IsNullOrEmpty(test.TempControl) && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
{
//---------------------------------------------------
Bridge.OnActivity(this, Strings.Setting_temperature);

View File

@ -244,7 +244,7 @@ namespace TBF.Rig.TestMethods.PulsesTest
int flowSetTime = StateMachine.Time - flowSetTime0;
if (test.DoControlWaterTemp && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
if (!string.IsNullOrEmpty(test.TempControl) && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
{
//---------------------------------------------------
Bridge.OnActivity(this, Strings.Setting_temperature);

View File

@ -246,7 +246,7 @@ namespace TBF.Rig.TestMethods.PulsesTestManual
int flowSetTime = StateMachine.Time - flowSetTime0;
if (test.DoControlWaterTemp && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
if (!string.IsNullOrEmpty(test.TempControl) && benchPath.TempMtrUp != null && benchPath.TempMtrDown != null)
{
//---------------------------------------------------
Bridge.OnActivity(this, Strings.Setting_temperature);