Repository navigation
role: value, scale and unit lines in the machine description - #24
Merged
Merged
Conversation
…cription Params (role/face.h) gains value(raw[, label]), scale(field, num, den) and unit(field, symbol); each prints one description line, inside the machine hash. python/onemachine reads them (RoleInfo.values/scales/units) and refuses a bad label, a zero denominator and a line for an undeclared role. Kinds that call none of them print what they printed before (role_link_avr: same size on avr-gcc 7.3). test/role/values_check.cpp and .py cover the lines, a select with labels and a report-only kind (empty Command). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
python/onemachine's SYMBOL class gains '%' (a percent scale: `unit duty raw %`). values_check.py: an accepted line (% and V/s^2, kept as written) and two refusals (a quote, 17 characters). docs/role.md states the character class. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
A kind can now print three more lines in the machine description, through `Params` (`role/face.h`), all inside the machine hash:
```
value mode 0 off a value the role takes, with an optional label
scale vin raw 5 1023 presented = raw * num / den, for a field of the role
unit vin raw V the unit symbol of a field of the role
```
`role/build.sh`: 33 ok; the one failure, `role_link_avr` (baseline comparison), fails identically on `main` before this change.
🤖 Generated with Claude Code