Skip to content

Commit

Permalink
Merge branch 'next'
Browse files Browse the repository at this point in the history
  • Loading branch information
mpaperno committed Nov 7, 2023
2 parents 682ceff + b084c4c commit 4b3fe92
Show file tree
Hide file tree
Showing 60 changed files with 7,662 additions and 2,829 deletions.
89 changes: 89 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,94 @@
# WASimCommander - Change Log

## 1.2.0.0 (next)

### WASimModule
* Fix binary data representation in results for named variable requests with 1-4 byte integer value sizes (`int8` - `int32` types) -- the result data would be encoded as a float type instead. ([8c7724e6])
* Restore ability to use Unit type specifiers when setting and getting Local vars. ([e16049ac])
* Added ability to specify/set a default 'L' var value and unit type in `GetCreate` command to use if the variable needs to be created. ([61a52674])
* `GetCreate` and `SetCreate` commands for non-L types now silently fall back to `Get` and `Set` respectively. ([61a52674])
* Fixed that command response for `GetCreate` was always sent as if responding to a `Get` command. ([61a52674])
* Added `requestId` to error logging and response output for data requests and add more info for `Get` command errors. ([17791eef])
* Added ability to return string type results for Get commands and Named data requests by converting them to calculator expressions automatically on the server. ([983e7ab6])
* Improved automatic conversion to calc code for other variable types by including the unit type, if given, and narrowing numeric results to integer types if needed. ([983e7ab6])
* Prevent possible simulator hang on exit when quitting with active client(s) connections. ([70e0ef31])
* Event loop processing is now paused/restarted also based on whether any connected client(s) have active data requests and if they are paused or not (previously it was only based on if any clients were connected at all). ([90242ed4])
* Fixes a logged SimConnect error when trying to unsubscribe from the "Frame" event (cause unknown). ([90242ed4])
* Data requests with `Once` type update period are now queued if data updates are paused when the request is submitted. These requests will be sent when/if updates are resumed again by the client. Fixes that data would be sent anyway when the request is initially submitted, even if updates are paused. ([fe99bbb2])
* Update reference list of KEY events and aliases as of MSFS SDK v0.22.3.0. ([f045e150])

[8c7724e6]: https://github.com/mpaperno/WASimCommander/commit/8c7724e60ed94e622d5ee2669cf7e000031c2c18
[e16049ac]: https://github.com/mpaperno/WASimCommander/commit/e16049ac69ff15cdcdd9084c7fdab6920a1ffba1
[61a52674]: https://github.com/mpaperno/WASimCommander/commit/61a52674e0dff7e1f3e63ed73a0bed711bb2c479
[17791eef]: https://github.com/mpaperno/WASimCommander/commit/17791eefecc86454c031636a5da9c19d56e21139
[983e7ab6]: https://github.com/mpaperno/WASimCommander/commit/983e7ab609e81af81525ff84431b1c4557447d87
[70e0ef31]: https://github.com/mpaperno/WASimCommander/commit/70e0ef31b01a1a772d9e49102e0a77ec6f3e928b
[90242ed4]: https://github.com/mpaperno/WASimCommander/commit/90242ed494069aba5bcdad839914b9fcfc6521e2
[fe99bbb2]: https://github.com/mpaperno/WASimCommander/commit/fe99bbb25c5dd907e8a4d513769759c4b430580f
[f045e150]: https://github.com/mpaperno/WASimCommander/commit/f045e15007abd6b7b05b97c004a7a55488a33a9b

