Esempio n. 1
0
 private void scheduleTimeoutTimer()
 {
     timeoutTimer = new System.Threading.Timer(
         obj =>
     {
         this.Invoke((MethodInvoker) delegate
         {
             if (controller != null && controller.connected)
             {
                 controller.disconnect(true);
             }
         });
     },
         null, 50000, Timeout.Infinite);
 }
Esempio n. 2
0
 private async void disconnect()
 {
     if (timeoutTimer != null)
     {
         timeoutTimer.Dispose();
         timeoutTimer = null;
     }
     if (controller != null && controller.connected)
     {
         if (engineStatus != 0)
         {
             engine(0);
         }
         else
         {
             clearEngineTask();
         }
         if (engineTask != null)
         {
             await engineTask;
             engineTask.Dispose();
             engineTask = null;
         }
         toggleLine(currentTemplate.ledLine, 0);
         controller.disconnect();
     }
 }
Esempio n. 3
0
 private void cbConnectTerminal_CheckedChanged(object sender, EventArgs e)
 {
     if (cbConnectTerminal.Checked)
     {
         connectTerminal();
     }
     else
     {
         if (terminalJConnection != null)
         {
             terminalJConnection.disconnect();
         }
         cbConnectTerminal.ForeColor = defForeColor;
     }
 }
Esempio n. 4
0
 private void FWX0B_FormClosing(object sender, FormClosingEventArgs e)
 {
     closingFl = true;
     terminalJConnection?.disconnect();
     setActiveController(-1);
 }