ASCOM.cam8_v04.Camera.StartExposure C# (CSharp) Method

StartExposure() public method

public StartExposure ( double Duration, bool Light ) : void
Duration double
Light bool
return void
        public void StartExposure(double Duration, bool Light)
        {
            if ((Duration < ExposureMin) || (Duration > ExposureMax)) throw new ASCOM.InvalidValueException("StartExposure: Invalid Duration");
            //Set LastExposureDuration;
            m_LastExposureDuration = Duration;
            //Set LasExposureStartTime;
            m_LastExposureStartTime = System.DateTime.Now.ToString("yyyy-MM-ddThh:mm:ss");
            //Read & set gain and offset parameters
            m_Gain = short.Parse(settings_form.GainTextBox.Text);            
            m_Offset = short.Parse(settings_form.OffsetTextBox.Text);            
            //Set camera settings, if fail - exception
            if (CameraSetGain(m_Gain) == false) throw new ASCOM.InvalidOperationException("Cant set gain to cam8");
            if (CameraSetOffset(m_Offset) == false) throw new ASCOM.InvalidOperationException("Cant set offset to cam8");
            //Call function from cam8ll4.dll to start exposure
            CameraStartExposure((int)m_BinX, m_StartX, m_StartY, m_NumX, m_NumY, Duration, true);
            return;
        }
        //Camera stop exposure