1
0
Fork 0
mirror of https://github.com/hawkeye-stan/msfs-popout-panel-manager.git synced 2024-11-21 21:30:12 +00:00

Update pop out logic and home cockpit mode logic

This commit is contained in:
hawkeye 2023-08-16 13:13:39 -04:00
parent 1999a5c84f
commit f1f8005820
12 changed files with 146 additions and 94 deletions

View file

@ -11,9 +11,9 @@
<PackageProjectUrl>https://github.com/hawkeye-stan/msfs-popout-panel-manager</PackageProjectUrl> <PackageProjectUrl>https://github.com/hawkeye-stan/msfs-popout-panel-manager</PackageProjectUrl>
<RootNamespace>MSFSPopoutPanelManager.DomainModel</RootNamespace> <RootNamespace>MSFSPopoutPanelManager.DomainModel</RootNamespace>
<Platforms>x64</Platforms> <Platforms>x64</Platforms>
<Version>4.0.2.2</Version> <Version>4.0.2.3</Version>
<AssemblyVersion>4.0.2.2</AssemblyVersion> <AssemblyVersion>4.0.2.3</AssemblyVersion>
<FileVersion>4.0.2.2</FileVersion> <FileVersion>4.0.2.3</FileVersion>
<RuntimeIdentifier>win-x64</RuntimeIdentifier> <RuntimeIdentifier>win-x64</RuntimeIdentifier>
<DebugType>Embedded</DebugType> <DebugType>Embedded</DebugType>
<Configurations>Debug;Release;Local</Configurations> <Configurations>Debug;Release;Local</Configurations>

View file

