From aab3472036c8217a8a2e6f4c9011b7578c676361 Mon Sep 17 00:00:00 2001 From: Vit Nemecky Date: Thu, 26 Dec 2024 20:44:11 +0100 Subject: [PATCH 1/4] Settings page for a device (BuWizz 1 & 2) (#64) --- BrickController2/BrickController2/App.xaml | 17 +++- .../BuWizz/BuWizz2OutputLevels.cs | 9 ++ .../BuWizz/BuWizzOutputLevels.cs | 8 ++ .../DeviceManagement/BuWizz2Device.cs | 24 +++-- .../DeviceManagement/BuwizzDevice.cs | 14 ++- .../DI/DeviceManagementModule.cs | 6 +- .../DeviceManagement/Device.cs | 45 ++++++++- .../DeviceManagement/DeviceDTO.cs | 7 ++ .../DeviceManagement/DeviceFactory.cs | 6 +- .../DeviceManagement/DeviceManager.cs | 6 +- .../DeviceManagement/DeviceRepository.cs | 40 ++++++-- .../DeviceManagement/DeviceSetting.cs | 25 +++++ .../DeviceManagement/IDeviceRepository.cs | 3 +- .../Extensions/DeviceSettingExtensions.cs | 26 ++++++ .../TranslationResources.Designer.cs | 20 +++- .../Resources/TranslationResources.de.resx | 15 +++ .../Resources/TranslationResources.resx | 18 ++++ .../UI/Pages/DeviceListPage.xaml | 8 ++ .../BrickController2/UI/Pages/DevicePage.xaml | 3 + .../UI/Pages/DeviceSettingsPage.xaml | 91 +++++++++++++++++++ .../UI/Pages/DeviceSettingsPage.xaml.cs | 18 ++++ .../UI/Templates/DataTemplatesSelector.cs | 23 +++++ .../BrickController2/UI/Themes/DarkTheme.xaml | 1 + .../UI/Themes/LightTheme.xaml | 1 + .../ViewModels/DeviceBoolSettingViewModel.cs | 27 ++++++ .../ViewModels/DeviceEnumSettingViewModel.cs | 48 ++++++++++ .../UI/ViewModels/DeviceListPageViewModel.cs | 13 +++ .../UI/ViewModels/DevicePageViewModel.cs | 22 ++++- .../ViewModels/DeviceSettingViewModelBase.cs | 37 ++++++++ .../ViewModels/DeviceSettingsPageViewModel.cs | 55 +++++++++++ 30 files changed, 608 insertions(+), 28 deletions(-) create mode 100644 BrickController2/BrickController2/DeviceManagement/BuWizz/BuWizz2OutputLevels.cs create mode 100644 BrickController2/BrickController2/DeviceManagement/BuWizz/BuWizzOutputLevels.cs create mode 100644 BrickController2/BrickController2/DeviceManagement/DeviceSetting.cs create mode 100644 BrickController2/BrickController2/Extensions/DeviceSettingExtensions.cs create mode 100644 BrickController2/BrickController2/UI/Pages/DeviceSettingsPage.xaml create mode 100644 BrickController2/BrickController2/UI/Pages/DeviceSettingsPage.xaml.cs create mode 100644 BrickController2/BrickController2/UI/Templates/DataTemplatesSelector.cs create mode 100644 BrickController2/BrickController2/UI/ViewModels/DeviceBoolSettingViewModel.cs create mode 100644 BrickController2/BrickController2/UI/ViewModels/DeviceEnumSettingViewModel.cs create mode 100644 BrickController2/BrickController2/UI/ViewModels/DeviceSettingViewModelBase.cs create mode 100644 BrickController2/BrickController2/UI/ViewModels/DeviceSettingsPageViewModel.cs diff --git a/BrickController2/BrickController2/App.xaml b/BrickController2/BrickController2/App.xaml index 132be36f..fd0716b3 100644 --- a/BrickController2/BrickController2/App.xaml +++ b/BrickController2/BrickController2/App.xaml @@ -27,7 +27,22 @@ @@ -29,11 +34,11 @@ - @@ -50,7 +55,7 @@ -