Repository navigation
Conversation
… one config write The 6-byte GET 0x3106 / SET 0x3107 struct holds the command set (byte 1) and, from the VPanel "NC Code setting" page (FUN_00404ff0 / FUN_00405040), the decimal-point method (byte 2), tool-diameter offset type (byte 3) and optional block (byte 4); bytes 0 and 5 are only round-tripped. MachineConfig decodes it, write_config() changes any of the fields with one read-modify-write (validated, acked and read back), and the config is cached at connect. set_command_set() now delegates to it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ialog The header shows "RML-1 mode", "NC mode" or "Auto-mode" from the config read at connect. n opens a dialog for the command set plus the three NC Code preferences (tool-diameter offset type, decimal-point method, optional block): arrows move, Space selects, Enter applies everything changed with one config write, Esc cancels. The NC Code preferences are locked unless the command set is NC Code or automatic, as in VPanel, and n is refused while a job is loaded. The Z-probe dialog now uses the cached command set instead of reading it on open, and also warns that VPanel hides User in NC Code mode. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…t the whole config at startup The dialog group is "Tool-dia offset paths" with options "Type A" and "Type B", and the option column moves right to fit it. The startup banner prints every decoded field of the 6-byte machine config plus the raw bytes, e.g. Machine config: command set NC Code, tool-dia offset paths Type A, decimal point Conventional Method, optional block Enabled [00 01 00 00 00 05] 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.
Reads the machine's command set and NC Code preferences at connect, shows the command set in the header, and adds an
ndialog to change them.What the machine config is
The 6-byte
GET 0x3106/SET 0x3107struct carries the command set and, from VPanel's "NC Code setting" page (FUN_00404ff0/FUN_00405040), three NC Code preferences. Each byte is the MFC radio index of a VPanel control:Bytes 0 and 5 are never edited by VPanel and are round-tripped. VPanel writes only when something changed, and enables the NC Code page only for the NC Code and automatic command sets.
Changes
MachineConfigdecodes the struct. It is read at connect and logged in full at startup (Machine config: command set …, tool-dia offset paths …, decimal point …, optional block … [00 01 00 00 00 05]).write_config()changes any of the fields with one validated read-modify-write, waits for the ack and reads back to verify.set_command_set()now delegates to it, and the unusedMDX40A.CMDSET_*class attributes are gone (the constants are module-level).RML-1 mode,NC modeorAuto-mode.nopens a Command Mode dialog (command set plus Tool-dia offset paths Type A/B, decimal point, optional block):↑↓ navigate,↵ apply,Space select,Esc close. The NC Code preferences are locked unless the command set is NC Code or automatic, as in VPanel, andnis refused while a job is loaded. Changes are applied with a single write.usb-protocol.md, notes insending-nc-code.md, and thenkey in the README.Test plan
pytest -q: 206 passed, 1 skippedtests/test_machine_config.py(exact bytes written, only the edited bytes change, no write when unchanged, validation, failed read-back, the startup banner) andtests/test_cmd_mode.py(dialog flow, locked preferences, one write per apply, no write on Esc)ruff checkon the test files touched🤖 Generated with Claude Code