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

Added 4.0.3 beta 2 features

This commit is contained in:
hawkeye 2023-11-04 22:10:03 -04:00
parent 67c2e5e22b
commit ccd2409126
13 changed files with 98 additions and 74 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.3.0</Version>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
<FileVersion>4.0.3.0</FileVersion>
<Version>4.0.3.2</Version>
<AssemblyVersion>4.0.3.2</AssemblyVersion>
<FileVersion>4.0.3.2</FileVersion>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<DebugType>Embedded</DebugType>
<Configurations>Debug;Release;Local</Configurations>

View file

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

View file

@ -32,8 +32,8 @@
Height="Auto"
Mode="Dark">
<DockPanel
Width="400"
Height="225"
Width="{Binding WindowWidth}"
Height="{Binding WindowHeight}"
d:DataContext="{d:DesignInstance viewmodel:MessageWindowViewModel}">
<WrapPanel
Height="30"

View file

@ -12,8 +12,11 @@ namespace MSFSPopoutPanelManager.MainApp.ViewModel
{
public class MessageWindowViewModel : BaseViewModel
{
private const int WINDOW_WIDTH = 400;
private const int WINDOW_HEIGHT = 225;
private const int WINDOW_WIDTH_POPOUT_MESSAGE = 400;
private const int WINDOW_HEIGHT_POPOUT_MESSAGE = 225;
private const int WINDOW_WIDTH_REGULAR_MESSAGE = 300;
private const int WINDOW_HEIGHT_REGULAR_MESSAGE = 75;
private bool _isVisible;
@ -37,18 +40,37 @@ namespace MSFSPopoutPanelManager.MainApp.ViewModel
}
}
public int WindowTop { get; set; }
public int WindowWidth { get; set; }
public int WindowLeft { get; set; }
public int WindowHeight { get; set; }
public MessageWindowViewModel(MainOrchestrator orchestrator) : base(orchestrator)
{
IsVisible = false;
Orchestrator.PanelPopOut.OnPopOutStarted += (sender, e) => IsVisible = true;
Orchestrator.PanelPopOut.OnPopOutStarted += (sender, e) =>
{
IsVisible = true;
WindowWidth = WINDOW_WIDTH_POPOUT_MESSAGE;
WindowHeight = WINDOW_HEIGHT_POPOUT_MESSAGE;
};
Orchestrator.PanelPopOut.OnPopOutCompleted += (sender, e) =>
{
Thread.Sleep(1000);
IsVisible = false;
WindowWidth = WINDOW_WIDTH_POPOUT_MESSAGE;
WindowHeight = WINDOW_HEIGHT_POPOUT_MESSAGE;
};
Orchestrator.PanelSource.OnStatusMessageStarted += (sender, e) =>
{
IsVisible = true;
WindowWidth = WINDOW_WIDTH_REGULAR_MESSAGE;
WindowHeight = WINDOW_HEIGHT_REGULAR_MESSAGE;
};
Orchestrator.PanelSource.OnStatusMessageEnded += (sender, e) =>
{
IsVisible = false;
WindowWidth = WINDOW_WIDTH_REGULAR_MESSAGE;
WindowHeight = WINDOW_HEIGHT_REGULAR_MESSAGE;
};
StatusMessageWriter.OnStatusMessage += (sender, e) =>
@ -72,9 +94,9 @@ namespace MSFSPopoutPanelManager.MainApp.ViewModel
return;
var simulatorRectangle = WindowActionManager.GetWindowRectangle(WindowProcessManager.SimulatorProcess.Handle);
var left = simulatorRectangle.Left + simulatorRectangle.Width / 2 - WINDOW_WIDTH / 2;
var top = simulatorRectangle.Top + simulatorRectangle.Height / 2 - WINDOW_HEIGHT / 2;
WindowActionManager.MoveWindow(Handle, left, top, WINDOW_WIDTH, WINDOW_HEIGHT);
var left = simulatorRectangle.Left + simulatorRectangle.Width / 2 - WindowWidth / 2;
var top = simulatorRectangle.Top + simulatorRectangle.Height / 2 - WindowHeight / 2;
WindowActionManager.MoveWindow(Handle, left, top, WindowWidth, WindowHeight);
WindowActionManager.ApplyAlwaysOnTop(Handle, PanelType.StatusMessageWindow, true);
}
}

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.3.0</Version>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
<FileVersion>4.0.3.0</FileVersion>
<Version>4.0.3.2</Version>
<AssemblyVersion>4.0.3.2</AssemblyVersion>
<FileVersion>4.0.3.2</FileVersion>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<DebugType>Embedded</DebugType>
<Configurations>Debug;Release;Local</Configurations>

View file

