From de156812e885d0206fb68da0bb30d9d75d013c9b Mon Sep 17 00:00:00 2001 From: Valeriy Mironov Date: Tue, 21 Nov 2017 23:16:36 +0200 Subject: [PATCH] Added extracting all data, renamed project --- Amazfit.sln | 61 +++++++++ Amazfit.sln.DotSettings | 12 ++ AmazfitWFReader.sln | 79 ------------ AmazfitWFReader.sln.DotSettings | 3 - Cmd/App.config | 26 ---- Cmd/Program.cs | 56 --------- UI/App.xaml | 9 -- UI/App.xaml.cs | 17 --- UI/MainWindow.xaml | 24 ---- UI/MainWindow.xaml.cs | 28 ----- UI/Properties/AssemblyInfo.cs | 55 -------- UI/Properties/Resources.Designer.cs | 71 ----------- UI/Properties/Resources.resx | 117 ------------------ UI/Properties/Settings.Designer.cs | 30 ----- UI/Properties/Settings.settings | 7 -- UI/UI.csproj | 103 --------------- {UI => WatchFace.Cmd}/App.config | 0 WatchFace.Cmd/Program.cs | 91 ++++++++++++++ .../Properties/AssemblyInfo.cs | 6 +- .../WatchFace.Cmd.csproj | 73 ++++++++++- {Cmd => WatchFace.Cmd}/packages.config | 2 +- WatchFace/Elements/BasicElements/ClockHand.cs | 5 + WatchFace/Elements/BasicElements/Image.cs | 2 +- WatchFace/Elements/BasicElements/ImageSet.cs | 4 +- WatchFace/Elements/BasicElements/Number.cs | 9 +- WatchFace/Elements/Status.cs | 4 +- WatchFace/Elements/StatusElements/Flag.cs | 4 +- WatchFace/Elements/StatusElements/Switch.cs | 2 +- WatchFace/Elements/Time.cs | 2 +- .../JsonConverters/HexStringJsonConverter.cs | 27 ++++ WatchFace/WatchFace.csproj | 11 +- 31 files changed, 287 insertions(+), 653 deletions(-) create mode 100644 Amazfit.sln create mode 100644 Amazfit.sln.DotSettings delete mode 100644 AmazfitWFReader.sln delete mode 100644 AmazfitWFReader.sln.DotSettings delete mode 100644 Cmd/App.config delete mode 100644 Cmd/Program.cs delete mode 100644 UI/App.xaml delete mode 100644 UI/App.xaml.cs delete mode 100644 UI/MainWindow.xaml delete mode 100644 UI/MainWindow.xaml.cs delete mode 100644 UI/Properties/AssemblyInfo.cs delete mode 100644 UI/Properties/Resources.Designer.cs delete mode 100644 UI/Properties/Resources.resx delete mode 100644 UI/Properties/Settings.Designer.cs delete mode 100644 UI/Properties/Settings.settings delete mode 100644 UI/UI.csproj rename {UI => WatchFace.Cmd}/App.config (100%) create mode 100644 WatchFace.Cmd/Program.cs rename {Cmd => WatchFace.Cmd}/Properties/AssemblyInfo.cs (89%) rename Cmd/Cmd.csproj => WatchFace.Cmd/WatchFace.Cmd.csproj (52%) rename {Cmd => WatchFace.Cmd}/packages.config (97%) create mode 100644 WatchFace/JsonConverters/HexStringJsonConverter.cs diff --git a/Amazfit.sln b/Amazfit.sln new file mode 100644 index 0000000..c73ef76 --- /dev/null +++ b/Amazfit.sln @@ -0,0 +1,61 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.27004.2009 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchFace", "WatchFace\WatchFace.csproj", "{8D2E0224-DE7F-4EC9-AD23-9904B9D7B409}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchFace.Cmd", "WatchFace.Cmd\WatchFace.Cmd.csproj", "{963BCF47-8C24-4219-BC84-8EC3670205B3}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|ARM = Debug|ARM + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|ARM = Release|ARM + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {8D2E0224-DE7F-4EC9-AD23-9904B9D7B409}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8D2E0224-DE7F-4EC9-AD23-9904B9D7B409}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8D2E0224-DE7F-4EC9-AD23-9904B9D7B409}.Debug|ARM.ActiveCfg = Debug|Any CPU + {8D2E0224-DE7F-4EC9-AD23-9904B9D7B409}.Debug|ARM.Build.0 = Debug|Any CPU + {8D2E0224-DE7F-4EC9-AD23-9904B9D7B409}.Debug|x64.ActiveCfg = Debug|Any CPU + {8D2E0224-DE7F-4EC9-AD23-9904B9D7B409}.Debug|x64.Build.0 = Debug|Any CPU + {8D2E0224-DE7F-4EC9-AD23-9904B9D7B409}.Debug|x86.ActiveCfg = Debug|Any CPU + {8D2E0224-DE7F-4EC9-AD23-9904B9D7B409}.Debug|x86.Build.0 = Debug|Any CPU + {8D2E0224-DE7F-4EC9-AD23-9904B9D7B409}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8D2E0224-DE7F-4EC9-AD23-9904B9D7B409}.Release|Any CPU.Build.0 = Release|Any CPU + {8D2E0224-DE7F-4EC9-AD23-9904B9D7B409}.Release|ARM.ActiveCfg = Release|Any CPU + {8D2E0224-DE7F-4EC9-AD23-9904B9D7B409}.Release|ARM.Build.0 = Release|Any CPU + {8D2E0224-DE7F-4EC9-AD23-9904B9D7B409}.Release|x64.ActiveCfg = Release|Any CPU + {8D2E0224-DE7F-4EC9-AD23-9904B9D7B409}.Release|x64.Build.0 = Release|Any CPU + {8D2E0224-DE7F-4EC9-AD23-9904B9D7B409}.Release|x86.ActiveCfg = Release|Any CPU + {8D2E0224-DE7F-4EC9-AD23-9904B9D7B409}.Release|x86.Build.0 = Release|Any CPU + {963BCF47-8C24-4219-BC84-8EC3670205B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {963BCF47-8C24-4219-BC84-8EC3670205B3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {963BCF47-8C24-4219-BC84-8EC3670205B3}.Debug|ARM.ActiveCfg = Debug|Any CPU + {963BCF47-8C24-4219-BC84-8EC3670205B3}.Debug|ARM.Build.0 = Debug|Any CPU + {963BCF47-8C24-4219-BC84-8EC3670205B3}.Debug|x64.ActiveCfg = Debug|Any CPU + {963BCF47-8C24-4219-BC84-8EC3670205B3}.Debug|x64.Build.0 = Debug|Any CPU + {963BCF47-8C24-4219-BC84-8EC3670205B3}.Debug|x86.ActiveCfg = Debug|Any CPU + {963BCF47-8C24-4219-BC84-8EC3670205B3}.Debug|x86.Build.0 = Debug|Any CPU + {963BCF47-8C24-4219-BC84-8EC3670205B3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {963BCF47-8C24-4219-BC84-8EC3670205B3}.Release|Any CPU.Build.0 = Release|Any CPU + {963BCF47-8C24-4219-BC84-8EC3670205B3}.Release|ARM.ActiveCfg = Release|Any CPU + {963BCF47-8C24-4219-BC84-8EC3670205B3}.Release|ARM.Build.0 = Release|Any CPU + {963BCF47-8C24-4219-BC84-8EC3670205B3}.Release|x64.ActiveCfg = Release|Any CPU + {963BCF47-8C24-4219-BC84-8EC3670205B3}.Release|x64.Build.0 = Release|Any CPU + {963BCF47-8C24-4219-BC84-8EC3670205B3}.Release|x86.ActiveCfg = Release|Any CPU + {963BCF47-8C24-4219-BC84-8EC3670205B3}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {76A7037C-575A-4EA5-A894-D47C03F8D3ED} + EndGlobalSection +EndGlobal diff --git a/Amazfit.sln.DotSettings b/Amazfit.sln.DotSettings new file mode 100644 index 0000000..595f792 --- /dev/null +++ b/Amazfit.sln.DotSettings @@ -0,0 +1,12 @@ + + TOGETHER_SAME_LINE + False + NEVER + C:\Users\valeronm\AppData\Local\JetBrains\Transient\ReSharperPlatformVs15\v11_048a238b\SolutionCaches + True + True + True + True + True + True + True \ No newline at end of file diff --git a/AmazfitWFReader.sln b/AmazfitWFReader.sln deleted file mode 100644 index bfce891..0000000 --- a/AmazfitWFReader.sln +++ /dev/null @@ -1,79 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27004.2009 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UI", "UI\UI.csproj", "{B05BAE0A-2C09-4910-924D-CA3DA0FA1CFD}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatchFace", "WatchFace\WatchFace.csproj", "{8D2E0224-DE7F-4EC9-AD23-9904B9D7B409}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cmd", "Cmd\Cmd.csproj", "{A599B50E-754E-4C8F-A078-867B26E3DD09}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|ARM = Debug|ARM - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|ARM = Release|ARM - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {B05BAE0A-2C09-4910-924D-CA3DA0FA1CFD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B05BAE0A-2C09-4910-924D-CA3DA0FA1CFD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B05BAE0A-2C09-4910-924D-CA3DA0FA1CFD}.Debug|ARM.ActiveCfg = Debug|Any CPU - {B05BAE0A-2C09-4910-924D-CA3DA0FA1CFD}.Debug|ARM.Build.0 = Debug|Any CPU - {B05BAE0A-2C09-4910-924D-CA3DA0FA1CFD}.Debug|x64.ActiveCfg = Debug|Any CPU - {B05BAE0A-2C09-4910-924D-CA3DA0FA1CFD}.Debug|x64.Build.0 = Debug|Any CPU - {B05BAE0A-2C09-4910-924D-CA3DA0FA1CFD}.Debug|x86.ActiveCfg = Debug|Any CPU - {B05BAE0A-2C09-4910-924D-CA3DA0FA1CFD}.Debug|x86.Build.0 = Debug|Any CPU - {B05BAE0A-2C09-4910-924D-CA3DA0FA1CFD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B05BAE0A-2C09-4910-924D-CA3DA0FA1CFD}.Release|Any CPU.Build.0 = Release|Any CPU - {B05BAE0A-2C09-4910-924D-CA3DA0FA1CFD}.Release|ARM.ActiveCfg = Release|Any CPU - {B05BAE0A-2C09-4910-924D-CA3DA0FA1CFD}.Release|ARM.Build.0 = Release|Any CPU - {B05BAE0A-2C09-4910-924D-CA3DA0FA1CFD}.Release|x64.ActiveCfg = Release|Any CPU - {B05BAE0A-2C09-4910-924D-CA3DA0FA1CFD}.Release|x64.Build.0 = Release|Any CPU - {B05BAE0A-2C09-4910-924D-CA3DA0FA1CFD}.Release|x86.ActiveCfg = Release|Any CPU - {B05BAE0A-2C09-4910-924D-CA3DA0FA1CFD}.Release|x86.Build.0 = Release|Any CPU - {8D2E0224-DE7F-4EC9-AD23-9904B9D7B409}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8D2E0224-DE7F-4EC9-AD23-9904B9D7B409}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8D2E0224-DE7F-4EC9-AD23-9904B9D7B409}.Debug|ARM.ActiveCfg = Debug|Any CPU - {8D2E0224-DE7F-4EC9-AD23-9904B9D7B409}.Debug|ARM.Build.0 = Debug|Any CPU - {8D2E0224-DE7F-4EC9-AD23-9904B9D7B409}.Debug|x64.ActiveCfg = Debug|Any CPU - {8D2E0224-DE7F-4EC9-AD23-9904B9D7B409}.Debug|x64.Build.0 = Debug|Any CPU - {8D2E0224-DE7F-4EC9-AD23-9904B9D7B409}.Debug|x86.ActiveCfg = Debug|Any CPU - {8D2E0224-DE7F-4EC9-AD23-9904B9D7B409}.Debug|x86.Build.0 = Debug|Any CPU - {8D2E0224-DE7F-4EC9-AD23-9904B9D7B409}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8D2E0224-DE7F-4EC9-AD23-9904B9D7B409}.Release|Any CPU.Build.0 = Release|Any CPU - {8D2E0224-DE7F-4EC9-AD23-9904B9D7B409}.Release|ARM.ActiveCfg = Release|Any CPU - {8D2E0224-DE7F-4EC9-AD23-9904B9D7B409}.Release|ARM.Build.0 = Release|Any CPU - {8D2E0224-DE7F-4EC9-AD23-9904B9D7B409}.Release|x64.ActiveCfg = Release|Any CPU - {8D2E0224-DE7F-4EC9-AD23-9904B9D7B409}.Release|x64.Build.0 = Release|Any CPU - {8D2E0224-DE7F-4EC9-AD23-9904B9D7B409}.Release|x86.ActiveCfg = Release|Any CPU - {8D2E0224-DE7F-4EC9-AD23-9904B9D7B409}.Release|x86.Build.0 = Release|Any CPU - {A599B50E-754E-4C8F-A078-867B26E3DD09}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A599B50E-754E-4C8F-A078-867B26E3DD09}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A599B50E-754E-4C8F-A078-867B26E3DD09}.Debug|ARM.ActiveCfg = Debug|Any CPU - {A599B50E-754E-4C8F-A078-867B26E3DD09}.Debug|ARM.Build.0 = Debug|Any CPU - {A599B50E-754E-4C8F-A078-867B26E3DD09}.Debug|x64.ActiveCfg = Debug|Any CPU - {A599B50E-754E-4C8F-A078-867B26E3DD09}.Debug|x64.Build.0 = Debug|Any CPU - {A599B50E-754E-4C8F-A078-867B26E3DD09}.Debug|x86.ActiveCfg = Debug|Any CPU - {A599B50E-754E-4C8F-A078-867B26E3DD09}.Debug|x86.Build.0 = Debug|Any CPU - {A599B50E-754E-4C8F-A078-867B26E3DD09}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A599B50E-754E-4C8F-A078-867B26E3DD09}.Release|Any CPU.Build.0 = Release|Any CPU - {A599B50E-754E-4C8F-A078-867B26E3DD09}.Release|ARM.ActiveCfg = Release|Any CPU - {A599B50E-754E-4C8F-A078-867B26E3DD09}.Release|ARM.Build.0 = Release|Any CPU - {A599B50E-754E-4C8F-A078-867B26E3DD09}.Release|x64.ActiveCfg = Release|Any CPU - {A599B50E-754E-4C8F-A078-867B26E3DD09}.Release|x64.Build.0 = Release|Any CPU - {A599B50E-754E-4C8F-A078-867B26E3DD09}.Release|x86.ActiveCfg = Release|Any CPU - {A599B50E-754E-4C8F-A078-867B26E3DD09}.Release|x86.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {76A7037C-575A-4EA5-A894-D47C03F8D3ED} - EndGlobalSection -EndGlobal diff --git a/AmazfitWFReader.sln.DotSettings b/AmazfitWFReader.sln.DotSettings deleted file mode 100644 index 4742e85..0000000 --- a/AmazfitWFReader.sln.DotSettings +++ /dev/null @@ -1,3 +0,0 @@ - - TOGETHER_SAME_LINE - C:\Users\valeronm\AppData\Local\JetBrains\Transient\ReSharperPlatformVs15\v11_048a238b\SolutionCaches \ No newline at end of file diff --git a/Cmd/App.config b/Cmd/App.config deleted file mode 100644 index e15b3f8..0000000 --- a/Cmd/App.config +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Cmd/Program.cs b/Cmd/Program.cs deleted file mode 100644 index c335373..0000000 --- a/Cmd/Program.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System; -using System.IO; -using SixLabors.ImageSharp; -using WatchFace; -using WatchFace.Models; - -namespace Cmd -{ - internal class Program - { - private static void Main(string[] args) - { - var fileName = args[0]; - Reader reader; - Console.WriteLine("Opening watch face: {0}", fileName); - using (var fileStream = File.OpenRead(fileName)) - { - reader = new Reader(fileStream); - reader.Parse(); - } - - foreach (var resource in reader.Resources) - { - Console.WriteLine("{0:D}: ", resource.Id); - foreach (var descriptor in resource.Children) WriteParameter(4, descriptor); - } - - var watchFace = WatchFace.WatchFace.Parse(reader.Resources); - - var index = 0; - foreach (var image in reader.Images) - { - image.Save($"{index}.bmp"); - index++; - } - - Console.ReadKey(); - } - - private static void WriteParameter(int offset, Parameter parameter) - { - for (var i = 0; i < offset; i++) - Console.Write(' '); - Console.Write("{0:D}: ", parameter.Id); - if (parameter.IsComplex) - { - Console.WriteLine(); - foreach (var parameter1 in parameter.Children) WriteParameter(offset + 4, parameter1); - } - else - { - Console.WriteLine("{0:D} (0x{0:x})", parameter.Value); - } - } - } -} \ No newline at end of file diff --git a/UI/App.xaml b/UI/App.xaml deleted file mode 100644 index db385e4..0000000 --- a/UI/App.xaml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - diff --git a/UI/App.xaml.cs b/UI/App.xaml.cs deleted file mode 100644 index 61f8a46..0000000 --- a/UI/App.xaml.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Configuration; -using System.Data; -using System.Linq; -using System.Threading.Tasks; -using System.Windows; - -namespace UI -{ - /// - /// Interaction logic for App.xaml - /// - public partial class App : Application - { - } -} diff --git a/UI/MainWindow.xaml b/UI/MainWindow.xaml deleted file mode 100644 index 9d794c3..0000000 --- a/UI/MainWindow.xaml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - -