Exemple #1
0
        /// <summary>
        /// Setups streaming. After calling this method the application is ready to receive data.
        /// StartAcquisition will instruct the device to actually start sending data.
        /// </summary>
        private void StartStreaming()
        {
            // Create display thread, hook display event
            displayThread = new PvDisplayThread();
            displayThread.OnBufferDisplay += OnBufferDisp;

            // Start threads
            displayThread.Start(pipeline, device.Parameters);
            displayThread.Priority = PvThreadPriority.AboveNormal;

            // Configure acquisition state manager
            acquisitionManager = new PvAcquisitionStateManager(device, stream);

            // Start pipeline
            pipeline.Start();
        }
Exemple #2
0
        /// <summary>
        /// Setups streaming. After calling this method the application is ready to receive data.
        /// StartAcquisition will instruct the device to actually start sending data.
        /// </summary>
        private void StartStreaming()
        {
            // Configure status control
            statusControl.Stream        = mStream;
            statusControl.DisplayThread = mDisplayThread;

            // Start threads
            mDisplayThread.Start(mPipeline, mDevice.Parameters);
            mDisplayThread.Priority = PvThreadPriority.AboveNormal;

            // Configure acquisition state manager
            mAcquisitionManager = new PvAcquisitionStateManager(mDevice, mStream);
            mAcquisitionManager.OnAcquisitionStateChanged += new OnAcquisitionStateChanged(OnAcquisitionStateChanged);

            // Start pipeline
            mPipeline.Start();
        }
Exemple #3
0
        /// <summary>
        /// Stops streaming. After calling this method the application is no longer armed or ready
        /// to receive data.
        /// </summary>
        private void StopStreaming()
        {
            if (!displayThread.IsRunning)
            {
                return;
            }

            // Stop display thread
            displayThread.Stop(false);

            // Release acquisition manager
            acquisitionManager.Dispose();
            acquisitionManager = null;

            // Stop pipeline
            if (pipeline.IsStarted)
            {
                pipeline.Stop();
            }

            displayThread.WaitComplete();
        }