@ -19,6 +19,7 @@ namespace MSFSPopoutPanelManager.DomainModel.Profile
PanelConfigs = new ObservableCollection<PanelConfig>(); PanelConfigs = new ObservableCollection<PanelConfig>();
ProfileSetting = new ProfileSetting(); ProfileSetting = new ProfileSetting();
MsfsGameWindowConfig = new MsfsGameWindowConfig(); MsfsGameWindowConfig = new MsfsGameWindowConfig();
HomeCockpitModeZoomFactor = 50;
this.PropertyChanged += (sender, e) => this.PropertyChanged += (sender, e) =>
{ {
@ -74,6 +75,8 @@ namespace MSFSPopoutPanelManager.DomainModel.Profile
public MsfsGameWindowConfig MsfsGameWindowConfig { get; set; } public MsfsGameWindowConfig MsfsGameWindowConfig { get; set; }
public int HomeCockpitModeZoomFactor { get; set; }
public int CompareTo(UserProfile other) public int CompareTo(UserProfile other)
{ {
int result = this.Name.ToLower().CompareTo(other.Name.ToLower()); int result = this.Name.ToLower().CompareTo(other.Name.ToLower());

View file

@ -7,7 +7,7 @@ namespace MSFSPopoutPanelManager.DomainModel.Setting
public KeyboardShortcutSetting() public KeyboardShortcutSetting()
{ {
IsEnabled = true; IsEnabled = true;
StartPopOutKeyBinding = "P"; StartPopOutKeyBinding = "O";
} }
public bool IsEnabled { get; set; } public bool IsEnabled { get; set; }

View file

@ -14,9 +14,9 @@
<RootNamespace>MSFSPopoutPanelManager.MainApp</RootNamespace> <RootNamespace>MSFSPopoutPanelManager.MainApp</RootNamespace>
<ApplicationIcon>logo.ico</ApplicationIcon> <ApplicationIcon>logo.ico</ApplicationIcon>
<Platforms>x64</Platforms> <Platforms>x64</Platforms>
<Version>4.0.2.2</Version> <Version>4.0.2.3</Version>
<AssemblyVersion>4.0.2.2</AssemblyVersion> <AssemblyVersion>4.0.2.3</AssemblyVersion>
<FileVersion>4.0.2.2</FileVersion> <FileVersion>4.0.2.3</FileVersion>
<DebugType>embedded</DebugType> <DebugType>embedded</DebugType>
<SatelliteResourceLanguages>en</SatelliteResourceLanguages> <SatelliteResourceLanguages>en</SatelliteResourceLanguages>
<!-- Publishing options --> <!-- Publishing options -->

View file

@ -11,9 +11,9 @@
<PackageProjectUrl>https://github.com/hawkeye-stan/msfs-popout-panel-manager</PackageProjectUrl> <PackageProjectUrl>https://github.com/hawkeye-stan/msfs-popout-panel-manager</PackageProjectUrl>
<RootNamespace>MSFSPopoutPanelManager.Orchestration</RootNamespace> <RootNamespace>MSFSPopoutPanelManager.Orchestration</RootNamespace>
<Platforms>x64</Platforms> <Platforms>x64</Platforms>
<Version>4.0.2.2</Version> <Version>4.0.2.3</Version>
<AssemblyVersion>4.0.2.2</AssemblyVersion> <AssemblyVersion>4.0.2.3</AssemblyVersion>
<FileVersion>4.0.2.2</FileVersion> <FileVersion>4.0.2.3</FileVersion>
<RuntimeIdentifier>win-x64</RuntimeIdentifier> <RuntimeIdentifier>win-x64</RuntimeIdentifier>
<DebugType>Embedded</DebugType> <DebugType>Embedded</DebugType>
<Configurations>Debug;Release;Local</Configurations> <Configurations>Debug;Release;Local</Configurations>

View file

@ -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 // 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 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 ProfileData _profileData;
private AppSettingData _appSettingData; private AppSettingData _appSettingData;
@ -110,6 +112,8 @@ namespace MSFSPopoutPanelManager.Orchestration
await StepPostPopout(); await StepPostPopout();
OnPopOutCompleted?.Invoke(this, null);
StatusMessageWriter.IsEnabled = false; StatusMessageWriter.IsEnabled = false;
} }
@ -195,6 +199,12 @@ namespace MSFSPopoutPanelManager.Orchestration
{ {
StatusMessageWriter.WriteMessageWithNewLine("Setting auto panning camera view", StatusMessageType.Info); StatusMessageWriter.WriteMessageWithNewLine("Setting auto panning camera view", StatusMessageType.Info);
if (_flightSimData.CameraViewTypeAndIndex1 == CAMERA_VIEW_HOME_COCKPIT_MODE)
{
SetCockpitZoomLevel(_profileData.ActiveProfile.HomeCockpitModeZoomFactor);
}
else
{
// Remember current game's zoom level to be recall after pop out // Remember current game's zoom level to be recall after pop out
_prePopOutCockpitZoomLevel = _flightSimData.CockpitCameraZoom; _prePopOutCockpitZoomLevel = _flightSimData.CockpitCameraZoom;
@ -215,6 +225,7 @@ namespace MSFSPopoutPanelManager.Orchestration
SetCockpitZoomLevel(50); SetCockpitZoomLevel(50);
}, true); }, true);
} }
}
}); });
} }
@ -412,9 +423,6 @@ namespace MSFSPopoutPanelManager.Orchestration
StatusMessageWriter.WriteMessageWithNewLine("Pop out has been completed with error.", StatusMessageType.Info); StatusMessageWriter.WriteMessageWithNewLine("Pop out has been completed with error.", StatusMessageType.Info);
else else
StatusMessageWriter.WriteMessageWithNewLine("Pop out has been completed successfully.", StatusMessageType.Info); StatusMessageWriter.WriteMessageWithNewLine("Pop out has been completed successfully.", StatusMessageType.Info);
Thread.Sleep(1000);
OnPopOutCompleted?.Invoke(this, null);
}); });
} }
@ -523,6 +531,12 @@ namespace MSFSPopoutPanelManager.Orchestration
StatusMessageWriter.WriteMessageWithNewLine("Applying cockpit view after pop out", StatusMessageType.Info); StatusMessageWriter.WriteMessageWithNewLine("Applying cockpit view after pop out", StatusMessageType.Info);
if (_flightSimData.CameraViewTypeAndIndex1 == CAMERA_VIEW_HOME_COCKPIT_MODE)
{
FlightSimOrchestrator.ResetCameraView();
}
else
{
switch (AppSetting.PopOutSetting.AfterPopOutCameraView.CameraView) switch (AppSetting.PopOutSetting.AfterPopOutCameraView.CameraView)
{ {
case AfterPopOutCameraViewType.CockpitCenterView: case AfterPopOutCameraViewType.CockpitCenterView:
@ -559,6 +573,7 @@ namespace MSFSPopoutPanelManager.Orchestration
break; break;
} }
} }
}
private bool CheckForPopOutError() private bool CheckForPopOutError()
{ {
@ -583,8 +598,8 @@ namespace MSFSPopoutPanelManager.Orchestration
for(var i = 0; i < retry; i++) for(var i = 0; i < retry; i++)
{ {
InputEmulationManager.LoadCustomView(keybinding); InputEmulationManager.LoadCustomView(keybinding);
Thread.Sleep(1000); // wait for flightsimdata to be updated 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; break;
} }
} }
@ -595,7 +610,7 @@ namespace MSFSPopoutPanelManager.Orchestration
for (var i = 0; i < retry; i++) for (var i = 0; i < retry; i++)
{ {
FlightSimOrchestrator.SetCockpitCameraZoomLevel(zoom); 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) if (_flightSimData.CockpitCameraZoom == zoom)
break; break;

View file

@ -11,6 +11,9 @@ namespace MSFSPopoutPanelManager.Orchestration
{ {
public class PanelSourceOrchestrator : ObservableObject 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 ProfileData _profileData;
private AppSettingData _appSettingData; private AppSettingData _appSettingData;
private FlightSimData _flightSimData; private FlightSimData _flightSimData;
@ -62,8 +65,17 @@ namespace MSFSPopoutPanelManager.Orchestration
if (AppSetting.PopOutSetting.AutoPanning.IsEnabled) if (AppSetting.PopOutSetting.AutoPanning.IsEnabled)
{ {
_prePanelConfigurationCockpitZoomLevel = _flightSimData.CockpitCameraZoom; _prePanelConfigurationCockpitZoomLevel = _flightSimData.CockpitCameraZoom;
if(_flightSimData.CameraViewTypeAndIndex1 == CAMERA_VIEW_HOME_COCKPIT_MODE)
{
FlightSimOrchestrator.SetCockpitCameraZoomLevel(_profileData.ActiveProfile.HomeCockpitModeZoomFactor);
}
else
{
LoadCustomView(AppSetting.PopOutSetting.AutoPanning.KeyBinding); LoadCustomView(AppSetting.PopOutSetting.AutoPanning.KeyBinding);
SetCockpitZoomLevel(50); SetCockpitZoomLevel(50);
}
WindowActionManager.BringWindowToForeground(ApplicationHandle); WindowActionManager.BringWindowToForeground(ApplicationHandle);
} }
}); });
@ -88,20 +100,33 @@ namespace MSFSPopoutPanelManager.Orchestration
// Save last auto panning camera angle // Save last auto panning camera angle
if (AppSetting.PopOutSetting.AutoPanning.IsEnabled) 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 using windows mode, save MSFS game window configuration
if (_appSettingData.ApplicationSetting.WindowedModeSetting.AutoResizeMsfsGameWindow) if (_appSettingData.ApplicationSetting.WindowedModeSetting.AutoResizeMsfsGameWindow)
_profileData.SaveMsfsGameWindowConfig(); _profileData.SaveMsfsGameWindowConfig();
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); InputEmulationManager.SaveCustomView(AppSetting.PopOutSetting.AutoPanning.KeyBinding);
} }
}
await Task.Run(() => await Task.Run(() =>
{ {
Thread.Sleep(500); // wait for custom view save to be completed Thread.Sleep(500); // wait for custom view save to be completed
if (_flightSimData.CameraViewTypeAndIndex1 == CAMERA_VIEW_HOME_COCKPIT_MODE)
{
FlightSimOrchestrator.ResetCameraView();
}
else
{
// Recenter game or return to after pop out camera view // Recenter game or return to after pop out camera view
if (!AppSetting.PopOutSetting.AfterPopOutCameraView.IsEnabled) if (!AppSetting.PopOutSetting.AfterPopOutCameraView.IsEnabled)
{ {
@ -122,6 +147,7 @@ namespace MSFSPopoutPanelManager.Orchestration
break; break;
} }
} }
}
WindowActionManager.BringWindowToForeground(ApplicationHandle); WindowActionManager.BringWindowToForeground(ApplicationHandle);
@ -195,7 +221,7 @@ namespace MSFSPopoutPanelManager.Orchestration
{ {
InputEmulationManager.LoadCustomView(keybinding); InputEmulationManager.LoadCustomView(keybinding);
Thread.Sleep(750); // wait for flightsimdata to be updated 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; break;
} }
} }

