ControlBoards, IControlBoard iface, Devices, test methods.

This commit is contained in:
Milan Hanajik
2020-05-21 15:55:02 +02:00
parent 6df9261697
commit 7b321abb30
222 changed files with 3995 additions and 1284 deletions
@@ -81,7 +81,7 @@ namespace TBF.BenchControl.TestMethods.PulsesTestManual
IList<Event> e; /// Events from currently running operations
Event retVal = Event.Done;
Elde.ControlBoardDev cBrd = StateMachine.ControlBoard;
TBF.BenchControl.ControlBoard.IControlBoard cBrd = StateMachine.ControlBoard;
checkUiOp = new Operations.CheckUIOp(true); /// Runs in more then one state
processDataLoggingOp = new TBF.BenchControl.Operations.ProcessDataLoggingOp(processDataLogger, this, false);
@@ -99,7 +99,10 @@ namespace TBF.BenchControl.TestMethods.PulsesTestManual
}
}
cBrd.SetFiltersPidShortPulses(filters, outPath.PidCoef, (test.TolerRed == 0) ? 0 : 1);
if (cBrd is ControlBoard.Legacy.ControlBoardDev)
{
(cBrd as ControlBoard.Legacy.ControlBoardDev).SetFiltersPidShortPulses(filters, outPath.PidCoef, (test.TolerRed == 0) ? 0 : 1);
}
IList<IOperation> readTempPressOps = new List<IOperation>();
if (benchPath.TempMtrUp != null) readTempPressOps.Add(benchPath.TempMtrUp.ReadTempOp(ref TempUp));
@@ -130,7 +133,7 @@ namespace TBF.BenchControl.TestMethods.PulsesTestManual
while (e.Contains(Event.Busy));
/// Start the test, initialize test results
Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, repetitionNr, inPath, benchPath, outPath, sensPath, heatMetersPath, totalPulses));
Bridge.OnTestSelected(this, new TestSelectedEventArgs(test, repetitionNr, inPath, benchPath, outPath, sensPath, heatMetersPath));
string testName = Results.Utils.GetTestName(test.Name, test.Repeats, repetitionNr);
TestStartTime = DateTime.Now;
@@ -220,7 +223,7 @@ namespace TBF.BenchControl.TestMethods.PulsesTestManual
State.Create(string.Format("{0}({1}) : Setting the flow", test.Method, test.Name))
.AddOperation(checkUiOp)
.AddOperations(readTempPressOps)
.AddOperation(outPath.RegulValve.SetFlowOp(outPath.FlowMeter, test.Qfrom, test.Qto, RefFlow, FlowSettingTimeoutSec))
.AddOperation(cBrd.SetFlowOp(test.Qfrom, test.Qto, RefFlow, FlowSettingTimeoutSec))
.EnterState();
do {
e = StateMachine.WaitRunDevsRunOps();
@@ -339,7 +342,7 @@ namespace TBF.BenchControl.TestMethods.PulsesTestManual
.AddOperation(checkUiOp)
.AddOperations(readTempPressOps)
.AddOperations(measureOperations)
.AddOperation(cBrd.StartMeasurementOp(outPath, Elde.TestMethods.Synchro, test.Qfrom, test.Qto, totalPulses))
.AddOperation(cBrd.StartTestOp(test))
.EnterState();
do {
e = StateMachine.WaitRunDevsRunOps();
@@ -366,8 +369,8 @@ namespace TBF.BenchControl.TestMethods.PulsesTestManual
case Event.MeasurementCompleted: goto one_test_completed;
}
RefFreq.Val = cBrd.ReferenceFreq;
RefFlow.Val = cBrd.ReferenceFlow;
RefFrequency.Val = cBrd.RefFrequency;
RefFlow.Val = cBrd.RefFlow;
UpdateAllStatistics(StateMachine.Time);
Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.Test));
@@ -401,12 +404,12 @@ namespace TBF.BenchControl.TestMethods.PulsesTestManual
tstRslt.StartTime = TestStartTime;
tstRslt.EndTime = TestEndTime;
tstRslt.FlowSetTime = flowSetTime;
tstRslt.TestTime = cBrd.TTime; /// [s] measurement time
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.EtPulses(0)); /// Pulses of the master flow meter (test total)
tstRslt.TestTime = cBrd.TestTime; /// [s] measurement time
tstRslt.PulsesMaster = Convert.ToDouble(cBrd.RefPulses); /// Pulses of the master flow meter (test total)
tstRslt.MassStart = 0;
tstRslt.MassEnd = 0;
tstRslt.FlowMass = 0; /// [kg/h]
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * cBrd.EtPulses(0) / tstRslt.TestTime; /// [m3/h]
tstRslt.FlowMass = 0; /// [kg/h]
tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * cBrd.RefPulses / tstRslt.TestTime; /// [m3/h]
tstRslt.Buoyancy = Config.Formulas.Buoyancy();
tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter
tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient
@@ -444,7 +447,7 @@ namespace TBF.BenchControl.TestMethods.PulsesTestManual
meterRslt.VolumeEnd = 0; /// liter
meterRslt.VolumeMeter = meterRslt.PulsesMeter * regReader.LtrsPerPulse; /// liter
meterRslt.VolumeRef = meterRslt.PulsesMaster * tstRslt.ConstMaster; /// liter
meterRslt.TestTime = cBrd.ImpulseTime(i + 1);
meterRslt.TestTime = cBrd.TestTimeWM(i + 1);
meterRslt.Error = 0;
meterRslt.Passed = (modelessDlg as IHasGetPassed).GetPassed(i);
meterRslt.TestDone = true;