@@ -1824,7 +1824,7 @@ LocalErrorHandler:
1824
1824
'configure the operator message box
1825
1825
Me .rtbOperatorMessage.Text = LangLookup(modLocalization.txslLangIndex.gnReadyToTest)
1826
1826
1827
-
1827
+ _readyToRunEvent.Set()
1828
1828
End Sub
1829
1829
1830
1830
Private Sub InitSerialInput()
@@ -2102,11 +2102,11 @@ LocalErrorHandler:
2102
2102
Me .Cursor = mnOldMousePointer
2103
2103
ConfigButtonsBeforeRun()
2104
2104
2105
- If _client .Connected Then
2106
- FixBox.BackColor = IIf(_client .Report(), Color.Red, Color.Yellow)
2105
+ If _tcpClient .Connected Then
2106
+ FixBox.BackColor = IIf(_tcpClient .Report(), Color.Red, Color.Yellow)
2107
2107
End If
2108
2108
InitSerialInput()
2109
- _pause .Set()
2109
+ _testDoneEvent .Set()
2110
2110
Exit Sub
2111
2111
2112
2112
LocalErrorHandler:
@@ -2325,21 +2325,25 @@ LocalErrorHandler:
2325
2325
thread.Start()
2326
2326
End Sub
2327
2327
2328
- ReadOnly _client As New TcpClient()
2329
- Dim _pause As New Threading.AutoResetEvent( False )
2328
+ ReadOnly _tcpClient As New TcpClient()
2329
+ ReadOnly _readyToRunEvent As New AutoResetEvent( False )
2330
+ ReadOnly _testDoneEvent As New AutoResetEvent( False )
2330
2331
Private Sub BackgroundThread()
2331
- If Not _client .Connect() Then
2332
+ If Not _tcpClient .Connect() Then
2332
2333
Return
2333
2334
End If
2335
+
2334
2336
SysBox.BackColor = Color.Green
2337
+ _readyToRunEvent.WaitOne()
2335
2338
2336
2339
While True
2337
- If _client .Check() Then
2340
+ If _tcpClient .Check() Then
2338
2341
FixBox.BackColor = Color.Green
2339
2342
Invoke( Sub ()
2340
2343
cmdRun_Click(cmdRun, New System.EventArgs)
2341
2344
End Sub )
2342
- _pause.WaitOne()
2345
+ _testDoneEvent.WaitOne()
2346
+ _testDoneEvent.Reset()
2343
2347
End If
2344
2348
Thread.Sleep( 500 )
2345
2349
End While
0 commit comments