### WASimClient and WASimClient_CLI (managed .NET)
* Fixed incoming data size check for variable requests which are less than 4 bytes in size. ([c8e74dfa])
* Fixed early timeout being reported on long-running `list()` requests (eg.thousands of L vars). ([a05a28c3])
* Restored ability to specify Unit type for L vars and support for GetCreate with default value/unit and added extra features: ([3090d534], [0a30646d])
* Added unit name parameter to `setLocalVariable()` and `setOrCreateLocalVariable()`.
* Added `getOrCreateLocalVariable()`.
* Added `VariableRequest::createLVar` property.
* Add optional `create` flag and unit name to `VariableRequest()` c'tor overloads.
* Added async option to `saveDataRequest()` which doesn't wait for server response (`saveDataRequestAsync()` for the C# version). ([82ea4252], [0a30646d])
* Added ability to return a string value with `getVariable()` to make use of new WASimModule feature. ([8e75eb8c], [0e54794b])
* The request updates paused state (set with `setDataRequestsPaused()`) is now saved locally even if not connected to server and will be sent to server upon connection and before sending any queued data requests.
This allows connecting and sending queued requests but suspending any actual value checks until needed. ([bea8bccb])
* The `setVariable()` method now verifies that the specified variable type is settable before sending the command to the server. ([576914a2])
* Removed logged version mismatch warning on Ping response.
* Documentation updates.

[c8e74dfa]: https://github.com/mpaperno/WASimCommander/commit/c8e74dfa706647cf785c7e6c811731d8945e49c6
[a05a28c3]: https://github.com/mpaperno/WASimCommander/commit/a05a28c3d1af56444be3fbe54f619e62548736a0
[3090d534]: https://github.com/mpaperno/WASimCommander/commit/3090d5344c3a34c62e81f61237fe1fd91f6b11c5
[0a30646d]: https://github.com/mpaperno/WASimCommander/commit/0a30646d0ae985580d67ed40c8a441a0f5a0ba17
[82ea4252]: https://github.com/mpaperno/WASimCommander/commit/82ea4252bd25423bbeab354799d6be41f053880e
[8e75eb8c]: https://github.com/mpaperno/WASimCommander/commit/8e75eb8c087f5a39fee93c2b7d073500e4f14664
[0e54794b]: https://github.com/mpaperno/WASimCommander/commit/0e54794b2ec8411f42d34a7696426724ffc5e932
[bea8bccb]: https://github.com/mpaperno/WASimCommander/commit/bea8bccba38fae987690d5af259f6f8b22fbc781
[576914a2]: https://github.com/mpaperno/WASimCommander/commit/576914a235c81b73ba0ea85655d913b61cbc5015

### WASimClient_CLI (managed .NET)
* Fixed possible exception when assembling list lookup results dictionary in the off-case of duplicate keys. ([cf46967b])

[cf46967b]: https://github.com/mpaperno/WASimCommander/commit/cf46967b499a9bb19a77a14a47bd2ac29b4d0989

