public void SetIO(int idx, bool OnOff) { if (SpecList[idx].specType == SpectType.NoSpectrometer) { return; } switch (SpecList[idx].specType) { case SpectType.Avantes: AvantesObj.SetIO(SpecList[idx].Idx, Convert.ToByte(OnOff)); break; case SpectType.Maya: MayaObj.SetIO(SpecList[idx].Idx, Convert.ToByte(OnOff)); break; case SpectType.CAS140: CASObj.SetIO(SpecList[idx].Idx, Convert.ToByte(OnOff)); break; } if (!Para.isOutShutter) { if (OnOff) { SpecList[idx].starttime = DateTime.Now; SpecList[idx].UsedTime = DateTime.Now - SpecList[idx].starttime; } else { SpecList[idx].UsedTime = SpecList[idx].UsedTime + (DateTime.Now - SpecList[idx].starttime); } } }