How to use the farmbot/dist/resources/api_resources.ToolPulloutDirection.NONE function in farmbot

To help you get started, we’ve selected a few farmbot examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github FarmBot / Farmbot-Web-App / webpack / tools / components / toolbay_slot_menu.tsx View on Github external
(old: ToolPulloutDirection | undefined): ToolPulloutDirection =>
        isNumber(old) && old < 4 ? old + 1 : ToolPulloutDirection.NONE;
    dispatch(edit(slot,
github FarmBot / Farmbot-Web-App / frontend / tools / components / toolbay_slot_menu.tsx View on Github external
(old: ToolPulloutDirection | undefined): ToolPulloutDirection =>
        isNumber(old) && old < 4 ? old + 1 : ToolPulloutDirection.NONE;
    dispatch(edit(slot,
github FarmBot / Farmbot-Web-App / webpack / tools / components / toolbay_slot_direction_selection.tsx View on Github external
import * as React from "react";
import { t } from "i18next";
import { FBSelect, DropDownItem } from "../../ui";
import { TaggedToolSlotPointer } from "farmbot";
import { edit } from "../../api/crud";
import { isNumber } from "lodash";
import { ToolPulloutDirection } from "farmbot/dist/resources/api_resources";

const DIRECTION_CHOICES_DDI: { [index: number]: DropDownItem } = {
  [ToolPulloutDirection.NONE]:
    { label: t("None"), value: ToolPulloutDirection.NONE },
  [ToolPulloutDirection.POSITIVE_X]:
    { label: t("Positive X"), value: ToolPulloutDirection.POSITIVE_X },
  [ToolPulloutDirection.NEGATIVE_X]:
    { label: t("Negative X"), value: ToolPulloutDirection.NEGATIVE_X },
  [ToolPulloutDirection.POSITIVE_Y]:
    { label: t("Positive Y"), value: ToolPulloutDirection.POSITIVE_Y },
  [ToolPulloutDirection.NEGATIVE_Y]:
    { label: t("Negative Y"), value: ToolPulloutDirection.NEGATIVE_Y },
};

const DIRECTION_CHOICES: DropDownItem[] = [
  DIRECTION_CHOICES_DDI[ToolPulloutDirection.NONE],
  DIRECTION_CHOICES_DDI[ToolPulloutDirection.POSITIVE_X],
  DIRECTION_CHOICES_DDI[ToolPulloutDirection.NEGATIVE_X],
  DIRECTION_CHOICES_DDI[ToolPulloutDirection.POSITIVE_Y],
  DIRECTION_CHOICES_DDI[ToolPulloutDirection.NEGATIVE_Y],
github FarmBot / Farmbot-Web-App / frontend / tools / components / toolbay_slot_direction_selection.tsx View on Github external
const DIRECTION_CHOICES_DDI: { [index: number]: DropDownItem } = {
  [ToolPulloutDirection.NONE]:
    { label: t("None"), value: ToolPulloutDirection.NONE },
  [ToolPulloutDirection.POSITIVE_X]:
    { label: t("Positive X"), value: ToolPulloutDirection.POSITIVE_X },
  [ToolPulloutDirection.NEGATIVE_X]:
    { label: t("Negative X"), value: ToolPulloutDirection.NEGATIVE_X },
  [ToolPulloutDirection.POSITIVE_Y]:
    { label: t("Positive Y"), value: ToolPulloutDirection.POSITIVE_Y },
  [ToolPulloutDirection.NEGATIVE_Y]:
    { label: t("Negative Y"), value: ToolPulloutDirection.NEGATIVE_Y },
};

const DIRECTION_CHOICES: DropDownItem[] = [
  DIRECTION_CHOICES_DDI[ToolPulloutDirection.NONE],
  DIRECTION_CHOICES_DDI[ToolPulloutDirection.POSITIVE_X],
  DIRECTION_CHOICES_DDI[ToolPulloutDirection.NEGATIVE_X],
  DIRECTION_CHOICES_DDI[ToolPulloutDirection.POSITIVE_Y],
  DIRECTION_CHOICES_DDI[ToolPulloutDirection.NEGATIVE_Y],
];

export interface SlotDirectionSelectProps {
  dispatch: Function;
  slot: TaggedToolSlotPointer;
}

export function SlotDirectionSelect(props: SlotDirectionSelectProps) {
  const { dispatch, slot } = props;
  const direction = slot.body.pullout_direction;

  const changePulloutDirection = (selectedDirection: DropDownItem) => {
github FarmBot / Farmbot-Web-App / frontend / tools / components / toolbay_slot_direction_selection.tsx View on Github external
import * as React from "react";
import { FBSelect, DropDownItem } from "../../ui";
import { TaggedToolSlotPointer } from "farmbot";
import { edit } from "../../api/crud";
import { isNumber } from "lodash";
import { ToolPulloutDirection } from "farmbot/dist/resources/api_resources";
import { t } from "../../i18next_wrapper";

const DIRECTION_CHOICES_DDI: { [index: number]: DropDownItem } = {
  [ToolPulloutDirection.NONE]:
    { label: t("None"), value: ToolPulloutDirection.NONE },
  [ToolPulloutDirection.POSITIVE_X]:
    { label: t("Positive X"), value: ToolPulloutDirection.POSITIVE_X },
  [ToolPulloutDirection.NEGATIVE_X]:
    { label: t("Negative X"), value: ToolPulloutDirection.NEGATIVE_X },
  [ToolPulloutDirection.POSITIVE_Y]:
    { label: t("Positive Y"), value: ToolPulloutDirection.POSITIVE_Y },
  [ToolPulloutDirection.NEGATIVE_Y]:
    { label: t("Negative Y"), value: ToolPulloutDirection.NEGATIVE_Y },
};

const DIRECTION_CHOICES: DropDownItem[] = [
  DIRECTION_CHOICES_DDI[ToolPulloutDirection.NONE],
  DIRECTION_CHOICES_DDI[ToolPulloutDirection.POSITIVE_X],
  DIRECTION_CHOICES_DDI[ToolPulloutDirection.NEGATIVE_X],
  DIRECTION_CHOICES_DDI[ToolPulloutDirection.POSITIVE_Y],
  DIRECTION_CHOICES_DDI[ToolPulloutDirection.NEGATIVE_Y],
github FarmBot / Farmbot-Web-App / webpack / tools / components / toolbay_slot_direction_selection.tsx View on Github external
const DIRECTION_CHOICES_DDI: { [index: number]: DropDownItem } = {
  [ToolPulloutDirection.NONE]:
    { label: t("None"), value: ToolPulloutDirection.NONE },
  [ToolPulloutDirection.POSITIVE_X]:
    { label: t("Positive X"), value: ToolPulloutDirection.POSITIVE_X },
  [ToolPulloutDirection.NEGATIVE_X]:
    { label: t("Negative X"), value: ToolPulloutDirection.NEGATIVE_X },
  [ToolPulloutDirection.POSITIVE_Y]:
    { label: t("Positive Y"), value: ToolPulloutDirection.POSITIVE_Y },
  [ToolPulloutDirection.NEGATIVE_Y]:
    { label: t("Negative Y"), value: ToolPulloutDirection.NEGATIVE_Y },
};

const DIRECTION_CHOICES: DropDownItem[] = [
  DIRECTION_CHOICES_DDI[ToolPulloutDirection.NONE],
  DIRECTION_CHOICES_DDI[ToolPulloutDirection.POSITIVE_X],
  DIRECTION_CHOICES_DDI[ToolPulloutDirection.NEGATIVE_X],
  DIRECTION_CHOICES_DDI[ToolPulloutDirection.POSITIVE_Y],
  DIRECTION_CHOICES_DDI[ToolPulloutDirection.NEGATIVE_Y],
];

export interface SlotDirectionSelectProps {
  dispatch: Function;
  slot: TaggedToolSlotPointer;
}

export function SlotDirectionSelect(props: SlotDirectionSelectProps) {
  const { dispatch, slot } = props;
  const direction = slot.body.pullout_direction;

  const changePulloutDirection = (selectedDirection: DropDownItem) => {