View file

@ -1,12 +1,16 @@
## Version 4.0.2 ## 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. * 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 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 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. * Fixed issue where full screen mode for pop out panel does not work on certain aircraft configuration.

View file

@ -11,9 +11,9 @@
<PackageProjectUrl>https://github.com/hawkeye-stan/msfs-popout-panel-manager</PackageProjectUrl> <PackageProjectUrl>https://github.com/hawkeye-stan/msfs-popout-panel-manager</PackageProjectUrl>
<RootNamespace>MSFSPopoutPanelManager.Shared</RootNamespace> <RootNamespace>MSFSPopoutPanelManager.Shared</RootNamespace>
<Platforms>x64</Platforms> <Platforms>x64</Platforms>
<Version>4.0.2.2</Version> <Version>4.0.2.3</Version>
<AssemblyVersion>4.0.2.2</AssemblyVersion> <AssemblyVersion>4.0.2.3</AssemblyVersion>
<FileVersion>4.0.2.2</FileVersion> <FileVersion>4.0.2.3</FileVersion>
<RuntimeIdentifier>win-x64</RuntimeIdentifier> <RuntimeIdentifier>win-x64</RuntimeIdentifier>
<DebugType>Embedded</DebugType> <DebugType>Embedded</DebugType>
<Configurations>Debug;Release;Local</Configurations> <Configurations>Debug;Release;Local</Configurations>

