示例#1
0
        public static Spectrometer ConnectToFirstDevice()
        {
            Spectrometer spectrometer = null;

            try
            {
                var ooIds = OceanOptics.EnumerateOceanOpticsDeviceIDs();
                if (ooIds.Count > 0)
                {
                    spectrometer = new OceanOptics(ooIds[0]);
                }
            }
            catch (Exception ex)
            {
            }

            if (spectrometer == null) //если OceanOptics не был подключен
            {
                spectrometer = Avesta.Connect(0);
            }

            if (spectrometer == null)
            {
                throw new Exception("No connected devices");
            }

            return(spectrometer);
        }
示例#2
0
        public static Avesta ConnectToFitstDevice()
        {
            Avesta av = new Avesta(0);

            av.Connect();
            return(av);
        }
示例#3
0
        public static Avesta Connect(int deviceID)
        {
            Avesta av = new Avesta(deviceID);

            return(av);
        }