From 1bc608200c5bee17a9ed53a5d1f78e23f9bef7ea Mon Sep 17 00:00:00 2001 From: Scott McIntosh Date: Sat, 22 Jan 2022 19:23:07 -0800 Subject: [PATCH] Changes for 3.1 Enhanced logging Better configuration loading code DisplayOnTop setting added for each config CTS Profile added for CTS Windows Config --- MFDMF-App/ConfigurationWindow.xaml | 2 +- MFDMF-App/ConfigurationWindow.xaml.cs | 217 +++++++----------- MFDMF-App/ConfigureApp.cs | 9 +- MFDMF-App/MFDMFApp.csproj | 26 ++- MFDMF-App/MainWindow.xaml.cs | 3 +- .../Historical Flight/SW_Squadrons.json | 40 ++++ MFDMF-App/Modules/Non DCS/CTSProf.json | 14 +- MFDMF-App/Modules/Non DCS/CTSProf2.json | 25 ++ MFDMF-App/Modules/Non DCS/CTSProfWindows.json | 37 +++ MFDMF-App/Properties/Resources.Designer.cs | 4 +- MFDMF-App/Properties/Resources.resx | 2 +- MFDMF-App/appsettings.json | 8 +- MFDMF-App/msmDisplay.json | 19 +- MFDMF-Models/Extensions/ModelExtensions.cs | 3 - MFDMF-Models/Interfaces/IDisplayDefinition.cs | 16 +- MFDMF-Models/Models/DisplayDefinition.cs | 20 +- .../ConfigurationLoadingService.cs | 66 +++--- MFDMF-Services/ConfigurationProvider.cs | 100 +++++--- .../appsettings.json | 14 ++ .../net5.0-windows10.0.17763.0/displays.json | 43 ++++ .../msmDisplay.json | 73 ++++++ Setup/Setup.vdproj | 10 +- 22 files changed, 512 insertions(+), 239 deletions(-) create mode 100644 MFDMF-App/Modules/Historical Flight/SW_Squadrons.json create mode 100644 MFDMF-App/Modules/Non DCS/CTSProf2.json create mode 100644 MFDMF-App/Modules/Non DCS/CTSProfWindows.json create mode 100644 Output/net5.0-windows10.0.17763.0/appsettings.json create mode 100644 Output/net5.0-windows10.0.17763.0/displays.json create mode 100644 Output/net5.0-windows10.0.17763.0/msmDisplay.json diff --git a/MFDMF-App/ConfigurationWindow.xaml b/MFDMF-App/ConfigurationWindow.xaml index 971ed09..e200cb1 100644 --- a/MFDMF-App/ConfigurationWindow.xaml +++ b/MFDMF-App/ConfigurationWindow.xaml @@ -5,7 +5,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:MFDMFApp" mc:Ignorable="d" - Title="ConfigurationWindow" BorderThickness="0" Topmost="True" ResizeMode="NoResize" WindowStyle="None" ShowInTaskbar="False" Opacity="0" AllowsTransparency="True" Loaded="Window_Loaded" Closing="Window_Closing" Closed="Window_Closed"> + Title="ConfigurationWindow" BorderThickness="0" ResizeMode="NoResize" WindowStyle="None" ShowInTaskbar="False" Opacity="0" AllowsTransparency="True" Loaded="Window_Loaded" Closing="Window_Closing" Closed="Window_Closed"> diff --git a/MFDMF-App/ConfigurationWindow.xaml.cs b/MFDMF-App/ConfigurationWindow.xaml.cs index e3b9959..f30616d 100644 --- a/MFDMF-App/ConfigurationWindow.xaml.cs +++ b/MFDMF-App/ConfigurationWindow.xaml.cs @@ -1,24 +1,23 @@ -namespace MFDMFApp +using MFDMF_Models; +using MFDMF_Models.Interfaces; +using MFDMF_Models.Models; +using MFDMF_Services; +using Microsoft.Extensions.Logging; +using System; +using System.Collections.Generic; +using System.Drawing; +using System.IO; +using System.Linq; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Forms; +using System.Windows.Input; +using System.Windows.Interop; +using System.Windows.Media; +using System.Windows.Media.Imaging; + +namespace MFDMFApp { - using MFDMF_Models; - using MFDMF_Models.Interfaces; - using MFDMF_Models.Models; - using MFDMF_Services; - using Microsoft.Extensions.Logging; - using System; - using System.Collections.Generic; - using System.Drawing; - using System.Drawing.Imaging; - using System.IO; - using System.Linq; - using System.Windows; - using System.Windows.Controls; - using System.Windows.Forms; - using System.Windows.Input; - using System.Windows.Interop; - using System.Windows.Media; - using System.Windows.Media.Imaging; - /// /// Interaction logic for ConfigurationWindow.xaml /// @@ -106,10 +105,10 @@ private bool InitializeWindow() var displayForConfig = _displayDefinitions?.FirstOrDefault(dd => dd.Name == Configuration?.Name || (Configuration?.Name?.StartsWith(dd.Name, StringComparison.CurrentCulture) ?? false)); Title = Configuration?.Name; ResizeMode = ResizeMode.NoResize; - Width = Configuration?.Width ?? displayForConfig.Width ?? 0; - Height = Configuration?.Height ?? displayForConfig.Height ?? 0; - Left = Configuration?.Left ?? displayForConfig.Left ?? 0; - Top = Configuration?.Top ?? displayForConfig.Top ?? 0; + Width = Configuration?.Width ?? displayForConfig?.Width ?? 0; + Height = Configuration?.Height ?? displayForConfig?.Height ?? 0; + Left = Configuration?.Left ?? displayForConfig?.Left ?? 0; + Top = Configuration?.Top ?? displayForConfig?.Top ?? 0; Opacity = Configuration?.Opacity ?? 1.0F; var status = $"Configuration: {Title} at ({Left},{Top}) for ({Width},{Height}) Created from: {displayForConfig?.ToReadableString() ?? "Scratch"}"; _logger?.LogInformation(status); @@ -117,6 +116,7 @@ private bool InitializeWindow() { ToolTip = status; } + Topmost = displayForConfig?.AlwaysOnTop ?? false; return true; } @@ -131,47 +131,20 @@ private bool InitializeWindow() private System.Windows.Controls.Image CreateNewImage(string imageName) { var controlGrid = Content as Grid; - while(controlGrid.Children.Count > 0) + while((controlGrid?.Children?.Count ?? 0) > 0) { - controlGrid.Children.RemoveAt(0); - } +#pragma warning disable CS8602 // Dereference of a possibly null reference. + controlGrid.Children.RemoveAt(0); +#pragma warning restore CS8602 // Dereference of a possibly null reference. + } var imgMain = new System.Windows.Controls.Image() { Name = imageName }; - controlGrid.Children.Add(imgMain); - return imgMain; - } - - /// - /// Crops the image to the specified dimensions - /// - /// - /// - /// - /// - /// - /// - private Bitmap Crop(Bitmap src, IConfigurationDefinition config, bool saveOriginal = true) - { - if (config.IsValid) - { - if (saveOriginal) - { - SaveOriginalImageIfRequired(src); - } - var cropRect = new Rectangle(config.CroppingStart, new System.Drawing.Size(config.CroppedWidth, config.CroppedHeight)); - var newBitmap = new Bitmap(config?.Width ?? 0, config?.Height ?? 0, System.Drawing.Imaging.PixelFormat.Format32bppRgb); - using (var g = Graphics.FromImage(newBitmap)) - { - g.DrawImage(src, new Rectangle(0, 0, newBitmap.Width, newBitmap.Height), cropRect, GraphicsUnit.Pixel); - } - return newBitmap; - } - else - { - throw new ArgumentException($"Unable to Crop bitmap for {config.ToReadableString()}. The configuration is not valid."); - } +#pragma warning disable CS8602 // Dereference of a possibly null reference. + controlGrid.Children.Add(imgMain); +#pragma warning restore CS8602 // Dereference of a possibly null reference. + return imgMain; } private void SaveOriginalImageIfRequired(Bitmap src) @@ -208,32 +181,11 @@ private void CreateCroppingRectangle(IConfigurationDefinition config, Graphics g g.DrawRectangle(Pens.Red, config.CroppingArea); } - /* - private void SaveFileAsKneeboardRef(string path, IConfigurationDefinition config) + private void SaveFileAsKneeboardRefAsRequired(string path, IConfigurationDefinition config) { - if (_settings.CreateKneeboard ?? false) + if ((_settings.CreateKneeboard ?? false) && !string.IsNullOrEmpty(ModuleDefinition.DCSName)) { - using var img = Crop((Bitmap)System.Drawing.Image.FromFile(path), config, false); - ConfigurationDefinition.WalkConfigurationDefinitionsWithAction(config, (subConfig) => - { - // See if the Coonfiguration is selected - if (CheckForConfiguration(subConfig)) - { - var key = $"{config.ModuleName}-{config?.Name}-{subConfig.Name}"; - var insetImage = ImageDictionary.FirstOrDefault(id => id.Key == key).Value; - using var cropped = Crop(insetImage, subConfig, false); - using var g = Graphics.FromImage(img); - g.CompositingMode = System.Drawing.Drawing2D.CompositingMode.SourceCopy; - var origin = new System.Drawing.Point(subConfig?.Left ?? 0, subConfig?.Top ?? 0); - g.DrawImage(cropped, new Rectangle(origin, new System.Drawing.Size(subConfig?.Width ?? 0, subConfig?.Height ?? 0))); - } - }); - - if (string.IsNullOrEmpty(ModuleDefinition.DCSName)) - { - _logger.LogWarning($"Configuration {ModuleDefinition.DisplayName} doesn't have a kneeboard tag"); - return; - } + using var img = System.Drawing.Image.FromFile(path); var kneeBoardPath = Path.Combine(SavedGamesFolder, _settings.DcsSavedGamesPath, "Kneeboard", ModuleDefinition.DCSName); var kneeBoardFile = Path.Combine(kneeBoardPath, $"{ModuleDefinition.DCSName}-{config.Name}.png"); if (!Directory.Exists(kneeBoardPath)) @@ -241,9 +193,9 @@ private void SaveFileAsKneeboardRef(string path, IConfigurationDefinition config Directory.CreateDirectory(kneeBoardPath); _logger.LogInformation($"Creating {kneeBoardPath}"); } - if (!File.Exists(kneeBoardFile)) + if (!File.Exists(kneeBoardFile) || (_settings.TurnOffCache ?? false)) { - using var kneeBoardBitmap = new Bitmap(768, 1024, System.Drawing.Imaging.PixelFormat.Format32bppRgb); + using var kneeBoardBitmap = new Bitmap(768, 1024, System.Drawing.Imaging.PixelFormat.Format24bppRgb); using (var gk = Graphics.FromImage(kneeBoardBitmap)) { var cropRect = config.CroppingArea; @@ -254,49 +206,7 @@ private void SaveFileAsKneeboardRef(string path, IConfigurationDefinition config } } } - */ - - private void CreateRulers(IConfigurationDefinition config, Graphics g) - { - var xCenter = (config.Width ?? 0) / 2; - var yCenter = (config.Height ?? 0) / 2; - - g.DrawLine(Pens.Red, new System.Drawing.Point(0, yCenter), new System.Drawing.Point(config.Width ?? 0, yCenter)); - for (int x = 0; x < (config.Width ?? 0); x++) - { - if (x % (_settings.RulerSize ?? 0) == 0) - { - var startPoint = new System.Drawing.Point(x, yCenter - 10); - var endPoint = new System.Drawing.Point(x, yCenter + 10); - g.DrawLine(Pens.OrangeRed, startPoint, endPoint); - } - - if (x % 100 == 0) - { - var textPoint = new PointF(x - 10, (float) yCenter + 10); - g.DrawString($"{x}", System.Drawing.SystemFonts.DefaultFont, System.Drawing.Brushes.Red, textPoint); - } - } - - g.DrawLine(Pens.Red, new System.Drawing.Point(xCenter, 0), new System.Drawing.Point(xCenter, config.Height ?? 0)); - - for (int y = 0; y < (config.Height ?? 0); y++) - { - if (y % (_settings.RulerSize ?? 0) == 0) - { - var startPoint = new System.Drawing.Point(xCenter - 10, y); - var endPoint = new System.Drawing.Point(xCenter + 10, y); - g.DrawLine(Pens.OrangeRed, startPoint, endPoint); - } - - if(y % 100 == 0) - { - var textPoint = new PointF(xCenter + 10, y-5); - g.DrawString($"{y}", System.Drawing.SystemFonts.DefaultFont, System.Drawing.Brushes.Red, textPoint); - } - } - } /// /// Loads the configured image either from the test pattern, user's cache or from the original location @@ -318,7 +228,7 @@ private void LoadImage(string cacheFile) imgMain.StretchDirection = StretchDirection.Both; imgMain.Stretch = Stretch.Fill; var imgSource = new Uri(cacheFile, UriKind.RelativeOrAbsolute); - BitmapImage src = new BitmapImage(); + var src = new BitmapImage(); src.BeginInit(); src.UriSource = imgSource; src.CacheOption = BitmapCacheOption.OnLoad; @@ -366,6 +276,7 @@ private void Window_Loaded(object sender, RoutedEventArgs e) }); var selectedImage = ImageDictionary[key]; LoadImage(selectedImage.CacheFile); + SaveFileAsKneeboardRefAsRequired(selectedImage.CacheFile, Configuration); } watch.Stop(); _logger?.LogWarning($"Configuration {Configuration.ModuleName}-{Configuration.Name}-{SubConfigurationNames}: loaded in {watch.ElapsedMilliseconds} milliseconds"); @@ -398,14 +309,50 @@ private void Window_Closed(object sender, EventArgs e) protected override void OnMouseDown(MouseButtonEventArgs e) { + var rightButton = e.RightButton; var mousePos = System.Windows.Forms.Control.MousePosition; var currentRect = new Rectangle(mousePos.X, mousePos.Y, 1, 1); - var screen = GetScreen(this); - var currentDisplay = _displayDefinitions?.FirstOrDefault(dd => currentRect.IntersectsWith(new Rectangle(dd?.Left ?? 0, dd?.Top ?? 0, dd?.Width ?? 0, dd?.Height ?? 0))); - var clientLeft = mousePos.X - (currentDisplay?.Left ?? 0); - var clientTop = mousePos.Y - (currentDisplay?.Top ?? 0); - System.Windows.MessageBox.Show($"({mousePos.X}, {mousePos.Y}) ({clientLeft}, {clientTop}) in {currentDisplay?.ToReadableString() ?? "None"} on Screen {screen?.DeviceName ?? "None"}", $"{Configuration.Name}", MessageBoxButton.OK, MessageBoxImage.Information); - base.OnMouseDown(e); + + IDisplayDefinition? displayDef; + var displayDefs = _displayDefinitions.Where(dd => currentRect.IntersectsWith(new Rectangle(dd?.Left ?? 0, dd?.Top ?? 0, dd?.Width ?? 0, dd?.Height ?? 0))); + if (displayDefs.Count() > 1) + { + // Get the smallest config in the area + displayDef = displayDefs.Aggregate((first, second) => ((first.Width ?? 0) * (first.Height ?? 0)) > ((second.Width ?? 0) * (second.Height ?? 0)) ? second : first); + } + else + { + displayDef = displayDefs.SingleOrDefault(); + } + var relatedDisplays = _displayDefinitions.Where(dd => dd.Name.StartsWith(displayDef?.Name)); + if (relatedDisplays.Count() > 1) + { + // Get the display definition with the longest name + displayDef = relatedDisplays.Aggregate((first, second) => (first.Name.Length > second.Name.Length) ? first : second); + } + + if (e.RightButton == MouseButtonState.Pressed) + { + switch (System.Windows.MessageBox.Show("Do you want to close this configuration window?", $"Close {Configuration?.DisplayName} in display {displayDef?.Name ?? "Not Specified"}", MessageBoxButton.YesNoCancel, MessageBoxImage.Question)) + { + case MessageBoxResult.No: + case MessageBoxResult.Cancel: + case MessageBoxResult.None: + break; + case MessageBoxResult.OK: + case MessageBoxResult.Yes: + Close(); + break; + } + } + else + { + var screen = GetScreen(this); + var clientLeft = mousePos.X - (displayDef?.Left ?? 0); + var clientTop = mousePos.Y - (displayDef?.Top ?? 0); + System.Windows.MessageBox.Show($"({mousePos.X}, {mousePos.Y}) ({clientLeft}, {clientTop}) in {displayDef?.ToReadableString() ?? "None"} on Screen {screen?.DeviceName ?? "None"}", $"{Configuration.Name}", MessageBoxButton.OK, MessageBoxImage.Information); + base.OnMouseDown(e); + } } #endregion Mouse events diff --git a/MFDMF-App/ConfigureApp.cs b/MFDMF-App/ConfigureApp.cs index ab55442..c6077ae 100644 --- a/MFDMF-App/ConfigureApp.cs +++ b/MFDMF-App/ConfigureApp.cs @@ -37,11 +37,12 @@ internal static IHost Configure(Action addti var logFile = Path.Combine(appFolder, $"{Properties.Resources.BaseDataDirectory}Logs\\status"); loggerConfiguration.MinimumLevel.Warning(); loggerConfiguration.MinimumLevel.Override("Microsoft", LogEventLevel.Warning); - loggerConfiguration.MinimumLevel.Override("MFDMFApp", LogEventLevel.Warning); - loggerConfiguration.MinimumLevel.Override("MFDMF_Services", LogEventLevel.Warning); - loggerConfiguration.MinimumLevel.Override("MFDMF_Services.Configuration", LogEventLevel.Information); + loggerConfiguration.MinimumLevel.Override("MFDMFApp", LogEventLevel.Information); + loggerConfiguration.MinimumLevel.Override("MFDMF_Services.Configuration", LogEventLevel.Warning); + loggerConfiguration.MinimumLevel.Override("MFDMF_Services.Displays", LogEventLevel.Warning); + loggerConfiguration.MinimumLevel.Override("MFDMF_Services.ConfigurationProvider", LogEventLevel.Warning); loggerConfiguration.Enrich.FromLogContext(); - loggerConfiguration.WriteTo.RollingFile(logFile + "-{Date}.log", LogEventLevel.Information, outputTemplate: "[{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz}] [{Level}] [{SourceContext}] [{Message}]{NewLine}{Exception}"); + loggerConfiguration.WriteTo.RollingFile(logFile + "-{Date}.log", LogEventLevel.Verbose, outputTemplate: "[{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz}] [{Level}] [{SourceContext}] [{Message}]{NewLine}{Exception}"); }) .Build(); } diff --git a/MFDMF-App/MFDMFApp.csproj b/MFDMF-App/MFDMFApp.csproj index 239ecb8..347e845 100644 --- a/MFDMF-App/MFDMFApp.csproj +++ b/MFDMF-App/MFDMFApp.csproj @@ -2,7 +2,7 @@ WinExe - net5.0-windows + net5.0-windows10.0.17763.0 MFDMFApp true true @@ -11,15 +11,18 @@ Vyper Industries Vyper Industries Multi-Function Display Management Application - © 2018-2021 + © 2018-2022 mfd_xkl_icon.ico AnyCPU;x64 - 3.0.3 + 3.1.0 en-US https://github.com/ScottyMac52/MFDMF https://github.com/ScottyMac52/MFDMF GitHUb - 3.0.3 + 3.1 + 3.1.0.0 + 3.1.0.0 + enable @@ -74,8 +77,11 @@ + + + @@ -105,6 +111,12 @@ PreserveNewest + + Always + + + Always + Always @@ -452,5 +464,11 @@ + + + Always + + + \ No newline at end of file diff --git a/MFDMF-App/MainWindow.xaml.cs b/MFDMF-App/MainWindow.xaml.cs index 5072084..3788bc9 100644 --- a/MFDMF-App/MainWindow.xaml.cs +++ b/MFDMF-App/MainWindow.xaml.cs @@ -8,7 +8,6 @@ using System.Collections.Generic; using System.IO; using System.Linq; -using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; @@ -110,7 +109,7 @@ private void CreateWindows() } else { - _logger?.LogWarning($"Configuration: {config.ToReadableString()} Disabled"); + _logger?.LogWarning($"Configuration: {config} Disabled"); } }); watch.Stop(); diff --git a/MFDMF-App/Modules/Historical Flight/SW_Squadrons.json b/MFDMF-App/Modules/Historical Flight/SW_Squadrons.json new file mode 100644 index 0000000..235c077 --- /dev/null +++ b/MFDMF-App/Modules/Historical Flight/SW_Squadrons.json @@ -0,0 +1,40 @@ +{ + "modules": [ + { + "name": "SW_Sqns", + "displayName": "Star Wars Squadrons", + "filePath": "E:\\HOTAS\\Windows\\CTS\\TARGET Profiles\\CTS_Windows\\Docs\\Profile JPGs", + "fileName": "SW_Sqns\\SW_Sqns MFD.jpg", + "configurations": [ + { + "name": "LMFD_SW_Sqns" + }, + { + "name": "WHKEY_SW_Sqns", + "filename": "SW_Sqns\\SW_Sqns THROTTLE.jpg" + }, + { + "name": "RMFD_SW_Sqns" + } + ] + }, + { + "name": "SW_SqnsHV", + "displayName": "Star Wars Squadrons Hi Viz", + "filePath": "E:\\HOTAS\\Windows\\CTS\\TARGET Profiles\\CTS_Windows\\Docs\\Profile JPGs", + "fileName": "_High Contrast MFDs\\SW_Sqns MFD HiVis.jpg", + "configurations": [ + { + "name": "LMFD_SW_Sqns" + }, + { + "name": "WHKEY_SW_Sqns", + "filename": "SW_Sqns\\SW_Sqns THROTTLE.jpg" + }, + { + "name": "RMFD_SW_Sqns" + } + ] + } + ] +} diff --git a/MFDMF-App/Modules/Non DCS/CTSProf.json b/MFDMF-App/Modules/Non DCS/CTSProf.json index beca24f..fb5f140 100644 --- a/MFDMF-App/Modules/Non DCS/CTSProf.json +++ b/MFDMF-App/Modules/Non DCS/CTSProf.json @@ -8,7 +8,11 @@ "fileName": "CTSConfigLMFD.jpg", "configurations": [ { - "name": "LMFD_CTSMFDOffset" + "name": "LMFD_CTSMFD", + "xOffsetStart": 0, + "xOffsetFinish": 668, + "yOffsetStart": 0, + "yOffsetFinish": 441 }, { "name": "WHKEY_CTSProf", @@ -20,8 +24,12 @@ "yOffsetFinish": 1184 }, { - "name": "RMFD_CTSMFDOffset", - "fileName": "CTSConfigRMFD.jpg" + "name": "RMFD_CTSMFD", + "fileName": "CTSConfigRMFD.jpg", + "xOffsetStart": 0, + "xOffsetFinish": 670, + "yOffsetStart": 0, + "yOffsetFinish": 443 } ] } diff --git a/MFDMF-App/Modules/Non DCS/CTSProf2.json b/MFDMF-App/Modules/Non DCS/CTSProf2.json new file mode 100644 index 0000000..db9a8d7 --- /dev/null +++ b/MFDMF-App/Modules/Non DCS/CTSProf2.json @@ -0,0 +1,25 @@ +{ + "modules" : + [ + { + "name": "CTSProf2", + "displayName": "New CTS Configuration Profile", + "filePath": "E:\\HOTAS\\TARGET\\CTS\\Docs\\Vyper", + "fileName": "CTSConfigLMFD2.jpg", + "configurations": [ + { + "name": "LMFDOffset" + }, + { + "name": "WHKEY_CTSProfOffset", + "filePath": "E:\\HOTAS\\TARGET\\CTS\\Docs\\HTML\\gfx", + "fileName": "vr_hotas_sel.jpg" + }, + { + "name": "RMFDOffset", + "fileName": "CTSConfigRMFD2.jpg" + } + ] + } + ] +} diff --git a/MFDMF-App/Modules/Non DCS/CTSProfWindows.json b/MFDMF-App/Modules/Non DCS/CTSProfWindows.json new file mode 100644 index 0000000..51a6972 --- /dev/null +++ b/MFDMF-App/Modules/Non DCS/CTSProfWindows.json @@ -0,0 +1,37 @@ +{ + "modules" : + [ + { + "name": "CTSProf3", + "displayName": "CTS Windows Configuration Profile", + "filePath": "E:\\HOTAS\\Windows\\CTS\\TARGET Profiles\\CTS_Windows\\Docs\\Profile JPGs\\CTSProfile", + "fileName": "LMFD_CTSProfile.jpg", + "configurations": [ + { + "name": "LMFD_CTSMFD", + "xOffsetStart": 0, + "xOffsetFinish": 668, + "yOffsetStart": 0, + "yOffsetFinish": 441 + }, + { + "name": "WHKEY_CTSProf", + "filePath": "E:\\HOTAS\\TARGET\\CTS\\Docs\\HTML\\gfx", + "fileName": "vr_hotas_sel.jpg", + "xOffsetStart": 0, + "xOffsetFinish": 1449, + "yOffsetStart": 0, + "yOffsetFinish": 1184 + }, + { + "name": "RMFD_CTSMFD", + "fileName": "RMFD_CTSProfile.jpg", + "xOffsetStart": 0, + "xOffsetFinish": 670, + "yOffsetStart": 0, + "yOffsetFinish": 443 + } + ] + } + ] +} diff --git a/MFDMF-App/Properties/Resources.Designer.cs b/MFDMF-App/Properties/Resources.Designer.cs index 7e566e5..5aa49d7 100644 --- a/MFDMF-App/Properties/Resources.Designer.cs +++ b/MFDMF-App/Properties/Resources.Designer.cs @@ -19,7 +19,7 @@ namespace MFDMFApp.Properties { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { @@ -61,7 +61,7 @@ internal Resources() { } /// - /// Looks up a localized string similar to The applictaion is exiting with. + /// Looks up a localized string similar to The application is exiting with. /// internal static string ApplicationExit { get { diff --git a/MFDMF-App/Properties/Resources.resx b/MFDMF-App/Properties/Resources.resx index f314729..e877f88 100644 --- a/MFDMF-App/Properties/Resources.resx +++ b/MFDMF-App/Properties/Resources.resx @@ -118,7 +118,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - The applictaion is exiting with + The application is exiting with Vyper Industries\MFDMF\ diff --git a/MFDMF-App/appsettings.json b/MFDMF-App/appsettings.json index 7c4475d..31c5b12 100644 --- a/MFDMF-App/appsettings.json +++ b/MFDMF-App/appsettings.json @@ -2,13 +2,13 @@ "displayConfigurationFile": "msmdisplay.json", "defaultConfiguration": null, "dcsSavedGamesPath": "DCS", - "saveCroppedImages": true, - "showTooltips": true, + "saveCroppedImages": false, + "showTooltips": false, "showRulers": false, - "rulerSize": 100, + "rulerSize": 0, "filePath": "E:\\HOTAS\\TARGET\\CTS\\Docs\\Profile JPGs", "fileSpec": "*.json", "useCougar": false, "turnOffCache": false, - "createKneeboard": false + "createKneeboard": true } \ No newline at end of file diff --git a/MFDMF-App/msmDisplay.json b/MFDMF-App/msmDisplay.json index 6310935..bfdc8d3 100644 --- a/MFDMF-App/msmDisplay.json +++ b/MFDMF-App/msmDisplay.json @@ -6,6 +6,7 @@ }, { "name": "LMFD", + "alwaysOnTop": true, "width": 870, "height": 700, "left": -1280, @@ -30,6 +31,7 @@ }, { "name": "RMFD", + "alwaysOnTop": true, "width": 870, "height": 700, "left": 3005, @@ -48,11 +50,24 @@ } }, { - "name": "CTSMFDOffset", + "name": "LMFDOffset", "xOffsetStart": 0, "xOffsetFinish": 667, "yOffsetStart": 0, "yOffsetFinish": 441 - + }, + { + "name": "RMFDOffset", + "xOffsetStart": 0, + "xOffsetFinish": 667, + "yOffsetStart": 0, + "yOffsetFinish": 441 + }, + { + "name": "WHKEY_CTSProfOffset", + "xOffsetStart": 0, + "xOffsetFinish": 1449, + "yOffsetStart": 0, + "yOffsetFinish": 1184 } ] diff --git a/MFDMF-Models/Extensions/ModelExtensions.cs b/MFDMF-Models/Extensions/ModelExtensions.cs index 87e98f1..c55d6d4 100644 --- a/MFDMF-Models/Extensions/ModelExtensions.cs +++ b/MFDMF-Models/Extensions/ModelExtensions.cs @@ -1,9 +1,6 @@ namespace MFDMF_Models.Extensions { - using System; - using System.Collections.Generic; using System.Linq; - using System.Text; public static class ModelExtensions { diff --git a/MFDMF-Models/Interfaces/IDisplayDefinition.cs b/MFDMF-Models/Interfaces/IDisplayDefinition.cs index 0569204..3daec4d 100644 --- a/MFDMF-Models/Interfaces/IDisplayDefinition.cs +++ b/MFDMF-Models/Interfaces/IDisplayDefinition.cs @@ -1,9 +1,19 @@ -namespace MFDMF_Models.Interfaces -{ - using MFDMF_Models.Models; +using MFDMF_Models.Models; +using Newtonsoft.Json; +namespace MFDMF_Models.Interfaces +{ public interface IDisplayDefinition : IDisplayGeometry, IReadableObject, INameObject, IOffsetGeometry { + /// + /// + /// ImageGeometry ImageGeometry { get; set; } + + /// + /// If true then any configurations created in this will be set to always on top + /// + [JsonProperty("alwaysOnTop")] + bool? AlwaysOnTop { get; set; } } } diff --git a/MFDMF-Models/Models/DisplayDefinition.cs b/MFDMF-Models/Models/DisplayDefinition.cs index ea74a9f..22c50bb 100644 --- a/MFDMF-Models/Models/DisplayDefinition.cs +++ b/MFDMF-Models/Models/DisplayDefinition.cs @@ -42,6 +42,7 @@ public DisplayDefinition(IDisplayDefinition copy) : this() Top = copy.Top; Width = copy.Width; Height = copy.Height; + AlwaysOnTop = copy.AlwaysOnTop; } public DisplayDefinition(IConfigurationDefinition copy) @@ -143,15 +144,18 @@ public static DisplayDefinition FromJson(ILoggerFactory loggerFactory, string js [JsonIgnore()] public bool? Center { get; set; } - public bool? MakeOpaque { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } - - public Point CroppingStart => throw new NotImplementedException(); - - public Rectangle CroppingArea => throw new NotImplementedException(); - - public int CroppedWidth => throw new NotImplementedException(); + public bool? MakeOpaque { get; set; } + [JsonIgnore()] + public Point CroppingStart => this.YOffsetStart.HasValue && this.YOffsetStart.HasValue ? new Point(this.XOffsetStart.Value, this.YOffsetStart.Value) : new Point(); + [JsonIgnore()] + public Rectangle CroppingArea => this.XOffsetStart.HasValue && this.XOffsetFinish.HasValue && this.YOffsetStart.HasValue && this.YOffsetFinish.HasValue ? new Rectangle(CroppingStart, new Size(CroppedWidth, CroppedHeight)) : new Rectangle(); + [JsonIgnore()] + public int CroppedWidth => this.XOffsetStart.HasValue && this.XOffsetFinish.HasValue ? Math.Abs(this.XOffsetFinish.Value - this.XOffsetStart.Value) : 0; + [JsonIgnore()] + public int CroppedHeight => this.YOffsetStart.HasValue && this.YOffsetFinish.HasValue ? Math.Abs(this.YOffsetFinish.Value - this.YOffsetStart.Value) : 0; - public int CroppedHeight => throw new NotImplementedException(); + [JsonProperty("alwaysOnTop")] + public bool? AlwaysOnTop { get; set; } #endregion Image cropping properties IOffsetGeometry diff --git a/MFDMF-Services/Configuration/ConfigurationLoadingService.cs b/MFDMF-Services/Configuration/ConfigurationLoadingService.cs index af798cf..1e23b3a 100644 --- a/MFDMF-Services/Configuration/ConfigurationLoadingService.cs +++ b/MFDMF-Services/Configuration/ConfigurationLoadingService.cs @@ -62,22 +62,25 @@ public ConfigurationLoadingService(IOptions settings, ILoggerFactor /// public IEnumerable LoadModulesConfigurationFile(string jsonContent, IEnumerable displays, string category) { - var modulesList = new List(); try { if(jsonContent.Contains("\"modules\"")) { + var modulesList = new List(); var moduleDefinitions = JsonConvert.DeserializeObject(jsonContent); var modules = PreProcessModules(moduleDefinitions.Modules, displays, category); modulesList.AddRange(modules); + var names = string.Join(',', modules.Select(mod => mod.ModuleName)); + if(_logger.IsEnabled(LogLevel.Debug)) + { + _logger.LogDebug($"Loaded {modules.Count()} modules: {names} for Category: {category ?? "None"}"); + } + return modulesList; } else { - var moduleDefinitions = JsonConvert.DeserializeObject>(jsonContent); - var modules = PreProcessModules(moduleDefinitions, displays, category); - modulesList.AddRange(modules); + throw new ArgumentException($"The JSON content is missing the \"modules\": {jsonContent}"); } - return modulesList; } catch (Exception ex) { @@ -115,19 +118,6 @@ private IEnumerable PreProcessModules(List m { // Get the Display for the configuration and get the placement var currentConfig = LoadBaseConfigurationDefinition(arg, config, displays, out var currentDisplay); - - var placement = GetPlacementRect(currentConfig, currentDisplay); - currentConfig.Left = placement.X; - currentConfig.Top = placement.Y; - currentConfig.Width = placement.Width; - currentConfig.Height = placement.Height; - - var croppingRect = GetCroppingRect(currentConfig, currentDisplay); - currentConfig.XOffsetStart ??= croppingRect.Left; - currentConfig.XOffsetFinish ??= croppingRect.Right; - currentConfig.YOffsetStart ??= croppingRect.Top; - currentConfig.YOffsetFinish ??= croppingRect.Bottom; - _logger.LogDebug($"Configuration {currentConfig.Name} using {currentDisplay?.Name ?? "Scratch"} Using file: {currentConfig?.FileName ?? "None"} Size: ({currentConfig.Width ?? 0},{currentConfig.Height ?? 0}) Location: ({currentConfig.Left ?? 0}, {currentConfig.Top ?? 0})"); _logger.LogDebug($"Cropping offsets ({currentConfig.XOffsetStart??0}, {currentConfig.YOffsetStart??0}) to ({currentConfig.XOffsetFinish??0}, {currentConfig.YOffsetFinish??0}) Opacity: {currentConfig.Opacity}"); @@ -135,20 +125,19 @@ private IEnumerable PreProcessModules(List m { var currentSubConfig = LoadBaseConfigurationDefinition(arg, subConfig, displays, out var currentSubDisplay, currentConfig); currentSubConfig.Parent = config; - - var placement = GetPlacementRect(currentConfig, currentSubDisplay, currentSubConfig); - currentSubConfig.Left = placement.X; - currentSubConfig.Top = placement.Y; - currentSubConfig.Width = placement.Width; - currentSubConfig.Height = placement.Height; - - // The cropping offsets can originate from the sub configurations display offset geometry and from their parent configurations - var croppingRect = GetCroppingRect(currentConfig, currentDisplay, currentSubConfig); - currentSubConfig.XOffsetStart ??= croppingRect.Left; - currentSubConfig.XOffsetFinish ??= croppingRect.Right; - currentSubConfig.YOffsetStart ??= croppingRect.Top; - currentSubConfig.YOffsetFinish ??= croppingRect.Bottom; - currentSubConfig.Opacity ??= currentSubDisplay?.Opacity ?? currentConfig.Opacity; + bool determineDimension = false; + if((currentSubConfig.Width ?? 0) == 0 || (currentSubConfig.Height ?? 0) == 0) + { + determineDimension = true; + } + if (determineDimension) + { + var placement = GetPlacementRect(currentConfig, currentSubDisplay, currentSubConfig); + currentSubConfig.Left = placement.X; + currentSubConfig.Top = placement.Y; + currentSubConfig.Width = placement.Width; + currentSubConfig.Height = placement.Height; + } _logger.LogDebug($"Configuration: {currentSubConfig.Name} using {currentSubDisplay?.Name ?? "Scratch"} Using file: {currentSubConfig?.FileName ?? "None"} Size: ({currentSubConfig.Width ?? 0},{currentSubConfig.Height ?? 0}) Location: ({currentSubConfig.Left ?? 0}, {currentSubConfig.Top ?? 0})"); _logger.LogDebug($"Cropping offsets: ({currentSubConfig.XOffsetStart ?? 0}, {currentSubConfig.YOffsetStart ?? 0}) to ({currentSubConfig.XOffsetFinish ?? 0}, {currentSubConfig.YOffsetFinish ?? 0}) Opacity: {currentSubConfig.Opacity}"); @@ -185,8 +174,8 @@ private IConfigurationDefinition LoadBaseConfigurationDefinition(IModuleDefiniti { // The primary display configuration MUST have it's name start with or equal the configuration name currentDisplay = currentDisplays.FirstOrDefault(cd => config.Name.StartsWith(cd.Name) || config.Name.Equals(cd.Name, StringComparison.CurrentCultureIgnoreCase)); - // The secondary display configuration MUST NOT have it's name start with the configuration name BUT must contain it - auxDisplay = currentDisplays.FirstOrDefault(cd => !config.Name.StartsWith(cd.Name) && config.Name.Contains(cd.Name)); + // The secondary display configuration MUST NOT have it's name equal the configuration + auxDisplay = currentDisplays.FirstOrDefault(cd => !cd.Name.Equals(currentDisplay.Name, StringComparison.CurrentCultureIgnoreCase)); } } else @@ -195,6 +184,10 @@ private IConfigurationDefinition LoadBaseConfigurationDefinition(IModuleDefiniti } config.Logger = _logger; + config.Left ??= currentDisplay.Left; + config.Top ??= currentDisplay.Top; + config.Width ??= currentDisplay.Width; + config.Height ??= currentDisplay.Height; config.Enabled ??= arg.Enabled ?? config.Enabled ?? parentDef?.Enabled ?? false; config.UseAsSwitch ??= parentDef?.UseAsSwitch ?? false; config.ModuleName ??= arg?.ModuleName; @@ -202,11 +195,14 @@ private IConfigurationDefinition LoadBaseConfigurationDefinition(IModuleDefiniti config.FileName ??= arg?.FileName; config.MakeOpaque ??= false; config.Center ??= false; - config.Opacity ??= 1.0F; config.Opacity ??= currentDisplay?.Opacity ?? 1.0F; config.RulerName = (_settings.ShowRulers ?? false) ? $"Ruler-{_settings.RulerSize ?? 0}" : null; var throttleType = (_settings?.UseCougar ?? false) ? "HC" : "WH"; config.ThrottleType = throttleType; + config.XOffsetStart ??= auxDisplay?.XOffsetStart ?? currentDisplay?.XOffsetStart ?? 0; + config.XOffsetFinish ??= auxDisplay?.XOffsetFinish ?? currentDisplay?.XOffsetFinish ?? 0; + config.YOffsetStart ??= auxDisplay?.YOffsetStart ?? currentDisplay?.YOffsetStart ?? 0; + config.YOffsetFinish ??= auxDisplay?.YOffsetFinish ?? currentDisplay?.YOffsetFinish ?? 0; mainDef = currentDisplay; return config; } diff --git a/MFDMF-Services/ConfigurationProvider.cs b/MFDMF-Services/ConfigurationProvider.cs index b57f4f0..787da8f 100644 --- a/MFDMF-Services/ConfigurationProvider.cs +++ b/MFDMF-Services/ConfigurationProvider.cs @@ -100,17 +100,8 @@ public Dictionary LoadConfigurationImages(IModuleDefini var cacheFile = $"{fileTemplate}.png"; var cacheFileExists = File.Exists(cacheFile); var key = $"{module.ModuleName}-{config.Name}"; - if (imageDictionary.TryGetValue(key, out var mainImage)) - { - if (!cacheFileExists || forceReload) - { - _logger.LogDebug($"Creating cache file {cacheFile}"); - mainImage.Save($"{fileTemplate}.png"); - } - _logger.LogDebug($"Adding image {key}"); - var bitMapCache = new ImageDefinition() { Bitmap = mainImage, CacheFile = cacheFile, Key = key }; - bitmapDictionary.Add(key, bitMapCache); - } + imageDictionary.TryGetValue(key, out var mainImage); + _logger.LogDebug($"Processing image {key}"); config?.SubConfigurations?.ForEach(subConfig => { @@ -133,37 +124,91 @@ public Dictionary LoadConfigurationImages(IModuleDefini g.CompositingMode = CompositingMode.SourceOver; var newLocation = (subConfig.Center ?? false) ? subConfig.GetCenterTo(config) : new Point(subConfig.Left ?? config.Left ?? 0, subConfig.Top ?? config.Top ?? 0); var croppingArea = new Rectangle(newLocation, new Size(subConfig.Width ?? 0, subConfig.Height ?? 0)); - _logger.LogDebug($"Using image: {key} to paint configuration {subConfig.Name} for {subConfig.ToReadableString()}"); + _logger.LogDebug($"Using image: {key} to paint configuration {subConfig.Name} for {subConfig}"); g.DrawImage(sourceImage, croppingArea); - } - ConfigurationDefinition.WalkConfigurationDefinitionsWithAction(subConfig, (subsubConfig) => - { - var key = $"{module.ModuleName}-{config.Name}-{subsubConfig.Name}"; - if (imageDictionary.TryGetValue(key, out var sourceImage)) + ConfigurationDefinition.WalkConfigurationDefinitionsWithAction(subConfig, (subsubConfig) => { - using (var g = Graphics.FromImage(currentConfig)) + var key = $"{module.ModuleName}-{config.Name}-{subsubConfig.Name}"; + if (imageDictionary.TryGetValue(key, out var sourceImage)) { - g.CompositingMode = CompositingMode.SourceOver; + using var graphicsSuperimposed = Graphics.FromImage(currentConfig); + graphicsSuperimposed.CompositingMode = CompositingMode.SourceOver; var newLocation = (subsubConfig.Center ?? false) ? subsubConfig.GetCenterTo(subConfig) : new Point(subsubConfig.Left ?? subConfig.Left ?? config.Left ?? 0, subsubConfig.Top ?? subConfig.Top ?? config.Top ?? 0); var croppingArea = new Rectangle(newLocation, new Size(subsubConfig.Width ?? 0, subsubConfig.Height ?? 0)); - _logger.LogDebug($"Using image: {key} to paint configuration {subsubConfig.Name} for {subsubConfig.ToReadableString()}"); - g.DrawImage(sourceImage, croppingArea); + _logger.LogDebug($"Using image: {key} to paint configuration {subsubConfig.Name} for {subsubConfig}"); + graphicsSuperimposed.DrawImage(sourceImage, croppingArea); } - } - }); - currentConfig.Save($"{fileTemplate}.png"); + }); + } + using var graphics = Graphics.FromImage(currentConfig); + CreateRulersAsRequired(config, graphics); + currentConfig.Save(cacheFile); } } var bitMapCache = new ImageDefinition() { Bitmap = currentConfig, CacheFile = cacheFile, Key = key }; bitmapDictionary.Add(key, bitMapCache); }); - var mainKey = $"{module.ModuleName}-{config.Name}"; - imageDictionary.TryGetValue(key, out mainImage); + if (!cacheFileExists || forceReload) + { + using var graphics = Graphics.FromImage(mainImage); + CreateRulersAsRequired(config, graphics); + _logger.LogDebug($"Creating cache file {cacheFile}"); + mainImage.Save($"{fileTemplate}.png"); + } + var bitMapCache = new ImageDefinition() { Bitmap = mainImage, CacheFile = cacheFile, Key = key }; + bitmapDictionary.Add(key, bitMapCache); + var mainKey = $"{module.ModuleName}-{config.Name}"; return bitmapDictionary; } + private void CreateRulersAsRequired(IConfigurationDefinition config, Graphics g) + { + if (_settings.ShowRulers ?? false) + { + var xCenter = (config.Width ?? 0) / 2; + var yCenter = (config.Height ?? 0) / 2; + + g.DrawLine(Pens.Red, new System.Drawing.Point(0, yCenter), new System.Drawing.Point(config.Width ?? 0, yCenter)); + + for (int x = 0; x < (config.Width ?? 0); x++) + { + if (x % (_settings.RulerSize ?? 0) == 0) + { + var startPoint = new System.Drawing.Point(x, yCenter - 10); + var endPoint = new System.Drawing.Point(x, yCenter + 10); + g.DrawLine(Pens.OrangeRed, startPoint, endPoint); + } + + if (x % 100 == 0) + { + var textPoint = new PointF(x - 10, (float)yCenter + 10); + g.DrawString($"{x}", System.Drawing.SystemFonts.DefaultFont, System.Drawing.Brushes.Red, textPoint); + } + } + + g.DrawLine(Pens.Red, new System.Drawing.Point(xCenter, 0), new System.Drawing.Point(xCenter, config.Height ?? 0)); + + for (int y = 0; y < (config.Height ?? 0); y++) + { + if (y % (_settings.RulerSize ?? 0) == 0) + { + var startPoint = new System.Drawing.Point(xCenter - 10, y); + var endPoint = new System.Drawing.Point(xCenter + 10, y); + g.DrawLine(Pens.OrangeRed, startPoint, endPoint); + } + + if (y % 100 == 0) + { + var textPoint = new PointF(xCenter + 10, y - 5); + g.DrawString($"{y}", System.Drawing.SystemFonts.DefaultFont, System.Drawing.Brushes.Red, textPoint); + } + } + } + } + + // public Dictionary private void CheckCacheFolder(IModuleName moduleName) @@ -185,6 +230,7 @@ private void CheckCacheFolder(IModuleName moduleName) private Bitmap Crop(Bitmap src, IDisplayGeometry displayGeometry, IOffsetGeometry cropping) { var cropRect = new Rectangle(cropping.CroppingStart, new Size(cropping.CroppedWidth, cropping.CroppedHeight)); + _logger.LogDebug($"Creating bitmap {displayGeometry?.Width ?? 0} * {displayGeometry?.Height ?? 0}"); var newBitmap = new Bitmap(displayGeometry?.Width ?? 0, displayGeometry?.Height ?? 0, PixelFormat.Format32bppArgb); using (var g = Graphics.FromImage(newBitmap)) { @@ -262,7 +308,7 @@ private Dictionary LoadBitmaps(IConfigurationDefinition configur { throw new FileNotFoundException($"Unable to find the specified file at {filePath}", subConfig.FileName); } - _logger?.LogInformation($"Loading file: {fileSource} for {subConfig.ToReadableString()}"); + _logger?.LogInformation($"Loading file: {fileSource} for {subConfig}"); bitMap = (Bitmap)Image.FromFile(fileSource); var key = $"{currentConfig.ModuleName}-{currentConfig.Name}-{subConfig.Name}"; using var croppedBitmap = Crop(bitMap, subConfig, subConfig); diff --git a/Output/net5.0-windows10.0.17763.0/appsettings.json b/Output/net5.0-windows10.0.17763.0/appsettings.json new file mode 100644 index 0000000..31c5b12 --- /dev/null +++ b/Output/net5.0-windows10.0.17763.0/appsettings.json @@ -0,0 +1,14 @@ +{ + "displayConfigurationFile": "msmdisplay.json", + "defaultConfiguration": null, + "dcsSavedGamesPath": "DCS", + "saveCroppedImages": false, + "showTooltips": false, + "showRulers": false, + "rulerSize": 0, + "filePath": "E:\\HOTAS\\TARGET\\CTS\\Docs\\Profile JPGs", + "fileSpec": "*.json", + "useCougar": false, + "turnOffCache": false, + "createKneeboard": true +} \ No newline at end of file diff --git a/Output/net5.0-windows10.0.17763.0/displays.json b/Output/net5.0-windows10.0.17763.0/displays.json new file mode 100644 index 0000000..11f9f90 --- /dev/null +++ b/Output/net5.0-windows10.0.17763.0/displays.json @@ -0,0 +1,43 @@ +[ + { + "name": "Main", + "width": 1920, + "height": 1080 + }, + { + "name": "LMFD", + "width": 350, + "height": 350, + "left": 0, + "top": 351, + "xOffsetStart": 101, + "xOffsetFinish": 776, + "yOffsetStart": 250, + "yOffsetFinish": 900, + "opacity": 1.0 + }, + { + "name": "WHKEY", + "width": 350, + "height": 350, + "left": 0, + "top": 0, + "xOffsetStart": 0, + "yOffsetStart": 0, + "xOffsetFinish": 3330, + "yOffsetFinish": 2295, + "opacity": 1.0 + }, + { + "name": "RMFD", + "width": 350, + "height": 350, + "left": 0, + "top": 701, + "xOffsetStart": 903, + "xOffsetFinish": 1576, + "yOffsetStart": 250, + "yOffsetFinish": 900, + "opacity": 1.0 + } +] diff --git a/Output/net5.0-windows10.0.17763.0/msmDisplay.json b/Output/net5.0-windows10.0.17763.0/msmDisplay.json new file mode 100644 index 0000000..bfdc8d3 --- /dev/null +++ b/Output/net5.0-windows10.0.17763.0/msmDisplay.json @@ -0,0 +1,73 @@ +[ + { + "name": "Main", + "width": 2560, + "height": 1440 + }, + { + "name": "LMFD", + "alwaysOnTop": true, + "width": 870, + "height": 700, + "left": -1280, + "top": 0, + "xOffsetStart": 101, + "xOffsetFinish": 776, + "yOffsetStart": 250, + "yOffsetFinish": 900, + "opacity": 1.0 + }, + { + "name": "WHKEY", + "width": 1200, + "height": 1200, + "left": 1360, + "top": 0, + "xOffsetStart": 0, + "yOffsetStart": 0, + "xOffsetFinish": 3330, + "yOffsetFinish": 2295, + "opacity": 1.0 + }, + { + "name": "RMFD", + "alwaysOnTop": true, + "width": 870, + "height": 700, + "left": 3005, + "xOffsetStart": 903, + "xOffsetFinish": 1576, + "yOffsetStart": 250, + "yOffsetFinish": 900, + "opacity": 1.0 + }, + { + "name": "Flir", + "offsets": { + "top": -45, + "width": -490, + "height": -260 + } + }, + { + "name": "LMFDOffset", + "xOffsetStart": 0, + "xOffsetFinish": 667, + "yOffsetStart": 0, + "yOffsetFinish": 441 + }, + { + "name": "RMFDOffset", + "xOffsetStart": 0, + "xOffsetFinish": 667, + "yOffsetStart": 0, + "yOffsetFinish": 441 + }, + { + "name": "WHKEY_CTSProfOffset", + "xOffsetStart": 0, + "xOffsetFinish": 1449, + "yOffsetStart": 0, + "yOffsetFinish": 1184 + } +] diff --git a/Setup/Setup.vdproj b/Setup/Setup.vdproj index 0e4aa7a..ecbc854 100644 --- a/Setup/Setup.vdproj +++ b/Setup/Setup.vdproj @@ -165,7 +165,7 @@ "InstallUrl" = "8:https://dotnet.microsoft.com/download/dotnet/[NetCoreVerMajorDotMinor]" "IsNETCore" = "11:TRUE" "Architecture" = "2:2" - "Runtime" = "2:0" + "Runtime" = "2:2" } } } @@ -488,15 +488,15 @@ { "Name" = "8:Microsoft Visual Studio" "ProductName" = "8:MFDMF" - "ProductCode" = "8:{2A656CE8-E003-4289-92E6-C1C62BF5E5A7}" - "PackageCode" = "8:{463B5B66-9E3B-478B-88DC-F4622EB43E21}" + "ProductCode" = "8:{78E27590-28D6-4A04-935E-37DE91C9F0AF}" + "PackageCode" = "8:{2B0D5075-F7D3-4A00-86EB-5A26108C799B}" "UpgradeCode" = "8:{10A36A70-4527-422C-9715-54AE7A24ECC8}" "AspNetVersion" = "8:4.0.30319.0" "RestartWWWService" = "11:FALSE" "RemovePreviousVersions" = "11:TRUE" "DetectNewerInstalledVersion" = "11:TRUE" "InstallAllUsers" = "11:FALSE" - "ProductVersion" = "8:3.0.3" + "ProductVersion" = "8:3.1.0" "Manufacturer" = "8:Vyper Industries" "ARPHELPTELEPHONE" = "8:" "ARPHELPLINK" = "8:https://github.com/ScottyMac52/MFDMF/issues" @@ -1088,7 +1088,7 @@ { "{5259A561-127C-4D43-A0A1-72F10C7B3BF8}:_D40C0B95CF45451486426DC5DF9E0C40" { - "SourcePath" = "8:..\\MFDMF-App\\obj\\x64\\Debug\\net5.0-windows\\apphost.exe" + "SourcePath" = "8:..\\MFDMF-App\\obj\\x64\\Debug\\net5.0-windows10.0.17763.0\\apphost.exe" "TargetName" = "8:" "Tag" = "8:" "Folder" = "8:_7FCB61EBE1E14F5F9BB45E9312EFFC0D"