Skip to content

Remember the manual request across restarts (#205) - #206

Merged
nobrega8 merged 1 commit into
mainfrom
remember-request-205
Nov 6, 2026
Merged

nobrega8 merged 1 commit into
mainfrom
remember-request-205

Conversation

@nobrega8

@nobrega8 nobrega8 commented Nov 6, 2026

Copy link
Copy Markdown
Owner

Closes #205.

The manual request of step 2 (command, start address, quantity and Loop) always started as FC03 / 0 / 10 / Loop on, so it had to be set again after every restart.

What changes

  • src/lib/state.svelte.ts: the request is saved to modbench.request in localStorage whenever it changes (quantity, Loop, command, address) and when a test starts, and is filled in again at start. Saved values that are not a valid function code, address or quantity for that command are ignored, so the defaults apply.
  • It follows the existing Remember the last connection setting: with it off, nothing is saved or restored. The demo never saves.
  • With a map open, Loop still comes from that device's remembered choices, as before.
  • The setting's hint now says steps 1 and 2 are filled in again (all 17 languages), and the manual's Settings chapter says the same.

Tests

  • New tests in state.test.ts: the request is saved and picked up by a fresh start; a saved request that does not fit is ignored.
  • npx vitest run: 228 passed. npm run check: 0 errors, 0 warnings.

Command, start address, quantity and Loop of step 2 are saved when they
change and filled in again at start, under the existing "Remember the
last connection" setting. Saved values that do not fit are ignored.
@nobrega8
nobrega8 merged commit ebdeded into main Nov 6, 2026
7 checks passed
@nobrega8
nobrega8 deleted the remember-request-205 branch November 6, 2026 09:28
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.

Feature Request: Persist the Quantity Setting Across Restarts

1 participant