private void Microscan_App_Closing(object sender, System.ComponentModel.CancelEventArgs e) { // Stop all inspections if (m_Dev != null) { m_Dev.StopAll(); } // Disconnect the reports if (m_RepCon1 != null) { m_RepCon1.Disconnect(); } m_RepCon1 = null; // Disconnect the IO if (m_IO != null) { m_IO.Disconnect(); } m_IO = null; // Disconnect from the camera if (m_Dev != null) { m_Dev.Disconnect(); } m_Dev = null; // Set the RootStep of setup manager to null SetupManager1.RootStep = null; // Clear the job from pc memory while (m_Job.Count > 0) { m_Job.Remove(1); } m_Job = null; }
private void DisconnectReport() { if (allReport != null) { allReport.Disconnect(); allReport.NewReport -= receivedReport_NewReport; allReport = null; } if (allMultipleReport != null) { foreach (ReportConnection report in allMultipleReport) { report.Disconnect(); report.NewReport -= receivedReport_NewReport; } allMultipleReport = null; } if (ConnectionEventCallback != null) { ConnectionEventCallback.Invoke(Enum_ConnectionEvent.CONNECTED_REPORT, null); } }