public RecordingDriver2(int processingThreadNumber = 3)
 {
     ArduinoWorker                = new ArduinoWorker();
     settings                     = new SettingsContainer();
     imageCapture                 = new ImageCapture();
     imageCapture2                = new ModelImageCapture();
     imageProcessor               = new ImageProcessor2(processingThreadNumber);
     imageCapture.rec            += AddImage;
     imageCapture2.imageReciever += AddImage;
     imageCapture.action         += ArduinoWorker.Action;
     imageCapture.Start();
     imageCapture2.Pause();
     imageCapture2.Start();
 }
        private void ApplySettings()
        {
            imageCapture.UpdateCamera(settings.Camera);
            imageCapture.UpdateFramePause(settings.FramePause);
            imageCapture.UpdateMaxFrameCounter(settings.MaximumSteps);
            if (settings.model)
            {
                imageCapture.Pause();
                lock (locker)
                    BufferPhaseImage = null;
                imageCapture2.PauseRelease();
            }
            else
            {
                imageCapture2.Pause();
                lock (locker)
                    BufferPhaseImage = null;
                imageCapture.PauseRelease();
            }

            if (settings.arduino)
            {
                if (ArduinoWorker == null)
                {
                    ArduinoWorker = new ArduinoWorker();
                    ArduinoWorker.init();
                    imageCapture.action += ArduinoWorker.Action;
                }
            }
            else
            {
                if (ArduinoWorker != null)
                {
                    ArduinoWorker.Stop();
                    imageCapture.action -= ArduinoWorker.Action;
                    ArduinoWorker        = null;
                }
            }
        }