mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-16 09:31:20 -04:00
horn limits and such
This commit is contained in:
@@ -24,6 +24,7 @@ export default function CameraServoPanel() {
|
||||
const hornAvailable = Boolean(roverId && pipeline?.horn);
|
||||
const nightVisionKey = formatKeyLabel(keymap?.nightVisionToggle?.[0]);
|
||||
const hornKey = formatKeyLabel(keymap?.hornHonk?.[0]);
|
||||
const hornCooldownActive = (horn?.cooldownUntil ?? 0) > Date.now();
|
||||
const min = typeof config?.minAngle === 'number' ? config.minAngle : -30;
|
||||
const max = typeof config?.maxAngle === 'number' ? config.maxAngle : 30;
|
||||
const value =
|
||||
@@ -106,7 +107,7 @@ export default function CameraServoPanel() {
|
||||
)}
|
||||
{hornAvailable && (
|
||||
<HornControl
|
||||
disabled={!roverId}
|
||||
disabled={!roverId || hornCooldownActive}
|
||||
onStart={startHorn}
|
||||
onStop={stopHorn}
|
||||
keyLabel={hornKey}
|
||||
|
||||
@@ -85,6 +85,7 @@ export function InlineCameraTilt({ keymap }) {
|
||||
const nightVisionAvailable = Boolean(roverId && pipeline?.nightVision);
|
||||
const nightVisionState = pipeline?.nightVisionState;
|
||||
const hornAvailable = Boolean(roverId && pipeline?.horn);
|
||||
const hornCooldownActive = (horn?.cooldownUntil ?? 0) > Date.now();
|
||||
const min = typeof config?.minAngle === 'number' ? config.minAngle : -30;
|
||||
const max = typeof config?.maxAngle === 'number' ? config.maxAngle : 30;
|
||||
const value =
|
||||
@@ -133,7 +134,7 @@ export function InlineCameraTilt({ keymap }) {
|
||||
)}
|
||||
{hornAvailable && (
|
||||
<HornControl
|
||||
disabled={!roverId}
|
||||
disabled={!roverId || hornCooldownActive}
|
||||
onStart={startHorn}
|
||||
onStop={stopHorn}
|
||||
keyLabel={hornLabel}
|
||||
|
||||
@@ -146,6 +146,7 @@ function MobileJoystickPanel({ layout }) {
|
||||
const nightVisionAvailable = Boolean(roverId && pipeline?.nightVision);
|
||||
const nightVisionState = pipeline?.nightVisionState;
|
||||
const hornAvailable = Boolean(roverId && pipeline?.horn);
|
||||
const hornCooldownActive = (horn?.cooldownUntil ?? 0) > Date.now();
|
||||
const cameraMin = typeof cameraConfig?.minAngle === 'number' ? cameraConfig.minAngle : -45;
|
||||
const cameraMax = typeof cameraConfig?.maxAngle === 'number' ? cameraConfig.maxAngle : 45;
|
||||
const cameraValue =
|
||||
@@ -226,7 +227,12 @@ function MobileJoystickPanel({ layout }) {
|
||||
/>
|
||||
)}
|
||||
{hornAvailable && (
|
||||
<HornControl disabled={disabled} onStart={startHorn} onStop={stopHorn} active={horn?.active} />
|
||||
<HornControl
|
||||
disabled={disabled || hornCooldownActive}
|
||||
onStart={startHorn}
|
||||
onStop={stopHorn}
|
||||
active={horn?.active}
|
||||
/>
|
||||
)}
|
||||
{cameraEnabled && (
|
||||
<div className="bg-zinc-950 p-0.5 text-xs">
|
||||
|
||||
Reference in New Issue
Block a user