diff --git a/TestBenchFramework/BenchControl/DataEntry/Munich/EntryForm.cs b/TestBenchFramework/BenchControl/DataEntry/Munich/EntryForm.cs index 858f27893..4bf247163 100644 --- a/TestBenchFramework/BenchControl/DataEntry/Munich/EntryForm.cs +++ b/TestBenchFramework/BenchControl/DataEntry/Munich/EntryForm.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using TBF.BenchControl; +using TBF.BenchControl.GenericDevices; namespace TBF.BenchControl.DataEntry.Munich { @@ -136,5 +137,20 @@ namespace TBF.BenchControl.DataEntry.Munich modelessDlg = null; currentOp = CurrentOp.None; } - } + + /// + /// Updates test results with the information collected in watermeters. + /// + /// Watermetes with information entered in the forms + /// Test results to be updated with the information + public void UpdateTestResults(IList waterMeters, IList results) + { + foreach (var test in results) + { + if (test.MetersKind != Entities.MetersKind.Combined) continue; + + //TODO + } + } + } } diff --git a/TestBenchFramework/BenchControl/DataEntry/Munich3/EntryForm.cs b/TestBenchFramework/BenchControl/DataEntry/Munich3/EntryForm.cs index 773617f2f..9e43684b5 100644 --- a/TestBenchFramework/BenchControl/DataEntry/Munich3/EntryForm.cs +++ b/TestBenchFramework/BenchControl/DataEntry/Munich3/EntryForm.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using TBF.BenchControl; +using TBF.BenchControl.GenericDevices; namespace TBF.BenchControl.DataEntry.Munich3 { @@ -128,5 +129,20 @@ namespace TBF.BenchControl.DataEntry.Munich3 modelessDlg = null; currentOp = CurrentOp.None; } + + /// + /// Updates test results with the information collected in watermeters. + /// + /// Watermetes with information entered in the forms + /// Test results to be updated with the information + public void UpdateTestResults(IList waterMeters, IList results) + { + foreach (var test in results) + { + if (test.MetersKind != Entities.MetersKind.Single) continue; + + //TODO + } + } } } diff --git a/TestBenchFramework/BenchControl/GenericDevices/IDataEntry.cs b/TestBenchFramework/BenchControl/GenericDevices/IDataEntry.cs index 2f5fa0c24..57c889b39 100644 --- a/TestBenchFramework/BenchControl/GenericDevices/IDataEntry.cs +++ b/TestBenchFramework/BenchControl/GenericDevices/IDataEntry.cs @@ -5,7 +5,25 @@ namespace TBF.BenchControl.GenericDevices { public interface IDataEntry : IComponent { + /// + /// Displays form at the beginning of the cycle (usually to enter S/N). + /// + /// Watermetes to be updated by the operation + /// Operation to be used in the sequence IOperation ShowFormAtCycleBeginningOp(IList waterMeters); - IOperation ShowFormAtCycleEndOp(IList waterMeters); + + /// + /// Displays form at the end of the cycle (usually to enter S/N). + /// + /// Watermetes to be updated by the operation + /// Operation to be used in the sequence + IOperation ShowFormAtCycleEndOp(IList waterMeters); + + /// + /// Updates test results with the information collected in watermeters. + /// + /// Watermetes with information entered in the forms + /// Test results to be updated with the information + void UpdateTestResults(IList waterMeters, IList results); } } diff --git a/TestBenchFramework/BenchControl/Sequences/MainSeq.cs b/TestBenchFramework/BenchControl/Sequences/MainSeq.cs index c5a6dca7b..21ca43c8d 100644 --- a/TestBenchFramework/BenchControl/Sequences/MainSeq.cs +++ b/TestBenchFramework/BenchControl/Sequences/MainSeq.cs @@ -176,8 +176,9 @@ namespace TBF.BenchControl.Sequences } //-------------------------------- - Generic.IComponent dataEntryCmpnt = TbfComponents.FindComponent(StateMachine.Procedure.DataEntry); - if ((dataEntryCmpnt as GenericDevices.IDataEntry) != null) + GenericDevices.IDataEntry dataEntryCmpnt = + TbfComponents.FindComponent(StateMachine.Procedure.DataEntry) as GenericDevices.IDataEntry; + if (dataEntryCmpnt != null) { Bridge.OnActivity(this, "Enter the water meter data"); State.Create("MainSeq : Enter begin data") @@ -345,8 +346,8 @@ namespace TBF.BenchControl.Sequences //-------------------------------- string protocolTitle = string.Empty; - dataEntryCmpnt = TbfComponents.FindComponent(StateMachine.Procedure.DataEntry); - if ((dataEntryCmpnt as GenericDevices.IDataEntry) != null) + dataEntryCmpnt = TbfComponents.FindComponent(StateMachine.Procedure.DataEntry) as GenericDevices.IDataEntry; + if (dataEntryCmpnt != null) { Bridge.OnActivity(this, "Enter the protokoll data"); State.Create("MainSeq : Enter end data") @@ -364,6 +365,8 @@ namespace TBF.BenchControl.Sequences { protocolTitle = (dataEntryCmpnt as IHasProtocolTitle).ProtocolTitle; } + + dataEntryCmpnt.UpdateTestResults(WaterMeters, results); } //-------------------------------- diff --git a/TestBenchFramework/BenchControl/WaterMeter/ProcParams.cs b/TestBenchFramework/BenchControl/WaterMeter/ProcParams.cs index daea4f125..ba2fff3de 100644 --- a/TestBenchFramework/BenchControl/WaterMeter/ProcParams.cs +++ b/TestBenchFramework/BenchControl/WaterMeter/ProcParams.cs @@ -9,10 +9,10 @@ namespace TBF.BenchControl.WaterMeter { public class ProcParams : IParamsProvider, IProcedureParams { - public string Producer; + public string Producer; /// Hersteller public float Qn; - public string ApprovalInfo; - public string MetrologicalClass; + public string ApprovalInfo; /// Zulassungszeichen + public string MetrologicalClass; /// Metr. Klasse string[] paramNames = new string[] { diff --git a/TestBenchFramework/BenchControl/WaterMeter/WaterMeterCfg.cs b/TestBenchFramework/BenchControl/WaterMeter/WaterMeterCfg.cs index 5b0a43b9b..a9d49cdee 100644 --- a/TestBenchFramework/BenchControl/WaterMeter/WaterMeterCfg.cs +++ b/TestBenchFramework/BenchControl/WaterMeter/WaterMeterCfg.cs @@ -8,11 +8,6 @@ namespace TBF.BenchControl.WaterMeter { public class WaterMeterCfg : ComponentCfgBase, Generic.IComponentCfg { - public string Producer; /// Hersteller - public float Qn; - public string ApprovalInfo; /// Zulassungszeichen - public string MetrologicalClass; /// Metr. Klasse - /// Parameterless constructor public WaterMeterCfg() { @@ -23,20 +18,14 @@ namespace TBF.BenchControl.WaterMeter /// /// Data entry form factory /// Component name - public WaterMeterCfg(IComponentFactory factory, string name, string producer, - float qn, string approvalInfo, string metrologicalClass) + public WaterMeterCfg(IComponentFactory factory, string name) : base(factory, name) { - Producer = producer; - Qn = qn; - ApprovalInfo = approvalInfo; - MetrologicalClass = metrologicalClass; } public IComponentCfg Clone() { - return new WaterMeterCfg(Factory, Name, Producer, - Qn, ApprovalInfo, MetrologicalClass); + return new WaterMeterCfg(Factory, Name); } public string ToString(int i) diff --git a/TestBenchFramework/BenchControl/WaterMeter/WaterMeterFactory.cs b/TestBenchFramework/BenchControl/WaterMeter/WaterMeterFactory.cs index bffb95501..0c93a54b2 100644 --- a/TestBenchFramework/BenchControl/WaterMeter/WaterMeterFactory.cs +++ b/TestBenchFramework/BenchControl/WaterMeter/WaterMeterFactory.cs @@ -20,7 +20,7 @@ namespace TBF.BenchControl.WaterMeter public IComponentCfg DefaultConfig(IList components) { - return new WaterMeterCfg(this, "WaterMeter", "", 2.5f, "", "A"); + return new WaterMeterCfg(this, "WaterMeter"); } public IComponentCfgCtrl CreateCfgCtrl() diff --git a/TestBenchFramework/Entities/MeterTestResult.cs b/TestBenchFramework/Entities/MeterTestResult.cs index 4fee66c39..a142d9767 100644 --- a/TestBenchFramework/Entities/MeterTestResult.cs +++ b/TestBenchFramework/Entities/MeterTestResult.cs @@ -7,7 +7,8 @@ namespace TBF.Entities public virtual int Id { get; protected set; } public virtual TestResult TestResult { get; set; } /// reference to the TestResult entity - public virtual string SerialNr { get; set; } + public virtual string SerialNr { get; set; } + public virtual string EndState { get; set; } public virtual float VolumeStart { get; set; } /// liter public virtual float VolumeEnd { get; set; } /// liter public virtual float VolumeMeter { get; set; } /// liter @@ -33,6 +34,7 @@ namespace TBF.Entities MeterTestResult result = new MeterTestResult(testResult); result.SerialNr = SerialNr; + result.EndState = EndState; result.VolumeStart = VolumeStart; result.VolumeEnd = VolumeEnd; result.VolumeMeter = VolumeMeter; diff --git a/TestBenchFramework/Entities/TestResult.cs b/TestBenchFramework/Entities/TestResult.cs index 0a1f48f61..4b50fe409 100644 --- a/TestBenchFramework/Entities/TestResult.cs +++ b/TestBenchFramework/Entities/TestResult.cs @@ -97,13 +97,13 @@ namespace TBF.Entities if (kind == MetersKind.Single) { - for (int i = 0; i < Program.WMsCount; i++) Meters.Add(new MeterTestResult()); + for (int i = 0; i < Program.WMsCount; i++) Meters.Add(new MeterTestResult(this)); } else if (kind == MetersKind.Combined) { int combinedCount = Program.WMsCount / 2; - for (int i = 0; i < 2 * combinedCount; i++) Meters.Add(new MeterTestResult()); - for (int i = 0; i < combinedCount; i++) CombinedMeters.Add(new MeterTestResult()); + for (int i = 0; i < 2 * combinedCount; i++) Meters.Add(new MeterTestResult(this)); + for (int i = 0; i < combinedCount; i++) CombinedMeters.Add(new MeterTestResult(this)); } }