feat: what a unit ID scan actually found - #47
Merged
Conversation
A unit that answers with an exception is a unit that is there and talking; one that says nothing is not on the bus at all. Both arrived as a message string, so nothing downstream could tell them apart. modbus-serial hangs `modbusCode` on the error it builds from an exception frame and on nothing else it throws, so that code is the whole test. The result carries the types that refused beside the ones that answered.
A row of chips reads as decoration and cost the space of a badge to say one word. The cell carries it now: green for a reply with data, amber for a unit that answered by refusing, red for one that said nothing, with the word in it and the same colour on the matching line in the error column. The column is a single select, so filtering offers those three answers rather than asking you to type one. Nothing here is editable; the type is for the filter.
The menu behind it stayed open, because only the register scan closed it, and the dialog itself was rendered inside that menu: a Popover unmounts its children when it closes, so closing the menu took the dialog with it. It lives beside the client view now, where the register dialog already did. Closing clears the results, so the next scan does not fill in around the last one. The toggles carry the short names the result columns use, and the count is gone: that grid lists every unit it asked, which is more than a number can say. The close button lost its cross. The grid is keyed on the chosen register types. It carries width state across a change of columns otherwise, and the error column, the only one on flex, came back at zero often enough to look like it had disappeared.
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 unit that answers with a Modbus exception is a unit that is there and talking: it answered the question with no. One that says nothing is not on the bus. Both used to be the same red chip.
Telling them apart
modbus-serial hangs
modbusCodeon the error it builds from an exception frame, and on nothing else it throws: a timeout is aTransactionTimedOutError, a closed port aPortNotOpenError. So the code is the whole test, and the result now carries the types that refused beside the ones that answered.In the grid
The cell carries the answer instead of a chip inside it: green
OK, amberEXCEPTION, redNO REPLY, and the matching line in the error column takes the same colour, so the two cannot disagree. The columns are single selects, so filtering offers those three answers rather than a text box. Nothing is editable; the type is for the filter.The register type toggles carry the short names the columns use, and the count is gone from this dialog: the grid lists every unit it asked, which is more than a number can say. It stays in the register scan, where you only see the first rows.
Manners
The cog menu stayed open behind this dialog, because only the register scan closed it, and the dialog was rendered inside that menu: a Popover unmounts its children when it closes, so closing the menu took the dialog with it. It is mounted beside the client view now, where the register dialog already was. Closing clears the results. The close button lost its cross.
The grid is keyed on the chosen register types, because it carries width state across a change of columns and the error column, the only one on flex, came back at zero often enough to look like it had vanished.
What was run
Lint, typecheck, 573 unit tests, and the full e2e suite at 556. One of the new specs pins down something worth knowing: against Modbux's own server every scanned unit ID answers, so the results come back amber and never red.
ServerTCPandServerSerialignore a request whose unit ID is not theirs unless theirs is 255, and Modbux passes none, which is right for a server holding several units. Testing a real silence needs an opponent that can be told to stay quiet.