From 61ef7fc3ea14076c2f85113bd3532a3072959063 Mon Sep 17 00:00:00 2001 From: kdeterme Date: Tue, 22 Sep 2026 21:59:05 +0200 Subject: [PATCH] fix(trafficlights): correct cyclopieton 'bF' detection and preserve STIB detectors by default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Recognize combined 'bF' phases as cyclo-piétons with appropriate 2V200 cyclo-piéto model - Improve lantern match scoring to pair LANxx_bF with existing LANxx lanterns on multi-lantern poles - Normalize lantern model matching between Excel deduction and DB names - Propose 'keep' by default for STIB tram detector loops ('dT') absent from the cross plan - Add unit tests for cyclo-piéton deduction, lantern matching and STIB detector preservation --- .../trafficlights_import_cross_plan.html | 14 +- loko/assets/tests.py | 160 +++++++++++++++++- loko/assets/utils/cross_plan_parser.py | 74 ++++++-- loko/assets/views/trafficlights.py | 87 +++++++++- 4 files changed, 311 insertions(+), 24 deletions(-) diff --git a/loko/assets/templates/assets/trafficlights_import_cross_plan.html b/loko/assets/templates/assets/trafficlights_import_cross_plan.html index f9cda57..99021ae 100644 --- a/loko/assets/templates/assets/trafficlights_import_cross_plan.html +++ b/loko/assets/templates/assets/trafficlights_import_cross_plan.html @@ -503,11 +503,11 @@ {% for item in detectors %} - + {{ item.code }} - + {{ item.pole_code|default:"—" }} @@ -518,7 +518,11 @@ {% elif item.status == 'identical' %} {% translate "Identique" %} {% elif item.status == 'db_only' %} - {% translate "DB uniquement" %} + {% if item.action_default == 'keep' %} + {% translate "DB uniquement" %} + {% else %} + {% translate "DB uniquement" %} + {% endif %} {% endif %} {% for diff in item.details_diff %}
@@ -531,8 +535,8 @@ {% if item.status == 'db_only' %} {% else %}