feat: Dauer-, Wiederholungs- und Kombinationspruefung
- Kategorie-Dauer gegen Sollzeit plus Toleranz - Sprungwiederholungen max. 2-mal inkl. Kombinationsbestandteilen - Kombinations-/Folgenanzahl und max. Sprunge pro Kombination - Punktschaetzung mit PCS-Annahme und Sturzabzug - Inline-Panel fuer PCS-Durchschnitt und Stuerze, mit Kuer gespeichert - 67 Adult- und 279 Whiteboard-Assertions (1023 gesamt) - Doku und Roadmap aktualisiert
This commit is contained in:
parent
e4fd74ea6e
commit
ef1a01d5b3
13 changed files with 476 additions and 66 deletions
|
|
@ -140,8 +140,10 @@ liefert `ValidationIssue`-Objekte mit Schweregrad (Fehler/Warnung), Meldung
|
|||
und Abschnitts-/Segmentbezug. `validate_report()` ergänzt eine Prüfstatistik:
|
||||
Element- und Abschnittszahl sowie pro Kategorie, wie viele Fälle geprüft und
|
||||
bestanden wurden. Zusätzlich summiert der Report die Base Values aller
|
||||
Elemente mit gültigem Katalogwert und führt eine Wertungsliste; das ist eine
|
||||
bewusste Schätzung ohne GOE, 1,1-Faktor, Programmkomponenten und Abzüge.
|
||||
Elemente mit gültigem Katalogwert und führt eine Wertungsliste. Bei gewählter
|
||||
Adult-Kategorie ergänzt der Dialog eine grobe Punktschätzung aus Basiswert,
|
||||
PCS-Annahme (Durchschnitt × 3 × Kategorie-Faktor) und Sturzabzug
|
||||
(Stürze × Kategorie-Abzug). GOE bleibt unberücksichtigt.
|
||||
Die Prüfung ist bewusst getrennt von `Routine.validate()`:
|
||||
Das Modell prüft Struktur und Pfade, der Validator prüft fachliche
|
||||
Elementdaten. Die Oberfläche zeigt die Prüfliste und die Befunde in einem
|
||||
|
|
@ -153,9 +155,10 @@ Features pro Fuß.
|
|||
`AdultCategoryRules` liest das IAFSC-Technical-Announcement als eigene
|
||||
JSON-Datei. Die Kategorie liegt als `Routine.adult_category` an der Kür und
|
||||
kann in der Statusleiste gewählt werden. Der Validator prüft Elementanzahl,
|
||||
erlaubte Sprungrotationen, Level-Caps und Pflichtelemente. Das Announcement
|
||||
hat bei Konflikten Vorrang vor den allgemeinen ISU-Regeln; deshalb bleiben
|
||||
Kategorie und Saison getrennte Datenquellen.
|
||||
erlaubte Sprungrotationen, Level-Caps, Pflichtelemente, Dauer, Wiederholungen
|
||||
und Kombinationsgrenzen. Das Announcement hat bei Konflikten Vorrang vor den
|
||||
allgemeinen ISU-Regeln; deshalb bleiben Kategorie und Saison getrennte
|
||||
Datenquellen.
|
||||
|
||||
## 4. View- und Controller-Grenzen
|
||||
|
||||
|
|
@ -387,15 +390,17 @@ Aktueller Stand:
|
|||
Prüfstatistik je Kategorie und die Basiswert-Summe.
|
||||
- **Canvas:** 90 Assertions für Meter→Pixel-Mapping, Fit/Zoom/Pan,
|
||||
Rink-Kontur und die reine Bogen-Geometrie.
|
||||
- **Adult-Kategorien:** 60 Assertions für Metadaten, Gold/Silver/Bronze,
|
||||
Sprungerlaubnis, Level-Caps, Pflichtelemente und unbekannte Kategorien.
|
||||
- **Whiteboard:** 274 Assertions für Controller-Verdrahtung, Segmenterzeugung,
|
||||
- **Adult-Kategorien:** 67 Assertions für Metadaten, Gold/Silver/Bronze,
|
||||
Sprungerlaubnis, Level-Caps, Pflichtelemente, Wiederholungen, Kombinationen,
|
||||
Dauer und unbekannte Kategorien.
|
||||
- **Whiteboard:** 279 Assertions für Controller-Verdrahtung, Segmenterzeugung,
|
||||
Linien-/Bogenpfade, Klemmen an der Bande, Auswahl, Griff- und
|
||||
Richtungs-/Kanten-Bearbeitung, Segmentlöschung, Element-Marker (Setzen,
|
||||
Typwechsel, Inspector inkl. Kürzelauswahl, Standzeit, Base-Value- und
|
||||
Feature-Hinweis, Feature-Menü, Verschieben, Löschen), Section-Verwaltung,
|
||||
Ghosting-Zustand, Segment-Labels inklusive Dialog und Sichtbarkeits-Schalter,
|
||||
Speichern/Laden, Schema-Prüfung, Dirty-State, Prüfdialog,
|
||||
Speichern/Laden, Schema-Prüfung, Dirty-State, Prüfdialog mit
|
||||
Punktschätzung und inline änderbaren Annahmen,
|
||||
Navigationsmodus und den Maus-Drag-Pfad.
|
||||
- **History:** 53 Assertions für Undo/Redo von Segmenten, Kanten, Labels, Sections,
|
||||
Zeichengesten und Griff-Bearbeitung, Toolbar-Buttons, Erhalt der Ansicht
|
||||
|
|
|
|||
|
|
@ -16,7 +16,11 @@ und Bronze.
|
|||
| Fokus | Gold; Silver und Bronze vollständig mitgeprüft |
|
||||
| Auswahl | Kategorie-Dropdown in der Statusleiste |
|
||||
| Validierung | Elementanzahl, erlaubte Sprünge, Level-Caps, Pflichtelemente |
|
||||
| Tests | 1012 Assertions gesamt, `./tools/test.sh` grün |
|
||||
| Dauer | Prüfung gegen Kategorie-Zeit ± Toleranz |
|
||||
| Wiederholungen | max. 2-mal pro gelistetem Sprung, inkl. Kombinations-Teile |
|
||||
| Kombinationen | Anzahl, Folgen und max. Sprünge pro Kombination |
|
||||
| Punktschätzung | Basiswert + PCS-Annahme + Sturzabzug |
|
||||
| Tests | 1023 Assertions gesamt, `./tools/test.sh` grün |
|
||||
|
||||
## Datenupdate 2026/27
|
||||
|
||||
|
|
@ -95,15 +99,48 @@ Die Befunde sind Warnungen; Speichern und Export bleiben möglich.
|
|||
5. **Adult-Announcement** ist die Grundlage; spätere Aktualisierungen müssen
|
||||
als neue Saisondatei gepflegt werden.
|
||||
|
||||
## Dauer, Wiederholungen, Kombinationen
|
||||
|
||||
- **Dauer:** Die Kürdauer wird gegen `duration_seconds ±
|
||||
duration_tolerance_seconds` der Kategorie geprüft.
|
||||
- **Wiederholungen:** Jeder gelistete Sprung darf höchstens zweimal
|
||||
vorkommen; Kombinationsbestandteile werden mitgezählt. Euler (`Eu`) und
|
||||
`SEQ` zählen nicht als gelistete Sprünge.
|
||||
- **Kombinationen/Folgen:** Anzahl, Folgenanzahl und maximale Sprünge pro
|
||||
Kombination werden geprüft. Beispiel Gold: max. 2 Kombinationen oder
|
||||
1 Kombination + 1 Folge, max. 3 Sprünge pro Kombination.
|
||||
- **Freitext:** Kombinationen wie `3Lz+2T` werden für diese Prüfungen
|
||||
geparst; eine strukturierte Kombinationsmodellierung folgt später.
|
||||
|
||||
## Punktschätzung
|
||||
|
||||
Der Prüfdialog zeigt jetzt:
|
||||
|
||||
```text
|
||||
Basiswert: 9,50
|
||||
PCS-Annahme: 5,00 × 3 × 2,67 = 40,05
|
||||
Sturzabzug: 0 × 1,00 = -0,00
|
||||
Geschätzte Summe: 49,55
|
||||
ⓘ Annahmen ändern
|
||||
```
|
||||
|
||||
- PCS = Durchschnitt pro Komponente × 3 × Kategorie-Faktor.
|
||||
- Abzug = Stürze × Kategorie-Abzug.
|
||||
- Über **ⓘ Annahmen ändern** erscheint ein Inline-Panel mit zwei SpinBoxen
|
||||
(PCS 0–10, Stürze 0–20); die Werte werden mit der Kür gespeichert.
|
||||
- GOE bleibt unberücksichtigt; die Summe ist eine grobe Planungshilfe.
|
||||
|
||||
## Tests
|
||||
|
||||
- **Katalog:** 166 Assertions (43 Familien, 2026/27-Werte, `ChSp`).
|
||||
- **Level-Features:** 51 Assertions (15/5 Features, Windmills, Level-4-Liste).
|
||||
- **Validierung:** 63 Assertions (Basiswerte 2026/27).
|
||||
- **Adult:** 60 Assertions (Metadaten, Kategorien, Sprungerlaubnis,
|
||||
Gold-Limits, gültige Gold-Kür, unbekannte Kategorie).
|
||||
- **Whiteboard:** 274 Assertions (Kategorie-Auswahl, Prüfdialog, Gold-Befunde).
|
||||
- **Gesamt:** 1012 Assertions.
|
||||
- **Adult:** 67 Assertions (Metadaten, Kategorien, Sprungerlaubnis,
|
||||
Gold-Limits, gültige Gold-Kür, Wiederholungen, Kombinationen, Dauer und
|
||||
unbekannte Kategorie).
|
||||
- **Whiteboard:** 279 Assertions (Kategorie-Auswahl, Prüfdialog, Gold-Befunde,
|
||||
Punktschätzung und inline änderbare Annahmen).
|
||||
- **Gesamt:** 1023 Assertions.
|
||||
|
||||
Visuell geprüft bei 1400 × 876 und 1024 × 768: Kategorie-Dropdown, Kopfzeile
|
||||
`Kategorie: Gold · 2:50 ±10 s`, Basiswert und Gold-Befunde.
|
||||
|
|
|
|||
|
|
@ -230,7 +230,7 @@ Prüfliste jede Kategorie mit `bestanden/geprüft` und Befundzahl:
|
|||
- Level aus Features
|
||||
- Einmal pro Programm
|
||||
- Kategorie: Sprunganzahl, erlaubte Sprünge, Pirouetten, Sequenzen,
|
||||
Level-Grenzen, Pflichtelemente
|
||||
Level-Grenzen, Pflichtelemente, Dauer, Wiederholungen, Kombinationen
|
||||
|
||||
Nicht anwendbare Kategorien nennen den Grund, z. B. „nicht anwendbar (kein
|
||||
ChSq)“ oder „nicht anwendbar (keine Features gesetzt)“. Erst danach folgen
|
||||
|
|
@ -238,22 +238,23 @@ die konkreten Befunde. Die Prüfung blockiert Speichern und Export nicht.
|
|||
|
||||
### Punktwert
|
||||
|
||||
Der Prüfdialog zeigt zusätzlich eine **Basiswert-Schätzung**:
|
||||
Der Prüfdialog zeigt eine **Punktschätzung** aus drei Teilen:
|
||||
|
||||
- Summe der Base Values aller Elemente mit gültigem Katalogwert
|
||||
- Anzahl gewerteter und nicht gewerteter Elemente
|
||||
- Wertungsliste pro Element (`CCoSp L4 — 4,20`, `ChStSq — —`)
|
||||
1. **Basiswert:** Summe der Base Values aller Elemente mit gültigem
|
||||
Katalogwert, plus Wertungsliste pro Element (`CCoSp L4 — 4,20`).
|
||||
2. **PCS-Annahme:** Durchschnitt pro Komponente × 3 Komponenten ×
|
||||
Kategorie-Faktor (z. B. Gold 2,67).
|
||||
3. **Sturzabzug:** Anzahl Stürze × Kategorie-Abzug (Gold 1,0; Silver/Bronze
|
||||
0,5).
|
||||
|
||||
Die Schätzung enthält **keine** GOE, keinen 1,1-Faktor für die zweite
|
||||
Programmhälfte, keine Programmkomponenten und keine Abzüge. Freitext- und
|
||||
Kombinationselemente ohne Katalogwert werden als nicht gewertet markiert.
|
||||
Der angezeigte Wert ist damit ein technischer Basiswert, keine
|
||||
Gesamtpunktzahl.
|
||||
Die Annahmen sind über **ⓘ Annahmen ändern** direkt im Dialog einstellbar
|
||||
(PCS-Durchschnitt 0–10, Stürze 0–20) und werden mit der Kür gespeichert.
|
||||
GOE ist weiterhin nicht enthalten; Freitext- und Kombinationselemente ohne
|
||||
Katalogwert werden als nicht gewertet markiert. Der Wert bleibt eine grobe
|
||||
Schätzung, keine offizielle Punktzahl.
|
||||
|
||||
Der Link **ⓘ Was ist enthalten?** klappt diese Grenzen direkt im Prüfdialog
|
||||
auf; ein zweiter Klick blendet sie wieder aus. Noch nicht geprüft werden
|
||||
Dauer, Wiederholungs- und Kombinationsregeln sowie die Begrenzung auf zwei
|
||||
Features pro Fuß.
|
||||
Der Link **ⓘ Was ist enthalten?** klappt die Grenzen der Basiswert-Summe auf;
|
||||
ein zweiter Klick blendet sie wieder aus.
|
||||
|
||||
## Neue Saison einpflegen
|
||||
|
||||
|
|
@ -279,9 +280,6 @@ mit ausgeliefert.
|
|||
## Nächste Ausbaustufen
|
||||
|
||||
- Max. zwei Features pro Fuß und Feature-Positionsregeln
|
||||
- Wiederholungs- und Kombinationsregeln
|
||||
- Dauerprüfung gegen die Kategorie-Zeit
|
||||
- PCS und Sturzabzüge in der Punktschätzung
|
||||
- Strukturierte Sprungkombinationen/-folgen statt Freitext-Parsing
|
||||
- GOE-Tabellen und `V`-/Unterrotations-Varianten
|
||||
- Sprungkombinationen und -folgen als zusammengesetzte Elemente
|
||||
- Vorschlagsliste im Inspector direkt aus `suggest()`
|
||||
|
|
|
|||
|
|
@ -131,9 +131,11 @@ Voraussetzung für Phase 1.
|
|||
Elementlimits, erlaubten Sprüngen, Level-Caps und Pflichtelementen
|
||||
- [x] Kategorie-Auswahl in der Statusleiste und Kategorie-Prüfungen
|
||||
- [ ] Max. zwei Features pro Fuß und Feature-Positionsregeln
|
||||
- [ ] Wiederholungs- und Kombinationsregeln
|
||||
- [ ] Dauerprüfung gegen die Kategorie-Zeit
|
||||
- [ ] PCS und Sturzabzüge in der Punktschätzung
|
||||
- [x] Wiederholungsregeln (max. 2-mal pro gelistetem Sprung)
|
||||
- [x] Kombinationsgrenzen (Anzahl, Folgen, max. Sprünge pro Kombination)
|
||||
- [ ] Strukturierte Sprungkombinationen/-folgen statt Freitext-Parsing
|
||||
- [x] Dauerprüfung gegen die Kategorie-Zeit
|
||||
- [x] PCS und Sturzabzüge in der Punktschätzung (mit Annahmen)
|
||||
- [ ] Optional: Suchfeld/Autovervollständigung aus `suggest()`
|
||||
- [ ] Optional: GOE-Tabellen sowie `V`-/Unterrotationsvarianten
|
||||
|
||||
|
|
@ -160,9 +162,10 @@ fachlichen Validierung angefasst.
|
|||
|
||||
Die Reihenfolge ist bewusst: native Builds, Datenaustausch und Element-Marker
|
||||
sind erledigt. Im PoC läuft jetzt das ISU-Regelwerk – Katalog 2026/27,
|
||||
Level-Features, Elementvalidierung und Adult-Kategorien stehen; als Nächstes
|
||||
folgen Wiederholungs-/Kombinationsregeln und die Dauerprüfung. Sync-Komfort
|
||||
und UI-Refactoring sind zurückgestellt, weil der bestehende Stand für Tests
|
||||
Level-Features, Elementvalidierung, Adult-Kategorien, Dauer und
|
||||
Wiederholungs-/Kombinationsgrenzen stehen; als Nächstes folgen strukturierte
|
||||
Kombinationen, Feature-Grenzen pro Fuß und GOE. Sync-Komfort und
|
||||
UI-Refactoring sind zurückgestellt, weil der bestehende Stand für Tests
|
||||
genügt und die endgültige Sync-Architektur (PHP-Webserver) sowie das
|
||||
UI-Feedback der Tester ohnehin noch ausstehen.
|
||||
|
||||
|
|
|
|||
|
|
@ -960,12 +960,70 @@ title = "Kür prüfen"
|
|||
size = Vector2i(720, 520)
|
||||
ok_button_text = "Schließen"
|
||||
|
||||
[node name="ValidationText" type="RichTextLabel" parent="ValidationDialog"]
|
||||
unique_name_in_owner = true
|
||||
[node name="ValidationContainer" type="VBoxContainer" parent="ValidationDialog"]
|
||||
offset_left = 12.0
|
||||
offset_top = 12.0
|
||||
offset_right = 708.0
|
||||
offset_bottom = 456.0
|
||||
offset_bottom = 656.0
|
||||
theme_override_constants/separation = 8
|
||||
|
||||
[node name="ValidationText" type="RichTextLabel" parent="ValidationDialog/ValidationContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
bbcode_enabled = true
|
||||
scroll_active = true
|
||||
selection_enabled = true
|
||||
selection_enabled = true
|
||||
|
||||
[node name="ScoreAssumptionsPanel" type="VBoxContainer" parent="ValidationDialog/ValidationContainer"]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 6
|
||||
|
||||
[node name="AssumptionsRow" type="HBoxContainer" parent="ValidationDialog/ValidationContainer/ScoreAssumptionsPanel"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 8
|
||||
|
||||
[node name="PcsLabel" type="Label" parent="ValidationDialog/ValidationContainer/ScoreAssumptionsPanel/AssumptionsRow"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0.580392, 0.639216, 0.721569, 1)
|
||||
theme_override_font_sizes/font_size = 14
|
||||
text = "PCS-Durchschnitt"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="PcsAverageSpin" type="SpinBox" parent="ValidationDialog/ValidationContainer/ScoreAssumptionsPanel/AssumptionsRow"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(130, 48)
|
||||
layout_mode = 2
|
||||
max_value = 10.0
|
||||
step = 0.25
|
||||
value = 5.0
|
||||
|
||||
[node name="FallsLabel" type="Label" parent="ValidationDialog/ValidationContainer/ScoreAssumptionsPanel/AssumptionsRow"]
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0.580392, 0.639216, 0.721569, 1)
|
||||
theme_override_font_sizes/font_size = 14
|
||||
text = "Stürze"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="FallsSpin" type="SpinBox" parent="ValidationDialog/ValidationContainer/ScoreAssumptionsPanel/AssumptionsRow"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(110, 48)
|
||||
layout_mode = 2
|
||||
max_value = 20.0
|
||||
step = 1.0
|
||||
|
||||
[node name="ApplyScoreAssumptionsButton" type="Button" parent="ValidationDialog/ValidationContainer/ScoreAssumptionsPanel/AssumptionsRow"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(150, 48)
|
||||
layout_mode = 2
|
||||
text = "Übernehmen"
|
||||
|
||||
[node name="ScoreAssumptionsHint" type="Label" parent="ValidationDialog/ValidationContainer/ScoreAssumptionsPanel"]
|
||||
custom_minimum_size = Vector2(680, 0)
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0.580392, 0.639216, 0.721569, 1)
|
||||
theme_override_font_sizes/font_size = 13
|
||||
text = "Grobe Schätzung: PCS = Durchschnitt × 3 Komponenten × Kategorie-Faktor. Abzug = Stürze × Kategorie-Abzug. GOE ist nicht enthalten."
|
||||
autowrap_mode = 3
|
||||
|
|
|
|||
|
|
@ -13,6 +13,10 @@ const CURRENT_SCHEMA_VERSION := 2
|
|||
## Adult competition category code (e.g. "gold", "silver", "bronze"). Empty
|
||||
## means no category-specific validation.
|
||||
@export var adult_category: String = ""
|
||||
## Rough scoring assumptions for the estimate: average PCS per component
|
||||
## (0-10) and number of falls.
|
||||
@export var assumed_pcs_average: float = 5.0
|
||||
@export var assumed_falls: int = 0
|
||||
@export var rink: RinkDimensions = RinkDimensions.new()
|
||||
@export var sections: Array[RoutineSection] = []
|
||||
|
||||
|
|
@ -61,6 +65,10 @@ func validate() -> PackedStringArray:
|
|||
errors.append("rink dimensions are invalid")
|
||||
if sections.is_empty():
|
||||
errors.append("routine must contain at least one section")
|
||||
if assumed_pcs_average < 0.0 or assumed_pcs_average > 10.0:
|
||||
errors.append("assumed_pcs_average must be between 0 and 10")
|
||||
if assumed_falls < 0:
|
||||
errors.append("assumed_falls must not be negative")
|
||||
|
||||
var seen_section_ids: Dictionary[String, bool] = {}
|
||||
var seen_orders: Dictionary[int, bool] = {}
|
||||
|
|
|
|||
|
|
@ -63,9 +63,12 @@ class Category extends RefCounted:
|
|||
return true
|
||||
if not allowed_rotations.has(ROTATION_NAMES[rotation]):
|
||||
return false
|
||||
if jump_type(cleaned) == "A" and not allow_axel:
|
||||
if jump_type(cleaned).to_lower() == "a" and not allow_axel:
|
||||
return false
|
||||
return not forbidden_jumps.has(cleaned)
|
||||
for forbidden: String in forbidden_jumps:
|
||||
if forbidden.to_lower() == cleaned.to_lower():
|
||||
return false
|
||||
return true
|
||||
|
||||
func validate() -> PackedStringArray:
|
||||
var errors := PackedStringArray()
|
||||
|
|
|
|||
|
|
@ -112,6 +112,11 @@ func _validate_category(
|
|||
var axel_present := false
|
||||
var jump_type_failed := false
|
||||
var level_failed := false
|
||||
var jump_counts: Dictionary[String, int] = {}
|
||||
var jump_labels: Dictionary[String, String] = {}
|
||||
var combination_count := 0
|
||||
var sequence_count := 0
|
||||
var combination_failed := false
|
||||
|
||||
for section: RoutineSection in routine.sections:
|
||||
if section == null:
|
||||
|
|
@ -124,18 +129,44 @@ func _validate_category(
|
|||
match segment.element_type:
|
||||
PathSegment.ElementType.JUMP:
|
||||
jumps += 1
|
||||
if AdultCategoryRules.Category.jump_type(code) == "A":
|
||||
axel_present = true
|
||||
if not category.is_jump_allowed(code):
|
||||
_append(
|
||||
report,
|
||||
ValidationIssue.Severity.WARNING,
|
||||
"„%s“ ist in %s nicht erlaubt."
|
||||
% [code, category.name],
|
||||
section.section_id,
|
||||
segment.segment_id
|
||||
)
|
||||
jump_type_failed = true
|
||||
var parts := _jump_parts(code)
|
||||
for part: String in parts:
|
||||
var key := part.to_lower()
|
||||
jump_counts[key] = jump_counts.get(key, 0) + 1
|
||||
if not jump_labels.has(key):
|
||||
jump_labels[key] = part
|
||||
if AdultCategoryRules.Category.jump_type(part).to_upper() == "A":
|
||||
axel_present = true
|
||||
if not category.is_jump_allowed(part):
|
||||
_append(
|
||||
report,
|
||||
ValidationIssue.Severity.WARNING,
|
||||
"„%s“ ist in %s nicht erlaubt."
|
||||
% [part, category.name],
|
||||
section.section_id,
|
||||
segment.segment_id
|
||||
)
|
||||
jump_type_failed = true
|
||||
if parts.size() > 1:
|
||||
if code.to_upper().contains("SEQ"):
|
||||
sequence_count += 1
|
||||
else:
|
||||
combination_count += 1
|
||||
if parts.size() > category.max_jumps_per_combination:
|
||||
_append(
|
||||
report,
|
||||
ValidationIssue.Severity.WARNING,
|
||||
"Kombination „%s“ hat %d Sprünge; %s erlaubt max. %d."
|
||||
% [
|
||||
code,
|
||||
parts.size(),
|
||||
category.name,
|
||||
category.max_jumps_per_combination,
|
||||
],
|
||||
section.section_id,
|
||||
segment.segment_id
|
||||
)
|
||||
combination_failed = true
|
||||
PathSegment.ElementType.SPIN:
|
||||
spins += 1
|
||||
if lower.begins_with("chsp"):
|
||||
|
|
@ -266,6 +297,106 @@ func _validate_category(
|
|||
else:
|
||||
_pass(report, "category_required")
|
||||
|
||||
var repetition_failed := false
|
||||
for key: String in jump_counts:
|
||||
var count: int = jump_counts[key]
|
||||
if count <= 2:
|
||||
continue
|
||||
_append(
|
||||
report,
|
||||
ValidationIssue.Severity.WARNING,
|
||||
"„%s“ kommt %d-mal vor; max. 2-mal erlaubt."
|
||||
% [jump_labels.get(key, key), count]
|
||||
)
|
||||
repetition_failed = true
|
||||
if repetition_failed:
|
||||
_fail(report, "category_repetitions", false)
|
||||
else:
|
||||
_pass(report, "category_repetitions")
|
||||
|
||||
if combination_count > category.max_jump_combinations:
|
||||
_append(
|
||||
report,
|
||||
ValidationIssue.Severity.WARNING,
|
||||
"Sprungkombinationen: %d, erlaubt sind max. %d (%s)."
|
||||
% [combination_count, category.max_jump_combinations, category.name]
|
||||
)
|
||||
combination_failed = true
|
||||
if sequence_count > category.max_jump_sequences:
|
||||
_append(
|
||||
report,
|
||||
ValidationIssue.Severity.WARNING,
|
||||
"Sprungfolgen: %d, erlaubt sind max. %d (%s)."
|
||||
% [sequence_count, category.max_jump_sequences, category.name]
|
||||
)
|
||||
combination_failed = true
|
||||
if combination_count + sequence_count > category.max_jump_combinations:
|
||||
_append(
|
||||
report,
|
||||
ValidationIssue.Severity.WARNING,
|
||||
"Kombinationen/Folgen zusammen: %d, erlaubt sind max. %d (%s)."
|
||||
% [
|
||||
combination_count + sequence_count,
|
||||
category.max_jump_combinations,
|
||||
category.name,
|
||||
]
|
||||
)
|
||||
combination_failed = true
|
||||
if combination_failed:
|
||||
_fail(report, "category_combinations", false)
|
||||
else:
|
||||
_pass(report, "category_combinations")
|
||||
|
||||
var duration := routine.get_duration_seconds()
|
||||
var target := float(category.duration_seconds)
|
||||
var tolerance := float(category.duration_tolerance_seconds)
|
||||
if duration < target - tolerance or duration > target + tolerance:
|
||||
_append(
|
||||
report,
|
||||
ValidationIssue.Severity.WARNING,
|
||||
"Kürdauer %s liegt außerhalb %s ±%d s."
|
||||
% [
|
||||
_format_duration(duration),
|
||||
_format_duration(target),
|
||||
int(tolerance),
|
||||
]
|
||||
)
|
||||
_fail(report, "category_duration", false)
|
||||
else:
|
||||
_pass(report, "category_duration")
|
||||
|
||||
|
||||
## Splits a jump code like "3Lz+2T+SEQ" into its listed jumps. Euler (Eu) and
|
||||
## the SEQ marker are not listed jumps and do not count for repetition.
|
||||
static func _jump_parts(code: String) -> PackedStringArray:
|
||||
var result := PackedStringArray()
|
||||
var cleaned := code.strip_edges()
|
||||
if cleaned.is_empty():
|
||||
return result
|
||||
for raw: String in cleaned.split("+"):
|
||||
var token := raw.strip_edges()
|
||||
var upper := token.to_upper()
|
||||
if token.is_empty() or upper == "SEQ" or upper == "S":
|
||||
continue
|
||||
if token.length() < 2:
|
||||
continue
|
||||
var first := token.substr(0, 1)
|
||||
if not first.is_valid_int():
|
||||
continue
|
||||
var rotation := int(first)
|
||||
if rotation < 1 or rotation > 4:
|
||||
continue
|
||||
var jump_type := token.substr(1)
|
||||
if jump_type.to_lower() == "eu":
|
||||
continue
|
||||
result.append(token)
|
||||
return result
|
||||
|
||||
|
||||
static func _format_duration(seconds: float) -> String:
|
||||
var total := int(round(seconds))
|
||||
return "%d:%02d" % [total / 60, total % 60]
|
||||
|
||||
|
||||
func _check_category_count(
|
||||
report: ValidationReport,
|
||||
|
|
|
|||
|
|
@ -20,6 +20,9 @@ const CHECK_ORDER := [
|
|||
"category_sequences",
|
||||
"category_levels",
|
||||
"category_required",
|
||||
"category_duration",
|
||||
"category_repetitions",
|
||||
"category_combinations",
|
||||
]
|
||||
|
||||
const CHECK_LABELS := {
|
||||
|
|
@ -38,6 +41,9 @@ const CHECK_LABELS := {
|
|||
"category_sequences": "Kategorie: Sequenzen",
|
||||
"category_levels": "Kategorie: Level-Grenzen",
|
||||
"category_required": "Kategorie: Pflichtelemente",
|
||||
"category_duration": "Kategorie: Dauer",
|
||||
"category_repetitions": "Kategorie: Wiederholungen",
|
||||
"category_combinations": "Kategorie: Kombinationen",
|
||||
}
|
||||
|
||||
var issues: Array[ValidationIssue] = []
|
||||
|
|
|
|||
|
|
@ -125,6 +125,10 @@ const COMPACT_LAYOUT_WIDTH := 1280.0
|
|||
@onready var adult_category_option: OptionButton = %AdultCategoryOption
|
||||
@onready var validation_dialog: AcceptDialog = %ValidationDialog
|
||||
@onready var validation_text: RichTextLabel = %ValidationText
|
||||
@onready var score_assumptions_panel: VBoxContainer = %ScoreAssumptionsPanel
|
||||
@onready var pcs_average_spin: SpinBox = %PcsAverageSpin
|
||||
@onready var falls_spin: SpinBox = %FallsSpin
|
||||
@onready var apply_score_assumptions_button: Button = %ApplyScoreAssumptionsButton
|
||||
@onready var element_duration_spin: SpinBox = %ElementDurationSpin
|
||||
@onready var segment_label_dialog: ConfirmationDialog = %SegmentLabelDialog
|
||||
@onready var segment_label_edit: LineEdit = %SegmentLabelEdit
|
||||
|
|
@ -170,6 +174,7 @@ var _level_rules: ElementLevelRules
|
|||
var _adult_rules: AdultCategoryRules
|
||||
var _dialog_features: PackedStringArray = PackedStringArray()
|
||||
var _show_score_info: bool = false
|
||||
var _show_score_assumptions: bool = false
|
||||
var _preset_speed: float = DEFAULT_SPEED_MPS
|
||||
var _current_path: String = ""
|
||||
var _dirty: bool = false
|
||||
|
|
@ -281,6 +286,7 @@ func _ready() -> void:
|
|||
element_dialog.confirmed.connect(_on_element_confirmed)
|
||||
validation_button.pressed.connect(open_validation_dialog)
|
||||
validation_text.meta_clicked.connect(_on_validation_meta_clicked)
|
||||
apply_score_assumptions_button.pressed.connect(_apply_score_assumptions)
|
||||
element_type_option.item_selected.connect(_on_element_type_selected)
|
||||
|
||||
resized.connect(_apply_responsive_layout)
|
||||
|
|
@ -462,6 +468,9 @@ func validate_routine() -> Array[ValidationIssue]:
|
|||
## were performed.
|
||||
func open_validation_dialog() -> void:
|
||||
_show_score_info = false
|
||||
_show_score_assumptions = false
|
||||
if score_assumptions_panel != null:
|
||||
score_assumptions_panel.visible = false
|
||||
_render_validation_dialog()
|
||||
|
||||
|
||||
|
|
@ -493,19 +502,20 @@ func _render_validation_dialog() -> void:
|
|||
season,
|
||||
]
|
||||
)
|
||||
var category_name := "Ohne Kategorie"
|
||||
var category: AdultCategoryRules.Category = null
|
||||
if (
|
||||
_routine != null
|
||||
and not _routine.adult_category.is_empty()
|
||||
and _adult_rules != null
|
||||
):
|
||||
var category := _adult_rules.get_category(_routine.adult_category)
|
||||
if category != null:
|
||||
category_name = "%s · %s ±%d s" % [
|
||||
category.name,
|
||||
_format_duration(category.duration_seconds),
|
||||
category.duration_tolerance_seconds,
|
||||
]
|
||||
category = _adult_rules.get_category(_routine.adult_category)
|
||||
var category_name := "Ohne Kategorie"
|
||||
if category != null:
|
||||
category_name = "%s · %s ±%d s" % [
|
||||
category.name,
|
||||
_format_duration(category.duration_seconds),
|
||||
category.duration_tolerance_seconds,
|
||||
]
|
||||
lines.append("[b]Kategorie: %s[/b]" % category_name)
|
||||
lines.append("")
|
||||
lines.append(
|
||||
|
|
@ -528,6 +538,46 @@ func _render_validation_dialog() -> void:
|
|||
if _show_score_info:
|
||||
lines.append("")
|
||||
lines.append_array(_score_info_lines())
|
||||
if category != null:
|
||||
var pcs_total := (
|
||||
_routine.assumed_pcs_average * 3.0 * category.pcs_factor
|
||||
)
|
||||
var deduction := float(_routine.assumed_falls) * category.fall_deduction
|
||||
var estimated := report.base_value_total + pcs_total - deduction
|
||||
lines.append("")
|
||||
lines.append("[b]Punktschätzung[/b]")
|
||||
lines.append(
|
||||
"PCS-Annahme: %s × 3 × %s = %s"
|
||||
% [
|
||||
_format_base_value(_routine.assumed_pcs_average),
|
||||
_format_base_value(category.pcs_factor),
|
||||
_format_base_value(pcs_total),
|
||||
]
|
||||
)
|
||||
lines.append(
|
||||
"Sturzabzug: %d × %s = -%s"
|
||||
% [
|
||||
_routine.assumed_falls,
|
||||
_format_base_value(category.fall_deduction),
|
||||
_format_base_value(deduction),
|
||||
]
|
||||
)
|
||||
lines.append(
|
||||
"[b]Geschätzte Summe: %s[/b]" % _format_base_value(estimated)
|
||||
)
|
||||
var assumptions_label := (
|
||||
"ⓘ Annahmen ausblenden"
|
||||
if _show_score_assumptions
|
||||
else "ⓘ Annahmen ändern"
|
||||
)
|
||||
lines.append(
|
||||
"[url=score_assumptions][color=#60a5fa]%s[/color][/url]"
|
||||
% assumptions_label
|
||||
)
|
||||
else:
|
||||
lines.append(
|
||||
"[color=#94a3b8]PCS und Abzüge: Kategorie wählen.[/color]"
|
||||
)
|
||||
if not report.element_values.is_empty():
|
||||
lines.append("")
|
||||
lines.append("[b]Wertung[/b]")
|
||||
|
|
@ -712,9 +762,48 @@ static func _format_duration(seconds: int) -> String:
|
|||
|
||||
|
||||
func _on_validation_meta_clicked(meta: Variant) -> void:
|
||||
if str(meta) != "score_info":
|
||||
var key := str(meta)
|
||||
if key == "score_info":
|
||||
_show_score_info = not _show_score_info
|
||||
_render_validation_dialog()
|
||||
elif key == "score_assumptions":
|
||||
_show_score_assumptions = not _show_score_assumptions
|
||||
_update_score_assumptions_panel()
|
||||
_render_validation_dialog()
|
||||
|
||||
|
||||
func _update_score_assumptions_panel() -> void:
|
||||
if score_assumptions_panel == null:
|
||||
return
|
||||
_show_score_info = not _show_score_info
|
||||
score_assumptions_panel.visible = _show_score_assumptions
|
||||
if _show_score_assumptions and _routine != null:
|
||||
pcs_average_spin.set_value_no_signal(_routine.assumed_pcs_average)
|
||||
falls_spin.set_value_no_signal(float(_routine.assumed_falls))
|
||||
var target_height := 670 if _show_score_assumptions else 520
|
||||
var target := Vector2i(720, target_height)
|
||||
var viewport_size := Vector2i(get_viewport_rect().size)
|
||||
if viewport_size.x > 0:
|
||||
target.x = mini(target.x, viewport_size.x)
|
||||
if viewport_size.y > 0:
|
||||
target.y = mini(target.y, viewport_size.y)
|
||||
validation_dialog.size = target
|
||||
|
||||
|
||||
func _apply_score_assumptions() -> void:
|
||||
if _routine == null:
|
||||
return
|
||||
var pcs := clampf(pcs_average_spin.value, 0.0, 10.0)
|
||||
var falls := clampi(int(round(falls_spin.value)), 0, 20)
|
||||
if (
|
||||
not is_equal_approx(_routine.assumed_pcs_average, pcs)
|
||||
or _routine.assumed_falls != falls
|
||||
):
|
||||
_record_undo()
|
||||
_routine.assumed_pcs_average = pcs
|
||||
_routine.assumed_falls = falls
|
||||
_mark_dirty()
|
||||
_show_score_assumptions = false
|
||||
_update_score_assumptions_panel()
|
||||
_render_validation_dialog()
|
||||
|
||||
|
||||
|
|
@ -1722,6 +1811,8 @@ func _clone_routine(source: Routine) -> Routine:
|
|||
clone.title = source.title
|
||||
clone.skater_name = source.skater_name
|
||||
clone.adult_category = source.adult_category
|
||||
clone.assumed_pcs_average = source.assumed_pcs_average
|
||||
clone.assumed_falls = source.assumed_falls
|
||||
if source.rink != null:
|
||||
clone.rink = _clone_rink(source.rink)
|
||||
|
||||
|
|
|
|||
|
|
@ -94,6 +94,10 @@ func _capture() -> void:
|
|||
elif args.size() > 3 and args[3] == "adultgold":
|
||||
controller.set_adult_category("gold")
|
||||
controller.open_validation_dialog()
|
||||
elif args.size() > 3 and args[3] == "assumptions":
|
||||
controller.set_adult_category("gold")
|
||||
controller.open_validation_dialog()
|
||||
controller.validation_text.meta_clicked.emit("score_assumptions")
|
||||
elif args.size() > 3 and args[3] == "scoreinfo":
|
||||
controller.open_validation_dialog()
|
||||
controller.validation_text.meta_clicked.emit("score_info")
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ func _init() -> void:
|
|||
_test_jump_permissions()
|
||||
_test_gold_limits()
|
||||
_test_valid_gold()
|
||||
_test_duration_and_repetitions()
|
||||
_test_unknown_category()
|
||||
_finish()
|
||||
|
||||
|
|
@ -153,6 +154,7 @@ func _test_valid_gold() -> void:
|
|||
_add_spin(section, "spin-b", "FUSp", 3)
|
||||
_add_spin(section, "spin-chsp", "ChSp", 1)
|
||||
_add_sequence(section, "step", "StSq", 2)
|
||||
_set_total_duration(section, 170.0)
|
||||
|
||||
var report := _validator.validate_report(routine)
|
||||
_check(report.issues.is_empty(), "a valid Gold program has no findings")
|
||||
|
|
@ -176,6 +178,35 @@ func _test_valid_gold() -> void:
|
|||
report.get_check("category_required").passed == 1,
|
||||
"the Gold required elements pass"
|
||||
)
|
||||
_check(
|
||||
report.get_check("category_duration").passed == 1,
|
||||
"the Gold duration passes at 2:50"
|
||||
)
|
||||
|
||||
|
||||
func _test_duration_and_repetitions() -> void:
|
||||
var routine := _make_routine("gold")
|
||||
var section := routine.sections[0]
|
||||
for code: String in ["2T", "2T", "2T", "2S+2S", "2Lo+2Lo", "2T+2T"]:
|
||||
_add_jump(section, code)
|
||||
_set_total_duration(section, 200.0)
|
||||
|
||||
var report := _validator.validate_report(routine)
|
||||
_check(
|
||||
report.get_check("category_repetitions").warnings == 1,
|
||||
"more than two 2T attempts are reported"
|
||||
)
|
||||
_check(
|
||||
report.get_check("category_combinations").warnings == 1,
|
||||
"three jump combinations exceed the Gold limit"
|
||||
)
|
||||
_check(
|
||||
report.get_check("category_duration").warnings == 1,
|
||||
"200 seconds are outside the Gold duration"
|
||||
)
|
||||
_check(_has_message(report, "kommt 5-mal vor"), "repetition message")
|
||||
_check(_has_message(report, "Sprungkombinationen: 3"), "combination message")
|
||||
_check(_has_message(report, "Kürdauer"), "duration message")
|
||||
|
||||
|
||||
func _test_unknown_category() -> void:
|
||||
|
|
@ -236,6 +267,14 @@ func _add_sequence(
|
|||
return segment
|
||||
|
||||
|
||||
func _set_total_duration(section: RoutineSection, total: float) -> void:
|
||||
if section.segments.is_empty():
|
||||
return
|
||||
var each := total / float(section.segments.size())
|
||||
for segment: PathSegment in section.segments:
|
||||
segment.element_duration_seconds = each
|
||||
|
||||
|
||||
func _make_point_curve(point: Vector2) -> Curve2D:
|
||||
var curve := Curve2D.new()
|
||||
curve.add_point(point)
|
||||
|
|
|
|||
|
|
@ -1368,6 +1368,33 @@ func _run() -> void:
|
|||
controller.validation_text.text.contains("Choreographic Spin"),
|
||||
"validation dialog reports the missing choreographic spin"
|
||||
)
|
||||
_check(
|
||||
controller.validation_text.text.contains("Punktschätzung")
|
||||
and controller.validation_text.text.contains("Geschätzte Summe"),
|
||||
"Gold validation shows the PCS-based estimate"
|
||||
)
|
||||
controller.validation_text.meta_clicked.emit("score_assumptions")
|
||||
_check(
|
||||
controller.score_assumptions_panel.visible,
|
||||
"the assumptions panel opens from the score estimate"
|
||||
)
|
||||
controller.pcs_average_spin.value = 6.0
|
||||
controller.falls_spin.value = 1.0
|
||||
controller.apply_score_assumptions_button.pressed.emit()
|
||||
_check(
|
||||
not controller.score_assumptions_panel.visible,
|
||||
"applying the assumptions closes the inline panel"
|
||||
)
|
||||
_check(
|
||||
controller.get_routine().assumed_pcs_average == 6.0
|
||||
and controller.get_routine().assumed_falls == 1,
|
||||
"the scoring assumptions are stored on the routine"
|
||||
)
|
||||
_check(
|
||||
controller.validation_text.text.contains("PCS-Annahme: 6,00")
|
||||
and controller.validation_text.text.contains("-1,00"),
|
||||
"the estimate follows the changed assumptions"
|
||||
)
|
||||
controller.validation_dialog.hide()
|
||||
|
||||
scene.queue_free()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue