• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

atomic14 / web-serial-plotter / 17381877161

01 Sep 2025 03:29PM UTC coverage: 63.077% (+0.1%) from 62.932%
17381877161

push

github

cgreening
Fix build

409 of 519 branches covered (78.81%)

Branch coverage included in aggregate %.

1969 of 3251 relevant lines covered (60.57%)

36.2 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/components/GeneratorPanel.tsx
1
import { useSignalGenerator } from '../hooks/useSignalGenerator'
×
2
import Button from './ui/Button'
×
3
import { PlayIcon, StopIcon } from '@heroicons/react/24/outline'
×
4
import Input from './ui/Input'
×
5
import Select from './ui/Select'
×
6

7
interface Props {
8
  onEmitLine: (line: string) => void
9
  disabled?: boolean
10
}
11

12
export function GeneratorPanel({ onEmitLine, disabled }: Props) {
×
13
  const gen = useSignalGenerator(onEmitLine)
×
14

15
  return (
×
16
    <div className="flex items-center gap-2">
×
17
      <Select
×
18
        value={gen.config.mode}
×
19
        onChange={(e) => gen.setConfig({ mode: e.target.value as 'sine3' | 'noise' | 'ramp' })}
×
20
        disabled={disabled || gen.isRunning}
×
21
      >
22
        <option value="sine3">Sine (phased)</option>
×
23
        <option value="noise">Noise</option>
×
24
        <option value="ramp">Ramp</option>
×
25
      </Select>
×
26
      <Input
×
27
        className="w-24"
×
28
        type="number"
×
29
        step="1"
×
30
        min={1}
×
31
        value={gen.config.sampleRateHz}
×
32
        onChange={(e) => gen.setConfig({ sampleRateHz: Number(e.target.value) || 1 })}
×
33
        disabled={disabled || gen.isRunning}
×
34
      />
×
35
      <span className="text-xs opacity-70">Hz</span>
×
36
      {gen.isRunning ? (
×
37
        <Button variant="danger" onClick={() => gen.stop()} startIcon={<StopIcon className="w-4 h-4" />}>Stop</Button>
×
38
      ) : (
39
        <Button variant="primary" onClick={() => gen.start()} disabled={disabled} startIcon={<PlayIcon className="w-4 h-4" />}>Start</Button>
×
40
      )}
41
    </div>
×
42
  )
43
}
×
44

45
export default GeneratorPanel
×
46

47

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc