This commit is contained in:
legop3
2026-01-21 14:04:14 -05:00
parent 2fc9becc88
commit 99a1c5418d
3 changed files with 22 additions and 17 deletions
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -11,7 +11,7 @@
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" /> <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="apple-mobile-web-app-title" content="Multi Roomba Rover" /> <meta name="apple-mobile-web-app-title" content="Multi Roomba Rover" />
<title>Multi Roomba Rover</title> <title>Multi Roomba Rover</title>
<script type="module" crossorigin src="/assets/index-DNjDcUqU.js"></script> <script type="module" crossorigin src="/assets/index-CliLyfmZ.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-HhAzSaxc.css"> <link rel="stylesheet" crossorigin href="/assets/index-HhAzSaxc.css">
</head> </head>
<body> <body>
+13 -8
View File
@@ -104,10 +104,11 @@ export default function VideoTile({
return Math.max(0, Math.min(1, 1 - Math.min(driveCap, auxCap))); return Math.max(0, Math.min(1, 1 - Math.min(driveCap, auxCap)));
}, [limiterCaps]); }, [limiterCaps]);
const limiterActive = Boolean(overcurrentLimiter?.isActive); const limiterActive = Boolean(overcurrentLimiter?.isActive);
const overlayMotors = overcurrentMotors.length const overlayVisible = Boolean(overcurrentMotors.length || limiterActive);
? overcurrentMotors const overlayLabels = overcurrentMotors.length
? overcurrentMotors.map((name) => OVERCURRENT_LABELS[name] || name)
: limiterActive : limiterActive
? ['limiter'] ? ['Overcurrent limit']
: []; : [];
const overlayFill = limiterFill ?? (overcurrentMotors.length ? 1 : 0); const overlayFill = limiterFill ?? (overcurrentMotors.length ? 1 : 0);
@@ -436,7 +437,12 @@ export default function VideoTile({
labelScale={hudLabelScale} labelScale={hudLabelScale}
/> />
<HudChatInput compact={mobileHud} /> <HudChatInput compact={mobileHud} />
<OvercurrentOverlay motors={overlayMotors} fill={overlayFill} compact={mobileHud} /> <OvercurrentOverlay
labels={overlayLabels}
fill={overlayFill}
visible={overlayVisible}
compact={mobileHud}
/>
<LowBatteryOverlay charge={batteryCharge} config={batteryConfig} compact={mobileHud} /> <LowBatteryOverlay charge={batteryCharge} config={batteryConfig} compact={mobileHud} />
{showVerticalBattery && batteryVisual.available ? ( {showVerticalBattery && batteryVisual.available ? (
<BatteryBarVertical visual={batteryVisual} /> <BatteryBarVertical visual={batteryVisual} />
@@ -734,12 +740,11 @@ const OVERCURRENT_LABELS = {
rightWheel: 'Right wheel', rightWheel: 'Right wheel',
mainBrush: 'Main brush', mainBrush: 'Main brush',
sideBrush: 'Side brush', sideBrush: 'Side brush',
limiter: 'Overcurrent limit',
}; };
function OvercurrentOverlay({ motors, fill = 0, compact = false }) { function OvercurrentOverlay({ labels, fill = 0, visible = false, compact = false }) {
if (!motors?.length) return null; if (!visible) return null;
const safeLabels = motors.map((name) => OVERCURRENT_LABELS[name] || name); const safeLabels = Array.isArray(labels) && labels.length ? labels : ['Overcurrent'];
const containerClass = compact ? 'p-2' : 'p-4'; const containerClass = compact ? 'p-2' : 'p-4';
const textClass = compact ? 'text-lg' : 'text-4xl'; const textClass = compact ? 'text-lg' : 'text-4xl';
const subTextClass = compact ? 'text-xs' : 'text-xl'; const subTextClass = compact ? 'text-xs' : 'text-xl';