{% import "partials/fields.html" as f %} {% import "partials/constraint_node.html" as cons %} {# Choosing which lanelet a field names, beside the map it is chosen on. Every lanelet in a document is chosen the same way -- a spawn, the ego's goal, the lanelet a condition watches -- so the panel that asks is one macro rather than one per site. It used to be written out inside the entity inspector, and for as long as it was, the spawn was the only lanelet that could be searched for at all. It lives beside the map because a constraint is a statement *about* the map: "the lane left of a junction, at least 30 m long" is written by looking at one, and the matches are outlined on the same drawing as they are counted. #} {# The whole answer to "which lanelet is this", as the picker's side panel. `slot` is a LaneletSlot: the address of one lanelet-valued field, whatever holds it. `selected` is the inspector's current object, carried through so a constraint's own inspector form knows what to go back to. #} {% macro chooser(slot, draft, document, selected) %} {%- set group = 'lanelet_mode_' ~ slot.key|replace('.', '_') -%}
Worked out from the lanelet the search picks, case by case: the lane beside it, the lanelet after it, the pick itself. The pinned ID stays as the default a non-swept run uses.
{% elif not slot.searching %}Click a lanelet to pin it. A constraint search hands the choice to the lanelet-constraint sweeper instead, which runs the scenario once per matching lanelet.
{% else %}The sweeper runs the scenario once per matching lanelet; the pinned ID stays as the default a non-swept run uses.
No constraints yet: every lanelet matches.
{% endfor %} {{ cons.add_constraint(draft, slot) }}Loading…