From b001ee5234652e4f6ccff12cfaa06e8649fb9fcf Mon Sep 17 00:00:00 2001 From: hawkeye Date: Sat, 4 Nov 2023 22:16:41 -0400 Subject: [PATCH] Fixed CPU rogue cycle issue when using touchUpdate doc --- DomainModel/DomainModel.csproj | 6 +++--- MainApp/MainApp.csproj | 6 +++--- Orchestration/Orchestration.csproj | 6 +++--- RELEASENOTES.md | 10 +++++++--- Shared/Shared.csproj | 6 +++--- SimconnectAgent/SimconnectAgent.csproj | 6 +++--- VERSION.md | 10 +++++++--- WindowsAgent/TouchEventManager.cs | 23 +++++++---------------- WindowsAgent/WindowsAgent.csproj | 6 +++--- 9 files changed, 39 insertions(+), 40 deletions(-) diff --git a/DomainModel/DomainModel.csproj b/DomainModel/DomainModel.csproj index 1a3d908..6be874b 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.3.2 - 4.0.3.2 - 4.0.3.2 + 4.0.3.3 + 4.0.3.3 + 4.0.3.3 win-x64 Embedded Debug;Release;Local diff --git a/MainApp/MainApp.csproj b/MainApp/MainApp.csproj index 934c4f1..fae921c 100644 --- a/MainApp/MainApp.csproj +++ b/MainApp/MainApp.csproj @@ -14,9 +14,9 @@ MSFSPopoutPanelManager.MainApp logo.ico x64 - 4.0.3.2 - 4.0.3.2 - 4.0.3.2 + 4.0.3.3 + 4.0.3.3 + 4.0.3.3 embedded en diff --git a/Orchestration/Orchestration.csproj b/Orchestration/Orchestration.csproj index c11b359..2917d1e 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.3.2 - 4.0.3.2 - 4.0.3.2 + 4.0.3.3 + 4.0.3.3 + 4.0.3.3 win-x64 Embedded Debug;Release;Local diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 293ef5c..8318d89 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -1,10 +1,14 @@ +## Version 4.0.3 Beta 3 + +* Fixed CPU rogue cycle issue when using touch feature in pop out panel. + ## Version 4.0.3 Beta 2 -* Update logic to turbo mode to help resolve pop out reliability issue. +* Updated 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. +* 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 during creation of a new aircraft profile. -* Remove pop out failure error message when after pop out predefined camera view has not been setup for an aircraft. +* Removed 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. diff --git a/Shared/Shared.csproj b/Shared/Shared.csproj index ab85c74..de80390 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.3.2 - 4.0.3.2 - 4.0.3.2 + 4.0.3.3 + 4.0.3.3 + 4.0.3.3 win-x64 Embedded Debug;Release;Local diff --git a/SimconnectAgent/SimconnectAgent.csproj b/SimconnectAgent/SimconnectAgent.csproj index 86e42c9..2288805 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.3.2 - 4.0.3.2 - 4.0.3.2 + 4.0.3.3 + 4.0.3.3 + 4.0.3.3 win-x64 Embedded Debug;Release;Local diff --git a/VERSION.md b/VERSION.md index fccaa26..68c9749 100644 --- a/VERSION.md +++ b/VERSION.md @@ -1,13 +1,17 @@ # Version History
+## Version 4.0.3 Beta 3 + +* Fixed CPU rogue cycle issue when using touch feature in pop out panel. + ## Version 4.0.3 Beta 2 -* Update logic to turbo mode to help resolve pop out reliability issue. +* Updated 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. +* 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 during creation of a new aircraft profile. -* Remove pop out failure error message when after pop out predefined camera view has not been setup for an aircraft. +* Removed 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. diff --git a/WindowsAgent/TouchEventManager.cs b/WindowsAgent/TouchEventManager.cs index 3571dec..5a679ab 100644 --- a/WindowsAgent/TouchEventManager.cs +++ b/WindowsAgent/TouchEventManager.cs @@ -111,9 +111,9 @@ namespace MSFSPopoutPanelManager.WindowsAgent Task.Run(() => { PInvoke.mouse_event(MOUSEEVENTF_LEFTUP, info.pt.X, info.pt.Y, 0, 0); // focus window - Thread.Sleep(ApplicationSetting.TouchSetting.TouchDownUpDelay + 25); + Thread.Sleep(ApplicationSetting.TouchSetting.TouchDownUpDelay + 5); PInvoke.mouse_event(MOUSEEVENTF_LEFTDOWN, info.pt.X, info.pt.Y, 0, 0); - Thread.Sleep(ApplicationSetting.TouchSetting.TouchDownUpDelay + 50); + Thread.Sleep(ApplicationSetting.TouchSetting.TouchDownUpDelay + 25); _isTouchDown = false; }); } @@ -145,27 +145,18 @@ namespace MSFSPopoutPanelManager.WindowsAgent { Task.Run(() => { - while (_isTouchDown) { } - + SpinWait.SpinUntil(() => !_isTouchDown, TimeSpan.FromSeconds(0.25)); + if (_isDragged) { - if (ApplicationSetting.TouchSetting.TouchDownUpDelay > 0) - Thread.Sleep(ApplicationSetting.TouchSetting.TouchDownUpDelay); - - PInvoke.SetCursorPos(info.pt.X, info.pt.Y); - - if (ApplicationSetting.TouchSetting.TouchDownUpDelay > 0) - Thread.Sleep(ApplicationSetting.TouchSetting.TouchDownUpDelay); - - InputEmulationManager.LeftClickFast(info.pt.X, info.pt.Y); + PInvoke.mouse_event(MOUSEEVENTF_LEFTUP, info.pt.X, info.pt.Y, 0, 0); + Thread.Sleep(ApplicationSetting.TouchSetting.TouchDownUpDelay + 25); + PInvoke.mouse_event(MOUSEEVENTF_LEFTUP, info.pt.X, info.pt.Y, 0, 0); _isDragged = false; } else { - if (ApplicationSetting.TouchSetting.TouchDownUpDelay > 0) - Thread.Sleep(ApplicationSetting.TouchSetting.TouchDownUpDelay); - PInvoke.mouse_event(MOUSEEVENTF_LEFTUP, info.pt.X, info.pt.Y, 0, 0); } diff --git a/WindowsAgent/WindowsAgent.csproj b/WindowsAgent/WindowsAgent.csproj index 8e62f66..6410054 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.3.2 - 4.0.3.2 - 4.0.3.2 + 4.0.3.3 + 4.0.3.3 + 4.0.3.3 win-x64 Embedded Debug;Release;Local