private void Init() { m_params = Params.GetParams(); m_config = Config.GetConfig(); m_waver = Waver.GetWaver(); m_card = NiCard.CreateInstance(); m_scanTasks = new List <ScanTask>(); m_scanningTask = null; m_params.Calculate(); }
public void Config() { if (m_sysConfig.GetAcqDevice() == ACQ_DEVICE.PMT) { NiCard.CreateInstance().AiSamplesReceived += new AiSamplesReceivedEventHandler(PmtReceiveSamples); } else { NiCard.CreateInstance().CiSamplesReceived += new CiSamplesReceivedEventHandler(ApdReceiveSamples); } m_scanInfo.Config(); m_scanData.Config(); }
/////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////// public static NiCard CreateInstance() { if (m_card == null) { lock (locker) { if (m_card == null) { m_card = new NiCard(); } } } return(m_card); }
public void Stop() { if (m_sysConfig.GetAcqDevice() == ACQ_DEVICE.PMT) { NiCard.CreateInstance().AiSamplesReceived -= PmtReceiveSamples; } else { NiCard.CreateInstance().CiSamplesReceived -= ApdReceiveSamples; } m_scanning = false; if (m_convertThreads != null) { for (int i = 0; i < m_convertThreads.Length; i++) { if (m_convertThreads[i] != null) { m_convertThreads[i].Join(); m_convertThreads[i].Abort(); m_convertThreads[i] = null; } } } if (m_imageDataThread != null) { m_imageDataThread.Join(); m_imageDataThread.Abort(); m_imageDataThread = null; } if (m_imageDisplayThread != null) { m_imageDisplayThread.Join(); m_imageDisplayThread.Abort(); m_imageDisplayThread = null; } }