Skip to content
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

#16 fix update example #18

Closed

Conversation

BitsAndDroids
Copy link
Contributor

@Sequal32 (sorry, I messed up the fork sync the first time) I've fixed the input example to tackle issue #16. There was some faulty pointer logic.
While there, I've updated the bindgen version to the latest to keep it current.

BitsAndDroids and others added 21 commits December 21, 2023 16:40
An epsilon parameter is added to the data definition in the SimConnect_AddToDataDefinition function in lib.rs. This replaces the previously hard-coded value of 0.0, allowing for more flexibility depending on the specific requirements of different use cases.
The `add_data_definition` functions in `src/lib.rs` now accept an optional 'epsilon' parameter as opposed to a mandatory float. This modification enhances versatility by accommodating scenarios where 'epsilon' doesn't require a specific value and defaults to 0.0 if not explicitly given.
The add_data_definition method has been updated to include an optional epsilon parameter. This parameter is used to set a threshold for updates, providing more flexibility for data definition. If no specific value for epsilon is provided, it defaults to 0.0.
The simconnect dependency version in the README file is updated from "0.2.0" to "0.2.1". This reflects the current version the project is using and ensures consistency across all parts of the documentation.
The handling of raw pointers and data transmutation in the unsafe blocks has been refactored for better safety and code clarity. Instead of using transmute_copy, it now uses std::ptr::addr_of and std::ptr::read_unaligned to obtain data values.
Updated `simconnect` package from version `0.2.0` to `0.2.1` in `Cargo.lock` file. Introduced two new example scripts `aircraft_updates_on_change` and `aircraft_updates` to demonstrate usage of the libraries. Also, made a minor change in `lib.rs` on how `epsilon` is handled inside `add_data_definition` function.
Updated how data is defined in aircraft_updates_on_change example. Epsilon is now defined to control the frequency of updates from the game, reducing the amount of data sent to the client. For instance, latitude and longitude values update every degree, whereas altitude updates are now received every 100 feet, as opposed to every foot previously.
Added comments in the aircraft_updates_on_change example to explain how different requests need to have unique request_id values in order to prevent data overwrite. Also included a pointer about the way sim_data_ptr uses the passed define_id for better clarity.
Expanded on the usage of KeyValuePairFloat and the need for unique request_id values in the aircraft_updates_on_change example. Clarified how define_id is used with simconnect data by adding detailed comments, helping prevent potential overwrite of data.
This commit rectifies typographical errors and improves the readability of code comments in both the README file and example files. Detailed instructions regarding the execution of examples with SimConnect.dll have been included. Additionally, the datastruct memory allocation has been adjusted for optimal performance and accuracy.
This commit corrects typographical errors in the Readme.md file. It also enhances the instructions on building the code and running the examples to help users understand them easily. Hyphenations are also updated to ensure grammatical correctness.
This commit corrects a typographical error in the inline comment when connecting with SimConnect in main.rs within the aircraft_updates_on_change directory. Instead of "Intialize", the correct spelling "Initialize" is now used.
…oids:BitsAndDroids/simconnect-rust into Sequal32#16-fix-update-example
@BitsAndDroids
Copy link
Contributor Author

Closed this due to wrapping it in new pr with new fix for bindgen issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants