public void LoadMachineSettings(string fileName) { string Header = ""; string strread = ""; for (int i = 0; i < SpecList.Count; i++) { Header = "Spectrometer" + (i + 1).ToString(); FileOperation.ReadData(fileName, Header, "Type", ref strread); if (strread != "0") { SpectType spt = SpectType.NoSpectrometer; Enum.TryParse(strread, out spt); SpecList[i].specType = spt;//(SpectType)int.Parse(strread); } FileOperation.ReadData(fileName, Header, "Serial", ref strread); if (strread != "0") { SpecList[i].serial = strread; } } InitSpectrometer(); AssignSpecIndex(); LoadFileName = fileName; LoadSettings(fileName); }
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 UpdateSpecList(SpectType myType) { specLB.Items.Clear(); List <string> myList = new List <string>(); myList = myMgr.GetSpectrometerList(myType); for (int i = 0; i < myList.Count; i++) { specLB.Items.Add(myList[i]); } selType = myType; }