From 17c685148ef1014804e053a52f6584e795ecde2b Mon Sep 17 00:00:00 2001 From: Milan Hanajik Date: Wed, 3 May 2017 22:17:20 +0200 Subject: [PATCH] (1) Flow selection in New Test Wizard extended, (2) MainSeq and BencControlPael modified, etc. --- Config/Entities/Enums.cs | 1 - .../BenchControl/Sequences/MainSeq.cs | 27 +- .../BenchControl/StateMachine.cs | 7 +- .../FlyingStartMassCollectionSeq.cs | 2 +- .../Resources/Strings.Designer.cs | 72 + TestBenchFramework/Resources/Strings.resx | 24 + .../TestWizard/FlowSelection.Designer.cs | 335 ++-- .../TestWizard/FlowSelection.cs | 117 +- .../UiControls/BenchControlPanel.Designer.cs | 98 +- .../UiControls/BenchControlPanel.cs | 8 + .../UiControls/BenchControlPanel.de.resx | 45 +- .../UiControls/BenchControlPanel.resx | 1356 ++++++++--------- 12 files changed, 1139 insertions(+), 953 deletions(-) diff --git a/Config/Entities/Enums.cs b/Config/Entities/Enums.cs index 1df08b9f5..e3800e357 100644 --- a/Config/Entities/Enums.cs +++ b/Config/Entities/Enums.cs @@ -42,7 +42,6 @@ namespace Config.Entities { Active, History, - Template, Count, } diff --git a/TestBenchFramework/BenchControl/Sequences/MainSeq.cs b/TestBenchFramework/BenchControl/Sequences/MainSeq.cs index 88c6f548b..d1981d7d2 100644 --- a/TestBenchFramework/BenchControl/Sequences/MainSeq.cs +++ b/TestBenchFramework/BenchControl/Sequences/MainSeq.cs @@ -164,7 +164,7 @@ namespace TBF.BenchControl.Sequences !e.Contains(Event.ValvesBusy) && !e.Contains(Event.CameraBusy)) { - goto stop_emptying; + goto stop_draining; } } while (e.Contains(Event.TimerBusy) || @@ -175,9 +175,9 @@ namespace TBF.BenchControl.Sequences Bridge.OnActivity(this, Strings.Emptying_tank); - stop_emptying: + stop_draining: //-------------------------------------------------------------------------------------------- - State stopEmptying = State.Create("MainSeq : Stop emptying of water tanks") + State stopDraining = State.Create("MainSeq : Stop draining water tanks") .AddOperation(checkUiOp) .AddOperation(StateMachine.ControlBoard.SetValvesOp(null, allDrainValves)) .EnterState(); @@ -779,18 +779,8 @@ namespace TBF.BenchControl.Sequences } } - if (BatchRslts.AllTestsDone()) - { - Bridge.Bench2UI(ButtonsEtc.AcceptResultsBtnEn | ButtonsEtc.ResetResultsBtnEn); - } - else - { - Bridge.Bench2UI(ButtonsEtc.ResetResultsBtnEn); - } - goto select_cycle_or_test; - evacuation: save_results: UiBridge.Bridge.OnError(this, string.Empty); /// Clear an error message (if any) @@ -905,6 +895,10 @@ namespace TBF.BenchControl.Sequences ProcessData.BatchRslts.Batch.ProcedureName, Program.LocalSettings.BatchNr); + evacuation: + + /// Evacuation is similar to 'Abort session' (no results are saved), but the evacuation is done as well. + if (simultWithEvacuationCount > 0) { /// Open iPerlCommunicationForm @@ -1105,14 +1099,13 @@ namespace TBF.BenchControl.Sequences Bridge.Bench2UI(((context == MKSelContext.ProcedureNotSelected) ? ButtonsEtc.ProcedureCmbBoxEn : 0) | ButtonsEtc.TestCmbBoxEn | ButtonsEtc.StopBtnEn | + ((context == MKSelContext.InsideProcedure) ? ButtonsEtc.Break : 0) | + ((context == MKSelContext.InsideProcedure && BatchRslts.AllTestsDone()) ? ButtonsEtc.AcceptResultsBtnEn : 0) | ((draining1 || draining2 || draining3) ? 0 : (ButtonsEtc.StartCycleBtnEn | ButtonsEtc.StartTestBtnsEn | ButtonsEtc.PurgeBeginBtnEn | - ((context == MKSelContext.InsideProcedure) ? ButtonsEtc.PurgeEndBtnEn : 0) | - ButtonsEtc.SensitivityTestBtnEn | - ((Cameras.Count > 0) ? ButtonsEtc.CalibrationBtnEn : 0) | - ButtonsEtc.Break)) | + ((context == MKSelContext.InsideProcedure) ? ButtonsEtc.PurgeEndBtnEn : 0))) | (((StateMachine.Scale1 != null) && (StateMachine.DrainValve1 != null) && !draining1) ? ButtonsEtc.DrainTankBtn1En : 0) | (((StateMachine.Scale2 != null) && (StateMachine.DrainValve2 != null) && !draining2) ? ButtonsEtc.DrainTankBtn2En : 0) | (((StateMachine.Scale3 != null) && (StateMachine.DrainValve3 != null) && !draining3) ? ButtonsEtc.DrainTankBtn3En : 0)); diff --git a/TestBenchFramework/BenchControl/StateMachine.cs b/TestBenchFramework/BenchControl/StateMachine.cs index 8908a8a6e..ace1b2d0f 100644 --- a/TestBenchFramework/BenchControl/StateMachine.cs +++ b/TestBenchFramework/BenchControl/StateMachine.cs @@ -14,6 +14,7 @@ using TBF.BenchControl.Generic; using TBF.BenchControl.GenericDevices; using TBF.BenchControl.Sequences; using Dirichlet.Numerics; +using TBF.Resources; namespace TBF.BenchControl { @@ -481,9 +482,13 @@ namespace TBF.BenchControl pmtrs = GetMetersPath(test); + if (pfeed == null) errorMsg = Strings.Cannot_load_feeding_path; + else if (pben == null) errorMsg = Strings.Cannot_load_bench_path; + else if (pout == null) errorMsg = Strings.Cannot_load_output_path; + else if (pmtrs == null) errorMsg = Strings.Cannot_load_sensor_path; + else errorMsg = string.Empty; if ((pfeed == null) || (pben == null) || (pout == null) || (pmtrs == null)) { - errorMsg = "Cannot load paths"; return false; } diff --git a/TestBenchFramework/BenchControl/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs b/TestBenchFramework/BenchControl/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs index 53e8be32a..87f81a05f 100644 --- a/TestBenchFramework/BenchControl/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs +++ b/TestBenchFramework/BenchControl/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs @@ -105,7 +105,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection int repetitionNr = outerLoopMode ? outerLoopCounter : 1; /// First test: repetitionNr = 1 - if (test.Volume >= outPath.Scale.Capacity * Constants.TankFullFactor) + if (test.Volume > outPath.Scale.Capacity * Constants.TankFullFactor) { Bridge.OnError(this, Strings.Test_volume_exceeds_the_scale_capacity); retVal = Event.UiCmdStop; diff --git a/TestBenchFramework/Resources/Strings.Designer.cs b/TestBenchFramework/Resources/Strings.Designer.cs index 5f33dfc3b..607c5e2f5 100644 --- a/TestBenchFramework/Resources/Strings.Designer.cs +++ b/TestBenchFramework/Resources/Strings.Designer.cs @@ -159,6 +159,15 @@ namespace TBF.Resources { } } + /// + /// Looks up a localized string similar to All tests must be completed. + /// + internal static string All_tests_must_be_completed { + get { + return ResourceManager.GetString("All_tests_must_be_completed", resourceCulture); + } + } + /// /// Looks up a localized string similar to Air humidity [%]:. /// @@ -501,6 +510,42 @@ namespace TBF.Resources { } } + /// + /// Looks up a localized string similar to Cannot load bench path. + /// + internal static string Cannot_load_bench_path { + get { + return ResourceManager.GetString("Cannot_load_bench_path", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot load feeding path. + /// + internal static string Cannot_load_feeding_path { + get { + return ResourceManager.GetString("Cannot_load_feeding_path", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot load output path. + /// + internal static string Cannot_load_output_path { + get { + return ResourceManager.GetString("Cannot_load_output_path", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot load sensor path. + /// + internal static string Cannot_load_sensor_path { + get { + return ResourceManager.GetString("Cannot_load_sensor_path", resourceCulture); + } + } + /// /// Looks up a localized string similar to Cannot save changes. /// @@ -1077,6 +1122,15 @@ namespace TBF.Resources { } } + /// + /// Looks up a localized string similar to Drain. + /// + internal static string Drain { + get { + return ResourceManager.GetString("Drain", resourceCulture); + } + } + /// /// Looks up a localized string similar to Leak duration [s]. /// @@ -2850,6 +2904,15 @@ namespace TBF.Resources { } } + /// + /// Looks up a localized string similar to Protected procedure. + /// + internal static string Protected_procedure { + get { + return ResourceManager.GetString("Protected_procedure", resourceCulture); + } + } + /// /// Looks up a localized string similar to Protocol. /// @@ -3561,6 +3624,15 @@ namespace TBF.Resources { } } + /// + /// Looks up a localized string similar to Session. + /// + internal static string Session { + get { + return ResourceManager.GetString("Session", resourceCulture); + } + } + /// /// Looks up a localized string similar to Set cold water cooling temperature. /// diff --git a/TestBenchFramework/Resources/Strings.resx b/TestBenchFramework/Resources/Strings.resx index 678cbe6d8..0e30dee3d 100644 --- a/TestBenchFramework/Resources/Strings.resx +++ b/TestBenchFramework/Resources/Strings.resx @@ -1717,4 +1717,28 @@ Restore + + Cannot load bench path + + + Cannot load feeding path + + + Cannot load output path + + + Cannot load sensor path + + + All tests must be completed + + + Protected procedure + + + Drain + + + Session + \ No newline at end of file diff --git a/TestBenchFramework/TestWizard/FlowSelection.Designer.cs b/TestBenchFramework/TestWizard/FlowSelection.Designer.cs index 3b0c087eb..670cf8335 100644 --- a/TestBenchFramework/TestWizard/FlowSelection.Designer.cs +++ b/TestBenchFramework/TestWizard/FlowSelection.Designer.cs @@ -31,151 +31,193 @@ namespace TBF.TestWizard /// private void InitializeComponent() { - this.horizSplitContainer = new System.Windows.Forms.SplitContainer(); - this.sensorsComboBox = new System.Windows.Forms.ComboBox(); - this.sensorsLabel = new System.Windows.Forms.Label(); - this.qToTextBox = new System.Windows.Forms.TextBox(); - this.qFromTextBox = new System.Windows.Forms.TextBox(); - this.qToLabel = new System.Windows.Forms.Label(); - this.qFromLabel = new System.Windows.Forms.Label(); - this.cancelButton = new System.Windows.Forms.Button(); - this.nextButton = new System.Windows.Forms.Button(); - this.backButton = new System.Windows.Forms.Button(); - ((System.ComponentModel.ISupportInitialize)(this.horizSplitContainer)).BeginInit(); - this.horizSplitContainer.Panel1.SuspendLayout(); - this.horizSplitContainer.Panel2.SuspendLayout(); - this.horizSplitContainer.SuspendLayout(); - this.SuspendLayout(); - // - // horizSplitContainer - // - this.horizSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill; - this.horizSplitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; - this.horizSplitContainer.Location = new System.Drawing.Point(0, 0); - this.horizSplitContainer.Name = "horizSplitContainer"; - this.horizSplitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal; - // - // horizSplitContainer.Panel1 - // - this.horizSplitContainer.Panel1.Controls.Add(this.sensorsComboBox); - this.horizSplitContainer.Panel1.Controls.Add(this.sensorsLabel); - this.horizSplitContainer.Panel1.Controls.Add(this.qToTextBox); - this.horizSplitContainer.Panel1.Controls.Add(this.qFromTextBox); - this.horizSplitContainer.Panel1.Controls.Add(this.qToLabel); - this.horizSplitContainer.Panel1.Controls.Add(this.qFromLabel); - // - // horizSplitContainer.Panel2 - // - this.horizSplitContainer.Panel2.Controls.Add(this.cancelButton); - this.horizSplitContainer.Panel2.Controls.Add(this.nextButton); - this.horizSplitContainer.Panel2.Controls.Add(this.backButton); - this.horizSplitContainer.Size = new System.Drawing.Size(284, 262); - this.horizSplitContainer.SplitterDistance = 182; - this.horizSplitContainer.TabIndex = 1; - // - // sensorsComboBox - // - this.sensorsComboBox.FormattingEnabled = true; - this.sensorsComboBox.Location = new System.Drawing.Point(137, 105); - this.sensorsComboBox.Name = "sensorsComboBox"; - this.sensorsComboBox.Size = new System.Drawing.Size(124, 21); - this.sensorsComboBox.TabIndex = 7; - this.sensorsComboBox.SelectedIndexChanged += new System.EventHandler(this.anyTextBox_TextChanged); - // - // sensorsLabel - // - this.sensorsLabel.AutoSize = true; - this.sensorsLabel.Location = new System.Drawing.Point(21, 108); - this.sensorsLabel.Name = "sensorsLabel"; - this.sensorsLabel.Size = new System.Drawing.Size(45, 13); - this.sensorsLabel.TabIndex = 6; - this.sensorsLabel.Text = "Sensors"; - // - // qToTextBox - // - this.qToTextBox.Location = new System.Drawing.Point(137, 74); - this.qToTextBox.Name = "qToTextBox"; - this.qToTextBox.Size = new System.Drawing.Size(124, 20); - this.qToTextBox.TabIndex = 5; - this.qToTextBox.TextChanged += new System.EventHandler(this.anyTextBox_TextChanged); - // - // qFromTextBox - // - this.qFromTextBox.Location = new System.Drawing.Point(137, 44); - this.qFromTextBox.Name = "qFromTextBox"; - this.qFromTextBox.Size = new System.Drawing.Size(124, 20); - this.qFromTextBox.TabIndex = 4; - this.qFromTextBox.TextChanged += new System.EventHandler(this.anyTextBox_TextChanged); - // - // qToLabel - // - this.qToLabel.AutoSize = true; - this.qToLabel.Location = new System.Drawing.Point(21, 77); - this.qToLabel.Name = "qToLabel"; - this.qToLabel.Size = new System.Drawing.Size(61, 13); - this.qToLabel.TabIndex = 2; - this.qToLabel.Text = "Q to [m3/h]"; - // - // qFromLabel - // - this.qFromLabel.AutoSize = true; - this.qFromLabel.Location = new System.Drawing.Point(21, 47); - this.qFromLabel.Name = "qFromLabel"; - this.qFromLabel.Size = new System.Drawing.Size(72, 13); - this.qFromLabel.TabIndex = 1; - this.qFromLabel.Text = "Q from [m3/h]"; - // - // cancelButton - // - this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.cancelButton.Location = new System.Drawing.Point(186, 17); - this.cancelButton.Name = "cancelButton"; - this.cancelButton.Size = new System.Drawing.Size(75, 42); - this.cancelButton.TabIndex = 27; - this.cancelButton.Text = "&Cancel"; - this.cancelButton.UseVisualStyleBackColor = true; - this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click); - // - // nextButton - // - this.nextButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.nextButton.Location = new System.Drawing.Point(105, 17); - this.nextButton.Name = "nextButton"; - this.nextButton.Size = new System.Drawing.Size(75, 42); - this.nextButton.TabIndex = 26; - this.nextButton.Text = "&Next >"; - this.nextButton.UseVisualStyleBackColor = true; - this.nextButton.Click += new System.EventHandler(this.nextButton_Click); - // - // backButton - // - this.backButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.backButton.DialogResult = System.Windows.Forms.DialogResult.Retry; - this.backButton.Location = new System.Drawing.Point(24, 17); - this.backButton.Name = "backButton"; - this.backButton.Size = new System.Drawing.Size(75, 42); - this.backButton.TabIndex = 25; - this.backButton.Text = "< &Back"; - this.backButton.UseVisualStyleBackColor = true; - this.backButton.Click += new System.EventHandler(this.backButton_Click); - // - // FlowSelection - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(284, 262); - this.Controls.Add(this.horizSplitContainer); - this.Name = "FlowSelection"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "FlowSelection"; - this.Load += new System.EventHandler(this.FlowSelection_Load); - this.horizSplitContainer.Panel1.ResumeLayout(false); - this.horizSplitContainer.Panel1.PerformLayout(); - this.horizSplitContainer.Panel2.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.horizSplitContainer)).EndInit(); - this.horizSplitContainer.ResumeLayout(false); - this.ResumeLayout(false); + this.horizSplitContainer = new System.Windows.Forms.SplitContainer(); + this.sensorsComboBox = new System.Windows.Forms.ComboBox(); + this.sensorsLabel = new System.Windows.Forms.Label(); + this.qToTextBox = new System.Windows.Forms.TextBox(); + this.qFromTextBox = new System.Windows.Forms.TextBox(); + this.qToLabel = new System.Windows.Forms.Label(); + this.qFromLabel = new System.Windows.Forms.Label(); + this.cancelButton = new System.Windows.Forms.Button(); + this.nextButton = new System.Windows.Forms.Button(); + this.backButton = new System.Windows.Forms.Button(); + this.radioButton1 = new System.Windows.Forms.RadioButton(); + this.radioButton2 = new System.Windows.Forms.RadioButton(); + this.radioButton3 = new System.Windows.Forms.RadioButton(); + ((System.ComponentModel.ISupportInitialize)(this.horizSplitContainer)).BeginInit(); + this.horizSplitContainer.Panel1.SuspendLayout(); + this.horizSplitContainer.Panel2.SuspendLayout(); + this.horizSplitContainer.SuspendLayout(); + this.SuspendLayout(); + // + // horizSplitContainer + // + this.horizSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill; + this.horizSplitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; + this.horizSplitContainer.Location = new System.Drawing.Point(0, 0); + this.horizSplitContainer.Name = "horizSplitContainer"; + this.horizSplitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal; + // + // horizSplitContainer.Panel1 + // + this.horizSplitContainer.Panel1.Controls.Add(this.radioButton3); + this.horizSplitContainer.Panel1.Controls.Add(this.radioButton2); + this.horizSplitContainer.Panel1.Controls.Add(this.radioButton1); + this.horizSplitContainer.Panel1.Controls.Add(this.sensorsComboBox); + this.horizSplitContainer.Panel1.Controls.Add(this.sensorsLabel); + this.horizSplitContainer.Panel1.Controls.Add(this.qToTextBox); + this.horizSplitContainer.Panel1.Controls.Add(this.qFromTextBox); + this.horizSplitContainer.Panel1.Controls.Add(this.qToLabel); + this.horizSplitContainer.Panel1.Controls.Add(this.qFromLabel); + // + // horizSplitContainer.Panel2 + // + this.horizSplitContainer.Panel2.Controls.Add(this.cancelButton); + this.horizSplitContainer.Panel2.Controls.Add(this.nextButton); + this.horizSplitContainer.Panel2.Controls.Add(this.backButton); + this.horizSplitContainer.Size = new System.Drawing.Size(284, 262); + this.horizSplitContainer.SplitterDistance = 182; + this.horizSplitContainer.TabIndex = 1; + // + // sensorsComboBox + // + this.sensorsComboBox.FormattingEnabled = true; + this.sensorsComboBox.Location = new System.Drawing.Point(137, 145); + this.sensorsComboBox.Name = "sensorsComboBox"; + this.sensorsComboBox.Size = new System.Drawing.Size(124, 21); + this.sensorsComboBox.TabIndex = 7; + this.sensorsComboBox.SelectedIndexChanged += new System.EventHandler(this.anyTextBox_TextChanged); + // + // sensorsLabel + // + this.sensorsLabel.AutoSize = true; + this.sensorsLabel.Location = new System.Drawing.Point(21, 148); + this.sensorsLabel.Name = "sensorsLabel"; + this.sensorsLabel.Size = new System.Drawing.Size(45, 13); + this.sensorsLabel.TabIndex = 6; + this.sensorsLabel.Text = "Sensors"; + // + // qToTextBox + // + this.qToTextBox.Location = new System.Drawing.Point(137, 119); + this.qToTextBox.Name = "qToTextBox"; + this.qToTextBox.Size = new System.Drawing.Size(124, 20); + this.qToTextBox.TabIndex = 5; + this.qToTextBox.TextChanged += new System.EventHandler(this.anyTextBox_TextChanged); + // + // qFromTextBox + // + this.qFromTextBox.Location = new System.Drawing.Point(137, 93); + this.qFromTextBox.Name = "qFromTextBox"; + this.qFromTextBox.Size = new System.Drawing.Size(124, 20); + this.qFromTextBox.TabIndex = 4; + this.qFromTextBox.TextChanged += new System.EventHandler(this.anyTextBox_TextChanged); + // + // qToLabel + // + this.qToLabel.AutoSize = true; + this.qToLabel.Location = new System.Drawing.Point(21, 122); + this.qToLabel.Name = "qToLabel"; + this.qToLabel.Size = new System.Drawing.Size(61, 13); + this.qToLabel.TabIndex = 2; + this.qToLabel.Text = "Q to [m3/h]"; + // + // qFromLabel + // + this.qFromLabel.AutoSize = true; + this.qFromLabel.Location = new System.Drawing.Point(21, 96); + this.qFromLabel.Name = "qFromLabel"; + this.qFromLabel.Size = new System.Drawing.Size(72, 13); + this.qFromLabel.TabIndex = 1; + this.qFromLabel.Text = "Q from [m3/h]"; + // + // cancelButton + // + this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.cancelButton.Location = new System.Drawing.Point(186, 17); + this.cancelButton.Name = "cancelButton"; + this.cancelButton.Size = new System.Drawing.Size(75, 42); + this.cancelButton.TabIndex = 27; + this.cancelButton.Text = "&Cancel"; + this.cancelButton.UseVisualStyleBackColor = true; + this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click); + // + // nextButton + // + this.nextButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.nextButton.Location = new System.Drawing.Point(105, 17); + this.nextButton.Name = "nextButton"; + this.nextButton.Size = new System.Drawing.Size(75, 42); + this.nextButton.TabIndex = 26; + this.nextButton.Text = "&Next >"; + this.nextButton.UseVisualStyleBackColor = true; + this.nextButton.Click += new System.EventHandler(this.nextButton_Click); + // + // backButton + // + this.backButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.backButton.DialogResult = System.Windows.Forms.DialogResult.Retry; + this.backButton.Location = new System.Drawing.Point(24, 17); + this.backButton.Name = "backButton"; + this.backButton.Size = new System.Drawing.Size(75, 42); + this.backButton.TabIndex = 25; + this.backButton.Text = "< &Back"; + this.backButton.UseVisualStyleBackColor = true; + this.backButton.Click += new System.EventHandler(this.backButton_Click); + // + // radioButton1 + // + this.radioButton1.AutoSize = true; + this.radioButton1.Location = new System.Drawing.Point(24, 19); + this.radioButton1.Name = "radioButton1"; + this.radioButton1.Size = new System.Drawing.Size(85, 17); + this.radioButton1.TabIndex = 8; + this.radioButton1.TabStop = true; + this.radioButton1.Text = "Q from - Q to"; + this.radioButton1.UseVisualStyleBackColor = true; + this.radioButton1.CheckedChanged += new System.EventHandler(this.radioButton1_CheckedChanged); + // + // radioButton2 + // + this.radioButton2.AutoSize = true; + this.radioButton2.Location = new System.Drawing.Point(24, 40); + this.radioButton2.Name = "radioButton2"; + this.radioButton2.Size = new System.Drawing.Size(67, 17); + this.radioButton2.TabIndex = 9; + this.radioButton2.TabStop = true; + this.radioButton2.Text = "Q +/- dQ"; + this.radioButton2.UseVisualStyleBackColor = true; + this.radioButton2.CheckedChanged += new System.EventHandler(this.radioButton2_CheckedChanged); + // + // radioButton3 + // + this.radioButton3.AutoSize = true; + this.radioButton3.Location = new System.Drawing.Point(24, 61); + this.radioButton3.Name = "radioButton3"; + this.radioButton3.Size = new System.Drawing.Size(61, 17); + this.radioButton3.TabIndex = 10; + this.radioButton3.TabStop = true; + this.radioButton3.Text = "Q +/- %"; + this.radioButton3.UseVisualStyleBackColor = true; + this.radioButton3.CheckedChanged += new System.EventHandler(this.radioButton3_CheckedChanged); + // + // FlowSelection + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(284, 262); + this.Controls.Add(this.horizSplitContainer); + this.Name = "FlowSelection"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "FlowSelection"; + this.Load += new System.EventHandler(this.FlowSelection_Load); + this.horizSplitContainer.Panel1.ResumeLayout(false); + this.horizSplitContainer.Panel1.PerformLayout(); + this.horizSplitContainer.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.horizSplitContainer)).EndInit(); + this.horizSplitContainer.ResumeLayout(false); + this.ResumeLayout(false); } @@ -191,6 +233,9 @@ namespace TBF.TestWizard private System.Windows.Forms.Label qFromLabel; private System.Windows.Forms.ComboBox sensorsComboBox; private System.Windows.Forms.Label sensorsLabel; + private System.Windows.Forms.RadioButton radioButton3; + private System.Windows.Forms.RadioButton radioButton2; + private System.Windows.Forms.RadioButton radioButton1; } } \ No newline at end of file diff --git a/TestBenchFramework/TestWizard/FlowSelection.cs b/TestBenchFramework/TestWizard/FlowSelection.cs index 37cc10ef3..bd62fb1e1 100644 --- a/TestBenchFramework/TestWizard/FlowSelection.cs +++ b/TestBenchFramework/TestWizard/FlowSelection.cs @@ -16,13 +16,31 @@ namespace TBF.TestWizard { public partial class FlowSelection : Form { - Test test; + enum QSpec + { + Qfrom_Qto, + Q_dQ, + Q_dPct + } + + Test test; IList sensorPaths; + QSpec qSpec; public FlowSelection() { InitializeComponent(); - } + + radioButton1.Checked = true; + radioButton2.Checked = false; + radioButton3.Checked = false; + qSpec = QSpec.Qfrom_Qto; + + Text = Strings.Flow_selection; + qFromLabel.Text = Strings.Q_from_m3h; + qToLabel.Text = Strings.Q_to_m3h; + sensorsLabel.Text = Strings.Sensors; + } public FlowSelection(bool first, bool last, Test test, @@ -32,16 +50,11 @@ namespace TBF.TestWizard this.test = test; this.sensorPaths = sensorPaths; - Text = Strings.Flow_selection; - qFromLabel.Text = Strings.Q_from_m3h; - qToLabel.Text = Strings.Q_to_m3h; - sensorsLabel.Text = Strings.Sensors; - backButton.Text = Strings.BackBtnText; - nextButton.Text = Strings.NextBtnText; - cancelButton.Text = Strings.CancelBtnText; + if (first) backButton.Visible = false; - if (first) backButton.Visible = false; - if (last) nextButton.Text = Strings.FinishBtnText; + backButton.Text = Strings.BackBtnText; + nextButton.Text = last ? Strings.FinishBtnText : Strings.NextBtnText; + cancelButton.Text = Strings.CancelBtnText; } private void FlowSelection_Load(object sender, EventArgs e) @@ -62,8 +75,24 @@ namespace TBF.TestWizard void UpdateTest() { - test.Qfrom = Utils.ParseUFloat(qFromTextBox.Text); - test.Qto = Utils.ParseUFloat(qToTextBox.Text); + double Q1 = Utils.ParseUDouble(qFromTextBox.Text); + double Q2 = Utils.ParseUDouble(qToTextBox.Text); + + switch (qSpec) + { + case QSpec.Qfrom_Qto: + test.Qfrom = (float)Q1; + test.Qto = (float)Q2; + break; + case QSpec.Q_dQ: + test.Qfrom = (float)(Q1 - Q2); + test.Qto = (float)(Q1 + Q2); + break; + case QSpec.Q_dPct: + test.Qfrom = (float)(Q1 * (1 - Q2 / 100.0f)); + test.Qto = (float)(Q1 * (1 + Q2 / 100.0f)); + break; + } if (sensorsComboBox.Items.Contains(sensorsComboBox.Text)) { @@ -109,5 +138,67 @@ namespace TBF.TestWizard { nextButton.Enabled = IsFormValid(); } + + private void radioButton1_CheckedChanged(object sender, EventArgs e) { if (radioButton1.Checked) ReadRadioButtons(); } + private void radioButton2_CheckedChanged(object sender, EventArgs e) { if (radioButton2.Checked) ReadRadioButtons(); } + private void radioButton3_CheckedChanged(object sender, EventArgs e) { if (radioButton3.Checked) ReadRadioButtons(); } + + void ReadRadioButtons() + { + double Q1 = 0; + double Q2 = 0; + bool floatDataOk = Utils.TryParseUDouble(qFromTextBox.Text, out Q1) + && Utils.TryParseUDouble(qToTextBox.Text, out Q2); + + if (radioButton1.Checked) + { + if (floatDataOk && qSpec == QSpec.Q_dQ) + { + qFromTextBox.Text = (Q1 - Q2).ToString(); + qToTextBox.Text = (Q1 + Q2).ToString(); + } + else if (floatDataOk && qSpec == QSpec.Q_dPct) + { + qFromTextBox.Text = (Q1 * (1 - Q2 / 100.0)).ToString(); + qToTextBox.Text = (Q1 * (1 + Q2 / 100.0)).ToString(); + } + + qSpec = QSpec.Qfrom_Qto; + qFromLabel.Text = Strings.Q_from_m3h; + qToLabel.Text = Strings.Q_to_m3h; + } + else if (radioButton2.Checked) + { + if (floatDataOk && qSpec == QSpec.Qfrom_Qto) + { + qFromTextBox.Text = ((Q1 + Q2) / 2.0).ToString(); + qToTextBox.Text = ((Q2 - Q1) / 2.0).ToString(); + } + else if (floatDataOk && qSpec == QSpec.Q_dPct) + { + qToTextBox.Text = (Q1 * Q2 / 100.0).ToString(); + } + + qSpec = QSpec.Q_dQ; + qFromLabel.Text = "Q [m3/h]"; + qToLabel.Text = "dQ [m3/h]"; + } + else if (radioButton3.Checked) + { + if (floatDataOk && qSpec == QSpec.Qfrom_Qto) + { + qFromTextBox.Text = ((Q1 + Q2) / 2.0).ToString(); + qToTextBox.Text = (100.0 * (Q2 - Q1) / (Q1 + Q2)).ToString(); + } + else if (floatDataOk && qSpec == QSpec.Q_dQ) + { + qToTextBox.Text = (100.0 * Q2 / Q1).ToString(); + } + + qSpec = QSpec.Q_dPct; + qFromLabel.Text = "Q [m3/h]"; + qToLabel.Text = "dQ [%]"; + } + } } } diff --git a/TestBenchFramework/UiControls/BenchControlPanel.Designer.cs b/TestBenchFramework/UiControls/BenchControlPanel.Designer.cs index fd664d4a2..791166eb7 100644 --- a/TestBenchFramework/UiControls/BenchControlPanel.Designer.cs +++ b/TestBenchFramework/UiControls/BenchControlPanel.Designer.cs @@ -44,6 +44,7 @@ namespace TBF.UiControls this.sensitivityTestBtn = new System.Windows.Forms.Button(); this.emptyTank2Btn = new System.Windows.Forms.Button(); this.testGroupBox = new System.Windows.Forms.GroupBox(); + this.acceptResultsBtn = new System.Windows.Forms.Button(); this.startQ3Btn = new System.Windows.Forms.Button(); this.startQ2Btn = new System.Windows.Forms.Button(); this.startQ1Btn = new System.Windows.Forms.Button(); @@ -52,10 +53,9 @@ namespace TBF.UiControls this.emptyGroupBox = new System.Windows.Forms.GroupBox(); this.emptyTank3Btn = new System.Windows.Forms.Button(); this.otherGroupBox = new System.Windows.Forms.GroupBox(); + this.customButton = new System.Windows.Forms.Button(); this.nextButton = new System.Windows.Forms.Button(); this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.acceptResultsBtn = new System.Windows.Forms.Button(); - this.customButton = new System.Windows.Forms.Button(); this.testGroupBox.SuspendLayout(); this.purgeGroupBox.SuspendLayout(); this.emptyGroupBox.SuspendLayout(); @@ -65,125 +65,149 @@ namespace TBF.UiControls // // stopBtn // - this.stopBtn.BackColor = System.Drawing.Color.Tomato; resources.ApplyResources(this.stopBtn, "stopBtn"); + this.stopBtn.BackColor = System.Drawing.Color.Tomato; + this.stopBtn.ImageKey = global::TBF.Resources.Strings.Camera; this.stopBtn.Name = "stopBtn"; this.stopBtn.UseVisualStyleBackColor = false; this.stopBtn.Click += new System.EventHandler(this.stopBtn_Click); // // startTestBtn // - this.startTestBtn.BackColor = System.Drawing.Color.DarkSeaGreen; resources.ApplyResources(this.startTestBtn, "startTestBtn"); + this.startTestBtn.BackColor = System.Drawing.Color.DarkSeaGreen; + this.startTestBtn.ImageKey = global::TBF.Resources.Strings.Camera; this.startTestBtn.Name = "startTestBtn"; this.startTestBtn.UseVisualStyleBackColor = false; this.startTestBtn.Click += new System.EventHandler(this.startTestBtn_Click); // // startCycleBtn // - this.startCycleBtn.BackColor = System.Drawing.Color.LightSeaGreen; resources.ApplyResources(this.startCycleBtn, "startCycleBtn"); + this.startCycleBtn.BackColor = System.Drawing.Color.SteelBlue; + this.startCycleBtn.ImageKey = global::TBF.Resources.Strings.Camera; this.startCycleBtn.Name = "startCycleBtn"; this.startCycleBtn.UseVisualStyleBackColor = false; this.startCycleBtn.Click += new System.EventHandler(this.startCycleBtn_Click); // // purgeBeginBtn // - this.purgeBeginBtn.BackColor = System.Drawing.Color.LightSteelBlue; resources.ApplyResources(this.purgeBeginBtn, "purgeBeginBtn"); + this.purgeBeginBtn.BackColor = System.Drawing.Color.LightSteelBlue; + this.purgeBeginBtn.ImageKey = global::TBF.Resources.Strings.Camera; this.purgeBeginBtn.Name = "purgeBeginBtn"; this.purgeBeginBtn.UseVisualStyleBackColor = false; this.purgeBeginBtn.Click += new System.EventHandler(this.purgeBeginBtn_Click); // // purgeEndBtn // - this.purgeEndBtn.BackColor = System.Drawing.Color.LightSteelBlue; resources.ApplyResources(this.purgeEndBtn, "purgeEndBtn"); + this.purgeEndBtn.BackColor = System.Drawing.Color.LightSteelBlue; + this.purgeEndBtn.ImageKey = global::TBF.Resources.Strings.Camera; this.purgeEndBtn.Name = "purgeEndBtn"; this.purgeEndBtn.UseVisualStyleBackColor = false; this.purgeEndBtn.Click += new System.EventHandler(this.purgeEndBtn_Click); // // breakBtn // - this.breakBtn.BackColor = System.Drawing.Color.DarkGray; resources.ApplyResources(this.breakBtn, "breakBtn"); + this.breakBtn.BackColor = System.Drawing.Color.DarkGray; + this.breakBtn.ImageKey = global::TBF.Resources.Strings.Camera; this.breakBtn.Name = "breakBtn"; this.breakBtn.UseVisualStyleBackColor = false; this.breakBtn.Click += new System.EventHandler(this.breakBtn_Click); // // resetResultsBtn // - this.resetResultsBtn.BackColor = System.Drawing.Color.Tomato; resources.ApplyResources(this.resetResultsBtn, "resetResultsBtn"); + this.resetResultsBtn.BackColor = System.Drawing.Color.Tomato; + this.resetResultsBtn.ImageKey = global::TBF.Resources.Strings.Camera; this.resetResultsBtn.Name = "resetResultsBtn"; this.resetResultsBtn.UseVisualStyleBackColor = false; this.resetResultsBtn.Click += new System.EventHandler(this.resetResultsBtn_Click); // // cameraTestBtn // - this.cameraTestBtn.BackColor = System.Drawing.Color.DarkGray; resources.ApplyResources(this.cameraTestBtn, "cameraTestBtn"); + this.cameraTestBtn.BackColor = System.Drawing.Color.DarkGray; + this.cameraTestBtn.ImageKey = global::TBF.Resources.Strings.Camera; this.cameraTestBtn.Name = "cameraTestBtn"; this.cameraTestBtn.UseVisualStyleBackColor = false; this.cameraTestBtn.Click += new System.EventHandler(this.cameraTestBtn_Click); // // emptyTank1Btn // - this.emptyTank1Btn.BackColor = System.Drawing.Color.LightSteelBlue; resources.ApplyResources(this.emptyTank1Btn, "emptyTank1Btn"); + this.emptyTank1Btn.BackColor = System.Drawing.Color.LightSteelBlue; + this.emptyTank1Btn.ImageKey = global::TBF.Resources.Strings.Camera; this.emptyTank1Btn.Name = "emptyTank1Btn"; this.emptyTank1Btn.UseVisualStyleBackColor = false; this.emptyTank1Btn.Click += new System.EventHandler(this.emptyTank1Btn_Click); // // sensitivityTestBtn // - this.sensitivityTestBtn.BackColor = System.Drawing.Color.DarkGray; resources.ApplyResources(this.sensitivityTestBtn, "sensitivityTestBtn"); + this.sensitivityTestBtn.BackColor = System.Drawing.Color.DarkGray; + this.sensitivityTestBtn.ImageKey = global::TBF.Resources.Strings.Camera; this.sensitivityTestBtn.Name = "sensitivityTestBtn"; this.sensitivityTestBtn.UseVisualStyleBackColor = false; this.sensitivityTestBtn.Click += new System.EventHandler(this.sensitivityTestBtn_Click); // // emptyTank2Btn // - this.emptyTank2Btn.BackColor = System.Drawing.Color.LightSteelBlue; resources.ApplyResources(this.emptyTank2Btn, "emptyTank2Btn"); + this.emptyTank2Btn.BackColor = System.Drawing.Color.LightSteelBlue; + this.emptyTank2Btn.ImageKey = global::TBF.Resources.Strings.Camera; this.emptyTank2Btn.Name = "emptyTank2Btn"; this.emptyTank2Btn.UseVisualStyleBackColor = false; this.emptyTank2Btn.Click += new System.EventHandler(this.emptyTank2Btn_Click); // // testGroupBox // + resources.ApplyResources(this.testGroupBox, "testGroupBox"); + this.testGroupBox.Controls.Add(this.acceptResultsBtn); this.testGroupBox.Controls.Add(this.startQ3Btn); this.testGroupBox.Controls.Add(this.startQ2Btn); this.testGroupBox.Controls.Add(this.startQ1Btn); + this.testGroupBox.Controls.Add(this.breakBtn); this.testGroupBox.Controls.Add(this.testComboBox); this.testGroupBox.Controls.Add(this.startTestBtn); this.testGroupBox.Controls.Add(this.startCycleBtn); - this.testGroupBox.Controls.Add(this.stopBtn); - resources.ApplyResources(this.testGroupBox, "testGroupBox"); this.testGroupBox.Name = "testGroupBox"; this.testGroupBox.TabStop = false; // + // acceptResultsBtn + // + resources.ApplyResources(this.acceptResultsBtn, "acceptResultsBtn"); + this.acceptResultsBtn.BackColor = System.Drawing.Color.DarkKhaki; + this.acceptResultsBtn.ImageKey = global::TBF.Resources.Strings.Camera; + this.acceptResultsBtn.Name = "acceptResultsBtn"; + this.acceptResultsBtn.UseVisualStyleBackColor = false; + this.acceptResultsBtn.Click += new System.EventHandler(this.acceptResultsBtn_Click); + // // startQ3Btn // - this.startQ3Btn.BackColor = System.Drawing.Color.DarkSeaGreen; resources.ApplyResources(this.startQ3Btn, "startQ3Btn"); + this.startQ3Btn.BackColor = System.Drawing.Color.DarkSeaGreen; + this.startQ3Btn.ImageKey = global::TBF.Resources.Strings.Camera; this.startQ3Btn.Name = "startQ3Btn"; this.startQ3Btn.UseVisualStyleBackColor = false; this.startQ3Btn.Click += new System.EventHandler(this.startQ3Btn_Click); // // startQ2Btn // - this.startQ2Btn.BackColor = System.Drawing.Color.DarkSeaGreen; resources.ApplyResources(this.startQ2Btn, "startQ2Btn"); + this.startQ2Btn.BackColor = System.Drawing.Color.DarkSeaGreen; + this.startQ2Btn.ImageKey = global::TBF.Resources.Strings.Camera; this.startQ2Btn.Name = "startQ2Btn"; this.startQ2Btn.UseVisualStyleBackColor = false; this.startQ2Btn.Click += new System.EventHandler(this.startQ2Btn_Click); // // startQ1Btn // - this.startQ1Btn.BackColor = System.Drawing.Color.DarkSeaGreen; resources.ApplyResources(this.startQ1Btn, "startQ1Btn"); + this.startQ1Btn.BackColor = System.Drawing.Color.DarkSeaGreen; + this.startQ1Btn.ImageKey = global::TBF.Resources.Strings.Camera; this.startQ1Btn.Name = "startQ1Btn"; this.startQ1Btn.UseVisualStyleBackColor = false; this.startQ1Btn.Click += new System.EventHandler(this.startQ1Btn_Click); @@ -197,71 +221,64 @@ namespace TBF.UiControls // // purgeGroupBox // + resources.ApplyResources(this.purgeGroupBox, "purgeGroupBox"); this.purgeGroupBox.BackColor = System.Drawing.SystemColors.Control; this.purgeGroupBox.Controls.Add(this.purgeEndBtn); this.purgeGroupBox.Controls.Add(this.purgeBeginBtn); - resources.ApplyResources(this.purgeGroupBox, "purgeGroupBox"); this.purgeGroupBox.Name = "purgeGroupBox"; this.purgeGroupBox.TabStop = false; // // emptyGroupBox // + resources.ApplyResources(this.emptyGroupBox, "emptyGroupBox"); this.emptyGroupBox.Controls.Add(this.emptyTank3Btn); this.emptyGroupBox.Controls.Add(this.emptyTank1Btn); this.emptyGroupBox.Controls.Add(this.emptyTank2Btn); - resources.ApplyResources(this.emptyGroupBox, "emptyGroupBox"); this.emptyGroupBox.Name = "emptyGroupBox"; this.emptyGroupBox.TabStop = false; // // emptyTank3Btn // - this.emptyTank3Btn.BackColor = System.Drawing.Color.LightSteelBlue; resources.ApplyResources(this.emptyTank3Btn, "emptyTank3Btn"); + this.emptyTank3Btn.BackColor = System.Drawing.Color.LightSteelBlue; + this.emptyTank3Btn.ImageKey = global::TBF.Resources.Strings.Camera; this.emptyTank3Btn.Name = "emptyTank3Btn"; this.emptyTank3Btn.UseVisualStyleBackColor = false; this.emptyTank3Btn.Click += new System.EventHandler(this.emptyTank3Btn_Click); // // otherGroupBox // + resources.ApplyResources(this.otherGroupBox, "otherGroupBox"); this.otherGroupBox.Controls.Add(this.customButton); this.otherGroupBox.Controls.Add(this.sensitivityTestBtn); this.otherGroupBox.Controls.Add(this.nextButton); this.otherGroupBox.Controls.Add(this.cameraTestBtn); - this.otherGroupBox.Controls.Add(this.breakBtn); - resources.ApplyResources(this.otherGroupBox, "otherGroupBox"); this.otherGroupBox.Name = "otherGroupBox"; this.otherGroupBox.TabStop = false; // + // customButton + // + resources.ApplyResources(this.customButton, "customButton"); + this.customButton.ImageKey = global::TBF.Resources.Strings.Camera; + this.customButton.Name = "customButton"; + this.customButton.UseVisualStyleBackColor = true; + this.customButton.Click += new System.EventHandler(this.customButton_Click); + // // nextButton // resources.ApplyResources(this.nextButton, "nextButton"); + this.nextButton.ImageKey = global::TBF.Resources.Strings.Camera; this.nextButton.Name = "nextButton"; this.nextButton.UseVisualStyleBackColor = true; this.nextButton.Click += new System.EventHandler(this.nextButton_Click); // // groupBox1 // - this.groupBox1.Controls.Add(this.acceptResultsBtn); - this.groupBox1.Controls.Add(this.resetResultsBtn); resources.ApplyResources(this.groupBox1, "groupBox1"); + this.groupBox1.Controls.Add(this.resetResultsBtn); this.groupBox1.Name = "groupBox1"; this.groupBox1.TabStop = false; // - // acceptResultsBtn - // - this.acceptResultsBtn.BackColor = System.Drawing.Color.ForestGreen; - resources.ApplyResources(this.acceptResultsBtn, "acceptResultsBtn"); - this.acceptResultsBtn.Name = "acceptResultsBtn"; - this.acceptResultsBtn.UseVisualStyleBackColor = false; - this.acceptResultsBtn.Click += new System.EventHandler(this.acceptResultsBtn_Click); - // - // customButton - // - resources.ApplyResources(this.customButton, "customButton"); - this.customButton.Name = "customButton"; - this.customButton.UseVisualStyleBackColor = true; - this.customButton.Click += new System.EventHandler(this.customButton_Click); - // // BenchControlPanel // resources.ApplyResources(this, "$this"); @@ -272,6 +289,7 @@ namespace TBF.UiControls this.Controls.Add(this.emptyGroupBox); this.Controls.Add(this.purgeGroupBox); this.Controls.Add(this.testGroupBox); + this.Controls.Add(this.stopBtn); this.Name = "BenchControlPanel"; this.Load += new System.EventHandler(this.BenchControlPanel_Load); this.testGroupBox.ResumeLayout(false); diff --git a/TestBenchFramework/UiControls/BenchControlPanel.cs b/TestBenchFramework/UiControls/BenchControlPanel.cs index 2800f3e50..5f93bf646 100644 --- a/TestBenchFramework/UiControls/BenchControlPanel.cs +++ b/TestBenchFramework/UiControls/BenchControlPanel.cs @@ -8,6 +8,7 @@ using System.Windows.Forms; using log4net; using Config.Entities; using TBF.UiBridge; +using TBF.Resources; namespace TBF.UiControls { @@ -97,6 +98,8 @@ namespace TBF.UiControls private void BenchControlPanel_Load(object sender, EventArgs e) { + //Localize(); + // Original (enabled) colors of buttons colorStopEn = stopBtn.BackColor; colorTestsEn = startTestBtn.BackColor; @@ -117,6 +120,11 @@ namespace TBF.UiControls colorOtherDis = Color.FromArgb(Lghtr(colorOtherEn.R), Lghtr(colorOtherEn.G), Lghtr(colorOtherEn.B)); } + void Localize() + { + testGroupBox.Text = Strings.Session; + emptyGroupBox.Text = Strings.Drain; + } /// /// Read the database and re-initialize testComboBox items. diff --git a/TestBenchFramework/UiControls/BenchControlPanel.de.resx b/TestBenchFramework/UiControls/BenchControlPanel.de.resx index a95cb3829..68a954dd4 100644 --- a/TestBenchFramework/UiControls/BenchControlPanel.de.resx +++ b/TestBenchFramework/UiControls/BenchControlPanel.de.resx @@ -122,20 +122,17 @@ Verdana, 14.25pt - 104, 167 + 68, 290 - 94, 70 + 94, 81 - 0 Stopp + Stopp Verdana, 14.25pt - - 8, 66 - 4 Start Prüfpunkt @@ -143,7 +140,7 @@ Verdana, 14.25pt - 8, 167 + 8, 151 5 Start Prüfung @@ -169,8 +166,11 @@ 7 Entwässern + + 8, 235 + - Unter- brechung + Unterbrechen Verdana, 12pt @@ -193,11 +193,17 @@ Verdana, 14.25pt + + 9, 192 + + + Bestätigen + Verdana, 14.25pt - 138, 116 + 138, 109 3 @@ -206,7 +212,7 @@ Verdana, 14.25pt - 73, 116 + 73, 109 2 @@ -215,7 +221,7 @@ Verdana, 14.25pt - 8, 116 + 8, 109 1 @@ -223,23 +229,26 @@ 13, 3 + + 207, 281 + Prüfpunkt - 13, 252 + 13, 382 Prüfstrecke - 13, 326 + 13, 456 Leeren - 13, 400 + 13, 530 207, 130 @@ -247,14 +256,8 @@ Zubehör - - Verdana, 10pt - - - bestätigen - - 13, 536 + 13, 666 Ergebnisse diff --git a/TestBenchFramework/UiControls/BenchControlPanel.resx b/TestBenchFramework/UiControls/BenchControlPanel.resx index 03404b0a0..019abf1ad 100644 --- a/TestBenchFramework/UiControls/BenchControlPanel.resx +++ b/TestBenchFramework/UiControls/BenchControlPanel.resx @@ -117,814 +117,742 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Verdana, 15.75pt - - - - NoControl - - - 106, 168 - - - 92, 70 - - - 5 - - - Stop - - - stopBtn - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - testGroupBox - - - 6 - - - Verdana, 15.75pt - - - NoControl - - - 8, 67 - - - 190, 45 - - - 4 + + 12 - Start Test - - - startTestBtn - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - testGroupBox - - - 4 - - - Verdana, 15.75pt - - - NoControl - - - 8, 168 - - - 92, 70 - - - 7 - - - Start Cycle - - - startCycleBtn - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - testGroupBox - - - 5 - - - Verdana, 15.75pt + Start test + NoControl - - 8, 23 - - - 92, 35 - - - 8 - - - Begin - - - purgeBeginBtn - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - purgeGroupBox - - - 1 - - + + Verdana, 15.75pt - + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 5 + + + Verdana, 15.75pt + + + 2 + + NoControl 106, 23 - - 92, 35 + + 4, 4, 4, 4 - - 9 + + Line - - End + + 3 - - purgeEndBtn + + 190, 38 - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - purgeGroupBox - - - 0 - - - Verdana, 12pt - - - NoControl - - - 8, 26 - - - 92, 45 - - - 10 - - - Break - - - breakBtn - - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - otherGroupBox - - - 4 - - - Verdana, 15.75pt - - - NoControl - - - 8, 20 - - - 92, 42 - - - 11 - - - Reset - - - resetResultsBtn - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox1 - - - 1 - - - Verdana, 12pt - - - NoControl - - - 105, 77 - - - 92, 45 - - - 12 - - - Camera test - False cameraTestBtn - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - otherGroupBox - - - 3 - - - Verdana, 15.75pt - - - NoControl - - - 8, 26 - - - 60, 35 - - - 13 - - - W1 - - - emptyTank1Btn - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - emptyGroupBox - - - 1 - - - Verdana, 12pt - - - NoControl - - - 8, 77 - - - 92, 45 - - - 14 - - - Sensi- tivity - - - False - - - sensitivityTestBtn - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - otherGroupBox - - - 1 - - - Verdana, 15.75pt - - - NoControl - - - 73, 26 - - - 60, 35 - - - 15 - - - W2 - - - emptyTank2Btn - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - emptyGroupBox - - - 2 - - - startQ3Btn - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - testGroupBox - - - 0 - - - startQ2Btn - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - testGroupBox - - - 1 - - - startQ1Btn - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - testGroupBox - - - 2 - - - testComboBox - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - testGroupBox - - - 3 - - - Verdana, 12pt - - - 7, 3 - - - 207, 246 - - - 17 - - - Test - - - testGroupBox - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 4 - - - Verdana, 15.75pt - - - NoControl - - - 138, 117 - - - 60, 45 - - - 9 - - - Q3 - - - startQ3Btn - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - testGroupBox - - - 0 - - - Verdana, 15.75pt - - - NoControl - - - 73, 117 - - - 60, 45 - - - 8 - - - Q2 - - - startQ2Btn - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - testGroupBox - - - 1 - - - Verdana, 15.75pt - - - NoControl - - - 8, 117 - - - 60, 45 - - - 7 - - - Q1 - - - startQ1Btn - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - testGroupBox - - - 2 - - - Verdana, 15.75pt - - - 8, 25 - - - 190, 33 - - - 6 - - - testComboBox - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - testGroupBox - - - 3 - - - Verdana, 12pt - - - 7, 253 - - - 207, 68 - - - 18 - - - Purge - - - purgeGroupBox - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 3 - - - emptyTank3Btn - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - emptyGroupBox - - - 0 - - - Verdana, 12pt - - - 7, 327 - - - 207, 68 - - - 19 - - - Empty - - - emptyGroupBox - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 2 - - + Verdana, 15.75pt NoControl - - 138, 26 + + 19 - - 60, 35 + + Verdana, 15.75pt - - 16 + + Auxiliary - - W3 + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Camera test + + + 1 + + + 60, 38 + + + Reset + + + 22 + + + startQ2Btn + + + sensitivityTestBtn + + + 91, 25 + + + Sensi- tivity + + + Verdana, 11.25pt + + + 17 + + + Verdana, 12pt emptyTank3Btn - + + Drain + + + testGroupBox + + + testGroupBox + + + 8, 66 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 60, 38 + + + 1 + + + groupBox1 + + + 2 + + + $this + + + 7, 446 + + + startCycleBtn + + + 8, 110 + + + emptyGroupBox + + + startQ3Btn + + + testGroupBox + + + testGroupBox + + + 6 + + + 8 + + + 207, 68 + + + breakBtn + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Verdana, 15.75pt + + + 7 + + + Flood + + + 0 + + + 8, 198 + + + 106, 17 + + + 0 + + + 92, 67 + + + 22 + + + 8, 20 + + + W2 + + + 207, 128 + + + 21 + + + otherGroupBox + + + 3 + + + Q1 + + + Start cycle + + + 60, 35 + + + nextButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + purgeEndBtn + + + Q3 + + + otherGroupBox + + + 11 + + + Verdana, 12pt + + + W1 + + + 92, 35 + + + NoControl + + + otherGroupBox + + + 190, 38 + + + 20 + + + BenchControlPanel + + + 1 + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 8, 154 + + + 1 + + + 5 + + + 14 + + + 5 + + + 92, 35 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 6 + + + 0 + + + 2 + + + 92, 42 + + + False + + + NoControl + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + testGroupBox + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + purgeGroupBox + + + Drain water tank + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 7, 3 + + + startQ1Btn + + + 0 + + + NoControl + + + 13 + + + Verdana, 15.75pt + + + Verdana, 15.75pt + + + 3 + + + purgeGroupBox + + + 7, 654 + + + 4 + + + testGroupBox + + + False + emptyGroupBox - + + Session + + + 60, 35 + + + $this + + + 138, 26 + + + 73, 26 + + + Verdana, 15.75pt + + + startTestBtn + + + emptyTank1Btn + + + 92, 45 + + + 15 + + + False + + + NoControl + + + 16 + + + 9 + + + testComboBox + + + 60, 35 + + + Verdana, 15.75pt + + + 60, 38 + + + 4 + + + 224, 736 + + + False + + + 8, 23 + + + purgeBeginBtn + + + emptyTank2Btn + + + 207, 68 + + + acceptResultsBtn + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + End session + + + emptyGroupBox + + + resetResultsBtn + + + 8, 24 + + + testGroupBox + + + W3 + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 138, 110 + + + $this + + + NoControl + + + 8 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 7 + + + Verdana, 15.75pt + + + 105, 46 + + + 4 + + + testGroupBox + + + Stop + + + Verdana, 15.75pt + + + NoControl + + + NoControl + + + Abort session + + + 60, 299 + + 0 + + 190, 33 + + + NoControl + + + 10 + + + 9, 18 + + + $this + + + Verdana, 12pt + Lucida Console, 8.25pt NoControl - - 105, 46 + + 1 - - 92, 25 + + 8, 77 - - 22 + + NoControl - - Oprav DEWY + + 7 - - False + + 190, 38 - - customButton + + testGroupBox - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + $this - - otherGroupBox + + Verdana, 15.75pt - - 0 - - - False - - - Lucida Console, 8.25pt - - - 106, 17 - - - 91, 25 - - - 21 - - - Next - - - False - - - nextButton - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - otherGroupBox - - - 2 - - + Verdana, 12pt - - 7, 401 - - - 207, 128 - - - 20 - - - Auxiliary - otherGroupBox - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 1 - - - acceptResultsBtn - - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - groupBox1 + + stopBtn - - 0 + + Verdana, 15.75pt - - Verdana, 12pt + + emptyGroupBox - - 7, 535 + + NoControl - - 207, 68 + + 7, 520 - - 22 + + 73, 110 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Results - - False + + 8, 26 - - groupBox1 + + 18 - + + Lucida Console, 8.25pt + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - $this + + 207, 68 - + + 92, 45 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 7, 372 + + 0 - - Verdana, 15.75pt + + Verdana, 12pt + + + purgeGroupBox + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 8, 242 NoControl - - 106, 20 + + Q2 - - 92, 42 + + 190, 38 - - 15 - - - Accept - - - acceptResultsBtn - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - + groupBox1 - - 0 + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 92, 25 + + + NoControl + + + customButton + + + otherGroupBox + + + Verdana, 15.75pt + + + NoControl + + + 105, 77 + + + Next + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 9 + + + Verdana, 15.75pt + + + 2 + + + 15 + + + 207, 290 + + + Oprav DEWY + + + False + + + Verdana, 12pt + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Verdana, 12pt True - - 9, 18 - - - Verdana, 11.25pt - - - 4, 4, 4, 4 - - - 224, 736 - - - BenchControlPanel - - - System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - \ No newline at end of file