diff --git a/TBF/Properties/AssemblyInfo.cs b/TBF/Properties/AssemblyInfo.cs index 27fe8942e..28ce96fd4 100644 --- a/TBF/Properties/AssemblyInfo.cs +++ b/TBF/Properties/AssemblyInfo.cs @@ -29,5 +29,5 @@ using System.Runtime.InteropServices; // Build Number // Revision // -[assembly: AssemblyVersion("3.1.1618.0")] -[assembly: AssemblyFileVersion("3.1.1618.0")] +[assembly: AssemblyVersion("3.1.1620.0")] +[assembly: AssemblyFileVersion("3.1.1620.0")] diff --git a/TBF/Rig/ControlBoard/Papouch/PapouchCB.cs b/TBF/Rig/ControlBoard/Papouch/PapouchCB.cs index f6353093e..fa1c42a07 100644 --- a/TBF/Rig/ControlBoard/Papouch/PapouchCB.cs +++ b/TBF/Rig/ControlBoard/Papouch/PapouchCB.cs @@ -537,7 +537,7 @@ namespace TBF.Rig.ControlBoard.Papouch { if (opCompleted) return Event.TestCompleted; - double currentMass = TBF.Rig.Sequences.ProcessData.Mass.Val; + double currentMass = (Devices.Scale is IScale) ? (Devices.Scale as IScale).Mass : 0; if (currentMass - TBF.Rig.Sequences.ProcessData.StartMass.Val >= currentTest.Volume) { diff --git a/TBF/Rig/ControlBoard/Uni/StandingStartStopTestOp.cs b/TBF/Rig/ControlBoard/Uni/StandingStartStopTestOp.cs index 1ee4d3bf3..2f1441ce4 100644 --- a/TBF/Rig/ControlBoard/Uni/StandingStartStopTestOp.cs +++ b/TBF/Rig/ControlBoard/Uni/StandingStartStopTestOp.cs @@ -69,7 +69,7 @@ namespace TBF.Rig.ControlBoard.Uni log.InfoFormat("Op.Start() RV#={0} Et#={1} Qfrom={2} Qto={3}", regV.Idx1, flowMeter.Idx1, qFrom, qTo); /// Start the test (and the flow measurement) - uniCB.StartTest(false, flowMeter.Idx1, 0, 0, false, false, true, false, pulsesCount, 0); + uniCB.StartTest(false, flowMeter.Idx1, 0, 0, false, false, true, false, pulsesCount); opState = OpState.StartingTest; } @@ -117,7 +117,7 @@ namespace TBF.Rig.ControlBoard.Uni case OpState.TestInProgress: - if ((uniCB.State & (ulong)StatusP.TestCompleted) == 0) + if ((uniCB.State & (ulong)StatusP.TestCompleted) == 0 && uniCB.RefPulses < pulsesCount) { return Event.TestInProgress; /// Test was not completed yet } diff --git a/TBF/Rig/Dummy/Balance/Component.cs b/TBF/Rig/Dummy/Balance/Component.cs index 0f621c864..db48521f7 100644 --- a/TBF/Rig/Dummy/Balance/Component.cs +++ b/TBF/Rig/Dummy/Balance/Component.cs @@ -27,6 +27,8 @@ namespace TBF.Rig.Dummy.Balance public float BuoyancyPress { get { return 1.013f; } } public float BuoyancyHumi { get { return 50.0f; } } + public double Mass { get { return 0; } } + public Component() { } diff --git a/TBF/Rig/GenericDevices/IScale.cs b/TBF/Rig/GenericDevices/IScale.cs index df4777922..68556e9e9 100644 --- a/TBF/Rig/GenericDevices/IScale.cs +++ b/TBF/Rig/GenericDevices/IScale.cs @@ -14,19 +14,14 @@ namespace TBF.Rig.GenericDevices float BuoyancyPress { get; } /// Displayed in Metrology tab page float BuoyancyHumi { get; } /// + double Mass { get; } + /// /// Events: BalanceDone, Error /// /// ZeroOp instance reference casted to IOperaton IOperation ZeroOp(); - /// - /// Events: BalanceDone, Error - /// - /// Reference to a variable for the measured mass in kg - /// ReadMassOp instance reference casted to IOperaton - IOperation ReadMassOp(ref DoubleBox mass); - /// /// Events: BalanceDone, Timeout, Error /// diff --git a/TBF/Rig/Sequences/MainSeq.cs b/TBF/Rig/Sequences/MainSeq.cs index 1255e8aa9..a7b4dffb7 100644 --- a/TBF/Rig/Sequences/MainSeq.cs +++ b/TBF/Rig/Sequences/MainSeq.cs @@ -816,7 +816,6 @@ namespace TBF.Rig.Sequences /// Update format for the water mass if (outPath != null && outPath.Scale != null && !string.IsNullOrEmpty(outPath.Scale.Format)) { - Mass.Format = outPath.Scale.Format; StartMass.Format = outPath.Scale.Format; EndMass.Format = outPath.Scale.Format; } @@ -1033,7 +1032,6 @@ namespace TBF.Rig.Sequences } /// Update format for the water mass - Mass.Format = "F3"; StartMass.Format = "F3"; EndMass.Format = "F3"; diff --git a/TBF/Rig/Sequences/MainSeqUtils.cs b/TBF/Rig/Sequences/MainSeqUtils.cs index f4155ce5f..8833dc282 100644 --- a/TBF/Rig/Sequences/MainSeqUtils.cs +++ b/TBF/Rig/Sequences/MainSeqUtils.cs @@ -300,11 +300,6 @@ namespace TBF.Rig.Sequences bool draining2 = false; bool draining3 = false; - /// Measured masses to control emptying - DoubleBox mass1 = new DoubleBox(); - DoubleBox mass2 = new DoubleBox(); - DoubleBox mass3 = new DoubleBox(); - IList e; while (true) @@ -336,14 +331,10 @@ namespace TBF.Rig.Sequences ((StateMachine.DrainValve2 == null) ? 0 : (draining2 ? ButtonsEtc.DrainTankBtn2Hi : ButtonsEtc.DrainTankBtn2En)) | ((StateMachine.DrainValve3 == null) ? 0 : (draining3 ? ButtonsEtc.DrainTankBtn3Hi : ButtonsEtc.DrainTankBtn3En))); - State.Create("MainSeq : Select an activity") - .AddOperation(checkUiOp) - .AddOperation(StateMachine.BenchWaitingOp) - .AddOperation((StateMachine.Tank1 is IScale) ? (StateMachine.Tank1 as IScale).ReadMassOp(ref mass1) : null) - .AddOperation((StateMachine.Tank2 is IScale) ? (StateMachine.Tank2 as IScale).ReadMassOp(ref mass2) : null) - .AddOperation((StateMachine.Tank3 is IScale) ? (StateMachine.Tank3 as IScale).ReadMassOp(ref mass3) : null) - .EnterState(); + .AddOperation(checkUiOp) + .AddOperation(StateMachine.BenchWaitingOp) + .EnterState(); do { e = StateMachine.WaitRunDevsRunOps(); @@ -379,7 +370,6 @@ namespace TBF.Rig.Sequences } while (true); - if (e.Contains(Event.Error)) { ///------------------------------------ @@ -505,21 +495,15 @@ namespace TBF.Rig.Sequences int remTime = drainingStartTime + maxDrainTime - StateMachine.Time; Bridge.OnActivity(this, string.Format("{0} ... {1} {2} {3} {4}", Strings.Emptying_tank, remTime / 60, "min", remTime % 60, Strings.sec)); - DoubleBox mass1 = new DoubleBox(); - DoubleBox mass2 = new DoubleBox(); - DoubleBox mass3 = new DoubleBox(); - /// - State.Create("MainSeq : Reading mass") - .AddOperation(checkUiOp) - .AddOperation((StateMachine.Tank1 is IScale) ? (StateMachine.Tank1 as IScale).ReadMassOp(ref mass1) : null) - .AddOperation((StateMachine.Tank2 is IScale) ? (StateMachine.Tank2 as IScale).ReadMassOp(ref mass2) : null) - .AddOperation((StateMachine.Tank3 is IScale) ? (StateMachine.Tank3 as IScale).ReadMassOp(ref mass3) : null) - .EnterState(); - while (StateMachine.WaitRunDevsRunOps().Contains(Event.Busy)) { } + State.Create("MainSeq : Draining tanks") + .AddOperation(checkUiOp) + .EnterState(); - if (draining1 && StateMachine.Tank1 != null && StateMachine.Tank1.IsEmpty()) draining1 = false; - if (draining2 && StateMachine.Tank2 != null && StateMachine.Tank2.IsEmpty()) draining2 = false; - if (draining3 && StateMachine.Tank3 != null && StateMachine.Tank3.IsEmpty()) draining3 = false; + StateMachine.WaitRunDevsRunOps(); + + if (draining1 && StateMachine.Tank1.IsEmpty()) draining1 = false; + if (draining2 && StateMachine.Tank2.IsEmpty()) draining2 = false; + if (draining3 && StateMachine.Tank3.IsEmpty()) draining3 = false; } /// Close all drain valves diff --git a/TBF/Rig/Sequences/ProcessData.cs b/TBF/Rig/Sequences/ProcessData.cs index 309522afc..0f3891bca 100644 --- a/TBF/Rig/Sequences/ProcessData.cs +++ b/TBF/Rig/Sequences/ProcessData.cs @@ -5,6 +5,7 @@ using log4net; using SchematicDrawing; using TBF.Rig.GenericDevices; using TBF.Boxes; +using TBF.Resources; namespace TBF.Rig.Sequences { @@ -21,6 +22,15 @@ namespace TBF.Rig.Sequences public static IStatisticsMonitoring StatisticsMonitoringComp; public static Output.DB.SensusOracle.Database OracleDB; + ///------------------------------------------------------------ + /// Test related (instance) variables. + /// Created when test sequence is open. + /// They persist during all repetitions of the same test + ///------------------------------------------------------------ + protected static Rig.BenchPath benchPath; + protected static Rig.OutputPath outPath; + + public static readonly IList ComponentsWithMeasuredVal; public static readonly IList ComponentsWithSetpoint; @@ -205,7 +215,6 @@ namespace TBF.Rig.Sequences public static DoubleBox RefFrequency = new DoubleBox() { Name = "RefFreq", Format = "F2" }; public static DoubleBox RefFlow = new DoubleBox() { Name = "RefFlow", Format = "F2" }; /// [m3/h] - public static DoubleBox Mass = new DoubleBox() { Name = "Mass", Format = "F3" }; /// [kg] public static DoubleBox StartMass = new DoubleBox() { Name = "Start Mass", Format = "F3" }; /// [kg] public static DoubleBox EndMass = new DoubleBox() { Name = "End Mass", Format = "F3" }; /// [kg] @@ -231,7 +240,6 @@ namespace TBF.Rig.Sequences RefPulses = 0; RefFrequency.Clear(); RefFlow.Clear(); - Mass.Clear(); StartMass.Clear(); EndMass.Clear(); } @@ -375,5 +383,115 @@ namespace TBF.Rig.Sequences Energy.Stop(); VolumeForEnergy.Stop(); } - } + + /// + /// Process data logging + /// + public void LogProcessDataTestInfo(ILog logger, string procedureName, string testName) + { + logger.Info(Environment.NewLine); + logger.InfoFormat("{0}={1:dd.MM.yyyy HH:mm:ss} {2}={3} {4}={5} {6}={7}", + Strings.Date_and_time, TestStartTime, + Strings.Batch_nr, BatchRslts.Batch.BatchNr, + Strings.Procedure, procedureName, + Strings.Test, testName); + } + + public void LogProcessDataHeader(ILog logger) + { + LogProcessDataHeader(logger, null); + } + + public void LogProcessDataHeader(ILog logger, string sectionName) + { + logger.Info(Environment.NewLine); + if (sectionName != null) logger.Info(sectionName); + logger.Info("Time Flow TstTime Ref.cnt Ref.vol Tup Tdown Tdiv Pup Pdown Pdelta Mass VolMM Tamb Hamb Pamb Rv"); + logger.Info(Environment.NewLine); + } + + public void LogProcessData(ILog logger) + { + logger.InfoFormat("{0} {1} {2} {3} {4} {5} {6} {7} {8} {9} {10} {11} {12} {13} {14} {15} {16}", + DateTime.Now.ToLongTimeString(), + Utils.DoubleToStr(RefFlow.Val, 4), /// flow measured by the reference flow meter in m3/h + StateMachine.ControlBoard.TestTime.ToString("F3"),/// test time in s + StateMachine.ControlBoard.RefPulses, /// reference flow meter pulses count + Config.Formulas.VolumeFromPulses(StateMachine.ControlBoard.RefPulses, 1.0f / LtrPerRefPulse).ToString("F3"), /// volume in l + benchPath.TempMtrUp != null ? benchPath.TempMtrUp.ReadTemperature() : 0, /// temp. at the beginning of line in degree C + benchPath.TempMtrDown != null ? benchPath.TempMtrDown.ReadTemperature() : 0, /// temp. at the end of line in degree C + outPath.TempMtrDiv != null ? outPath.TempMtrDiv.ReadTemperature() : 0, /// temp. at the diverter in degree C + PressUp, /// water pressure at the beginning of test line in bar (= 100 kPa) + PressDown, /// water pressure at the end of test line in bar (= 100 kPa) + PressDelta, + (outPath.Scale is IScale) ? (outPath.Scale as IScale).Mass : 0, /// collected water mass in kg + "VolMM", + AmbTemp, /// ambient temperature in degree C + AmbHumi, /// ambient humidity in R% + AmbPress, /// ambient pressure in mbar (= 1 hPa) + outPath.RegValve.Position.ToString("F1")); /// regulation valve position in % (0=closed / 100=open) + } + + public void LogProcessDataHeaderHeatMeters(ILog logger, string sectionName) + { + logger.Info(Environment.NewLine); + if (sectionName != null) logger.Info(sectionName); + logger.Info("Time Flow TstTime Ref.cnt Ref.vol Tup Tdown Tdiv Pup Pdown Pdelta Mass VolMM Tamb Hamb Pamb Rv Thiac1 Thiac2 Tloac1 Tloac2"); + logger.Info(Environment.NewLine); + } + + public void LogProcessDataHeatMeters(ILog logger) + { + logger.InfoFormat("{0} {1} {2} {3} {4} {5} {6} {7} {8} {9} {10} {11} {12} {13} {14} {15} {16} {17} {18} {19} {20}", + DateTime.Now.ToLongTimeString(), + Utils.DoubleToStr(RefFlow.Val, 4), + StateMachine.ControlBoard.TestTime.ToString("F3"), + StateMachine.ControlBoard.RefPulses, + Config.Formulas.VolumeFromPulses(StateMachine.ControlBoard.RefPulses, 1.0f / LtrPerRefPulse).ToString("F3"), + benchPath.TempMtrUp != null ? benchPath.TempMtrUp.ReadTemperature() : 0, /// temp. at the beginning of line in degree C + benchPath.TempMtrDown != null ? benchPath.TempMtrDown.ReadTemperature() : 0, /// temp. at the end of test in degree C + outPath.TempMtrDiv != null ? outPath.TempMtrDiv.ReadTemperature() : 0, /// temp. at the diverter in degree C + PressUp, + PressDown, + PressDelta, + (outPath.Scale is IScale) ? (outPath.Scale as IScale).Mass : 0, /// collected water mass in kg + "VolMM", + AmbTemp, + AmbHumi, + AmbPress, + outPath.RegValve.Position.ToString("F1"), + TempRefHi1, + TempRefHi2, + TempRefLo1, + TempRefLo2); + } + + /// + /// Endurance data logging + /// + public void LogEnduranceHeader(System.IO.StreamWriter writer) + { + LogEnduranceHeader(writer, null); + } + + public void LogEnduranceHeader(System.IO.StreamWriter writer, string sectionName) + { + writer.WriteLine(); + if (sectionName != null) + writer.Write(sectionName); + writer.WriteLine("Time T_up T_dn Pr_up Pr_dn Flow"); + } + + public void LogEnduranceData(System.IO.StreamWriter writer) + { + + writer.WriteLine(string.Format("{0:dd.MM.yyyy HH:mm.ss} {1} {2} {3} {4} {5}", + DateTime.Now, + benchPath.TempMtrUp != null ? benchPath.TempMtrUp.ReadTemperature() : 0, /// temp. at the beginning of line in degree C + benchPath.TempMtrDown != null ? benchPath.TempMtrDown.ReadTemperature() : 0, /// temp. at the end of line in degree C + PressUp, + PressDown, + RefFlow)); + } + } } diff --git a/TBF/Rig/Sequences/SequenceBase.cs b/TBF/Rig/Sequences/SequenceBase.cs index e6d95ad24..25ccf8d3a 100644 --- a/TBF/Rig/Sequences/SequenceBase.cs +++ b/TBF/Rig/Sequences/SequenceBase.cs @@ -57,8 +57,6 @@ namespace TBF.Rig.Sequences /// They persist during all repetitions of the same test ///------------------------------------------------------------ protected static Rig.FeedingPath inPath; - protected static Rig.BenchPath benchPath; - protected static Rig.OutputPath outPath; protected static Rig.MetersPath sensPath; protected static Rig.HeatMetersPath heatMetersPath; @@ -92,116 +90,6 @@ namespace TBF.Rig.Sequences protected GenericDevices.IDataEntry lastDataEntryCmpnt; - /// - /// Process data logging - /// - public void LogProcessDataTestInfo(ILog logger, string procedureName, string testName) - { - logger.Info(Environment.NewLine); - logger.InfoFormat("{0}={1:dd.MM.yyyy HH:mm:ss} {2}={3} {4}={5} {6}={7}", - Strings.Date_and_time, TestStartTime, - Strings.Batch_nr, BatchRslts.Batch.BatchNr, - Strings.Procedure, procedureName, - Strings.Test, testName); - } - - public void LogProcessDataHeader(ILog logger) - { - LogProcessDataHeader(logger, null); - } - - public void LogProcessDataHeader(ILog logger, string sectionName) - { - logger.Info(Environment.NewLine); - if (sectionName != null) logger.Info(sectionName); - logger.Info("Time Flow TstTime Ref.cnt Ref.vol Tup Tdown Tdiv Pup Pdown Pdelta Mass VolMM Tamb Hamb Pamb Rv"); - logger.Info(Environment.NewLine); - } - - public void LogProcessData(ILog logger) - { - logger.InfoFormat("{0} {1} {2} {3} {4} {5} {6} {7} {8} {9} {10} {11} {12} {13} {14} {15} {16}", - DateTime.Now.ToLongTimeString(), - Utils.DoubleToStr(RefFlow.Val, 4), /// flow measured by the reference flow meter in m3/h - StateMachine.ControlBoard.TestTime.ToString("F3"),/// test time in s - StateMachine.ControlBoard.RefPulses, /// reference flow meter pulses count - Formulas.VolumeFromPulses(StateMachine.ControlBoard.RefPulses, 1.0f / LtrPerRefPulse).ToString("F3"), /// volume in l - TempUp, /// water temperature at the beginning of test line in degree C - TempDown, /// water temperature at the end of test line in degree C - TempDiv, /// water temperature at the diverter in degree C - PressUp, /// water pressure at the beginning of test line in bar (= 100 kPa) - PressDown, /// water pressure at the end of test line in bar (= 100 kPa) - PressDelta, - Mass, /// collected water mass in kg - "VolMM", - AmbTemp, /// ambient temperature in degree C - AmbHumi, /// ambient humidity in R% - AmbPress, /// ambient pressure in mbar (= 1 hPa) - outPath.RegValve.Position.ToString("F1")); /// regulation valve position in % (0=closed / 100=open) - } - - public void LogProcessDataHeaderHeatMeters(ILog logger, string sectionName) - { - logger.Info(Environment.NewLine); - if (sectionName != null) logger.Info(sectionName); - logger.Info("Time Flow TstTime Ref.cnt Ref.vol Tup Tdown Tdiv Pup Pdown Pdelta Mass VolMM Tamb Hamb Pamb Rv Thiac1 Thiac2 Tloac1 Tloac2"); - logger.Info(Environment.NewLine); - } - - public void LogProcessDataHeatMeters(ILog logger) - { - logger.InfoFormat("{0} {1} {2} {3} {4} {5} {6} {7} {8} {9} {10} {11} {12} {13} {14} {15} {16} {17} {18} {19} {20}", - DateTime.Now.ToLongTimeString(), - Utils.DoubleToStr(RefFlow.Val, 4), - StateMachine.ControlBoard.TestTime.ToString("F3"), - StateMachine.ControlBoard.RefPulses, - Formulas.VolumeFromPulses(StateMachine.ControlBoard.RefPulses, 1.0f / LtrPerRefPulse).ToString("F3"), - TempUp, - TempDown, - TempDiv, - PressUp, - PressDown, - PressDelta, - Mass, - "VolMM", - AmbTemp, - AmbHumi, - AmbPress, - outPath.RegValve.Position.ToString("F1"), - TempRefHi1, - TempRefHi2, - TempRefLo1, - TempRefLo2); - } - - /// - /// Endurance data logging - /// - public void LogEnduranceHeader(System.IO.StreamWriter writer) - { - LogEnduranceHeader(writer, null); - } - - public void LogEnduranceHeader(System.IO.StreamWriter writer, string sectionName) - { - writer.WriteLine(); - if (sectionName != null) - writer.Write(sectionName); - writer.WriteLine("Time T_up T_dn Pr_up Pr_dn Flow"); - } - - public void LogEnduranceData(System.IO.StreamWriter writer) - { - - writer.WriteLine(string.Format("{0:dd.MM.yyyy HH:mm.ss} {1} {2} {3} {4} {5}", - DateTime.Now, - TempUp, - TempDown, - PressUp, - PressDown, - RefFlow)); - } - /// /// Used in tests in measurement loop to display remaining test time /// @@ -261,37 +149,29 @@ namespace TBF.Rig.Sequences } while (!e.Contains(Event.ValvesSet)); - IOperation timer = new TimerOp(tank.EmptyTimeSec, remainingTimeSec); + + State.Create("SequenceBase : Draining the tank") + .AddOperation(checkUiOp) + .AddOperation(new TimerOp(tank.EmptyTimeSec, remainingTimeSec)) + .AddOperations(extraOperations) + .EnterState(); do { - State.Create("SequenceBase : Draining the tank") - .AddOperation(checkUiOp) - .AddOperation(timer) - .AddOperation((tank is IScale) ? (tank as IScale).ReadMassOp(ref Mass) : null) - .AddOperations(extraOperations) - .EnterState(); - do + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) return Event.Error; + if (TestAndLogUiCmdStop(e)) { - e = StateMachine.WaitRunDevsRunOps(); - if (e.Contains(Event.Error)) return Event.Error; - if (TestAndLogUiCmdStop(e)) - { - stopped = true; - break; - } - if (e.Contains(Event.ScaleOverload)) { }; /// Tank should be emptying now - /// - if (!(tank is IScale)) - { - Bridge.OnActivity(this, string.Format("{0} ... {1} {2} {3} {4}", - Strings.Emptying_tank, - remainingTimeSec.Val / 60, "min", - remainingTimeSec.Val % 60, Strings.sec)); - } + stopped = true; + break; + } + /// + if (!(tank is IScale)) + { + Bridge.OnActivity(this, string.Format("{0} ... {1} {2} {3} {4}", + Strings.Emptying_tank, + remainingTimeSec.Val / 60, "min", + remainingTimeSec.Val % 60, Strings.sec)); } - while ((tank is IScale) && !e.Contains(Event.ScaleDone)); - - if (stopped) break; } while (!tank.IsEmpty() && !e.Contains(Event.TimerExpired)); } @@ -314,37 +194,28 @@ namespace TBF.Rig.Sequences /// /// 1st half /// - IOperation timer1 = new TimerOp(tank.EmptyTimeSec / 2, remainingTimeSec); + State.Create("SequenceBase : Draining the tank") + .AddOperation(checkUiOp) + .AddOperation(new TimerOp(tank.EmptyTimeSec / 2, remainingTimeSec)) + .AddOperations(extraOperations) + .EnterState(); do { - State.Create("SequenceBase : Draining the tank") - .AddOperation(checkUiOp) - .AddOperation(timer1) - .AddOperation((tank is IScale) ? (tank as IScale).ReadMassOp(ref Mass) : null) - .AddOperations(extraOperations) - .EnterState(); - do + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) return Event.Error; + if (TestAndLogUiCmdStop(e)) { - e = StateMachine.WaitRunDevsRunOps(); - if (e.Contains(Event.Error)) return Event.Error; - if (TestAndLogUiCmdStop(e)) - { - stopped = true; - break; - } - if (e.Contains(Event.ScaleOverload)) { }; /// Tank should be emptying now - /// - if (!(tank is IScale)) - { - Bridge.OnActivity(this, string.Format("{0} ... {1} {2} {3} {4}", - Strings.Emptying_tank, - (remainingTimeSec.Val + tank.EmptyTimeSec / 2) / 60, "min", - (remainingTimeSec.Val + tank.EmptyTimeSec / 2) % 60, Strings.sec)); - } + stopped = true; + break; + } + /// + if (!(tank is IScale)) + { + Bridge.OnActivity(this, string.Format("{0} ... {1} {2} {3} {4}", + Strings.Emptying_tank, + (remainingTimeSec.Val + tank.EmptyTimeSec / 2) / 60, "min", + (remainingTimeSec.Val + tank.EmptyTimeSec / 2) % 60, Strings.sec)); } - while ((tank is IScale) && !e.Contains(Event.ScaleDone)); - - if (stopped) break; } while (!tank.IsEmpty() && !e.Contains(Event.TimerExpired)); @@ -364,38 +235,30 @@ namespace TBF.Rig.Sequences } while (!e.Contains(Event.ValvesSet)); - IOperation timer2 = new TimerOp(tank.EmptyTimeSec / 2, remainingTimeSec); + + State.Create("SequenceBase : Draining the tank") + .AddOperation(checkUiOp) + .AddOperation(new TimerOp(tank.EmptyTimeSec / 2, remainingTimeSec)) + .AddOperations(extraOperations) + .EnterState(); do { - State.Create("SequenceBase : Draining the tank") - .AddOperation(checkUiOp) - .AddOperation(timer2) - .AddOperation((tank is IScale) ? (tank as IScale).ReadMassOp(ref Mass) : null) - .AddOperations(extraOperations) - .EnterState(); - do + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.Error)) return Event.Error; + if (TestAndLogUiCmdStop(e)) { - e = StateMachine.WaitRunDevsRunOps(); - if (e.Contains(Event.Error)) return Event.Error; - if (TestAndLogUiCmdStop(e)) - { - stopped = true; - break; - } - if (e.Contains(Event.ScaleOverload)) { }; /// Tank should be emptying now - /// - if (!(tank is IScale)) - { - Bridge.OnActivity(this, string.Format("{0} ... {1} {2} {3} {4}", - Strings.Emptying_tank, - remainingTimeSec.Val / 60, "min", - remainingTimeSec.Val % 60, Strings.sec)); - } - + stopped = true; + break; + } + /// + if (!(tank is IScale)) + { + Bridge.OnActivity(this, string.Format("{0} ... {1} {2} {3} {4}", + Strings.Emptying_tank, + remainingTimeSec.Val / 60, "min", + remainingTimeSec.Val % 60, Strings.sec)); } - while ((tank is IScale) && !e.Contains(Event.ScaleDone)); - if (stopped) break; } while (!tank.IsEmpty() && !e.Contains(Event.TimerExpired)); } @@ -406,7 +269,6 @@ namespace TBF.Rig.Sequences // State.Create("SequenceBase : Closing the drain valve") .AddOperation(checkUiOp) - .AddOperation((tank is IScale) ? (tank as IScale).ReadMassOp(ref Mass) : null) .AddOperation(StateMachine.ControlBoard.SetValvesOp(null, tank.DrainValve)) .AddOperations(extraOperations) .EnterState(); @@ -422,7 +284,6 @@ namespace TBF.Rig.Sequences { State.Create("SequenceBase : Closing the 2nd drain valve") .AddOperation(checkUiOp) - .AddOperation((tank is IScale) ? (tank as IScale).ReadMassOp(ref Mass) : null) .AddOperation(StateMachine.ControlBoard.SetValvesOp(null, tank.DrainValve2)) .AddOperations(extraOperations) .EnterState(); @@ -432,25 +293,24 @@ namespace TBF.Rig.Sequences if (e.Contains(Event.Error)) return Event.Error; if (TestAndLogUiCmdStop(e)) return Event.UiCmdStop; } - while (!e.Contains(Event.ValvesSet) || ((tank is IScale) && !e.Contains(Event.ScaleDone))); + while (!e.Contains(Event.ValvesSet)); } - if (tank is IScale) - { - State.Create("SequenceBase : Updating the mass") - .AddOperation(checkUiOp) - .AddOperation((tank as IScale).ReadMassOp(ref Mass)) - .AddOperation(new Operations.TimerOp(5)) - .AddOperations(extraOperations) - .EnterState(); - do - { - e = StateMachine.WaitRunDevsRunOps(); - if (e.Contains(Event.Error)) return Event.Error; - if (TestAndLogUiCmdStop(e)) return Event.UiCmdStop; - } - while (!e.Contains(Event.ScaleDone) || !e.Contains(Event.TimerExpired)); - } + //if (tank is IScale) + //{ + // State.Create("SequenceBase : Updating the mass") + // .AddOperation(checkUiOp) + // .AddOperation(new Operations.TimerOp(5)) + // .AddOperations(extraOperations) + // .EnterState(); + // do + // { + // e = StateMachine.WaitRunDevsRunOps(); + // if (e.Contains(Event.Error)) return Event.Error; + // if (TestAndLogUiCmdStop(e)) return Event.UiCmdStop; + // } + // while (!e.Contains(Event.TimerExpired)); + //} if (stopped) return Event.UiCmdStop; @@ -1988,7 +1848,7 @@ namespace TBF.Rig.Sequences else if (inPath.Pump is IValve) log.FatalFormat(" Feeding valve: {0}", (inPath.Pump as IValve).State ? "open" : "close"); if (outPath.RegValve is IRegValve) log.FatalFormat(" Regulation valve position: {0}%", outPath.RegValve.Position); log.FatalFormat(" Flow: {0}", RefFlow); - log.FatalFormat(" Mass: {0}", Mass); + log.FatalFormat(" Mass: {0}", (outPath.Scale is IScale) ? (outPath.Scale as IScale).Mass : 0); log.FatalFormat(" Start mass: {0}", StartMass); log.FatalFormat(" Liter/ref.pulse: {0}", LtrPerRefPulse); log.FatalFormat(" Reference pulses: {0}", RefPulses); diff --git a/TBF/Rig/TestMethods/CombinedWithDetection/CombinedWithDetectionSeq.cs b/TBF/Rig/TestMethods/CombinedWithDetection/CombinedWithDetectionSeq.cs index c915e0cd4..63bfb6400 100644 --- a/TBF/Rig/TestMethods/CombinedWithDetection/CombinedWithDetectionSeq.cs +++ b/TBF/Rig/TestMethods/CombinedWithDetection/CombinedWithDetectionSeq.cs @@ -198,20 +198,7 @@ namespace TBF.Rig.TestMethods.CombinedWithDetection if (!test.DoDraining) /// Do not skip emptying if test.Emptying==true { - //-------------------------------- - State.Create(string.Format("{0}({1}) : Mesuring mass of water in the tank", test.Method, test.Name)) - .AddOperation(checkUiOp) - .AddOperations(readTempPressOps) - .AddOperation(scale.ReadMassOp(ref Mass)) - .EnterState(); - do { - e = StateMachine.WaitRunDevsRunOps(); - if (e.Contains(Event.Error)) goto error; - if (TestAndLogUiCmdStop(test,e)) goto stopTest; - } - while (!e.Contains(Event.ScaleDone)); - - double estimatedEndMass = Mass.Val + test.Volume; + double estimatedEndMass = scale.Mass + test.Volume; if (estimatedEndMass < scale.Capacity * Constants.TankFullFactor) { goto switching_flow_detection; /// Enough room in the tank -> skip emptying @@ -551,7 +538,6 @@ namespace TBF.Rig.TestMethods.CombinedWithDetection } while (!e.Contains(Event.ScaleDone)); /// - Mass.Val = StartMass.Val; tMass1 = StateMachine.Time; //------------------------------------------------ diff --git a/TBF/Rig/TestMethods/DiverterTest/DiverterTestSeq.cs b/TBF/Rig/TestMethods/DiverterTest/DiverterTestSeq.cs index 2140d0f94..8ef3b649e 100644 --- a/TBF/Rig/TestMethods/DiverterTest/DiverterTestSeq.cs +++ b/TBF/Rig/TestMethods/DiverterTest/DiverterTestSeq.cs @@ -180,22 +180,7 @@ namespace TBF.Rig.TestMethods.DiverterTest if (!drainTheTank) /// If condition met => skip measuring and force emptying { - /// - /// Measure the weight and skip emptying if there is enough room in the tank - /// - State.Create(string.Format("{0}({1}) : Checking available tank capacity", test.Method, test.Name)) - .AddOperation(checkUiOp) - .AddOperations(readTempPressOps) - .AddOperation(scale.ReadMassOp(ref Mass)) - .EnterState(); - do { - e = StateMachine.WaitRunDevsRunOps(); - if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; } - if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; } - } - while (!e.Contains(Event.ScaleDone)); - - double estimatedEndMass = Mass.Val + test.Volume; + double estimatedEndMass = scale.Mass + test.Volume; if (estimatedEndMass >= scale.Capacity * Constants.TankFullFactor) { drainTheTank = true; @@ -456,7 +441,6 @@ namespace TBF.Rig.TestMethods.DiverterTest } while (!e.Contains(Event.ScaleDone)); - Mass.Val = StartMass.Val; tMass1 = StateMachine.Time; log.WarnFormat("Start mass = {0}kg", StartMass); diff --git a/TBF/Rig/TestMethods/FixedStartAdvanced/FixedStartAdvancedSeq.cs b/TBF/Rig/TestMethods/FixedStartAdvanced/FixedStartAdvancedSeq.cs index a8aab50b5..ee3cd5df9 100644 --- a/TBF/Rig/TestMethods/FixedStartAdvanced/FixedStartAdvancedSeq.cs +++ b/TBF/Rig/TestMethods/FixedStartAdvanced/FixedStartAdvancedSeq.cs @@ -161,33 +161,10 @@ namespace TBF.Rig.TestMethods.FixedStartAdvanced TestStartTime = DateTime.Now; - if (!test.DoDraining) + if (test.DoDraining || (scale.Mass + test.Volume >= scale.Capacity * Constants.TankFullFactor)) { /// - /// Measure the weight in case there is no unconditional draining - /// - State.Create("FixedStartAdvanced : Measuring mass of water in the tank") - .AddOperation(checkUiOp) - .AddOperations(readTempPressOps) - .AddOperation(scale.ReadMassOp(ref Mass)) - .EnterState(); - do { - e = StateMachine.WaitRunDevsRunOps(); - Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting)); - Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting)); - - if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; } - if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; } - } - while (!e.Contains(Event.ScaleDone)); - } - /// - /// Skip draining in case there is enough room in the tank - /// - if (test.DoDraining || (Mass.Val + test.Volume >= scale.Capacity * Constants.TankFullFactor)) - { - /// - /// Drain the water tank + /// There is not enough room in the tank OR unconditional draining ... drain the water tank /// switch (DrainTheTank(scale, readTempPressOps)) { @@ -386,7 +363,6 @@ namespace TBF.Rig.TestMethods.FixedStartAdvanced while (!e.Contains(Event.ScaleDone)); /// TestStartTime = DateTime.Now; - Mass.Val = StartMass.Val; tMass1 = StateMachine.Time; //------------------------------------------------ diff --git a/TBF/Rig/TestMethods/FixedStartMassCollAdvanced/FixedStartMassCollAdvancedSeq.cs b/TBF/Rig/TestMethods/FixedStartMassCollAdvanced/FixedStartMassCollAdvancedSeq.cs index f631924b3..cb17efbe0 100644 --- a/TBF/Rig/TestMethods/FixedStartMassCollAdvanced/FixedStartMassCollAdvancedSeq.cs +++ b/TBF/Rig/TestMethods/FixedStartMassCollAdvanced/FixedStartMassCollAdvancedSeq.cs @@ -184,33 +184,10 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollAdvanced #region Make sure there is enough space in the tank - if (!test.DoDraining) + if (test.DoDraining || (scale.Mass + test.Volume >= scale.Capacity * Constants.TankFullFactor)) { /// - /// Measure the weight in case there is no unconditional draining - /// - State.Create(string.Format("{0}({1}) : Measuring mass of water in the tank", test.Method, test.Name)) - .AddOperation(checkUiOp) - .AddOperations(readTempPressOps) - .AddOperation(scale.ReadMassOp(ref Mass)) - .AddOperation(heatMetersPromptOp) - .EnterState(); - do { - e = StateMachine.WaitRunDevsRunOps(); - Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.JustStarted)); - - if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; } - if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; } - } - while (!e.Contains(Event.ScaleDone)); - } - /// - /// Skip draining in case there is enough room in the tank - /// - if (test.DoDraining || (Mass.Val + test.Volume >= scale.Capacity * Constants.TankFullFactor)) - { - /// - /// Drain the water tank + /// There is not enough room in the tank OR unconditional draining ... drain the water tank /// IList ops = new List(readTempPressOps); ops.Add(heatMetersPromptOp); @@ -226,7 +203,6 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollAdvanced State.Create(string.Format("{0}({1}) : Make sure the drain valve is closed", test.Method, test.Name)) .AddOperation(checkUiOp) .AddOperations(readTempPressOps) - .AddOperation(scale.ReadMassOp(ref Mass)) .AddOperation(heatMetersPromptOp) .AddOperation(cBrd.SetValvesOp(null, scale.DrainValve)) .EnterState(); @@ -288,7 +264,6 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollAdvanced } while (!e.Contains(Event.ScaleDone)); /// - Mass.Val = StartMass.Val; tMass1 = StateMachine.Time; #endregion @@ -340,7 +315,6 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollAdvanced State.Create(string.Format("{0}({1}) : Entering begin-state", test.Method, test.Name)) .AddOperation(checkUiOp) .AddOperations(readTempPressOps) - .AddOperation(scale.ReadMassOp(ref Mass)) .AddOperation((dataEntryCmpnt as GenericDevices.IHasWMStatesForm).ShowAdvancedTestStartFormOp(sensPath.RegisterReaders, BatchRslts.Batch.WaterMeters, false)) .EnterState(); do @@ -494,7 +468,6 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollAdvanced State.Create(string.Format("{0}({1}) : Start the test, open the start/stop valve", test.Method, test.Name)) .AddOperation(checkUiOp) .AddOperations(readTempPressOps) - .AddOperation(scale.ReadMassOp(ref Mass)) //.AddOperation(cBrd.StartTestOp(test, false, true, true, test.Qfrom, test.Qto, totalPulses, 0)) .AddOperation(cBrd.OpenStartValveOp()) .EnterState(); @@ -597,7 +570,6 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollAdvanced State.Create(string.Format("{0}({1}) : Closing the start/stop valve at the end of the fixed start test", test.Method, test.Name)) .AddOperation(checkUiOp) .AddOperations(readTempPressOps) - .AddOperation(scale.ReadMassOp(ref Mass)) .AddOperation(cBrd.CloseStartValveOp()) .EnterState(); do { @@ -610,7 +582,6 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollAdvanced State.Create(string.Format("{0}({1}) : Stopping flow regulation", test.Method, test.Name)) .AddOperation(checkUiOp) .AddOperations(readTempPressOps) - .AddOperation(scale.ReadMassOp(ref Mass)) .AddOperation(cBrd.StopFlowRegulationOp()) .EnterState(); do { diff --git a/TBF/Rig/TestMethods/FixedStartMassCollDeferredEval/FixedStartMassCollDeferredEvalSeq.cs b/TBF/Rig/TestMethods/FixedStartMassCollDeferredEval/FixedStartMassCollDeferredEvalSeq.cs index a88b62d3b..98ba96d09 100644 --- a/TBF/Rig/TestMethods/FixedStartMassCollDeferredEval/FixedStartMassCollDeferredEvalSeq.cs +++ b/TBF/Rig/TestMethods/FixedStartMassCollDeferredEval/FixedStartMassCollDeferredEvalSeq.cs @@ -207,30 +207,10 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollDeferredEval } - if (!test.DoDraining) - { - /// - /// Measure the weight in case there is no unconditional draining - /// - State.Create(string.Format("{0}({1}) : Measuring mass of water in the tank", test.Method, test.Name)) - .AddOperation(checkUiOp) - .AddOperations(readTempPressOps) - .AddOperation(scale.ReadMassOp(ref Mass)) - .AddOperation(heatMetersPromptOp) - .EnterState(); - do { - e = StateMachine.WaitRunDevsRunOps(); - Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.JustStarted)); - - if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; } - if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; } - } - while (!e.Contains(Event.ScaleDone)); - } /// /// Skip draining in case there is enough room in the tank /// - if (test.DoDraining || (Mass.Val + test.Volume >= scale.Capacity * Constants.TankFullFactor)) + if (test.DoDraining || (scale.Mass + test.Volume >= scale.Capacity * Constants.TankFullFactor)) { /// /// Drain the water tank @@ -249,7 +229,6 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollDeferredEval State.Create(string.Format("{0}({1}) : Make sure the drain valve is closed", test.Method, test.Name)) .AddOperation(checkUiOp) .AddOperations(readTempPressOps) - .AddOperation(scale.ReadMassOp(ref Mass)) .AddOperation(heatMetersPromptOp) .AddOperation(StateMachine.ControlBoard.SetValvesOp(null, scale.DrainValve)) .EnterState(); @@ -531,7 +510,6 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollDeferredEval } while (!e.Contains(Event.ScaleDone)); /// - Mass.Val = StartMass.Val; tMass1 = StateMachine.Time; diff --git a/TBF/Rig/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs b/TBF/Rig/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs index 4ccab7ae9..2eb982ef5 100644 --- a/TBF/Rig/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs +++ b/TBF/Rig/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs @@ -22,8 +22,7 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollection /// true when capabilities of devices are OK public static bool CheckDeviceCaps(Config.Entities.Test test, OutputPath devices, out string message) { - if (!(StateMachine.ControlBoard is ControlBoard.Legacy.CBoard) && - !(StateMachine.ControlBoard is ControlBoard.Papouch.PapouchCB) && + if (!(StateMachine.ControlBoard is ControlBoard.Papouch.PapouchCB) && !(StateMachine.ControlBoard is ControlBoard.Uni.UniCB)) { /// Control board does not support this method @@ -182,35 +181,11 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollection } - - if (!test.DoDraining) + if (test.DoDraining || (scale.Mass + test.Volume >= scale.Capacity * Constants.TankFullFactor)) { - /// - /// Measure the weight in case there is no unconditional draining - /// - State.Create(string.Format("{0}({1}) : Measuring mass of water in the tank", test.Method, test.Name)) - .AddOperation(checkUiOp) - .AddOperations(readTempPressOps) - .AddOperation(scale.ReadMassOp(ref Mass)) - .AddOperation(heatMetersPromptOp) - .EnterState(); - do { - e = StateMachine.WaitRunDevsRunOps(); - Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.JustStarted)); - - if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; } - if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; } - } - while (!e.Contains(Event.ScaleDone)); - } - /// - /// Skip draining in case there is enough room in the tank - /// - if (test.DoDraining || (Mass.Val + test.Volume >= scale.Capacity * Constants.TankFullFactor)) - { - /// - /// Drain the water tank - /// + /// + /// There is not enough room in the tank OR unconditional draining ... drain the water tank + /// IList ops = new List(readTempPressOps); ops.Add(heatMetersPromptOp); switch (DrainTheTank(scale, ops)) @@ -225,7 +200,6 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollection State.Create(string.Format("{0}({1}) : Make sure the drain valve is closed", test.Method, test.Name)) .AddOperation(checkUiOp) .AddOperations(readTempPressOps) - .AddOperation(scale.ReadMassOp(ref Mass)) .AddOperation(heatMetersPromptOp) .AddOperation(cBrd.SetValvesOp(null, scale.DrainValve)) .EnterState(); @@ -506,7 +480,6 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollection } while (!e.Contains(Event.ScaleDone)); /// - Mass.Val = StartMass.Val; tMass1 = StateMachine.Time; @@ -556,7 +529,6 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollection State.Create(string.Format("{0}({1}) : Entering begin-state", test.Method, test.Name)) .AddOperation(checkUiOp) .AddOperations(readTempPressOps) - .AddOperation(scale.ReadMassOp(ref Mass)) .AddOperation((dataEntryCmpnt as GenericDevices.IHasWMStatesForm).ShowTestStartFormOp(sensPath.RegisterReaders)) .EnterState(); do { @@ -624,73 +596,51 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollection } - if (heatMetersPath == null) LogProcessDataHeader(processDataLogger, "Measurement"); - else LogProcessDataHeaderHeatMeters(processDataLogger, "Measurement"); + if (heatMetersPath == null) + LogProcessDataHeader(processDataLogger, "Measurement"); + else + LogProcessDataHeaderHeatMeters(processDataLogger, "Measurement"); //------------------------------------------------ Bridge.OnActivity(this, Strings.Test_in_progress); //------------------------------------------------ - StartTime = (double)StateMachine.Time; + + /// Measurement loop preparation TestStartTime = DateTime.Now; + StartTime = (double)StateMachine.Time; + int estimtdEndTime = StateMachine.Time + (int)test.TestTime; + int remainingTime; + StartNewStatistics(StateMachine.Time, BatchRslts.Batch.BatchNr, test.Name, repetitionNr, Math.Max((int)(test.TestTime / 10), 5)); State.Create(string.Format("{0}({1}) : Start the test, open the start/stop valve", test.Method, test.Name)) .AddOperation(checkUiOp) .AddOperations(readTempPressOps) - .AddOperation(scale.ReadMassOp(ref Mass)) .AddOperation(cBrd.OpenStartValveOp()) - //.AddOperation(cBrd.StartTestOp(test, false, true, true, test.Qfrom, test.Qto, totalPulses, 0)) + .AddOperation(cBrd.StandingStartStopTestOp(test, test.Qfrom, test.Qto, totalPulses)) + .AddOperation(processDataLoggingOp) .EnterState(); do { e = StateMachine.WaitRunDevsRunOps(); - if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; } - if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; } - } - while (!e.Contains(Event.ValvesSet) || !e.Contains(Event.TestInProgress)); + if (e.Contains(Event.OpArgumentError)) { retVal = Event.OpArgumentError; goto stopTest; } + if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; } + if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; } - switchTimeStart = 0.001f * cBrd.ValveOpenCloseTime; - log.WarnFormat("Start valve switch time on test start = {0} ms", cBrd.ValveOpenCloseTime); - - /// Measurement loop - preparation - queryEnd1 = cBrd.QueryMeasurementEndOp(); - - StartNewStatistics(StateMachine.Time, BatchRslts.Batch.BatchNr, test.Name, repetitionNr, Math.Max((int)(test.TestTime / 10), 5)); - int estimtdEndTime = StateMachine.Time + (int)test.TestTime; - - /// Measurement loop - begin - do - { - //-------------------------------- - switch (ReadRegistersTempPressAmbient(null, true)) - { - case Event.Error: - retVal = Event.Error; - goto stopTest; - - case Event.UiCmdStop: - retVal = Event.UiCmdStop; - goto stopTest; - - case Event.TestCompleted: - goto test_completed; - } - - int remainingTime = Math.Max(estimtdEndTime - StateMachine.Time, 0); - if (remainingTime > 60) - { + /// Show remaining time + if ((remainingTime = Math.Max(estimtdEndTime - StateMachine.Time, 0)) > 60) Bridge.OnActivity(this, string.Format("{0} ... {1} {2} {3} {4}", Strings.Test_in_progress, remainingTime / 60, "min", remainingTime % 60, Strings.sec)); - } else - { Bridge.OnActivity(this, string.Format("{0} ... {1} s", Strings.Test_in_progress, remainingTime)); - } + /// Update statistics RefFrequency.Val = cBrd.RefFrequency; RefFlow.Val = outPath.FlowMeter.ReadFlow(); + UpdateAllStatistics(StateMachine.Time); - UpdateAllStatistics(StateMachine.Time); + #region Heat meters if (heatMetersTestParams != null) { + /// Update heatmeter volume and energy values if (lastEnergyUpdateTime == 0) { lastEnergyUpdateTime = StateMachine.Time; @@ -698,9 +648,9 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollection else { //double deltaTime = (double)(StateMachine.Time - lastEnergyUpdateTime); - double T_in = (TempRefHi1.Val + TempRefHi2.Val) / 2; /// [°C] - double T_out = (TempRefLo1.Val + TempRefLo2.Val) / 2; /// [°C] - double deltaVolume = LtrPerRefPulse * RefPulsesDelta; /// [l] + double T_in = (TempRefHi1.Val + TempRefHi2.Val) / 2; /// [°C] + double T_out = (TempRefLo1.Val + TempRefLo2.Val) / 2; /// [°C] + double deltaVolume = LtrPerRefPulse * RefPulsesDelta; /// [l] double deltaEnergy = (0.001 * deltaVolume) * (T_in - T_out) * Config.Formulas.HeatCoefficientWater(16, T_in, T_out, heatMetersTestParams.FlowMeasuredAtHiTempPipe); /// [J] = [m3] * [K] * [J/(m3 K)] Energy.Update(deltaEnergy); VolumeForEnergy.Update(deltaVolume); @@ -708,39 +658,25 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollection } } - if (compound) - { - /// TODO: Reimplement for combined meters - //for (int i = 0; i < Config.Data.CompoundWMsCount; i++) - //{ - // data.TestResult.CombinedMeters[i].VolumeMeter = data.TestResult.Meters[2 * i].VolumeMeter - // + data.TestResult.Meters[2 * i + 1].VolumeMeter; - // if (data.Volume.Valid) - // { - // data.TestResult.CombinedMeters[i].VolumeErrorPct = - // Formulas.ErrorFromVolumes(data.TestResult.CombinedMeters[i].VolumeMeter, data.Volume.Val); - // } - //} - } + #endregion Bridge.OnProcessData(this, new ProcessDataEventArgs(test, repetitionNr, Config.Entities.Progress.Test)); Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.Test)); } - while (cBrd.RefPulses < totalPulses); - /// Measurement loop - end - - test_completed: - - StopRecordingStatistics(); + while (!e.Contains(Event.TestCompleted) && !e.Contains(Event.Next)); + /// Measurement loop end + switchTimeStart = 0.001f * cBrd.ValveOpenCloseTime; + log.WarnFormat("Start valve switch time on test start = {0} ms", cBrd.ValveOpenCloseTime); + StopRecordingStatistics(); EndTime = (double)StateMachine.Time; TestEndTime = DateTime.Now; State.Create(string.Format("{0}({1}) : Closing the start/stop valve at the end of the fixed start test", test.Method, test.Name)) .AddOperation(checkUiOp) .AddOperations(readTempPressOps) - .AddOperation(scale.ReadMassOp(ref Mass)) .AddOperation(cBrd.CloseStartValveOp()) + .AddOperation(processDataLoggingOp) .EnterState(); do { e = StateMachine.WaitRunDevsRunOps(); @@ -748,26 +684,13 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollection } while (e.Contains(Event.ValvesBusy)); - - State.Create(string.Format("{0}({1}) : Stopping flow regulation", test.Method, test.Name)) - .AddOperation(checkUiOp) - .AddOperations(readTempPressOps) - .AddOperation(scale.ReadMassOp(ref Mass)) - .AddOperation(cBrd.StopFlowRegulationOp()) - .EnterState(); - do { - e = StateMachine.WaitRunDevsRunOps(); - if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; } - if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; } - } - while (!e.Contains(Event.FlowRegulationStopped)); - - switchTimeEnd = 0.001f * cBrd.ValveOpenCloseTime; log.WarnFormat("Start valve switch time on test end = {0} ms", cBrd.ValveOpenCloseTime); - if (heatMetersPath == null) LogProcessDataHeader(processDataLogger, "End mass"); - else LogProcessDataHeaderHeatMeters(processDataLogger, "End mass"); + if (heatMetersPath == null) + LogProcessDataHeader(processDataLogger, "End mass"); + else + LogProcessDataHeaderHeatMeters(processDataLogger, "End mass"); //------------------------------------------------ Bridge.OnActivity(this, Strings.Measuring_the_weight); @@ -799,7 +722,6 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollection State.Create(string.Format("{0}({1}) : Open the drain valve", test.Method, test.Name)) .AddOperation(checkUiOp) .AddOperation(cBrd.SetValvesOp(scale.DrainValve, null)) - .AddOperations(readTempPressOps) .EnterState(); do { @@ -810,18 +732,6 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollection } - State.Create(string.Format("{0}({1}) : Stopping diverter, gate, etc.", test.Method, test.Name)) - .AddOperation(checkUiOp) - .AddOperations(readTempPressOps) - .AddOperation(cBrd.StopPreviousOp()) - .EnterState(); - do { - e = StateMachine.WaitRunDevsRunOps(); - if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; } - } - while (!e.Contains(Event.PreviousStopped)); - - double massStart = Config.Formulas.CorrectedValue(StartMass.Val, scale.Corrections); double massEnd = Config.Formulas.CorrectedValue(EndMass.Val, scale.Corrections); double densityOut = Config.Formulas.WaterDensityFromTempPress((TempUpStat.Average + TempDownStat.Average) / 2, @@ -953,7 +863,6 @@ namespace TBF.Rig.TestMethods.FixedStartMassCollection } } - //------------------------------------------------ Bridge.OnActivity(this, Strings.Test_completed); //------------------------------------------------ diff --git a/TBF/Rig/TestMethods/FlyingStartFirstRepetWithMassColl/FlyingStartFirstRepetWithMassCollSeq.cs b/TBF/Rig/TestMethods/FlyingStartFirstRepetWithMassColl/FlyingStartFirstRepetWithMassCollSeq.cs index 15a7c509c..65c456022 100644 --- a/TBF/Rig/TestMethods/FlyingStartFirstRepetWithMassColl/FlyingStartFirstRepetWithMassCollSeq.cs +++ b/TBF/Rig/TestMethods/FlyingStartFirstRepetWithMassColl/FlyingStartFirstRepetWithMassCollSeq.cs @@ -212,7 +212,6 @@ namespace TBF.Rig.TestMethods.FlyingStartFirstRepetWithMassColl State.Create(string.Format("{0}({1}) : Checking available tank capacity", test.Method, test.Name)) .AddOperation(checkUiOp) .AddOperations(readTempPressOps) - .AddOperation(scale.ReadMassOp(ref Mass)) .EnterState(); do { e = StateMachine.WaitRunDevsRunOps(); @@ -221,7 +220,7 @@ namespace TBF.Rig.TestMethods.FlyingStartFirstRepetWithMassColl } while (!e.Contains(Event.ScaleDone)); - double estimatedEndMass = Mass.Val + test.Volume; + double estimatedEndMass = scale.Mass + test.Volume; if (estimatedEndMass >= scale.Capacity * Constants.TankFullFactor) { drainTheTank = true; @@ -547,7 +546,6 @@ namespace TBF.Rig.TestMethods.FlyingStartFirstRepetWithMassColl } while (!e.Contains(Event.ScaleDone)); - Mass.Val = StartMass.Val; tMass1 = StateMachine.Time; log.WarnFormat("Start mass = {0}kg", StartMass); } diff --git a/TBF/Rig/TestMethods/FlyingStartMassCollComparative/FlyingStartMassCollComparativeSeq.cs b/TBF/Rig/TestMethods/FlyingStartMassCollComparative/FlyingStartMassCollComparativeSeq.cs index 957fa6fc6..063c02763 100644 --- a/TBF/Rig/TestMethods/FlyingStartMassCollComparative/FlyingStartMassCollComparativeSeq.cs +++ b/TBF/Rig/TestMethods/FlyingStartMassCollComparative/FlyingStartMassCollComparativeSeq.cs @@ -227,7 +227,6 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollComparative State.Create(string.Format("{0}({1}) : Checking available tank capacity", test.Method, test.Name)) .AddOperation(checkUiOp) .AddOperations(readTempPressOps) - .AddOperation(scale.ReadMassOp(ref Mass)) .EnterState(); do { e = StateMachine.WaitRunDevsRunOps(); @@ -236,7 +235,7 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollComparative } while (!e.Contains(Event.ScaleDone)); - double estimatedEndMass = Mass.Val + test.Volume; + double estimatedEndMass = scale.Mass + test.Volume; if (estimatedEndMass >= scale.Capacity * Constants.TankFullFactor) { drainTheTank = true; @@ -543,7 +542,6 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollComparative .AddOperation(checkUiOp) .AddOperations(readTempPressOps) .AddOperation(StateMachine.ControlBoard.SetValvesOp(compareValves, null)) - .AddOperation(scale.ReadMassOp(ref Mass)) .EnterState(); do { e = StateMachine.WaitRunDevsRunOps(); @@ -592,7 +590,6 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollComparative .AddOperation(checkUiOp) .AddOperations(readTempPressOps) .AddOperation(StateMachine.ControlBoard.SetValvesOp(null, compareValves)) - .AddOperation(scale.ReadMassOp(ref Mass)) .EnterState(); do { e = StateMachine.WaitRunDevsRunOps(); @@ -629,7 +626,6 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollComparative } while (!e.Contains(Event.ScaleDone)); - Mass.Val = StartMass.Val; tMass1 = StateMachine.Time; log.WarnFormat("Start mass = {0}kg", StartMass); diff --git a/TBF/Rig/TestMethods/FlyingStartMassCollProlonged/FlyingStartMassCollProlongedSeq.cs b/TBF/Rig/TestMethods/FlyingStartMassCollProlonged/FlyingStartMassCollProlongedSeq.cs index d05cfcb5a..f9bee919a 100644 --- a/TBF/Rig/TestMethods/FlyingStartMassCollProlonged/FlyingStartMassCollProlongedSeq.cs +++ b/TBF/Rig/TestMethods/FlyingStartMassCollProlonged/FlyingStartMassCollProlongedSeq.cs @@ -199,22 +199,7 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollProlonged if (!drainTheTank) /// If condition met => skip measuring and force emptying { - /// - /// Measure the weight and skip emptying if there is enough room in the tank - /// - State.Create(string.Format("{0}({1}) : Checking available tank capacity", test.Method, test.Name)) - .AddOperation(checkUiOp) - .AddOperations(readTempPressOps) - .AddOperation(scale.ReadMassOp(ref Mass)) - .EnterState(); - do { - e = StateMachine.WaitRunDevsRunOps(); - if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; } - if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; } - } - while (!e.Contains(Event.ScaleDone)); - - double estimatedEndMass = Mass.Val + volumeToTank; + double estimatedEndMass = scale.Mass + volumeToTank; if (estimatedEndMass >= scale.Capacity * Constants.TankFullFactor) { drainTheTank = true; @@ -540,7 +525,6 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollProlonged } while (!e.Contains(Event.ScaleDone)); - Mass.Val = StartMass.Val; tMass1 = StateMachine.Time; log.WarnFormat("Start mass = {0}kg", StartMass); diff --git a/TBF/Rig/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs b/TBF/Rig/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs index ca72e90c8..6dd6f7975 100644 --- a/TBF/Rig/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs +++ b/TBF/Rig/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs @@ -195,22 +195,7 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollection if (!drainTheTank) /// If condition met => skip measuring and force emptying { - /// - /// Measure the weight and skip emptying if there is enough room in the tank - /// - State.Create(string.Format("{0}({1}) : Checking available tank capacity", test.Method, test.Name)) - .AddOperation(checkUiOp) - .AddOperations(readTempPressOps) - .AddOperation(scale.ReadMassOp(ref Mass)) - .EnterState(); - do { - e = StateMachine.WaitRunDevsRunOps(); - if (e.Contains(Event.Error)) { retVal = Event.Error; goto stopTest; } - if (TestAndLogUiCmdStop(test, e)) { retVal = Event.UiCmdStop; goto stopTest; } - } - while (!e.Contains(Event.ScaleDone)); - - double estimatedEndMass = Mass.Val + test.Volume; + double estimatedEndMass = scale.Mass + test.Volume; if (estimatedEndMass >= scale.Capacity * Constants.TankFullFactor) { drainTheTank = true; @@ -536,7 +521,6 @@ namespace TBF.Rig.TestMethods.FlyingStartMassCollection } while (!e.Contains(Event.ScaleDone) && !e.Contains(Event.Next)); - Mass.Val = StartMass.Val; tMass1 = StateMachine.Time; log.WarnFormat("Start mass = {0}kg", StartMass); diff --git a/TBF/UI/Process/ProcessTabPageCtrl24.cs b/TBF/UI/Process/ProcessTabPageCtrl24.cs index 1dd5c585e..c9793f062 100644 --- a/TBF/UI/Process/ProcessTabPageCtrl24.cs +++ b/TBF/UI/Process/ProcessTabPageCtrl24.cs @@ -431,7 +431,7 @@ namespace TBF.UI.Process prInLabel.Text = ProcessData.PressUp.ToString(); prOutLabel.Text = ProcessData.PressDown.ToString(); - massLabel.Text = ProcessData.Mass.ToString(); + //massLabel.Text = ProcessData.Mass.ToString(); if (args.TestPhase == Config.Entities.Progress.FlowSetting || args.TestPhase == Config.Entities.Progress.Test) @@ -452,13 +452,13 @@ namespace TBF.UI.Process double refVolume = ProcessData.LtrPerRefPulse * (double)ProcessData.RefPulses; refVolumeLabel.Text = refVolume.ToString("F2"); - double massDiff = ProcessData.Mass.Val - ProcessData.StartMass.Val; - massDiffLabel.Text = massDiff.ToString("F3"); - double volumeCtv = 1000 * Config.Formulas.Buoyancy() * massDiff / Config.Formulas.WaterDensityFromTempPress((ProcessData.TempUp.Val + ProcessData.TempDown.Val) / 2, - (ProcessData.PressUp.Val + ProcessData.PressDown.Val) / 2); - volumeCtvLabel.Text = volumeCtv.ToString("F2"); - double refError = Config.Formulas.ErrorFromVolumes(refVolume, volumeCtv); - refErrorLabel.Text = refError.ToString("F3"); + //double massDiff = ProcessData.Mass.Val - ProcessData.StartMass.Val; + //massDiffLabel.Text = massDiff.ToString("F3"); + //double volumeCtv = 1000 * Config.Formulas.Buoyancy() * massDiff / Config.Formulas.WaterDensityFromTempPress((ProcessData.TempUp.Val + ProcessData.TempDown.Val) / 2, + // (ProcessData.PressUp.Val + ProcessData.PressDown.Val) / 2); + //volumeCtvLabel.Text = volumeCtv.ToString("F2"); + //double refError = Config.Formulas.ErrorFromVolumes(refVolume, volumeCtv); + //refErrorLabel.Text = refError.ToString("F3"); if (currentMetersKind == MetersKind.Single || currentMetersKind == MetersKind.HeatMeter) { @@ -531,7 +531,7 @@ namespace TBF.UI.Process prInLabel.Text = tRes.PressUpMean.ToString("F2"); prOutLabel.Text = tRes.PressDownMean.ToString("F2"); - massLabel.Text = ProcessData.Mass.ToString(); + //massLabel.Text = ProcessData.Mass.ToString(); massDiffLabel.Text = (tRes.MassEnd - tRes.MassStart).ToString("F3"); refPulsesLabel.Text = tRes.PulsesMaster.ToString("F0"); diff --git a/TBF/UI/Process/ProcessTabPageCtrl48.cs b/TBF/UI/Process/ProcessTabPageCtrl48.cs index de3af0162..51ca4cf2a 100644 --- a/TBF/UI/Process/ProcessTabPageCtrl48.cs +++ b/TBF/UI/Process/ProcessTabPageCtrl48.cs @@ -460,7 +460,7 @@ namespace TBF.UI.Process prInLabel.Text = ProcessData.PressUp.ToString(); prOutLabel.Text = ProcessData.PressDown.ToString(); - massLabel.Text = ProcessData.Mass.ToString(); + //massLabel.Text = ProcessData.Mass.ToString(); if (args.TestPhase == Config.Entities.Progress.FlowSetting || args.TestPhase == Config.Entities.Progress.Test) @@ -481,13 +481,13 @@ namespace TBF.UI.Process double refVolume = ProcessData.LtrPerRefPulse * (double)ProcessData.RefPulses; refVolumeLabel.Text = refVolume.ToString("F2"); - double massDiff = ProcessData.Mass.Val - ProcessData.StartMass.Val; - massDiffLabel.Text = massDiff.ToString("F3"); - double volumeCtv = 1000 * Config.Formulas.Buoyancy() * massDiff / Config.Formulas.WaterDensityFromTempPress((ProcessData.TempUp.Val + ProcessData.TempDown.Val) / 2, - (ProcessData.PressUp.Val + ProcessData.PressDown.Val) / 2); - volumeCtvLabel.Text = volumeCtv.ToString("F2"); - double refError = Config.Formulas.ErrorFromVolumes(refVolume, volumeCtv); - refErrorLabel.Text = refError.ToString("F3"); + //double massDiff = ProcessData.Mass.Val - ProcessData.StartMass.Val; + //massDiffLabel.Text = massDiff.ToString("F3"); + //double volumeCtv = 1000 * Config.Formulas.Buoyancy() * massDiff / Config.Formulas.WaterDensityFromTempPress((ProcessData.TempUp.Val + ProcessData.TempDown.Val) / 2, + // (ProcessData.PressUp.Val + ProcessData.PressDown.Val) / 2); + //volumeCtvLabel.Text = volumeCtv.ToString("F2"); + //double refError = Config.Formulas.ErrorFromVolumes(refVolume, volumeCtv); + //refErrorLabel.Text = refError.ToString("F3"); if (currentMetersKind == MetersKind.Single) { @@ -560,7 +560,7 @@ namespace TBF.UI.Process prInLabel.Text = tRes.PressUpMean.ToString("F2"); prOutLabel.Text = tRes.PressDownMean.ToString("F2"); - massLabel.Text = ProcessData.Mass.ToString(); + //massLabel.Text = ProcessData.Mass.ToString(); massDiffLabel.Text = (tRes.MassEnd - tRes.MassStart).ToString("F3"); refPulsesLabel.Text = tRes.PulsesMaster.ToString("F0"); diff --git a/TBF/UI/Process/ProcessTabPageCtrl6.cs b/TBF/UI/Process/ProcessTabPageCtrl6.cs index 1f86f2d28..dc1e2449c 100644 --- a/TBF/UI/Process/ProcessTabPageCtrl6.cs +++ b/TBF/UI/Process/ProcessTabPageCtrl6.cs @@ -464,7 +464,7 @@ namespace TBF.UI.Process prUpLabel.Text = ProcessData.PressUp.ToString(); prDownLabel.Text = ProcessData.PressDown.ToString(); - massLabel.Text = ProcessData.Mass.ToString(); + //massLabel.Text = ProcessData.Mass.ToString(); if (args.TestPhase == Config.Entities.Progress.FlowSetting || args.TestPhase == Config.Entities.Progress.Test) @@ -485,13 +485,13 @@ namespace TBF.UI.Process double refVolume = ProcessData.LtrPerRefPulse * (double)ProcessData.RefPulses; refVolumeLabel.Text = refVolume.ToString("F2"); - double massDiff = ProcessData.Mass.Val - ProcessData.StartMass.Val; - massDiffLabel.Text = massDiff.ToString("F3"); - double volumeCtv = 1000 * Config.Formulas.Buoyancy() * massDiff / Config.Formulas.WaterDensityFromTempPress((ProcessData.TempUp.Val + ProcessData.TempDown.Val) / 2, - (ProcessData.PressUp.Val + ProcessData.PressDown.Val) / 2); - volumeCtvLabel.Text = volumeCtv.ToString("F2"); - double refError = Config.Formulas.ErrorFromVolumes(refVolume, volumeCtv); - refErrorLabel.Text = refError.ToString("F3"); + //double massDiff = ProcessData.Mass.Val - ProcessData.StartMass.Val; + //massDiffLabel.Text = massDiff.ToString("F3"); + //double volumeCtv = 1000 * Config.Formulas.Buoyancy() * massDiff / Config.Formulas.WaterDensityFromTempPress((ProcessData.TempUp.Val + ProcessData.TempDown.Val) / 2, + // (ProcessData.PressUp.Val + ProcessData.PressDown.Val) / 2); + //volumeCtvLabel.Text = volumeCtv.ToString("F2"); + //double refError = Config.Formulas.ErrorFromVolumes(refVolume, volumeCtv); + //refErrorLabel.Text = refError.ToString("F3"); if (currentMetersKind == MetersKind.Single) { @@ -564,7 +564,7 @@ namespace TBF.UI.Process prUpLabel.Text = tRes.PressUpMean.ToString("F2"); prDownLabel.Text = tRes.PressDownMean.ToString("F2"); - massLabel.Text = ProcessData.Mass.ToString(); + //massLabel.Text = ProcessData.Mass.ToString(); massDiffLabel.Text = (tRes.MassEnd - tRes.MassStart).ToString("F3"); refPulsesLabel.Text = tRes.PulsesMaster.ToString("F0"); diff --git a/TBF/UI/Process/ProcessTabPageExCtrl.cs b/TBF/UI/Process/ProcessTabPageExCtrl.cs index 23f838fd4..c19ffeccb 100644 --- a/TBF/UI/Process/ProcessTabPageExCtrl.cs +++ b/TBF/UI/Process/ProcessTabPageExCtrl.cs @@ -343,7 +343,7 @@ namespace TBF.UI.Process prInLabel.Text = ProcessData.PressUp.ToString(); prOutLabel.Text = ProcessData.PressDown.ToString(); - massLabel.Text = ProcessData.Mass.ToString(); + //massLabel.Text = ProcessData.Mass.ToString(); #if HEAT_METERS tHiDataLabel.Text = (ProcessData.TempRefHi1.Valid && ProcessData.TempRefHi2.Valid) ? ((ProcessData.TempRefHi1.Val + ProcessData.TempRefHi2.Val) / 2).ToString("F2") : "---"; @@ -430,7 +430,7 @@ namespace TBF.UI.Process prInLabel.Text = ProcessData.PressUp.ToString(); prOutLabel.Text = ProcessData.PressDown.ToString(); - massLabel.Text = ProcessData.Mass.ToString(); + //massLabel.Text = ProcessData.Mass.ToString(); if (args.TestPhase == Config.Entities.Progress.FlowSetting || args.TestPhase == Config.Entities.Progress.Test) @@ -451,14 +451,14 @@ namespace TBF.UI.Process double refVolume = ProcessData.LtrPerRefPulse * (double)ProcessData.RefPulses; refVolumeLabel.Text = refVolume.ToString("F2"); - double massDiff = ProcessData.Mass.Val - ProcessData.StartMass.Val; - massDiffLabel.Text = massDiff.ToString("F3"); - double volumeCtv = 1000 * Config.Formulas.Buoyancy() * massDiff - / Config.Formulas.WaterDensityFromTempPress((ProcessData.TempUp.Val + ProcessData.TempDown.Val) / 2, - (ProcessData.PressUp.Val + ProcessData.PressDown.Val) / 2); - volumeCtvLabel.Text = volumeCtv.ToString("F2"); - double refError = Config.Formulas.ErrorFromVolumes(refVolume, volumeCtv); - refErrorLabel.Text = refError.ToString("F3"); + //double massDiff = ProcessData.Mass.Val - ProcessData.StartMass.Val; + //massDiffLabel.Text = massDiff.ToString("F3"); + //double volumeCtv = 1000 * Config.Formulas.Buoyancy() * massDiff + // / Config.Formulas.WaterDensityFromTempPress((ProcessData.TempUp.Val + ProcessData.TempDown.Val) / 2, + // (ProcessData.PressUp.Val + ProcessData.PressDown.Val) / 2); + //volumeCtvLabel.Text = volumeCtv.ToString("F2"); + //double refError = Config.Formulas.ErrorFromVolumes(refVolume, volumeCtv); + //refErrorLabel.Text = refError.ToString("F3"); if (currentMetersKind == MetersKind.Single || currentMetersKind == MetersKind.HeatMeter) { @@ -533,7 +533,7 @@ namespace TBF.UI.Process prInLabel.Text = ProcessData.PressUp.ToString(); prOutLabel.Text = ProcessData.PressDown.ToString(); - massLabel.Text = ProcessData.Mass.ToString(); + //massLabel.Text = ProcessData.Mass.ToString(); massDiffLabel.Text = (tRes.MassEnd - tRes.MassStart).ToString("F3"); refPulsesLabel.Text = tRes.PulsesMaster.ToString("F0");