### WASimUI
* Added database of Simulator Variables, Key Events, and Unit types imported from SimConnect SDK online documentation. This is used for:
* Typing suggestions in the related form fields when entering names of 'A' vars, Key Events, or Unit types.
* Available as a popup search window from each related form (Variables, Key Events, Data Requests) via button/menu/CTRL-F shortcut.
* Can be opened as a standalone window for browsing and searching all imported data by type.
* Added ability to import and export Data Requests in _MSFS/SimConnect Touch Portal Plugin_ format with a new editor window available to adjust plugin-specific data before export (category, format, etc.)
* Fixed that the state of current item selections in tables wasn't always properly detected and buttons didn't get enabled/disabled when needed (eg. "Remove Requests" button).
* Added ability to toggle visibility of each main form area of the UI from the View menu (eg. Variables or Key Events groups). Choices are preserved between sessions.
* Simplified the connection/disconnection procedure by providing one action/button for both Sim and Server connections (independent actions still available via extension menu).
* Typing suggestions in combo boxes now use a drop-down menu style selection list by default, and the behavior can be configured independently for each one.
* String type variables can now be used in the "Variables" section for `Get` commands.
* Unit type specifier is now shown and used for 'L' variables as well (unit is optional).
* Added "Get or Create" action/button for 'L' vars.
* The list of 'L' variables loaded from simulator is now sorted alphabetically.
* The Size field in Data Request form is automatically populated with a likely match when a new Unit type is selected.
* Many improvements in table views (all options are saved to user settings and persist between sessions):
* All column widths are now re-sizable in all tables.
* Columns can be toggled on/off in the views (r-click for context menu).
* Can now be sorted by multiple columns (CTRL-click).
* Option to show filtering (searching) text fields for each column. Filters support wildcards and optional regular expressions.
* Font size can be adjusted (using context menu or CTRL key with `+`, `-`, or `0` to reset.
* Tooltips shown with data values when hovered over table cells (readable even if text is too long to fit in the column).
* Numerous shortcuts and context menus added throughout, each relevant to the respective forms/tables currently being used or clicked.
* Last selected variable types and data request type are saved between sessions.
* Most actions/buttons which require a server connection to work are now disabled when not connected.
* When loading data requests from a file while connected to the server, the requests are now sent asynchronously, improving UI responsiveness.
* More minor quality-of-life improvements!

**Full log:** [v1.1.2.0...HEAD](https://github.com/mpaperno/WASimCommander/compare/1.1.2.0...next)

---
## 1.1.2.0 (23-Feb-2023)

### WASimModule
Expand Down
40 changes: 25 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/mpaperno/WASimCommander?include_prereleases)](https://github.com/mpaperno/WASimCommander/releases)
[![GPLv3 License](https://img.shields.io/badge/license-GPLv3-blue.svg)](LICENSE.GPL.txt)
[![LGPGv3 License](https://img.shields.io/badge/license-LGPLv3-blue.svg)](LICENSE.LGPL.txt)
[![API Documentation](https://img.shields.io/badge/API-Documentation-07A7EC?labelColor=black)](https://wasimcommander.max.paperno.us/)
[![Discord](https://img.shields.io/static/v1?style=flat&color=7289DA&&labelColor=7289DA&message=Discord%20Chat&label=&logo=discord&logoColor=white)](https://discord.gg/meWyE4dcAt)


Expand All @@ -15,7 +16,7 @@
**A WASM module-based Server and a full Client API combination.**

This project is geared towards other MSFS developers/coders who need a convenient way to remotely access parts of the Simulator which are normally
inaccessible via _SimConnect_, such as locally-defined aircraft variables or custom events.
inaccessible via _SimConnect_, such as some variable types and 'H' events, and running RPN "calculator code" directly on the sim.

The Client API can be utilized natively from C++, or via .NET managed assembly from C#, Python, or other languages.

Expand All @@ -27,7 +28,7 @@ to _SimConnect_ for basic functionality like reading/setting Simulation Variable

One of the motivations for this project was seeing multiple MSFS tool authors and casual hackers creating their own WASM modules and protocols just to support their
own product or need. There is nothing wrong with this, of course, but for the Sim user it can be a disadvantage on several levels. They may end up running
multiple versions of modules which all do eseentially the same thing, and it may be confusing which WASM module they need to support which tool,
multiple versions of modules which all do essentially the same thing, and it may be confusing which WASM module they need to support which tool,
just to name two obvious issues. For the developer, programming the WASM modules comes with its own quirks, too, not to mention the time involved.
And regardless of the supposed isolated environment a WASM module is supposed to run in, it's still very easy to take down the whole Simulator with
some errant code... ;-)
Expand Down Expand Up @@ -60,15 +61,15 @@ On a more practical note, I am using it with the [MSFS Touch Portal Plugin](http
- Any calculator code saved in subscriptions is **pre-compiled to a more efficient byte code** representation before being passed to the respective calculator
functions. This significantly improves performance for recurring calculations.
- **Register Named Events**:
- Save recurring "set events," like activiating controls using calculator code, for more efficient and simpler re-use.
- Save recurring "set events," like activating controls using calculator code, for more efficient and simpler re-use.
Saved calculator code is pre-compiled to a more efficient byte code representation before being passed to the calculator function.
This significantly improves performance for recurring events.
- Registered events can be executed "natively" via _WASim API_ by simply sending a short command with the saved event ID.
- Saved events can also be named and executed via standard SimConnect commands `SimConnect_MapClientEventToSimEvent(id, "event_name")` and `SimConnect_TransmitClientEvent(id)`.
- Event names can be completely custom (including a `.` (period) as per SimConnect convention), or derive from the connected Client's name (to ensure uniqueness).
- **Send Simulator "Key Events"** directly by ID or name (instead of going through the SimConnect mapping process or executing calculator code). Much more efficient than the other methods.
- **New in v1.1.0:** Send Key Events with up to 5 values (like the new `SimConnect_TransmitClientEvent_EX1()`).
- **Remote Logging**: Log messages (errors, warnings, debug, etc) can optionally be sent to the Client, with specific minimum level (eg. only warnings and errros).
- **Remote Logging**: Log messages (errors, warnings, debug, etc) can optionally be sent to the Client, with specific minimum level (eg. only warnings and errors).
- **Ping** the Server to check that the WASM module is installed and running before trying to connect or use its features.

#### Core Components
Expand All @@ -77,9 +78,9 @@ On a more practical note, I am using it with the [MSFS Touch Portal Plugin](http
- Well-defined message API for communication between Server module and any client implementation.
- Uses standard SimConnect messages for the base network "transport" layer.
- All data allocations are on client side, so SimConnect limits in WASM module are bypassed (can in theory support unlimited clients).
- No wasted data allocations, each data/variable subscription is stored independently avoiding complications with offets or data overflows.
- No wasted data allocations, each data/variable subscription is stored independently avoiding complications with offsets or data overflows.
- Minimum possible impact on MSFS in terms of memory and CPU usage; practically zero effect for Sim user when no clients are connected (Server is idle).
- Server periodically checks that a client is still connected by sending "hearbeat" ping requests and enforcing a timeout if no response is received.
- Server periodically checks that a client is still connected by sending "heartbeat" ping requests and enforcing a timeout if no response is received.
- Extensive logging at configurable levels (debug/info/warning/etc) to multiple destinations (file/console/remote) for both Server and Client.
- Uses an efficient **lazy logging** implementation which doesn't evaluate any arguments if the log message will be discarded anyway
(eg. a DEBUG level message when minimum logging level is INFO).
Expand All @@ -90,7 +91,9 @@ On a more practical note, I am using it with the [MSFS Touch Portal Plugin](http

#### Desktop GUI
- Includes a full-featured desktop application which demonstrates/tests all available features of the API.
- Fully usable as a standalone application which saves preferences, imports/exports lists of data subscriptions/registered events, and other usabililty features.
- Fully usable as a standalone application which saves preferences, imports/exports lists of data subscriptions/registered events, and other friendly features.
- Very useful for "exploring" the simulator in general, like checking variable values, testing effects of key events and RPN calculator code.
- Can be used with the [MSFS/SimConnect Touch Portal Plugin](https://github.com/mpaperno/MSFSTouchPortalPlugin) for import/export of custom variable request definitions.

<p> &nbsp; </p>
<div align="center">
Expand All @@ -100,7 +103,7 @@ On a more practical note, I am using it with the [MSFS Touch Portal Plugin](http


-------------
### Downloads
### Downloads and Updates

Over in the [Releases](https://github.com/mpaperno/WASimCommander/releases) there are 3 packages provided. (The actual file names have version numbers appended.)
- `WASimCommander_SDK` - All header files, pre-built static and dynamic libs, packaged WASM module, pre-build GUI, reference documentation, and other tools/examples.
Expand All @@ -111,14 +114,16 @@ _Watch_ -> _Custom_ -> _Releases_ this repo (button at top) or subscribe to the

Update announcements are also posted on my Discord server's [WASimCommander release announcement channel](https://discord.gg/StbmZ2ZgsF).

The SDK and updates are [published on Flightsim.to](https://flightsim.to/file/36474/wasimcommander) where one could "subscribe" to release notifications (account required).

-------------
### Documentation & Examples

There are three basic console-style tests/examples included for `C++`, `C#`, and `Python` in the [src/Testing](https://github.com/mpaperno/WASimCommander/tree/main/src/Testing) folder.
If you like reading code, this is the place to start.

API docuemntation generated from source comments is published here: https://mpaperno.github.io/WASimCommander/ <br/>
A good place to start with the docs is probably the [`WASimClient`](https://mpaperno.github.io/WASimCommander/class_w_a_sim_commander_1_1_client_1_1_w_a_sim_client.html) page.
API documentation generated from source comments is published here: https://wasimcommander.max.paperno.us/ <br/>
A good place to start with the docs is probably the [`WASimClient`](https://wasimcommander.max.paperno.us/class_w_a_sim_commander_1_1_client_1_1_w_a_sim_client.html) page.

The GUI is written in C++ (using Qt library for UI), and while not the simplest example, _is_ a full implementation of almost all the available
API features. The main `WASimClient` interactions all happen in the `MainWindow::Private` class at the top of the
Expand All @@ -141,7 +146,7 @@ The module also logs to a file, though it's a bit tricky to find. On my edition
`D:\WpSystem\S-1-5-21-611220451-769921231-644967174-1000\AppData\Local\Packages\Microsoft.FlightSimulator_8wekyb3d8bbwe\LocalState\packages\wasimcommander-module\work`

To enable more verbose logging on the module at startup, edit the `server_conf.ini` file which is found in the module's install folder
(`Comunity\wasimcommander-module\modules`). There are comments in there indicating the options.
(`Community\wasimcommander-module\modules`). There are comments in there indicating the options.

Keep in mind that the server logging level can also be changed remotely at runtime, but
of course that only works if you can establish a connection to the module in the first place.
Expand Down Expand Up @@ -185,12 +190,17 @@ Uses and includes [_IniPP_ by Matthias C. M. Troffaes](https://github.com/mcmtro

Uses the _Microsoft SimConnect SDK_ under the terms of the _MS Flight Simulator SDK EULA (11/2019)_ document.

The GUI component uses portions of the [_Qt Library_](http://qt.io) under the terms of the GPL v3 license.
WASimUI (GUI):
- Uses portions of the [_Qt Library_](http://qt.io) under the terms of the GPL v3 license.
- Uses and includes the following symbol fonts for icons, under the terms of their respective licenses:
- [IcoMoon Free](https://icomoon.io/#icons-icomoon) - IcoMoon.io, GPL v3.
- [Material Icons](https://material.io/) - Google, Apache License v2.0.
- Uses modified versions of `FilterTableHeader` and `FilterLineEdit` components from [DB Browser for SQLite](https://github.com/sqlitebrowser/sqlitebrowser) under GPL v3 license.
- Uses modified version of `MultisortTableView` from <https://github.com/dimkanovikov/MultisortTableView> under GPL v3 license.
- Uses Natural (alpha-numeric) sorting algorithm implementation for _Qt_ by Litkevich Yuriy (public domain).

The GUI component uses and includes the following symbol fonts for icons, under the terms of their respective licenses:
- [IcoMoon Free](https://icomoon.io/#icons-icomoon) - IcoMoon.io, GPL v3.
- [Material Icons](https://material.io/) - Google, Apache License v2.0.

Documentation generated with [Doxygen](https://www.doxygen.nl/) and styled with the most excellent [Doxygen Awesome](https://jothepro.github.io/doxygen-awesome-css).

-------------
### Copyright, License, and Disclaimer
Expand Down
Loading

0 comments on commit 4b3fe92

Please sign in to comment.