mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-17 10:00:46 -04:00
stupid
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -11,8 +11,8 @@
|
|||||||
<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-D3ANBnoQ.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index-HhAzSaxc.css">
|
<link rel="stylesheet" crossorigin href="/assets/index-CVAmzxlA.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
|
|||||||
@@ -97,6 +97,8 @@ export default function VideoTile({
|
|||||||
.map(([key]) => key);
|
.map(([key]) => key);
|
||||||
const limiterCaps = overcurrentLimiter?.caps || null;
|
const limiterCaps = overcurrentLimiter?.caps || null;
|
||||||
const limiterGroups = overcurrentLimiter?.overcurrent?.groups || null;
|
const limiterGroups = overcurrentLimiter?.overcurrent?.groups || null;
|
||||||
|
const debugHud =
|
||||||
|
typeof window !== 'undefined' && new URLSearchParams(window.location.search).has('debugHud');
|
||||||
const limiterFill = useMemo(() => {
|
const limiterFill = useMemo(() => {
|
||||||
if (!limiterCaps) return null;
|
if (!limiterCaps) return null;
|
||||||
const driveCap = Number.isFinite(limiterCaps?.drive?.cap) ? limiterCaps.drive.cap : 1;
|
const driveCap = Number.isFinite(limiterCaps?.drive?.cap) ? limiterCaps.drive.cap : 1;
|
||||||
@@ -106,6 +108,20 @@ export default function VideoTile({
|
|||||||
const limiterActive = Boolean(overcurrentLimiter?.isActive);
|
const limiterActive = Boolean(overcurrentLimiter?.isActive);
|
||||||
const overlayMotors = overcurrentMotors.length ? overcurrentMotors : limiterActive ? ['limiter'] : [];
|
const overlayMotors = overcurrentMotors.length ? overcurrentMotors : limiterActive ? ['limiter'] : [];
|
||||||
const overlayFill = limiterFill ?? (overcurrentMotors.length ? 1 : 0);
|
const overlayFill = limiterFill ?? (overcurrentMotors.length ? 1 : 0);
|
||||||
|
const overlayVisible = Boolean(overlayMotors.length);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (!debugHud) return;
|
||||||
|
console.log('[OvercurrentHUD]', {
|
||||||
|
overlayVisible,
|
||||||
|
overlayMotors,
|
||||||
|
overlayFill,
|
||||||
|
limiterActive,
|
||||||
|
limiterCaps,
|
||||||
|
limiterGroups,
|
||||||
|
wheelOvercurrents,
|
||||||
|
});
|
||||||
|
}, [debugHud, overlayFill, overlayMotors, overlayVisible, limiterActive, limiterCaps, limiterGroups, wheelOvercurrents]);
|
||||||
|
|
||||||
const scheduleRestart = useCallback(() => {
|
const scheduleRestart = useCallback(() => {
|
||||||
clearTimeout(restartTimer.current);
|
clearTimeout(restartTimer.current);
|
||||||
@@ -432,6 +448,11 @@ export default function VideoTile({
|
|||||||
labelScale={hudLabelScale}
|
labelScale={hudLabelScale}
|
||||||
/>
|
/>
|
||||||
<HudChatInput compact={mobileHud} />
|
<HudChatInput compact={mobileHud} />
|
||||||
|
{debugHud ? (
|
||||||
|
<div className="pointer-events-none absolute left-1 top-1 z-40 rounded bg-black/80 px-1 py-0.5 text-[0.6rem] text-lime-200">
|
||||||
|
{`OC vis:${overlayVisible ? 1 : 0} motors:${overlayMotors.length} fill:${Math.round(overlayFill * 100)}%`}
|
||||||
|
</div>
|
||||||
|
) : null}
|
||||||
<OvercurrentOverlay motors={overlayMotors} fill={overlayFill} compact={mobileHud} />
|
<OvercurrentOverlay motors={overlayMotors} fill={overlayFill} compact={mobileHud} />
|
||||||
<LowBatteryOverlay charge={batteryCharge} config={batteryConfig} compact={mobileHud} />
|
<LowBatteryOverlay charge={batteryCharge} config={batteryConfig} compact={mobileHud} />
|
||||||
{showVerticalBattery && batteryVisual.available ? (
|
{showVerticalBattery && batteryVisual.available ? (
|
||||||
|
|||||||
Reference in New Issue
Block a user