version: 1

templates:
  builtin.manual-tc:
    hal:
      pins:
        change:
          direction: in
          type: bit
          trigger: rising

        number:
          direction: in
          type: s32
          variable: tool_number

        changed:
          direction: out
          type: bit
          on_action:
            continue: true

    title:
      en: Manual tool change
      pl: Ręczna zmiana narzędzia

    message:
      en: >-
        {% if tool_number == 0 %}
        Remove the installed tool
        {% else %}
        Install tool T{{ tool_number }}{% if not is_lathe and tools[tool_number].diameter != 0 %}
        (⌀{{ tools[tool_number].diameter | linear }}){% endif %}{% if tools[tool_number].comment != '' %}
        “{{ tools[tool_number].comment }}”{% endif %}
        {% endif %}
      pl: >-
        {% if tool_number == 0 %}
        Wyjmij zamontowane narzędzie
        {% else %}
        Załóż narzędzie T{{ tool_number }}{% if not is_lathe and tools[tool_number].diameter != 0 %}
        (⌀{{ tools[tool_number].diameter | linear }}){% endif %}{% if tools[tool_number].comment != '' %}
        „{{ tools[tool_number].comment }}”{% endif %}
        {% endif %}

    severity: warning

    details: []

    actions:
      - id: continue
        label: {en: Continue, pl: Kontynuuj}
        intent: primary

    allow_abort: true

  builtin.manual-gear-change:
    hal:
      pins:
        change:
          direction: in
          type: bit
          trigger: rising

        gear:
          direction: in
          type: s32
          variable: gear

        changed:
          direction: out
          type: bit
          on_action:
            continue: true

    title:
      en: Manual gearbox change
      pl: Ręczna zmiana biegu

    message:
      en: Shift the spindle gearbox to gear {{ gear }}
      pl: Przełącz przekładnię wrzeciona na bieg {{ gear }}

    severity: warning
    details: []

    actions:
      - id: continue
        label: {en: Continue, pl: Kontynuuj}
        intent: primary

    allow_abort: true
