public List <string> GetSpectrometerList(SpectType myType) { List <string> myList = new List <string>(); switch (myType) { case SpectType.NoSpectrometer: break; case SpectType.Avantes: if (AvantesObj == null) { AvantesObj = new AvantesSpect(avWinHdl); } myList = AvantesObj.GetSpectrometerList(); break; case SpectType.Maya: if (MayaObj == null) { MayaObj = new MayaSpectrometer(); } myList = MayaObj.GetSpectrometerList(); break; case SpectType.CAS140: if (CASObj == null) { CASObj = new CAS140Spect(); } myList = CASObj.GetSpectrometerList(); break; } return(myList); }
private void InitSpectrometer() { bool isAvantes = false; bool isMaya = false; bool isCAS = false; if (SpecList.Count == 0) { return; } for (int i = 0; i < SpecList.Count; i++) { switch (SpecList[i].specType) { case SpectType.Avantes: isAvantes = true; break; case SpectType.Maya: isMaya = true; break; case SpectType.CAS140: isCAS = true; break; } } if (isAvantes) { if (AvantesObj == null) { AvantesObj = new AvantesSpect(avWinHdl); } } if (isMaya) { if (MayaObj == null) { MayaObj = new MayaSpectrometer(); } } if (isCAS) { if (CASObj == null) { CASObj = new CAS140Spect(); } } }