コード例 #1
0
        // Occurs when a camera has stopped grabbing.
        private void OnGrabStopped(Object sender, GrabStopEventArgs e)
        {
            CCDGrabStatusChange(CCDGrabStatus.Stop);
            //if (InvokeRequired)
            //{
            //    // If called from a different thread, we must use the Invoke method to marshal the call to the proper thread.
            //    BeginInvoke(new EventHandler<GrabStopEventArgs>(OnGrabStopped), sender, e);
            //    return;
            //}

            // Reset the stopwatch.
            stopWatch.Reset();

            // The camera stopped grabbing. Enable the grab buttons. Disable the stop button.
            //EnableButtons(true, false);

            // If the grabbed stop due to an error, display the error message.
            if (e.Reason != GrabStopReason.UserRequest)
            {
                Console.WriteLine("A grab error occured:\n" + e.ErrorMessage);
            }
        }
コード例 #2
0
        // Occurs when a camera has stopped grabbing.
        private void OnGrabStopped(Object sender, GrabStopEventArgs e)
        {
            if (!Dispatcher.CheckAccess())
            {
                // If called from a different thread, we must use the Invoke method to marshal the call to the proper thread.
                Dispatcher.BeginInvoke(new EventHandler <GrabStopEventArgs>(OnGrabStopped), sender, e);
                return;
            }

            // Reset the stopwatch.
            stopWatch.Reset();

            // Re-enable the updating of the device list.
            //updateDeviceListTimer.Start();

            // The camera stopped grabbing. Enable the grab buttons. Disable the stop button.
            EnableButtons(true, false);

            // If the grabbed stop due to an error, display the error message.
            if (e.Reason != GrabStopReason.UserRequest)
            {
                MessageBox.Show("A grab error occured:\n" + e.ErrorMessage, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
コード例 #3
0
ファイル: clsBasler.cs プロジェクト: JiaquanLi/AutoTech
        // Occurs when a camera has stopped grabbing.
        private void OnGrabStopped(Object sender, GrabStopEventArgs e)
        {
            if (pbx_Image == null)
            {
            }
            else
            {
                if (pbx_Image.InvokeRequired)
                {
                    // If called from a different thread, we must use the Invoke method to marshal the call to the proper thread.
                    pbx_Image.BeginInvoke(new EventHandler <GrabStopEventArgs>(OnGrabStopped), sender, e);
                    return;
                }
            }

            // Reset the stopwatch.
            stopWatch.Reset();

            // If the grabbed stop due to an error, display the error message.
            if (e.Reason != GrabStopReason.UserRequest)
            {
                System.Windows.Forms.MessageBox.Show("A grab error occured:\n" + e.ErrorMessage, "Error", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
            }
        }
コード例 #4
0
        // Occurs when a camera has stopped grabbing.
        private void OnGrabStopped(Object sender, GrabStopEventArgs e)
        {
            if (e.Reason != GrabStopReason.UserRequest)
            {
                Log.Set(string.Format("A grab error occured:\n" + e.ErrorMessage));
            }
            else
            {
                Log.Set("Camera has stopped grabbing.");
            }

            EnShotOnce       = true;
            EnShotContinuous = true;
            EnShotStop       = false;
            EnResetCamera    = true;
            EnConnect        = false;
            EnDisConnet      = true;
            EnParameterSave  = true;
            EnParameterLoad  = true;
            EnImageSave      = true;
            EnImageSaveAuto  = true;

            EnParamAll = true;
        }
コード例 #5
0
 private void StreamGrabber_GrabStopped(object sender, GrabStopEventArgs e)
 {
     GrabOver = false;
 }
コード例 #6
0
 private void RaiseGrabStoppedEvent(object sender, GrabStopEventArgs e) => GrabStopped?.Invoke(sender, e);