2017-06-29 12:54:02 -06:00
|
|
|
import * as React from "react";
|
|
|
|
import { t } from "i18next";
|
|
|
|
import { BooleanMCUInputGroup } from "../boolean_mcu_input_group";
|
2017-08-11 17:14:55 -06:00
|
|
|
import { ToolTips } from "../../../constants";
|
2017-06-29 12:54:02 -06:00
|
|
|
import { NumericMCUInputGroup } from "../numeric_mcu_input_group";
|
|
|
|
import { HomingRow } from "../homing_row";
|
|
|
|
import { CalibrationRow } from "../calibration_row";
|
|
|
|
import { ZeroRow } from "../zero_row";
|
|
|
|
import { enabledAxisMap } from "../axis_tracking_status";
|
|
|
|
import { HomingAndCalibrationProps } from "../interfaces";
|
|
|
|
import { Header } from "./header";
|
|
|
|
import { Collapse } from "@blueprintjs/core";
|
|
|
|
|
|
|
|
export function HomingAndCalibration(props: HomingAndCalibrationProps) {
|
|
|
|
|
|
|
|
let { dispatch, bot } = props;
|
|
|
|
let { mcu_params } = bot.hardware;
|
|
|
|
let { homing_and_calibration } = props.bot.controlPanelState;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Tells us if X/Y/Z have a means of checking their position.
|
|
|
|
* FARMBOT WILL CRASH INTO WALLS IF THIS IS WRONG! BE CAREFUL.
|
|
|
|
*/
|
|
|
|
let enabled = enabledAxisMap(mcu_params);
|
|
|
|
|
|
|
|
return <section>
|
|
|
|
<Header
|
|
|
|
title={"Homing and Calibration"}
|
|
|
|
name={"homing_and_calibration"}
|
|
|
|
dispatch={dispatch}
|
2017-08-23 16:26:09 -06:00
|
|
|
bool={homing_and_calibration} />
|
2017-06-29 12:54:02 -06:00
|
|
|
<Collapse isOpen={!!homing_and_calibration}>
|
|
|
|
<HomingRow hardware={mcu_params} />
|
|
|
|
<CalibrationRow hardware={mcu_params} />
|
|
|
|
<ZeroRow />
|
|
|
|
<BooleanMCUInputGroup
|
|
|
|
name={t("Find Home on Boot")}
|
|
|
|
tooltip={t(ToolTips.FIND_HOME_ON_BOOT)}
|
|
|
|
disableX={!enabled.x}
|
|
|
|
disableY={!enabled.y}
|
|
|
|
disableZ={!enabled.z}
|
|
|
|
x={"movement_home_at_boot_x"}
|
|
|
|
y={"movement_home_at_boot_y"}
|
|
|
|
z={"movement_home_at_boot_z"}
|
|
|
|
dispatch={dispatch}
|
|
|
|
bot={bot}
|
2017-08-23 16:26:09 -06:00
|
|
|
caution={true} />
|
2017-06-29 12:54:02 -06:00
|
|
|
<BooleanMCUInputGroup
|
|
|
|
name={t("Stop at Home")}
|
|
|
|
tooltip={t(ToolTips.STOP_AT_HOME)}
|
|
|
|
x={"movement_stop_at_home_x"}
|
|
|
|
y={"movement_stop_at_home_y"}
|
|
|
|
z={"movement_stop_at_home_z"}
|
|
|
|
dispatch={dispatch}
|
2017-08-23 16:26:09 -06:00
|
|
|
bot={bot} />
|
2017-06-29 12:54:02 -06:00
|
|
|
<BooleanMCUInputGroup
|
|
|
|
name={t("Stop at Max")}
|
|
|
|
tooltip={t(ToolTips.STOP_AT_MAX)}
|
|
|
|
x={"movement_stop_at_max_x"}
|
|
|
|
y={"movement_stop_at_max_y"}
|
|
|
|
z={"movement_stop_at_max_z"}
|
|
|
|
dispatch={dispatch}
|
2017-08-23 16:26:09 -06:00
|
|
|
bot={bot} />
|
2017-06-29 12:54:02 -06:00
|
|
|
<BooleanMCUInputGroup
|
|
|
|
name={t("Negative Coordinates Only")}
|
|
|
|
tooltip={t(ToolTips.NEGATIVE_COORDINATES_ONLY)}
|
|
|
|
x={"movement_home_up_x"}
|
|
|
|
y={"movement_home_up_y"}
|
|
|
|
z={"movement_home_up_z"}
|
|
|
|
dispatch={dispatch}
|
2017-08-23 16:26:09 -06:00
|
|
|
bot={bot} />
|
2017-06-29 12:54:02 -06:00
|
|
|
<NumericMCUInputGroup
|
|
|
|
name={t("Axis Length (steps)")}
|
|
|
|
tooltip={t(ToolTips.LENGTH)}
|
|
|
|
x={"movement_axis_nr_steps_x"}
|
|
|
|
y={"movement_axis_nr_steps_y"}
|
|
|
|
z={"movement_axis_nr_steps_z"}
|
|
|
|
bot={bot}
|
2017-08-23 16:26:09 -06:00
|
|
|
dispatch={dispatch} />
|
2017-06-29 12:54:02 -06:00
|
|
|
<NumericMCUInputGroup
|
|
|
|
name={t("Timeout after (seconds)")}
|
|
|
|
tooltip={t(ToolTips.TIMEOUT_AFTER)}
|
|
|
|
x={"movement_timeout_x"}
|
|
|
|
y={"movement_timeout_y"}
|
|
|
|
z={"movement_timeout_z"}
|
|
|
|
bot={bot}
|
2017-08-23 16:26:09 -06:00
|
|
|
dispatch={dispatch} />
|
2017-06-29 12:54:02 -06:00
|
|
|
</Collapse>
|
|
|
|
</section>;
|
|
|
|
}
|