Remove redundant shift speed section

This commit is contained in:
admin committed 2026-10-20 16:15:19 +02:00
1 parent f6ebd78a4a
commit 71eae0600d
6 files changed
+10 -19

No files matched your search

+3 -2
View File
@@ -277,8 +277,9 @@ Speed always uses the approximate FA windows.
The shift report's production table uses these same FA windows and KPI results The shift report's production table uses these same FA windows and KPI results
for each listed order. Its speed describes the FA's estimated period; material for each listed order. Its speed describes the FA's estimated period; material
uses the configured segment or order-aware source rule. The shift-wide speed and uses the configured segment or order-aware source rule. The shift-wide material
material sections remain useful reconciliation totals. In HTML, the FA number section remains available as a reconciliation total; the shift-wide speed
summary stays in the report model but is not rendered. In HTML, the FA number
links directly to `/order?production_order=...` for the order's full shift list. links directly to `/order?production_order=...` for the order's full shift list.
The PDF prints the FA number as text. The PDF prints the FA number as text.
@@ -201,17 +201,6 @@ def present_report(
story.append( story.append(
MaterialPieBlock(labels, tuple(quantity for _, _, quantity in positive_materials)) MaterialPieBlock(labels, tuple(quantity for _, _, quantity in positive_materials))
) )
text("Liniengeschwindigkeit", "Heading2")
if report.speed is None:
text("Für diese Maschine nicht verfügbar.")
else:
speed = report.speed.average_line_speed_m_min
text(
"Durchschnittliche Liniengeschwindigkeit im Lauf: "
+ (f"{_number(speed)} m/min" if speed is not None
else "Nicht verfügbar (keine Laufdaten).")
)
return tuple(story) return tuple(story)
+1 -1
View File
@@ -260,7 +260,7 @@ def test_partial_capabilities_skip_disabled_sources_and_render_unavailable(
blocks = present_report(report) blocks = present_report(report)
unavailable = [b for b in blocks if isinstance(b, TextBlock) unavailable = [b for b in blocks if isinstance(b, TextBlock)
and b.text == "Für diese Maschine nicht verfügbar."] and b.text == "Für diese Maschine nicht verfügbar."]
assert len(unavailable) == (2 if downtime else 3) assert len(unavailable) == (1 if downtime else 2)
def test_downtime_only_machine_does_not_query_production(): def test_downtime_only_machine_does_not_query_production():
+2
View File
@@ -44,6 +44,8 @@ def test_production_rows_show_attributed_kpis_and_link_fa_to_detail():
assert '<td>10,24 m/min</td>' in html assert '<td>10,24 m/min</td>' in html
assert '<td>3.317,58 kg</td>' in html assert '<td>3.317,58 kg</td>' in html
assert '<th scope="col">Details</th>' not in html assert '<th scope="col">Details</th>' not in html
assert "Durchschnittliche Liniengeschwindigkeit im Lauf" not in html
assert "<h2>Liniengeschwindigkeit</h2>" not in html
def test_production_kpis_distinguish_unavailable_from_zero(): def test_production_kpis_distinguish_unavailable_from_zero():
+3 -4
View File
@@ -48,15 +48,14 @@ def test_stable_model_required_labels_and_supplied_quantities():
"Zeit ohne erfassten Stillstand", "Zeit ohne erfassten Stillstand",
"Materialverbrauch", "Materialverbrauch",
"42,00 kg", "42,00 kg",
"Liniengeschwindigkeit im Lauf",
"order", "order",
"article", "article",
"description", "description",
): ):
assert label in text assert label in text
assert "Produktionszeit" not in text assert "Produktionszeit" not in text
value = replace(value, speed=replace(value.speed, average_line_speed_m_min=12.345)) assert "Liniengeschwindigkeit im Lauf" not in text
assert "12,35 m/min" in content(value) assert "Durchschnittliche Liniengeschwindigkeit" not in text
def test_production_pdf_table_contains_attributed_kpis_as_plain_text(): def test_production_pdf_table_contains_attributed_kpis_as_plain_text():
@@ -72,6 +71,7 @@ def test_production_pdf_table_contains_attributed_kpis_as_plain_text():
assert table.rows[1][-2:] == ("—", "0,00 kg") assert table.rows[1][-2:] == ("—", "0,00 kg")
assert table.rows[0][0] == "12026001032" assert table.rows[0][0] == "12026001032"
assert "Materialverbrauch gesamt: 42,00 kg" in content(value) assert "Materialverbrauch gesamt: 42,00 kg" in content(value)
assert "Liniengeschwindigkeit im Lauf" not in content(value)
assert render_pdf(value).startswith(b"%PDF-") assert render_pdf(value).startswith(b"%PDF-")
@@ -110,7 +110,6 @@ def test_empty_sections_and_zero_totals():
"Keine Stillstandsgründe vorhanden.", "Keine Stillstandsgründe vorhanden.",
"Keine Stillstandsereignisse vorhanden.", "Keine Stillstandsereignisse vorhanden.",
"Keine Materialverbrauchsdaten vorhanden.", "Keine Materialverbrauchsdaten vorhanden.",
"keine Laufdaten",
"Gesamtmenge: 0,00 m²", "Gesamtmenge: 0,00 m²",
"Rollen gesamt: 0", "Rollen gesamt: 0",
): ):
+1 -1
View File
@@ -111,12 +111,12 @@ def test_default_and_render(application):
"42,00 kg", "42,00 kg",
"description", "description",
"Ohne Stillstandsgrund", "Ohne Stillstandsgrund",
"Nicht verfügbar",
"Datenstand: 14.10.2026 15:46:00 CEST", "Datenstand: 14.10.2026 15:46:00 CEST",
"Europe/Berlin", "Europe/Berlin",
"Als PDF exportieren", "Als PDF exportieren",
): ):
assert expected in text assert expected in text
assert "Durchschnittliche Liniengeschwindigkeit im Lauf" not in text
assert headers["Cache-Control"] == "no-store" assert headers["Cache-Control"] == "no-store"