@ -13,7 +13,6 @@ namespace MSFSPopoutPanelManager.Orchestration
{
public class PanelPopOutOrchestrator : ObservableObject
{
// 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;
@ -99,7 +98,7 @@ namespace MSFSPopoutPanelManager.Orchestration
// *** THIS MUST BE DONE FIRST. Get the built-in panel list to be configured later
List<IntPtr> builtInPanelHandles = WindowActionManager.GetWindowsByPanelType(new List<PanelType>() { PanelType.BuiltInPopout });
await StepAddCutomPanels(builtInPanelHandles);
await StepAddCustomPanels(builtInPanelHandles);
StepAddBuiltInPanels(builtInPanelHandles);
@ -152,7 +151,7 @@ namespace MSFSPopoutPanelManager.Orchestration
}
private async Task StepAddCutomPanels(List<IntPtr> builtInPanelHandles)
private async Task StepAddCustomPanels(List<IntPtr> builtInPanelHandles)
{
if (!ActiveProfile.HasCustomPanels)
return;
@ -214,7 +213,7 @@ namespace MSFSPopoutPanelManager.Orchestration
var success = WorkflowStepWithMessage.Execute("Loading custom camera view", () =>
{
return LoadCustomView(AppSetting.PopOutSetting.AutoPanning.KeyBinding, AppSetting.GeneralSetting.TurboMode);
return LoadCustomView(AppSetting.PopOutSetting.AutoPanning.KeyBinding, AppSetting.GeneralSetting.TurboMode, false);
}, true);
if (!success)
@ -250,20 +249,10 @@ namespace MSFSPopoutPanelManager.Orchestration
{
panelConfig.IsSelectedPanelSource = true;
if(AppSetting.GeneralSetting.TurboMode)
{
InputEmulationManager.PrepareToPopOutPanel((int)panelConfig.PanelSource.X, (int)panelConfig.PanelSource.Y, AppSetting.GeneralSetting.TurboMode);
PanelSourceOrchestrator.ShowPanelSourceNonEdit(panelConfig);
ExecuteCustomPopout(panelConfig, builtInPanelHandles, index++);
PanelSourceOrchestrator.ClosePanelSourceNonEdit(panelConfig);
}
else
{
PanelSourceOrchestrator.ShowPanelSourceNonEdit(panelConfig);
InputEmulationManager.PrepareToPopOutPanel((int)panelConfig.PanelSource.X, (int)panelConfig.PanelSource.Y, AppSetting.GeneralSetting.TurboMode);
PanelSourceOrchestrator.ClosePanelSourceNonEdit(panelConfig);
ExecuteCustomPopout(panelConfig, builtInPanelHandles, index++);
}
PanelSourceOrchestrator.ShowPanelSourceNonEdit(panelConfig);
InputEmulationManager.PrepareToPopOutPanel((int)panelConfig.PanelSource.X, (int)panelConfig.PanelSource.Y, AppSetting.GeneralSetting.TurboMode);
PanelSourceOrchestrator.ClosePanelSourceNonEdit(panelConfig);
ExecuteCustomPopout(panelConfig, builtInPanelHandles, index++);
ApplyPanelLocation(panelConfig);
panelConfig.IsSelectedPanelSource = false;
@ -568,7 +557,7 @@ namespace MSFSPopoutPanelManager.Orchestration
WorkflowStepWithMessage.Execute("Loading custom camera view", () =>
{
return LoadCustomView(AppSetting.PopOutSetting.AfterPopOutCameraView.KeyBinding, AppSetting.GeneralSetting.TurboMode);
return LoadCustomView(AppSetting.PopOutSetting.AfterPopOutCameraView.KeyBinding, AppSetting.GeneralSetting.TurboMode, true);
}, true);
break;
@ -593,7 +582,7 @@ namespace MSFSPopoutPanelManager.Orchestration
}
}
private bool LoadCustomView(string keybinding, bool isTurboMode)
private bool LoadCustomView(string keybinding, bool isTurboMode, bool ignoreError)
{
int retry = 10;
for(var i = 0; i < retry; i++)
@ -604,7 +593,7 @@ namespace MSFSPopoutPanelManager.Orchestration
return true;
}
return false;
return ignoreError;
}
private void SetCockpitZoomLevel(int zoom, bool isTurboMode)

View file

@ -19,6 +19,9 @@ namespace MSFSPopoutPanelManager.Orchestration
private FlightSimData _flightSimData;
private bool _isEditingPanelSourceLock = false;
public event EventHandler OnStatusMessageStarted;
public event EventHandler OnStatusMessageEnded;
public PanelSourceOrchestrator(ProfileData profileData, AppSettingData appSettingData, FlightSimData flightSimData)
{
_profileData = profileData;
@ -64,6 +67,12 @@ namespace MSFSPopoutPanelManager.Orchestration
await Task.Run(() =>
{
OnStatusMessageStarted?.Invoke(this, null);
StatusMessageWriter.IsEnabled = true;
StatusMessageWriter.ClearMessage();
StatusMessageWriter.WriteMessage("Loading camera view. Please wait......", StatusMessageType.Info);
// Set Windowed Display Mode window's configuration if needed
if (_appSettingData.ApplicationSetting.WindowedModeSetting.AutoResizeMsfsGameWindow)
WindowActionManager.SetMsfsGameWindowLocation(ActiveProfile.MsfsGameWindowConfig);
@ -91,6 +100,11 @@ namespace MSFSPopoutPanelManager.Orchestration
// Turn off TrackIR if TrackIR is started
FlightSimOrchestrator.TurnOffTrackIR();
Thread.Sleep(500);
StatusMessageWriter.IsEnabled = false;
OnStatusMessageEnded?.Invoke(this, null);
});
}

