예제 #1
0
        public CameraModel GetCameraModel(IDslrCamera camera, string storePath)
        {
            _imageData = null;
            camera.ConnectCamera();
            var model = camera.Model;

            camera.ImageReady    += Camera_ImageReady;
            camera.StorePath      = storePath;
            camera.Iso            = 200;
            camera.ImageFormat    = Enums.ImageFormat.RAW;
            camera.IsLiveViewMode = false;
            camera.StartExposure(1, true);

            oSignalEvent.WaitOne(60 * 1000);
            oSignalEvent.Reset();

            CameraModel result = null;

            if (_imageData != null)
            {
                result              = new CameraModel();
                result.ImageWidth   = _imageData.GetLength(0);
                result.ImageHeight  = _imageData.GetLength(1);
                result.SensorWidth  = 22.5;
                result.SensorHeight = 15;
                result.Name         = model;
            }

            return(result);
        }
예제 #2
0
        private static void CreateCamera()
        {
            Logger.WriteTraceMessage("CreateCamera(), _cameraSettings.IntegrationAPI = '" + _cameraSettings.IntegrationApi.ToString() + "'");

            if (_cameraSettings.IntegrationApi == ConnectionMethod.CanonSdk)
            {
                _dslrCamera = new CanonSdkCamera(_cameraSettings.CameraModelsHistory);
                _dslrCamera.IsLiveViewMode = _cameraSettings.LiveViewCaptureMode;
                _dslrCamera.LiveViewZoom = _cameraSettings.LiveViewZoom;
                //Future Test
                //_dslrCamera = new DigiCamControlCamera(TraceLogger, _cameraSettings.CameraModelsHistory);
            }
            else if (_cameraSettings.IntegrationApi == ConnectionMethod.BackyardEOS)
            {
                _dslrCamera = new BackyardEosCamera(_cameraSettings.BackyardEosPort, _cameraSettings.CameraModelsHistory);
            }
            else if (_cameraSettings.IntegrationApi == ConnectionMethod.NikonLegacy)
            {
                _dslrCamera = new DigiCamControlCamera(TraceLogger, _cameraSettings.CameraModelsHistory);
            }
            else if (_cameraSettings.IntegrationApi == ConnectionMethod.Pentax)
            {
                _dslrCamera = new PentaxCamera(_cameraSettings.CameraModelsHistory);
            }
            else if (_cameraSettings.IntegrationApi == ConnectionMethod.Nikon)
            {
                _dslrCamera = new NikonSDKCamera(_cameraSettings.CameraModelsHistory);
            }
        }
예제 #3
0
        private void SetCameraSettings(IDslrCamera camera, CameraSettings settings)
        {
            //camera.Iso = Gain > 0 ? Gain : settings.Iso;
            camera.Iso            = Gain > 50 ? Gain : settings.Iso;
            camera.StorePath      = settings.StorePath;
            camera.SaveFile       = settings.SaveFile;
            camera.IsLiveViewMode = settings.LiveViewCaptureMode;
            camera.LiveViewZoom   = settings.LiveViewZoom;
            camera.maxADU         = settings.maxADU;

            camera.maxADUOverride = settings.maxADUOverride;

            switch (CameraSettings.CameraMode)
            {
            case CameraMode.RGGB:
            case CameraMode.Color16:
                camera.ImageFormat = ImageFormat.RAW;
                break;

            case CameraMode.ColorJpg:
                camera.ImageFormat = ImageFormat.JPEG;
                break;
            }

            camera.UseExternalShutter  = settings.UseExternalShutter;
            camera.ExternalShutterPort = settings.ExternalShutterPortName;
        }
예제 #4
0
 private static void CreateCamera()
 {
     if (_cameraSettings.IntegrationApi == IntegrationApi.CanonSdk)
     {
         _dslrCamera = new CanonSdkCamera();
     }
     else if (_cameraSettings.IntegrationApi == IntegrationApi.BackyardEOS)
     {
         _dslrCamera = new BackyardEosCamera(_cameraSettings.BackyardEosPort);
     }
 }
