{% import "partials/fields.html" as f %} {% import "partials/lanelet_search.html" as ls %} {% import "partials/icons.html" as ic %} {% import "partials/vertex_conditions.html" as gates %} {# The inspector renders whatever object the canvas selected. Every section below is built from registry metadata, so a newly registered action, condition, constraint or binding is editable here without touching this template. #}
Inspector
{{ selected }}
{{ ic.icon('target', 15) }}
{% if selected_kind == 'scenario' %} {% include "partials/inspector_scenario.html" %} {% elif selected_kind == 'environment' %} {% include "partials/inspector_environment.html" %} {% elif selected_kind == 'entity' %} {% include "partials/inspector_entity.html" %} {% elif selected_kind == 'action' %} {% set spec = get_action_spec(target.type) %}

{{ spec.category if spec else 'Action' }}

{{ spec.title if spec else target.type }}

{% if spec and spec.description %}

{{ spec.description }}

{% endif %}
{# No actor to choose for an environment action: nothing performs it, and offering the field would let the card be filed under a vehicle that has nothing to do with it. #} {% if spec and spec.scope == 'environment' %}

{{ ic.icon('globe', 13) }} The environment, not a vehicle

{% else %}
{% endif %} {% if spec %}{{ f.fields(spec.fields, target.params, document, '', draft) }}{% endif %} {# Options come from the registry, so a phase cannot exist in the IR and be missing from the only control that sets it. #}

{{ phase_help.get(target.phase, '') }}

{# Every lanelet this action names, each with its map and the choice between a pinned lanelet and a constraint search. Outside the form above: the search is made of forms, and a form cannot nest. #} {% if spec %}{{ ls.modals(spec.fields, target.params, draft, document, target.id, selected) }}{% endif %} {# Outside the form for the same reason: each waypoint condition is edited with forms of its own. Offered only where the spec says the action follows vertices. #} {% if spec and spec.vertex_conditions %} {{ gates.section(target, draft, selected, document) }} {% endif %} {% elif selected_kind == 'condition' %} {% set spec = get_condition_spec(target.type) %} {# A waypoint condition lives in an action's inspector rather than on the canvas, so it says whose it is and leads back there. #} {% set gate_owner = document.vertex_condition_of(target.id) %} {% if gate_owner %}

Waypoint condition: holds the entity of {{ gate_owner[0].title or gate_owner[0].type }} at vertex {{ gate_owner[1].vertex }} until it holds.

{% endif %}

{{ spec.category if spec else 'Predicate' }}

{{ spec.title if spec else target.type }}

{% if spec and spec.description %}

{{ spec.description }}

{% endif %} {% if spec and spec.fields %} {{ f.fields(spec.fields, target.params, document, '', draft) }} {% elif spec %}

This condition has no parameters.

{% endif %}
{% if spec %}{{ ls.modals(spec.fields, target.params, draft, document, target.id, selected) }}{% endif %} {% if spec and spec.accepts_children %}

{{ spec.min_children }} child condition(s) required, {{ 'unlimited' if spec.max_children is none else spec.max_children }} allowed. Add them on the canvas.

{% endif %} {% elif selected_kind == 'constraint' %} {% set spec = get_constraint_spec(target.type) %}

{{ spec.category if spec else 'Constraint' }}

{{ spec.title if spec else target.type }}

{% if spec and spec.description %}

{{ spec.description }}

{% endif %} {% if spec and spec.fields %} {{ f.fields(spec.fields, target.params, document, '', draft) }} {% else %}

This constraint has no parameters.

{% endif %}
{% endif %}