Пример #1
0
 public void Disconnect()
 {
     if (cmdMessenger != null)
     {
         cmdMessenger.StopListening();
         cmdMessenger.Dispose();
     }
     if (st != null)
     {
         st.Close();
         st.Kill();
         st.Dispose();
     }
     measurementThread.Abort();
     connected = false;
 }
Пример #2
0
 /// <summary>
 /// Disconnects from the communication port, sends an event for the connection status change
 /// </summary>
 private void Disconnect()
 {
     if (cmdMessenger != null)
     {
         cmdMessenger.StopListening();
         cmdMessenger.Dispose();
     }
     if (st != null)
     {
         st.Close();
         st.Kill();
         st.Dispose();
     }
     connected = false;
     fixture   = NO_FIXTURE;
     if (FixtureChanged != null)
     {
         FixtureChanged(fixture);
     }
     if (ConnectionStatusChanged != null)
     {
         ConnectionStatusChanged(connected);
     }
 }