Exemple #1
0
        /// <summary>
        /// 실제 사용되는 측정 메소드
        /// </summary>
        /// <param name="deviceIndex"></param>
        /// <returns></returns>
        public bool Measure(int deviceIndex)
        {
            try
            {
                LastWavelength = OceanOpticsWrapper.getWavelengths(deviceIndex);
                LastIntensity  = OceanOpticsWrapper.getSpectrum(deviceIndex);

                WaveLength [deviceIndex] = ( double [] )LastWavelength.Clone();
                Intensity [deviceIndex]  = ( double [] )LastIntensity.Clone();

                if (LastIntensity.Max() > MaxCount)
                {
                }
                return(true);
            }
            catch (Exception except)
            {
                return(false);
            }
        }
Exemple #2
0
        public bool Measure(int deviceIndex, out double [] outWavelength, out double [] outIntensity)
        {
            try
            {
                LastWavelength = OceanOpticsWrapper.getWavelengths(deviceIndex);
                LastIntensity  = OceanOpticsWrapper.getSpectrum(deviceIndex);

                WaveLength [deviceIndex] = ( double [] )LastWavelength.Clone();
                Intensity [deviceIndex]  = ( double [] )LastIntensity.Clone();

                outWavelength = ( double [] )LastWavelength.Clone();
                outIntensity  = ( double [] )LastIntensity.Clone();
                return(true);
            }
            catch (Exception except)
            {
                outWavelength = null;
                outIntensity  = null;
                return(false);
            }
        }
        public bool Measure(out double[] outWavelength, out double[] outIntensity)
        {
            try
            {
                LastWavelength = OceanOpticsWrapper.getWavelengths(DeviceIndex);
                LastIntensity  = OceanOpticsWrapper.getSpectrum(DeviceIndex);

                WaveLength[DeviceIndex] = (double[])LastWavelength.Clone();
                Intensity[DeviceIndex]  = (double[])LastIntensity.Clone();

                outWavelength = (double[])LastWavelength.Clone();
                outIntensity  = (double[])LastIntensity.Clone();
                return(true);
            }
            catch (Exception except)
            {
                COMMON.Log.Error("Spectrometer :: Measure " + except.ToString());
                outWavelength = null;
                outIntensity  = null;
                return(false);
            }
        }
        /// <summary>
        /// 실제 사용되는 측정 메소드
        /// </summary>
        /// <param name="deviceIndex"></param>
        /// <returns></returns>
        public bool Measure(int deviceIndex)
        {
            try
            {
                LastWavelength = OceanOpticsWrapper.getWavelengths(deviceIndex);
                LastIntensity  = OceanOpticsWrapper.getSpectrum(deviceIndex);

                WaveLength[deviceIndex] = (double[])LastWavelength.Clone();
                Intensity[deviceIndex]  = (double[])LastIntensity.Clone();

                if (LastIntensity.Max() > MaxCount)
                {
                    MessageBox.Show("Spectrometer Saturated");
                }
                return(true);
            }
            catch (Exception except)
            {
                COMMON.Log.Error("Spectrometer :: Measure " + except.ToString());
                return(false);
            }
        }