Exemple #1
0
        public void Start()
        {
            if (!imageProvider.IsOpen)
            {
                Open();
            }

            if (!deviceHandle.IsValid || !imageProvider.IsOpen)
            {
                return;
            }

            log.DebugFormat("Starting device {0}, {1}", summary.Alias, summary.Identifier);

            imageProvider.GrabErrorEvent       += imageProvider_GrabErrorEvent;
            imageProvider.GrabbingStartedEvent += imageProvider_GrabbingStartedEvent;
            imageProvider.DeviceRemovedEvent   += imageProvider_DeviceRemovedEvent;
            imageProvider.ImageReadyEvent      += imageProvider_ImageReadyEvent;

            try
            {
                imageProvider.ContinuousShot();
            }
            catch (Exception e)
            {
                LogError(e, imageProvider.GetLastErrorMessage());
            }
        }
Exemple #2
0
 /* Starts the grabbing of images until the grabbing is stopped and handles exceptions. */
 private void ContinuousShot()
 {
     try
     {
         m_imageProvider.ContinuousShot(); /* Start the grabbing of images until grabbing is stopped. */
     }
     catch (Exception e)
     {
         ShowException(e, m_imageProvider.GetLastErrorMessage());
     }
 }
Exemple #3
0
        /// <summary>
        /// Starts continous grabbing of ImageProvider.
        /// </summary>
        public void Start()
        {
            try {
                // Save range set to 0, but the imageProvider is still working. We Stop it.
                if (HasStarted && SaveRange <= 0)
                {
                    Stop();

                    return;
                }

                // Disable the camera on Save range zero.
                if (HasStarted || SaveRange <= 0)
                {
                    return;
                }

                ImageProvider.ContinuousShot();

                /*using (var p = Process.GetCurrentProcess ()) {
                 *
                 *      Console.Clear ();
                 *
                 *      int pS = 1;
                 *
                 *
                 *      foreach (ProcessThread t in p.Threads) {
                 *              if (t.PriorityLevel == ThreadPriorityLevel.Highest) {
                 *                      //t.PriorityLevel = ThreadPriorityLevel.TimeCritical;
                 *
                 *                      t.IdealProcessor = pS;
                 *
                 *                      pS++;
                 *
                 *                      if (pS >= 8)
                 *                              pS = 1;
                 *              }
                 *              //Console.WriteLine (t.CurrentPriority + " - " + t.Id + " - " + t.PriorityBoostEnabled + " - " + t.PriorityLevel);
                 *      }
                 *
                 * }*/

                HasStarted = true;
            } catch (Exception ex) {
                log.Fatal("ERROR while starting continuous sht on device with Index " + Index);
                log.Fatal("Device Info: " + FullName);

                log.Fatal("Exception: " + ex.ToString());

                OnErrorReceived?.Invoke(this, ex);
            }
        }
 public override void Start()
 {
     m_imageProvider.ContinuousShot();
 }
 //连续拍照
 public void ContinuousShot()
 {
     Finish = false;
     m_imageProvider.ContinuousShot(); /* Start the grabbing of images until grabbing is stopped. */
 }