View file

@ -11,9 +11,9 @@
<PackageProjectUrl>https://github.com/hawkeye-stan/msfs-popout-panel-manager</PackageProjectUrl> <PackageProjectUrl>https://github.com/hawkeye-stan/msfs-popout-panel-manager</PackageProjectUrl>
<RootNamespace>MSFSPopoutPanelManager.SimConnectAgent</RootNamespace> <RootNamespace>MSFSPopoutPanelManager.SimConnectAgent</RootNamespace>
<Platforms>x64</Platforms> <Platforms>x64</Platforms>
<Version>4.0.2.2</Version> <Version>4.0.2.3</Version>
<AssemblyVersion>4.0.2.2</AssemblyVersion> <AssemblyVersion>4.0.2.3</AssemblyVersion>
<FileVersion>4.0.2.2</FileVersion> <FileVersion>4.0.2.3</FileVersion>
<RuntimeIdentifier>win-x64</RuntimeIdentifier> <RuntimeIdentifier>win-x64</RuntimeIdentifier>
<DebugType>Embedded</DebugType> <DebugType>Embedded</DebugType>
<Configurations>Debug;Release;Local</Configurations> <Configurations>Debug;Release;Local</Configurations>

View file

@ -2,15 +2,19 @@
<hr/> <hr/>
## Version 4.0.2 ## 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. * 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 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 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. * Fixed issue where full screen mode for pop out panel does not work on certain aircraft configuration.

View file

@ -11,9 +11,9 @@
<PackageProjectUrl>https://github.com/hawkeye-stan/msfs-popout-panel-manager</PackageProjectUrl> <PackageProjectUrl>https://github.com/hawkeye-stan/msfs-popout-panel-manager</PackageProjectUrl>
<RootNamespace>MSFSPopoutPanelManager.WindowsAgent</RootNamespace> <RootNamespace>MSFSPopoutPanelManager.WindowsAgent</RootNamespace>
<Platforms>x64</Platforms> <Platforms>x64</Platforms>
<Version>4.0.2.2</Version> <Version>4.0.2.3</Version>
<AssemblyVersion>4.0.2.2</AssemblyVersion> <AssemblyVersion>4.0.2.3</AssemblyVersion>
<FileVersion>4.0.2.2</FileVersion> <FileVersion>4.0.2.3</FileVersion>
<RuntimeIdentifier>win-x64</RuntimeIdentifier> <RuntimeIdentifier>win-x64</RuntimeIdentifier>
<DebugType>Embedded</DebugType> <DebugType>Embedded</DebugType>
<Configurations>Debug;Release;Local</Configurations> <Configurations>Debug;Release;Local</Configurations>