import { JointTypeEnum, type CoordinateSystem, type MotionGroupDescription, type RobotTcp } from "@wandelbots/nova-js/v2"; import { type IReactionDisposer } from "mobx"; import type { JoggerConnection } from "../../lib/JoggerConnection"; declare const discreteIncrementOptions: { id: string; mm: number; degrees: number; }[]; declare const incrementOptions: readonly [{ readonly id: "continuous"; }, ...{ id: string; mm: number; degrees: number; }[]]; export type JoggingAxis = "x" | "y" | "z"; export type JoggingDirection = "+" | "-"; export type DiscreteIncrementOption = (typeof discreteIncrementOptions)[number]; export type IncrementOption = (typeof incrementOptions)[number]; export type IncrementOptionId = IncrementOption["id"]; export declare const ORIENTATION_IDS: string[]; export type OrientationId = (typeof ORIENTATION_IDS)[number]; export type IncrementJogInProgress = { direction: JoggingDirection; axis: JoggingAxis; }; type TabType = "cartesian" | "joint" | "debug"; export type CartesianMotionType = "translate" | "rotate"; export declare class JoggingStore { readonly jogger: JoggerConnection; readonly coordSystems: CoordinateSystem[]; readonly motionGroupDescription: MotionGroupDescription; readonly tcps: RobotTcp[]; readonly inverseSolverValue: string | null | undefined; selectedTabId: TabType; /** Locks to prevent UI interactions during certain operations */ locks: Set; /** Block jogging UI interactions when connection is taken by another jogger */ blocked: boolean; /** * Id of selected coordinate system from among those defined on the API side */ selectedCoordSystemId: string; /** Id of selected tool center point from among the options available on the robot */ selectedTcpId: string; /** Whether a TCP change request is currently in flight */ tcpChangeInProgress: boolean; /** * Whether the user is jogging in the coordinate system or tool orientation. * When in tool orientation, the robot moves in a direction relative to the * attached tool rotation. */ selectedOrientation: OrientationId; /** * Id of selected increment amount for jogging. Options are defined by robot pad. * When non-continuous, jogging moves the robot by a fixed number of mm or degrees * each time the button is pressed, for extra precision */ selectedIncrementId: IncrementOptionId; /** * When on the cartesian tab, jogging can be either translating or rotating * around the TCP. */ selectedCartesianMotionType: CartesianMotionType; /** * If the jogger is busy running an incremental jog, this will be set * with the information about the motion */ incrementJogInProgress: IncrementJogInProgress | null; /** How fast the robot goes when doing cartesian translate jogging in mm/s */ translationVelocityMmPerSec: number; /** How fast the robot goes when doing cartesian or joint rotation jogging in °/s */ rotationVelocityDegPerSec: number; /** Minimum translation velocity user can choose on the velocity slider in °/s */ minTranslationVelocityMmPerSec: number; /** Maximum translation velocity user can choose on the velocity slider in °/s */ maxTranslationVelocityMmPerSec: number; /** Minimum rotation velocity user can choose on the velocity slider in °/s */ minRotationVelocityDegPerSec: number; /** Maximum rotation velocity user can choose on the velocity slider in °/s */ maxRotationVelocityDegPerSec: number; /** Whether to show the coordinate system select dropdown in the UI */ showCoordSystemSelect: boolean; /** Whether to show the TCP select dropdown in the UI */ showTcpSelect: boolean; /** Whether to show the orientation select dropdown in the UI */ showOrientationSelect: boolean; /** Whether to show the increment select dropdown in the UI */ showIncrementSelect: boolean; /** Whether to show icons in the jogging tabs */ showTabIcons: boolean; /** Whether to show the label to the right of the velocity slider */ showVelocitySliderLabel: boolean; /** Whether to show the legend before the slider */ showVelocityLegend: boolean; /** Whether to show the legend before the joints */ showJointsLegend: boolean; disposers: IReactionDisposer[]; /** * Inverse solver from the kinematic model of the motion group to determine, which tabs should be rendered */ inverseSolver: string | null | undefined; /** * Joint type to determine, whether the active robot should be displayed as Robot or Linear Axis and what tabs * should be rendered by the JoggingPanel component. */ jointType: JointTypeEnum; /** * Load a jogging store with the relevant data it needs * from the backend */ static loadFor(jogger: JoggerConnection): Promise; constructor(jogger: JoggerConnection, coordSystems: CoordinateSystem[], motionGroupDescription: MotionGroupDescription, tcps: RobotTcp[], inverseSolverValue: string | null | undefined); dispose(): void; get coordSystemCountByName(): import("lodash").Dictionary; deactivate(): Promise; /** Activate the jogger with current settings */ activate(): Promise; loadFromLocalStorage(): void; saveToLocalStorage(): void; get isLocked(): boolean; get localStorageSave(): { selectedTabId: TabType; selectedCoordSystemId: string; selectedOrientation: string; selectedIncrementId: string; selectedCartesianMotionType: CartesianMotionType; }; get tabs(): { id: TabType; label: string; }[]; get incrementOptions(): readonly [{ readonly id: "continuous"; }, ...{ id: string; mm: number; degrees: number; }[]]; get discreteIncrementOptions(): { id: string; mm: number; degrees: number; }[]; get incrementOptionsById(): import("lodash").Dictionary<{ id: string; mm: number; degrees: number; } | { readonly id: "continuous"; }>; get tabsById(): import("lodash").Dictionary<{ id: TabType; label: string; }>; get currentTab(): { id: TabType; label: string; }; get tabIndex(): number; get coordSystemsById(): import("lodash").Dictionary; /** * The id of the coordinate system to use for jogging. * If in tool orientation, this is set to "tool", not the * selected coordinate system. */ get activeCoordSystemId(): string; get tcpsById(): import("lodash").Dictionary; get activeDiscreteIncrement(): { id: string; mm: number; degrees: number; } | undefined; /** The selected rotation velocity converted to radians per second */ get rotationVelocityRadsPerSec(): number; /** Selected velocity in mm/sec or deg/sec */ velocityInDisplayUnits(useDegree: boolean): number; /** Minimum selectable velocity in mm/sec or deg/sec */ minVelocityInDisplayUnits(useDegree: boolean): number; /** Maximum selectable velocity in mm/sec or deg/sec */ maxVelocityInDisplayUnits(useDegree: boolean): number; onTabChange(_event: React.SyntheticEvent, newValue: number): void; setSelectedCoordSystemId(id: string): void; /** * @deprecated Use {@link JoggingStore.requestTcpChange} instead. This method now delegates * to `requestTcpChange` which properly communicates the TCP change to the server. */ setSelectedTcpId(id: string): void; /** * Request a TCP change on the server. Sends an InitializeJoggingRequest * with the new TCP to the backend via the jogging websocket. * * If the jogger is actively jogging, the websocket is reinitialised with the new TCP. * If the jogger is idle, a jogging websocket is briefly opened to communicate the * TCP change. The websocket is kept open until the state-stream confirms the * change (or a 1s timeout), to ensure the backend has time to process it. */ requestTcpChange(tcpId: string): Promise; private waitForTcpConfirmation; setSelectedOrientation(orientation: OrientationId): void; setSelectedIncrementId(id: IncrementOptionId): void; setCurrentIncrementJog(incrementJog: IncrementJogInProgress | null): void; setVelocityFromSlider(velocity: number, useDegree: boolean): void; setSelectedCartesianMotionType(type: CartesianMotionType): void; lock(id: string): void; unlock(id: string): void; block(): void; unblock(): void; /** Lock the UI until the given async callback resolves */ withMotionLock(fn: () => Promise): Promise; } export default JoggingStore;