feat(k1): complete primary acquisition lifecycle
This commit is contained in:
@@ -29,6 +29,17 @@ export function isTerminalAcquisitionState(
|
||||
return state ? TERMINAL_ACQUISITION_STATES.has(state) : false;
|
||||
}
|
||||
|
||||
export function shouldRenderSpatialControls(
|
||||
state: XgridsK1State | null | undefined,
|
||||
): boolean {
|
||||
const acquisition = state?.acquisition;
|
||||
if (!acquisition || state?.source_mode === "replay") return false;
|
||||
return (
|
||||
!isTerminalAcquisitionState(acquisition.state) ||
|
||||
acquisition.cleanup_pending === true
|
||||
);
|
||||
}
|
||||
|
||||
export function recoverableAcquisition(
|
||||
state: XgridsK1State | null | undefined,
|
||||
): XgridsAcquisition | null {
|
||||
@@ -44,6 +55,21 @@ export function isSourceRuntimeBusy(state: XgridsK1State | null | undefined): bo
|
||||
return state?.source_mode === "live" || state?.source_mode === "replay";
|
||||
}
|
||||
|
||||
export function isVendorWriteCapable(
|
||||
state: XgridsK1State | null | undefined,
|
||||
): boolean {
|
||||
return (
|
||||
state?.compatibility?.vendor_writes_enabled === true &&
|
||||
state.compatibility.permitted_mode === "active-control"
|
||||
);
|
||||
}
|
||||
|
||||
export function isSoftwareCommandedAcquisition(
|
||||
state: XgridsK1State | null | undefined,
|
||||
): boolean {
|
||||
return isVendorWriteCapable(state) && state?.acquisition?.control_mode === "plugin-commanded";
|
||||
}
|
||||
|
||||
export function confirmedRuntimeSourceMode(
|
||||
state: XgridsK1State | null | undefined,
|
||||
): RuntimeSourceMode {
|
||||
|
||||
Reference in New Issue
Block a user