public void Disconnect() { if (cmdMessenger != null) { cmdMessenger.StopListening(); cmdMessenger.Dispose(); } if (st != null) { st.Close(); st.Kill(); st.Dispose(); } measurementThread.Abort(); connected = false; }
/// <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); } }