View file

@ -1,4 +1,14 @@
## Version 4.0.3 Beta
## Version 4.0.3 Beta 2
* Update logic to turbo mode to help resolve pop out reliability issue.
* Added please wait message when editing panel source to resolve the confusion that Pop Out Panel Manager seems to hang when trying to select panel source when creating a new aircraft profile.
* Remove pop out failure error message when after pop out predefined camera view has not been setup for an aircraft.
* KNOWN ISSUE: For A2A Comanche PA-24-250, pop out step "Resetting camera view" does not work since this aircraft does not seem to implement SimConnect variable CAMERA_VIEW_TYPE_AND_INDEX:1 which Pop Out Panel Manager uses.
## Version 4.0.3 Beta 1
* Added a new turbo mode to improve execution speed during pop out process. Turbo mode can be turned on in preferences => general settings.

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.3.0</Version>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
<FileVersion>4.0.3.0</FileVersion>
<Version>4.0.3.2</Version>
<AssemblyVersion>4.0.3.2</AssemblyVersion>
<FileVersion>4.0.3.2</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.3.0</Version>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
<FileVersion>4.0.3.0</FileVersion>
<Version>4.0.3.2</Version>
<AssemblyVersion>4.0.3.2</AssemblyVersion>
<FileVersion>4.0.3.2</FileVersion>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<DebugType>Embedded</DebugType>
<Configurations>Debug;Release;Local</Configurations>

View file

@ -1,7 +1,17 @@
# Version History
<hr/>
## Version 4.0.3 Beta
## Version 4.0.3 Beta 2
* Update logic to turbo mode to help resolve pop out reliability issue.
* Added please wait message when editing panel source to resolve the confusion that Pop Out Panel Manager seems to hang when trying to select panel source when creating a new aircraft profile.
* Remove pop out failure error message when after pop out predefined camera view has not been setup for an aircraft.
* KNOWN ISSUE: For A2A Comanche PA-24-250, pop out step "Resetting camera view" does not work since this aircraft does not seem to implement SimConnect variable CAMERA_VIEW_TYPE_AND_INDEX:1 which Pop Out Panel Manager uses.
## Version 4.0.3 Beta 1
* Added a new turbo mode to improve execution speed during pop out process. Turbo mode can be turned on in preferences => general settings.

View file

@ -51,8 +51,7 @@ namespace MSFSPopoutPanelManager.WindowsAgent
MoveAppWindowFromLeftClickPoint(x, y);
if(!isTurboMode)
LeftClick(x + 30, y); // Left click outside the cirlce area to focus game window
LeftClick(x + 30, y); // Left click outside the circle area to focus game window
// Force cursor reset and focus
PInvoke.SetCursorPos(x, y);
@ -106,26 +105,6 @@ namespace MSFSPopoutPanelManager.WindowsAgent
}
}
public static void CenterView()
{
Debug.WriteLine("Centering view......");
var hwnd = WindowProcessManager.SimulatorProcess.Handle;
PInvoke.SetForegroundWindow(hwnd);
Thread.Sleep(200);
// First center view using Ctrl-Space
PInvoke.keybd_event(Convert.ToByte(VK_RCONTROL), 0, KEYEVENTF_KEYDOWN, 0);
PInvoke.keybd_event(Convert.ToByte(VK_SPACE), 0, KEYEVENTF_KEYDOWN, 0);
Thread.Sleep(200);
PInvoke.keybd_event(Convert.ToByte(VK_SPACE), 0, KEYEVENTF_KEYUP, 0);
PInvoke.keybd_event(Convert.ToByte(VK_RCONTROL), 0, KEYEVENTF_KEYUP, 0);
Thread.Sleep(200);
// Wait for center view to complete
Thread.Sleep(500);
}
public static void SaveCustomView(string keybinding)
{
Debug.WriteLine("Saving custom view...");

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.3.0</Version>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
<FileVersion>4.0.3.0</FileVersion>
<Version>4.0.3.2</Version>
<AssemblyVersion>4.0.3.2</AssemblyVersion>
<FileVersion>4.0.3.2</FileVersion>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<DebugType>Embedded</DebugType>
<Configurations>Debug;Release;Local</Configurations>