Steps_per_me_settings.tsx
parent
4ff67932ab
commit
ef901426c7
|
@ -6,55 +6,13 @@ import { SpacePanelToolTip } from "../space_panel_tool_tip";
|
|||
import { ToggleButton } from "../../../controls/toggle_button";
|
||||
import { settingToggle } from "../../actions";
|
||||
import { NumericMCUInputGroup } from "../numeric_mcu_input_group";
|
||||
import { BotConfigInputBox } from "../bot_config_input_box";
|
||||
import { MotorsProps } from "../interfaces";
|
||||
import { Row, Col } from "../../../ui/index";
|
||||
import { Header } from "./header";
|
||||
import { Collapse } from "@blueprintjs/core";
|
||||
import { McuInputBox } from "../mcu_input_box";
|
||||
import { minFwVersionCheck } from "../../../util";
|
||||
|
||||
export function StepsPerMmSettings(props: MotorsProps) {
|
||||
const { dispatch, bot, sourceFbosConfig } = props;
|
||||
const { firmware_version } = bot.hardware.informational_settings;
|
||||
if (minFwVersionCheck(firmware_version, "5.0.5")) {
|
||||
return <NumericMCUInputGroup
|
||||
name={t("Steps per MM")}
|
||||
tooltip={ToolTips.STEPS_PER_MM}
|
||||
x={"movement_step_per_mm_x"}
|
||||
y={"movement_step_per_mm_y"}
|
||||
z={"movement_step_per_mm_z"}
|
||||
bot={bot}
|
||||
dispatch={dispatch} />;
|
||||
} else {
|
||||
return <Row>
|
||||
<Col xs={6}>
|
||||
<label>
|
||||
{t("Steps per MM")}
|
||||
</label>
|
||||
<SpacePanelToolTip tooltip={ToolTips.STEPS_PER_MM} />
|
||||
</Col>
|
||||
<Col xs={2}>
|
||||
<BotConfigInputBox
|
||||
setting="steps_per_mm_x"
|
||||
sourceFbosConfig={sourceFbosConfig}
|
||||
dispatch={dispatch} />
|
||||
</Col>
|
||||
<Col xs={2}>
|
||||
<BotConfigInputBox
|
||||
setting="steps_per_mm_y"
|
||||
sourceFbosConfig={sourceFbosConfig}
|
||||
dispatch={dispatch} />
|
||||
</Col>
|
||||
<Col xs={2}>
|
||||
<BotConfigInputBox
|
||||
setting="steps_per_mm_z"
|
||||
sourceFbosConfig={sourceFbosConfig}
|
||||
dispatch={dispatch} />
|
||||
</Col>
|
||||
</Row>;
|
||||
}
|
||||
}
|
||||
import { StepsPerMmSettings } from "./steps_per_mm_settings";
|
||||
|
||||
export function Motors(props: MotorsProps) {
|
||||
const { dispatch, bot, sourceFbosConfig } = props;
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
import { BotConfigInputBox } from "../bot_config_input_box";
|
||||
import { MotorsProps } from "../interfaces";
|
||||
import { minFwVersionCheck } from "../../../util";
|
||||
|
||||
export function StepsPerMmSettings(props: MotorsProps) {
|
||||
const { dispatch, bot, sourceFbosConfig } = props;
|
||||
const { firmware_version } = bot.hardware.informational_settings;
|
||||
if (minFwVersionCheck(firmware_version, "5.0.5")) {
|
||||
return <NumericMCUInputGroup
|
||||
name={t("Steps per MM")}
|
||||
tooltip={ToolTips.STEPS_PER_MM}
|
||||
x={"movement_step_per_mm_x"}
|
||||
y={"movement_step_per_mm_y"}
|
||||
z={"movement_step_per_mm_z"}
|
||||
bot={bot}
|
||||
dispatch={dispatch} />;
|
||||
} else {
|
||||
return <Row>
|
||||
<Col xs={6}>
|
||||
<label>
|
||||
{t("Steps per MM")}
|
||||
</label>
|
||||
<SpacePanelToolTip tooltip={ToolTips.STEPS_PER_MM} />
|
||||
</Col>
|
||||
<Col xs={2}>
|
||||
<BotConfigInputBox
|
||||
setting="steps_per_mm_x"
|
||||
sourceFbosConfig={sourceFbosConfig}
|
||||
dispatch={dispatch} />
|
||||
</Col>
|
||||
<Col xs={2}>
|
||||
<BotConfigInputBox
|
||||
setting="steps_per_mm_y"
|
||||
sourceFbosConfig={sourceFbosConfig}
|
||||
dispatch={dispatch} />
|
||||
</Col>
|
||||
<Col xs={2}>
|
||||
<BotConfigInputBox
|
||||
setting="steps_per_mm_z"
|
||||
sourceFbosConfig={sourceFbosConfig}
|
||||
dispatch={dispatch} />
|
||||
</Col>
|
||||
</Row>;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue