2017-06-29 12:54:02 -06:00
|
|
|
import { BotStateTree } from "farmbot";
|
|
|
|
import {
|
|
|
|
McuParamName,
|
|
|
|
ConfigurationName,
|
|
|
|
Dictionary,
|
|
|
|
SyncStatus,
|
2017-08-04 14:42:29 -06:00
|
|
|
FarmwareManifest,
|
|
|
|
LocationName
|
2017-06-29 12:54:02 -06:00
|
|
|
} from "farmbot";
|
|
|
|
import { AuthState } from "../auth/interfaces";
|
|
|
|
import {
|
|
|
|
TaggedImage,
|
|
|
|
TaggedPeripheral,
|
|
|
|
TaggedDevice
|
|
|
|
} from "../resources/tagged_resources";
|
|
|
|
import { RestResources } from "../resources/interfaces";
|
|
|
|
import { TaggedUser } from "../resources/tagged_resources";
|
2017-07-28 15:24:21 -06:00
|
|
|
import { WD_ENV } from "../farmware/weed_detector/remote_env/interfaces";
|
2017-08-27 18:42:07 -06:00
|
|
|
import { EncoderDisplay } from "../controls/interfaces";
|
2017-06-29 12:54:02 -06:00
|
|
|
|
|
|
|
export interface Props {
|
|
|
|
auth: AuthState | undefined;
|
|
|
|
bot: BotState;
|
|
|
|
deviceAccount: TaggedDevice;
|
|
|
|
images: TaggedImage[];
|
|
|
|
dispatch: Function;
|
|
|
|
}
|
|
|
|
|
|
|
|
/** How the device is stored in the API side.
|
|
|
|
* This is what comes back from the API as JSON.
|
|
|
|
*/
|
|
|
|
export interface DeviceAccountSettings {
|
|
|
|
id: number;
|
|
|
|
name: string;
|
|
|
|
timezone?: string | undefined;
|
2017-08-07 08:35:08 -06:00
|
|
|
last_seen?: string | undefined;
|
2017-06-29 12:54:02 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface BotState {
|
2017-08-08 10:34:06 -06:00
|
|
|
connectedToMQTT: boolean;
|
2017-06-29 12:54:02 -06:00
|
|
|
/** How many steps to move when the user presses a manual movement arrow */
|
|
|
|
stepSize: number;
|
|
|
|
/** The current os version on the github release api */
|
|
|
|
currentOSVersion?: string;
|
|
|
|
/** The current fw version on the github release api */
|
|
|
|
currentFWVersion?: string;
|
|
|
|
/** Is the bot in sync with the api */
|
|
|
|
dirty: boolean;
|
|
|
|
/** The state of the bot, as reported by the bot over MQTT. */
|
|
|
|
hardware: HardwareState;
|
|
|
|
/** Hardware settings auto update on blur. Tells the UI if it should load a
|
|
|
|
* spinner or not. */
|
|
|
|
isUpdating?: boolean;
|
|
|
|
controlPanelState: ControlPanelState;
|
|
|
|
/** The inversions for the jog buttons on the controls page. */
|
2017-08-27 18:42:07 -06:00
|
|
|
axis_inversion: Record<Xyz, boolean>;
|
2017-08-02 15:59:18 -06:00
|
|
|
/** The display setting for encoder data on the controls page. */
|
2017-08-27 18:42:07 -06:00
|
|
|
encoder_visibility: Record<EncoderDisplay, boolean>;
|
2017-06-29 12:54:02 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface BotProp {
|
|
|
|
bot: BotState;
|
|
|
|
}
|
|
|
|
|
|
|
|
/** Status registers for the bot's status */
|
|
|
|
export type HardwareState = BotStateTree;
|
|
|
|
|
|
|
|
export interface GithubRelease {
|
|
|
|
tag_name: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface MoveRelProps {
|
|
|
|
x: number;
|
|
|
|
y: number;
|
|
|
|
z: number;
|
|
|
|
speed?: number | undefined;
|
|
|
|
}
|
|
|
|
|
|
|
|
export type Xyz = "x" | "y" | "z";
|
|
|
|
export type Axis = Xyz | "all";
|
|
|
|
|
2017-08-02 17:59:34 -06:00
|
|
|
export type BotPosition = Record<Xyz, (number | undefined)>;
|
2017-08-04 14:42:29 -06:00
|
|
|
export type BotLocationData = Record<LocationName, BotPosition> | undefined;
|
2017-08-02 17:59:34 -06:00
|
|
|
|
2017-06-29 12:54:02 -06:00
|
|
|
export interface CalibrationButtonProps {
|
|
|
|
disabled: boolean;
|
|
|
|
axis: Axis;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface FarmbotOsProps {
|
|
|
|
bot: BotState;
|
|
|
|
account: TaggedDevice;
|
|
|
|
auth: AuthState;
|
|
|
|
dispatch: Function;
|
|
|
|
}
|
|
|
|
|
2017-08-24 17:55:35 -06:00
|
|
|
export interface CameraSelectionProps {
|
|
|
|
env: Dictionary<string | undefined>
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface CameraSelectionState {
|
2017-06-29 12:54:02 -06:00
|
|
|
cameraStatus: "" | "sending" | "done" | "error";
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface StepsPerMMBoxProps {
|
|
|
|
bot: BotState;
|
|
|
|
setting: ConfigurationName;
|
|
|
|
dispatch: Function;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface McuInputBoxProps {
|
|
|
|
bot: BotState;
|
|
|
|
setting: McuParamName;
|
|
|
|
dispatch: Function;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface EStopButtonProps {
|
|
|
|
bot: BotState;
|
|
|
|
user: TaggedUser | undefined;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface PeripheralsProps {
|
|
|
|
resources: RestResources;
|
|
|
|
bot: BotState;
|
|
|
|
peripherals: TaggedPeripheral[];
|
|
|
|
dispatch: Function;
|
2017-08-11 19:56:02 -06:00
|
|
|
disabled: boolean | undefined;
|
2017-06-29 12:54:02 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface FarmwareProps {
|
|
|
|
dispatch: Function;
|
|
|
|
env: Partial<WD_ENV>;
|
|
|
|
images: TaggedImage[];
|
|
|
|
currentImage: TaggedImage | undefined;
|
|
|
|
syncStatus: SyncStatus;
|
|
|
|
farmwares: Dictionary<FarmwareManifest | undefined>;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface HardwareSettingsProps {
|
|
|
|
controlPanelState: ControlPanelState;
|
|
|
|
dispatch: Function;
|
|
|
|
bot: BotState;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ControlPanelState {
|
|
|
|
homing_and_calibration: boolean;
|
|
|
|
motors: boolean;
|
|
|
|
encoders_and_endstops: boolean;
|
|
|
|
danger_zone: boolean;
|
|
|
|
}
|