diff --git a/TBF/Resources/Strings.Designer.cs b/TBF/Resources/Strings.Designer.cs index 9d095bf57..f5efe87b8 100644 --- a/TBF/Resources/Strings.Designer.cs +++ b/TBF/Resources/Strings.Designer.cs @@ -2238,6 +2238,15 @@ namespace TBF.Resources { } } + /// + /// Looks up a localized string similar to Disabled by user. + /// + internal static string Head_was_disabled_by_the_user { + get { + return ResourceManager.GetString("Head_was_disabled_by_the_user", resourceCulture); + } + } + /// /// Looks up a localized string similar to Header. /// @@ -3390,15 +3399,6 @@ namespace TBF.Resources { } } - /// - /// Looks up a localized string similar to Disabled by user. - /// - internal static string Opto_head_was_disabled_by_the_user { - get { - return ResourceManager.GetString("Opto_head_was_disabled_by_the_user", resourceCulture); - } - } - /// /// Looks up a localized string similar to Other. /// diff --git a/TBF/Resources/Strings.resx b/TBF/Resources/Strings.resx index 3c428994e..ea0768d1a 100644 --- a/TBF/Resources/Strings.resx +++ b/TBF/Resources/Strings.resx @@ -1723,7 +1723,7 @@ RFID communication failed - + Disabled by user diff --git a/TBF/Rig/TestMethods/S640Communication/S640CommForm.cs b/TBF/Rig/TestMethods/S640Communication/S640CommForm.cs index a32cbc0ae..dfc43d3be 100644 --- a/TBF/Rig/TestMethods/S640Communication/S640CommForm.cs +++ b/TBF/Rig/TestMethods/S640Communication/S640CommForm.cs @@ -290,7 +290,7 @@ namespace TBF.Rig.TestMethods.S640Communication checkBoxes[i].Checked = false; checkBoxes[i].Enabled = false; pictures[i].BackColor = DisabledColor; - messages[i].Text = Strings.Opto_head_was_disabled_by_the_user; + messages[i].Text = Strings.Head_was_disabled_by_the_user; } else { @@ -387,7 +387,7 @@ namespace TBF.Rig.TestMethods.S640Communication { /// Opto head was disabled by the user pictures[i].BackColor = DisabledColor; - messages[i].Text = Strings.Opto_head_was_disabled_by_the_user; + messages[i].Text = Strings.Head_was_disabled_by_the_user; } else { diff --git a/TBF/Rig/TestMethods/iPerlCommunication/iPerlCommunicationForm.cs b/TBF/Rig/TestMethods/iPerlCommunication/iPerlCommunicationForm.cs index 005d6674a..a5a29269e 100644 --- a/TBF/Rig/TestMethods/iPerlCommunication/iPerlCommunicationForm.cs +++ b/TBF/Rig/TestMethods/iPerlCommunication/iPerlCommunicationForm.cs @@ -1,5 +1,5 @@ /// -/// Copyright (c) 2015-2020 Sensus Slovensko a.s. +/// Copyright (c) 2015-2021 Sensus Slovensko a.s. /// //#define VERIFY_ACTIVE_MODE //#define VERIFY_Q2_CORR_RESET @@ -494,7 +494,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication } WaterMetersCount = iperlHeads.Count; - ShuffleTextBoxes(WaterMetersCount, Common.Data.LineSize); + ShuffleTextBoxes(WaterMetersCount, ProcessData.LineSize); /// /// Prepare worker threads, 'rfidPortNrs', 'lastGroup', etc.. @@ -611,19 +611,10 @@ namespace TBF.Rig.TestMethods.iPerlCommunication textBoxesCount = wmsCount; } - if (checkBoxesEditMode) + int count = checkBoxesEditMode ? textBoxesCount : Math.Min(textBoxesCount, iperlHeads.Count); + for (int j = 0; j < count; j++) { - for (int j = 0; j < textBoxesCount; j++) labels[j].Text = string.Format("WM{0}", j + 1); - samplePictureBox1.Visible = false; - samplePictureBox2.Visible = false; - samplePictureBox3.Visible = false; - sampleLabel1.Visible = false; - sampleLabel2.Visible = false; - sampleLabel1.Visible = false; - } - else - { - for (int j = 0; j < Math.Min(textBoxesCount, iperlHeads.Count); j++) labels[j].Text = iperlHeads[j].Name; + labels[j].Text = (j + 1).ToString(); } ResizeDlgToFitEnabledControls(); @@ -648,7 +639,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication void Localize() { - Text = Strings.Water_Meter_States; + Text = checkBoxesEditMode ? Strings.Optical_heads : Strings.Water_Meter_States; saveButton.Text = Strings.Save; sampleLabel1.Text = Strings.Direction_and_pulses_are_OK; @@ -665,6 +656,17 @@ namespace TBF.Rig.TestMethods.iPerlCommunication { Localize(); + if (checkBoxesEditMode) + { + /// Check box edit mode => Hide explanation of activity colours + sampleLabel1.Visible = false; + sampleLabel2.Visible = false; + sampleLabel3.Visible = false; + samplePictureBox1.Visible = false; + samplePictureBox2.Visible = false; + samplePictureBox3.Visible = false; + } + /// /// Set checkbox states accroding to iPerlHeads[i].Disabled states /// @@ -677,7 +679,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication /// iPerl position i+1 is disabled checkBoxes[i].Enabled = checkBoxes[i].Checked = ckbState[i] = false; counters[i].BackColor = DisabledColor; - messages[i].Text = Strings.Opto_head_was_disabled_by_the_user; + messages[i].Text = Strings.Head_was_disabled_by_the_user; } else { @@ -904,7 +906,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication /// if (error == CommErr.HeadDisabledByUser || !ckbState[wmNr0]) { - OnCommCompleted(null, new CommCompletedEventArgs(threadID, wmNr0, ihead, wm, Strings.Opto_head_was_disabled_by_the_user, CommErr.HeadDisabledByUser)); + OnCommCompleted(null, new CommCompletedEventArgs(threadID, wmNr0, ihead, wm, Strings.Head_was_disabled_by_the_user, CommErr.HeadDisabledByUser)); } else if (error == CommErr.None) { @@ -1892,10 +1894,10 @@ namespace TBF.Rig.TestMethods.iPerlCommunication { if (ihead.CommFailed) return CommErr.CommFailed; - if (TBF.Rig.Sequences.ProcessData.IsQ2PreCorrectionCalculated) + if (ProcessData.IsQ2PreCorrectionCalculated) { - return WriteQ2Corrections(threadId, ihead, wm, ref resultStr, TBF.Rig.Sequences.ProcessData.CalculatedQ2PreCorrectionLR, - TBF.Rig.Sequences.ProcessData.CalculatedQ2PreCorrectionRL); + return WriteQ2Corrections(threadId, ihead, wm, ref resultStr, ProcessData.CalculatedQ2PreCorrectionLR, + ProcessData.CalculatedQ2PreCorrectionRL); } else { @@ -1979,10 +1981,10 @@ namespace TBF.Rig.TestMethods.iPerlCommunication if (wm.Pruefindex == 1) { - if (TBF.Rig.Sequences.ProcessData.IsQ2PreCorrectionCalculated) + if (ProcessData.IsQ2PreCorrectionCalculated) { - return WriteQ2Corrections(threadId, ihead, wm, ref resultStr, TBF.Rig.Sequences.ProcessData.CalculatedQ2PreCorrectionLR, - TBF.Rig.Sequences.ProcessData.CalculatedQ2PreCorrectionRL); + return WriteQ2Corrections(threadId, ihead, wm, ref resultStr, ProcessData.CalculatedQ2PreCorrectionLR, + ProcessData.CalculatedQ2PreCorrectionRL); } else { @@ -2185,9 +2187,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication /// if ((q2CorrType == Q2CorrType.Update) || (q2CorrType == Q2CorrType.ConditionalUpdate)) { - /// /// Update or ConditionalUpdate: 1. Calculate updates, not corrections, 2. Use error limits from this test - /// double errLimitLo = test.ErrLimLo + test.Uncertainty; double errLimitHi = test.ErrLimHi - test.Uncertainty; @@ -2269,9 +2269,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication } else { - /// /// Regular Q2 corrections: 1. Use error limits from 'q2adjResult' - /// double errLimitLo = q2adjTestData.ErrLimLo + q2adjTestData.ErrLimMargin; double errLimitHi = q2adjTestData.ErrLimHi - q2adjTestData.ErrLimMargin; @@ -2768,7 +2766,7 @@ namespace TBF.Rig.TestMethods.iPerlCommunication tstRslt.EndTime = endTime; tstRslt.FlowSetTime = 0; tstRslt.MassOfEvapWater = 0; - tstRslt.TestTime += testTime; /// [s] total communication time of all tests + tstRslt.TestTime += testTime; /// [s] total communication time of all tests for (int i = 0; i < iperlHeads.Count; i++) {