2019-12-27 11:37:54 -07:00
|
|
|
import { BotPosition, BotState, UserEnv } from "../../devices/interfaces";
|
2020-02-07 16:06:40 -07:00
|
|
|
import { McuParams, Xyz, FirmwareHardware } from "farmbot";
|
2018-07-31 18:48:43 -06:00
|
|
|
import { GetWebAppConfigValue } from "../../config_storage/actions";
|
2018-10-22 09:35:44 -06:00
|
|
|
import { BooleanConfigKey } from "farmbot/dist/resources/configs/web_app";
|
2018-07-31 18:48:43 -06:00
|
|
|
|
2018-10-22 09:35:44 -06:00
|
|
|
export type ToggleWebAppBool = (key: BooleanConfigKey) => () => void;
|
|
|
|
export type GetWebAppBool = (key: BooleanConfigKey) => boolean;
|
2018-07-31 18:48:43 -06:00
|
|
|
|
|
|
|
export interface MoveProps {
|
|
|
|
dispatch: Function;
|
|
|
|
bot: BotState;
|
|
|
|
arduinoBusy: boolean;
|
|
|
|
firmwareSettings: McuParams;
|
|
|
|
getWebAppConfigVal: GetWebAppConfigValue;
|
2019-12-27 11:37:54 -07:00
|
|
|
env: UserEnv;
|
2020-02-07 16:06:40 -07:00
|
|
|
firmwareHardware: FirmwareHardware | undefined;
|
2018-07-31 18:48:43 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface DirectionButtonProps {
|
|
|
|
axis: Xyz;
|
|
|
|
direction: "up" | "down" | "left" | "right";
|
|
|
|
directionAxisProps: {
|
|
|
|
isInverted: boolean;
|
|
|
|
stopAtHome: boolean;
|
|
|
|
stopAtMax: boolean;
|
|
|
|
axisLength: number;
|
|
|
|
negativeOnly: boolean;
|
|
|
|
position: number | undefined;
|
|
|
|
}
|
|
|
|
steps: number;
|
|
|
|
disabled: boolean | undefined;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface StepSizeSelectorProps {
|
|
|
|
choices: number[];
|
|
|
|
selected: number;
|
|
|
|
selector: (num: number) => void;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface DirectionAxesProps {
|
|
|
|
axisInversion: Record<Xyz, boolean>;
|
|
|
|
botPosition: BotPosition;
|
|
|
|
firmwareSettings: McuParams;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface JogMovementControlsBaseProps extends DirectionAxesProps {
|
|
|
|
stepSize: number;
|
|
|
|
arduinoBusy: boolean;
|
|
|
|
xySwap: boolean;
|
2019-12-27 11:37:54 -07:00
|
|
|
env: UserEnv;
|
2018-07-31 18:48:43 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface JogMovementControlsProps extends JogMovementControlsBaseProps {
|
|
|
|
doFindHome: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ControlsPopupProps extends JogMovementControlsBaseProps {
|
|
|
|
dispatch: Function;
|
2019-04-09 19:15:50 -06:00
|
|
|
botOnline: boolean;
|
2018-07-31 18:48:43 -06:00
|
|
|
}
|