diff --git a/DomainModel/DomainModel.csproj b/DomainModel/DomainModel.csproj index 2795b56..539c35f 100644 --- a/DomainModel/DomainModel.csproj +++ b/DomainModel/DomainModel.csproj @@ -11,9 +11,9 @@ https://github.com/hawkeye-stan/msfs-popout-panel-manager MSFSPopoutPanelManager.DomainModel x64 - 4.0.2.2 - 4.0.2.2 - 4.0.2.2 + 4.0.2.3 + 4.0.2.3 + 4.0.2.3 win-x64 Embedded Debug;Release;Local diff --git a/DomainModel/Profile/UserProfile.cs b/DomainModel/Profile/UserProfile.cs index 846b51f..ad69e31 100644 --- a/DomainModel/Profile/UserProfile.cs +++ b/DomainModel/Profile/UserProfile.cs @@ -19,6 +19,7 @@ namespace MSFSPopoutPanelManager.DomainModel.Profile PanelConfigs = new ObservableCollection(); ProfileSetting = new ProfileSetting(); MsfsGameWindowConfig = new MsfsGameWindowConfig(); + HomeCockpitModeZoomFactor = 50; this.PropertyChanged += (sender, e) => { @@ -74,6 +75,8 @@ namespace MSFSPopoutPanelManager.DomainModel.Profile public MsfsGameWindowConfig MsfsGameWindowConfig { get; set; } + public int HomeCockpitModeZoomFactor { get; set; } + public int CompareTo(UserProfile other) { int result = this.Name.ToLower().CompareTo(other.Name.ToLower()); diff --git a/DomainModel/Setting/KeyboardShortcutSetting.cs b/DomainModel/Setting/KeyboardShortcutSetting.cs index 3d95a26..583ce06 100644 --- a/DomainModel/Setting/KeyboardShortcutSetting.cs +++ b/DomainModel/Setting/KeyboardShortcutSetting.cs @@ -7,7 +7,7 @@ namespace MSFSPopoutPanelManager.DomainModel.Setting public KeyboardShortcutSetting() { IsEnabled = true; - StartPopOutKeyBinding = "P"; + StartPopOutKeyBinding = "O"; } public bool IsEnabled { get; set; } diff --git a/MainApp/MainApp.csproj b/MainApp/MainApp.csproj index 45fa36e..9c42bdd 100644 --- a/MainApp/MainApp.csproj +++ b/MainApp/MainApp.csproj @@ -14,9 +14,9 @@ MSFSPopoutPanelManager.MainApp logo.ico x64 - 4.0.2.2 - 4.0.2.2 - 4.0.2.2 + 4.0.2.3 + 4.0.2.3 + 4.0.2.3 embedded en diff --git a/Orchestration/Orchestration.csproj b/Orchestration/Orchestration.csproj index 7d0cf34..26a879d 100644 --- a/Orchestration/Orchestration.csproj +++ b/Orchestration/Orchestration.csproj @@ -11,9 +11,9 @@ https://github.com/hawkeye-stan/msfs-popout-panel-manager MSFSPopoutPanelManager.Orchestration x64 - 4.0.2.2 - 4.0.2.2 - 4.0.2.2 + 4.0.2.3 + 4.0.2.3 + 4.0.2.3 win-x64 Embedded Debug;Release;Local diff --git a/Orchestration/PanelPopOutOrchestrator.cs b/Orchestration/PanelPopOutOrchestrator.cs index b7f0558..5bbb3dc 100644 --- a/Orchestration/PanelPopOutOrchestrator.cs +++ b/Orchestration/PanelPopOutOrchestrator.cs @@ -15,6 +15,8 @@ namespace MSFSPopoutPanelManager.Orchestration { // This will be replaced by a signal from Ready to Fly Skipper into webserver in version 4.0 private const int READY_TO_FLY_BUTTON_APPEARANCE_DELAY = 2000; + private const int CAMERA_VIEW_HOME_COCKPIT_MODE = 8; + private const int CAMERA_VIEW_CUSTOM_CAMERA = 7; private ProfileData _profileData; private AppSettingData _appSettingData; @@ -110,6 +112,8 @@ namespace MSFSPopoutPanelManager.Orchestration await StepPostPopout(); + OnPopOutCompleted?.Invoke(this, null); + StatusMessageWriter.IsEnabled = false; } @@ -194,26 +198,33 @@ namespace MSFSPopoutPanelManager.Orchestration if (AppSetting.PopOutSetting.AutoPanning.IsEnabled) { StatusMessageWriter.WriteMessageWithNewLine("Setting auto panning camera view", StatusMessageType.Info); - - // Remember current game's zoom level to be recall after pop out - _prePopOutCockpitZoomLevel = _flightSimData.CockpitCameraZoom; - - WorkflowStepWithMessage.Execute("Resetting camera view", () => + + if (_flightSimData.CameraViewTypeAndIndex1 == CAMERA_VIEW_HOME_COCKPIT_MODE) { - ResetCockpitView(); - Thread.Sleep(2000); - }, true); - - WorkflowStepWithMessage.Execute("Loading custom camera view", () => + SetCockpitZoomLevel(_profileData.ActiveProfile.HomeCockpitModeZoomFactor); + } + else { - LoadCustomView(AppSetting.PopOutSetting.AutoPanning.KeyBinding); - Thread.Sleep(2000); - }, true); + // Remember current game's zoom level to be recall after pop out + _prePopOutCockpitZoomLevel = _flightSimData.CockpitCameraZoom; - WorkflowStepWithMessage.Execute("Setting camera zoom level", () => - { - SetCockpitZoomLevel(50); - }, true); + WorkflowStepWithMessage.Execute("Resetting camera view", () => + { + ResetCockpitView(); + Thread.Sleep(2000); + }, true); + + WorkflowStepWithMessage.Execute("Loading custom camera view", () => + { + LoadCustomView(AppSetting.PopOutSetting.AutoPanning.KeyBinding); + Thread.Sleep(2000); + }, true); + + WorkflowStepWithMessage.Execute("Setting camera zoom level", () => + { + SetCockpitZoomLevel(50); + }, true); + } } }); } @@ -412,9 +423,6 @@ namespace MSFSPopoutPanelManager.Orchestration StatusMessageWriter.WriteMessageWithNewLine("Pop out has been completed with error.", StatusMessageType.Info); else StatusMessageWriter.WriteMessageWithNewLine("Pop out has been completed successfully.", StatusMessageType.Info); - - Thread.Sleep(1000); - OnPopOutCompleted?.Invoke(this, null); }); } @@ -523,40 +531,47 @@ namespace MSFSPopoutPanelManager.Orchestration StatusMessageWriter.WriteMessageWithNewLine("Applying cockpit view after pop out", StatusMessageType.Info); - switch (AppSetting.PopOutSetting.AfterPopOutCameraView.CameraView) + if (_flightSimData.CameraViewTypeAndIndex1 == CAMERA_VIEW_HOME_COCKPIT_MODE) { - case AfterPopOutCameraViewType.CockpitCenterView: - WorkflowStepWithMessage.Execute("Resetting camera view", () => - { - ResetCockpitView(); - Thread.Sleep(1000); - }, true); + FlightSimOrchestrator.ResetCameraView(); + } + else + { + switch (AppSetting.PopOutSetting.AfterPopOutCameraView.CameraView) + { + case AfterPopOutCameraViewType.CockpitCenterView: + WorkflowStepWithMessage.Execute("Resetting camera view", () => + { + ResetCockpitView(); + Thread.Sleep(1000); + }, true); - WorkflowStepWithMessage.Execute("Setting camera zoom level", () => - { - SetCockpitZoomLevel(_prePopOutCockpitZoomLevel); - }, true); + WorkflowStepWithMessage.Execute("Setting camera zoom level", () => + { + SetCockpitZoomLevel(_prePopOutCockpitZoomLevel); + }, true); - break; - case AfterPopOutCameraViewType.CustomCameraView: - WorkflowStepWithMessage.Execute("Resetting camera view", () => - { - ResetCockpitView(); - Thread.Sleep(1000); - }, true); + break; + case AfterPopOutCameraViewType.CustomCameraView: + WorkflowStepWithMessage.Execute("Resetting camera view", () => + { + ResetCockpitView(); + Thread.Sleep(1000); + }, true); - WorkflowStepWithMessage.Execute("Loading custom camera view", () => - { - LoadCustomView(AppSetting.PopOutSetting.AfterPopOutCameraView.KeyBinding); - Thread.Sleep(1000); - }, true); + WorkflowStepWithMessage.Execute("Loading custom camera view", () => + { + LoadCustomView(AppSetting.PopOutSetting.AfterPopOutCameraView.KeyBinding); + Thread.Sleep(1000); + }, true); - WorkflowStepWithMessage.Execute("Setting camera zoom level", () => - { - SetCockpitZoomLevel(_prePopOutCockpitZoomLevel); - }, true); + WorkflowStepWithMessage.Execute("Setting camera zoom level", () => + { + SetCockpitZoomLevel(_prePopOutCockpitZoomLevel); + }, true); - break; + break; + } } } @@ -583,8 +598,8 @@ namespace MSFSPopoutPanelManager.Orchestration for(var i = 0; i < retry; i++) { InputEmulationManager.LoadCustomView(keybinding); - Thread.Sleep(1000); // wait for flightsimdata to be updated - if (_flightSimData.CameraViewTypeAndIndex1 == 7) // 7 = custom camera view enum + Thread.Sleep(750); // wait for flightsimdata to be updated + if (_flightSimData.CameraViewTypeAndIndex1 == CAMERA_VIEW_CUSTOM_CAMERA) // custom camera view enum break; } } @@ -595,7 +610,7 @@ namespace MSFSPopoutPanelManager.Orchestration for (var i = 0; i < retry; i++) { FlightSimOrchestrator.SetCockpitCameraZoomLevel(zoom); - Thread.Sleep(1000); // wait for flightsimdata to be updated + Thread.Sleep(750); // wait for flightsimdata to be updated if (_flightSimData.CockpitCameraZoom == zoom) break; diff --git a/Orchestration/PanelSourceOrchestrator.cs b/Orchestration/PanelSourceOrchestrator.cs index 130dd02..4f84cd9 100644 --- a/Orchestration/PanelSourceOrchestrator.cs +++ b/Orchestration/PanelSourceOrchestrator.cs @@ -11,6 +11,9 @@ namespace MSFSPopoutPanelManager.Orchestration { public class PanelSourceOrchestrator : ObservableObject { + private const int CAMERA_VIEW_HOME_COCKPIT_MODE = 8; + private const int CAMERA_VIEW_CUSTOM_CAMERA = 7; + private ProfileData _profileData; private AppSettingData _appSettingData; private FlightSimData _flightSimData; @@ -62,8 +65,17 @@ namespace MSFSPopoutPanelManager.Orchestration if (AppSetting.PopOutSetting.AutoPanning.IsEnabled) { _prePanelConfigurationCockpitZoomLevel = _flightSimData.CockpitCameraZoom; - LoadCustomView(AppSetting.PopOutSetting.AutoPanning.KeyBinding); - SetCockpitZoomLevel(50); + + if(_flightSimData.CameraViewTypeAndIndex1 == CAMERA_VIEW_HOME_COCKPIT_MODE) + { + FlightSimOrchestrator.SetCockpitCameraZoomLevel(_profileData.ActiveProfile.HomeCockpitModeZoomFactor); + } + else + { + LoadCustomView(AppSetting.PopOutSetting.AutoPanning.KeyBinding); + SetCockpitZoomLevel(50); + } + WindowActionManager.BringWindowToForeground(ApplicationHandle); } }); @@ -88,41 +100,55 @@ namespace MSFSPopoutPanelManager.Orchestration // Save last auto panning camera angle if (AppSetting.PopOutSetting.AutoPanning.IsEnabled) { - // !!! Fix MSFS bug that without setting zoom, everything will be off by few pixels - FlightSimOrchestrator.SetCockpitCameraZoomLevel(_flightSimData.CockpitCameraZoom); - // If using windows mode, save MSFS game window configuration if (_appSettingData.ApplicationSetting.WindowedModeSetting.AutoResizeMsfsGameWindow) _profileData.SaveMsfsGameWindowConfig(); - InputEmulationManager.SaveCustomView(AppSetting.PopOutSetting.AutoPanning.KeyBinding); + if (_flightSimData.CameraViewTypeAndIndex1 == CAMERA_VIEW_HOME_COCKPIT_MODE) + { + _profileData.ActiveProfile.HomeCockpitModeZoomFactor = _flightSimData.CockpitCameraZoom; + } + else + { + // !!! Fix MSFS bug that without setting zoom, everything will be off by few pixels + FlightSimOrchestrator.SetCockpitCameraZoomLevel(_flightSimData.CockpitCameraZoom); + + InputEmulationManager.SaveCustomView(AppSetting.PopOutSetting.AutoPanning.KeyBinding); + } } await Task.Run(() => { Thread.Sleep(500); // wait for custom view save to be completed - // Recenter game or return to after pop out camera view - if (!AppSetting.PopOutSetting.AfterPopOutCameraView.IsEnabled) + if (_flightSimData.CameraViewTypeAndIndex1 == CAMERA_VIEW_HOME_COCKPIT_MODE) { FlightSimOrchestrator.ResetCameraView(); - SetCockpitZoomLevel(_prePanelConfigurationCockpitZoomLevel); } else { - switch (AppSetting.PopOutSetting.AfterPopOutCameraView.CameraView) + // Recenter game or return to after pop out camera view + if (!AppSetting.PopOutSetting.AfterPopOutCameraView.IsEnabled) { - case AfterPopOutCameraViewType.CockpitCenterView: - FlightSimOrchestrator.ResetCameraView(); - SetCockpitZoomLevel(_prePanelConfigurationCockpitZoomLevel); - break; - case AfterPopOutCameraViewType.CustomCameraView: - LoadCustomView(AppSetting.PopOutSetting.AfterPopOutCameraView.KeyBinding); - SetCockpitZoomLevel(_prePanelConfigurationCockpitZoomLevel); - break; + FlightSimOrchestrator.ResetCameraView(); + SetCockpitZoomLevel(_prePanelConfigurationCockpitZoomLevel); + } + else + { + switch (AppSetting.PopOutSetting.AfterPopOutCameraView.CameraView) + { + case AfterPopOutCameraViewType.CockpitCenterView: + FlightSimOrchestrator.ResetCameraView(); + SetCockpitZoomLevel(_prePanelConfigurationCockpitZoomLevel); + break; + case AfterPopOutCameraViewType.CustomCameraView: + LoadCustomView(AppSetting.PopOutSetting.AfterPopOutCameraView.KeyBinding); + SetCockpitZoomLevel(_prePanelConfigurationCockpitZoomLevel); + break; + } } } - + WindowActionManager.BringWindowToForeground(ApplicationHandle); // Turn TrackIR back on @@ -195,7 +221,7 @@ namespace MSFSPopoutPanelManager.Orchestration { InputEmulationManager.LoadCustomView(keybinding); Thread.Sleep(750); // wait for flightsimdata to be updated - if (_flightSimData.CameraViewTypeAndIndex1 == 7) // 7 = custom camera view enum + if (_flightSimData.CameraViewTypeAndIndex1 == CAMERA_VIEW_CUSTOM_CAMERA) // custom camera view enum break; } } diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 195a8e6..26ceaaa 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -1,12 +1,16 @@ ## Version 4.0.2 +********* NOTE: The speed for Pop Out Panel Manager to execute pop outs will be slower than previous version because latest version MSFS had made existing POPM logic to not work reliably. Updated pop out logic requires wider timing threshold which unfortunately resulted in slower pop out speed. ********* + * Added new logic to detect when flight session is ready to initiate pop out process for auto pop out panel. -* Updated logic to load custom camera view when performing pop out. The new logic is more reliable but unfornately will be a little slower because MSFS AAU2 may have introduced issue in loading and saving camera view. Pop out progress messages will show steps being taken when adjusting camera view. +* Updated logic to save and load custom camera view when performing pop out to workaround AAU2 issues. Pop out progress messages will now show steps being taken when adjusting camera view. * Added workaround for MSFS bug when using cockpit camera zoom setting is set with value other than 50 in MSFS general options. Pop out was failing before because saving and loading custom camera view does not work correctly in MSFS. * Added workaround for CJ4 CDU panel not popping out because of MSFS bug. -* Added configurable keyboard shortcut to initiate pop out process (default is Ctrl-Shift-P). This keyboard shortcut can be configured in preference setting. This setting can be disabled to improve computing resource needed to constantly detect keyboard inputs. +* Added configurable keyboard shortcut to initiate pop out process (default is Ctrl-Shift-O). This keyboard shortcut can be configured in preference setting. This setting can be disabled to improve computing resource needed to constantly detect keyboard inputs. + +* Added separate logic to configure panels if using camera options of Home Cockpit Mode. Since in this mode, saving and loading of custom camera angle to define pop out panels is not avaible, new updated logic is needed. * Fixed issue where full screen mode for pop out panel does not work on certain aircraft configuration. \ No newline at end of file diff --git a/Shared/Shared.csproj b/Shared/Shared.csproj index 3ab7449..e02c96a 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 - 4.0.2.2 - 4.0.2.2 - 4.0.2.2 + 4.0.2.3 + 4.0.2.3 + 4.0.2.3 win-x64 Embedded Debug;Release;Local diff --git a/SimconnectAgent/SimconnectAgent.csproj b/SimconnectAgent/SimconnectAgent.csproj index c3786fb..b5b706a 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 - 4.0.2.2 - 4.0.2.2 - 4.0.2.2 + 4.0.2.3 + 4.0.2.3 + 4.0.2.3 win-x64 Embedded Debug;Release;Local diff --git a/VERSION.md b/VERSION.md index 353975f..920fed1 100644 --- a/VERSION.md +++ b/VERSION.md @@ -2,15 +2,19 @@
## Version 4.0.2 +********* NOTE: The speed for Pop Out Panel Manager to execute pop outs will be slower than previous version because latest version MSFS had made existing POPM logic to not work reliably. Updated pop out logic requires wider timing threshold which unfortunately resulted in slower pop out speed. ********* + * Added new logic to detect when flight session is ready to initiate pop out process for auto pop out panel. -* Updated logic to load custom camera view when performing pop out. The new logic is more reliable but unfornately will be a little slower because MSFS AAU2 may have introduced issue in loading and saving camera view. Pop out progress messages will show steps being taken when adjusting camera view. +* Updated logic to save and load custom camera view when performing pop out to workaround AAU2 issues. Pop out progress messages will now show steps being taken when adjusting camera view. * Added workaround for MSFS bug when using cockpit camera zoom setting is set with value other than 50 in MSFS general options. Pop out was failing before because saving and loading custom camera view does not work correctly in MSFS. * Added workaround for CJ4 CDU panel not popping out because of MSFS bug. -* Added configurable keyboard shortcut to initiate pop out process (default is Ctrl-Shift-P). This keyboard shortcut can be configured in preference setting. This setting can be disabled to improve computing resource needed to constantly detect keyboard inputs. +* Added configurable keyboard shortcut to initiate pop out process (default is Ctrl-Shift-O). This keyboard shortcut can be configured in preference setting. This setting can be disabled to improve computing resource needed to constantly detect keyboard inputs. + +* Added separate logic to configure panels if using camera options of Home Cockpit Mode. Since in this mode, saving and loading of custom camera angle to define pop out panels is not avaible, new updated logic is needed. * Fixed issue where full screen mode for pop out panel does not work on certain aircraft configuration. diff --git a/WindowsAgent/WindowsAgent.csproj b/WindowsAgent/WindowsAgent.csproj index 38bceab..7d93258 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 - 4.0.2.2 - 4.0.2.2 - 4.0.2.2 + 4.0.2.3 + 4.0.2.3 + 4.0.2.3 win-x64 Embedded Debug;Release;Local