diff --git a/TBF/BenchControl/Sequences/MainSeq.cs b/TBF/BenchControl/Sequences/MainSeq.cs index d9de9b1b9..5c70786c5 100644 --- a/TBF/BenchControl/Sequences/MainSeq.cs +++ b/TBF/BenchControl/Sequences/MainSeq.cs @@ -1138,17 +1138,22 @@ namespace TBF.BenchControl.Sequences GenericDevices.IDataEntry dataEntryCmpnt = TbfComponents.FindComponent(StateMachine.Procedure.DataEntry) as GenericDevices.IDataEntry; if (dataEntryCmpnt is IHasCycleEndForm) { - /// Open the modeless form for the end of the cycle - State.Create("MainSeq : Enter end data") - .AddOperation((dataEntryCmpnt as GenericDevices.IHasCycleEndForm).ShowCycleEndFormOp()) - .AddOperation(checkUiOp) - .EnterState(); - do - { - e = StateMachine.WaitRunDevsRunOps(); - if (e.Contains(Event.UiCmdStop)) goto stop; - } - while (!e.Contains(Event.ModelessFormClosed)); + IOperation showCycleEndFormOp = (dataEntryCmpnt as GenericDevices.IHasCycleEndForm).ShowCycleEndFormOp(); + + if (showCycleEndFormOp != null) + { + /// Open the modeless form for the end of the cycle + State.Create("MainSeq : Enter end data") + .AddOperation(showCycleEndFormOp) + .AddOperation(checkUiOp) + .EnterState(); + do + { + e = StateMachine.WaitRunDevsRunOps(); + if (e.Contains(Event.UiCmdStop)) goto stop; + } + while (!e.Contains(Event.ModelessFormClosed)); + } } /// diff --git a/TBF/BenchControl/TestMethods/iPerlCommunication/iPerlCommunicationForm.cs b/TBF/BenchControl/TestMethods/iPerlCommunication/iPerlCommunicationForm.cs index 65b4c65de..25d865e0c 100644 --- a/TBF/BenchControl/TestMethods/iPerlCommunication/iPerlCommunicationForm.cs +++ b/TBF/BenchControl/TestMethods/iPerlCommunication/iPerlCommunicationForm.cs @@ -588,16 +588,22 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication int nrLines = (wmsCount + lineSize - 1) / lineSize; int gap = (textBoxesCount - wmsCount) / nrLines; + for (int i = 0; i < ckbIndex.Length; i++) + { + ckbIndex[i] = -1; /// Initialize with invalid indices + } + int dest = 0; - for (int l = 0; l < nrLines; l++) + for (int l = 0; l < nrLines; l++) { for (int i = 0; i < lineSize; i++) { - labels[dest] = labels[l * lineSize + l * gap + i]; - counters[dest] = counters[l * lineSize + l * gap + i]; - messages[dest] = messages[l * lineSize + l * gap + i]; - checkBoxes[dest] = checkBoxes[l * lineSize + l * gap + i]; - ckbIndex[l * lineSize + l * gap + i] = dest; + int origin = l * lineSize + l * gap + i; + labels[dest] = labels[origin]; + counters[dest] = counters[origin]; + messages[dest] = messages[origin]; + checkBoxes[dest] = checkBoxes[origin]; + ckbIndex[origin] = dest; dest++; } } @@ -2836,7 +2842,10 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication long result = 0; for (int i = 0; i < 48; i++) { - if (ckbState[ckbIndex[i]]) result += (1L << i); + if (ckbIndex[i] >= 0 && ckbState[ckbIndex[i]]) + { + result += (1L << i); + } } return result; } @@ -2861,7 +2870,10 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication }; for (int i = 0; i < 48; i++) { - chkBoxes[i].Checked = ckbState[ckbIndex[i]] = ((state & (1L << i)) != 0); + if (ckbIndex[i] >= 0) + { + chkBoxes[i].Checked = ckbState[ckbIndex[i]] = ((state & (1L << i)) != 0); + } } } diff --git a/TBF/Properties/AssemblyInfo.cs b/TBF/Properties/AssemblyInfo.cs index b97b8bd82..195bea34c 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.26.1706.0")] -[assembly: AssemblyFileVersion("2.26.1706.0")] +[assembly: AssemblyVersion("2.26.1707.0")] +[assembly: AssemblyFileVersion("2.26.1707.0")]