-
-
Notifications
You must be signed in to change notification settings - Fork 3
V0.1.18 #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
V0.1.18 #16
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". |
| var result = SimConnectNative.SimConnect_SubscribeToSystemEvent( | ||
| this.simConnectHandle, | ||
| systemEventId, | ||
| systemEventName); |
| var result = SimConnectNative.SimConnect_SetSystemEventState( | ||
| this.simConnectHandle, | ||
| systemEventId, | ||
| (uint)state); |
| var result = SimConnectNative.SimConnect_UnsubscribeFromSystemEvent( | ||
| this.simConnectHandle, | ||
| systemEventId); |
| var result = SimConnectNative.SimConnect_SetDataOnSimObject( | ||
| this.simConnectHandle, | ||
| definitionId, | ||
| objectId, | ||
| 0, | ||
| 1, | ||
| (uint)dataSize, | ||
| dataPtr); |
| 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; |
| catch (Exception ex) | ||
| { | ||
| Console.WriteLine($" ❌ System event state test failed: {ex.Message}"); | ||
| return false; | ||
| } |
| catch | ||
| { | ||
| // Best-effort cleanup; ignore errors | ||
| } |
Version 0.1.18 Release.