public ControlPanelViewData(CameraStatus status) { this.status = status; status.PropertyChanged += (sender, e) => { switch (e.PropertyName) { case "AvailableApis": OnPropertyChanged("CpIsAvailableSelfTimer"); OnPropertyChanged("CpIsAvailableShootMode"); OnPropertyChanged("CpIsAvailablePostviewSize"); break; case "PostviewSizeInfo": OnPropertyChanged("CpCandidatesPostviewSize"); OnPropertyChanged("CpSelectedIndexPostviewSize"); break; case "SelfTimerInfo": OnPropertyChanged("CpCandidatesSelfTimer"); OnPropertyChanged("CpSelectedIndexSelfTimer"); break; case "ShootModeInfo": OnPropertyChanged("CpCandidatesShootMode"); OnPropertyChanged("CpSelectedIndexShootMode"); break; } }; }
public ControlPanelManager(StackPanel panel) { this.manager = CameraManager.GetInstance(); this.status = manager.cameraStatus; this.data = new ControlPanelViewData(status); this.panel = panel; manager.MethodTypesUpdateNotifer += () => { Initialize(); }; }
internal static bool IsExposureModeInfoModified(CameraStatus status, BasicInfo<string> latest) { if (latest == null) { return false; } var previous = status.ExposureMode; status.ExposureMode = latest; return IsModified(previous, latest); }
internal static bool IsFNumberModified(CameraStatus status, BasicInfo<string> latest) { if (latest == null) { return false; } var previous = status.FNumber; status.FNumber = latest; return IsModified(previous, latest); }
internal static bool IsISOModified(CameraStatus status, BasicInfo<string> latest) { if (latest == null) { return false; } var previous = status.ISOSpeedRate; status.ISOSpeedRate = latest; return IsModified(previous, latest); }
internal static bool IsCameraStatusModified(CameraStatus status, string latest) { if (latest == null) { return false; } var previous = status.Status; status.Status = latest; return previous != latest; }
internal static bool IsEvInfoModified(CameraStatus status, EvInfo latest) { if (latest == null) { return false; } var previous = status.EvInfo; status.EvInfo = latest; return previous == null || previous.CurrentIndex != latest.CurrentIndex || previous.MaxIndex != latest.MaxIndex || previous.MinIndex != latest.MinIndex || previous.StepDefinition != latest.StepDefinition; }
/// <summary> /// /// </summary> /// <param name="status">Status object to update</param> /// <param name="OnDetectDifference">Called when the parameter has been changed</param> /// <param name="OnStop">Called when event observation is finished with error</param> /// public void Start(CameraStatus status, Action<EventMember> OnDetectDifference, Action OnStop) { Debug.WriteLine("EventObserver.Start"); if (status == null | OnDetectDifference == null || OnStop == null) { throw new ArgumentNullException(); } status.InitEventParams(); this.status = status; this.OnDetectDifference = OnDetectDifference; this.OnStop = OnStop; failure_count = RETRY_LIMIT; worker.DoWork += AnalyzeEventData; client.GetEvent(false, OnError, OnSuccess); }
public ShootingViewData(AppStatus aStatus, CameraStatus cStatus) { this.appStatus = aStatus; appStatus.PropertyChanged += (sender, e) => { switch (e.PropertyName) { case "IsTryingToConnectLiveview": OnPropertyChanged("ShootingProgressVisibility"); break; case "IsSearchingDevice": OnPropertyChanged("ShootingProgressVisibility"); break; case "IsTakingPicture": OnPropertyChanged("ShootingProgressVisibility"); OnPropertyChanged("ShootButtonStatus"); break; case "IsIntervalShootingActivated": OnPropertyChanged("ShootButtonImage"); OnPropertyChanged("ShootButtonStatus"); break; } }; this.cameraStatus = cStatus; cStatus.PropertyChanged += (sender, e) => { switch (e.PropertyName) { case "MethodTypes": OnPropertyChanged("ShootFunctionVisibility"); OnPropertyChanged("ZoomElementVisibility"); break; case "Status": OnPropertyChanged("ShootButtonImage"); OnPropertyChanged("ShootButtonStatus"); break; case "ShootModeInfo": OnPropertyChanged("ShootButtonImage"); break; } }; }
internal static bool IsAvailableApisModified(CameraStatus status, string[] latest) { if (latest == null) { return false; } var previous = status.AvailableApis; status.AvailableApis = latest; if (previous == null || previous.Length != latest.Length) { return true; } foreach (var api in latest) { if (!previous.Contains(api)) { return true; } } return false; }
internal void WifiUpdateListener(CameraStatus cameraStatus) { Debug.WriteLine("WifiUpdateLIstener called"); if (cameraStatus.isAvailableConnecting) { String modelName = ""; if (cameraManager.DeviceInfo != null && cameraManager.DeviceInfo.FriendlyName != null) { modelName = cameraManager.DeviceInfo.FriendlyName; } NetworkStatus.Text = "Connected device: " + modelName; GuideMessage.Visibility = System.Windows.Visibility.Visible; } if (cameraStatus.isAvailableConnecting && cameraStatus.MethodTypes != null) { } }
private void Deactivate() { Debug.WriteLine("EventObserver deactivated"); status = null; OnStop = null; OnDetectDifference = null; worker.DoWork -= AnalyzeEventData; }
internal static bool IsPostviewSizeInfoModified(CameraStatus status, BasicInfo<string> latest) { if (latest == null) { return false; } var previous = status.PostviewSizeInfo; status.PostviewSizeInfo = latest; return IsModified(previous, latest); }
internal static bool IsLiveviewAvailableModified(CameraStatus status, bool latest) { var previous = status.IsLiveviewAvailable; status.IsLiveviewAvailable = latest; return previous != latest; }
internal static bool IsProgramShiftModified(CameraStatus status, bool? latest) { if (latest == null) { return false; } var previous = status.ProgramShiftActivated; status.ProgramShiftActivated = (bool)latest; return previous != latest; }
internal static bool IsSelftimerInfoModified(CameraStatus status, BasicInfo<int> latest) { if (latest == null) { return false; } var previous = status.SelfTimerInfo; status.SelfTimerInfo = latest; return IsModified(previous, latest); }
internal void LiveViewUpdateListener(CameraStatus cameraStatus) { if (cameraStatus.ZoomInfo != null) { // dumpZoomInfo(cameraStatus.ZoomInfo); double margin_left = cameraStatus.ZoomInfo.position * 156 / 100; ZoomCursor.Margin = new Thickness(15 + margin_left, 2, 0, 0); Debug.WriteLine("zoom bar display update: " + margin_left); } }
internal static bool IsShutterSpeedModified(CameraStatus status, BasicInfo<string> latest) { if (latest == null) { return false; } var previous = status.ShutterSpeed; status.ShutterSpeed = latest; return IsModified(previous, latest); }
internal static bool IsZoomInfoModified(CameraStatus status, ZoomInfo latest) { if (latest == null) { return false; } var previous = status.ZoomInfo; status.ZoomInfo = latest; return previous == null || previous.current_box_index != latest.current_box_index || previous.number_of_boxes != latest.number_of_boxes || previous.position != latest.position || previous.position_in_current_box != latest.position_in_current_box; }