diff --git a/TBF/BenchControl/DataEntry/StandardCamera/TestStartEndForm.cs b/TBF/BenchControl/DataEntry/StandardCamera/TestStartEndForm.cs index 59ce34d32..4f3559fab 100644 --- a/TBF/BenchControl/DataEntry/StandardCamera/TestStartEndForm.cs +++ b/TBF/BenchControl/DataEntry/StandardCamera/TestStartEndForm.cs @@ -297,7 +297,8 @@ namespace TBF.BenchControl.DataEntry.StandardCamera switch (mode) { case Tst.Start: - if (disabled != null && wmPos <= disabled.Length && disabled[wmPos - 1]) + if ((disabled != null && wmPos <= disabled.Length && disabled[wmPos - 1]) || + (regReaders != null && wmPos <= regReaders.Length && regReaders[wmPos - 1] == null)) { startTextBoxes[i].Enabled = false; } @@ -309,8 +310,9 @@ namespace TBF.BenchControl.DataEntry.StandardCamera break; case Tst.End: - if (disabled != null && wmPos <= disabled.Length && disabled[wmPos - 1]) - { + if ((disabled != null && wmPos <= disabled.Length && disabled[wmPos - 1]) || + (regReaders != null && wmPos <= regReaders.Length && regReaders[wmPos - 1] == null)) + { startTextBoxes[i].Enabled = false; endTextBoxes[i].Enabled = false; } @@ -324,8 +326,9 @@ namespace TBF.BenchControl.DataEntry.StandardCamera break; case Tst.Both: - if (disabled != null && wmPos <= disabled.Length && disabled[wmPos - 1]) - { + if ((disabled != null && wmPos <= disabled.Length && disabled[wmPos - 1]) || + (regReaders != null && wmPos <= regReaders.Length && regReaders[wmPos - 1] == null)) + { startTextBoxes[i].Enabled = false; endTextBoxes[i].Enabled = false; } @@ -561,8 +564,29 @@ namespace TBF.BenchControl.DataEntry.StandardCamera if (enabledTextBoxes[i] == currentFocusOwner) { /// Change focus to the next enabled text box - enabledTextBoxes[(i + 1) % enabledTextBoxes.Count].Focus(); - return; + var currentTextBox = enabledTextBoxes[(i + 1) % enabledTextBoxes.Count]; + currentTextBox.Focus(); + + /// Load the respective image + for (int j = 0; j < startTextBoxes.Length; j++) + { + if (startTextBoxes[j] == currentTextBox) + { + LoadImage(Tst.Start, j); + return; + } + } + for (int j = 0; j < endTextBoxes.Length; j++) + { + if (endTextBoxes[j] == currentTextBox) + { + LoadImage(Tst.End, j); + return; + } + } + + /// No image found + return; } } }