mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-17 01:50:47 -04:00
pass 1 (broken)
This commit is contained in:
@@ -5,7 +5,7 @@ import React from 'react';
|
||||
import TopDownMap from '../TopDownMap/index.jsx';
|
||||
import { roverNameChromeStyle } from '../../lib/roverColor.js';
|
||||
|
||||
export default function HudOverlay({
|
||||
function HudOverlay({
|
||||
sensors,
|
||||
label,
|
||||
roverColor = null,
|
||||
@@ -174,3 +174,5 @@ export default function HudOverlay({
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default React.memo(HudOverlay);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// Scope: Keeps behavior unchanged while isolating this concern into a clear, single-responsibility unit.
|
||||
import React from 'react';
|
||||
|
||||
export default function LightBumpBars({ sensors }) {
|
||||
function LightBumpBars({ sensors }) {
|
||||
const values = [
|
||||
sensors?.lightBumpLeftSignal,
|
||||
sensors?.lightBumpFrontLeftSignal,
|
||||
@@ -47,3 +47,5 @@ export default function LightBumpBars({ sensors }) {
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default React.memo(LightBumpBars);
|
||||
|
||||
@@ -100,10 +100,18 @@ export default function VideoTile({
|
||||
.map(([key]) => key);
|
||||
const limiterCaps = overcurrentLimiter?.caps || null;
|
||||
const limiterGroups = overcurrentLimiter?.overcurrent?.groups || null;
|
||||
const debugAudio =
|
||||
typeof window !== 'undefined' && new URLSearchParams(window.location.search).has('debugAudio');
|
||||
const debugHud =
|
||||
typeof window !== 'undefined' && new URLSearchParams(window.location.search).has('debugHud');
|
||||
const debugFlags = useMemo(() => {
|
||||
if (typeof window === 'undefined') {
|
||||
return { debugAudio: false, debugHud: false };
|
||||
}
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
return {
|
||||
debugAudio: params.has('debugAudio'),
|
||||
debugHud: params.has('debugHud'),
|
||||
};
|
||||
}, []);
|
||||
const debugAudio = debugFlags.debugAudio;
|
||||
const debugHud = debugFlags.debugHud;
|
||||
const limiterFill = useMemo(() => {
|
||||
if (!limiterCaps) return null;
|
||||
const driveCap = Number.isFinite(limiterCaps?.drive?.cap) ? limiterCaps.drive.cap : 1;
|
||||
|
||||
Reference in New Issue
Block a user