Merged
Conversation
…n 0.1.18 - Implemented subscription to simulator system events via `SimConnectClient.SubscribeToEventAsync`. - Added typed event handlers for frame, filename, object add/remove, and extended EX1 system events. - Introduced helper methods for managing event states: `SetSystemEventStateAsync` and `UnsubscribeFromEventAsync`. - Enhanced performance by optimizing message processing and memory allocation in SimVar setters. - Updated bundled `SimConnect.dll` to the latest SDK version. - Added tests for system event subscription and state management.
Greptile SummaryThis release adds system event subscription capabilities and delivers significant performance improvements to the SimConnect.NET library. Key Changes
Confidence Score: 5/5
Important Files Changed
|
Greptile's behavior is changing!From now on, if a review finishes with no comments, we will not post an additional "statistics" comment to confirm that our review found nothing to comment on. However, you can confirm that we reviewed your changes in the status check section. This feature can be toggled off in your Code Review Settings by deselecting "Create a status check for each PR". |
Comment on lines
+393
to
+396
| var result = SimConnectNative.SimConnect_SubscribeToSystemEvent( | ||
| this.simConnectHandle, | ||
| systemEventId, | ||
| systemEventName); |
Comment on lines
+427
to
+430
| var result = SimConnectNative.SimConnect_SetSystemEventState( | ||
| this.simConnectHandle, | ||
| systemEventId, | ||
| (uint)state); |
Comment on lines
+460
to
+462
| var result = SimConnectNative.SimConnect_UnsubscribeFromSystemEvent( | ||
| this.simConnectHandle, | ||
| systemEventId); |
Comment on lines
+757
to
+764
| var result = SimConnectNative.SimConnect_SetDataOnSimObject( | ||
| this.simConnectHandle, | ||
| definitionId, | ||
| objectId, | ||
| 0, | ||
| 1, | ||
| (uint)dataSize, | ||
| dataPtr); |
Comment on lines
+1007
to
+1014
| var hr = SimConnectNative.SimConnect_SetDataOnSimObject( | ||
| this.simConnectHandle, | ||
| definitionId, | ||
| objectId, | ||
| 0, | ||
| 1, | ||
| (uint)cache.TotalSize, | ||
| dataPtr); |
| var request = this.StartRequest<T>(definitionId, objectId, SimConnectPeriod.Once, onValue: null); | ||
|
|
||
| using (cancellationToken.Register(() => this.CancelRequest(request))) | ||
| CancellationTokenSource? timeoutCts = null; |
|
|
||
| using (cancellationToken.Register(() => this.CancelRequest(request))) | ||
| CancellationTokenSource? timeoutCts = null; | ||
| CancellationTokenSource? linkedCts = null; |
Comment on lines
+108
to
+112
| catch (Exception ex) | ||
| { | ||
| Console.WriteLine($" ❌ System event state test failed: {ex.Message}"); | ||
| return false; | ||
| } |
Comment on lines
+121
to
+124
| catch | ||
| { | ||
| // Best-effort cleanup; ignore errors | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Version 0.1.18 Release.