[274] Umbau je Schicht: Sanierung auch für Decken und Dächer, Status je Schicht im IFC
Gleicher Kern-Code wie bei den Wänden (Trait build_up::Layered für Wand-, Decken- und Dachtyp; type_pair_in, look_core; ceiling_look/roof_look in Resolved::slabs, Umstellen in swap_build_ups). CeilingType/RoofType mit renovationTarget/Side/Old/New; Bezugsseite Decke unten/oben, Dach: Dachhaut hebt sich. Schnitt je Schicht, 3D je Deckenschicht, Grundriss-Linien/Ansicht/Axo in der Farbe der obersten Schicht. Objekt-Info und Umbau-Panel „Sanierung“ für Decken und Dächer; Abfragen mit kind. IFC: Dossier_Umbau.SchichtenBestand/SchichtenSanierung. Beispiel :umbau: Decke C1 und Dach RF1 saniert (Schnitt C). Bild doc/review-274/07-decke-dach.png.
This commit is contained in:
20 files changed
+955
-180
No files matched your search
@@ -75,7 +75,7 @@ Kennwort, anonym) als PDF; Austausch mit Fachplanern über DXF/IFC.
|
||||
- ◐ **[270]** Blickrichtungen überall gleich, Marken weichen aus (17.11.). **Befund:** das 3D-Fenster (render3d, Browser und Metal) zeigte das Modell **gespiegelt**: Bauteile liegen in der Welt (x, Höhe, y), ein Achsentausch (Determinante −1), und `look_at` ist rechtshändig — von Süden gesehen lag der Erker im Osten links, die Draufsicht stand kopfüber (Süden oben). Gelände, Importe/Verbau und Punktwolken negierten y (Fix 24.9. „swisstopo gespiegelt“) und lagen damit an y = 0 gespiegelt unter dem Haus. Vektor-Axonometrie, Cycles, Blender, glTF/OBJ und die Ansichten Nord/Ost/Süd/West waren seitenrichtig, aber die Namen widersprachen sich: `iso` = von Nordost (3D, Axo-Alias), von Südwest (Cycles/Blender); `front` = von Norden (3D, Axo) bzw. Süden (Cycles); „Axonometrie Südost“ im Musterhaus komplex stand auf `isoFrontLeft`. **Behoben:** eine Tabelle `render3d/src/view_dir.rs` für 3D-Presets (`math::preset_camera`), Axonometrie (`plan/axo.rs::preset`), Cycles (`cycles_scene.rs::preset`, CLI `render --view` nimmt auch `southeast` …), Blender-Skript (Kopie, per vitest geprüft): vorne = Süden, rechts = Osten, `iso` = Südost, `isoFrontLeft` = Südwest, `isoBackRight` = Nordost, `isoBackLeft` = Nordwest, `top` mit Norden oben; Beschriftungen „Isometrie Südost“, „Südwest“ … Die Spiegelung gleicht die Kamera an einer Stelle aus (`math::view_matrix`: Bild-rechts = oben × Blick; Culling `FrontFace::Cw`; Pathtracer-Strahlen; TS `screenRight`/`orbitRight` für Pick-Strahl, Griffe, Pan, Zoom zum Cursor, Begehen, Orbit-Richtung); Gelände/Import/Punktwolke/Luftbild ohne y-Negation. Ausschnitt „Axonometrie Südost“ → `iso`. **Marken ([266]/8):** Ansichtsmarken werden nach den Schnitten gesetzt und weichen Schnittlinien, -pfeilen und anderen Ansichtsmarken aus (zusätzlich seitlich entlang ihrer Linie, bis 15 mm; `plan/context.rs::view_marker`); Schnittpfeile sind Hindernis für Beschriftungen. Tests: Rust render3d `kamera_zeigt_modell_seitenrichtig` (vorher rot), `aussenflaechen_erscheinen_im_uhrzeigersinn`, `view_dir::tests`; Kern `axo::testhaus_seitenrichtig_in_allen_vorgaben`, `cycles_scene::voreinstellungen_heissen_wie_im_3d`, `context::ansichtsmarken_weichen_schnittmarken_aus` (vorher rot); vitest `view270.test.ts`, `viewDirections.test.ts`. Bilder und Testhaus (Erker Ost, Garage West, Turm Nordwest; `testhaus.py`) in `doc/review-270/`. **Offen:** 3D-Bild nur numerisch (Kameramatrix, Pick-Strahl) geprüft, kein Bild aus render3d unter Linux, nicht auf dem Mac/Metal (Prüfschritt `doc/RELEASE-1.0.md` 13.36); natives Spike-Fenster `src-tauri/src/native.rs` (Orbit-Richtung) nicht angepasst; gespeicherte Ausschnitte mit `isoBackRight`/`isoFrontLeft` zeigen jetzt die Richtung ihres Namens (keine produktiven Projekte). · M
|
||||
- ◐ **[276]** Schnitt-/Ansichtslinie im Plan einstellbar (Wunsch Maintainer 17.11., „wie Archicad“; 17.11.). **Archicad** (Hilfe „Section/Elevation Marker“, Marker- und Marker-Head-Bereich der Schnitt-Einstellungen, Modellansicht-Option „Show Section and Elevation Markers“, [Quellen nur über die Suche gelesen, Feldnamen nicht je Version geprüft]): Marke an Anfang, Ende oder beiden Enden bzw. eine in der Mitte, Markentyp und Symbol, Linientyp und Stift der Linie, Beschriftung. **Übernommen (schlank):** je Schnitt- und Ansichtslinie `lineMode` (full | ends | none), `endLengthMm`, `lineStyleId` (Linientyp), `linePenId` (Stift des aktiven Stiftsatzes: Farbe + Stärke), `marker` (arrow | lAngle | triangle | none; Ansicht: triangle | arrow | none), `markerAt` (both | start | end, nur Schnitt), `markerLabel`; Vorgabe getrennt für Schnitte (`sectionMarks`) und Ansichten (`elevationMarks`) in der Modelldarstellung (Ebene > Modelldarstellung des gezeigten Plans > Basis), dort ohne Linientyp/Stift (Auswahl nur feste Werte). `markerStyle`/`sectionMarks.style` gehen darin auf; Basis = heutiges Bild (Goldens unverändert): Schnitt = dünne Strichpunktlinie mit kräftigen Endstücken + Pfeile + Beschriftung, Ansicht = nur Dreieck + Beschriftung. Ansichtslinie wird jetzt auf Wunsch gezeichnet und ist dann anwählbar. Der frühere L (`lAngle`) heisst jetzt `lineMode: ends` + `marker: lAngle`. Kern: `plan/misc.rs` (`SectionLook`, `section_polyline_look`, `view_symbol`, `view_line_parts`), `plan/model_view.rs::mark_look`, `plan/context.rs` (Linientyp/Stift, Beschriftung nur an markierten Enden, Ausweichen [270] und Knicke [176] unverändert). Oberfläche: `SectionLookFields.tsx` in der Objekt-Info (Symbol-Knöpfe mit Vorschau; Mehrfachauswahl ändert alle gewählten Linien in einem Undo-Schritt), Ressourcen > Modelldarstellung (Schnitt- und Ansichtsmarken). Tests: Rust `misc::darstellung_varianten`, `ansicht_zeichen_und_linie`, `context::schnittlinie_varianten_im_grundriss`, `schnittlinie_linientyp_und_stift`, `ansichtslinie_varianten`; vitest `SectionLookFields.test.ts`; e2e `sectionLook276.spec.ts`. Bilder: `doc/review-276/`. **Offen:** nicht in der Tauri-App/auf dem Mac geprüft (nur CLI-SVG in Chromium und Browser-Build); Linientyp/Stift in der Modelldarstellung wählbar machen (dynamische Werte); Marke „Kreis mit Pfeil“ für Ansichten; Marken-Versatz wie bei Archicad (Symbol unabhängig von der Schnittlinie verschieben) · S.
|
||||
- ◐ **[271]** Umbaufilter wie Archicad (Wunsch Maintainer 17.11.). **Modell:** `renovation: {status: existing|demolish|new, phase?}` an Wand, Öffnung (ohne eigenen Status folgt sie der Wand), Decke, Dach, Treppe, Stütze, Körper und Raum (Raum nur Sichtbarkeit/Flächen, keine Farbe — kein Bauteil); `Project.renovation` (Etappen, Farben, eigene Filter); `DrawingLevel`/`ViewTemplate`/`ViewSnapshot.renovationFilter`+`renovationPhase` (der Filter gehört zur Ebene wie die Modelldarstellung [173], damit je Reiter/Ausschnitt/Vorlage). **Kern** `renovation.rs` (ein Ort, `doc/ARCHITEKTUR.md` 3.8): Vorgaben Bestand/Abbruch/Neubau/Umbauplan/Endzustand, SIA-400-Farben (Bestand grau, Abbruch gelb gestrichelt, Neu rot, anpassbar), Etappen „bis n“ (Neues früherer Etappen = Bestand, Abbruch früherer weg, spätere Neue fehlen), Öffnung neu in Bestandswand = Abbruch-Stück bzw. zugemauerte Öffnung = Ausfachung (Wand zu, wo die Öffnung ausgeblendet ist). Umbau-Farben bleiben auch in Tusche (Schwarz-Weiss, `extras::KeepColors`); gefüllt werden nur Schnittflächen (Wand, Stütze), Symbole (Fenster, Türflügel, Tritte) nur in Linienfarbe. Angebunden: Grundriss, Schnitt, Ansicht, Vektor-Axo, 3D-Fenster (Filter der aktiven Ebene) und `model3d`, Kennzahlen/Flächen (Zustand Bestand/Endzustand im Panel), DXF (Layer `<Klasse>_Abbruch`/`_Neu`), IFC (`Status` NEW/EXISTING/DEMOLISH im `Pset_*Common`, Etappe in `Dossier_Umbau`). **Bedienung:** Objekt-Info/Objekteinstellungen „Umbau“ + „Etappe“ (Mehrfachauswahl, ein Undo-Schritt), Statusleiste „Umbau: …“ (Zeichen-Status neuer Bauteile, Vorgabe Bestand, Kern `commands::stamp_renovation`; Umbaufilter und Etappe der Ansicht; mit der Pausfolie im Überlauf „⋯“), Befehl `umbau` (B/A/N; die Befehlszeile nimmt getippte Options-Kürzel jetzt auch mit Enter an, `engine.ts`), Ressourcen-Tab „Umbau“ (Etappen, Farben), Vorlage „Beispiel Umbau“ (`model/sampleProjectUmbau.ts`, CLI `:umbau`), CLI `--renovation`/`--phase` (plan, section, elevation, axo, model3d, kennzahlen). Tests: Kern `renovation_tests.rs` (19), Robustheit, vitest `model/renovation.test.ts`, `commands/cmds/renovation.test.ts`, e2e `renovation271.spec.ts` (2× grün, Port 5195; dazu `uxReview263`, `objectSettings`, `modelViews`, `release10`, `editing` grün); Bilder `doc/review-271/` (CLI-SVG `--hatch` in Chromium, App-Screenshot). **Offen:** 3D-Fenster nur im Code angebunden (Kern-Teile per Test geprüft, Bild nicht angesehen: kein render3d unter Linux); Blender-Paket ohne Umbau-Farben (nur Ausblenden); Ansichtsleiste/Werkzeugleiste ohne eigene Filter-Wahl (Statusleiste und Panel Umbau); eigene Filter nur im Modell (keine Bearbeitung in der Oberfläche); Tauri/Mac nicht geprüft (Prüfschritt `doc/RELEASE-1.0.md` 13.37). **Nachtrag 17.11. (Panel):** eigenes Dock-Panel „Umbau“ (`panels/RenovationPanel.tsx`, Reiter rechts oben neben Objekt-Info/Flächenbilanz, Layout v16): Zeichen-Status Bestand/Abbruch/Neu mit SIA-Farbmuster + Etappe, Umbaufilter der aktiven Ansicht als Liste mit Vorschau je Status (wie gezeichnet/ausgeblendet/Umbau-Farbe) + „bis Etappe“, Status der Auswahl (gemischt-Marke) mit Setzen und Etappe (ein Undo-Schritt), „Nach Status wählen“ (Geschoss), Etappenliste (anlegen, umbenennen, Reihenfolge, Löschen mit Rückfrage über `ui/ConfirmDialog`, Verweis auf die Farben in den Ressourcen). Statusleisten-Popover und Objekt-Info teilen Zustand und Aktionen mit dem Panel (`state/renovationHook.ts`, keine Doppelspur) und lesen nur schmale Teile des Projekts: behebt die 45 Renders je Wand-Änderung in `renderCount.spec.ts` (jetzt 42, Grenze unverändert; `RenovationField` ist `memo`). Filter-Vorschau der eingebauten Filter spiegelt `renovation::builtin` in `model/renovation.ts` (vitest prüft gegen den Plan des Kerns; sauberer wäre, die Anteile in `filter_list` mitzuliefern). Tests: vitest `model/renovation.test.ts` (+3), e2e `renovationPanel271.spec.ts` (Port 5193); Bild `doc/review-271/05-panel-umbau.png`. Nicht geprüft: Tauri/Mac. **Offen:** Panel-Bild nur hell/1280×800 angesehen (dunkel ebenfalls ok, schmale Leiste nicht eigens). **Nachtrag 17.11. (Exporte und Rendering folgen der Ansicht, mit [272]):** neue gemeinsame Ansicht `export/exportView.ts` (`levelExportView` = Umbaufilter, Etappe und Variantenkombination der aktiven Ebene; `exportViewText` = Text der Kern-Abfragen, `renovation::view_from_text`), die EIN Weg für IFC (`exportIfcSpf({view})`), OBJ/STL/glTF (`MeshOptions.view`), STEP (`exportProjectStep(…, view)`), Blender-Paket (`RenderOptions.view`) und Cycles-Szene ist. Ausgeblendetes fehlt dort; die Cycles-Szene malt Umbau-Farben nur auf Wunsch (Option `renovationColors`, `cycles_scene_styled`; Vorgabe Materialfarben). App: Export-Dialog (IFC, OBJ, STL, glTF, STEP) und Rendering-Dialog zeigen die Ansicht der aktiven Ebene („Umbau: …“, „Variante: …“) und lassen „Hauptvarianten/kein Filter“ wählen; Rendering mit Cycles hat das HäkchenLine truncated
|
||||
- ◐ **[274]** Umbau je Schicht: Sanierung mehrschichtiger Bauteile (Feedback Maintainer 17.11., typbasiert nach Rückfrage). **Modell:** `WallType.renovationTarget` (Sanierungstyp), `renovationSide` (Bezugsseite innen/aussen), `renovationOld`/`renovationNew` (manuelle Zuordnung je Schicht, Vorgabe „auto“); Wand `renovation.renovated` (nutzt den Sanierungstyp ihres Typs) bzw. `renovation.newTypeId` (Ausnahme); wirkt nur beim Status Bestand, Etappe = `renovation.phase`; ohne Umbaufilter gilt der Bestandstyp. **Kern** `renovation::build_up` (ein Ort, `doc/ARCHITEKTUR.md` 3.8): Zuordnung von der Bezugsseite her (gleicher Baustoff + Dicke + Lage = Bestand, nur alt = Abbruch, nur neu = Neu; manuell überschreibbar, weil z. B. ein ersetzter Baustoff gleicher Dicke sonst als Bestand gälte; das automatisch gepaarte Gegenstück folgt), gezeigter Aufbau je Filter (Abbruch sichtbar ⇒ alt, Neu sichtbar ⇒ neu, beide ⇒ überlagert in Teilschichten), Ersatzwand mit Ersatztyp und Achsversatz (Bezugsseite bleibt stehen, Achse bleibt) für Grundriss, Schnitt, Ansicht, Axo, 3D, Kennzahlen/GF, IFC-Schichten; Farben je Schicht (Grundriss über die Schicht-Aktionen [33], Kanten der Abbruch-Schichten gestrichelt, im Umbauplan Abbruch als gelbe gestrichelte Kontur über der roten Füllung; Schnitt je Schnittfläche; Ansicht/Axo/3D Farbe der äussersten Schicht); Öffnungsleibungen folgen dem gezeigten Aufbau. Abfragen `renovationPair`/`renovationPairs`. **Bedienung:** Objekt-Info/Objekteinstellungen „Neuer Aufbau (Sanierung)“ (keiner / wie Typ / anderer Wandtyp; Mehrfachauswahl ein Undo-Schritt) mit Streifen Alt/Neu/Ergebnis in SIA-Farben (`ui/RenovationStrip.tsx`); Umbau-Panel Abschnitt „Sanierung“ (`panels/RenovationSanierung.tsx`): Zähler „Sanierte Bauteile“, Typ-Paare mit „x von n Wänden saniert“, „Alle Wände vom Typ sanieren“ (ein Undo-Schritt), „Sanierungstyp anlegen …“ (Kopie des Bestandstyps), Typ-Paar-Editor (Alt/Neu nebeneinander, Zuordnung je Schicht, Bezugsseite, Ergebnis-Streifen). Status/Etappe setzen und Etappe löschen behalten die Sanierung. Beispiel Umbau: Südwand W1 Beton 20 + Dämmung 10 + Putz → Dämmung 20 + Putz (Etappe 1), neuer Schnitt C durch die Wand. Tests: Kern `renovation_layers_tests.rs` (11: Zuordnung inkl. gleicher Baustoff andere Dicke, vertauscht, Bezugsseite aussen, manuell, NaN/leer/fehlender Typ; Grundriss und Schnitt je Filter; Kennzahlen je Zustand; Öffnung; 3D/Ansicht; Umstellen idempotent; Abfragen), vitest `model/renovationLayers.test.ts`, e2e `renovation274.spec.ts` (2× grün, Port 5195; dazu `renovation271`, `renovationPanel271`, `objectSettings`, `renderCount` 2× grün, Renders je Wand-Änderung 43 bei unveränderter Grenze); Bilder `doc/review-274/` (CLI-SVG `--hatch` Grundriss 1:50/1:100 und Schnitt C in allen fünf Filtern, Chromium; App-Screenshots Feld und Panel). **Offen:** Decken und Dächer ohne Sanierung je Schicht (Modell-Felder nur am Wandtyp); Bogenwände ohne gestrichelte Abbruch-Kanten (Füllung je Schicht ja); im Schnitt Abbruch-Kontur schwarz gestrichelt statt gelb, Aussenkante der Abbruch-Schicht unter der schweren Schnittkante durchgezogen (wie [271]); 3D/Ansicht nur Farbe der äussersten Schicht (Teile je Schicht im 3D wären möglich), 3D-Bild nicht angesehen; IFC: Endzustand-Aufbau als Materialschichten über die Ersatzwand (Weg wie Kennzahlen, nicht eigens geprüft), kein Status je Schicht als Eigenschaft; DXF: Schichten nicht auf eigenen Umbau-Layern (Wand-Layer nach Wand-Status); Instanz-Schichtliste (eigene Schichten je Wand) bewusst nicht, nur anderer Typ als Ausnahme; Achse auf der bewegten Seite bei dünnerem neuem Aufbau bleibt in der Wand (Bezugsseite verschiebt sich dann); Tauri/Mac nicht geprüft (Prüfschritt `doc/RELEASE-1.0.md` 13.39). **Zusammenführung mit [271]-Rest (17.11.):** sanierte Wände zeigen auch die Projektionslinien des Schnitts in der Farbe ihrer äussersten Schicht (`CutRules::edge` über `Resolved::faces`); die Ersatzstücke der Öffnungen in Schnitt und Ansicht rechnen aus dem Projekt mit allem, aber mit dem gezeigten Aufbau (`renovation::apply` ohne Ausgeblendetes); Beispiel `:umbau` vereint Südwand W1/Schnitt C mit Möbeln, Bäumen und Ansicht West. · M
|
||||
- ◐ **[274]** Umbau je Schicht: Sanierung mehrschichtiger Bauteile (Feedback Maintainer 17.11., typbasiert nach Rückfrage). **Modell:** `WallType.renovationTarget` (Sanierungstyp), `renovationSide` (Bezugsseite innen/aussen), `renovationOld`/`renovationNew` (manuelle Zuordnung je Schicht, Vorgabe „auto“); Wand `renovation.renovated` (nutzt den Sanierungstyp ihres Typs) bzw. `renovation.newTypeId` (Ausnahme); wirkt nur beim Status Bestand, Etappe = `renovation.phase`; ohne Umbaufilter gilt der Bestandstyp. **Kern** `renovation::build_up` (ein Ort, `doc/ARCHITEKTUR.md` 3.8): Zuordnung von der Bezugsseite her (gleicher Baustoff + Dicke + Lage = Bestand, nur alt = Abbruch, nur neu = Neu; manuell überschreibbar, weil z. B. ein ersetzter Baustoff gleicher Dicke sonst als Bestand gälte; das automatisch gepaarte Gegenstück folgt), gezeigter Aufbau je Filter (Abbruch sichtbar ⇒ alt, Neu sichtbar ⇒ neu, beide ⇒ überlagert in Teilschichten), Ersatzwand mit Ersatztyp und Achsversatz (Bezugsseite bleibt stehen, Achse bleibt) für Grundriss, Schnitt, Ansicht, Axo, 3D, Kennzahlen/GF, IFC-Schichten; Farben je Schicht (Grundriss über die Schicht-Aktionen [33], Kanten der Abbruch-Schichten gestrichelt, im Umbauplan Abbruch als gelbe gestrichelte Kontur über der roten Füllung; Schnitt je Schnittfläche; Ansicht/Axo/3D Farbe der äussersten Schicht); Öffnungsleibungen folgen dem gezeigten Aufbau. Abfragen `renovationPair`/`renovationPairs`. **Bedienung:** Objekt-Info/Objekteinstellungen „Neuer Aufbau (Sanierung)“ (keiner / wie Typ / anderer Wandtyp; Mehrfachauswahl ein Undo-Schritt) mit Streifen Alt/Neu/Ergebnis in SIA-Farben (`ui/RenovationStrip.tsx`); Umbau-Panel Abschnitt „Sanierung“ (`panels/RenovationSanierung.tsx`): Zähler „Sanierte Bauteile“, Typ-Paare mit „x von n Wänden saniert“, „Alle Wände vom Typ sanieren“ (ein Undo-Schritt), „Sanierungstyp anlegen …“ (Kopie des Bestandstyps), Typ-Paar-Editor (Alt/Neu nebeneinander, Zuordnung je Schicht, Bezugsseite, Ergebnis-Streifen). Status/Etappe setzen und Etappe löschen behalten die Sanierung. Beispiel Umbau: Südwand W1 Beton 20 + Dämmung 10 + Putz → Dämmung 20 + Putz (Etappe 1), neuer Schnitt C durch die Wand. Tests: Kern `renovation_layers_tests.rs` (11: Zuordnung inkl. gleicher Baustoff andere Dicke, vertauscht, Bezugsseite aussen, manuell, NaN/leer/fehlender Typ; Grundriss und Schnitt je Filter; Kennzahlen je Zustand; Öffnung; 3D/Ansicht; Umstellen idempotent; Abfragen), vitest `model/renovationLayers.test.ts`, e2e `renovation274.spec.ts` (2× grün, Port 5195; dazu `renovation271`, `renovationPanel271`, `objectSettings`, `renderCount` 2× grün, Renders je Wand-Änderung 43 bei unveränderter Grenze); Bilder `doc/review-274/` (CLI-SVG `--hatch` Grundriss 1:50/1:100 und Schnitt C in allen fünf Filtern, Chromium; App-Screenshots Feld und Panel). **Offen:** Bogenwände ohne gestrichelte Abbruch-Kanten (Füllung je Schicht ja); im Schnitt Abbruch-Kontur schwarz gestrichelt statt gelb, Aussenkante der Abbruch-Schicht unter der schweren Schnittkante durchgezogen (wie [271]); 3D/Ansicht nur Farbe der äussersten Schicht (Teile je Schicht im 3D wären möglich), 3D-Bild nicht angesehen; IFC: Endzustand-Aufbau als Materialschichten über die Ersatzwand (Weg wie Kennzahlen, nicht eigens geprüft), kein Status je Schicht als Eigenschaft; DXF: Schichten nicht auf eigenen Umbau-Layern (Wand-Layer nach Wand-Status); Instanz-Schichtliste (eigene Schichten je Wand) bewusst nicht, nur anderer Typ als Ausnahme; Achse auf der bewegten Seite bei dünnerem neuem Aufbau bleibt in der Wand (Bezugsseite verschiebt sich dann); Tauri/Mac nicht geprüft (Prüfschritt `doc/RELEASE-1.0.md` 13.39). **Zusammenführung mit [271]-Rest (17.11.):** sanierte Wände zeigen auch die Projektionslinien des Schnitts in der Farbe ihrer äussersten Schicht (`CutRules::edge` über `Resolved::faces`); die Ersatzstücke der Öffnungen in Schnitt und Ansicht rechnen aus dem Projekt mit allem, aber mit dem gezeigten Aufbau (`renovation::apply` ohne Ausgeblendetes); Beispiel `:umbau` vereint Südwand W1/Schnitt C mit Möbeln, Bäumen und Ansicht West. **Nachtrag 17.11. (Decken und Dächer, IFC):** Sanierung je Schicht auch für Decken und Dächer, gleicher Kern-Code wie bei den Wänden (Trait `build_up::Layered` für Wand-/Decken-/Dachtyp, `type_pair_in`, `look_core`; `ceiling_look`/`roof_look` in `Resolved::slabs`, Umstellen in `swap_build_ups` mit Marke `~renovationOrigin`). **Modell:** `CeilingType`/`RoofType` mit `renovationTarget`/`renovationSide`/`renovationOld`/`renovationNew`; Decke/Dach `renovation.renovated`/`newTypeId` wie die Wand. Bezugsseite Decke innen = unten (Rohdecke bleibt, die Oberkante verschiebt sich), aussen = oben; Dach innen = Tragwerk bleibt, die Dachhaut hebt sich (Traufhöhe + Dickendifferenz / cos Hauptneigung). **Darstellung:** Schnitt je Schicht (`CutRules::with_renovation` für Slab/Roof), 3D je geschichteter Deckenplatte (Dach: Line truncated
|
||||
- ◐ **[275]** Umbau-Farben als Farbe oder Stift, gedämpfte Vorgabe, eigene Farben je Etappe (Wunsch Maintainer 17.11.: „eine Farbe oder ein Stift … weniger leuchtendes Gelb und Rot“). **Vorgabe** (`renovation::default_style`, Konstanten `DEMOLISH_FILL`/`NEW_FILL`/`NEW_LINE`): Abbruch ruhiges Ocker-Gelb `#e8c35a` (statt `#ffd800`), Neu gedämpftes Ziegelrot `#c8524a`, Linie `#9e3a33` (statt `#e3001b`/`#c00016`), Bestand `#a6a6a6` unverändert; gilt überall über `renovation::style` (Plan, Schnitt, Ansicht, Axo, 3D, Cycles-Umbaufarben, Panel/Statusleiste; CSS über `--reno-*`). **Modell:** `RenovationStyle.fillPen`/`linePen` (ColorPen-Id; Farbe aus dem aktiven Stiftsatz, beim Lesen aufgelöst, nicht eingebacken — S/W-Stiftsatz färbt den Umbauplan um; Stift ohne Eintrag ⇒ freie Farbe/Vorgabe), `RenovationPhase.styles` (eigene Farben der Etappe über der Projektfarbe; `View::treat` nimmt sie, solange das Element seinen eigenen Status zeigt, Ersatzstücke nach der Etappe ihrer Öffnung). Abfrage `renovationStyles` (Vorgabe/Projekt/Etappen aufgelöst) — die Oberfläche rechnet keine Farben mehr selbst (`DEFAULT_RENOVATION_STYLES` in TS entfernt). `project_refs` prüft die Stifte. **Oberfläche:** gemeinsamer Editor `ui/RenovationStyleEditor.tsx` (je Status Füllung/Linie mit dem `PenColorField` der App: Frei/Stift, „gestrichelt“, Zurücksetzen) im Umbau-Panel (Abschnitt „Darstellung“ mit Knopf „SIA-Vorgabe“; je Etappe Farbmuster-Knopf mit eigenem Editor und „Farben des Projekts verwenden“) und im Ressourcen-Tab „Umbau“ (ersetzt die `input type=color`); Ops `setRenovationStylesOps`/`setPhaseStylesOps`/`patchRenovationStyles` (Farbe und Stift schliessen sich aus). Beispiel `:umbau`: Etappe 2 (Anbau) Neu gedämpft blau `#5b84b1`. Tests: Kern `renovation_style_tests.rs` (6: Vorgabe, Stift + Stiftsatz-Wechsel, Etappe inkl. „bis Etappe“, Ersatzstück, Unsinn, Abfrage), vitest `model/renovationStyles.test.ts` (4), e2e `renovationStyles275.spec.ts` (Port 5196); Bilder `doc/review-275/` (CLI-SVG `--hatch` Grundriss EG 1:50 und Schnitt C vorher/nachher, Etappe 2 blau; App-Panel hell/dunkel). **Offen:** dünnes Strichwerk im Abbruch (Möbel, Baum „zu fällen“) bleibt auf weissem Papier blass (Linie = Füllfarbe; mit eigener Abbruch-Linie z. B. dunklem Ocker kräftiger, dann aber auch die Wandkontur ocker statt schwarz gestrichelt — bewusst nicht als Vorgabe); Etappen-Farben nur für Neu/Abbruch in der Oberfläche (Modell kennt auch Bestand); Stift-Strichstärke wirkt nicht (nur Farbe); Tauri/Mac und 3D-Fenster (render3d) nicht angesehen. · S
|
||||
- ◐ **[269]** Pläne schöner, Befunde aus Screenshots des Koordinators (16.11.; CLI `plan|section|elevation --hatch --template "Eingabeplan 1:100"`, SVG → Chromium; Bilder vorher/nachher `doc/review-269/`). **Behoben 17.11.:** (1) **Ausschnitt mit Parzelle:** das Plan-Ausmass endet bei Parzelle + 5 m (`SITE_MARGIN_M`) vereinigt mit Haus ± Marken-Reichweite und den nicht weitreichenden Zeichnungen (Titel, Massstab, Bemassung; Kataster/Strassen/Höhenlinien/Bäume/Kontext-Klassen zählen nicht, `drawings::is_far_class`); keine Beschneidung im Situationsplan und bei sichtbarem Schatten (`extras::site_clip`, in beiden Puffer-Wegen von `domains.rs`). Wettbewerb EG 1:200: SVG 85 × 54.9 m → 46 × 37.9 m; Musterhaus komplex EG 99 × 63.6 → 55 × 46.6 m. Layout-Viewports/Plakat croppen schon über [208] (`crop`, Haus + 20 mm) und ändern sich praktisch nicht; Einpassen beim Öffnen nutzt `house`. Die Linien ausserhalb bleiben im SVG (werden von der viewBox abgeschnitten), nicht geometrisch gekappt. (2) **Gartenkörper:** Brunnen, Loft, Rotationskörper im Musterhaus komplex lagen auf „20 Wände“, jetzt Klasse „24 Fahrzeuge & Freiflächen“ (`GARDEN_CLASS`) — in Grundriss, Schnitt und Ansicht ausschaltbar. Die Vorlage „Eingabeplan 1:100“ blendet 24 NICHT aus (würde auch Parkfelder/Fahrzeuge im Grundriss ausblenden; fachlicher Entscheid offen für den Maintainer); im Nachher-Bild `--hide …,24`. Der Standard für neue freie Körper bleibt die aktive Klasse. (3) **Dachziegel/Ansichtsschraffur:** Musterlinien in der Ansicht nie enger als 2.5 mm Papier (`PATTERN_MIN_PAPER_MM`, dünnt bei 1:100 und 1:200 gleich aus, vorher 0.7 mm), Standardstärke 0.05 statt 0.1 mm (höchstens 0.09), Vorgabefarbe unverändert. (4) **Hinweistext:** im Beispiel jetzt im Wohnraum über der Hebeschiebetür mit kurzer Führungslinie; Führungslinien setzen vor Masszahlen, Texten und Koten aus (`cut_at_gaps`, mit Wächter gegen Rekursion in der Hindernisberechnung — erste Fassung stürzte im WASM mit Stack-Überlauf ab, im nativen Test nicht); Titel „Erdgeschoss“ und Massstabsbalken rücken ans Haus. Tests: Rust `ausmass_endet_an_parzelle_plus_rand`, `fuehrungslinie_setzt_vor_masszahlen_aus`, `ansichtsschraffur_massstabsgerecht_und_fein`; Goldens `komplex-ansicht-ansicht-sued`, `komplex-grundriss-eg-100/-50` (Hinweis/Titel/Massstab verschoben, Ansichtsschraffur dünner und seltener). **Offen:** Ausschnitt nur Linux/CLI angesehen (nicht in der App/Metal), Beschriftung am Rand (z. B. „Kat.-Nr. 1188“) kann angeschnitten sein; Schnitt/Ansicht-Ausmass nicht beschnitten (Gelände); Eingabeplan-Klasse 24 s. o.; Stossfugen-Muster (Läuferverband) in der Ansicht nicht eigens geprüft. · S
|
||||
- ◐ **[268]** Review der Änderungen vom 15./16.11. auf echte Fehler vor der Beta (16.11.; [256] [260] [261] [262] [263] [264] [265] [266] [267] [170] [30]). **Behoben 16.11.:** (1) **Datenverlust nach Sprachwechsel** ([264] `LanguageRoot` baut die App neu auf): zuletzt gespeicherter Stand, Pfad, Lock und Autosave-Stand lagen in `useRef` von `useProjectFileActions` und wurden zurückgesetzt — danach galten ungespeicherte Änderungen als gespeichert, Neu/Öffnen/Fenster schliessen verwarfen sie ohne Rückfrage, Cmd+S fragte neu nach dem Pfad, der Lock der offenen Datei blieb liegen; zudem erschien die Autosave-Kopie der laufenden Sitzung als „Ungesicherte Arbeit gefunden“. Jetzt Sitzungszustand ausserhalb von React (`FileSession`), Suche nach Kopien einmal je Seitenladen; e2e `languageSwitch268.spec.ts` (vorher rot, beide Fälle). (2) **Release-Skript** (`scripts/release-gitea.mjs`): jeder Fehler beim Lesen von `versions.json` (Netz, 5xx, Proxy) galt als „leer“ — `--publish` überschrieb den Versionsverlauf mit nur der neuen Version; ein nicht lesbares `SHA256SUMS.txt` der anderen Plattform fiel stillschweigend aus den Prüfsummen. Jetzt nur 404 = leer, sonst Abbruch (`fetchExisting`, `parseSums` in `release-gitea-lib.cjs`, Test `releaseGitea.test.ts`). **Offen (Verdacht ohne Nachweis, Befund · Ort · Szenario · Grösse):** ~~a.~~ **Behoben 16.11. (Electron-Links):** `setWindowOpenHandler` (nie ein Kindfenster; https/mailto → `shell.openExternal`, sonst verwerfen), `will-navigate`/`will-redirect` nur im App-Ursprung (`dossier://app`, Dev-Server `localhost:5187`; fremdes https → System-Browser), CSP in `onHeadersReceived` nur für den App-Ursprung; Entscheide als reine Funktionen in `scripts/electron-links.cjs` (im Paket, `electron-builder.yml`), Test `src/native/electronLinks.test.ts` und e2e `linuxApp170.spec.ts` („Externe Links“: `window.open`/Navigation erzeugen kein Fenster, `shell.openExternal` im Hauptprozess abgefangen; mit gebautem AppImage grün). `openExternalUrl` (Fehler melden, Blender laden) nutzt unter Electron `window.open` und landet damit im System-Browser, keine App-Änderung nötig. Offen: Tauri/Mac unberührt (dort `plugin-shell`), echter Browser-Start nicht geprüft (nur Hook). b. Sprachwechsel setzt weiteren UI-Zustand zurück: Fang-Einstellungen (`useDrawingToolState`, `DEFAULT_SNAP`), aktives Werkzeug, laufender Befehl, Element-Zwischenablage (`useSelectionState`), offene Dialoge ausser Einstellungen · kein Datenverlust, aber z. B. ausgeschalteter Ortho-Fang ist danach wieder an · S. ~~c.~~ **Behoben 16.11.:** `uploadAsset` lädt beim Ersetzen erst unter `<name>.upload-<ms>` hoch, löscht dann den alten Anhang und benennt per PATCH um (`latest.json` fehlt nie; Rest `.upload-…` bei Abbruch in Gitea löschen; gegen echte Gitea-API nicht geprüft, nur `--dry-run`). ~~d.~~ **Behoben 16.11.:** ohne `--publish` auf ein veröffentlichtes Release Abbruch, bewusst mit `--replace-published` (`preflight` in `release-gitea-lib.cjs`, läuft vor dem Anlegen des Entwurfs). ~~e.~~ **Behoben 16.11.:** `--publish` ohne Mac-Pakete (weder im Ordner noch am Release) bricht ab, bewusst nur Linux mit `--linux-only`; Tests `releaseGitea.test.ts`, README „Release auf Gitea“ nachgeführt. **Geprüft ohne Befund:** `elevation_set.rs` (Faltung, Namen, vorhandene Seiten), `kernel2d/src/rooms.rs` (Offset je Kante, NaN), `standards_names.rs`/Standards-Abgleich (kein Duplikat, „Aktualisieren“ hält englische Namen), `stamp_place.rs` `cut_out` (NaN ohne Panic), [262] Offline-Pfade und Host-/CSP-Listen (Overpass, http-Fähigkeit Gitea), [261] `build-number.cjs`, Kurzanleitung (`miniMarkdown` ohne HTML), Dock-Einklappen (`reconcileLayout`), Electron-Argumentdatei (`take-open-file` einmalig). Nicht geprüft: Mac/Tauri, Electron-Paket, GPU-Renderer über mehrere Sprachwechsel (Speicher), [216] Erker und [208] DXF-MTEXT im Detail.
|
||||
|
||||
@@ -509,6 +509,14 @@ Farben je Schicht im Grundriss über die Schicht-Aktionen (`WallLook::layer_acti
|
||||
(Typ-Paare, Editor, „Alle Wände vom Typ sanieren“); Kern-Abfragen `renovationPair`, `renovationPairs`. Mit den Ersatzstücken
|
||||
([271]): `orig` in Schnitt und Ansicht ist das Projekt mit allem, aber mit den gezeigten Aufbauten (`apply` ohne Ausgeblendetes);
|
||||
Projektionslinien sanierter Wände in der Farbe der äussersten Schicht (`CutRules::edge` über `Resolved::faces`).
|
||||
**Decken und Dächer** (gleicher Code, Trait `build_up::Layered` für Wand-, Decken- und Dachtyp; `type_pair_in`, `look_core`):
|
||||
`CeilingType`/`RoofType` tragen dieselben Felder, `ceiling_look`/`roof_look` liefern denselben `WallLook` (in `Resolved::slabs`);
|
||||
Bezugsseite bei Decken innen = unten (Rohdecke bleibt, die Oberkante verschiebt sich: `WallLook::level` = neue OK), aussen = oben;
|
||||
bei Dächern innen = Tragwerk bleibt, die Dachhaut hebt sich (neue Traufhöhe, Dickendifferenz / cos Hauptneigung). `swap_build_ups`
|
||||
stellt Decke/Dach auf einen Ersatz-Decken- bzw. -Dachtyp um (Marke `~renovationOrigin` mit Typ, Dicke, OK/UK bzw. Traufhöhe).
|
||||
Farben: Schnitt je Schicht (`CutRules::with_renovation`, Kind Slab/Roof), 3D je geschichteter Platte (`color_parts` über
|
||||
`SlabSource::Ceiling.layer`; Dächer: oberste Schicht), Grundriss-Linien, Ansicht und Axo in der Farbe der obersten Schicht
|
||||
(`Resolved::element_style`/`faces`).
|
||||
|
||||
|
||||
### 3.9 Varianten ([272])
|
||||
|
||||
@@ -181,6 +181,7 @@ und Befunde in `TODO.md` eintragen.
|
||||
| 13.37 | **Umbau ([271]):** *Datei → Neu aus Vorlage: Beispiel Umbau*; Statusleiste „Umbau“ → Umbaufilter nacheinander Bestand, Abbruch, Neubau, Umbauplan, Endzustand (Erdgeschoss, dann Schnitt A); Wand W9 wählen, Objekt-Info „Umbau“ auf Neu, ⌘Z; Zeichen-Status Neu, eine Wand zeichnen; Flächenbilanz „Zustand“ Bestand/Endzustand; PDF und DXF des Umbauplans | Bestand ohne Anbau und neues Fenster (Westwand zu); Abbruch: Zwischenwand gelb gestrichelt, gelbes Stück im neuen Fenster; Neubau: Anbau und neue Tür rot, Nordfenster rot zugemauert; Umbauplan alle drei Farben; Endzustand ohne Farben; Schnitt gleich; neue Wand rot im Umbauplan; ⌘Z nimmt die Status-Änderung in einem Schritt zurück; GF im Endzustand grösser; DXF mit Layern „…_Abbruch“/„…_Neu“; am Bildschirm (Metal) wie im PDF |
|
||||
| 13.38 | **Varianten ([272]):** *Datei → Neu aus Vorlage: Beispiel Varianten*; Knopf „Variante“ in der Statusleiste → Panel „Varianten“; Kombination Fassade B, dann Dachform B (Erdgeschoss, Schnitt A, Ansicht Süd, 3D); Wand W1 wählen, „Zuweisen“ zu Fassade: B, ⌘Z; Satz hinzufügen; „Vergleich öffnen“ und „Vergleich als CSV“; Blatt mit zwei Viewports desselben Ausschnitts, einer mit Dachform B; „Übernehmen“ bei Dachform B, ⌘Z; PDF/DXF/IFC in Kombination B; im IFC-Export-Dialog „Variante: …“ lesen, Häkchen aus und wieder an; Rendering (Cycles) in Studie 2 mit 8 Samples, bei Umbaufilter „Umbauplan“ mit „Umbau-Farben im Bild“ | Fassade B: Bandfenster statt Nordfenster; Dachform B: Satteldach statt Flachdach in Schnitt, Ansicht und 3D; ⌘Z nimmt Zuweisen bzw. Übernehmen in einem Schritt zurück; Vergleich mit 4 Zeilen, GV und Kosten bei Satteldach höher; zweiter Viewport mit Titelzusatz „Dachform B Satteldach“; Exporte zeigen nur die gewählte Variante; Dialoge nennen Umbaufilter und Variante der Ansicht, ohne Häkchen gelten Hauptvarianten und alles; Rendering ohne ausgeblendete Elemente, Umbau-Farben nur mit Häkchen |
|
||||
| 13.39 | **Sanierung je Schicht ([274]):** *Datei → Neu aus Vorlage: Beispiel Umbau*; Panel Umbau → „Sanierung“, „Zuordnung bearbeiten“ beim Typ „Aussenwand Beton 20 + Dämmung 10 (Bestand)“; Umbaufilter Bestand, Abbruch, Neubau, Umbauplan, Endzustand im Erdgeschoss (1:50 und 1:100), Schnitt C (durch die Südwand) und Ansicht Süd; Südwand wählen, Objekt-Info „Neuer Aufbau (Sanierung)“ auf „keiner“, ⌘Z; beim Typ „Aussenwand 34.5 cm“ „Sanierungstyp anlegen …“, Dämmung der Kopie auf 20 cm, „Alle Wände vom Typ sanieren“, ⌘Z; Flächenbilanz Bestand/Endzustand | Streifen Alt/Neu/Ergebnis: Beton grau, Dämmung/Putz alt gelb, neu rot; Bestand: alte Wand ohne Farbe; Abbruch: Putz und Dämmung gelb gestrichelt; Neubau: Wand 10 cm dicker nach aussen, Innenseite bündig, neue Schichten rot; Umbauplan: Beton grau, Neu rot, gelbe gestrichelte Kontur der alten Dämmung darin; Endzustand ohne Farben; Fensterleibung der Südwand folgt dem Aufbau; ⌘Z je ein Schritt; GF im Endzustand grösser; am Bildschirm (Metal) wie im PDF |
|
||||
| 13.39b | **Sanierung je Schicht: Decke und Dach ([274]):** *Beispiel Umbau*; Decke über dem EG und Dach wählen, Objekt-Info „Neuer Aufbau (Sanierung)“ = „wie Typ“, Streifen; Panel Umbau → „Sanierung“: Abschnitte Wände/Decken/Dächer, Decke „Zuordnung bearbeiten“, Bezugsseite unten/oben umstellen, ⌘Z; Schnitt C in Bestand, Abbruch, Neubau, Umbauplan, Endzustand; 3D-Fenster im Umbauplan; IFC-Export (Endzustand) in einem IFC-Viewer: Eigenschaften `Dossier_Umbau` der Decke | Decke: Beton grau, Belag/Unterlagsboden/Trittschall alt gelb, neu rot (Umbauplan überlagert mit gelber gestrichelter Kontur); Dach: Sparren und Verkleidung grau, Ziegel alt gelb, Aufsparrendämmung und Ziegel neu rot, Dachhaut im Neubau/Endzustand höher; 3D: Deckenschichten je Farbe, Dach in der Farbe der Eindeckung; IFC: `SchichtenBestand`/`SchichtenSanierung` mit EXISTING/DEMOLISH/NEW |
|
||||
|
||||
## 14. Datensicherheit auf dem Mac ([116], Audit 14.11.)
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 90 KiB |
@@ -43,9 +43,10 @@ test("Sanierung je Schicht: Feld, Typ-Paar, alle sanieren ([274])", async ({ pag
|
||||
await openTab(page, "Umbau");
|
||||
const panel = page.getByTestId("renovation-dock");
|
||||
const san = panel.getByTestId("reno-sanierung");
|
||||
await expect(san.getByTestId("reno-sanierung-count")).toHaveText("Sanierte Bauteile: 1");
|
||||
await expect(san.getByTestId("reno-pair")).toHaveCount(1);
|
||||
await san.getByTestId("reno-pair-edit").click();
|
||||
// Südwand W1, Decke C1, Dach RF1.
|
||||
await expect(san.getByTestId("reno-sanierung-count")).toHaveText("Sanierte Bauteile: 3");
|
||||
await expect(san.getByTestId("reno-pair")).toHaveCount(3);
|
||||
await san.getByTestId("reno-pairs-wall").getByTestId("reno-pair-edit").click();
|
||||
const ed = san.getByTestId("reno-pair-editor");
|
||||
await expect(ed).toBeVisible();
|
||||
await expect(ed.getByTestId("reno-pair-old-layer")).toHaveCount(3);
|
||||
@@ -65,14 +66,71 @@ test("Sanierung je Schicht: Feld, Typ-Paar, alle sanieren ([274])", async ({ pag
|
||||
await expect.poll(async () => Object.keys(await fills())).toContain(RED);
|
||||
|
||||
// Sanierungstyp für „Aussenwand 34.5 cm“ anlegen, alle Wände vom Typ sanieren (ein Undo-Schritt).
|
||||
await san.getByTestId("reno-create-type").selectOption("aw");
|
||||
await san.getByTestId("reno-create-type").selectOption("wall:aw");
|
||||
await san.getByTestId("reno-create").click();
|
||||
await expect(san.getByTestId("reno-pair")).toHaveCount(2);
|
||||
await expect(san.getByTestId("reno-pairs-wall").getByTestId("reno-pair")).toHaveCount(2);
|
||||
const pair = san.getByTestId("reno-pair").filter({ hasText: "Aussenwand 34.5 cm" });
|
||||
await pair.getByTestId("reno-pair-renovate-all").click();
|
||||
await expect.poll(async () => Object.values((await ren()).buildUp).filter((v) => v === "type").length).toBe(8);
|
||||
await expect(san.getByTestId("reno-sanierung-count")).toHaveText("Sanierte Bauteile: 8");
|
||||
await expect.poll(async () => Object.values((await ren()).buildUp).filter((v) => v === "type").length).toBe(10);
|
||||
await expect(san.getByTestId("reno-sanierung-count")).toHaveText("Sanierte Bauteile: 10");
|
||||
await blurFocus(page);
|
||||
await page.keyboard.press("ControlOrMeta+z");
|
||||
await expect.poll(async () => Object.values((await ren()).buildUp).filter((v) => v === "type").length).toBe(1);
|
||||
await expect.poll(async () => Object.values((await ren()).buildUp).filter((v) => v === "type").length).toBe(3);
|
||||
});
|
||||
|
||||
test("Sanierung je Schicht: Decke und Dach ([274])", async ({ page }) => {
|
||||
await page.goto("/?dossierTest");
|
||||
await page.getByRole("button", { name: /Neues Projekt/ }).first().click();
|
||||
await expect(page.getByRole("group", { name: "Befehlszeile" })).toBeVisible();
|
||||
await fileMenu(page, /^Neu aus Vorlage: Beispiel Umbau$/);
|
||||
await discardIfAsked(page);
|
||||
await expect(page.locator(".project-name")).toHaveText("Beispiel Umbau");
|
||||
const ren = () => page.evaluate(() => window.__dossierTest!.renovation());
|
||||
expect((await ren()).buildUp.C1).toBe("type");
|
||||
expect((await ren()).buildUp.RF1).toBe("type");
|
||||
|
||||
// Objekt-Info der Decke C1: „wie Typ“ mit Streifen; auf „keiner“ und Undo.
|
||||
await page.evaluate(() => window.__dossierTest!.select({ walls: [], ceilings: ["C1"] }));
|
||||
await openTab(page, "Objekt-Info");
|
||||
const field = page.getByTestId("objinfo-renovation-buildup");
|
||||
await expect(field).toContainText("wie Typ: Geschossdecke Parkett (saniert)");
|
||||
const strip = page.getByTestId("objinfo-renovation-strip");
|
||||
await expect(strip).toBeVisible();
|
||||
await field.scrollIntoViewIfNeeded();
|
||||
await page.screenshot({ path: "test-results/renovation274-decke-objektinfo.png" });
|
||||
await field.getByRole("button", { name: "Neuer Aufbau (Sanierung)" }).click();
|
||||
await page.getByRole("option", { name: "keiner", exact: true }).click();
|
||||
await expect.poll(async () => (await ren()).buildUp.C1).toBe("");
|
||||
await blurFocus(page);
|
||||
await page.keyboard.press("ControlOrMeta+z");
|
||||
await expect.poll(async () => (await ren()).buildUp.C1).toBe("type");
|
||||
|
||||
// Dach RF1 in der Objekt-Info.
|
||||
await page.evaluate(() => window.__dossierTest!.select({ walls: [], ceilings: [], roofs: ["RF1"] }));
|
||||
await expect(field).toContainText("wie Typ: Steildach Aufsparrendämmung (saniert)");
|
||||
|
||||
// Umbau-Panel: Decken- und Dach-Paar, Bezugsseite der Decke unten/oben.
|
||||
await openTab(page, "Umbau");
|
||||
const san = page.getByTestId("renovation-dock").getByTestId("reno-sanierung");
|
||||
const deck = san.getByTestId("reno-pairs-ceiling").getByTestId("reno-pair");
|
||||
await expect(deck).toContainText("1 von 1 Decken saniert");
|
||||
await expect(san.getByTestId("reno-pairs-roof").getByTestId("reno-pair")).toContainText("1 von 1 Dächern saniert");
|
||||
await deck.getByTestId("reno-pair-edit").click();
|
||||
const ed = deck.getByTestId("reno-pair-editor");
|
||||
await expect(ed.getByTestId("reno-pair-side").locator("option").first()).toHaveText("unten (Rohdecke bleibt)");
|
||||
await expect(ed.getByTestId("reno-pair-old-layer")).toHaveCount(4);
|
||||
await expect(ed.getByTestId("reno-pair-old-layer").nth(3)).toHaveAttribute("data-fate", "kept");
|
||||
await expect(ed.getByTestId("reno-pair-old-layer").nth(0)).toHaveAttribute("data-fate", "demolish");
|
||||
await ed.scrollIntoViewIfNeeded();
|
||||
await page.screenshot({ path: "test-results/renovation274-decke-panel.png" });
|
||||
// Bezugsseite oben; Undo.
|
||||
await ed.getByTestId("reno-pair-side").selectOption("outside");
|
||||
await expect(ed.getByTestId("reno-pair-side")).toHaveValue("outside");
|
||||
await blurFocus(page);
|
||||
await page.keyboard.press("ControlOrMeta+z");
|
||||
await expect(ed.getByTestId("reno-pair-side")).toHaveValue("inside");
|
||||
// Sanierungstyp für einen Deckentyp anlegen.
|
||||
await san.getByTestId("reno-create-type").selectOption("ceiling:dg-massiv");
|
||||
await san.getByTestId("reno-create").click();
|
||||
await expect(san.getByTestId("reno-pairs-ceiling").getByTestId("reno-pair")).toHaveCount(2);
|
||||
});
|
||||
@@ -140,6 +140,16 @@ fn renovation_props(p: &Project, psets: &mut Vec<Pset>, common: &'static str, r:
|
||||
}
|
||||
}
|
||||
|
||||
/// [274] Status je Schicht eines sanierten Bauteils in `Dossier_Umbau` (s. `renovation::build_up::ifc_layer_status`).
|
||||
fn layer_renovation_props(p: &Project, psets: &mut Vec<Pset>, id: &str) {
|
||||
let Some((old, new)) = crate::renovation::build_up::ifc_layer_status(p, id) else { return };
|
||||
let props = [Prop::Label("SchichtenBestand", old), Prop::Label("SchichtenSanierung", new)];
|
||||
match psets.iter_mut().find(|ps| ps.name == "Dossier_Umbau") {
|
||||
Some(ps) => ps.props.extend(props),
|
||||
None => psets.push(Pset { name: "Dossier_Umbau", props: props.into() }),
|
||||
}
|
||||
}
|
||||
|
||||
fn ident(name: &'static str, v: &str) -> Prop {
|
||||
Prop::Ident(name, v.to_string())
|
||||
}
|
||||
@@ -1146,6 +1156,7 @@ pub fn ifc_export_data(src: &Project, opt: &IfcOptions) -> Result<Flat, String>
|
||||
props.extend(crate::u_value::wall_u_value(p, wall).and_then(|u| u.u).map(|u| Prop::Thermal("ThermalTransmittance", u)));
|
||||
let mut ps = vec![Pset { name: "Pset_WallCommon", props }];
|
||||
renovation_props(p, &mut ps, "Pset_WallCommon", wall.renovation.as_ref());
|
||||
layer_renovation_props(p, &mut ps, &wall.id);
|
||||
ps.extend(q);
|
||||
(wt.name.clone(), Some((wt.id.clone(), wt.name.clone(), layers)), ps)
|
||||
}
|
||||
@@ -1425,6 +1436,7 @@ pub fn ifc_export_data(src: &Project, opt: &IfcOptions) -> Result<Flat, String>
|
||||
psets.push(Pset { name: "Pset_SlabCommon", props: slab_props });
|
||||
}
|
||||
renovation_props(&p, &mut psets, "Pset_SlabCommon", c.renovation.as_ref());
|
||||
layer_renovation_props(&p, &mut psets, &c.id);
|
||||
// Aussparungen (wie im 3D) als innere Ringe des Profils; Netto zieht sie ab.
|
||||
let hole_rings = crate::opening_shape::ceiling_hole_rings(&p, c);
|
||||
let inner: Vec<&[Vec2]> = hole_rings.iter().filter(|r| r.len() >= 3).map(|r| r.as_slice()).collect();
|
||||
@@ -1738,6 +1750,7 @@ pub fn ifc_export_data(src: &Project, opt: &IfcOptions) -> Result<Flat, String>
|
||||
props.extend(crate::u_value::roof_u_value(&p, roof).and_then(|u| u.u).map(|u| Prop::Thermal("ThermalTransmittance", u)));
|
||||
let mut psets = vec![Pset { name: "Pset_RoofCommon", props }];
|
||||
renovation_props(&p, &mut psets, "Pset_RoofCommon", roof.renovation.as_ref());
|
||||
layer_renovation_props(&p, &mut psets, &roof.id);
|
||||
let (roof_q, dormer_q) = roof_base_quantities(&p, roof);
|
||||
psets.extend(qto("Qto_RoofBaseQuantities", roof_q));
|
||||
psets.extend(qto("Qto_DossierDormerQuantities", dormer_q));
|
||||
|
||||
@@ -756,6 +756,22 @@ pub struct CeilingType {
|
||||
pub id: String,
|
||||
pub name: String,
|
||||
pub layers: Vec<Layer>,
|
||||
/// [274] Sanierungstyp (Deckentyp-Id): neuer Aufbau aller als „saniert“ markierten Decken dieses (Bestands-)Typs.
|
||||
#[serde(rename = "renovationTarget", default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub renovation_target: Option<String>,
|
||||
/// [274] Bezugsseite der Sanierung (fehlt ⇒ innen); bei Decken: innen = unten (Rohdecke bleibt, die Oberkante verschiebt sich), aussen = oben (Oberkante bleibt).
|
||||
#[serde(rename = "renovationSide", default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub renovation_side: Option<RenovationSide>,
|
||||
/// [274] Manuelle Zuordnung je Schicht dieses Bestandstyps (wie `WallType.renovationOld`).
|
||||
#[serde(rename = "renovationOld", default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub renovation_old: Option<Vec<LayerRenovation>>,
|
||||
/// [274] Manuelle Zuordnung je Schicht des Sanierungstyps (wie `WallType.renovationNew`).
|
||||
#[serde(rename = "renovationNew", default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub renovation_new: Option<Vec<LayerRenovation>>,
|
||||
#[serde(flatten)]
|
||||
#[ts(skip)]
|
||||
pub extra: Extra,
|
||||
@@ -774,6 +790,22 @@ pub struct RoofType {
|
||||
pub name: String,
|
||||
/// Aussen (Eindeckung) → innen (Verkleidung), analog `WallType.layers`.
|
||||
pub layers: Vec<Layer>,
|
||||
/// [274] Sanierungstyp (Dachtyp-Id): neuer Aufbau aller als „saniert“ markierten Dächer dieses (Bestands-)Typs.
|
||||
#[serde(rename = "renovationTarget", default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub renovation_target: Option<String>,
|
||||
/// [274] Bezugsseite der Sanierung (fehlt ⇒ innen); innen = Tragwerk/Verkleidung bleibt, die Dachhaut verschiebt sich.
|
||||
#[serde(rename = "renovationSide", default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub renovation_side: Option<RenovationSide>,
|
||||
/// [274] Manuelle Zuordnung je Schicht dieses Bestandstyps (wie `WallType.renovationOld`).
|
||||
#[serde(rename = "renovationOld", default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub renovation_old: Option<Vec<LayerRenovation>>,
|
||||
/// [274] Manuelle Zuordnung je Schicht des Sanierungstyps (wie `WallType.renovationNew`).
|
||||
#[serde(rename = "renovationNew", default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub renovation_new: Option<Vec<LayerRenovation>>,
|
||||
#[serde(flatten)]
|
||||
#[ts(skip)]
|
||||
pub extra: Extra,
|
||||
|
||||
@@ -314,7 +314,7 @@ impl CutRules {
|
||||
/// [271] Umbau-Farben als Override der Schnittflächen: Füllung der Farbe, ohne Muster, Umriss gestrichelt bei
|
||||
/// Abbruch. Geht den Regeln vor (der Umbaufilter ist die Aussage des Plans).
|
||||
pub fn with_renovation(mut self, out: &Output, r: Option<&crate::renovation::Resolved>) -> CutRules {
|
||||
let Some(r) = r.filter(|r| !r.styled.is_empty() || !r.walls.is_empty()) else { return self };
|
||||
let Some(r) = r.filter(|r| !r.styled.is_empty() || !r.walls.is_empty() || !r.slabs.is_empty()) else { return self };
|
||||
// Projektionslinien: Besitzer mit Umbau-Farbe (nur Linienfarbe und Strichmuster, die Fläche gibt es nicht);
|
||||
// [274] sanierte Wände in der Farbe ihrer äussersten Schicht.
|
||||
for (k, id) in &out.edge_ids {
|
||||
@@ -330,8 +330,18 @@ impl CutRules {
|
||||
if let Some(st) = r.styled.get(s) {
|
||||
return Some(st.clone());
|
||||
}
|
||||
let look = r.walls.get(s).filter(|_| c.kind == Kind::Wall)?;
|
||||
look.layer_style(c.layer_index.or_else(|| c.component_id.as_deref().and_then(|id| look.pieces.iter().position(|q| q.layer.component_id == id)))?)
|
||||
// [274] Sanierte Decke bzw. Dach ebenso je Schicht.
|
||||
let look = match c.kind {
|
||||
Kind::Wall => r.walls.get(s),
|
||||
Kind::Slab | Kind::Roof => r.slabs.get(s),
|
||||
_ => None,
|
||||
}?;
|
||||
let li = c.layer_index.or_else(|| if look.pieces.len() == 1 { Some(0) } else { c.component_id.as_deref().and_then(|id| look.pieces.iter().position(|q| q.layer.component_id == id)) });
|
||||
match li {
|
||||
Some(li) => look.layer_style(li),
|
||||
// Ungeteilte Platte (z. B. zusammengefasster Aufbau): Farbe der obersten Schicht.
|
||||
None => r.faces.get(s).cloned().filter(|_| c.kind != Kind::Wall),
|
||||
}
|
||||
};
|
||||
if out.cuts.iter().all(|c| style_of(c).is_none()) {
|
||||
return self;
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
//! beide ⇒ überlagert in Teilschichten, Abbruch als gestrichelte Kontur über der Neu-Füllung). Die Wand-Achse
|
||||
//! bleibt; die Ableitungen sehen eine Ersatzwand mit dem gezeigten Aufbau ([`Resolved::project`],
|
||||
//! [`with_build_ups`]), die Farben gelten je Schicht ([`WallLook`]). Ohne Umbaufilter gilt der Bestandstyp.
|
||||
//! Decken und Dächer gleich (Decken-/Dachtyp, [`build_up::Layered`]); Bezugsseite der Decke innen = unten, aussen = oben.
|
||||
|
||||
use crate::model::*;
|
||||
use crate::plan::prim::Primitive;
|
||||
@@ -436,6 +437,35 @@ impl View {
|
||||
}
|
||||
put(&w.id, self.treat(w.renovation.as_ref()), out);
|
||||
}
|
||||
// [274] Sanierte Bestandsdecken und -dächer: Aufbau und Farben je Schicht wie bei den Wänden.
|
||||
let layered = |id: &str, look: Option<WallLook>, has_origin: bool, out: &mut Resolved| -> bool {
|
||||
let Some(look) = look else { return false };
|
||||
if let Some(Treat::Style(st)) = look.treat.first() {
|
||||
out.faces.insert(id.to_string(), st.clone());
|
||||
}
|
||||
if look.pieces.is_empty() {
|
||||
out.hidden.insert(id.to_string());
|
||||
}
|
||||
if look.new_type.is_none() && has_origin {
|
||||
out.restore = true;
|
||||
}
|
||||
out.slabs.insert(id.to_string(), look);
|
||||
true
|
||||
};
|
||||
for x in p.ceilings.iter().flatten() {
|
||||
let s = self.state(x.renovation.as_ref());
|
||||
if s == Some(RenovationStatus::Existing) && layered(&x.id, build_up::ceiling_look(self, p, x), x.extra.0.contains_key(build_up::ORIGIN), out) {
|
||||
continue;
|
||||
}
|
||||
put(&x.id, self.treat(x.renovation.as_ref()), out);
|
||||
}
|
||||
for x in p.roofs.iter().flatten() {
|
||||
let s = self.state(x.renovation.as_ref());
|
||||
if s == Some(RenovationStatus::Existing) && layered(&x.id, build_up::roof_look(self, p, x), x.extra.0.contains_key(build_up::ORIGIN), out) {
|
||||
continue;
|
||||
}
|
||||
put(&x.id, self.treat(x.renovation.as_ref()), out);
|
||||
}
|
||||
for o in p.openings.iter().flatten() {
|
||||
let host = wall_state.get(o.host_wall_id.as_str()).copied().flatten();
|
||||
if out.hidden.contains(&o.host_wall_id) {
|
||||
@@ -459,12 +489,6 @@ impl View {
|
||||
out.patches.push(Patch { opening_id: o.id.clone(), wall_id: o.host_wall_id.clone(), status: virt, style: st, closed: out.hidden.contains(&o.id) });
|
||||
}
|
||||
}
|
||||
for x in p.ceilings.iter().flatten() {
|
||||
put(&x.id, self.treat(x.renovation.as_ref()), out);
|
||||
}
|
||||
for x in p.roofs.iter().flatten() {
|
||||
put(&x.id, self.treat(x.renovation.as_ref()), out);
|
||||
}
|
||||
for x in p.stairs.iter().flatten() {
|
||||
put(&x.id, self.treat(x.renovation.as_ref()), out);
|
||||
}
|
||||
@@ -545,15 +569,29 @@ pub struct Resolved {
|
||||
pub walls: HashMap<String, WallLook>,
|
||||
/// [274] Wandtypen der gezeigten Aufbauten (neu bzw. überlagert), in [`Self::project`] ergänzt.
|
||||
pub wall_types: Vec<WallType>,
|
||||
/// [274] Ansichtsflächen sanierter Wände (Ansicht, Axo, 3D): Farbe der äussersten Schicht.
|
||||
/// [274] Ansichtsflächen sanierter Wände, Decken und Dächer (Ansicht, Axo, 3D, Grundriss-Linien der Decken und
|
||||
/// Dächer): Farbe der äussersten bzw. obersten Schicht.
|
||||
pub faces: HashMap<String, Style>,
|
||||
/// [274] Sanierte Decken und Dächer (id → gezeigter Aufbau mit Farben je Schicht, Schichten oben/aussen → unten/innen).
|
||||
pub slabs: HashMap<String, WallLook>,
|
||||
/// [274] Eine schon umgestellte Ersatzwand muss auf den Bestand zurück ([`Self::swap_build_ups`]).
|
||||
pub restore: bool,
|
||||
}
|
||||
|
||||
impl Resolved {
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.hidden.is_empty() && self.styled.is_empty() && self.patches.is_empty() && self.walls.is_empty()
|
||||
self.hidden.is_empty() && self.styled.is_empty() && self.patches.is_empty() && self.walls.is_empty() && self.slabs.is_empty()
|
||||
}
|
||||
|
||||
/// [274] Umbau-Farbe eines Elements für Linien und Flächen im Grundriss: eigene Farbe, sonst die oberste Schicht
|
||||
/// einer sanierten Decke bzw. eines sanierten Dachs (Wände färben je Schicht selbst).
|
||||
pub fn element_style(&self, id: &str) -> Option<&Style> {
|
||||
self.styled.get(id).or_else(|| if self.slabs.contains_key(id) { self.faces.get(id) } else { None })
|
||||
}
|
||||
|
||||
/// [274] Darstellung der Schicht `li` (Schicht des gezeigten Aufbaus) einer sanierten Decke oder eines Dachs.
|
||||
pub fn slab_layer_style(&self, id: &str, li: usize) -> Option<Style> {
|
||||
self.slabs.get(id)?.layer_style(li)
|
||||
}
|
||||
|
||||
/// Umbau-Farbe einer Ansichtsfläche (Element-Farbe, sonst die der äussersten Schicht einer sanierten Wand).
|
||||
@@ -563,7 +601,7 @@ impl Resolved {
|
||||
|
||||
/// Ersetzt der Filter Aufbauten (Wände mit anderem gezeigtem Aufbau)?
|
||||
pub fn swaps(&self) -> bool {
|
||||
self.restore || self.walls.values().any(|l| l.new_type.is_some())
|
||||
self.restore || self.walls.values().chain(self.slabs.values()).any(|l| l.new_type.is_some())
|
||||
}
|
||||
|
||||
/// Das Projekt dieser Darstellung: ohne Ausgeblendetes, sanierte Wände mit dem gezeigten Aufbau; `None` = unverändert.
|
||||
@@ -601,7 +639,47 @@ impl Resolved {
|
||||
q.wall_types.push(t.clone());
|
||||
}
|
||||
}
|
||||
for c in self.walls.values().flat_map(|l| l.components.iter()) {
|
||||
// [274] Decken: Ersatz-Deckentyp; die Bezugsseite bleibt stehen (unten: neue Oberkante, oben: Unterkante folgt).
|
||||
for c in q.ceilings.iter_mut().flatten() {
|
||||
let Some(look) = self.slabs.get(&c.id) else { continue };
|
||||
if c.ceiling_type_id.as_deref() == Some(look.type_id.as_str()) && look.new_type.is_some() {
|
||||
continue;
|
||||
}
|
||||
build_up::restore_ceiling(c);
|
||||
let Some(t) = &look.new_type else { continue };
|
||||
let orig = serde_json::json!({"type": c.ceiling_type_id, "thickness": c.thickness, "top": c.top, "bottom": c.bottom});
|
||||
c.extra.0.insert(build_up::ORIGIN.to_string(), orig);
|
||||
if let Some(z) = look.level {
|
||||
c.top = Some(VerticalAnchor::Custom { z });
|
||||
}
|
||||
c.bottom = None;
|
||||
c.thickness = None;
|
||||
c.ceiling_type_id = Some(t.id.clone());
|
||||
let types = q.ceiling_types.get_or_insert_with(Vec::new);
|
||||
if !types.iter().any(|x| x.id == t.id) {
|
||||
types.push(CeilingType { id: t.id.clone(), name: t.name.clone(), layers: t.layers.clone(), ..Default::default() });
|
||||
}
|
||||
}
|
||||
// [274] Dächer: Ersatz-Dachtyp; Bezugsseite innen hebt die Dachhaut (Traufhöhe).
|
||||
for r in q.roofs.iter_mut().flatten() {
|
||||
let Some(look) = self.slabs.get(&r.id) else { continue };
|
||||
if r.roof_type_id.as_deref() == Some(look.type_id.as_str()) && look.new_type.is_some() {
|
||||
continue;
|
||||
}
|
||||
build_up::restore_roof(r);
|
||||
let Some(t) = &look.new_type else { continue };
|
||||
let orig = serde_json::json!({"type": r.roof_type_id, "base": r.base_elevation});
|
||||
r.extra.0.insert(build_up::ORIGIN.to_string(), orig);
|
||||
if let Some(z) = look.level {
|
||||
r.base_elevation = Some(z);
|
||||
}
|
||||
r.roof_type_id = Some(t.id.clone());
|
||||
let types = q.roof_types.get_or_insert_with(Vec::new);
|
||||
if !types.iter().any(|x| x.id == t.id) {
|
||||
types.push(RoofType { id: t.id.clone(), name: t.name.clone(), layers: t.layers.clone(), ..Default::default() });
|
||||
}
|
||||
}
|
||||
for c in self.walls.values().chain(self.slabs.values()).flat_map(|l| l.components.iter()) {
|
||||
if !q.components.iter().any(|x| x.id == c.id) {
|
||||
q.components.push(c.clone());
|
||||
}
|
||||
@@ -790,13 +868,14 @@ pub fn restyle_linework(prims: &mut Vec<Primitive>, from: usize, st: &Style, fil
|
||||
/// Umbau-Farben auf `prims[from..]`: jedes Primitiv nach seinem Element ([`prim_element`]), sonst nach `owner`
|
||||
/// (z. B. die Wand, deren Umrisslinien keine Id tragen). Umrisslinien gestrichelter Flächen kommen dahinter.
|
||||
pub fn restyle_range(r: &Resolved, prims: &mut Vec<Primitive>, from: usize, owner: Option<&str>) {
|
||||
if r.styled.is_empty() || from >= prims.len() {
|
||||
if (r.styled.is_empty() && r.slabs.is_empty()) || from >= prims.len() {
|
||||
return;
|
||||
}
|
||||
let mut extra = Vec::new();
|
||||
for q in prims[from..].iter_mut() {
|
||||
let id = prim_element(q).or(owner);
|
||||
if let Some(st) = id.and_then(|id| r.styled.get(id)) {
|
||||
// [274] Sanierte Decke/Dach: Linien in der Farbe der obersten Schicht.
|
||||
if let Some(st) = id.and_then(|id| r.element_style(id)) {
|
||||
// Symbole und Ansichten (Fenster, Türflügel, Treppenstufen, Decken- und Dachkanten): nur Linien.
|
||||
// [272] Grau ausserhalb der Bearbeitungsvariante: alle Flächen.
|
||||
let f = st.ghost || cut_fill(q);
|
||||
@@ -925,6 +1004,15 @@ pub fn color_parts(p: &Project, parts: &mut crate::model3d::Parts, r: &Resolved)
|
||||
s.color = c;
|
||||
}
|
||||
}
|
||||
// [274] Sanierte Decke: Farbe je Schicht (geschichtete Platten tragen ihre Schicht).
|
||||
let ceilings = p.ceilings.as_deref().unwrap_or(&[]);
|
||||
for s in &mut parts.slabs {
|
||||
if let crate::model3d::SlabSource::Ceiling { index, layer: Some(li) } = s.source {
|
||||
if let Some(st) = ceilings.get(index).and_then(|c| r.slab_layer_style(&c.id, li)) {
|
||||
s.color = crate::style::hex_to_rgb(&st.fill, crate::style::WALL_RGB);
|
||||
}
|
||||
}
|
||||
}
|
||||
let meshes = [&mut parts.column_meshes, &mut parts.stair_meshes, &mut parts.roof_meshes, &mut parts.solid_meshes, &mut parts.stair_railings];
|
||||
for list in meshes {
|
||||
for m in list.iter_mut() {
|
||||
@@ -1015,6 +1103,57 @@ pub mod build_up {
|
||||
pub new: Vec<Fate>,
|
||||
}
|
||||
|
||||
/// Mehrschichtiger Typ mit Sanierungs-Angaben (Wand-, Decken-, Dachtyp): eine Zuordnungs-Logik für alle drei.
|
||||
pub trait Layered {
|
||||
fn type_id(&self) -> &str;
|
||||
fn type_name(&self) -> &str;
|
||||
fn type_layers(&self) -> &[Layer];
|
||||
fn target(&self) -> Option<&str>;
|
||||
fn side(&self) -> Option<RenovationSide>;
|
||||
fn old_ov(&self) -> Option<&[LayerRenovation]>;
|
||||
fn new_ov(&self) -> Option<&[LayerRenovation]>;
|
||||
}
|
||||
|
||||
macro_rules! layered {
|
||||
($($t:ty),*) => {$(
|
||||
impl Layered for $t {
|
||||
fn type_id(&self) -> &str { &self.id }
|
||||
fn type_name(&self) -> &str { &self.name }
|
||||
fn type_layers(&self) -> &[Layer] { &self.layers }
|
||||
fn target(&self) -> Option<&str> { self.renovation_target.as_deref() }
|
||||
fn side(&self) -> Option<RenovationSide> { self.renovation_side }
|
||||
fn old_ov(&self) -> Option<&[LayerRenovation]> { self.renovation_old.as_deref() }
|
||||
fn new_ov(&self) -> Option<&[LayerRenovation]> { self.renovation_new.as_deref() }
|
||||
}
|
||||
)*};
|
||||
}
|
||||
layered!(WallType, CeilingType, RoofType);
|
||||
|
||||
/// Bauteilart einer Sanierung (Abfragen `renovationPair`/`renovationPairs`, Oberfläche).
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
pub enum Host {
|
||||
Wall,
|
||||
Ceiling,
|
||||
Roof,
|
||||
}
|
||||
|
||||
impl Host {
|
||||
pub fn parse(s: &str) -> Host {
|
||||
match s {
|
||||
"ceiling" => Host::Ceiling,
|
||||
"roof" => Host::Roof,
|
||||
_ => Host::Wall,
|
||||
}
|
||||
}
|
||||
pub fn key(self) -> &'static str {
|
||||
match self {
|
||||
Host::Wall => "wall",
|
||||
Host::Ceiling => "ceiling",
|
||||
Host::Roof => "roof",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn thick(l: &Layer) -> f64 {
|
||||
if l.thickness.is_finite() && l.thickness > 0.0 {
|
||||
l.thickness
|
||||
@@ -1167,9 +1306,10 @@ pub mod build_up {
|
||||
out
|
||||
}
|
||||
|
||||
/// Hat das Projekt sanierte Wände?
|
||||
/// Hat das Projekt sanierte Wände, Decken oder Dächer?
|
||||
pub fn any(p: &Project) -> bool {
|
||||
p.walls.iter().any(|w| w.renovation.as_ref().is_some_and(marked))
|
||||
let m = |r: &Option<Renovation>| r.as_ref().is_some_and(marked);
|
||||
p.walls.iter().any(|w| m(&w.renovation)) || p.ceilings.iter().flatten().any(|c| m(&c.renovation)) || p.roofs.iter().flatten().any(|r| m(&r.renovation))
|
||||
}
|
||||
|
||||
/// Ist die Wand als saniert markiert?
|
||||
@@ -1200,20 +1340,78 @@ pub mod build_up {
|
||||
|
||||
/// Typ-Paar Bestandstyp `old` → `target` mit Zuordnung (die manuelle gilt nur für den eingetragenen Sanierungstyp).
|
||||
pub fn type_pair<'a>(p: &'a Project, old: &'a WallType, target: &str) -> Option<(&'a WallType, &'a WallType, RenovationSide, Matched)> {
|
||||
let new = p.wall_types.iter().find(|t| t.id == target)?;
|
||||
if new.id == old.id || total(&old.layers) <= TOL || total(&new.layers) <= TOL {
|
||||
type_pair_in(&p.wall_types, old, target)
|
||||
}
|
||||
|
||||
/// Typ-Paar unter den Typen `types` (Wand-, Decken- oder Dachtypen), wie [`type_pair`].
|
||||
pub fn type_pair_in<'a, T: Layered>(types: &'a [T], old: &'a T, target: &str) -> Option<(&'a T, &'a T, RenovationSide, Matched)> {
|
||||
let new = types.iter().find(|t| t.type_id() == target)?;
|
||||
if new.type_id() == old.type_id() || total(old.type_layers()) <= TOL || total(new.type_layers()) <= TOL {
|
||||
return None;
|
||||
}
|
||||
let side = match old.renovation_side {
|
||||
let side = match old.side() {
|
||||
Some(RenovationSide::Outside) => RenovationSide::Outside,
|
||||
_ => RenovationSide::Inside,
|
||||
};
|
||||
let own = old.renovation_target.as_deref() == Some(target);
|
||||
let (oo, no) = if own { (old.renovation_old.clone().unwrap_or_default(), old.renovation_new.clone().unwrap_or_default()) } else { (Vec::new(), Vec::new()) };
|
||||
let m = match_layers(&old.layers, &new.layers, side, &oo, &no);
|
||||
let own = old.target() == Some(target);
|
||||
let (oo, no) = if own { (old.old_ov().unwrap_or_default(), old.new_ov().unwrap_or_default()) } else { (&[][..], &[][..]) };
|
||||
let m = match_layers(old.type_layers(), new.type_layers(), side, oo, no);
|
||||
Some((old, new, side, m))
|
||||
}
|
||||
|
||||
/// Sanierungstyp eines Elements: Ausnahme `newTypeId`, sonst der eingetragene des Bestandstyps.
|
||||
fn target_of<'a, T: Layered>(r: &'a Renovation, old: &'a T) -> Option<&'a str> {
|
||||
r.new_type_id.as_deref().map(str::trim).filter(|s| !s.is_empty()).or(old.target())
|
||||
}
|
||||
|
||||
/// Ursprünglicher Deckentyp, Dicke und Höhenbindungen (auch einer schon umgestellten Ersatzdecke).
|
||||
pub fn ceiling_origin(c: &Ceiling) -> Ceiling {
|
||||
let mut c = c.clone();
|
||||
restore_ceiling(&mut c);
|
||||
c
|
||||
}
|
||||
|
||||
/// Ersatzdecke auf ihren Ursprung zurückstellen (Marke [`ORIGIN`]).
|
||||
pub fn restore_ceiling(c: &mut Ceiling) {
|
||||
let Some(o) = c.extra.0.remove(ORIGIN) else { return };
|
||||
c.ceiling_type_id = o.get("type").and_then(|x| x.as_str()).map(String::from);
|
||||
c.thickness = o.get("thickness").and_then(|x| x.as_f64());
|
||||
c.top = o.get("top").and_then(|x| serde_json::from_value(x.clone()).ok());
|
||||
c.bottom = o.get("bottom").and_then(|x| serde_json::from_value(x.clone()).ok());
|
||||
}
|
||||
|
||||
/// Ersatzdach auf seinen Ursprung zurückstellen (Marke [`ORIGIN`]).
|
||||
pub fn restore_roof(r: &mut Roof) {
|
||||
let Some(o) = r.extra.0.remove(ORIGIN) else { return };
|
||||
r.roof_type_id = o.get("type").and_then(|x| x.as_str()).map(String::from);
|
||||
r.base_elevation = o.get("base").and_then(|x| x.as_f64());
|
||||
}
|
||||
|
||||
/// Ursprünglicher Dachtyp und Traufhöhe (auch eines schon umgestellten Ersatzdachs).
|
||||
pub fn roof_origin(r: &Roof) -> Roof {
|
||||
let mut r = r.clone();
|
||||
restore_roof(&mut r);
|
||||
r
|
||||
}
|
||||
|
||||
/// Typ-Paar einer sanierten Decke (nur mit Deckentyp, wie [`pair`]).
|
||||
pub fn ceiling_pair<'a>(p: &'a Project, c: &Ceiling) -> Option<(&'a CeilingType, &'a CeilingType, RenovationSide, Matched)> {
|
||||
let r = c.renovation.as_ref().filter(|r| marked(r))?;
|
||||
let types = p.ceiling_types.as_deref()?;
|
||||
let id = if c.extra.0.contains_key(ORIGIN) { ceiling_origin(c).ceiling_type_id? } else { c.ceiling_type_id.clone()? };
|
||||
let old = types.iter().find(|t| t.id == id)?;
|
||||
type_pair_in(types, old, target_of(r, old)?)
|
||||
}
|
||||
|
||||
/// Typ-Paar eines sanierten Dachs (nur mit Dachtyp).
|
||||
pub fn roof_pair<'a>(p: &'a Project, x: &Roof) -> Option<(&'a RoofType, &'a RoofType, RenovationSide, Matched)> {
|
||||
let r = x.renovation.as_ref().filter(|r| marked(r))?;
|
||||
let types = p.roof_types.as_deref()?;
|
||||
let id = if x.extra.0.contains_key(ORIGIN) { roof_origin(x).roof_type_id? } else { x.roof_type_id.clone()? };
|
||||
let old = types.iter().find(|t| t.id == id)?;
|
||||
type_pair_in(types, old, target_of(r, old)?)
|
||||
}
|
||||
|
||||
/// Gezeigter Aufbau einer sanierten Wand im Filter.
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct WallLook {
|
||||
@@ -1221,12 +1419,16 @@ pub mod build_up {
|
||||
pub pieces: Vec<Piece>,
|
||||
/// Darstellung je Schicht (gleich lang wie `pieces`).
|
||||
pub treat: Vec<Treat>,
|
||||
/// Wandtyp der Ersatzwand (`None` = der Bestandstyp bleibt).
|
||||
/// Typ der Ersatzwand (`None` = der Bestandstyp bleibt); bei Decken und Dächern Träger von Id, Name und
|
||||
/// Schichten des Ersatz-Decken- bzw. -Dachtyps.
|
||||
pub new_type: Option<WallType>,
|
||||
/// Typ, den die Wand in der Darstellung trägt.
|
||||
pub type_id: String,
|
||||
/// Achsversatz der Ersatzwand (`Wall.referenceOffset`): die Bezugsseite bleibt stehen.
|
||||
pub ref_offset: f64,
|
||||
/// Decke: neue Oberkante (absolut), Dach: neue Traufhöhe; `None` = bleibt. Die Bezugsseite bleibt stehen, die
|
||||
/// andere Seite verschiebt sich um die Dickendifferenz.
|
||||
pub level: Option<f64>,
|
||||
/// Umbau-Farbe des Abbruchs, wenn der Filter ihn farbig zeigt (gestrichelte Kanten, Kontur im Umbauplan).
|
||||
pub demolish: Option<Style>,
|
||||
/// Hilfs-Bauteile der Schichten „Neu über Abbruch“ (Kopien des Baustoffs, in [`Resolved::project`] ergänzt).
|
||||
@@ -1276,18 +1478,60 @@ pub mod build_up {
|
||||
/// Aufbau der Wand `w` im Filter `v` (`None` = nicht saniert).
|
||||
pub fn look(v: &View, p: &Project, w: &Wall) -> Option<WallLook> {
|
||||
let (old, new, side, m) = pair(p, w)?;
|
||||
let phase = w.renovation.as_ref().and_then(|r| r.phase.clone());
|
||||
let mut look = look_core(v, p, w.renovation.as_ref(), old, new, side, &m);
|
||||
let (_, off, line) = origin(w);
|
||||
let t_old = total(&old.layers);
|
||||
let t_eff: f64 = look.pieces.iter().map(|q| thick(&q.layer)).sum();
|
||||
let r_old = crate::joins::reference_offset(reference(off, line), t_old);
|
||||
let ref_offset = if side == RenovationSide::Outside { r_old - t_old / 2.0 + t_eff / 2.0 } else { r_old + t_old / 2.0 - t_eff / 2.0 };
|
||||
look.ref_offset = if ref_offset.is_finite() { ref_offset } else { 0.0 };
|
||||
Some(look)
|
||||
}
|
||||
|
||||
/// Aufbau der Decke `c` im Filter `v` (`None` = nicht saniert). Bezugsseite innen = unten (die Rohdecke bleibt, die
|
||||
/// Oberkante verschiebt sich um die Dickendifferenz), aussen = oben (die Unterkante verschiebt sich).
|
||||
pub fn ceiling_look(v: &View, p: &Project, c: &Ceiling) -> Option<WallLook> {
|
||||
let (old, new, side, m) = ceiling_pair(p, c)?;
|
||||
let mut look = look_core(v, p, c.renovation.as_ref(), old, new, side, &m);
|
||||
if look.new_type.is_some() && side != RenovationSide::Outside {
|
||||
let (uk, ok) = p.ceiling_vertical_extent(&ceiling_origin(c));
|
||||
let t_eff: f64 = look.pieces.iter().map(|q| thick(&q.layer)).sum();
|
||||
look.level = Some(uk + t_eff).filter(|z| z.is_finite() && (z - ok).abs() > TOL);
|
||||
}
|
||||
Some(look)
|
||||
}
|
||||
|
||||
/// Aufbau des Dachs `x` im Filter `v` (`None` = nicht saniert). Bezugsseite innen (Vorgabe): Tragwerk und
|
||||
/// Verkleidung bleiben, die Dachhaut hebt sich um die Dickendifferenz (senkrecht zur Fläche; lotrecht über die
|
||||
/// Hauptneigung umgerechnet, an der Traufhöhe angesetzt); aussen: die Dachhaut bleibt, die Unterseite verschiebt sich.
|
||||
pub fn roof_look(v: &View, p: &Project, x: &Roof) -> Option<WallLook> {
|
||||
let (old, new, side, m) = roof_pair(p, x)?;
|
||||
let mut look = look_core(v, p, x.renovation.as_ref(), old, new, side, &m);
|
||||
if look.new_type.is_some() && side != RenovationSide::Outside {
|
||||
let t_eff: f64 = look.pieces.iter().map(|q| thick(&q.layer)).sum();
|
||||
let pitch = if x.pitch_deg.is_finite() { x.pitch_deg.clamp(0.0, 85.0) } else { 0.0 };
|
||||
let cos = crate::jsnum::cos(pitch.to_radians());
|
||||
let base = p.roof_base_elevation(&roof_origin(x));
|
||||
let z = base + (t_eff - total(&old.layers)) / cos;
|
||||
look.level = Some(z).filter(|z| z.is_finite() && (z - base).abs() > TOL);
|
||||
}
|
||||
Some(look)
|
||||
}
|
||||
|
||||
/// Gezeigter Aufbau eines Typ-Paars im Filter (ohne Lage): Teilstücke, Darstellung je Schicht, Ersatztyp.
|
||||
fn look_core<T: Layered>(v: &View, p: &Project, ren: Option<&Renovation>, old: &T, new: &T, side: RenovationSide, m: &Matched) -> WallLook {
|
||||
let phase = ren.and_then(|r| r.phase.clone());
|
||||
let virt = |status| Renovation { status, phase: phase.clone(), ..Default::default() };
|
||||
let td = v.treat(Some(&virt(RenovationStatus::Demolish)));
|
||||
let tn = v.treat(Some(&virt(RenovationStatus::New)));
|
||||
let tk = v.treat(w.renovation.as_ref());
|
||||
let tk = v.treat(ren);
|
||||
let shown = match (td != Treat::Hide, tn != Treat::Hide) {
|
||||
(true, false) => Shown::Old,
|
||||
(false, true) => Shown::New,
|
||||
(true, true) => Shown::Both,
|
||||
(false, false) => Shown::Kept,
|
||||
};
|
||||
let mut pieces = pieces(&old.layers, &new.layers, &m, side, shown);
|
||||
let mut pieces = pieces(old.type_layers(), new.type_layers(), m, side, shown);
|
||||
// Überlagert: neue Schichten über abgebrochenen bekommen ein eigenes (gleich aussehendes) Bauteil, damit
|
||||
// Schnitt und 3D sie nicht mit der übrigen neuen Schicht gleichen Baustoffs zusammenfassen — sonst fehlte dort die
|
||||
// Kontur der abgebrochenen Schicht.
|
||||
@@ -1307,26 +1551,21 @@ pub mod build_up {
|
||||
Kind::New | Kind::NewOverDemolish => tn.clone(),
|
||||
})
|
||||
.collect();
|
||||
let (_, off, line) = origin(w);
|
||||
let t_old = total(&old.layers);
|
||||
let t_eff: f64 = pieces.iter().map(|q| thick(&q.layer)).sum();
|
||||
let r_old = crate::joins::reference_offset(reference(off, line), t_old);
|
||||
let ref_offset = if side == RenovationSide::Outside { r_old - t_old / 2.0 + t_eff / 2.0 } else { r_old + t_old / 2.0 - t_eff / 2.0 };
|
||||
let new_type = (shown != Shown::Old).then(|| {
|
||||
let tag = match shown {
|
||||
Shown::New => "neu",
|
||||
Shown::Both => "umbau",
|
||||
_ => "bleibt",
|
||||
};
|
||||
let name = if shown == Shown::New { new.name.clone() } else { format!("{} → {}", old.name, new.name) };
|
||||
WallType { id: format!("{}~{}~{}", old.id, new.id, tag), name, layers: pieces.iter().map(|q| q.layer.clone()).collect(), ..Default::default() }
|
||||
let name = if shown == Shown::New { new.type_name().to_string() } else { format!("{} → {}", old.type_name(), new.type_name()) };
|
||||
WallType { id: format!("{}~{}~{}", old.type_id(), new.type_id(), tag), name, layers: pieces.iter().map(|q| q.layer.clone()).collect(), ..Default::default() }
|
||||
});
|
||||
let type_id = new_type.as_ref().map_or_else(|| old.id.clone(), |t| t.id.clone());
|
||||
let type_id = new_type.as_ref().map_or_else(|| old.type_id().to_string(), |t| t.id.clone());
|
||||
let demolish = match td {
|
||||
Treat::Style(s) => Some(s),
|
||||
_ => None,
|
||||
};
|
||||
Some(WallLook { shown, pieces, treat, new_type, type_id, ref_offset: if ref_offset.is_finite() { ref_offset } else { 0.0 }, demolish, components })
|
||||
WallLook { shown, pieces, treat, new_type, type_id, ref_offset: 0.0, level: None, demolish, components }
|
||||
}
|
||||
|
||||
/// Grundriss: Kanten der Wand (Umriss, Fugen, Stirnseiten) in `prims[from..]` je Schicht stricheln — Kanten einer
|
||||
@@ -1442,13 +1681,61 @@ pub mod build_up {
|
||||
prims.extend(extra);
|
||||
}
|
||||
|
||||
/// [274] IFC: Status je Schicht eines sanierten Bauteils (Wand, Decke, Dach; `id`), unabhängig vom Umbaufilter —
|
||||
/// Bestandstyp und Sanierungstyp je als Liste „Baustoff Dicke cm: EXISTING|DEMOLISH|NEW“ (Schichten aussen/oben →
|
||||
/// innen/unten). IFC kennt den Status nur je Bauteil (`Pset_*Common.Status`, PEnum_ElementStatus) und keinen je
|
||||
/// Materialschicht; die Liste steht darum in `Dossier_Umbau` (`SchichtenBestand`, `SchichtenSanierung`). `None` ohne Sanierung.
|
||||
pub fn ifc_layer_status(p: &Project, id: &str) -> Option<(String, String)> {
|
||||
fn text(p: &Project, layers: &[Layer], fates: &[Fate]) -> String {
|
||||
let word = |f: Fate| match f {
|
||||
Fate::Kept => "EXISTING",
|
||||
Fate::Demolish => "DEMOLISH",
|
||||
Fate::New => "NEW",
|
||||
};
|
||||
layers.iter().zip(fates).map(|(l, f)| format!("{} {:.1} cm: {}", p.component_or_fallback(&l.component_id).name, thick(l) * 100.0, word(*f))).collect::<Vec<_>>().join("; ")
|
||||
}
|
||||
fn of<T: Layered>(p: &Project, x: Option<(&T, &T, RenovationSide, Matched)>) -> Option<(String, String)> {
|
||||
let (old, new, _, m) = x?;
|
||||
Some((text(p, old.type_layers(), &m.old), text(p, new.type_layers(), &m.new)))
|
||||
}
|
||||
if let Some(w) = p.walls.iter().find(|w| w.id == id) {
|
||||
return of(p, pair(p, w));
|
||||
}
|
||||
if let Some(c) = p.ceilings.iter().flatten().find(|c| c.id == id) {
|
||||
return of(p, ceiling_pair(p, c));
|
||||
}
|
||||
let r = p.roofs.iter().flatten().find(|r| r.id == id)?;
|
||||
of(p, roof_pair(p, r))
|
||||
}
|
||||
|
||||
/// Bestandstyp, Markierung „saniert“ und gezeigter Sanierungstyp je Element einer Bauteilart (Zähler der Abfragen).
|
||||
fn members(p: &Project, host: Host) -> Vec<(Option<String>, bool, Option<String>)> {
|
||||
let m = |r: &Option<Renovation>| r.as_ref().is_some_and(marked);
|
||||
match host {
|
||||
Host::Wall => p.walls.iter().map(|w| (Some(origin(w).0), m(&w.renovation), pair(p, w).map(|x| x.1.id.clone()))).collect(),
|
||||
Host::Ceiling => p.ceilings.iter().flatten().map(|c| (ceiling_origin(c).ceiling_type_id, m(&c.renovation), ceiling_pair(p, c).map(|x| x.1.id.clone()))).collect(),
|
||||
Host::Roof => p.roofs.iter().flatten().map(|r| (roof_origin(r).roof_type_id, m(&r.renovation), roof_pair(p, r).map(|x| x.1.id.clone()))).collect(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Abfrage `renovationPair` (Typ-Paar-Editor, Vorschau): Schichten alt/neu mit Zuordnung und Ergebnis-Streifen
|
||||
/// (Umbauplan). `text` = `{"type": Bestandstyp-Id, "target": Sanierungstyp-Id (fehlt = eingetragener)}`; `null` ohne Paar.
|
||||
/// (Umbauplan). `text` = `{"type": Bestandstyp-Id, "target": Sanierungstyp-Id (fehlt = eingetragener), "kind": "wall" |
|
||||
/// "ceiling" | "roof" (fehlt = Wand)}`; `null` ohne Paar. `elements`/`renovated`: Elemente des Bestandstyps bzw. mit
|
||||
/// diesem Sanierungstyp saniert.
|
||||
pub fn pair_json(p: &Project, text: &str) -> serde_json::Value {
|
||||
let v: serde_json::Value = serde_json::from_str(text).unwrap_or_default();
|
||||
let Some(old) = v.get("type").and_then(|x| x.as_str()).and_then(|id| p.wall_types.iter().find(|t| t.id == id)) else { return serde_json::Value::Null };
|
||||
let target = v.get("target").and_then(|x| x.as_str()).filter(|s| !s.is_empty()).or(old.renovation_target.as_deref());
|
||||
let Some((old, new, side, m)) = target.and_then(|t| type_pair(p, old, t)) else { return serde_json::Value::Null };
|
||||
let host = Host::parse(v.get("kind").and_then(|x| x.as_str()).unwrap_or(""));
|
||||
match host {
|
||||
Host::Wall => pair_json_in(p, &p.wall_types, host, &v),
|
||||
Host::Ceiling => pair_json_in(p, p.ceiling_types.as_deref().unwrap_or(&[]), host, &v),
|
||||
Host::Roof => pair_json_in(p, p.roof_types.as_deref().unwrap_or(&[]), host, &v),
|
||||
}
|
||||
}
|
||||
|
||||
fn pair_json_in<T: Layered>(p: &Project, types: &[T], host: Host, v: &serde_json::Value) -> serde_json::Value {
|
||||
let Some(old) = v.get("type").and_then(|x| x.as_str()).and_then(|id| types.iter().find(|t| t.type_id() == id)) else { return serde_json::Value::Null };
|
||||
let target = v.get("target").and_then(|x| x.as_str()).filter(|s| !s.is_empty()).or(old.target());
|
||||
let Some((old, new, side, m)) = target.and_then(|t| type_pair_in(types, old, t)) else { return serde_json::Value::Null };
|
||||
let layer = |l: &Layer, f: Fate| {
|
||||
let c = p.component_or_fallback(&l.component_id);
|
||||
serde_json::json!({"componentId": l.component_id, "name": c.name, "color": c.color, "thickness": thick(l), "fate": f})
|
||||
@@ -1458,33 +1745,36 @@ pub mod build_up {
|
||||
Kind::Demolish => style(p, RenovationStatus::Demolish).fill,
|
||||
_ => style(p, RenovationStatus::New).fill,
|
||||
};
|
||||
let strip = |shown: Shown| -> Vec<serde_json::Value> { pieces(&old.layers, &new.layers, &m, side, shown).iter().map(|q| serde_json::json!({"thickness": thick(&q.layer), "kind": q.kind, "fill": fill(q.kind)})).collect() };
|
||||
let walls = p.walls.iter().filter(|w| origin(w).0 == old.id).count();
|
||||
let renovated = p.walls.iter().filter(|w| origin(w).0 == old.id && pair(p, w).is_some_and(|x| x.1.id == new.id)).count();
|
||||
let strip = |shown: Shown| -> Vec<serde_json::Value> { pieces(old.type_layers(), new.type_layers(), &m, side, shown).iter().map(|q| serde_json::json!({"thickness": thick(&q.layer), "kind": q.kind, "fill": fill(q.kind)})).collect() };
|
||||
let list = members(p, host);
|
||||
let of_type = |x: &(Option<String>, bool, Option<String>)| x.0.as_deref() == Some(old.type_id());
|
||||
let elements = list.iter().filter(|x| of_type(x)).count();
|
||||
let renovated = list.iter().filter(|x| of_type(x) && x.2.as_deref() == Some(new.type_id())).count();
|
||||
serde_json::json!({
|
||||
"type": old.id, "target": new.id, "side": if side == RenovationSide::Outside { "outside" } else { "inside" },
|
||||
"old": old.layers.iter().zip(&m.old).map(|(l, f)| layer(l, *f)).collect::<Vec<_>>(),
|
||||
"new": new.layers.iter().zip(&m.new).map(|(l, f)| layer(l, *f)).collect::<Vec<_>>(),
|
||||
"kind": host.key(), "type": old.type_id(), "target": new.type_id(), "side": if side == RenovationSide::Outside { "outside" } else { "inside" },
|
||||
"old": old.type_layers().iter().zip(&m.old).map(|(l, f)| layer(l, *f)).collect::<Vec<_>>(),
|
||||
"new": new.type_layers().iter().zip(&m.new).map(|(l, f)| layer(l, *f)).collect::<Vec<_>>(),
|
||||
"oldStrip": strip(Shown::Old), "newStrip": strip(Shown::New), "result": strip(Shown::Both),
|
||||
"walls": walls, "renovated": renovated,
|
||||
"elements": elements, "renovated": renovated,
|
||||
})
|
||||
}
|
||||
|
||||
/// Abfrage `renovationPairs` (Umbau-Panel): je Bestandstyp mit Sanierungstyp das Ziel und die Anzahl Wände bzw.
|
||||
/// sanierter Wände; dazu die Zahl aller sanierten Wände.
|
||||
/// Abfrage `renovationPairs` (Umbau-Panel): je Bestandstyp mit Sanierungstyp (Wände, Decken, Dächer) das Ziel und die
|
||||
/// Anzahl Elemente bzw. sanierter Elemente; dazu die Zahl aller sanierten Bauteile.
|
||||
pub fn pairs_json(p: &Project) -> serde_json::Value {
|
||||
let pairs: Vec<serde_json::Value> = p
|
||||
.wall_types
|
||||
.iter()
|
||||
.filter_map(|t| {
|
||||
let target = t.renovation_target.as_deref().filter(|s| !s.is_empty())?;
|
||||
let new = p.wall_types.iter().find(|x| x.id == target);
|
||||
let walls = p.walls.iter().filter(|w| origin(w).0 == t.id).count();
|
||||
let renovated = p.walls.iter().filter(|w| origin(w).0 == t.id && w.renovation.as_ref().is_some_and(marked)).count();
|
||||
Some(serde_json::json!({"type": t.id, "name": t.name, "target": target, "targetName": new.map(|n| n.name.clone()), "walls": walls, "renovated": renovated}))
|
||||
})
|
||||
.collect();
|
||||
let total = p.walls.iter().filter(|w| pair(p, w).is_some()).count();
|
||||
fn of<T: Layered>(p: &Project, types: &[T], host: Host, out: &mut Vec<serde_json::Value>) -> usize {
|
||||
let list = members(p, host);
|
||||
for t in types {
|
||||
let Some(target) = t.target().filter(|s| !s.is_empty()) else { continue };
|
||||
let new = types.iter().find(|x| x.type_id() == target);
|
||||
let elements = list.iter().filter(|x| x.0.as_deref() == Some(t.type_id())).count();
|
||||
let renovated = list.iter().filter(|x| x.0.as_deref() == Some(t.type_id()) && x.1).count();
|
||||
out.push(serde_json::json!({"kind": host.key(), "type": t.type_id(), "name": t.type_name(), "target": target, "targetName": new.map(|n| n.type_name()), "elements": elements, "renovated": renovated}));
|
||||
}
|
||||
list.iter().filter(|x| x.2.is_some()).count()
|
||||
}
|
||||
let mut pairs = Vec::new();
|
||||
let total = of(p, &p.wall_types, Host::Wall, &mut pairs) + of(p, p.ceiling_types.as_deref().unwrap_or(&[]), Host::Ceiling, &mut pairs) + of(p, p.roof_types.as_deref().unwrap_or(&[]), Host::Roof, &mut pairs);
|
||||
serde_json::json!({"pairs": pairs, "renovated": total})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -321,7 +321,7 @@ fn typ_paar_abfragen() {
|
||||
assert_eq!(v["target"], "neu");
|
||||
assert_eq!(v["old"].as_array().unwrap().iter().map(|x| x["fate"].as_str().unwrap()).collect::<Vec<_>>(), vec!["demolish", "demolish", "kept"]);
|
||||
assert_eq!(v["result"].as_array().unwrap().len(), 5);
|
||||
assert_eq!((v["walls"].as_u64(), v["renovated"].as_u64()), (Some(2), Some(2)));
|
||||
assert_eq!((v["elements"].as_u64(), v["renovated"].as_u64()), (Some(2), Some(2)));
|
||||
let all: Value = serde_json::from_str(&crate::queries::run(&p, "renovationPairs", &[], "").unwrap()).unwrap();
|
||||
assert_eq!(all["pairs"][0]["type"], "alt");
|
||||
assert_eq!(all["renovated"], 2);
|
||||
@@ -330,3 +330,129 @@ fn typ_paar_abfragen() {
|
||||
assert_eq!(crate::queries::run(&p, "renovationPair", &[], r#"{"type":"iw"}"#).unwrap(), "null");
|
||||
}
|
||||
|
||||
|
||||
/// [274] Decke C1 (oben → unten: Estrich 6 + Trittschall 2 + Beton 20) saniert zu Belag 1 + Estrich 5 + Trittschall 3 +
|
||||
/// Beton 20 (Rohdecke bleibt, Oberkante 1 cm höher); Dach RF1 (aussen → innen: Ziegel 4 + Sparren 16 + Verkleidung)
|
||||
/// saniert mit 12 cm Aufsparrendämmung (Sparren und Verkleidung bleiben, Ziegel neu). Dazu ein Querschnitt bei x = 2.5.
|
||||
fn decke_dach_fixture(renovated: bool) -> Value {
|
||||
let mut v = umbau_fixture();
|
||||
let lay = |ls: Vec<Layer>| serde_json::to_value(ls).unwrap();
|
||||
let ct = v["ceilingTypes"].as_array_mut().unwrap();
|
||||
ct.push(json!({"id": "decke-alt", "name": "Decke Bestand", "layers": lay(vec![l("screed", 0.06), l("insulation", 0.02), l("concrete", 0.2)]), "renovationTarget": "decke-neu"}));
|
||||
ct.push(json!({"id": "decke-neu", "name": "Decke saniert", "layers": lay(vec![l("render-int", 0.01), l("screed", 0.05), l("insulation", 0.03), l("concrete", 0.2)])}));
|
||||
let rt = v["roofTypes"].as_array_mut().unwrap();
|
||||
rt.push(json!({"id": "dach-alt", "name": "Dach Bestand", "layers": lay(vec![l("roof-tiles", 0.04), l("brick", 0.16), l("render-int", 0.0125)]), "renovationTarget": "dach-neu"}));
|
||||
rt.push(json!({"id": "dach-neu", "name": "Dach saniert", "layers": lay(vec![l("roof-tiles", 0.04), l("insulation", 0.12), l("brick", 0.16), l("render-int", 0.0125)])}));
|
||||
let r = if renovated { json!({"status": "existing", "renovated": true}) } else { json!({"status": "existing"}) };
|
||||
v["ceilings"][0]["ceilingTypeId"] = json!("decke-alt");
|
||||
v["ceilings"][0]["renovation"] = r.clone();
|
||||
v["roofs"][0]["roofTypeId"] = json!("dach-alt");
|
||||
v["roofs"][0]["renovation"] = r;
|
||||
v["drawingLevels"].as_array_mut().unwrap().push(json!({"id": "schnitt-q", "name": "Schnitt Q", "kind": "section", "visible": true, "locked": false, "linePoints": [{"x": 2.5, "y": -1}, {"x": 2.5, "y": 5}], "directionSign": 1}));
|
||||
v
|
||||
}
|
||||
|
||||
fn section_at(p: &Project, level: &str, filter: &str) -> Vec<Primitive> {
|
||||
let level = p.drawing_levels.iter().find(|l| l.id == level).unwrap();
|
||||
let v = json!({"level": level, "scale": 50, "detail": "mittel", "renovation": filter});
|
||||
let buf = crate::queries::run_bin(p, "sectionPlan", &[0.0, 1.0, 0.0], &v.to_string()).unwrap();
|
||||
crate::plan::buf::View::parse(&buf).and_then(|v| v.prims()).unwrap_or_default()
|
||||
}
|
||||
|
||||
fn u_project(p: &Project, filter: &str) -> Project {
|
||||
View::new(p, Some(filter), None).unwrap().resolve(p).project(p).unwrap_or_else(|| p.clone())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn decke_und_dach_je_schicht() {
|
||||
let p = project(&decke_dach_fixture(true));
|
||||
let u = View::new(&p, Some("umbauplan"), None).unwrap().resolve(&p);
|
||||
let kinds = |id: &str| u.slabs[id].pieces.iter().map(|q| q.kind).collect::<Vec<_>>();
|
||||
// Decke oben → unten: Belag neu, Estrich neu über altem Estrich …, Beton bleibt (Bezugsseite unten).
|
||||
let kc = kinds("C1");
|
||||
assert_eq!(kc.first(), Some(&Kind::New));
|
||||
assert_eq!(kc.last(), Some(&Kind::Kept));
|
||||
assert!(kc.contains(&Kind::NewOverDemolish), "{kc:?}");
|
||||
// Dach aussen → innen: Ziegel neu, Dämmung neu über alten Ziegeln, Sparren und Verkleidung bleiben.
|
||||
let kr = kinds("RF1");
|
||||
assert_eq!(kr.first(), Some(&Kind::New));
|
||||
assert_eq!(&kr[kr.len() - 2..], &[Kind::Kept, Kind::Kept]);
|
||||
// Oberste Schicht für Ansicht/Axo/Grundriss-Linien: rot.
|
||||
assert_eq!(u.element_style("C1").map(|s| s.fill.clone()), Some(default_style(RenovationStatus::New).fill));
|
||||
|
||||
// Endzustand: neuer Aufbau, Oberkante 1 cm höher (Rohdecke bleibt), Dachhaut 12 cm / cos 30° höher.
|
||||
let e = project_for_text(&p, "endzustand");
|
||||
let c1 = e.ceilings.as_ref().unwrap().iter().find(|c| c.id == "C1").unwrap();
|
||||
let (uk, ok) = e.ceiling_vertical_extent(c1);
|
||||
let (uk0, ok0) = p.ceiling_vertical_extent(&p.ceilings.as_ref().unwrap()[0]);
|
||||
assert!((uk - uk0).abs() < 1e-9 && (ok - ok0 - 0.01).abs() < 1e-9, "{uk0} {ok0} → {uk} {ok}");
|
||||
let rf = e.roofs.as_ref().unwrap().iter().find(|r| r.id == "RF1").unwrap();
|
||||
let dz = e.roof_base_elevation(rf) - p.roof_base_elevation(&p.roofs.as_ref().unwrap()[0]);
|
||||
assert!((dz - 0.12 / 30f64.to_radians().cos()).abs() < 1e-9, "{dz}");
|
||||
assert_eq!(e.roof_layers(rf).len(), 4);
|
||||
// Bestand: unverändert.
|
||||
let b = project_for_text(&p, "bestand");
|
||||
assert_eq!(b.ceilings.as_ref().unwrap()[0].ceiling_type_id.as_deref(), Some("decke-alt"));
|
||||
assert_eq!(b.roofs.as_ref().unwrap()[0].roof_type_id.as_deref(), Some("dach-alt"));
|
||||
|
||||
// Umgestellt und zurück: gleiche Auflösung, Bestand stellt den Ursprung her.
|
||||
let q = u_project(&p, "umbauplan");
|
||||
let u2 = View::new(&q, Some("umbauplan"), None).unwrap().resolve(&q);
|
||||
assert_eq!(u.slabs["C1"].type_id, u2.slabs["C1"].type_id);
|
||||
assert_eq!(u.slabs["RF1"].level, u2.slabs["RF1"].level);
|
||||
let back = u_project(&q, "bestand");
|
||||
let c = &back.ceilings.as_ref().unwrap()[0];
|
||||
assert_eq!((c.ceiling_type_id.as_deref(), c.top.is_none(), c.extra.0.contains_key(ORIGIN)), (Some("decke-alt"), true, false));
|
||||
let r = &back.roofs.as_ref().unwrap()[0];
|
||||
assert_eq!((r.roof_type_id.as_deref(), r.base_elevation), (Some("dach-alt"), None));
|
||||
|
||||
// Schnitt quer durch Decke und Dach: Umbauplan mit roten Schichten (mehr als ohne Sanierung), Abbruch gelb.
|
||||
let plain = project(&decke_dach_fixture(false));
|
||||
let (yellow, red) = (default_style(RenovationStatus::Demolish).fill, default_style(RenovationStatus::New).fill);
|
||||
let count = |v: &[Primitive], c: &str| v.iter().filter(|q| matches!(q, Primitive::Polygon { fill, .. } if fill == c)).count();
|
||||
let (su, su0) = (section_at(&p, "schnitt-q", "umbauplan"), section_at(&plain, "schnitt-q", "umbauplan"));
|
||||
assert!(count(&su, &red) > count(&su0, &red), "{} {}", count(&su, &red), count(&su0, &red));
|
||||
assert!(count(§ion_at(&p, "schnitt-q", "abbruch"), &yellow) > count(§ion_at(&plain, "schnitt-q", "abbruch"), &yellow));
|
||||
assert_eq!(count(§ion_at(&p, "schnitt-q", "bestand"), &red), 0);
|
||||
|
||||
// 3D: geschichtete Platten der Decke je Schicht (rot und grau im Umbauplan).
|
||||
let parts: Value = serde_json::from_str(&crate::queries::run(&p, "model3dParts", &[1.0, 1.0, 0.0], r#"{"renovation":"umbauplan"}"#).unwrap()).unwrap();
|
||||
let rgb = |s: RenovationStatus| crate::style::hex_to_rgb(&default_style(s).fill, [0.0; 3]);
|
||||
let cols: Vec<[f64; 3]> = parts["slabs"].as_array().unwrap().iter().filter(|s| s["ceilingId"] == "C1").map(|s| [0, 1, 2].map(|k| s["color"][k].as_f64().unwrap())).collect();
|
||||
let near = |a: &[f64; 3], b: [f64; 3]| (0..3).all(|k| (a[k] - b[k]).abs() < 1e-6);
|
||||
assert!(cols.iter().any(|c| near(c, rgb(RenovationStatus::New))) && cols.iter().any(|c| near(c, rgb(RenovationStatus::Existing))), "{cols:?}");
|
||||
|
||||
// Abfragen: Paare aller drei Bauteilarten.
|
||||
let all: Value = serde_json::from_str(&crate::queries::run(&p, "renovationPairs", &[], "").unwrap()).unwrap();
|
||||
let kinds: Vec<&str> = all["pairs"].as_array().unwrap().iter().map(|x| x["kind"].as_str().unwrap()).collect();
|
||||
assert!(kinds.contains(&"ceiling") && kinds.contains(&"roof"), "{kinds:?}");
|
||||
assert_eq!(all["renovated"], 2);
|
||||
let pc: Value = serde_json::from_str(&crate::queries::run(&p, "renovationPair", &[], r#"{"type":"decke-alt","kind":"ceiling"}"#).unwrap()).unwrap();
|
||||
assert_eq!((pc["target"].as_str(), pc["elements"].as_u64(), pc["renovated"].as_u64()), (Some("decke-neu"), Some(1), Some(1)));
|
||||
assert_eq!(pc["old"].as_array().unwrap().last().unwrap()["fate"], "kept");
|
||||
// Unsinn: Dach ohne Typ, Decke mit fehlendem Sanierungstyp — keine Sanierung, kein Panic.
|
||||
let mut q = p.clone();
|
||||
q.roofs.as_mut().unwrap()[0].roof_type_id = None;
|
||||
q.ceilings.as_mut().unwrap()[0].renovation.as_mut().unwrap().new_type_id = Some("gibts-nicht".into());
|
||||
let r = View::new(&q, Some("umbauplan"), None).unwrap().resolve(&q);
|
||||
assert!(r.slabs.is_empty());
|
||||
let _ = section_at(&q, "schnitt-q", "umbauplan");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn ifc_status_je_schicht() {
|
||||
let p = project(&decke_dach_fixture(true));
|
||||
let (old, new) = ifc_layer_status(&p, "C1").unwrap();
|
||||
assert_eq!(old, "Zementestrich 6.0 cm: DEMOLISH; Wärmedämmung 2.0 cm: DEMOLISH; Beton 20.0 cm: EXISTING");
|
||||
assert!(new.starts_with("Innenputz 1.0 cm: NEW") && new.ends_with("Beton 20.0 cm: EXISTING"), "{new}");
|
||||
assert!(ifc_layer_status(&p, "RF1").is_some() && ifc_layer_status(&p, "W2").is_none() && ifc_layer_status(&p, "gibts-nicht").is_none());
|
||||
// Im Export: `Dossier_Umbau` mit den Listen, auch im Endzustand (umgestellte Decke über ihren Ursprung).
|
||||
for q in [p.clone(), project_for_text(&p, "endzustand").into_owned()] {
|
||||
let f = crate::ifc_data::ifc_export_data(&q, &crate::ifc_data::IfcOptions::default()).unwrap();
|
||||
let (_, text) = crate::export_flat::from_bytes(&f.to_bytes()).unwrap();
|
||||
let s: Vec<&str> = text.split('\0').collect();
|
||||
for want in ["SchichtenBestand", "SchichtenSanierung", old.as_str()] {
|
||||
assert!(s.contains(&want), "fehlt: {want}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -136,8 +136,10 @@ export type { RenovationStyleView, RenovationStyleSet, ResolvedRenovationStyles
|
||||
export {
|
||||
wallBuildUp, buildUpKey, parseBuildUpKey, setBuildUpOps, commonBuildUp, renovateAllOfTypeOps, createRenovationTypeOps, setTypePairOps,
|
||||
renovationPair, renovationPairs,
|
||||
renovationTypes, hostTypeId, RENOVATION_HOSTS,
|
||||
} from "../model/renovation";
|
||||
export type { RenovationBuildUp, RenovationPair, RenovationPairLayer, RenovationStripPiece, RenovationPairsInfo } from "../model/renovation";
|
||||
export type { RenovationHost, LayeredType } from "../model/renovation";
|
||||
export { buildUmbauSampleProject } from "../model/sampleProjectUmbau";
|
||||
// [272] Varianten: Sätze, Kombinationen, Zuweisen/Kopieren/Übernehmen (Regeln im Kern `design_options.rs`, Sichtbarkeit `renovation.rs`)
|
||||
export {
|
||||
|
||||
+12
-1
@@ -4809,7 +4809,7 @@ export const de = {
|
||||
"renovation.strip.result": "Ergebnis",
|
||||
"renovation.panel.sanierung.title": "Sanierung",
|
||||
"renovation.panel.sanierung.count": "Sanierte Bauteile: {n}",
|
||||
"renovation.panel.sanierung.empty": "Noch kein Sanierungstyp. Wandtyp wählen und „Sanierungstyp anlegen …“.",
|
||||
"renovation.panel.sanierung.empty": "Noch kein Sanierungstyp. Wand-, Decken- oder Dachtyp wählen und „Sanierungstyp anlegen …“.",
|
||||
"renovation.panel.sanierung.walls": "{r} von {n} Wänden saniert",
|
||||
"renovation.panel.sanierung.renovateAll": "Alle Wände vom Typ sanieren",
|
||||
"renovation.panel.sanierung.create": "Sanierungstyp anlegen …",
|
||||
@@ -4825,6 +4825,17 @@ export const de = {
|
||||
"renovation.panel.sanierung.reset": "Automatisch zuordnen",
|
||||
"renovation.panel.sanierung.remove": "Sanierungstyp entfernen",
|
||||
"renovation.panel.sanierung.editLayers": "Schichten in den Ressourcen …",
|
||||
"renovation.panel.sanierung.host.wall": "Wände",
|
||||
"renovation.panel.sanierung.host.ceiling": "Decken",
|
||||
"renovation.panel.sanierung.host.roof": "Dächer",
|
||||
"renovation.panel.sanierung.ceilings": "{r} von {n} Decken saniert",
|
||||
"renovation.panel.sanierung.roofs": "{r} von {n} Dächern saniert",
|
||||
"renovation.panel.sanierung.renovateAll.ceiling": "Alle Decken vom Typ sanieren",
|
||||
"renovation.panel.sanierung.renovateAll.roof": "Alle Dächer vom Typ sanieren",
|
||||
"renovation.panel.sanierung.side.ceiling.inside": "unten (Rohdecke bleibt)",
|
||||
"renovation.panel.sanierung.side.ceiling.outside": "oben (Oberkante bleibt)",
|
||||
"renovation.panel.sanierung.side.roof.inside": "innen (Tragwerk bleibt)",
|
||||
"renovation.panel.sanierung.side.roof.outside": "aussen (Dachhaut bleibt)",
|
||||
"renovation.fate.auto": "automatisch",
|
||||
"renovation.fate.kept": "Bestand",
|
||||
"renovation.fate.demolish": "Abbruch",
|
||||
|
||||
+12
-1
@@ -4795,7 +4795,7 @@ export const en: Record<TranslationKey, string> = {
|
||||
"renovation.strip.result": "Result",
|
||||
"renovation.panel.sanierung.title": "Refurbishment",
|
||||
"renovation.panel.sanierung.count": "Refurbished elements: {n}",
|
||||
"renovation.panel.sanierung.empty": "No refurbishment type yet. Pick a wall type and “Create refurbishment type …”.",
|
||||
"renovation.panel.sanierung.empty": "No refurbishment type yet. Pick a wall, slab or roof type and “Create refurbishment type …”.",
|
||||
"renovation.panel.sanierung.walls": "{r} of {n} walls refurbished",
|
||||
"renovation.panel.sanierung.renovateAll": "Refurbish all walls of this type",
|
||||
"renovation.panel.sanierung.create": "Create refurbishment type …",
|
||||
@@ -4811,6 +4811,17 @@ export const en: Record<TranslationKey, string> = {
|
||||
"renovation.panel.sanierung.reset": "Map automatically",
|
||||
"renovation.panel.sanierung.remove": "Remove refurbishment type",
|
||||
"renovation.panel.sanierung.editLayers": "Layers in the resources …",
|
||||
"renovation.panel.sanierung.host.wall": "Walls",
|
||||
"renovation.panel.sanierung.host.ceiling": "Slabs",
|
||||
"renovation.panel.sanierung.host.roof": "Roofs",
|
||||
"renovation.panel.sanierung.ceilings": "{r} of {n} slabs refurbished",
|
||||
"renovation.panel.sanierung.roofs": "{r} of {n} roofs refurbished",
|
||||
"renovation.panel.sanierung.renovateAll.ceiling": "Refurbish all slabs of this type",
|
||||
"renovation.panel.sanierung.renovateAll.roof": "Refurbish all roofs of this type",
|
||||
"renovation.panel.sanierung.side.ceiling.inside": "bottom (structural slab stays)",
|
||||
"renovation.panel.sanierung.side.ceiling.outside": "top (top level stays)",
|
||||
"renovation.panel.sanierung.side.roof.inside": "inside (structure stays)",
|
||||
"renovation.panel.sanierung.side.roof.outside": "outside (roof skin stays)",
|
||||
"renovation.fate.auto": "automatic",
|
||||
"renovation.fate.kept": "Existing",
|
||||
"renovation.fate.demolish": "Demolish",
|
||||
|
||||
+63
-30
@@ -327,7 +327,7 @@ export function phaseUsage(project: Project, phaseId: string): number {
|
||||
/** Neuer Aufbau einer Wand: keiner, der Sanierungstyp ihres Wandtyps oder ein anderer Wandtyp (Ausnahme). */
|
||||
export type RenovationBuildUp = { kind: "none" } | { kind: "type" } | { kind: "other"; typeId: string };
|
||||
|
||||
/** Neuer Aufbau einer Wand aus ihren Umbau-Angaben. */
|
||||
/** Neuer Aufbau eines Bauteils (Wand, Decke, Dach) aus seinen Umbau-Angaben. */
|
||||
export function wallBuildUp(r: Renovation | undefined | null): RenovationBuildUp {
|
||||
if (r?.newTypeId) return { kind: "other", typeId: r.newTypeId };
|
||||
return r?.renovated ? { kind: "type" } : { kind: "none" };
|
||||
@@ -358,22 +358,52 @@ function withBuildUp(r: Renovation | undefined, b: RenovationBuildUp): Renovatio
|
||||
return plain ? undefined : base;
|
||||
}
|
||||
|
||||
/** Ops: neuer Aufbau für die Wände `ids` (ein Undo-Schritt); Status/Etappe bleiben. */
|
||||
export function setBuildUpOps(project: Project, ids: Iterable<string>, b: RenovationBuildUp): CoreOp[] {
|
||||
/** [274] Bauteilart einer Sanierung je Schicht: Wand, Decke oder Dach (je mit eigenem Typ-Katalog). */
|
||||
export type RenovationHost = "wall" | "ceiling" | "roof";
|
||||
export const RENOVATION_HOSTS: readonly RenovationHost[] = ["wall", "ceiling", "roof"];
|
||||
|
||||
/** Element-Liste, Typ-Liste und Typ-Feld je Bauteilart. */
|
||||
const HOST = {
|
||||
wall: { items: "walls", types: "wallTypes", typeKey: "wallTypeId" },
|
||||
ceiling: { items: "ceilings", types: "ceilingTypes", typeKey: "ceilingTypeId" },
|
||||
roof: { items: "roofs", types: "roofTypes", typeKey: "roofTypeId" },
|
||||
} as const;
|
||||
|
||||
/** Mehrschichtiger Typ mit Sanierungs-Angaben (Wand-, Decken- oder Dachtyp). */
|
||||
export type LayeredType = Pick<WallType, "id" | "name" | "layers" | "renovationTarget" | "renovationSide" | "renovationOld" | "renovationNew">;
|
||||
type HostItem = { id: string; renovation?: Renovation } & Record<string, unknown>;
|
||||
|
||||
/** Typen einer Bauteilart (Wandtypen, Deckentypen, Dachtypen). */
|
||||
export function renovationTypes(project: Project, host: RenovationHost = "wall"): readonly LayeredType[] {
|
||||
return ((project as unknown as Record<string, unknown>)[HOST[host].types] as LayeredType[] | undefined) ?? [];
|
||||
}
|
||||
|
||||
function hostItems(project: Project, host: RenovationHost): readonly HostItem[] {
|
||||
return ((project as unknown as Record<string, unknown>)[HOST[host].items] as HostItem[] | undefined) ?? [];
|
||||
}
|
||||
|
||||
/** Typ-Id eines Elements (Wand-, Decken-, Dachtyp; Decke/Dach ohne Typ: `undefined`). */
|
||||
export function hostTypeId(e: unknown, host: RenovationHost = "wall"): string | undefined {
|
||||
return ((e as Record<string, unknown>)[HOST[host].typeKey] as string | undefined) || undefined;
|
||||
}
|
||||
|
||||
/** Ops: neuer Aufbau für die Elemente `ids` der Bauteilart `host` (ein Undo-Schritt); Status/Etappe bleiben. */
|
||||
export function setBuildUpOps(project: Project, ids: Iterable<string>, b: RenovationBuildUp, host: RenovationHost = "wall"): CoreOp[] {
|
||||
const set = new Set(ids);
|
||||
return patchItems(project, "walls", set, (w) => {
|
||||
const fn = (w: HostItem): HostItem => {
|
||||
const next = withBuildUp(w.renovation, b);
|
||||
const { renovation: _drop, ...rest } = w;
|
||||
void _drop;
|
||||
return next ? { ...rest, renovation: next } : rest;
|
||||
});
|
||||
};
|
||||
return patchItems(project, HOST[host].items, set, fn as never);
|
||||
}
|
||||
|
||||
/** Gemeinsamer Aufbau-Schlüssel ({@link buildUpKey}) der Wände `ids`: `"mixed"` bei verschiedenen, `null` ohne Wände. */
|
||||
export function commonBuildUp(project: Project, ids: Iterable<string>): string | null {
|
||||
/** Gemeinsamer Aufbau-Schlüssel ({@link buildUpKey}) der Elemente `ids`: `"mixed"` bei verschiedenen, `null` ohne. */
|
||||
export function commonBuildUp(project: Project, ids: Iterable<string>, host: RenovationHost = "wall"): string | null {
|
||||
const set = new Set(ids);
|
||||
let out: string | null = null;
|
||||
for (const w of project.walls) {
|
||||
for (const w of hostItems(project, host)) {
|
||||
if (!set.has(w.id)) continue;
|
||||
const k = buildUpKey(wallBuildUp(w.renovation));
|
||||
if (out === null) out = k;
|
||||
@@ -382,30 +412,30 @@ export function commonBuildUp(project: Project, ids: Iterable<string>): string |
|
||||
return out;
|
||||
}
|
||||
|
||||
/** Ops: alle Wände des Bestandstyps `typeId` sanieren (Sanierungstyp des Typs; ein Undo-Schritt). */
|
||||
export function renovateAllOfTypeOps(project: Project, typeId: string): CoreOp[] {
|
||||
const ids = project.walls.filter((w) => w.wallTypeId === typeId && renovationStatus(w.renovation) === "existing").map((w) => w.id);
|
||||
return setBuildUpOps(project, ids, { kind: "type" });
|
||||
/** Ops: alle Elemente des Bestandstyps `typeId` sanieren (Sanierungstyp des Typs; ein Undo-Schritt). */
|
||||
export function renovateAllOfTypeOps(project: Project, typeId: string, host: RenovationHost = "wall"): CoreOp[] {
|
||||
const ids = hostItems(project, host).filter((w) => hostTypeId(w, host) === typeId && renovationStatus(w.renovation) === "existing").map((w) => w.id);
|
||||
return setBuildUpOps(project, ids, { kind: "type" }, host);
|
||||
}
|
||||
|
||||
/** Nächste freie Wandtyp-Id mit Präfix. */
|
||||
function freeTypeId(project: Project, base: string): string {
|
||||
const used = new Set(project.wallTypes.map((t) => t.id));
|
||||
/** Nächste freie Typ-Id mit Präfix. */
|
||||
function freeTypeId(project: Project, base: string, host: RenovationHost): string {
|
||||
const used = new Set(renovationTypes(project, host).map((t) => t.id));
|
||||
let i = 1;
|
||||
while (used.has(`${base}-${i}`)) i++;
|
||||
return `${base}-${i}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ops: „Sanierungstyp anlegen …“ — Kopie des Bestandstyps `typeId` als neuer Wandtyp `name` (zum Anpassen der Schichten)
|
||||
* Ops: „Sanierungstyp anlegen …“ — Kopie des Bestandstyps `typeId` als neuer Typ `name` (zum Anpassen der Schichten)
|
||||
* und als Sanierungstyp des Bestandstyps eingetragen. Liefert die Ops und die neue Id.
|
||||
*/
|
||||
export function createRenovationTypeOps(project: Project, typeId: string, name: string): { ops: CoreOp[]; id: string } {
|
||||
const src = project.wallTypes.find((t) => t.id === typeId);
|
||||
export function createRenovationTypeOps(project: Project, typeId: string, name: string, host: RenovationHost = "wall"): { ops: CoreOp[]; id: string } {
|
||||
const src = renovationTypes(project, host).find((t) => t.id === typeId);
|
||||
if (!src) return { ops: [], id: "" };
|
||||
const id = freeTypeId(project, `${typeId}-saniert`);
|
||||
const copy: WallType = { id, name, layers: src.layers.map((l) => ({ ...l })) };
|
||||
return { ops: [...addItems("wallTypes", [copy]), ...setTypePairOps(project, typeId, { target: id, old: null, new: null })], id };
|
||||
const id = freeTypeId(project, `${typeId}-saniert`, host);
|
||||
const copy: LayeredType = { id, name, layers: src.layers.map((l) => ({ ...l })) };
|
||||
return { ops: [...addItems(HOST[host].types, [copy] as never), ...setTypePairOps(project, typeId, { target: id, old: null, new: null }, host)], id };
|
||||
}
|
||||
|
||||
/** Ops: Typ-Paar am Bestandstyp ändern (Sanierungstyp, Bezugsseite, manuelle Zuordnung; `null` entfernt). */
|
||||
@@ -413,10 +443,11 @@ export function setTypePairOps(
|
||||
project: Project,
|
||||
typeId: string,
|
||||
patch: { target?: string | null; side?: RenovationSide | null; old?: LayerRenovation[] | null; new?: LayerRenovation[] | null },
|
||||
host: RenovationHost = "wall",
|
||||
): CoreOp[] {
|
||||
return patchItem(project, "wallTypes", typeId, (t) => {
|
||||
const next: WallType = { ...t };
|
||||
const put = <K extends keyof WallType>(k: K, v: WallType[K] | null | undefined) => {
|
||||
return patchItem(project, HOST[host].types, typeId, ((t: LayeredType) => {
|
||||
const next: LayeredType = { ...t };
|
||||
const put = <K extends keyof LayeredType>(k: K, v: LayeredType[K] | null | undefined) => {
|
||||
if (v === undefined) return;
|
||||
if (v === null || (Array.isArray(v) && v.every((x) => x === "auto"))) delete next[k];
|
||||
else next[k] = v;
|
||||
@@ -426,7 +457,7 @@ export function setTypePairOps(
|
||||
put("renovationOld", patch.old);
|
||||
put("renovationNew", patch.new);
|
||||
return next;
|
||||
});
|
||||
}) as never);
|
||||
}
|
||||
|
||||
/** Schicht eines Typ-Paars (Kern-Abfrage `renovationPair`). */
|
||||
@@ -444,6 +475,7 @@ export interface RenovationStripPiece {
|
||||
fill: string;
|
||||
}
|
||||
export interface RenovationPair {
|
||||
kind: RenovationHost;
|
||||
type: string;
|
||||
target: string;
|
||||
side: RenovationSide;
|
||||
@@ -452,21 +484,22 @@ export interface RenovationPair {
|
||||
oldStrip: RenovationStripPiece[];
|
||||
newStrip: RenovationStripPiece[];
|
||||
result: RenovationStripPiece[];
|
||||
walls: number;
|
||||
/** Elemente des Bestandstyps bzw. davon mit diesem Sanierungstyp saniert. */
|
||||
elements: number;
|
||||
renovated: number;
|
||||
}
|
||||
|
||||
/** Typ-Paar Bestandstyp → Sanierungstyp (`target` fehlt = eingetragener); `null` ohne gültiges Paar. */
|
||||
export function renovationPair(project: Project, typeId: string, target?: string): RenovationPair | null {
|
||||
return documentFor(project).query<RenovationPair | null>("renovationPair", [], JSON.stringify({ type: typeId, target: target ?? "" }));
|
||||
export function renovationPair(project: Project, typeId: string, target?: string, host: RenovationHost = "wall"): RenovationPair | null {
|
||||
return documentFor(project).query<RenovationPair | null>("renovationPair", [], JSON.stringify({ type: typeId, target: target ?? "", kind: host }));
|
||||
}
|
||||
|
||||
export interface RenovationPairsInfo {
|
||||
pairs: { type: string; name: string; target: string; targetName: string | null; walls: number; renovated: number }[];
|
||||
pairs: { kind: RenovationHost; type: string; name: string; target: string; targetName: string | null; elements: number; renovated: number }[];
|
||||
renovated: number;
|
||||
}
|
||||
|
||||
/** Alle Typ-Paare mit Zählern (Umbau-Panel „Sanierung“). */
|
||||
/** Alle Typ-Paare (Wände, Decken, Dächer) mit Zählern (Umbau-Panel „Sanierung“). */
|
||||
export function renovationPairs(project: Project): RenovationPairsInfo {
|
||||
return documentFor(project).query<RenovationPairsInfo>("renovationPairs");
|
||||
}
|
||||
@@ -78,7 +78,7 @@ describe("[274] Sanierung je Schicht", () => {
|
||||
// Alles „automatisch“: Feld weg.
|
||||
const u = applyOps(s, setTypePairOps(s, "aw", { old: ["auto", "auto"] }));
|
||||
expect(u.wallTypes.find((t) => t.id === "aw")).not.toHaveProperty("renovationOld");
|
||||
expect(renovationPairs(u).pairs.map((x) => x.type).sort()).toEqual(["aw", "aw-bestand"]);
|
||||
expect(renovationPairs(u).pairs.filter((x) => x.kind === "wall").map((x) => x.type).sort()).toEqual(["aw", "aw-bestand"]);
|
||||
});
|
||||
|
||||
it("Beispiel Umbau: Typ-Paar der Südwand, Zähler, Grundriss und GF je Filter", () => {
|
||||
@@ -87,7 +87,8 @@ describe("[274] Sanierung je Schicht", () => {
|
||||
expect(pr?.old.map((l) => l.fate)).toEqual(["demolish", "demolish", "kept"]);
|
||||
expect(pr?.new.map((l) => l.fate)).toEqual(["new", "new", "kept"]);
|
||||
expect(pr?.result.map((q) => q.kind)).toEqual(["new", "new", "newOverDemolish", "newOverDemolish", "kept"]);
|
||||
expect(renovationPairs(p).renovated).toBe(1);
|
||||
// Südwand W1, Decke C1, Dach RF1.
|
||||
expect(renovationPairs(p).renovated).toBe(3);
|
||||
// Grundriss: Abbruch gelb, Umbauplan mit gelber gestrichelter Kontur über Rot.
|
||||
const dashedYellow = (prims: ReturnType<typeof plan>) => prims.some((x) => x.kind === "line" && !!x.dash && x.color === "#e8c35a");
|
||||
expect(dashedYellow(plan(p, "umbauplan"))).toBe(true);
|
||||
@@ -99,4 +100,37 @@ describe("[274] Sanierung je Schicht", () => {
|
||||
const gfB = (q: Project) => computeAreaTable(q, "bestand").total.gf;
|
||||
expect(gfB(p)).toBeCloseTo(gfB(unsaniert), 9);
|
||||
});
|
||||
|
||||
it("Decken und Dächer: Typ-Paare, Ops je Bauteilart, Bezugsseite unten", () => {
|
||||
const p = buildUmbauSampleProject();
|
||||
const kinds = renovationPairs(p).pairs.map((x) => `${x.kind}:${x.type}:${x.renovated}/${x.elements}`).sort();
|
||||
expect(kinds).toEqual(["ceiling:decke-bestand:1/1", "roof:dach-bestand:1/1", "wall:aw-bestand:1/1"]);
|
||||
// Decke: Rohdecke bleibt (Bezugsseite unten = „inside“), darüber alles neu.
|
||||
const pc = renovationPair(p, "decke-bestand", undefined, "ceiling");
|
||||
expect(pc?.kind).toBe("ceiling");
|
||||
expect(pc?.side).toBe("inside");
|
||||
expect(pc?.old.map((l) => l.fate)).toEqual(["demolish", "demolish", "demolish", "kept"]);
|
||||
expect(pc?.new.map((l) => l.fate)).toEqual(["new", "new", "new", "kept"]);
|
||||
// Dach: Sparren und Verkleidung bleiben, Ziegel ab, Dämmung und Ziegel neu.
|
||||
const pr = renovationPair(p, "dach-bestand", undefined, "roof");
|
||||
expect(pr?.old.map((l) => l.fate)).toEqual(["demolish", "kept", "kept"]);
|
||||
expect(pr?.new.map((l) => l.fate)).toEqual(["new", "new", "kept", "kept"]);
|
||||
// Bezugsseite oben (gleiche Gesamtdicke: die Rohdecke liegt auch von oben her gleich und bleibt).
|
||||
const q = applyOps(p, setTypePairOps(p, "decke-bestand", { side: "outside" }, "ceiling"));
|
||||
expect(q.ceilingTypes?.find((t) => t.id === "decke-bestand")?.renovationSide).toBe("outside");
|
||||
expect(renovationPair(q, "decke-bestand", undefined, "ceiling")?.side).toBe("outside");
|
||||
expect(renovationPair(q, "decke-bestand", undefined, "ceiling")?.old.map((l) => l.fate)).toEqual(["demolish", "demolish", "demolish", "kept"]);
|
||||
// Ops je Art: keiner / wie Typ, gemeinsamer Wert, Sanierungstyp anlegen, alle sanieren.
|
||||
const none = applyOps(p, setBuildUpOps(p, ["C1"], { kind: "none" }, "ceiling"));
|
||||
expect(none.ceilings?.find((c) => c.id === "C1")?.renovation).toEqual({ status: "existing", phase: "etappe-1" });
|
||||
expect(commonBuildUp(p, ["C1"], "ceiling")).toBe("type");
|
||||
expect(commonBuildUp(p, ["RF1"], "roof")).toBe("type");
|
||||
expect(commonBuildUp(p, ["W1"], "ceiling")).toBeNull();
|
||||
const { ops, id } = createRenovationTypeOps(p, "dg-massiv", "Decke saniert", "ceiling");
|
||||
const r = applyOps(p, ops);
|
||||
expect(r.ceilingTypes?.find((t) => t.id === "dg-massiv")?.renovationTarget).toBe(id);
|
||||
const s = applyOps(r, renovateAllOfTypeOps(r, "dg-massiv", "ceiling"));
|
||||
// C2 (Anbau) ist neu: nicht saniert; sonst trägt keine Decke „dg-massiv“.
|
||||
expect((s.ceilings ?? []).filter((c) => c.renovation?.renovated).map((c) => c.id)).toEqual(["C1"]);
|
||||
});
|
||||
});
|
||||
@@ -11,9 +11,13 @@
|
||||
// [274] Sanierung je Schicht: die Südwand W1 ist eine Aussenwand „Beton 20 + Dämmung 10 + Aussenputz“ (Bestandstyp
|
||||
// „aw-bestand“) mit dem Sanierungstyp „aw-saniert“ (Beton bleibt, Dämmung und Putz werden abgebrochen, neue Dämmung 20 +
|
||||
// neuer Putz), saniert in Etappe 1: Kern bleibt an seiner Stelle, die Fassade rückt 10 cm nach aussen.
|
||||
// Ebenso je Schicht saniert (Etappe 1): die Geschossdecke C1 über dem EG (Rohdecke bleibt; Linoleum, Unterlagsboden und
|
||||
// Trittschall werden abgebrochen, neu Parkett + Unterlagsboden + dickerer Trittschall, gleiche Gesamtdicke) und das Dach
|
||||
// RF1 (Sparren und Verkleidung bleiben; Ziegel ab, neu 12 cm Aufsparrendämmung + Ziegel: die Dachhaut hebt sich). Schnitt C
|
||||
// (x = 2) schneidet Wand, Decke und Dach.
|
||||
// Nur Modellfelder, keine Kern-Befehle: das Modul ist ohne geladenen Kern auswertbar.
|
||||
|
||||
import type { Ceiling, Drawing2D, DrawingLevel, Opening, Project, Renovation, Room, Tree, Wall, WallType } from "./types";
|
||||
import type { Ceiling, CeilingType, Component, Drawing2D, DrawingLevel, Opening, Project, Renovation, Roof, RoofType, Room, Tree, Wall, WallType } from "./types";
|
||||
import { sampleProject } from "./sampleProject";
|
||||
|
||||
const E1: Renovation = { status: "new", phase: "etappe-1" };
|
||||
@@ -87,10 +91,67 @@ export function buildUmbauSampleProject(): Project {
|
||||
// Fenster des Anbaus: ohne eigenen Status, folgt der neuen Wand.
|
||||
win("O5", "W11", 0.9, 1.2),
|
||||
);
|
||||
const c1 = (base.ceilings ?? [])[0];
|
||||
// [274] Decke und Dach je Schicht saniert (Typ-Paare oben → unten bzw. aussen → innen).
|
||||
const components: Component[] = [
|
||||
...base.components,
|
||||
{ id: "linoleum", name: "Linoleum", color: "#9c8f6e", hatchId: "none", joinPriority: 5 },
|
||||
{ id: "parquet", name: "Parkett", color: "#c49a6c", hatchId: "none", joinPriority: 5 },
|
||||
{ id: "timber", name: "Sparren (Holz)", color: "#c8a26b", hatchId: "diagonal", joinPriority: 40 },
|
||||
];
|
||||
const ceilingTypes: CeilingType[] = [
|
||||
...(base.ceilingTypes ?? []),
|
||||
{
|
||||
id: "decke-bestand",
|
||||
name: "Geschossdecke Linoleum (Bestand)",
|
||||
layers: [
|
||||
{ componentId: "linoleum", thickness: 0.005 },
|
||||
{ componentId: "screed", thickness: 0.055 },
|
||||
{ componentId: "insulation", thickness: 0.02 },
|
||||
{ componentId: "concrete", thickness: 0.2 },
|
||||
],
|
||||
renovationTarget: "decke-saniert",
|
||||
},
|
||||
{
|
||||
id: "decke-saniert",
|
||||
name: "Geschossdecke Parkett (saniert)",
|
||||
layers: [
|
||||
{ componentId: "parquet", thickness: 0.01 },
|
||||
{ componentId: "screed", thickness: 0.04 },
|
||||
{ componentId: "insulation", thickness: 0.03 },
|
||||
{ componentId: "concrete", thickness: 0.2 },
|
||||
],
|
||||
},
|
||||
];
|
||||
const roofTypes: RoofType[] = [
|
||||
...(base.roofTypes ?? []),
|
||||
{
|
||||
id: "dach-bestand",
|
||||
name: "Steildach Sparren (Bestand)",
|
||||
layers: [
|
||||
{ componentId: "roof-tiles", thickness: 0.04 },
|
||||
{ componentId: "timber", thickness: 0.16 },
|
||||
{ componentId: "render-int", thickness: 0.0125 },
|
||||
],
|
||||
renovationTarget: "dach-saniert",
|
||||
},
|
||||
{
|
||||
id: "dach-saniert",
|
||||
name: "Steildach Aufsparrendämmung (saniert)",
|
||||
layers: [
|
||||
{ componentId: "roof-tiles", thickness: 0.04 },
|
||||
{ componentId: "insulation", thickness: 0.12 },
|
||||
{ componentId: "timber", thickness: 0.16 },
|
||||
{ componentId: "render-int", thickness: 0.0125 },
|
||||
],
|
||||
},
|
||||
];
|
||||
const R1: Renovation = { status: "existing", phase: "etappe-1", renovated: true };
|
||||
const roofs: Roof[] = (base.roofs ?? []).map((r) => (r.id === "RF1" ? { ...r, roofTypeId: "dach-bestand", renovation: R1 } : r));
|
||||
const c1: Ceiling = { ...(base.ceilings ?? [])[0], ceilingTypeId: "decke-bestand", renovation: R1 };
|
||||
const ceilings: Ceiling[] = [
|
||||
...(base.ceilings ?? []),
|
||||
{ ...c1, id: "C2", outline: [{ x: 0, y: 4 }, { x: 3, y: 4 }, { x: 3, y: 7 }, { x: 0, y: 7 }], renovation: E2 },
|
||||
c1,
|
||||
...(base.ceilings ?? []).slice(1),
|
||||
{ ...c1, ceilingTypeId: (base.ceilings ?? [])[0].ceilingTypeId, id: "C2", outline: [{ x: 0, y: 4 }, { x: 3, y: 4 }, { x: 3, y: 7 }, { x: 0, y: 7 }], renovation: E2 },
|
||||
];
|
||||
const r1 = (base.rooms ?? [])[0];
|
||||
const h = 0.1725;
|
||||
@@ -117,6 +178,10 @@ export function buildUmbauSampleProject(): Project {
|
||||
name: "Beispiel Umbau",
|
||||
drawingLevels: levels,
|
||||
wallTypes,
|
||||
components,
|
||||
ceilingTypes,
|
||||
roofTypes,
|
||||
roofs,
|
||||
walls,
|
||||
openings,
|
||||
ceilings,
|
||||
|
||||
@@ -237,7 +237,23 @@ export type Ceiling = {
|
||||
* damit Fuge/Schraffur-Auflösung identisch zur Wand bleiben. Eine „einschichtige"
|
||||
* Decke (SOLID) ist einfach ein Deckentyp mit genau einer Schicht.
|
||||
*/
|
||||
export type CeilingType = { id: string; name: string; layers: Array<Layer> };
|
||||
export type CeilingType = {
|
||||
id: string;
|
||||
name: string;
|
||||
layers: Array<Layer>;
|
||||
/**
|
||||
* [274] Sanierungstyp (Deckentyp-Id): neuer Aufbau aller als „saniert“ markierten Decken dieses (Bestands-)Typs.
|
||||
*/
|
||||
renovationTarget?: string;
|
||||
/**
|
||||
* [274] Bezugsseite der Sanierung (fehlt ⇒ innen); bei Decken: innen = unten (Rohdecke bleibt, die Oberkante verschiebt sich), aussen = oben (Oberkante bleibt).
|
||||
*/
|
||||
renovationSide?: RenovationSide;
|
||||
/** [274] Manuelle Zuordnung je Schicht dieses Bestandstyps (wie `WallType.renovationOld`). */
|
||||
renovationOld?: Array<LayerRenovation>;
|
||||
/** [274] Manuelle Zuordnung je Schicht des Sanierungstyps (wie `WallType.renovationNew`). */
|
||||
renovationNew?: Array<LayerRenovation>;
|
||||
};
|
||||
|
||||
/**
|
||||
* Ein Stift (ArchiCAD-Stiftsatz-Muster): ein reiner NAME/PLATZHALTER, der
|
||||
@@ -3688,6 +3704,18 @@ export type RoofType = {
|
||||
name: string;
|
||||
/** Aussen (Eindeckung) → innen (Verkleidung), analog `WallType.layers`. */
|
||||
layers: Array<Layer>;
|
||||
/**
|
||||
* [274] Sanierungstyp (Dachtyp-Id): neuer Aufbau aller als „saniert“ markierten Dächer dieses (Bestands-)Typs.
|
||||
*/
|
||||
renovationTarget?: string;
|
||||
/**
|
||||
* [274] Bezugsseite der Sanierung (fehlt ⇒ innen); innen = Tragwerk/Verkleidung bleibt, die Dachhaut verschiebt sich.
|
||||
*/
|
||||
renovationSide?: RenovationSide;
|
||||
/** [274] Manuelle Zuordnung je Schicht dieses Bestandstyps (wie `WallType.renovationOld`). */
|
||||
renovationOld?: Array<LayerRenovation>;
|
||||
/** [274] Manuelle Zuordnung je Schicht des Sanierungstyps (wie `WallType.renovationNew`). */
|
||||
renovationNew?: Array<LayerRenovation>;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,37 +1,49 @@
|
||||
// [274] Umbau-Panel, Abschnitt „Sanierung“: Typ-Paare Bestandstyp → Sanierungstyp mit Zählern, „Alle Wände vom Typ
|
||||
// sanieren“ (ein Undo-Schritt), „Sanierungstyp anlegen …“ (Kopie des Bestandstyps) und der Typ-Paar-Editor: Alt und Neu
|
||||
// nebeneinander, Zuordnung je Schicht (automatisch oder manuell), Bezugsseite, Ergebnis-Streifen mit SIA-Farben.
|
||||
// Die Regeln (Zuordnung, Teilstücke) rechnet der Kern (`renovation::build_up`); gespeichert wird am Bestandstyp.
|
||||
// [274] Umbau-Panel, Abschnitt „Sanierung“: Typ-Paare Bestandstyp → Sanierungstyp für Wände, Decken und Dächer mit
|
||||
// Zählern, „Alle … vom Typ sanieren“ (ein Undo-Schritt), „Sanierungstyp anlegen …“ (Kopie des Bestandstyps) und der
|
||||
// Typ-Paar-Editor: Alt und Neu nebeneinander, Zuordnung je Schicht (automatisch oder manuell), Bezugsseite (Decken:
|
||||
// unten/oben), Ergebnis-Streifen mit SIA-Farben. Die Regeln (Zuordnung, Teilstücke) rechnet der Kern
|
||||
// (`renovation::build_up`, für alle drei Bauteilarten dieselbe); gespeichert wird am Bestandstyp.
|
||||
|
||||
import { useState } from "react";
|
||||
import { t } from "../i18n";
|
||||
import type { TranslationKey } from "../i18n";
|
||||
import { useStore } from "../state/appStore";
|
||||
import {
|
||||
RENOVATION_HOSTS,
|
||||
createRenovationTypeOps,
|
||||
renovateAllOfTypeOps,
|
||||
renovationPair,
|
||||
renovationPairs,
|
||||
renovationTypes,
|
||||
setTypePairOps,
|
||||
} from "../core";
|
||||
import type { RenovationHost } from "../core";
|
||||
import type { LayerRenovation, Project, RenovationSide } from "../model/types";
|
||||
import { RenovationStrip } from "../ui/RenovationStrip";
|
||||
import { usePanelHostAction } from "./host";
|
||||
|
||||
function PairEditor({ project, typeId }: { project: Project; typeId: string }) {
|
||||
/** Ressourcen-Reiter mit den Schichten je Bauteilart. */
|
||||
const RESOURCE_TAB = { wall: "wallStyles", ceiling: "ceilingStyles", roof: "roofStyles" } as const;
|
||||
|
||||
/** Bezugsseiten-Beschriftung je Bauteilart (Decken: unten/oben). */
|
||||
const sideKey = (host: RenovationHost, side: "inside" | "outside"): TranslationKey =>
|
||||
(host === "wall" ? `renovation.panel.sanierung.side.${side}` : `renovation.panel.sanierung.side.${host}.${side}`) as TranslationKey;
|
||||
|
||||
function PairEditor({ project, typeId, host }: { project: Project; typeId: string; host: RenovationHost }) {
|
||||
const applyChange = useStore((s) => s.applyChange);
|
||||
const openResources = usePanelHostAction("onOpenResources");
|
||||
const wt = project.wallTypes.find((x) => x.id === typeId);
|
||||
const pair = renovationPair(project, typeId);
|
||||
const types = renovationTypes(project, host);
|
||||
const wt = types.find((x) => x.id === typeId);
|
||||
const pair = renovationPair(project, typeId, undefined, host);
|
||||
if (!wt || !pair) return null;
|
||||
const oldOv = wt.renovationOld ?? [];
|
||||
const newOv = wt.renovationNew ?? [];
|
||||
const setOv = (which: "old" | "new", i: number, v: LayerRenovation) => {
|
||||
const n = which === "old" ? wt.layers.length : (project.wallTypes.find((x) => x.id === pair.target)?.layers.length ?? 0);
|
||||
const n = which === "old" ? wt.layers.length : (types.find((x) => x.id === pair.target)?.layers.length ?? 0);
|
||||
const cur = [...(which === "old" ? oldOv : newOv)];
|
||||
while (cur.length < n) cur.push("auto");
|
||||
cur[i] = v;
|
||||
applyChange((p) => setTypePairOps(p, typeId, which === "old" ? { old: cur } : { new: cur }));
|
||||
applyChange((p) => setTypePairOps(p, typeId, which === "old" ? { old: cur } : { new: cur }, host));
|
||||
};
|
||||
const layerRow = (which: "old" | "new", l: (typeof pair.old)[number], i: number) => {
|
||||
const ov = (which === "old" ? oldOv : newOv)[i] ?? "auto";
|
||||
@@ -63,8 +75,8 @@ function PairEditor({ project, typeId }: { project: Project; typeId: string }) {
|
||||
<div className="reno-pair-editor" data-testid="reno-pair-editor">
|
||||
<label className="reno-field">
|
||||
<span>{t("renovation.panel.sanierung.target")}</span>
|
||||
<select value={pair.target} data-testid="reno-pair-target" onChange={(e) => applyChange((p) => setTypePairOps(p, typeId, { target: e.target.value, old: null, new: null }))}>
|
||||
{project.wallTypes
|
||||
<select value={pair.target} data-testid="reno-pair-target" onChange={(e) => applyChange((p) => setTypePairOps(p, typeId, { target: e.target.value, old: null, new: null }, host))}>
|
||||
{types
|
||||
.filter((x) => x.id !== typeId)
|
||||
.map((x) => (
|
||||
<option key={x.id} value={x.id}>
|
||||
@@ -75,9 +87,9 @@ function PairEditor({ project, typeId }: { project: Project; typeId: string }) {
|
||||
</label>
|
||||
<label className="reno-field">
|
||||
<span>{t("renovation.panel.sanierung.side")}</span>
|
||||
<select value={pair.side} data-testid="reno-pair-side" onChange={(e) => applyChange((p) => setTypePairOps(p, typeId, { side: e.target.value as RenovationSide }))}>
|
||||
<option value="inside">{t("renovation.panel.sanierung.side.inside")}</option>
|
||||
<option value="outside">{t("renovation.panel.sanierung.side.outside")}</option>
|
||||
<select value={pair.side} data-testid="reno-pair-side" onChange={(e) => applyChange((p) => setTypePairOps(p, typeId, { side: e.target.value as RenovationSide }, host))}>
|
||||
<option value="inside">{t(sideKey(host, "inside"))}</option>
|
||||
<option value="outside">{t(sideKey(host, "outside"))}</option>
|
||||
</select>
|
||||
</label>
|
||||
<div className="reno-pair-cols">
|
||||
@@ -92,13 +104,18 @@ function PairEditor({ project, typeId }: { project: Project; typeId: string }) {
|
||||
</div>
|
||||
<RenovationStrip pair={pair} width={170} />
|
||||
<div className="reno-select-by">
|
||||
<button type="button" className="reno-link-btn" data-testid="reno-pair-reset" onClick={() => applyChange((p) => setTypePairOps(p, typeId, { old: null, new: null }))}>
|
||||
<button type="button" className="reno-link-btn" data-testid="reno-pair-reset" onClick={() => applyChange((p) => setTypePairOps(p, typeId, { old: null, new: null }, host))}>
|
||||
{t("renovation.panel.sanierung.reset")}
|
||||
</button>
|
||||
<button type="button" className="reno-link-btn" onClick={() => openResources("wallStyles")}>
|
||||
<button type="button" className="reno-link-btn" onClick={() => openResources(RESOURCE_TAB[host])}>
|
||||
{t("renovation.panel.sanierung.editLayers")}
|
||||
</button>
|
||||
<button type="button" className="reno-link-btn" data-testid="reno-pair-remove" onClick={() => applyChange((p) => setTypePairOps(p, typeId, { target: null, old: null, new: null, side: null }))}>
|
||||
<button
|
||||
type="button"
|
||||
className="reno-link-btn"
|
||||
data-testid="reno-pair-remove"
|
||||
onClick={() => applyChange((p) => setTypePairOps(p, typeId, { target: null, old: null, new: null, side: null }, host))}
|
||||
>
|
||||
{t("renovation.panel.sanierung.remove")}
|
||||
</button>
|
||||
</div>
|
||||
@@ -110,10 +127,15 @@ export function RenovationSanierung({ project }: { project: Project }) {
|
||||
const applyChange = useStore((s) => s.applyChange);
|
||||
const info = renovationPairs(project);
|
||||
const [open, setOpen] = useState<string | null>(null);
|
||||
const targets = new Set(info.pairs.map((x) => x.target));
|
||||
const candidates = project.wallTypes.filter((x) => !x.renovationTarget && !targets.has(x.id));
|
||||
// Bestandstypen ohne Sanierungstyp (und nicht selbst Sanierungstyp) je Bauteilart; Schlüssel `host:id`.
|
||||
const candidates = RENOVATION_HOSTS.flatMap((host) => {
|
||||
const targets = new Set(info.pairs.filter((x) => x.kind === host).map((x) => x.target));
|
||||
return renovationTypes(project, host)
|
||||
.filter((x) => !x.renovationTarget && !targets.has(x.id))
|
||||
.map((x) => ({ host, id: x.id, name: x.name, key: `${host}:${x.id}` }));
|
||||
});
|
||||
const [pick, setPick] = useState("");
|
||||
const pickId = candidates.some((x) => x.id === pick) ? pick : (candidates[0]?.id ?? "");
|
||||
const picked = candidates.find((x) => x.key === pick) ?? candidates[0];
|
||||
return (
|
||||
<div className="reno-block" data-testid="reno-sanierung">
|
||||
<div className="reno-head">{t("renovation.panel.sanierung.title")}</div>
|
||||
@@ -121,49 +143,69 @@ export function RenovationSanierung({ project }: { project: Project }) {
|
||||
{t("renovation.panel.sanierung.count", { n: String(info.renovated) })}
|
||||
</div>
|
||||
{info.pairs.length === 0 && <div className="reno-hint">{t("renovation.panel.sanierung.empty")}</div>}
|
||||
{info.pairs.map((pr) => (
|
||||
<div className="reno-pair" key={pr.type} data-testid="reno-pair">
|
||||
<div className="reno-pair-title">
|
||||
<span>{pr.name}</span>
|
||||
<span aria-hidden="true">→</span>
|
||||
<span>{pr.targetName ?? pr.target}</span>
|
||||
{RENOVATION_HOSTS.map((host) => {
|
||||
const pairs = info.pairs.filter((x) => x.kind === host);
|
||||
if (pairs.length === 0) return null;
|
||||
return (
|
||||
<div key={host} data-testid={`reno-pairs-${host}`}>
|
||||
<div className="reno-head sub">{t(`renovation.panel.sanierung.host.${host}` as TranslationKey)}</div>
|
||||
{pairs.map((pr) => {
|
||||
const key = `${host}:${pr.type}`;
|
||||
return (
|
||||
<div className="reno-pair" key={key} data-testid="reno-pair" data-kind={host}>
|
||||
<div className="reno-pair-title">
|
||||
<span>{pr.name}</span>
|
||||
<span aria-hidden="true">→</span>
|
||||
<span>{pr.targetName ?? pr.target}</span>
|
||||
</div>
|
||||
<div className="reno-hint">
|
||||
{t((host === "wall" ? "renovation.panel.sanierung.walls" : `renovation.panel.sanierung.${host}s`) as TranslationKey, { r: String(pr.renovated), n: String(pr.elements) })}
|
||||
</div>
|
||||
<div className="reno-select-by">
|
||||
<button
|
||||
type="button"
|
||||
className="reno-link-btn"
|
||||
data-testid="reno-pair-renovate-all"
|
||||
disabled={pr.elements === 0 || pr.renovated === pr.elements}
|
||||
onClick={() => applyChange((p) => renovateAllOfTypeOps(p, pr.type, host))}
|
||||
>
|
||||
{t((host === "wall" ? "renovation.panel.sanierung.renovateAll" : `renovation.panel.sanierung.renovateAll.${host}`) as TranslationKey)}
|
||||
</button>
|
||||
<button type="button" className="reno-link-btn" data-testid="reno-pair-edit" aria-expanded={open === key} onClick={() => setOpen(open === key ? null : key)}>
|
||||
{t("renovation.panel.sanierung.edit")}
|
||||
</button>
|
||||
</div>
|
||||
{open === key && <PairEditor project={project} typeId={pr.type} host={host} />}
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
<div className="reno-hint">{t("renovation.panel.sanierung.walls", { r: String(pr.renovated), n: String(pr.walls) })}</div>
|
||||
<div className="reno-select-by">
|
||||
<button
|
||||
type="button"
|
||||
className="reno-link-btn"
|
||||
data-testid="reno-pair-renovate-all"
|
||||
disabled={pr.walls === 0 || pr.renovated === pr.walls}
|
||||
onClick={() => applyChange((p) => renovateAllOfTypeOps(p, pr.type))}
|
||||
>
|
||||
{t("renovation.panel.sanierung.renovateAll")}
|
||||
</button>
|
||||
<button type="button" className="reno-link-btn" data-testid="reno-pair-edit" aria-expanded={open === pr.type} onClick={() => setOpen(open === pr.type ? null : pr.type)}>
|
||||
{t("renovation.panel.sanierung.edit")}
|
||||
</button>
|
||||
</div>
|
||||
{open === pr.type && <PairEditor project={project} typeId={pr.type} />}
|
||||
</div>
|
||||
))}
|
||||
{candidates.length > 0 && (
|
||||
);
|
||||
})}
|
||||
{picked && (
|
||||
<div className="reno-field reno-create">
|
||||
<select value={pickId} aria-label={t("renovation.panel.sanierung.createFor")} data-testid="reno-create-type" onChange={(e) => setPick(e.target.value)}>
|
||||
{candidates.map((x) => (
|
||||
<option key={x.id} value={x.id}>
|
||||
{x.name}
|
||||
</option>
|
||||
))}
|
||||
<select value={picked.key} aria-label={t("renovation.panel.sanierung.createFor")} data-testid="reno-create-type" onChange={(e) => setPick(e.target.value)}>
|
||||
{RENOVATION_HOSTS.map((host) => {
|
||||
const list = candidates.filter((x) => x.host === host);
|
||||
return list.length === 0 ? null : (
|
||||
<optgroup key={host} label={t(`renovation.panel.sanierung.host.${host}` as TranslationKey)}>
|
||||
{list.map((x) => (
|
||||
<option key={x.key} value={x.key}>
|
||||
{x.name}
|
||||
</option>
|
||||
))}
|
||||
</optgroup>
|
||||
);
|
||||
})}
|
||||
</select>
|
||||
<button
|
||||
type="button"
|
||||
className="reno-add-btn"
|
||||
data-testid="reno-create"
|
||||
onClick={() => {
|
||||
const src = project.wallTypes.find((x) => x.id === pickId);
|
||||
if (!src) return;
|
||||
applyChange((p) => createRenovationTypeOps(p, pickId, t("renovation.panel.sanierung.newName", { name: src.name })).ops);
|
||||
setOpen(pickId);
|
||||
const src = picked;
|
||||
applyChange((p) => createRenovationTypeOps(p, src.id, t("renovation.panel.sanierung.newName", { name: src.name }), src.host).ops);
|
||||
setOpen(src.key);
|
||||
}}
|
||||
>
|
||||
{t("renovation.panel.sanierung.create")}
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
import { memo } from "react";
|
||||
import { t } from "../../i18n";
|
||||
import type { RenovationStatus } from "../../model/types";
|
||||
import { RENOVATION_STATUSES, commonBuildUp, parseBuildUpKey, renovationPair, setBuildUpOps } from "../../core";
|
||||
import { RENOVATION_STATUSES, commonBuildUp, hostTypeId, parseBuildUpKey, renovationPair, renovationTypes, setBuildUpOps } from "../../core";
|
||||
import type { RenovationHost } from "../../core";
|
||||
import { getState, useStore } from "../../state/appStore";
|
||||
import { RenovationStrip } from "../../ui/RenovationStrip";
|
||||
import { useRenovationSelection } from "../../state/renovationHook";
|
||||
@@ -65,26 +66,33 @@ export const RenovationField = memo(function RenovationField() {
|
||||
);
|
||||
});
|
||||
|
||||
const NO_TYPES: readonly { id: string; name: string; renovationTarget?: string }[] = [];
|
||||
const NO_IDS: readonly string[] = [];
|
||||
const SEL_KEY = { wall: "walls", ceiling: "ceilings", roof: "roofs" } as const;
|
||||
|
||||
/**
|
||||
* [274] „Neuer Aufbau (Sanierung)“ der gewählten Wände: keiner, wie Typ (Sanierungstyp des Wandtyps) oder ein anderer
|
||||
* Wandtyp (Ausnahme). Mehrfachauswahl in einem Undo-Schritt; bei gemeinsamem Wandtyp der Streifen Alt/Neu/Ergebnis.
|
||||
* [274] „Neuer Aufbau (Sanierung)“ der gewählten Wände, Decken oder Dächer (die erste Art der Auswahl): keiner, wie Typ
|
||||
* (Sanierungstyp des Typs) oder ein anderer Typ derselben Art (Ausnahme). Mehrfachauswahl in einem Undo-Schritt; bei
|
||||
* gemeinsamem Typ der Streifen Alt/Neu/Ergebnis.
|
||||
*/
|
||||
const BuildUpField = memo(function BuildUpField() {
|
||||
const types = useStore((s) => s.project.wallTypes) ?? NO_TYPES;
|
||||
const applyChange = useStore((s) => s.applyChange);
|
||||
const wallIds = useStore((s) => s.selection.walls);
|
||||
// Gemeinsamer Aufbau und gemeinsamer Wandtyp als Text: rendert nur bei echter Änderung neu.
|
||||
const host = useStore((s): RenovationHost | null => (s.selection.walls.length ? "wall" : s.selection.ceilings.length ? "ceiling" : s.selection.roofs.length ? "roof" : null));
|
||||
const ids = useStore((s) => (host ? s.selection[SEL_KEY[host]] : NO_IDS));
|
||||
// Typen der Art (Id, Name, Sanierungstyp) als Text: rendert nur bei echter Änderung neu.
|
||||
const typesKey = useStore((s) => (host ? JSON.stringify(renovationTypes(s.project, host).map((x) => [x.id, x.name, x.renovationTarget ?? ""])) : "[]"));
|
||||
// Gemeinsamer Aufbau und gemeinsamer Typ als Text.
|
||||
const key = useStore((s) => {
|
||||
const set = new Set(s.selection.walls);
|
||||
const ts = new Set(s.project.walls.filter((w) => set.has(w.id)).map((w) => w.wallTypeId));
|
||||
return JSON.stringify([commonBuildUp(s.project, s.selection.walls), ts.size === 1 ? [...ts][0] : null]);
|
||||
if (!host) return JSON.stringify([null, null]);
|
||||
const set = new Set(ids);
|
||||
const items = ((s.project as unknown as Record<string, { id: string }[] | undefined>)[SEL_KEY[host]] ?? []).filter((x) => set.has(x.id));
|
||||
const ts = new Set(items.map((x) => hostTypeId(x, host) ?? ""));
|
||||
return JSON.stringify([commonBuildUp(s.project, ids, host), ts.size === 1 ? [...ts][0] || null : null]);
|
||||
});
|
||||
const [common, typeId] = JSON.parse(key) as [string | null, string | null];
|
||||
if (common === null || wallIds.length === 0) return null;
|
||||
if (!host || common === null || ids.length === 0) return null;
|
||||
const types = (JSON.parse(typesKey) as [string, string, string][]).map(([id, name, target]) => ({ id, name, target }));
|
||||
const own = typeId ? types.find((x) => x.id === typeId) : undefined;
|
||||
const ownTarget = own?.renovationTarget ? types.find((x) => x.id === own.renovationTarget) : undefined;
|
||||
const ownTarget = own?.target ? types.find((x) => x.id === own.target) : undefined;
|
||||
const options = [
|
||||
...(common === "mixed" ? [{ value: MIXED, label: t("renovation.mixed") }] : []),
|
||||
{ value: "", label: t("renovation.buildUp.none") },
|
||||
@@ -94,7 +102,7 @@ const BuildUpField = memo(function BuildUpField() {
|
||||
const value = common === "mixed" ? MIXED : common;
|
||||
const b = parseBuildUpKey(value === MIXED ? "" : value);
|
||||
const target = b.kind === "other" ? b.typeId : b.kind === "type" ? ownTarget?.id : undefined;
|
||||
const pair = typeId && target ? renovationPair(getState().project, typeId, target) : null;
|
||||
const pair = typeId && target ? renovationPair(getState().project, typeId, target, host) : null;
|
||||
return (
|
||||
<>
|
||||
<div className="objinfo-field" data-testid="objinfo-renovation-buildup">
|
||||
@@ -105,7 +113,7 @@ const BuildUpField = memo(function BuildUpField() {
|
||||
value={value}
|
||||
onChange={(v) => {
|
||||
if (v === MIXED) return;
|
||||
applyChange((p) => setBuildUpOps(p, wallIds, parseBuildUpKey(v)));
|
||||
applyChange((p) => setBuildUpOps(p, ids, parseBuildUpKey(v), host));
|
||||
}}
|
||||
options={options}
|
||||
title={t("renovation.buildUp")}
|
||||
|
||||
@@ -235,7 +235,10 @@ export function installTestHooks(): void {
|
||||
phase: l?.renovationPhase ?? null,
|
||||
draw: s.drawRenovation.status,
|
||||
walls: Object.fromEntries(s.project.walls.map((w) => [w.id, w.renovation?.status ?? "existing"])),
|
||||
buildUp: Object.fromEntries(s.project.walls.map((w) => [w.id, w.renovation?.newTypeId ?? (w.renovation?.renovated ? "type" : "")])),
|
||||
// [274] Wände, Decken und Dächer (Ids sind projektweit eindeutig).
|
||||
buildUp: Object.fromEntries(
|
||||
[...s.project.walls, ...(s.project.ceilings ?? []), ...(s.project.roofs ?? [])].map((w) => [w.id, w.renovation?.newTypeId ?? (w.renovation?.renovated ? "type" : "")]),
|
||||
),
|
||||
};
|
||||
},
|
||||
context: () =>
|
||||
|
||||
Reference in new issue
Block a user