Repository navigation
fix(timeline): keep short segments and read their length to one sample - #67
Merged
Merged
Conversation
A drag along the ruler was taken for a click, and its segment dropped, whenever it covered less than 2 µs. Zoomed in to a few hundred nanoseconds per division the whole view is shorter than that, so no segment could be marked at all, and short spans such as a fast SPI transfer or an analog rise could never be measured or listed. Tell a click from a drag by how far the pointer moves, 3 px as on the tracks, and keep any segment that covers at least one sample. The segment now changes only once the pointer has left the press, so a click no longer flashes empty A and B flags.
The segment's length on the ruler and in the status bar was rounded to whole nanoseconds below a microsecond and to 0.1 µs below a millisecond, so short segments read wrong: one sample at 400 MHz showed as 3 ns rather than 2.5 ns, and 2.61 µs at 100 MHz as 2.6 µs. Format it as the edge measurement's Δt is formatted, with the digits one sample needs (at most three), so both readouts agree. Event lengths in the data stream keep their own format.
DESIGN.md §6.6 now tells a click from a drag on the ruler by 3 px, as on the tracks, instead of by 2 µs, and reads the segment's duration like the edge measurement, exact to one sample. The user guide says a segment can be as short as one sample.
Merged
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 drag along the ruler was taken for a click, and its segment dropped, whenever it covered less than 2 µs. Zoomed in to a few hundred nanoseconds per division the whole view is shorter than that, so no segment could be marked at all; short spans such as a fast SPI transfer, or a rise on an analog channel (where the edge measurement does not apply), could not be measured, listed in the data stream or exported.
Not changed: the segment's start and end times in the status bar's edge table (four decimals of ms) and in the data stream's segment summary (three) keep their fixed precision, so the two ends of a very short segment can read the same there.
Validation:
pnpm exec eslint srcpnpm typecheckpnpm test: 573 tests passed, including the newTimelineRuler.test.tsandSegmentMeasure.test.ts, which fail on the previous code (a 500 ns drag at 100 MHz is dropped; one sample at 400 MHz reads 3 ns)