This commit is contained in:
legop3
2025-11-18 20:54:58 -05:00
parent 288309055a
commit a1bd8eea96
7 changed files with 29 additions and 9 deletions
+3
View File
@@ -5,3 +5,6 @@
- https://www.thingiverse.com/thing:2873677
- https://www.printables.com/model/356894-raspberry-camera-module-with-automatic-ir-cut-swit
- https://www.thingiverse.com/thing:4514531
## spectator page
- video does not load in spectator page in admin mode
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -5,8 +5,8 @@
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>webui</title>
<script type="module" crossorigin src="/assets/index-CbBQ197T.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-DkvQkTlU.css">
<script type="module" crossorigin src="/assets/index-DgFhO08o.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-66RVFCl0.css">
</head>
<body>
<div id="root"></div>
+2 -2
View File
@@ -42,14 +42,14 @@ export default function AuthPanel() {
{loading ? 'Logging in…' : 'Login'}
</button>
</form>
<div className="flex gap-0.5 text-sm">
{/* <div className="flex gap-0.5 text-sm">
<button type="button" onClick={() => setRole('user')} className="flex-1 button-dark">
Driver
</button>
<button type="button" onClick={() => setRole('spectator')} className="flex-1 button-dark">
Spectator
</button>
</div>
</div> */}
</div>
);
}
+17
View File
@@ -76,6 +76,7 @@ export default function TelemetryPanel() {
<CliffBar value={sensors.cliffFrontRightSignal} />
<CliffBar value={sensors.cliffRightSignal} />
</div>
<MotorCurrentBar label="Left Wheel" value={sensors.wheelLeftCurrentMa} overcurrent={sensors.wheelOverCurrents.leftWheel}/>
</>
)}
@@ -143,3 +144,19 @@ function Metric({ label, value }) {
</div>
);
}
// a reusable motor current bar, with overcurrent coloring. Use the overcurrent from sensors for each motor.
// include a label to indicate which motor it is, with the label to the left of the bar
function MotorCurrentBar({ label, value, overcurrent }) {
const pct = value == null ? 0 : Math.max(0, Math.min(100, (value / 5000) * 100));
const height = `${pct}%`;
const barColor = overcurrent ? 'bg-red-500' : 'bg-emerald-500';
return (
<div className="flex items-center gap-0.5">
<span className="text-sm text-slate-200">{label}</span>
<div className="surface-muted h-6 w-20">
<div className={barColor} style={{ height }} />
</div>
</div>
);
}