/// <summary> /// Update status texts, such as remaining photo, video, and etc... /// </summary> async private void UpdateStatusTexts() { var optionsParam = new GetOptionsParam() { RemainingPictures = true, RemainingVideoSeconds = true, RemainingSpace = true, TotalSpace = true }; var options = await _theta.ThetaApi.GetOptionsAsync(optionsParam); pnlRemainings.DataContext = options; }
/// <summary> /// Initialize contorls bases /// </summary> async private void InitControlsValues() { var optionsParam = new GetOptionsParam() { ShutterVolume = true, ExposureDelay = true, SleepDelay = true, OffDelay = true }; var options = await _theta.ThetaApi.GetOptionsAsync(optionsParam); // shutter volume sliderVolume.Value = options.ShutterVolume; // exposure delay (self timer) tglExposureDelay.IsChecked = options.ExposureDelay > 0; if (tglExposureDelay.IsChecked.Value) { sliderSelfTimer.Value = options.ExposureDelay; } // sleep delay tglSleepDelay.IsChecked = options.SleepDelay != DISABLED_TIMER_VALUE; if (tglSleepDelay.IsChecked.Value) { sliderSleep.Value = options.SleepDelay; } // off delay tglOffDelay.IsChecked = options.OffDelay != DISABLED_TIMER_VALUE; if (CommonCameraInfo.Instance.Info.ThetaModel >= InfoResponse.THETA_MODEL.V) { sliderOffDelay.Minimum = 600; sliderOffDelay.Maximum = 2592000; sliderOffDelay.SmallChange = 60; sliderOffDelay.LargeChange = 120; if (tglOffDelay.IsChecked.Value) { sliderOffDelay.Value = options.OffDelay; } } else { sliderOffDelay.Minimum = 30; sliderOffDelay.Maximum = 1800; sliderOffDelay.SmallChange = 5; sliderOffDelay.LargeChange = 10; if (tglOffDelay.IsChecked.Value) { sliderOffDelay.Value = options.OffDelay; } } _isInitialized = true; }
/// <summary> /// Update controls /// </summary> /// <returns></returns> async private Task UpdateControls() { if (_theta == null) { return; } var optionsParam = new GetOptionsParam() { PreviewFormat = true }; var options = await _theta.ThetaApi.GetOptionsAsync(optionsParam); await this.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(() => { _ignoreEvent = true; cmbPreview.SelectedItem = options.PreviewFormat; _ignoreEvent = false; })); }
/// <summary> /// Initialize contorls bases /// </summary> async private void InitControlsValues() { var optionsParam = new GetOptionsParam() { ColorTemperature = true, WhiteBalance = true, ExposureProgram = true, Aperture = true, ShutterSpeed = true, Iso = true }; var options = await _theta.ThetaApi.GetOptionsAsync(optionsParam); #region White Balance KeyValuePair <string, string>[] WbValues = new KeyValuePair <string, string>[] { new KeyValuePair <string, string>(AppStrings.Title_WB_Auto, "auto"), new KeyValuePair <string, string>(AppStrings.Title_WB_DayLight, "daylight"), new KeyValuePair <string, string>(AppStrings.Title_WB_Shade, "shade"), new KeyValuePair <string, string>(AppStrings.Title_WB_Cloudy, "cloudy-daylight"), new KeyValuePair <string, string>(AppStrings.Title_WB_Incandescent, "incandescent"), new KeyValuePair <string, string>(AppStrings.Title_WB_WarmWhite, "_warmWhiteFluorescent"), new KeyValuePair <string, string>(AppStrings.Title_WB_DayLightFluorescent, "_dayLightFluorescent"), new KeyValuePair <string, string>(AppStrings.Title_WB_WhiteFluorescent, "_dayWhiteFluorescent"), new KeyValuePair <string, string>(AppStrings.Title_WB_Fluorescent, "fluorescent"), new KeyValuePair <string, string>(AppStrings.Title_WB_BulbFluorescent, "_bulbFluorescent"), new KeyValuePair <string, string>(AppStrings.Title_WB_ColorTemperature, "_colorTemperature"), }; cmbWhiteBalance.ItemsSource = WbValues; for (int i = 0; i < WbValues.Length; i++) { if (WbValues[i].Value == options.WhiteBalance) { cmbWhiteBalance.SelectedIndex = i; break; } } #endregion #region Color Temperature sliderColorTemperature.Value = options.ColorTemperature; #endregion #region Exposure program List <KeyValuePair <string, EXPOSURE_PROGRAM> > programValues = new List <KeyValuePair <string, EXPOSURE_PROGRAM> >(); programValues.Add(new KeyValuePair <string, EXPOSURE_PROGRAM>(AppStrings.Title_ExposureManual, EXPOSURE_PROGRAM.MANUAL)); programValues.Add(new KeyValuePair <string, EXPOSURE_PROGRAM>(AppStrings.Title_ExposureNormal, EXPOSURE_PROGRAM.NORMAL)); if (CommonCameraInfo.Instance.Info.ThetaModel >= THETA_MODEL.Z1) { programValues.Add(new KeyValuePair <string, EXPOSURE_PROGRAM>(AppStrings.Title_ExposureAperture, EXPOSURE_PROGRAM.APERTURE)); } programValues.Add(new KeyValuePair <string, EXPOSURE_PROGRAM>(AppStrings.Title_ExposureShutter, EXPOSURE_PROGRAM.SHUTTER)); programValues.Add(new KeyValuePair <string, EXPOSURE_PROGRAM>(AppStrings.Title_ExposureISO, EXPOSURE_PROGRAM.ISO)); cmbExposureProgram.ItemsSource = programValues; for (int i = 0; i < programValues.Count; i++) { if ((int)programValues[i].Value == options.ExposureProgram) { cmbExposureProgram.SelectedIndex = i; break; } } #endregion #region Aperture KeyValuePair <string, float>[] apertureValues = null; if (CommonCameraInfo.Instance.Info.ThetaModel >= THETA_MODEL.Z1) { apertureValues = new KeyValuePair <string, float>[] { new KeyValuePair <string, float>("2.1", 2.1f), new KeyValuePair <string, float>("3.5", 3.5f), new KeyValuePair <string, float>("5.6", 5.6f), }; } else { apertureValues = new KeyValuePair <string, float>[] { new KeyValuePair <string, float>("2.0", 2.0f) }; } cmbAperture.ItemsSource = apertureValues; for (int i = 0; i < apertureValues.Length; i++) { if (apertureValues[i].Value == options.Aperture) { cmbAperture.SelectedIndex = i; break; } } #endregion #region ShutterSpeed level List <KeyValuePair <string, float> > speedValues = new List <KeyValuePair <string, float> >(); if (CommonCameraInfo.Instance.Info.ThetaModel >= THETA_MODEL.V) { speedValues.Add(new KeyValuePair <string, float>("1/25000", 0.00004f)); speedValues.Add(new KeyValuePair <string, float>("1/20000", 0.00005f)); speedValues.Add(new KeyValuePair <string, float>("1/16000", 0.0000625f)); speedValues.Add(new KeyValuePair <string, float>("1/12500", 0.00008f)); speedValues.Add(new KeyValuePair <string, float>("1/10000", 0.00001f)); } if (CommonCameraInfo.Instance.Info.ThetaModel >= THETA_MODEL.SC) { speedValues.Add(new KeyValuePair <string, float>("1/8000", 0.000125f)); } speedValues.Add(new KeyValuePair <string, float>("1/6400", 0.00015625f)); speedValues.Add(new KeyValuePair <string, float>("1/5000", 0.0002f)); speedValues.Add(new KeyValuePair <string, float>("1/4000", 0.00025f)); speedValues.Add(new KeyValuePair <string, float>("1/3200", 0.0003125f)); speedValues.Add(new KeyValuePair <string, float>("1/2500", 0.0004f)); speedValues.Add(new KeyValuePair <string, float>("1/2000", 0.0005f)); speedValues.Add(new KeyValuePair <string, float>("1/1600", 0.000625f)); speedValues.Add(new KeyValuePair <string, float>("1/1250", 0.0008f)); speedValues.Add(new KeyValuePair <string, float>("1/1000", 0.001f)); speedValues.Add(new KeyValuePair <string, float>("1/800", 0.00125f)); speedValues.Add(new KeyValuePair <string, float>("1/640", 0.0015625f)); speedValues.Add(new KeyValuePair <string, float>("1/500", 0.002f)); speedValues.Add(new KeyValuePair <string, float>("1/400", 0.0025f)); speedValues.Add(new KeyValuePair <string, float>("1/320", 0.003125f)); speedValues.Add(new KeyValuePair <string, float>("1/250", 0.004f)); speedValues.Add(new KeyValuePair <string, float>("1/200", 0.005f)); speedValues.Add(new KeyValuePair <string, float>("1/160", 0.00625f)); speedValues.Add(new KeyValuePair <string, float>("1/125", 0.008f)); speedValues.Add(new KeyValuePair <string, float>("1/100", 0.01f)); speedValues.Add(new KeyValuePair <string, float>("1/80", 0.0125f)); speedValues.Add(new KeyValuePair <string, float>("1/60", 0.01666666f)); speedValues.Add(new KeyValuePair <string, float>("1/50", 0.02f)); speedValues.Add(new KeyValuePair <string, float>("1/40", 0.025f)); speedValues.Add(new KeyValuePair <string, float>("1/30", 0.03333333f)); speedValues.Add(new KeyValuePair <string, float>("1/25", 0.04f)); speedValues.Add(new KeyValuePair <string, float>("1/20", 0.05f)); speedValues.Add(new KeyValuePair <string, float>("1/15", 0.06666666f)); speedValues.Add(new KeyValuePair <string, float>("1/13", 0.07692307f)); speedValues.Add(new KeyValuePair <string, float>("1/10", 0.1f)); speedValues.Add(new KeyValuePair <string, float>("1/8", 0.125f)); speedValues.Add(new KeyValuePair <string, float>("1/6", 0.16666666f)); speedValues.Add(new KeyValuePair <string, float>("1/5", 0.2f)); speedValues.Add(new KeyValuePair <string, float>("1/4", 0.25f)); speedValues.Add(new KeyValuePair <string, float>("1/3", 0.33333333f)); speedValues.Add(new KeyValuePair <string, float>("1/2.5", 0.4f)); speedValues.Add(new KeyValuePair <string, float>("1/2", 0.5f)); speedValues.Add(new KeyValuePair <string, float>("1/1.6", 0.625f)); speedValues.Add(new KeyValuePair <string, float>("1", 1f)); speedValues.Add(new KeyValuePair <string, float>("1.3", 1.3f)); speedValues.Add(new KeyValuePair <string, float>("1.6", 1.6f)); speedValues.Add(new KeyValuePair <string, float>("2", 2f)); speedValues.Add(new KeyValuePair <string, float>("2.5", 2.5f)); speedValues.Add(new KeyValuePair <string, float>("3.2", 3.2f)); speedValues.Add(new KeyValuePair <string, float>("4", 4f)); speedValues.Add(new KeyValuePair <string, float>("5", 5f)); speedValues.Add(new KeyValuePair <string, float>("6", 6f)); speedValues.Add(new KeyValuePair <string, float>("8", 8f)); speedValues.Add(new KeyValuePair <string, float>("10", 10f)); speedValues.Add(new KeyValuePair <string, float>("13", 13f)); speedValues.Add(new KeyValuePair <string, float>("15", 15f)); speedValues.Add(new KeyValuePair <string, float>("20", 20f)); speedValues.Add(new KeyValuePair <string, float>("25", 25f)); speedValues.Add(new KeyValuePair <string, float>("30", 30f)); speedValues.Add(new KeyValuePair <string, float>("60", 60f)); cmbSpeed.ItemsSource = speedValues; for (int i = 0; i < speedValues.Count; i++) { if (speedValues[i].Value == options.ShutterSpeed) { cmbSpeed.SelectedIndex = i; break; } } #endregion #region ISO List <int> isoValues = new List <int>(new int[] { 100, 125, 160, 200, 250, 320, 400, 500, 640, 800, 1000, 1250, 1600 }); if (CommonCameraInfo.Instance.Info.ThetaModel >= THETA_MODEL.V) { isoValues.Insert(0, 80); isoValues.AddRange(new int[] { 2000, 2500, 3200, 4000, 5000 }); } if (CommonCameraInfo.Instance.Info.ThetaModel == THETA_MODEL.V) { isoValues.Insert(0, 64); isoValues.Add(6000); } if (CommonCameraInfo.Instance.Info.ThetaModel >= THETA_MODEL.Z1) { isoValues.Add(6400); } cmbIso.ItemsSource = isoValues; for (int i = 0; i < isoValues.Count; i++) { if (isoValues[i] == options.ISO) { cmbIso.SelectedIndex = i; break; } } #endregion _isInitialized = true; }