private void Window_Loaded(object sender, RoutedEventArgs e) { DyeListBLL.ReadInitDye(); try { if (!OmniProvider.isSimulate) { if (OmniProvider.OpenSpectrometers() > 0) { OmniProvider.OpenSerialPort(); OmniProvider.SendCommand("ZZ", false); OmniProvider.GetWaveLengthsList();//获得波长 OmniProvider.GetParameters(); } else { MessageBox.Show("Connect fail.未找到光谱仪"); Functions.CommnucationLog("Connect fail.未找到光谱仪"); } } } catch (Exception ex) { MessageBox.Show("Connect fail." + ex.Message); Functions.CommnucationLog("Connect fail." + ex.Message); } }
private void UserControl_Loaded(object sender, RoutedEventArgs e) { try { OmniProvider.GetParameters(); schart.CreateCoordinate(100, 900, 0, 70000); datWave_Light.ItemsSource = mDataList; mSetWaveLength_LightList.CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(mLightList_CollectionChanged); txtBoxcarWidth.Text = OmniProvider.BoxcarWidth.ToString(); txtScansToAverage.Text = OmniProvider.ScansToAverage.ToString(); txtIntergrationTime.Text = OmniProvider.InterationTime.ToString(); } catch (Exception ex) { Functions.LOG("check load" + ex.Message); } }