1
0
Fork 0
mirror of https://github.com/hawkeye-stan/msfs-popout-panel-manager.git synced 2024-10-16 06:00:45 +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>
<RootNamespace>MSFSPopoutPanelManager.DomainModel</RootNamespace>
<Platforms>x64</Platforms>
<Version>4.0.2.2</Version>
<AssemblyVersion>4.0.2.2</AssemblyVersion>
<FileVersion>4.0.2.2</FileVersion>
<Version>4.0.2.3</Version>
<AssemblyVersion>4.0.2.3</AssemblyVersion>
<FileVersion>4.0.2.3</FileVersion>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<DebugType>Embedded</DebugType>
<Configurations>Debug;Release;Local</Configurations>

View file

@ -19,6 +19,7 @@ namespace MSFSPopoutPanelManager.DomainModel.Profile
PanelConfigs = new ObservableCollection<PanelConfig>();
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());

View file

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

View file

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

View file

@ -11,9 +11,9 @@
<PackageProjectUrl>https://github.com/hawkeye-stan/msfs-popout-panel-manager</PackageProjectUrl>
<RootNamespace>MSFSPopoutPanelManager.Orchestration</RootNamespace>
<Platforms>x64</Platforms>
<Version>4.0.2.2</Version>
<AssemblyVersion>4.0.2.2</AssemblyVersion>
<FileVersion>4.0.2.2</FileVersion>
<Version>4.0.2.3</Version>
<AssemblyVersion>4.0.2.3</AssemblyVersion>
<FileVersion>4.0.2.3</FileVersion>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<DebugType>Embedded</DebugType>
<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
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;
}
@ -195,25 +199,32 @@ namespace MSFSPopoutPanelManager.Orchestration
{
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;

View file

@ -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,38 +100,52 @@ 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;
}
}
}
@ -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;
}
}

View file

@ -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.

View file

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

View file

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

View file

@ -2,15 +2,19 @@
<hr/>
## 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.

View file

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