Remove grid toggle — graticule always on

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
rolandnsharp
2026-04-05 21:14:51 +10:00
parent b29170faf1
commit 86a236f77d
3 changed files with 4 additions and 16 deletions

View File

@@ -30,8 +30,6 @@ nimble build
| `m` | Toggle Y-T / X-Y mode | | `m` | Toggle Y-T / X-Y mode |
| `+` / `-` | Increase / decrease gain (amplitude) | | `+` / `-` | Increase / decrease gain (amplitude) |
| `]` / `[` | Zoom in / out time axis | | `]` / `[` | Zoom in / out time axis |
| `g` | Cycle grid: full → crosshair → off |
| `space` | Freeze display |
| `q` | Quit (with CRT shutdown effect) | | `q` | Quit (with CRT shutdown effect) |
## Audio ## Audio

View File

@@ -43,7 +43,7 @@ proc main() =
tb = newTerminalBuffer(w, h) tb = newTerminalBuffer(w, h)
scope.phosphor.render(tb) scope.phosphor.render(tb)
drawGraticule(tb, w, h, scope.grid) drawGraticule(tb, w, h)
drawHUD(tb, w, h, scope) drawHUD(tb, w, h, scope)
tb.display() tb.display()
@@ -61,8 +61,6 @@ proc main() =
scope.timeDiv = min(scope.timeDiv * 1.5, 16.0) scope.timeDiv = min(scope.timeDiv * 1.5, 16.0)
of Key.LeftBracket: of Key.LeftBracket:
scope.timeDiv = max(scope.timeDiv / 1.5, 0.25) scope.timeDiv = max(scope.timeDiv / 1.5, 0.25)
of Key.G:
scope.grid = if scope.grid == gsGrid: gsOff else: gsGrid
else: else:
discard discard

View File

@@ -8,10 +8,6 @@ type
ModeYT ## Time-domain: x=time, y=amplitude ModeYT ## Time-domain: x=time, y=amplitude
ModeXY ## Lissajous: x=left, y=right ModeXY ## Lissajous: x=left, y=right
GridStyle* = enum
gsGrid ## Full graticule
gsOff ## No grid
Scope* = object Scope* = object
phosphor*: PhosphorBuffer phosphor*: PhosphorBuffer
mode*: DisplayMode mode*: DisplayMode
@@ -19,7 +15,6 @@ type
sampleCount*: int sampleCount*: int
gain*: float # amplitude scaling (volts/div) gain*: float # amplitude scaling (volts/div)
timeDiv*: float # horizontal zoom (time/div) timeDiv*: float # horizontal zoom (time/div)
grid*: GridStyle
proc initScope*(w, h: int): Scope = proc initScope*(w, h: int): Scope =
Scope( Scope(
@@ -29,8 +24,7 @@ proc initScope*(w, h: int): Scope =
samplesR: newSeq[float](4096), samplesR: newSeq[float](4096),
sampleCount: 0, sampleCount: 0,
gain: 6.5, gain: 6.5,
timeDiv: 3.4, timeDiv: 3.4
grid: gsOff
) )
proc w*(s: Scope): int = s.phosphor.w proc w*(s: Scope): int = s.phosphor.w
@@ -84,9 +78,7 @@ proc renderTrace*(scope: var Scope) =
# ── Graticule ──────────────────────────────────────────────────────── # ── Graticule ────────────────────────────────────────────────────────
proc drawGraticule*(tb: var TerminalBuffer, w, h: int, grid: GridStyle) = proc drawGraticule*(tb: var TerminalBuffer, w, h: int) =
if grid == gsOff: return
let cx = w div 2 let cx = w div 2
let cy = h div 2 let cy = h div 2
@@ -129,5 +121,5 @@ proc drawHUD*(tb: var TerminalBuffer, w, h: int, scope: Scope) =
tb.write(1, 0, fgGreen, styleBright, tb.write(1, 0, fgGreen, styleBright,
" " & modeStr & gainStr & tdStr & " ") " " & modeStr & gainStr & tdStr & " ")
let help = " m:mode +/-:gain [/]:time g:grid q:quit " let help = " m:mode +/-:gain [/]:time q:quit "
tb.write(w - help.len - 1, h - 1, fgGreen, styleDim, help) tb.write(w - help.len - 1, h - 1, fgGreen, styleDim, help)