From c6c584e76898f9d72d59cc1bc9280b00a51ef0db Mon Sep 17 00:00:00 2001 From: Stanley Date: Sun, 16 Oct 2022 09:11:01 -0400 Subject: [PATCH] Version 3.4.5 Release --- ArduinoAgent/ArduinoAgent.csproj | 6 +- Orchestration/MainOrchestrator.cs | 21 +++- Orchestration/Orchestration.csproj | 6 +- Orchestration/PanelPopOutOrchestrator.cs | 18 +++- .../public/config/PlanePanelProfile.json | 99 ++++++++++++++++++- ReactClient/src/App/ApplicationBar.js | 4 +- ReactClient/src/App/PopoutPanelContainer.js | 1 + ReactClient/src/App/Telemetry.js | 7 +- ReactClient/src/App/WebPanel.js | 9 +- Shared/Shared.csproj | 6 +- SimconnectAgent/SimconnectAgent.csproj | 6 +- SimconnectAgent/TouchPanel/ActionProvider.cs | 2 +- TouchPanelAgent/TouchPanelAgent.csproj | 6 +- UserDataAgent/AppSetting.cs | 3 + UserDataAgent/UserDataAgent.csproj | 6 +- VERSION.md | 5 + WebServer/WebServer.csproj | 6 +- WindowsAgent/InputEmulationManager.cs | 10 +- WindowsAgent/WindowsAgent.csproj | 6 +- WpfApp/PreferencesDialog.xaml | 7 ++ WpfApp/UserControlPanelSelection.xaml | 2 +- WpfApp/WpfApp.csproj | 6 +- latestreleasenotes.txt | 11 ++- 23 files changed, 195 insertions(+), 58 deletions(-) diff --git a/ArduinoAgent/ArduinoAgent.csproj b/ArduinoAgent/ArduinoAgent.csproj index 30cb112..4bcfaf9 100644 --- a/ArduinoAgent/ArduinoAgent.csproj +++ b/ArduinoAgent/ArduinoAgent.csproj @@ -10,9 +10,9 @@ https://github.com/hawkeye-stan/msfs-popout-panel-manager MSFSPopoutPanelManager.ArduinoAgent x64 - 3.4.4.1011 - 3.4.4.1011 - 3.4.4.1011 + 3.4.5.0 + 3.4.5.0 + 3.4.5.0 win-x64 Embedded Debug;Release;DebugTouchPanel;ReleaseTouchPanel diff --git a/Orchestration/MainOrchestrator.cs b/Orchestration/MainOrchestrator.cs index 0f3ab22..cb73b48 100644 --- a/Orchestration/MainOrchestrator.cs +++ b/Orchestration/MainOrchestrator.cs @@ -9,12 +9,11 @@ namespace MSFSPopoutPanelManager.Orchestration { public class MainOrchestrator : ObservableObject { - private IntPtr _msfsGameWindowHandle; + private const int MSFS_GAME_EXIT_DETECTION_INTERVAL = 3000; + private System.Timers.Timer _msfsGameExitDetectionTimer; public MainOrchestrator() { - _msfsGameWindowHandle = IntPtr.Zero; - Profile = new ProfileOrchestrator(); PanelSource = new PanelSourceOrchestrator(); PanelPopOut = new PanelPopOutOrchestrator(); @@ -94,6 +93,7 @@ namespace MSFSPopoutPanelManager.Orchestration FlightSim.AppSettingData = AppSettingData; FlightSim.FlightSimData = FlightSimData; FlightSim.OnFlightStartedForAutoPopOut += (sender, e) => PanelPopOut.AutoPopOut(); + FlightSim.OnSimulatorStarted += (sender, e) => DetectMsfsExit(); TouchPanel.ProfileData = ProfileData; TouchPanel.AppSettingData = AppSettingData; @@ -137,5 +137,20 @@ namespace MSFSPopoutPanelManager.Orchestration AutoUpdater.UpdateFormSize = new System.Drawing.Size(930, 675); AutoUpdater.Start(AppSettingData.AppSetting.AutoUpdaterUrl); } + + private void DetectMsfsExit() + { + _msfsGameExitDetectionTimer = new System.Timers.Timer(); + _msfsGameExitDetectionTimer.Interval = MSFS_GAME_EXIT_DETECTION_INTERVAL; + _msfsGameExitDetectionTimer.Enabled = true; + _msfsGameExitDetectionTimer.Elapsed += async (source, e) => + { + if (WindowsAgent.WindowProcessManager.GetSimulatorProcess() == null) + { + await ApplicationClose(); + Environment.Exit(0); + } + }; + } } } diff --git a/Orchestration/Orchestration.csproj b/Orchestration/Orchestration.csproj index 1ae0f32..fa8c4a2 100644 --- a/Orchestration/Orchestration.csproj +++ b/Orchestration/Orchestration.csproj @@ -10,9 +10,9 @@ https://github.com/hawkeye-stan/msfs-popout-panel-manager MSFSPopoutPanelManager.Orchestration x64 - 3.4.4.1011 - 3.4.4.1011 - 3.4.4.1011 + 3.4.5.0 + 3.4.5.0 + 3.4.5.0 win-x64 Embedded Debug;Release;DebugTouchPanel;ReleaseTouchPanel diff --git a/Orchestration/PanelPopOutOrchestrator.cs b/Orchestration/PanelPopOutOrchestrator.cs index 8016748..45b43bb 100644 --- a/Orchestration/PanelPopOutOrchestrator.cs +++ b/Orchestration/PanelPopOutOrchestrator.cs @@ -3,6 +3,7 @@ using MSFSPopoutPanelManager.UserDataAgent; using MSFSPopoutPanelManager.WindowsAgent; using System; using System.Collections.Generic; +using System.Collections.ObjectModel; using System.Drawing; using System.Linq; using System.Threading; @@ -77,6 +78,7 @@ namespace MSFSPopoutPanelManager.Orchestration Thread.Sleep(2000); _builtInPanelConfigDelay = 4000; + CorePopOutSteps(); } } @@ -484,24 +486,30 @@ namespace MSFSPopoutPanelManager.Orchestration // If profile is unlocked, add any new panel into profile if (!ActiveProfile.IsLocked) { + // Need this to fix collectionview modification thread issue + var finalPanelConfigs = ActiveProfile.PanelConfigs.ToList(); + var isAdded = false; - panelResults.ForEach(panel => + foreach (var panel in panelResults) { - if (panel.PanelType == PanelType.BuiltInPopout && !ActiveProfile.PanelConfigs.Any(s => s.PanelName == panel.PanelName)) + if ((panel.PanelType == PanelType.BuiltInPopout || panel.PanelType == PanelType.MSFSTouchPanel) && !ActiveProfile.PanelConfigs.Any(s => s.PanelName == panel.PanelName)) { - ActiveProfile.PanelConfigs.Add(panel); + finalPanelConfigs.Add(panel); isAdded = true; } else if (panel.PanelType == PanelType.CustomPopout && !ActiveProfile.PanelConfigs.Any(s => s.PanelIndex == panel.PanelIndex)) { - ActiveProfile.PanelConfigs.Add(panel); + finalPanelConfigs.Add(panel); isAdded = true; } - }); + } if (isAdded) + { + ActiveProfile.PanelConfigs = new ObservableCollection(finalPanelConfigs); ProfileData.WriteProfiles(); + } } // Apply full screen (cannot combine with always on top or hide title bar) diff --git a/ReactClient/public/config/PlanePanelProfile.json b/ReactClient/public/config/PlanePanelProfile.json index 3f390b3..7908aa9 100644 --- a/ReactClient/public/config/PlanePanelProfile.json +++ b/ReactClient/public/config/PlanePanelProfile.json @@ -9,7 +9,7 @@ "rootPath": "kodiak", "panelSize": { "width": 2458, - "height": 1310 + "height": 1280 }, "showMenuBar": true, "enableMap": true, @@ -29,7 +29,7 @@ "definitions": "KODIAK_ELECTRICAL_DEF", "rootPath": "electrical", "left": 0, - "top": 915, + "top": 910, "scale": 1 }, { @@ -38,7 +38,7 @@ "definitions": "KODIAK_LIGHTS_DEF", "rootPath": "lights", "left": 830, - "top": 915, + "top": 910, "scale": 1 }, { @@ -46,7 +46,7 @@ "name": "Fuel", "definitions": "KODIAK_FUEL_DEF", "rootPath": "fuel", - "left": 1770, + "left": 1765, "top": 980, "scale": 1 }, @@ -55,12 +55,61 @@ "name": "Oxygen", "definitions": "KODIAK_OXYGEN_DEF", "rootPath": "oxygen", - "left": 2230, + "left": 2215, "top": 985, "scale": 1 } ] }, + { + "panelId": "kodiak-wo-pfd-mfd", + "name": "Kodiak Full Instrumentation without PFD/MFD", + "rootPath": "kodiak", + "panelSize": { + "width": 2458, + "height": 380 + }, + "showMenuBar": false, + "enableMap": false, + "subPanels": [ + { + "panelId": "electrical", + "name": "Electrical", + "definitions": "KODIAK_ELECTRICAL_DEF", + "rootPath": "electrical", + "left": 0, + "top": 0, + "scale": 0.8 + }, + { + "panelId": "lights", + "name": "Lights", + "definitions": "KODIAK_LIGHTS_DEF", + "rootPath": "lights", + "left": 850, + "top": 0, + "scale": 0.8 + }, + { + "panelId": "fuel", + "name": "Fuel", + "definitions": "KODIAK_FUEL_DEF", + "rootPath": "fuel", + "left": 1825, + "top": 75, + "scale": 0.8 + }, + { + "panelId": "oxygen", + "name": "Oxygen", + "definitions": "KODIAK_OXYGEN_DEF", + "rootPath": "oxygen", + "left": 2350, + "top": 75, + "scale": 0.8 + } + ] + }, { "panelId": "kodiak-pfd", "name": "Kodiak PFD", @@ -249,6 +298,46 @@ } ] }, + { + "panelId": "pmdg-737-700-full-instrumentation-no-mcp", + "name": "PMDG 737 Full Instrumentation without MCP", + "rootPath": "pmdg-737-700", + "panelSize": { + "width": 1920, + "height": 900 + }, + "showMenuBar": false, + "enableMap": false, + "subPanels": [ + { + "panelId": "radio", + "name": "Radio", + "rootPath": "radio", + "definitions": "PMDG_737_700_RADIO_DEF", + "left": 200, + "top": 25, + "scale": 1.4 + }, + { + "panelId": "efis-cpt", + "name": "EFIS-CPT", + "rootPath": "efis-cpt", + "definitions": "PMDG_737_700_EFIS_CPT_DEF", + "left": 100, + "top": 525, + "scale": 1.2 + }, + { + "panelId": "xpndr", + "name": "XPNDR", + "rootPath": "xpndr", + "definitions": "PMDG_737_700_XPNDR_DEF", + "left": 750, + "top": 550, + "scale": 1.4 + } + ] + }, { "panelId": "pmdg-737-700-mcp", "name": "PMDG 737 MCP", diff --git a/ReactClient/src/App/ApplicationBar.js b/ReactClient/src/App/ApplicationBar.js index ffff9f1..ee72a73 100644 --- a/ReactClient/src/App/ApplicationBar.js +++ b/ReactClient/src/App/ApplicationBar.js @@ -29,8 +29,8 @@ const useStyles = makeStyles(() => ({ alignItems: 'center', }, menuButton: { - marginRight: '0.5em', - marginLeft: '0.5em' + marginRight: '0.25em', + marginLeft: '0.25em' }, networkConnected: { color: 'lightgreen' diff --git a/ReactClient/src/App/PopoutPanelContainer.js b/ReactClient/src/App/PopoutPanelContainer.js index 00857e7..3161615 100644 --- a/ReactClient/src/App/PopoutPanelContainer.js +++ b/ReactClient/src/App/PopoutPanelContainer.js @@ -18,6 +18,7 @@ const useStyles = makeStyles((theme) => ({ backgroundColor: theme.palette.background, backgroundImage: (props) => `url(/config/profiles/${props.parentRootPath}/${props.rootPath}/img/${props.backgroundImage})`, aspectRatio: (props) => `${props.panelSize.width}/${props.panelSize.height}`, + width: (props) => `calc(${props.panelSize.width} / ${props.parentPanelSize.width} * ${props.scale} * 100vw)`, backgroundRepeat: 'no-repeat', backgroundSize: '100% 100%', zIndex: 1000 diff --git a/ReactClient/src/App/Telemetry.js b/ReactClient/src/App/Telemetry.js index a3e3f78..ef2a19d 100644 --- a/ReactClient/src/App/Telemetry.js +++ b/ReactClient/src/App/Telemetry.js @@ -22,9 +22,8 @@ const useStyles = makeStyles((theme) => ({ display: 'flex', flexDirection: 'row', alignItems: 'center', - justifyContent: 'space-between', - paddingLeft: '30px', - paddingRight: '30px', + justifyContent: 'space-around', + minHeight: '1.5em', borderLeft: '1px solid gray', borderRight: '1px solid gray', @@ -72,7 +71,7 @@ const Telemetry = () => { - Elevator Trim: + Elev Trim: {ELEVATOR_TRIM === undefined ? 0 : ELEVATOR_TRIM} diff --git a/ReactClient/src/App/WebPanel.js b/ReactClient/src/App/WebPanel.js index 952e598..83c8337 100644 --- a/ReactClient/src/App/WebPanel.js +++ b/ReactClient/src/App/WebPanel.js @@ -57,9 +57,8 @@ const useStyles = props => makeStyles((theme) => ({ position: 'absolute', backgroundRepeat: 'no-repeat', backgroundSize: '100%', - width: '80%', - height: '80%', - + width: '100%', + height: '100%' }, })); @@ -97,6 +96,10 @@ const WebPanel = ({ planeId, panelId }) => { styleClasses.push(classes.subPanelBase); return styleClasses; } + + // const setupSubPanelLocationStyle = (subPanel) => { + // return { left: subPanel.left + '%', top: subPanel.top + '%' }; + // } const setupSubPanelLocationStyle = (subPanel) => { return { left: (subPanel.left / panelProfile.panelSize.width * 100.0) + '%', top: (subPanel.top / panelProfile.panelSize.height * 100.0) + '%' }; diff --git a/Shared/Shared.csproj b/Shared/Shared.csproj index 3dc2a2e..018dcbf 100644 --- a/Shared/Shared.csproj +++ b/Shared/Shared.csproj @@ -11,9 +11,9 @@ https://github.com/hawkeye-stan/msfs-popout-panel-manager MSFSPopoutPanelManager.Shared x64 - 3.4.4.1011 - 3.4.4.1011 - 3.4.4.1011 + 3.4.5.0 + 3.4.5.0 + 3.4.5.0 win-x64 Embedded Debug;Release;DebugTouchPanel;ReleaseTouchPanel diff --git a/SimconnectAgent/SimconnectAgent.csproj b/SimconnectAgent/SimconnectAgent.csproj index bcdf05a..af8db70 100644 --- a/SimconnectAgent/SimconnectAgent.csproj +++ b/SimconnectAgent/SimconnectAgent.csproj @@ -11,9 +11,9 @@ https://github.com/hawkeye-stan/msfs-popout-panel-manager MSFSPopoutPanelManager.SimConnectAgent x64 - 3.4.4.1011 - 3.4.4.1011 - 3.4.4.1011 + 3.4.5.0 + 3.4.5.0 + 3.4.5.0 win-x64 Embedded Debug;Release;DebugTouchPanel;ReleaseTouchPanel diff --git a/SimconnectAgent/TouchPanel/ActionProvider.cs b/SimconnectAgent/TouchPanel/ActionProvider.cs index 4d5c3d4..f098838 100644 --- a/SimconnectAgent/TouchPanel/ActionProvider.cs +++ b/SimconnectAgent/TouchPanel/ActionProvider.cs @@ -111,7 +111,7 @@ namespace MSFSPopoutPanelManager.SimConnectAgent.TouchPanel Thread.Sleep(500); if (!_isExecutingCommand) { - InputEmulationManager.RefocusGameWindow(); + InputEmulationManager.RefocusGameWindow(PanelType.MSFSTouchPanel); } }); } diff --git a/TouchPanelAgent/TouchPanelAgent.csproj b/TouchPanelAgent/TouchPanelAgent.csproj index 64de13a..4d88009 100644 --- a/TouchPanelAgent/TouchPanelAgent.csproj +++ b/TouchPanelAgent/TouchPanelAgent.csproj @@ -11,9 +11,9 @@ https://github.com/hawkeye-stan/msfs-popout-panel-manager MSFSPopoutPanelManager.TouchPanelAgent x64 - 3.4.4.1011 - 3.4.4.1011 - 3.4.4.1011 + 3.4.5.0 + 3.4.5.0 + 3.4.5.0 win-x64 Embedded Debug;Release;DebugTouchPanel;ReleaseTouchPanel diff --git a/UserDataAgent/AppSetting.cs b/UserDataAgent/AppSetting.cs index 5ee52d4..e589966 100644 --- a/UserDataAgent/AppSetting.cs +++ b/UserDataAgent/AppSetting.cs @@ -15,6 +15,7 @@ namespace MSFSPopoutPanelManager.UserDataAgent AlwaysOnTop = true; MinimizeToTray = false; StartMinimized = false; + AutoClose = true; AutoPopOutPanels = true; @@ -58,6 +59,8 @@ namespace MSFSPopoutPanelManager.UserDataAgent public bool AlwaysOnTop { get; set; } + public bool AutoClose { get; set; } + public bool UseAutoPanning { get; set; } public bool MinimizeAfterPopOut { get; set; } diff --git a/UserDataAgent/UserDataAgent.csproj b/UserDataAgent/UserDataAgent.csproj index 39e1e7c..5e9fa89 100644 --- a/UserDataAgent/UserDataAgent.csproj +++ b/UserDataAgent/UserDataAgent.csproj @@ -10,9 +10,9 @@ https://github.com/hawkeye-stan/msfs-popout-panel-manager MSFSPopoutPanelManager.UserDataAgent x64 - 3.4.4.1011 - 3.4.4.1011 - 3.4.4.1011 + 3.4.5.0 + 3.4.5.0 + 3.4.5.0 win-x64 Embedded Debug;Release;DebugTouchPanel;ReleaseTouchPanel diff --git a/VERSION.md b/VERSION.md index 26cbbfc..4cea722 100644 --- a/VERSION.md +++ b/VERSION.md @@ -1,6 +1,11 @@ # Version History
+## Version 3.4.5 +* Added new preference option by default to auto close MSFS Pop Out Manager when MSFS exits. + +* Fixed an issue when using "Power on required to pop out panels for cold start" for G1000 and G3000 equipped aircraft, the pop out process gets stuck during the final step after panels have been popped out but before battery and avionics are to be turned off. + ## Version 3.4.4.1011 * Hot fix: Reverted to previous implementation of touch setting's mouse cursor automatic refocus to center of MSFS game screen instead to the upper left corner of the pop out panel where it is being touched. diff --git a/WebServer/WebServer.csproj b/WebServer/WebServer.csproj index 49cf187..19f800e 100644 --- a/WebServer/WebServer.csproj +++ b/WebServer/WebServer.csproj @@ -11,9 +11,9 @@ https://github.com/hawkeye-stan/msfs-popout-panel-manager MSFSPopoutPanelManager.WebServer x64 - 3.4.4.1011 - 3.4.4.1011 - 3.4.4.1011 + 3.4.5.0 + 3.4.5.0 + 3.4.5.0 win-x64 Embedded Debug;Release;DebugTouchPanel;ReleaseTouchPanel diff --git a/WindowsAgent/InputEmulationManager.cs b/WindowsAgent/InputEmulationManager.cs index 1296d0d..5ccdb24 100644 --- a/WindowsAgent/InputEmulationManager.cs +++ b/WindowsAgent/InputEmulationManager.cs @@ -1,4 +1,5 @@ -using System; +using MSFSPopoutPanelManager.Shared; +using System; using System.Drawing; using System.Threading; using WindowsInput; @@ -194,7 +195,7 @@ namespace MSFSPopoutPanelManager.WindowsAgent PInvoke.keybd_event(Convert.ToByte(VK_RMENU), 0, KEYEVENTF_KEYUP, 0); } - public static void RefocusGameWindow() + public static void RefocusGameWindow(PanelType panelType) { var simualatorProcess = WindowProcessManager.GetSimulatorProcess(); if (simualatorProcess == null) @@ -203,7 +204,10 @@ namespace MSFSPopoutPanelManager.WindowsAgent var rectangle = WindowActionManager.GetWindowRect(simualatorProcess.Handle); var clientRectangle = WindowActionManager.GetClientRect(simualatorProcess.Handle); - PInvoke.SetCursorPos(rectangle.X + clientRectangle.Width / 2, rectangle.Y + clientRectangle.Height / 2); + if (panelType == PanelType.MSFSTouchPanel) + InputEmulationManager.LeftClick(rectangle.X + clientRectangle.Width / 2, rectangle.Y + clientRectangle.Height / 2); + else + PInvoke.SetCursorPos(rectangle.X + clientRectangle.Width / 2, rectangle.Y + clientRectangle.Height / 2); } } diff --git a/WindowsAgent/WindowsAgent.csproj b/WindowsAgent/WindowsAgent.csproj index 552bef1..33fd996 100644 --- a/WindowsAgent/WindowsAgent.csproj +++ b/WindowsAgent/WindowsAgent.csproj @@ -11,9 +11,9 @@ https://github.com/hawkeye-stan/msfs-popout-panel-manager MSFSPopoutPanelManager.WindowsAgent x64 - 3.4.4.1011 - 3.4.4.1011 - 3.4.4.1011 + 3.4.5.0 + 3.4.5.0 + 3.4.5.0 win-x64 Embedded Debug;Release;DebugTouchPanel;ReleaseTouchPanel diff --git a/WpfApp/PreferencesDialog.xaml b/WpfApp/PreferencesDialog.xaml index c73a8e3..2355d11 100644 --- a/WpfApp/PreferencesDialog.xaml +++ b/WpfApp/PreferencesDialog.xaml @@ -97,6 +97,13 @@ Start the application in minimized mode in system tray. + + Auto Close When Exiting MSFS + + + Automatically close the application when exiting MSFS. + + diff --git a/WpfApp/UserControlPanelSelection.xaml b/WpfApp/UserControlPanelSelection.xaml index f14b552..c08b340 100644 --- a/WpfApp/UserControlPanelSelection.xaml +++ b/WpfApp/UserControlPanelSelection.xaml @@ -76,7 +76,7 @@