mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-16 01:21:20 -04:00
waw awa..
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -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-DgooAI0x.js"></script>
|
<script type="module" crossorigin src="/assets/index-DlYfmusA.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index-HhAzSaxc.css">
|
<link rel="stylesheet" crossorigin href="/assets/index-HhAzSaxc.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@@ -108,11 +108,15 @@ export default function VideoTile({
|
|||||||
const auxCap = Number.isFinite(limiterCaps?.aux?.cap) ? limiterCaps.aux.cap : 1;
|
const auxCap = Number.isFinite(limiterCaps?.aux?.cap) ? limiterCaps.aux.cap : 1;
|
||||||
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 fallbackLabels = useMemo(
|
||||||
|
() => overcurrentMotors.map((name) => OVERCURRENT_LABELS[name] || name),
|
||||||
|
[overcurrentMotors],
|
||||||
|
);
|
||||||
const overcurrentActive = Boolean(
|
const overcurrentActive = Boolean(
|
||||||
(limiterGroups?.drive || limiterGroups?.aux) || overcurrentMotors.length,
|
(limiterGroups?.drive || limiterGroups?.aux) || overcurrentMotors.length,
|
||||||
);
|
);
|
||||||
const overlayFill = overcurrentLimiter
|
const overlayFill = overcurrentLimiter
|
||||||
? limiterFill ?? 0
|
? limiterFill ?? (overcurrentMotors.length ? 1 : 0)
|
||||||
: overcurrentMotors.length
|
: overcurrentMotors.length
|
||||||
? 1
|
? 1
|
||||||
: 0;
|
: 0;
|
||||||
@@ -121,7 +125,7 @@ export default function VideoTile({
|
|||||||
);
|
);
|
||||||
const overcurrentLabels = useMemo(() => {
|
const overcurrentLabels = useMemo(() => {
|
||||||
if (!overcurrentLimiter) {
|
if (!overcurrentLimiter) {
|
||||||
return overcurrentMotors.map((name) => OVERCURRENT_LABELS[name] || name);
|
return fallbackLabels;
|
||||||
}
|
}
|
||||||
const labels = [];
|
const labels = [];
|
||||||
const driveCap = Number.isFinite(limiterCaps?.drive?.cap) ? limiterCaps.drive.cap : 1;
|
const driveCap = Number.isFinite(limiterCaps?.drive?.cap) ? limiterCaps.drive.cap : 1;
|
||||||
@@ -130,8 +134,8 @@ export default function VideoTile({
|
|||||||
const auxActive = Boolean(limiterGroups?.aux) || auxCap < 0.999;
|
const auxActive = Boolean(limiterGroups?.aux) || auxCap < 0.999;
|
||||||
if (driveActive) labels.push('Drive wheels');
|
if (driveActive) labels.push('Drive wheels');
|
||||||
if (auxActive) labels.push('Aux motors');
|
if (auxActive) labels.push('Aux motors');
|
||||||
return labels;
|
return labels.length ? labels : fallbackLabels;
|
||||||
}, [limiterCaps, limiterGroups, overcurrentLimiter, overcurrentMotors]);
|
}, [fallbackLabels, limiterCaps, limiterGroups, overcurrentLimiter]);
|
||||||
|
|
||||||
const scheduleRestart = useCallback(() => {
|
const scheduleRestart = useCallback(() => {
|
||||||
clearTimeout(restartTimer.current);
|
clearTimeout(restartTimer.current);
|
||||||
|
|||||||
Reference in New Issue
Block a user