From ec8858d649f768cd213483801235f84a6d72dbe6 Mon Sep 17 00:00:00 2001 From: Rambalac Date: Sat, 29 Apr 2017 00:32:52 +0900 Subject: [PATCH] Added Battery indicator for #15 --- Core/Camera/LumixData/CameraState.cs | 6 ++-- GMaster.sln | 2 +- GMaster/GMaster.csproj | 1 + GMaster/Views/CameraViewControl.xaml | 11 +++++-- GMaster/Views/CameraViewControlResources.xaml | 3 +- .../Converters/BatteryToIconConverter.cs | 12 ++++++++ GMaster/Views/Models/CameraViewModel.cs | 30 +++++++++++++++++-- 7 files changed, 55 insertions(+), 10 deletions(-) create mode 100644 GMaster/Views/Converters/BatteryToIconConverter.cs diff --git a/Core/Camera/LumixData/CameraState.cs b/Core/Camera/LumixData/CameraState.cs index fa85e2d..23a01e4 100644 --- a/Core/Camera/LumixData/CameraState.cs +++ b/Core/Camera/LumixData/CameraState.cs @@ -9,7 +9,7 @@ public class CameraState public OnOff AddLocationData { get; set; } [XmlElement(ElementName = "batt")] - public string Batt { get; set; } + public string Battery { get; set; } [XmlElement(ElementName = "burst_interval_status")] public string BurstIntervalStatus { get; set; } @@ -92,7 +92,7 @@ public override int GetHashCode() { unchecked { - var hashCode = Batt?.GetHashCode() ?? 0; + var hashCode = Battery?.GetHashCode() ?? 0; hashCode = (hashCode * 397) ^ (Cammode?.GetHashCode() ?? 0); hashCode = (hashCode * 397) ^ Remaincapacity; hashCode = (hashCode * 397) ^ (Sdcardstatus?.GetHashCode() ?? 0); @@ -119,7 +119,7 @@ public override int GetHashCode() protected bool Equals(CameraState other) { - return string.Equals(Batt, other.Batt) && + return string.Equals(Battery, other.Battery) && string.Equals(Cammode, other.Cammode) && Remaincapacity == other.Remaincapacity && string.Equals(Sdcardstatus, other.Sdcardstatus) && diff --git a/GMaster.sln b/GMaster.sln index 83f0c68..edea0f0 100644 --- a/GMaster.sln +++ b/GMaster.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.26403.3 +VisualStudioVersion = 15.0.26403.7 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GMaster", "GMaster\GMaster.csproj", "{F361EA15-EF81-4B2D-9D9B-B32B4D174934}" EndProject diff --git a/GMaster/GMaster.csproj b/GMaster/GMaster.csproj index 5f54403..665f32e 100644 --- a/GMaster/GMaster.csproj +++ b/GMaster/GMaster.csproj @@ -111,6 +111,7 @@ + diff --git a/GMaster/Views/CameraViewControl.xaml b/GMaster/Views/CameraViewControl.xaml index dda193d..2b21cbe 100644 --- a/GMaster/Views/CameraViewControl.xaml +++ b/GMaster/Views/CameraViewControl.xaml @@ -83,7 +83,14 @@ - + + + + + + + +