add C# UnitTabulator and Rust unit_converter#1254
Open
Conversation
Contributor
Author
This comment was marked as outdated.
This comment was marked as outdated.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new unit conversion capability across the repo by introducing a Rust azure_iot_operations_facilities crate (with a UnitConverter + generated unit tables) and a new .NET Azure.Iot.Operations.UnitTabulator tool to generate the Rust unit metadata from QUDT Turtle resources.
Changes:
- Introduces
azure_iot_operations_facilitiesRust crate withget_converterAPI, conversion errors, and tests. - Adds generated Rust lookup tables for UNECE ECE codes and QUDT unit conversion metadata.
- Adds a new .NET UnitTabulator project (T4-based) to read QUDT TTL resources and emit the Rust tables; wires it into
codegen2/codegen.sln.
Reviewed changes
Copilot reviewed 20 out of 24 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| rust/azure_iot_operations_facilities/src/unit_converter.rs | Core Rust unit conversion API, parsing rules, and unit tests |
| rust/azure_iot_operations_facilities/src/unit_converter/ece_codes.rs | Generated UNECE → QUDT unit-name mapping table |
| rust/azure_iot_operations_facilities/src/lib.rs | Exposes unit converter module + re-exports public API |
| rust/azure_iot_operations_facilities/tests/unit_converter_tests.rs | Integration tests for converter and error cases |
| rust/azure_iot_operations_facilities/gen.sh | Helper script to run UnitTabulator and format generated Rust |
| rust/azure_iot_operations_facilities/Cargo.toml | New Rust crate manifest |
| rust/Cargo.toml | Adds the new crate to the Rust workspace members |
| codegen2/src/Azure.Iot.Operations.UnitTabulator/** | New .NET tool to read QUDT TTL and generate Rust ece_codes.rs + unit_infos.rs |
| codegen2/codegen.sln | Adds UnitTabulator project to the codegen2 solution |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
c264a46 to
369e5c7
Compare
timtay-microsoft
approved these changes
Mar 4, 2026
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.
This PR implements this proposal: QUDT Unit Conversion Library.docx