From 98fc15a70913f7111578474f1c9ddda76e932fb5 Mon Sep 17 00:00:00 2001 From: Milan Hanajik Date: Tue, 13 Nov 2018 17:06:43 +0100 Subject: [PATCH] bool TestParams.ManualLevelMsrmnt added to ...TankCollection methods, is used in sequnces, ver. 2.18.1062 --- .../Compound/Component.cs | 7 +- .../Compound/Factory.cs | 1 - .../Compound/TestMethodCfg.cs | 49 +++++++ .../Compound/TestMethodCfgCtrl.cs | 69 ++++++++++ .../Compound/TestMethodCfgCtrl.designer.cs | 86 ++++++++++++ .../Compound/TestMethodCfgCtrl.resx | 120 +++++++++++++++++ .../Compound/TestParams.cs | 118 +++++++++++++++++ .../FixedStartTankCollectionSeq.cs | 12 +- .../Single/Component.cs | 7 +- .../Single/Factory.cs | 1 - .../Single/TestMethodCfg.cs | 49 +++++++ .../Single/TestMethodCfgCtrl.cs | 69 ++++++++++ .../Single/TestMethodCfgCtrl.designer.cs | 86 ++++++++++++ .../Single/TestMethodCfgCtrl.resx | 120 +++++++++++++++++ .../Single/TestParams.cs | 118 +++++++++++++++++ .../Compound/Component.cs | 3 +- .../Compound/TestMethodCfg.cs | 6 +- .../Compound/TestParams.cs | 125 ++++++++++++++++++ .../FlyingStartTankCollectionSeq.cs | 16 ++- .../Single/Component.cs | 7 +- .../Single/Factory.cs | 1 - .../Single/TestMethodCfg.cs | 49 +++++++ .../Single/TestMethodCfgCtrl.cs | 69 ++++++++++ .../Single/TestMethodCfgCtrl.designer.cs | 86 ++++++++++++ .../Single/TestMethodCfgCtrl.resx | 120 +++++++++++++++++ .../TestParams.cs} | 33 +++-- .../TankWithLevelMsrmnt/TankCfgCtrl.cs | 2 +- TBF/Properties/AssemblyInfo.cs | 4 +- TBF/Resources/Strings.Designer.cs | 9 ++ TBF/Resources/Strings.cs.resx | 3 + TBF/Resources/Strings.resx | 3 + TBF/TBF.csproj | 35 ++++- 32 files changed, 1439 insertions(+), 44 deletions(-) create mode 100644 TBF/BenchControl/TestMethods/FixedStartTankCollection/Compound/TestMethodCfg.cs create mode 100644 TBF/BenchControl/TestMethods/FixedStartTankCollection/Compound/TestMethodCfgCtrl.cs create mode 100644 TBF/BenchControl/TestMethods/FixedStartTankCollection/Compound/TestMethodCfgCtrl.designer.cs create mode 100644 TBF/BenchControl/TestMethods/FixedStartTankCollection/Compound/TestMethodCfgCtrl.resx create mode 100644 TBF/BenchControl/TestMethods/FixedStartTankCollection/Compound/TestParams.cs create mode 100644 TBF/BenchControl/TestMethods/FixedStartTankCollection/Single/TestMethodCfg.cs create mode 100644 TBF/BenchControl/TestMethods/FixedStartTankCollection/Single/TestMethodCfgCtrl.cs create mode 100644 TBF/BenchControl/TestMethods/FixedStartTankCollection/Single/TestMethodCfgCtrl.designer.cs create mode 100644 TBF/BenchControl/TestMethods/FixedStartTankCollection/Single/TestMethodCfgCtrl.resx create mode 100644 TBF/BenchControl/TestMethods/FixedStartTankCollection/Single/TestParams.cs create mode 100644 TBF/BenchControl/TestMethods/FlyingStartTankCollection/Compound/TestParams.cs create mode 100644 TBF/BenchControl/TestMethods/FlyingStartTankCollection/Single/TestMethodCfg.cs create mode 100644 TBF/BenchControl/TestMethods/FlyingStartTankCollection/Single/TestMethodCfgCtrl.cs create mode 100644 TBF/BenchControl/TestMethods/FlyingStartTankCollection/Single/TestMethodCfgCtrl.designer.cs create mode 100644 TBF/BenchControl/TestMethods/FlyingStartTankCollection/Single/TestMethodCfgCtrl.resx rename TBF/BenchControl/TestMethods/FlyingStartTankCollection/{Compound/CombinedTestParams.cs => Single/TestParams.cs} (65%) diff --git a/TBF/BenchControl/TestMethods/FixedStartTankCollection/Compound/Component.cs b/TBF/BenchControl/TestMethods/FixedStartTankCollection/Compound/Component.cs index 6d1bc8d08..3491bbfc7 100644 --- a/TBF/BenchControl/TestMethods/FixedStartTankCollection/Compound/Component.cs +++ b/TBF/BenchControl/TestMethods/FixedStartTankCollection/Compound/Component.cs @@ -19,6 +19,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartTankCollection.Compound public bool CanTest(MetersKind meters) { return meters == MetersKind.Combined; } public bool DoTransitions() { return true; } + readonly TestMethodCfg testMethodCfg; + public Component() { } @@ -26,12 +28,13 @@ namespace TBF.BenchControl.TestMethods.FixedStartTankCollection.Compound public Component(Generic.IComponentCfg cfg) : base(cfg) { - log.Debug(this.ToString()); + testMethodCfg = cfg as TestMethodCfg; + log.Debug(this.ToString()); } public IList Execute(Test test, int repetNr, bool isLastRepetition) { - return (new FixedStartTankCollectionSeq()).Execute(test, repetNr, isLastRepetition, true, DebugLevel); + return (new FixedStartTankCollectionSeq()).Execute(test, repetNr, isLastRepetition, null, testMethodCfg.TestParams, DebugLevel); } } } diff --git a/TBF/BenchControl/TestMethods/FixedStartTankCollection/Compound/Factory.cs b/TBF/BenchControl/TestMethods/FixedStartTankCollection/Compound/Factory.cs index 18cc46caa..b8f2a119a 100644 --- a/TBF/BenchControl/TestMethods/FixedStartTankCollection/Compound/Factory.cs +++ b/TBF/BenchControl/TestMethods/FixedStartTankCollection/Compound/Factory.cs @@ -3,7 +3,6 @@ /// using System.Collections.Generic; using TBF.BenchControl.Generic; -using TBF.BenchControl.Configs.NameOnly; namespace TBF.BenchControl.TestMethods.FixedStartTankCollection.Compound { diff --git a/TBF/BenchControl/TestMethods/FixedStartTankCollection/Compound/TestMethodCfg.cs b/TBF/BenchControl/TestMethods/FixedStartTankCollection/Compound/TestMethodCfg.cs new file mode 100644 index 000000000..1a068e16c --- /dev/null +++ b/TBF/BenchControl/TestMethods/FixedStartTankCollection/Compound/TestMethodCfg.cs @@ -0,0 +1,49 @@ +/// +/// Copyright (c) 2018 Sensus Slovensko a.s. +/// +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml.Serialization; +using Config.Entities; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.TestMethods.FixedStartTankCollection.Compound +{ + public class TestMethodCfg : ComponentCfgBase, IComponentCfg + { + public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestMethodCfg) })[0]; + public override XmlSerializer GetSerializer() { return Serializer; } + + public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); } + + /// Test parameters + [XmlIgnore] + public TestParams TestParams; + public override IParamsProvider GetRuntimeTestParamsProvider() { return TestParams; } + public override IParamsProvider CreateTestParamsProvider() { return new TestParams(true); } + public override IParamsProvider GetUITestParamsProvider(Test test) + { + return (test.Method == Name) ? base.GetUITestParamsProvider(test) : null; + } + + /// Private parameterless constructor invoked by all other (public) constructors + TestMethodCfg() + { + TestParams = new TestParams(true); + } + + public TestMethodCfg(string name, IComponentFactory factory) + : this() + { + Name = name; + Factory = factory; + ParentName = string.Empty; + } + + public string ToString(int i) + { + return string.Format("Name={0}", Name); + } + } +} diff --git a/TBF/BenchControl/TestMethods/FixedStartTankCollection/Compound/TestMethodCfgCtrl.cs b/TBF/BenchControl/TestMethods/FixedStartTankCollection/Compound/TestMethodCfgCtrl.cs new file mode 100644 index 000000000..7323f267a --- /dev/null +++ b/TBF/BenchControl/TestMethods/FixedStartTankCollection/Compound/TestMethodCfgCtrl.cs @@ -0,0 +1,69 @@ +/// +/// Copyright (c) 2018 Sensus Slovensko a.s. +/// +using System; +using System.Windows.Forms; +using Config.Entities; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.TestMethods.FixedStartTankCollection.Compound +{ + public partial class TestMethodCfgCtrl : UserControl, IComponentCfgCtrl + { + public bool ShowMore { get { return false; } } + + TestMethodCfg config; + public IComponentCfg Config + { + get { return config as IComponentCfg; } + set + { + config = value as TestMethodCfg; + Redraw(); + } + } + + public TestMethodCfgCtrl() + { + InitializeComponent(); + } + + private void EntryFormCfgCtrl_Load(object sender, EventArgs e) + { + Redraw(); + } + + public void Closing() + { + } + + void Redraw() + { + if (config == null) return; /// Control was not loaded, settings were not changed + classNameLabel.Text = config.Factory.ClassName; + nameTextBox.Text = config.Name; + } + + public void Unlock() + { + nameTextBox.Enabled = true; + } + + public CfgUpdateFlags VerifyCfg(ref string message) + { + CfgUpdateFlags flags = CfgUpdateFlags.None; + return flags; + } + + public CfgUpdateFlags UpdateCfg() + { + CfgUpdateFlags flags = CfgUpdateFlags.RestartRqrd; + + if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed + + config.Name = nameTextBox.Text; + + return flags; + } + } +} diff --git a/TBF/BenchControl/TestMethods/FixedStartTankCollection/Compound/TestMethodCfgCtrl.designer.cs b/TBF/BenchControl/TestMethods/FixedStartTankCollection/Compound/TestMethodCfgCtrl.designer.cs new file mode 100644 index 000000000..60ea1a8fb --- /dev/null +++ b/TBF/BenchControl/TestMethods/FixedStartTankCollection/Compound/TestMethodCfgCtrl.designer.cs @@ -0,0 +1,86 @@ +/// +/// Copyright (c) 2018 Sensus Slovensko a.s. +/// +namespace TBF.BenchControl.TestMethods.FixedStartTankCollection.Compound +{ + partial class TestMethodCfgCtrl + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.nameTextBox = new System.Windows.Forms.TextBox(); + this.nameLabel = new System.Windows.Forms.Label(); + this.classNameLabel = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // nameTextBox + // + this.nameTextBox.Enabled = false; + this.nameTextBox.Location = new System.Drawing.Point(137, 57); + this.nameTextBox.Name = "nameTextBox"; + this.nameTextBox.Size = new System.Drawing.Size(130, 20); + this.nameTextBox.TabIndex = 5; + // + // nameLabel + // + this.nameLabel.AutoSize = true; + this.nameLabel.Location = new System.Drawing.Point(27, 60); + this.nameLabel.Name = "nameLabel"; + this.nameLabel.Size = new System.Drawing.Size(35, 13); + this.nameLabel.TabIndex = 4; + this.nameLabel.Text = "Name"; + // + // classNameLabel + // + this.classNameLabel.AutoSize = true; + this.classNameLabel.Location = new System.Drawing.Point(134, 33); + this.classNameLabel.Name = "classNameLabel"; + this.classNameLabel.Size = new System.Drawing.Size(83, 13); + this.classNameLabel.TabIndex = 3; + this.classNameLabel.Text = "ComonentName"; + // + // BasicPrinterCfgCtrl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.nameTextBox); + this.Controls.Add(this.nameLabel); + this.Controls.Add(this.classNameLabel); + this.Name = "BasicPrinterCfgCtrl"; + this.Size = new System.Drawing.Size(300, 200); + this.Load += new System.EventHandler(this.EntryFormCfgCtrl_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox nameTextBox; + private System.Windows.Forms.Label nameLabel; + private System.Windows.Forms.Label classNameLabel; + } +} diff --git a/TBF/BenchControl/TestMethods/FixedStartTankCollection/Compound/TestMethodCfgCtrl.resx b/TBF/BenchControl/TestMethods/FixedStartTankCollection/Compound/TestMethodCfgCtrl.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TBF/BenchControl/TestMethods/FixedStartTankCollection/Compound/TestMethodCfgCtrl.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/TBF/BenchControl/TestMethods/FixedStartTankCollection/Compound/TestParams.cs b/TBF/BenchControl/TestMethods/FixedStartTankCollection/Compound/TestParams.cs new file mode 100644 index 000000000..839f2b64f --- /dev/null +++ b/TBF/BenchControl/TestMethods/FixedStartTankCollection/Compound/TestParams.cs @@ -0,0 +1,118 @@ +/// +/// Copyright (c) 2018 Sensus Slovensko a.s. +/// +using System; +using System.IO; +using System.Text; +using System.Xml.Serialization; +using Config.Entities; +using TBF.BenchControl.Generic; +using TBF.Resources; + +namespace TBF.BenchControl.TestMethods.FixedStartTankCollection.Compound +{ + public class TestParams : TestParamsBase, IParamsProvider, ITestParams + { + public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestParams) })[0]; + public override XmlSerializer GetSerializer() { return Serializer; } + + public bool ManualLevelMsrmnt; /// true = manual level measurement/entry + + public override void InitializeAll() + { + ManualLevelMsrmnt = false; + } + + string[] paramNames = new string[] + { + Strings.Manual_level_measurement, + }; + public override string ParamName(int i) { return paramNames[i]; } + public override int ParamsCount() { return paramNames.Length; } + + public override string ToString(int i) + { + switch (i) + { + case 0: return (ManualLevelMsrmnt ? Strings.yes : Strings.no); + default: return string.Empty; + } + } + + public CfgUpdateFlags UpdateParam(int i, string strValue) + { + switch (i) + { + case 0: ManualLevelMsrmnt = strValue.Equals(Strings.yes); return CfgUpdateFlags.None; + default: return CfgUpdateFlags.None; + } + } + + public bool ValidateParam(int i, string strValue, out string message) + { + message = string.Empty; + + switch (i) + { + case 0: + if (strValue.Equals(Strings.yes) || strValue.Equals(Strings.no)) return true; + break; + default: + message = "Invalid index"; + return false; + } + + message = ParamName(i) + " is invalid"; + return false; + } + + void CopyContentTo(TestParams prms) + { + prms.ManualLevelMsrmnt = this.ManualLevelMsrmnt; + } + + public IParamsProvider Clone() + { + TestParams pars = new TestParams(); + CopyContentTo(pars); + return pars; + } + + public override void UpdateFromDbEntity(ComponentTest dbEntity) + { + if (dbEntity == null) return; + try + { + TestParams tmp = Serializer.Deserialize(new StringReader(dbEntity.Parameters)) as TestParams; + + testParamsEntity = dbEntity; + componentName = dbEntity.CmpntName; + test = dbEntity.Test; + + if (tmp != null) tmp.CopyContentTo(this); + } + catch + { + } + } + + /// + /// Parameterless constructor initializes the parameters + /// + public TestParams() + { + } + + public TestParams(bool initialize) + { + if (initialize) InitializeAll(); + } + + public TestParams(ComponentTest testParamsEntity, string componentName, Test test) + { + this.testParamsEntity = testParamsEntity; + this.componentName = componentName; + this.test = test; + } + } +} diff --git a/TBF/BenchControl/TestMethods/FixedStartTankCollection/FixedStartTankCollectionSeq.cs b/TBF/BenchControl/TestMethods/FixedStartTankCollection/FixedStartTankCollectionSeq.cs index 9edd5a0b7..6936905ba 100644 --- a/TBF/BenchControl/TestMethods/FixedStartTankCollection/FixedStartTankCollectionSeq.cs +++ b/TBF/BenchControl/TestMethods/FixedStartTankCollection/FixedStartTankCollectionSeq.cs @@ -28,7 +28,9 @@ namespace TBF.BenchControl.TestMethods.FixedStartTankCollection /// Event.Error . . . . . . Unspecified error /// public IList Execute(Config.Entities.Test test, int repetitionNr, bool isLastRepetition, - bool compound, Config.Entities.DebugMode debugLevel) + Single.TestParams singleTestParams, + Compound.TestParams compoundTestParams, + Config.Entities.DebugMode debugLevel) { IList e = new List(); /// Events from currently running operations @@ -40,6 +42,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartTankCollection } IVolumeMeter tank = outPath.Scale as IVolumeMeter; + bool manualLevelMsrmnt = (singleTestParams != null) ? singleTestParams.ManualLevelMsrmnt : compoundTestParams.ManualLevelMsrmnt; + int rangeIx = 0; /// Default range, used for non-Elde flowmeters if (outPath.FlowMeter is Elde.FlowMeter.FlowMeter) { @@ -481,7 +485,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartTankCollection UpdateAllStatistics(StateMachine.Time); - if (compound) + if (compoundTestParams != null) { /// TODO: Reimplement for combined meters //for (int i = 0; i < Config.Data.CompoundWMsCount; i++) @@ -565,7 +569,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartTankCollection .AddOperation(benchPath.PressMtrDelta == null ? null : benchPath.PressMtrDelta.ReadPressureOp(ref PressDelta)) .AddOperation((StateMachine.Ambient != null) ? StateMachine.Ambient.ReadAmbientOp(AmbTemp, AmbPress, AmbHumi) : null) - .AddOperation(tank.ReadStableVolumeOp(ref volumeBox, test.MassSpread)) + .AddOperation(manualLevelMsrmnt ? tank.ManualReadVolumeOp(ref volumeBox) : tank.ReadStableVolumeOp(ref volumeBox, test.MassSpread)) .AddOperation(processDataLoggingOp) .EnterState(); do @@ -737,7 +741,7 @@ namespace TBF.BenchControl.TestMethods.FixedStartTankCollection tstRslt.ErrorFlagsMd = (ErrorFlagsComp != null) ? (sbyte)ErrorFlagsComp.Mode : (sbyte)0; tstRslt.ErrorFlags = (ErrorFlagsComp != null) ? ErrorFlagsComp.GetErrorFlags(tstRslt, false, true, switchTimeStart, switchTimeEnd) : 0; - if (compound) + if (compoundTestParams != null) { /// /// Compound meters diff --git a/TBF/BenchControl/TestMethods/FixedStartTankCollection/Single/Component.cs b/TBF/BenchControl/TestMethods/FixedStartTankCollection/Single/Component.cs index a7268081e..42a595afd 100644 --- a/TBF/BenchControl/TestMethods/FixedStartTankCollection/Single/Component.cs +++ b/TBF/BenchControl/TestMethods/FixedStartTankCollection/Single/Component.cs @@ -19,6 +19,8 @@ namespace TBF.BenchControl.TestMethods.FixedStartTankCollection.Single public bool CanTest(MetersKind meters) { return meters == MetersKind.Single; } public bool DoTransitions() { return true; } + readonly TestMethodCfg testMethodCfg; + public Component() { } @@ -26,12 +28,13 @@ namespace TBF.BenchControl.TestMethods.FixedStartTankCollection.Single public Component(Generic.IComponentCfg cfg) : base(cfg) { - log.Debug(this.ToString()); + testMethodCfg = cfg as TestMethodCfg; + log.Debug(this.ToString()); } public IList Execute(Test test, int repetNr, bool isLastRepetition) { - return (new FixedStartTankCollectionSeq()).Execute(test, repetNr, isLastRepetition, false, DebugLevel); + return (new FixedStartTankCollectionSeq()).Execute(test, repetNr, isLastRepetition, testMethodCfg.TestParams, null, DebugLevel); } } } diff --git a/TBF/BenchControl/TestMethods/FixedStartTankCollection/Single/Factory.cs b/TBF/BenchControl/TestMethods/FixedStartTankCollection/Single/Factory.cs index 94f64c441..8ba6d7646 100644 --- a/TBF/BenchControl/TestMethods/FixedStartTankCollection/Single/Factory.cs +++ b/TBF/BenchControl/TestMethods/FixedStartTankCollection/Single/Factory.cs @@ -3,7 +3,6 @@ /// using System.Collections.Generic; using TBF.BenchControl.Generic; -using TBF.BenchControl.Configs.NameOnly; namespace TBF.BenchControl.TestMethods.FixedStartTankCollection.Single { diff --git a/TBF/BenchControl/TestMethods/FixedStartTankCollection/Single/TestMethodCfg.cs b/TBF/BenchControl/TestMethods/FixedStartTankCollection/Single/TestMethodCfg.cs new file mode 100644 index 000000000..b604d7366 --- /dev/null +++ b/TBF/BenchControl/TestMethods/FixedStartTankCollection/Single/TestMethodCfg.cs @@ -0,0 +1,49 @@ +/// +/// Copyright (c) 2018 Sensus Slovensko a.s. +/// +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml.Serialization; +using Config.Entities; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.TestMethods.FixedStartTankCollection.Single +{ + public class TestMethodCfg : ComponentCfgBase, IComponentCfg + { + public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestMethodCfg) })[0]; + public override XmlSerializer GetSerializer() { return Serializer; } + + public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); } + + /// Test parameters + [XmlIgnore] + public TestParams TestParams; + public override IParamsProvider GetRuntimeTestParamsProvider() { return TestParams; } + public override IParamsProvider CreateTestParamsProvider() { return new TestParams(true); } + public override IParamsProvider GetUITestParamsProvider(Test test) + { + return (test.Method == Name) ? base.GetUITestParamsProvider(test) : null; + } + + /// Private parameterless constructor invoked by all other (public) constructors + TestMethodCfg() + { + TestParams = new TestParams(true); + } + + public TestMethodCfg(string name, IComponentFactory factory) + : this() + { + Name = name; + Factory = factory; + ParentName = string.Empty; + } + + public string ToString(int i) + { + return string.Format("Name={0}", Name); + } + } +} diff --git a/TBF/BenchControl/TestMethods/FixedStartTankCollection/Single/TestMethodCfgCtrl.cs b/TBF/BenchControl/TestMethods/FixedStartTankCollection/Single/TestMethodCfgCtrl.cs new file mode 100644 index 000000000..1b6c1e7d6 --- /dev/null +++ b/TBF/BenchControl/TestMethods/FixedStartTankCollection/Single/TestMethodCfgCtrl.cs @@ -0,0 +1,69 @@ +/// +/// Copyright (c) 2018 Sensus Slovensko a.s. +/// +using System; +using System.Windows.Forms; +using Config.Entities; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.TestMethods.FixedStartTankCollection.Single +{ + public partial class TestMethodCfgCtrl : UserControl, IComponentCfgCtrl + { + public bool ShowMore { get { return false; } } + + TestMethodCfg config; + public IComponentCfg Config + { + get { return config as IComponentCfg; } + set + { + config = value as TestMethodCfg; + Redraw(); + } + } + + public TestMethodCfgCtrl() + { + InitializeComponent(); + } + + private void EntryFormCfgCtrl_Load(object sender, EventArgs e) + { + Redraw(); + } + + public void Closing() + { + } + + void Redraw() + { + if (config == null) return; /// Control was not loaded, settings were not changed + classNameLabel.Text = config.Factory.ClassName; + nameTextBox.Text = config.Name; + } + + public void Unlock() + { + nameTextBox.Enabled = true; + } + + public CfgUpdateFlags VerifyCfg(ref string message) + { + CfgUpdateFlags flags = CfgUpdateFlags.None; + return flags; + } + + public CfgUpdateFlags UpdateCfg() + { + CfgUpdateFlags flags = CfgUpdateFlags.RestartRqrd; + + if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed + + config.Name = nameTextBox.Text; + + return flags; + } + } +} diff --git a/TBF/BenchControl/TestMethods/FixedStartTankCollection/Single/TestMethodCfgCtrl.designer.cs b/TBF/BenchControl/TestMethods/FixedStartTankCollection/Single/TestMethodCfgCtrl.designer.cs new file mode 100644 index 000000000..6e807ebcc --- /dev/null +++ b/TBF/BenchControl/TestMethods/FixedStartTankCollection/Single/TestMethodCfgCtrl.designer.cs @@ -0,0 +1,86 @@ +/// +/// Copyright (c) 2018 Sensus Slovensko a.s. +/// +namespace TBF.BenchControl.TestMethods.FixedStartTankCollection.Single +{ + partial class TestMethodCfgCtrl + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.nameTextBox = new System.Windows.Forms.TextBox(); + this.nameLabel = new System.Windows.Forms.Label(); + this.classNameLabel = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // nameTextBox + // + this.nameTextBox.Enabled = false; + this.nameTextBox.Location = new System.Drawing.Point(137, 57); + this.nameTextBox.Name = "nameTextBox"; + this.nameTextBox.Size = new System.Drawing.Size(130, 20); + this.nameTextBox.TabIndex = 5; + // + // nameLabel + // + this.nameLabel.AutoSize = true; + this.nameLabel.Location = new System.Drawing.Point(27, 60); + this.nameLabel.Name = "nameLabel"; + this.nameLabel.Size = new System.Drawing.Size(35, 13); + this.nameLabel.TabIndex = 4; + this.nameLabel.Text = "Name"; + // + // classNameLabel + // + this.classNameLabel.AutoSize = true; + this.classNameLabel.Location = new System.Drawing.Point(134, 33); + this.classNameLabel.Name = "classNameLabel"; + this.classNameLabel.Size = new System.Drawing.Size(83, 13); + this.classNameLabel.TabIndex = 3; + this.classNameLabel.Text = "ComonentName"; + // + // BasicPrinterCfgCtrl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.nameTextBox); + this.Controls.Add(this.nameLabel); + this.Controls.Add(this.classNameLabel); + this.Name = "BasicPrinterCfgCtrl"; + this.Size = new System.Drawing.Size(300, 200); + this.Load += new System.EventHandler(this.EntryFormCfgCtrl_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox nameTextBox; + private System.Windows.Forms.Label nameLabel; + private System.Windows.Forms.Label classNameLabel; + } +} diff --git a/TBF/BenchControl/TestMethods/FixedStartTankCollection/Single/TestMethodCfgCtrl.resx b/TBF/BenchControl/TestMethods/FixedStartTankCollection/Single/TestMethodCfgCtrl.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TBF/BenchControl/TestMethods/FixedStartTankCollection/Single/TestMethodCfgCtrl.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/TBF/BenchControl/TestMethods/FixedStartTankCollection/Single/TestParams.cs b/TBF/BenchControl/TestMethods/FixedStartTankCollection/Single/TestParams.cs new file mode 100644 index 000000000..1993af890 --- /dev/null +++ b/TBF/BenchControl/TestMethods/FixedStartTankCollection/Single/TestParams.cs @@ -0,0 +1,118 @@ +/// +/// Copyright (c) 2018 Sensus Slovensko a.s. +/// +using System; +using System.IO; +using System.Text; +using System.Xml.Serialization; +using Config.Entities; +using TBF.BenchControl.Generic; +using TBF.Resources; + +namespace TBF.BenchControl.TestMethods.FixedStartTankCollection.Single +{ + public class TestParams : TestParamsBase, IParamsProvider, ITestParams + { + public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestParams) })[0]; + public override XmlSerializer GetSerializer() { return Serializer; } + + public bool ManualLevelMsrmnt; /// true = manual level measurement/entry + + public override void InitializeAll() + { + ManualLevelMsrmnt = false; + } + + string[] paramNames = new string[] + { + Strings.Manual_level_measurement, + }; + public override string ParamName(int i) { return paramNames[i]; } + public override int ParamsCount() { return paramNames.Length; } + + public override string ToString(int i) + { + switch (i) + { + case 0: return (ManualLevelMsrmnt ? Strings.yes : Strings.no); + default: return string.Empty; + } + } + + public CfgUpdateFlags UpdateParam(int i, string strValue) + { + switch (i) + { + case 0: ManualLevelMsrmnt = strValue.Equals(Strings.yes); return CfgUpdateFlags.None; + default: return CfgUpdateFlags.None; + } + } + + public bool ValidateParam(int i, string strValue, out string message) + { + message = string.Empty; + + switch (i) + { + case 0: + if (strValue.Equals(Strings.yes) || strValue.Equals(Strings.no)) return true; + break; + default: + message = "Invalid index"; + return false; + } + + message = ParamName(i) + " is invalid"; + return false; + } + + void CopyContentTo(TestParams prms) + { + prms.ManualLevelMsrmnt = this.ManualLevelMsrmnt; + } + + public IParamsProvider Clone() + { + TestParams pars = new TestParams(); + CopyContentTo(pars); + return pars; + } + + public override void UpdateFromDbEntity(ComponentTest dbEntity) + { + if (dbEntity == null) return; + try + { + TestParams tmp = Serializer.Deserialize(new StringReader(dbEntity.Parameters)) as TestParams; + + testParamsEntity = dbEntity; + componentName = dbEntity.CmpntName; + test = dbEntity.Test; + + if (tmp != null) tmp.CopyContentTo(this); + } + catch + { + } + } + + /// + /// Parameterless constructor initializes the parameters + /// + public TestParams() + { + } + + public TestParams(bool initialize) + { + if (initialize) InitializeAll(); + } + + public TestParams(ComponentTest testParamsEntity, string componentName, Test test) + { + this.testParamsEntity = testParamsEntity; + this.componentName = componentName; + this.test = test; + } + } +} diff --git a/TBF/BenchControl/TestMethods/FlyingStartTankCollection/Compound/Component.cs b/TBF/BenchControl/TestMethods/FlyingStartTankCollection/Compound/Component.cs index dde954f2b..bee14359e 100644 --- a/TBF/BenchControl/TestMethods/FlyingStartTankCollection/Compound/Component.cs +++ b/TBF/BenchControl/TestMethods/FlyingStartTankCollection/Compound/Component.cs @@ -5,7 +5,6 @@ using System; using System.Collections.Generic; using log4net; using Config.Entities; -using TBF.BenchControl.TestMethods.FlyingStartMassCollection; namespace TBF.BenchControl.TestMethods.FlyingStartTankCollection.Compound { @@ -35,7 +34,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartTankCollection.Compound public IList Execute(Test test, int repetNr, bool isLastRepetition) { - return (new FlyingStartTankCollectionSeq()).Execute(test, repetNr, isLastRepetition, testMethodCfg.TestParams, DebugLevel); + return (new FlyingStartTankCollectionSeq()).Execute(test, repetNr, isLastRepetition, null, testMethodCfg.TestParams, DebugLevel); } } } diff --git a/TBF/BenchControl/TestMethods/FlyingStartTankCollection/Compound/TestMethodCfg.cs b/TBF/BenchControl/TestMethods/FlyingStartTankCollection/Compound/TestMethodCfg.cs index 2b06a28f2..3c1b6a5cc 100644 --- a/TBF/BenchControl/TestMethods/FlyingStartTankCollection/Compound/TestMethodCfg.cs +++ b/TBF/BenchControl/TestMethods/FlyingStartTankCollection/Compound/TestMethodCfg.cs @@ -19,9 +19,9 @@ namespace TBF.BenchControl.TestMethods.FlyingStartTankCollection.Compound /// Test parameters [XmlIgnore] - public CombinedTestParams TestParams; + public TestParams TestParams; public override IParamsProvider GetRuntimeTestParamsProvider() { return TestParams; } - public override IParamsProvider CreateTestParamsProvider() { return new CombinedTestParams(true); } + public override IParamsProvider CreateTestParamsProvider() { return new TestParams(true); } public override IParamsProvider GetUITestParamsProvider(Test test) { return (test.Method == Name) ? base.GetUITestParamsProvider(test) : null; @@ -30,7 +30,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartTankCollection.Compound /// Private parameterless constructor invoked by all other (public) constructors TestMethodCfg() { - TestParams = new CombinedTestParams(true); + TestParams = new TestParams(true); } public TestMethodCfg(string name, IComponentFactory factory) diff --git a/TBF/BenchControl/TestMethods/FlyingStartTankCollection/Compound/TestParams.cs b/TBF/BenchControl/TestMethods/FlyingStartTankCollection/Compound/TestParams.cs new file mode 100644 index 000000000..149cafda1 --- /dev/null +++ b/TBF/BenchControl/TestMethods/FlyingStartTankCollection/Compound/TestParams.cs @@ -0,0 +1,125 @@ +/// +/// Copyright (c) 2018 Sensus Slovensko a.s. +/// +using System; +using System.IO; +using System.Text; +using System.Xml.Serialization; +using Config.Entities; +using TBF.BenchControl.Generic; +using TBF.Resources; + +namespace TBF.BenchControl.TestMethods.FlyingStartTankCollection.Compound +{ + public class TestParams : TestParamsBase, IParamsProvider, ITestParams + { + public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestParams) })[0]; + public override XmlSerializer GetSerializer() { return Serializer; } + + public bool ManualLevelMsrmnt; /// true = manual level measurement/entry + public bool SupressTrills; /// Main meter readings are ignored during test (suitable for small flows) + + public override void InitializeAll() + { + ManualLevelMsrmnt = false; + SupressTrills = false; + } + + string[] paramNames = new string[] + { + Strings.Manual_level_measurement, + Strings.SupressWMTrills, + }; + public override string ParamName(int i) { return paramNames[i]; } + public override int ParamsCount() { return paramNames.Length; } + + public override string ToString(int i) + { + switch (i) + { + case 0: return (ManualLevelMsrmnt ? Strings.yes : Strings.no); + case 1: return (SupressTrills ? Strings.yes : Strings.no); + default: return string.Empty; + } + } + + public CfgUpdateFlags UpdateParam(int i, string strValue) + { + switch (i) + { + case 0: ManualLevelMsrmnt = strValue.Equals(Strings.yes); return CfgUpdateFlags.None; + case 1: SupressTrills = strValue.Equals(Strings.yes); return CfgUpdateFlags.None; + default: return CfgUpdateFlags.None; + } + } + + public bool ValidateParam(int i, string strValue, out string message) + { + message = string.Empty; + + switch (i) + { + case 0: + case 1: + if (strValue.Equals(Strings.yes) || strValue.Equals(Strings.no)) return true; + break; + default: + message = "Invalid index"; + return false; + } + + message = ParamName(i) + " is invalid"; + return false; + } + + void CopyContentTo(TestParams prms) + { + prms.ManualLevelMsrmnt = this.ManualLevelMsrmnt; + prms.SupressTrills = this.SupressTrills; + } + + public IParamsProvider Clone() + { + TestParams pars = new TestParams(); + CopyContentTo(pars); + return pars; + } + + public override void UpdateFromDbEntity(ComponentTest dbEntity) + { + if (dbEntity == null) return; + try + { + TestParams tmp = Serializer.Deserialize(new StringReader(dbEntity.Parameters)) as TestParams; + + testParamsEntity = dbEntity; + componentName = dbEntity.CmpntName; + test = dbEntity.Test; + + if (tmp != null) tmp.CopyContentTo(this); + } + catch + { + } + } + + /// + /// Parameterless constructor initializes the parameters + /// + public TestParams() + { + } + + public TestParams(bool initialize) + { + if (initialize) InitializeAll(); + } + + public TestParams(ComponentTest testParamsEntity, string componentName, Test test) + { + this.testParamsEntity = testParamsEntity; + this.componentName = componentName; + this.test = test; + } + } +} diff --git a/TBF/BenchControl/TestMethods/FlyingStartTankCollection/FlyingStartTankCollectionSeq.cs b/TBF/BenchControl/TestMethods/FlyingStartTankCollection/FlyingStartTankCollectionSeq.cs index 3b6e0799e..b5922374d 100644 --- a/TBF/BenchControl/TestMethods/FlyingStartTankCollection/FlyingStartTankCollectionSeq.cs +++ b/TBF/BenchControl/TestMethods/FlyingStartTankCollection/FlyingStartTankCollectionSeq.cs @@ -26,12 +26,13 @@ namespace TBF.BenchControl.TestMethods.FlyingStartTankCollection /// Event.Error . . . . . . Unspecified error /// public IList Execute(Config.Entities.Test test, int repetitionNr, bool isLastRepetition, - Compound.CombinedTestParams compoundTestParams, + Single.TestParams singleTestParams, + Compound.TestParams compoundTestParams, Config.Entities.DebugMode debugLevel) { if (debugLevel == Config.Entities.DebugMode.Simulate) { - return Simulate(test, repetitionNr, isLastRepetition, compoundTestParams); + return Simulate(test, repetitionNr, isLastRepetition, singleTestParams, compoundTestParams); } IList e = new List(); /// Events from currently running operations @@ -44,6 +45,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartTankCollection } IVolumeMeter tank = outPath.Scale as IVolumeMeter; + bool manualLevelMsrmnt = (singleTestParams != null) ? singleTestParams.ManualLevelMsrmnt : compoundTestParams.ManualLevelMsrmnt; + int rangeIx = 0; /// Default range, used for non-Elde flowmeters if (outPath.FlowMeter is Elde.FlowMeter.FlowMeter) { @@ -450,7 +453,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartTankCollection .AddOperation(benchPath.PressMtrDelta == null ? null : benchPath.PressMtrDelta.ReadPressureOp(ref PressDelta)) .AddOperation((StateMachine.Ambient != null) ? StateMachine.Ambient.ReadAmbientOp(AmbTemp, AmbPress, AmbHumi) : null) - .AddOperation(tank.ReadStableVolumeOp(ref volumeBox, test.MassSpread)) + .AddOperation(manualLevelMsrmnt ? tank.ManualReadVolumeOp(ref volumeBox) : tank.ReadStableVolumeOp(ref volumeBox, test.MassSpread)) .AddOperation(processDataLoggingOp) .EnterState(); do @@ -770,7 +773,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartTankCollection public IList Simulate(Config.Entities.Test test, int repetitionNr, bool isLastRepetition, - Compound.CombinedTestParams compoundTestParams) + Single.TestParams singleTestParams, + Compound.TestParams compoundTestParams) { /// /// Test method simulation @@ -786,13 +790,15 @@ namespace TBF.BenchControl.TestMethods.FlyingStartTankCollection } IVolumeMeter tank = outPath.Scale as IVolumeMeter; + bool manualLevelMsrmnt = (singleTestParams != null) ? singleTestParams.ManualLevelMsrmnt : compoundTestParams.ManualLevelMsrmnt; + Bridge.OnTestProgress(this, new TestProgressEventArgs(test, repetitionNr, Config.Entities.Progress.FlowSetting)); IList e = new List(); /// Events from currently running operations Event retVal = Event.Done; DoubleBox volumeBox = new DoubleBox(); /// - IOperation msrVolOp = tank.ReadStableVolumeOp(ref volumeBox, test.MassSpread); + IOperation msrVolOp = manualLevelMsrmnt ? tank.ManualReadVolumeOp(ref volumeBox) : tank.ReadStableVolumeOp(ref volumeBox, test.MassSpread); State.Create(string.Format("{0}({1}) : Water level measurement", test.Method, test.Name)) .AddOperation(checkUiOp) .AddOperation(msrVolOp) diff --git a/TBF/BenchControl/TestMethods/FlyingStartTankCollection/Single/Component.cs b/TBF/BenchControl/TestMethods/FlyingStartTankCollection/Single/Component.cs index 15769f51a..29ebcf894 100644 --- a/TBF/BenchControl/TestMethods/FlyingStartTankCollection/Single/Component.cs +++ b/TBF/BenchControl/TestMethods/FlyingStartTankCollection/Single/Component.cs @@ -19,6 +19,8 @@ namespace TBF.BenchControl.TestMethods.FlyingStartTankCollection.Single public bool CanTest(MetersKind meters) { return meters == MetersKind.Single; } public bool DoTransitions() { return true; } + readonly TestMethodCfg testMethodCfg; + public Component() { } @@ -26,12 +28,13 @@ namespace TBF.BenchControl.TestMethods.FlyingStartTankCollection.Single public Component(Generic.IComponentCfg cfg) : base(cfg) { - log.Debug(this.ToString()); + testMethodCfg = cfg as TestMethodCfg; + log.Debug(this.ToString()); } public IList Execute(Test test, int repetNr, bool isLastRepetition) { - return (new FlyingStartTankCollectionSeq()).Execute(test, repetNr, isLastRepetition, null, DebugLevel); + return (new FlyingStartTankCollectionSeq()).Execute(test, repetNr, isLastRepetition, testMethodCfg.TestParams, null, DebugLevel); } } } diff --git a/TBF/BenchControl/TestMethods/FlyingStartTankCollection/Single/Factory.cs b/TBF/BenchControl/TestMethods/FlyingStartTankCollection/Single/Factory.cs index ca81d1ef3..4e2e61de9 100644 --- a/TBF/BenchControl/TestMethods/FlyingStartTankCollection/Single/Factory.cs +++ b/TBF/BenchControl/TestMethods/FlyingStartTankCollection/Single/Factory.cs @@ -3,7 +3,6 @@ /// using System.Collections.Generic; using TBF.BenchControl.Generic; -using TBF.BenchControl.Configs.NameOnly; namespace TBF.BenchControl.TestMethods.FlyingStartTankCollection.Single { diff --git a/TBF/BenchControl/TestMethods/FlyingStartTankCollection/Single/TestMethodCfg.cs b/TBF/BenchControl/TestMethods/FlyingStartTankCollection/Single/TestMethodCfg.cs new file mode 100644 index 000000000..1c856fb82 --- /dev/null +++ b/TBF/BenchControl/TestMethods/FlyingStartTankCollection/Single/TestMethodCfg.cs @@ -0,0 +1,49 @@ +/// +/// Copyright (c) 2018 Sensus Slovensko a.s. +/// +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml.Serialization; +using Config.Entities; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.TestMethods.FlyingStartTankCollection.Single +{ + public class TestMethodCfg : ComponentCfgBase, IComponentCfg + { + public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestMethodCfg) })[0]; + public override XmlSerializer GetSerializer() { return Serializer; } + + public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); } + + /// Test parameters + [XmlIgnore] + public TestParams TestParams; + public override IParamsProvider GetRuntimeTestParamsProvider() { return TestParams; } + public override IParamsProvider CreateTestParamsProvider() { return new TestParams(true); } + public override IParamsProvider GetUITestParamsProvider(Test test) + { + return (test.Method == Name) ? base.GetUITestParamsProvider(test) : null; + } + + /// Private parameterless constructor invoked by all other (public) constructors + TestMethodCfg() + { + TestParams = new TestParams(true); + } + + public TestMethodCfg(string name, IComponentFactory factory) + : this() + { + Name = name; + Factory = factory; + ParentName = string.Empty; + } + + public string ToString(int i) + { + return string.Format("Name={0}", Name); + } + } +} diff --git a/TBF/BenchControl/TestMethods/FlyingStartTankCollection/Single/TestMethodCfgCtrl.cs b/TBF/BenchControl/TestMethods/FlyingStartTankCollection/Single/TestMethodCfgCtrl.cs new file mode 100644 index 000000000..4d7a14eac --- /dev/null +++ b/TBF/BenchControl/TestMethods/FlyingStartTankCollection/Single/TestMethodCfgCtrl.cs @@ -0,0 +1,69 @@ +/// +/// Copyright (c) 2018 Sensus Slovensko a.s. +/// +using System; +using System.Windows.Forms; +using Config.Entities; +using TBF.BenchControl.Generic; + +namespace TBF.BenchControl.TestMethods.FlyingStartTankCollection.Single +{ + public partial class TestMethodCfgCtrl : UserControl, IComponentCfgCtrl + { + public bool ShowMore { get { return false; } } + + TestMethodCfg config; + public IComponentCfg Config + { + get { return config as IComponentCfg; } + set + { + config = value as TestMethodCfg; + Redraw(); + } + } + + public TestMethodCfgCtrl() + { + InitializeComponent(); + } + + private void EntryFormCfgCtrl_Load(object sender, EventArgs e) + { + Redraw(); + } + + public void Closing() + { + } + + void Redraw() + { + if (config == null) return; /// Control was not loaded, settings were not changed + classNameLabel.Text = config.Factory.ClassName; + nameTextBox.Text = config.Name; + } + + public void Unlock() + { + nameTextBox.Enabled = true; + } + + public CfgUpdateFlags VerifyCfg(ref string message) + { + CfgUpdateFlags flags = CfgUpdateFlags.None; + return flags; + } + + public CfgUpdateFlags UpdateCfg() + { + CfgUpdateFlags flags = CfgUpdateFlags.RestartRqrd; + + if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed + + config.Name = nameTextBox.Text; + + return flags; + } + } +} diff --git a/TBF/BenchControl/TestMethods/FlyingStartTankCollection/Single/TestMethodCfgCtrl.designer.cs b/TBF/BenchControl/TestMethods/FlyingStartTankCollection/Single/TestMethodCfgCtrl.designer.cs new file mode 100644 index 000000000..d22190331 --- /dev/null +++ b/TBF/BenchControl/TestMethods/FlyingStartTankCollection/Single/TestMethodCfgCtrl.designer.cs @@ -0,0 +1,86 @@ +/// +/// Copyright (c) 2018 Sensus Slovensko a.s. +/// +namespace TBF.BenchControl.TestMethods.FlyingStartTankCollection.Single +{ + partial class TestMethodCfgCtrl + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.nameTextBox = new System.Windows.Forms.TextBox(); + this.nameLabel = new System.Windows.Forms.Label(); + this.classNameLabel = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // nameTextBox + // + this.nameTextBox.Enabled = false; + this.nameTextBox.Location = new System.Drawing.Point(137, 57); + this.nameTextBox.Name = "nameTextBox"; + this.nameTextBox.Size = new System.Drawing.Size(130, 20); + this.nameTextBox.TabIndex = 5; + // + // nameLabel + // + this.nameLabel.AutoSize = true; + this.nameLabel.Location = new System.Drawing.Point(27, 60); + this.nameLabel.Name = "nameLabel"; + this.nameLabel.Size = new System.Drawing.Size(35, 13); + this.nameLabel.TabIndex = 4; + this.nameLabel.Text = "Name"; + // + // classNameLabel + // + this.classNameLabel.AutoSize = true; + this.classNameLabel.Location = new System.Drawing.Point(134, 33); + this.classNameLabel.Name = "classNameLabel"; + this.classNameLabel.Size = new System.Drawing.Size(83, 13); + this.classNameLabel.TabIndex = 3; + this.classNameLabel.Text = "ComonentName"; + // + // BasicPrinterCfgCtrl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.nameTextBox); + this.Controls.Add(this.nameLabel); + this.Controls.Add(this.classNameLabel); + this.Name = "BasicPrinterCfgCtrl"; + this.Size = new System.Drawing.Size(300, 200); + this.Load += new System.EventHandler(this.EntryFormCfgCtrl_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox nameTextBox; + private System.Windows.Forms.Label nameLabel; + private System.Windows.Forms.Label classNameLabel; + } +} diff --git a/TBF/BenchControl/TestMethods/FlyingStartTankCollection/Single/TestMethodCfgCtrl.resx b/TBF/BenchControl/TestMethods/FlyingStartTankCollection/Single/TestMethodCfgCtrl.resx new file mode 100644 index 000000000..1af7de150 --- /dev/null +++ b/TBF/BenchControl/TestMethods/FlyingStartTankCollection/Single/TestMethodCfgCtrl.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/TBF/BenchControl/TestMethods/FlyingStartTankCollection/Compound/CombinedTestParams.cs b/TBF/BenchControl/TestMethods/FlyingStartTankCollection/Single/TestParams.cs similarity index 65% rename from TBF/BenchControl/TestMethods/FlyingStartTankCollection/Compound/CombinedTestParams.cs rename to TBF/BenchControl/TestMethods/FlyingStartTankCollection/Single/TestParams.cs index 4dea33b31..f9d8a2fa5 100644 --- a/TBF/BenchControl/TestMethods/FlyingStartTankCollection/Compound/CombinedTestParams.cs +++ b/TBF/BenchControl/TestMethods/FlyingStartTankCollection/Single/TestParams.cs @@ -9,24 +9,23 @@ using Config.Entities; using TBF.BenchControl.Generic; using TBF.Resources; -namespace TBF.BenchControl.TestMethods.FlyingStartTankCollection.Compound +namespace TBF.BenchControl.TestMethods.FlyingStartTankCollection.Single { - public class CombinedTestParams : TestParamsBase, IParamsProvider, ITestParams + public class TestParams : TestParamsBase, IParamsProvider, ITestParams { - public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(CombinedTestParams) })[0]; + public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestParams) })[0]; public override XmlSerializer GetSerializer() { return Serializer; } - public bool SupressTrills; /// Main meter readings are ignored during test (suitable for small flows) + public bool ManualLevelMsrmnt; /// true = manual level measurement/entry public override void InitializeAll() { - SupressTrills = false; + ManualLevelMsrmnt = false; } - string[] paramNames = new string[] { - Strings.SupressWMTrills, + Strings.Manual_level_measurement, }; public override string ParamName(int i) { return paramNames[i]; } public override int ParamsCount() { return paramNames.Length; } @@ -35,7 +34,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartTankCollection.Compound { switch (i) { - case 0: return (SupressTrills ? Strings.yes : Strings.no); + case 0: return (ManualLevelMsrmnt ? Strings.yes : Strings.no); default: return string.Empty; } } @@ -44,7 +43,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartTankCollection.Compound { switch (i) { - case 0: SupressTrills = strValue.Equals(Strings.yes); return CfgUpdateFlags.None; + case 0: ManualLevelMsrmnt = strValue.Equals(Strings.yes); return CfgUpdateFlags.None; default: return CfgUpdateFlags.None; } } @@ -56,7 +55,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartTankCollection.Compound switch (i) { case 0: - if (strValue.Equals(Strings.yes) || strValue.Equals(Strings.no)) return true; + if (strValue.Equals(Strings.yes) || strValue.Equals(Strings.no)) return true; break; default: message = "Invalid index"; @@ -67,14 +66,14 @@ namespace TBF.BenchControl.TestMethods.FlyingStartTankCollection.Compound return false; } - void CopyContentTo(CombinedTestParams prms) + void CopyContentTo(TestParams prms) { - prms.SupressTrills = this.SupressTrills; + prms.ManualLevelMsrmnt = this.ManualLevelMsrmnt; } public IParamsProvider Clone() { - CombinedTestParams pars = new CombinedTestParams(); + TestParams pars = new TestParams(); CopyContentTo(pars); return pars; } @@ -84,7 +83,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartTankCollection.Compound if (dbEntity == null) return; try { - CombinedTestParams tmp = Serializer.Deserialize(new StringReader(dbEntity.Parameters)) as CombinedTestParams; + TestParams tmp = Serializer.Deserialize(new StringReader(dbEntity.Parameters)) as TestParams; testParamsEntity = dbEntity; componentName = dbEntity.CmpntName; @@ -100,16 +99,16 @@ namespace TBF.BenchControl.TestMethods.FlyingStartTankCollection.Compound /// /// Parameterless constructor initializes the parameters /// - public CombinedTestParams() + public TestParams() { } - public CombinedTestParams(bool initialize) + public TestParams(bool initialize) { if (initialize) InitializeAll(); } - public CombinedTestParams(ComponentTest testParamsEntity, string componentName, Test test) + public TestParams(ComponentTest testParamsEntity, string componentName, Test test) { this.testParamsEntity = testParamsEntity; this.componentName = componentName; diff --git a/TBF/BenchControl/Various/TankWithLevelMsrmnt/TankCfgCtrl.cs b/TBF/BenchControl/Various/TankWithLevelMsrmnt/TankCfgCtrl.cs index 4a9c65cf0..5e6892d83 100644 --- a/TBF/BenchControl/Various/TankWithLevelMsrmnt/TankCfgCtrl.cs +++ b/TBF/BenchControl/Various/TankWithLevelMsrmnt/TankCfgCtrl.cs @@ -54,7 +54,7 @@ namespace TBF.BenchControl.Various.TankWithLevelMsrmnt } //if (cmpnt is TBF.BenchControl.GenericDevices.ILevelMeter) /// TODO: Preco nefunguje? - if (cmpntFact is Various.ManualLevelMsrmnt.Factory || + if (cmpntFact is Modbus.UltrasoundLevelMeter.Factory || cmpntFact is Hart.Nivotrack.Factory) { levelMeasurementComboBox.Items.Add(cmpnt.Name); diff --git a/TBF/Properties/AssemblyInfo.cs b/TBF/Properties/AssemblyInfo.cs index c3e5b6fff..b2ddfd1ae 100644 --- a/TBF/Properties/AssemblyInfo.cs +++ b/TBF/Properties/AssemblyInfo.cs @@ -29,5 +29,5 @@ using System.Runtime.InteropServices; // Build Number // Revision // -[assembly: AssemblyVersion("2.18.1061.0")] -[assembly: AssemblyFileVersion("2.18.1061.0")] +[assembly: AssemblyVersion("2.18.1062.0")] +[assembly: AssemblyFileVersion("2.18.1062.0")] diff --git a/TBF/Resources/Strings.Designer.cs b/TBF/Resources/Strings.Designer.cs index 014d861ae..3caec56b6 100644 --- a/TBF/Resources/Strings.Designer.cs +++ b/TBF/Resources/Strings.Designer.cs @@ -2175,6 +2175,15 @@ namespace TBF.Resources { } } + /// + /// Looks up a localized string similar to Manual level measurement. + /// + internal static string Manual_level_measurement { + get { + return ResourceManager.GetString("Manual_level_measurement", resourceCulture); + } + } + /// /// Looks up a localized string similar to Mass. /// diff --git a/TBF/Resources/Strings.cs.resx b/TBF/Resources/Strings.cs.resx index 29adb043c..76e4146c2 100644 --- a/TBF/Resources/Strings.cs.resx +++ b/TBF/Resources/Strings.cs.resx @@ -1338,4 +1338,7 @@ Hladina + + Ručné zadávání výšky hladiny + \ No newline at end of file diff --git a/TBF/Resources/Strings.resx b/TBF/Resources/Strings.resx index 631d4b951..7ad02e3ea 100644 --- a/TBF/Resources/Strings.resx +++ b/TBF/Resources/Strings.resx @@ -1876,4 +1876,7 @@ Level + + Manual level measurement + \ No newline at end of file diff --git a/TBF/TBF.csproj b/TBF/TBF.csproj index 120aafd59..5b53911e4 100644 --- a/TBF/TBF.csproj +++ b/TBF/TBF.csproj @@ -1002,9 +1002,25 @@ + + + UserControl + + + TestMethodCfgCtrl.cs + + + + + UserControl + + + TestMethodCfgCtrl.cs + + @@ -1104,7 +1120,7 @@ TestMethodCfgCtrl.cs - + @@ -1117,6 +1133,14 @@ + + + UserControl + + + TestMethodCfgCtrl.cs + + @@ -2525,6 +2549,12 @@ TestMethodCfgCtrl.cs + + TestMethodCfgCtrl.cs + + + TestMethodCfgCtrl.cs + TestMethodCfgCtrl.cs @@ -2549,6 +2579,9 @@ TestMethodCfgCtrl.cs + + TestMethodCfgCtrl.cs + GrabImageCfgCtrl.cs