Ejemplo n.º 1
0
 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;
         }
     };
 }
Ejemplo n.º 2
0
 public ControlPanelManager(StackPanel panel)
 {
     this.manager = CameraManager.GetInstance();
     this.status = manager.cameraStatus;
     this.data = new ControlPanelViewData(status);
     this.panel = panel;
     manager.MethodTypesUpdateNotifer += () => { Initialize(); };
 }
Ejemplo n.º 3
0
 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);
 }
Ejemplo n.º 4
0
 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);
 }
Ejemplo n.º 5
0
 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);
 }
Ejemplo n.º 6
0
        internal static bool IsCameraStatusModified(CameraStatus status, string latest)
        {
            if (latest == null)
            {
                return false;
            }
            var previous = status.Status;
            status.Status = latest;

            return previous != latest;
        }
Ejemplo n.º 7
0
 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;
 }
Ejemplo n.º 8
0
 /// <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);
 }
Ejemplo n.º 9
0
 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;
         }
     };
 }
Ejemplo n.º 10
0
 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;
 }
Ejemplo n.º 11
0
        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)
            {

            }
        }
Ejemplo n.º 12
0
 private void Deactivate()
 {
     Debug.WriteLine("EventObserver deactivated");
     status = null;
     OnStop = null;
     OnDetectDifference = null;
     worker.DoWork -= AnalyzeEventData;
 }
Ejemplo n.º 13
0
 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);
 }
Ejemplo n.º 14
0
        internal static bool IsLiveviewAvailableModified(CameraStatus status, bool latest)
        {
            var previous = status.IsLiveviewAvailable;
            status.IsLiveviewAvailable = latest;

            return previous != latest;
        }
Ejemplo n.º 15
0
 internal static bool IsProgramShiftModified(CameraStatus status, bool? latest)
 {
     if (latest == null)
     {
         return false;
     }
     var previous = status.ProgramShiftActivated;
     status.ProgramShiftActivated = (bool)latest;
     return previous != latest;
 }
Ejemplo n.º 16
0
 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);
 }
Ejemplo n.º 17
0
 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);
     }
 }
Ejemplo n.º 18
0
 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);
 }
Ejemplo n.º 19
0
        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;
        }