How to use the farmbot/dist/resources/api_resources.ToolPulloutDirection.NEGATIVE_X 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 / frontend / tools / components / toolbay_slot_direction_selection.tsx View on Github external
[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) => {
    const { value } = selectedDirection;
    dispatch(edit(slot, {
github FarmBot / Farmbot-Web-App / webpack / farm_designer / map / layers / tool_slots / tool_graphics.tsx View on Github external
const rawAngle = () => {
    const direction = pulloutDirection + (xySwap ? 2 : 0);
    switch (direction > 4 ? direction % 4 : direction) {
      case ToolPulloutDirection.POSITIVE_X: return 0;
      case ToolPulloutDirection.NEGATIVE_X: return 180;
      case ToolPulloutDirection.NEGATIVE_Y: return 90;
      case ToolPulloutDirection.POSITIVE_Y: return 270;
      default: return 0;
    }
  };
  const adjustAngle = (angle: number) => {
github FarmBot / Farmbot-Web-App / frontend / farm_designer / map / layers / tool_slots / tool_graphics.tsx View on Github external
const rawAngle = () => {
    const direction = pulloutDirection + (xySwap ? 2 : 0);
    switch (direction > 4 ? direction % 4 : direction) {
      case ToolPulloutDirection.POSITIVE_X: return 0;
      case ToolPulloutDirection.NEGATIVE_X: return 180;
      case ToolPulloutDirection.NEGATIVE_Y: return 90;
      case ToolPulloutDirection.POSITIVE_Y: return 270;
      default: return 0;
    }
  };
  const adjustAngle = (angle: number) => {
github FarmBot / Farmbot-Web-App / webpack / farm_designer / map / layers / tool_slots / tool_label.tsx View on Github external
const rawAnchor = () => {
    const direction = pulloutDirection + (xySwap ? 2 : 0);
    switch (direction > 4 ? direction % 4 : direction) {
      case ToolPulloutDirection.POSITIVE_X: return Anchor.start;
      case ToolPulloutDirection.NEGATIVE_X: return Anchor.end;
      case ToolPulloutDirection.NEGATIVE_Y: return Anchor.middleTop;
      case ToolPulloutDirection.POSITIVE_Y: return Anchor.middleBottom;
      default: return Anchor.start;
    }
  };
  const adjustAnchor = (anchor: Anchor) => {
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],
];

export interface SlotDirectionSelectProps {
  dispatch: Function;
github FarmBot / Farmbot-Web-App / frontend / tools / components / toolbay_slot_menu.tsx View on Github external
const directionIconClass = (slotDirection: ToolPulloutDirection) => {
  switch (slotDirection) {
    case ToolPulloutDirection.POSITIVE_X: return "fa fa-arrow-circle-right";
    case ToolPulloutDirection.NEGATIVE_X: return "fa fa-arrow-circle-left";
    case ToolPulloutDirection.POSITIVE_Y: return "fa fa-arrow-circle-up";
    case ToolPulloutDirection.NEGATIVE_Y: return "fa fa-arrow-circle-down";
    case ToolPulloutDirection.NONE: return "fa fa-dot-circle-o";
  }
};
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],
];

export interface SlotDirectionSelectProps {
  dispatch: Function;
github FarmBot / Farmbot-Web-App / webpack / tools / components / toolbay_slot_menu.tsx View on Github external
const directionIconClass = (slotDirection: ToolPulloutDirection) => {
  switch (slotDirection) {
    case ToolPulloutDirection.POSITIVE_X: return "fa fa-arrow-circle-right";
    case ToolPulloutDirection.NEGATIVE_X: return "fa fa-arrow-circle-left";
    case ToolPulloutDirection.POSITIVE_Y: return "fa fa-arrow-circle-up";
    case ToolPulloutDirection.NEGATIVE_Y: return "fa fa-arrow-circle-down";
    case ToolPulloutDirection.NONE: return "fa fa-dot-circle-o";
  }
};
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],
];

export interface SlotDirectionSelectProps {