예제 #5
0
 private static void CreateCamera()
 {
     if (_cameraSettings.IntegrationApi == ConnectionMethod.CanonSdk)
     {
         _dslrCamera = new CanonSdkCamera(_cameraSettings.CameraModelsHistory);
         _dslrCamera.IsLiveViewMode = _cameraSettings.LiveViewCaptureMode;
         _dslrCamera.LiveViewZoom   = _cameraSettings.LiveViewZoom;
     }
     else if (_cameraSettings.IntegrationApi == ConnectionMethod.BackyardEOS)
     {
         _dslrCamera = new BackyardEosCamera(_cameraSettings.BackyardEosPort, _cameraSettings.CameraModelsHistory);
     }
 }
예제 #6
0
        private void SetCameraSettings(IDslrCamera camera, CameraSettings settings)
        {
            camera.Iso       = Gain > 0 ? Gain : settings.Iso;
            camera.StorePath = settings.StorePath;

            switch (CameraSettings.CameraMode)
            {
            case CameraMode.RGGB:
            case CameraMode.Color16:
                camera.ImageFormat = ImageFormat.RAW;
                break;

            case CameraMode.ColorJpg:
                camera.ImageFormat = ImageFormat.JPEG;
                break;
            }
        }
예제 #7
0
 public static void SetSettings(CameraSettings settings)
 {
     _cameraSettings = settings;
     _dslrCamera?.Dispose();
     _dslrCamera = null;
 }
예제 #8
0
        public CameraModel GetCameraModel(IDslrCamera camera, string storePath)
        {
            CameraModel result = null;

            _imageData = null;
            camera.ConnectCamera();
            var model = camera.Model;

            camera.ImageReady     += Camera_ImageReady;
            camera.ExposureFailed += Camera_ExposureFailed;
            camera.StorePath       = storePath;
            camera.Iso             = 200;
            camera.ImageFormat     = Enums.ImageFormat.RAW;
            camera.IsLiveViewMode  = false;
            boolCameraError        = false;

            camera.StartExposure(1, true);

            // modified to checked if the signal was set as opposed to a timeout occured

            //TESTING without the if. Looks like it is working for Nikon without IF statement


            oSignalEvent.WaitOne(60 * 1000);
            oSignalEvent.Reset();

            if (_imageData != null)
            {
                result              = new CameraModel();
                result.ImageWidth   = _imageData.GetLength(0);
                result.ImageHeight  = _imageData.GetLength(1);
                result.SensorWidth  = 22.5;
                result.SensorHeight = 15;
                result.Name         = model;
            }


            /*if (oSignalEvent.WaitOne(60 * 1000))
             * {
             *  oSignalEvent.Reset();
             *
             *  if (!boolCameraError && (_imageData != null))
             *  {
             *      result = new CameraModel();
             *      result.ImageWidth = _imageData.GetLength(0);
             *      result.ImageHeight = _imageData.GetLength(1);
             *      result.SensorWidth = 22.5;
             *      result.SensorHeight = 15;
             *      result.Name = model;
             *  }
             *  else
             *  {
             *      Logger.WriteTraceMessage("CameraModelDetector.GetCameraModel: Camera Exposure failed, msg = " + exposureFailedEventArgs.Message + "'");
             *
             *      throw new DriverException("Camera Exposure failed, msg'" + exposureFailedEventArgs.Message + "'");
             *  }
             * }
             * else
             * {
             *  // TODO: figure out how to handle this better....  This will just throw an exception to the user and close the app
             *  Logger.WriteTraceMessage("CameraModelDetector.GetCameraModel: timeout waiting for setup exposure");
             *
             *  throw new DriverException("Timeout waiting for setup exposure");
             *
             * }*/

            return(result);
        }