Akkumulierten grünen Arbeitsstand landen (Basis für Weiterarbeit)
Bündelt den über mehrere Sessions gewachsenen, uncommitteten Stand in
einem Basis-Commit, damit Folge-Features isoliert darauf aufsetzen.
Verifikation: tsc --noEmit sauber, vitest 600/600 grün.
Enthalten (Details in PENDENZEN.md ✅-Liste / HANDOVER.md):
- truck-Integration: Profil-Extrusion + Verjüngung + Boolean-CSG (csgrs),
Crate src-tauri/trucksolid, Werkzeug `extrude`, ExtrudedSolid-Modell.
- kernel2d-Port nach Rust/WASM (Phasen 1–5, Diff-Harness).
- render3d 3D-Live-Schnitt = 2D-Schnitt: geschichteter Bodenaufbau,
Prioritäts-Verschneidung (section_boolean.rs), einstellbare
Schichttrennlinien, per-Hatch-Strichstärke, relativeToWall-Orientierung.
- Interop-Export IFC4/STL/OBJ (Loch-Ausschnitt wallMeshCut), Schnellexport.
- Projektdatei .obp + OS-Lock (lock.rs, LockConflictDialog).
- Layout-Blätter (Modell/Editor/Panel/PDF), Ausschnitte, Override-Engine,
Tragwerk-Stützen (Column), BIM-Tree-Panel.
- Bauteil-Typsystem (Tür/Fenster/Treppe-Typen), Betontreppe mit schräger
Laufplatte, Text-/Textbox-Werkzeug, Mess-Werkzeug, 2D/3D-Griffe für
Öffnungen/Treppen, Snap-Symbol-Restyle.
This commit is contained in:
1 parent
9b33a89318
commit
1d939a939a
129 files changed
+26324
-842
No files matched your search
@@ -1,14 +1,18 @@
|
||||
// Unit-Tests für die Bauteilliste (Bauteil-Schedule CSV, AUDIT A6).
|
||||
// • Kopfzeile + eine Zeile je Bauteil-Vorkommen (2 Wände + 1 Decke).
|
||||
// Unit-Tests für die Bauteilliste (Bauteil-Schedule CSV, AUDIT A6 + D2).
|
||||
// • Kopfzeile + eine Zeile je Bauteil-Vorkommen (2 Wände, 1 Decke, 1 Tür,
|
||||
// 1 Fenster, 1 Treppe, 1 Extrusion).
|
||||
// • korrekte Kennwerte (Länge/Höhe/Dicke/Fläche) aus dem Modell abgeleitet.
|
||||
// • CSV-Escaping bei einem Typnamen mit Semikolon/Anführungszeichen.
|
||||
// • leeres Projekt ⇒ nur Kopfzeile (kein Crash).
|
||||
|
||||
import { describe, it, expect } from "vitest";
|
||||
import { exportScheduleCsv, scheduleRows } from "./exportSchedule";
|
||||
import type { Project, Wall, Ceiling } from "../model/types";
|
||||
import type { Project, Wall, Ceiling, Door, Opening, Stair, ExtrudedSolid } from "../model/types";
|
||||
|
||||
/** Minimalprojekt: 2 Wände (1 Wandtyp T=0.4) + 1 Decke (Deckentyp T=0.2). */
|
||||
/**
|
||||
* Minimalprojekt: 2 Wände (1 Wandtyp T=0.4) + 1 Decke (Deckentyp T=0.2) +
|
||||
* 1 Tür + 1 Fenster (je an W1 gehostet) + 1 Treppe + 1 Extrusion.
|
||||
*/
|
||||
function fixtureProject(): Project {
|
||||
const walls: Wall[] = [
|
||||
{
|
||||
@@ -48,6 +52,61 @@ function fixtureProject(): Project {
|
||||
ceilingTypeId: "dt",
|
||||
},
|
||||
];
|
||||
const doors: Door[] = [
|
||||
{
|
||||
id: "T1",
|
||||
type: "door",
|
||||
hostWallId: "W1",
|
||||
categoryCode: "21",
|
||||
position: 1,
|
||||
width: 0.9,
|
||||
height: 2.1, // Fläche 1.89
|
||||
swing: "left",
|
||||
hinge: "start",
|
||||
},
|
||||
];
|
||||
const openings: Opening[] = [
|
||||
{
|
||||
id: "F1",
|
||||
type: "opening",
|
||||
hostWallId: "W2",
|
||||
categoryCode: "21",
|
||||
kind: "window",
|
||||
position: 1,
|
||||
width: 1.2,
|
||||
height: 1.5, // Fläche 1.80
|
||||
sillHeight: 0.9,
|
||||
},
|
||||
];
|
||||
const stairs: Stair[] = [
|
||||
{
|
||||
id: "S1",
|
||||
type: "stair",
|
||||
floorId: "eg",
|
||||
categoryCode: "40",
|
||||
shape: "straight",
|
||||
start: { x: 0, y: 0 },
|
||||
dir: { x: 1, y: 0 },
|
||||
runLength: 3, // Länge 3 (kein 2. Lauf)
|
||||
width: 1.2,
|
||||
totalRise: 2.6,
|
||||
stepCount: 16,
|
||||
},
|
||||
];
|
||||
const extrudedSolids: ExtrudedSolid[] = [
|
||||
{
|
||||
id: "E1",
|
||||
type: "extrudedSolid",
|
||||
levelId: "eg",
|
||||
points: [
|
||||
{ x: 0, y: 0 },
|
||||
{ x: 2, y: 0 },
|
||||
{ x: 2, y: 3 },
|
||||
{ x: 0, y: 3 },
|
||||
], // 2×3 = 6 m²
|
||||
height: 2.5,
|
||||
},
|
||||
];
|
||||
return {
|
||||
id: "t",
|
||||
name: "T",
|
||||
@@ -61,10 +120,11 @@ function fixtureProject(): Project {
|
||||
],
|
||||
layers: [{ code: "20", name: "Wände", color: "#0a0a0a", lw: 0.5, visible: true, locked: false }],
|
||||
walls,
|
||||
doors: [],
|
||||
openings: [],
|
||||
doors,
|
||||
openings,
|
||||
ceilings,
|
||||
stairs: [],
|
||||
stairs,
|
||||
extrudedSolids,
|
||||
rooms: [],
|
||||
drawings2d: [],
|
||||
context: [],
|
||||
@@ -76,8 +136,8 @@ describe("exportScheduleCsv — Bauteilliste", () => {
|
||||
const csv = exportScheduleCsv(fixtureProject(), { includeSummary: false });
|
||||
const lines = csv.split("\r\n");
|
||||
|
||||
// Kopfzeile + 3 Bauteil-Zeilen (2 Wände, 1 Decke).
|
||||
expect(lines).toHaveLength(4);
|
||||
// Kopfzeile + 7 Bauteil-Zeilen (2 Wände, 1 Decke, 1 Tür, 1 Fenster, 1 Treppe, 1 Extrusion).
|
||||
expect(lines).toHaveLength(8);
|
||||
expect(lines[0]).toBe("Typ;ID;Bauteil;Geschoss;Länge [m];Höhe [m];Dicke [m];Fläche [m²]");
|
||||
|
||||
// Wand W1: Länge 5, Höhe 2.6, Dicke 0.4, Ansichtsfläche 13.
|
||||
@@ -86,19 +146,35 @@ describe("exportScheduleCsv — Bauteilliste", () => {
|
||||
expect(lines[2]).toBe("Wand;W2;Aussenwand;EG;4.00;2.60;0.40;10.40");
|
||||
// Decke D1: keine Länge/Höhe, Dicke 0.2, Grundrissfläche 20.
|
||||
expect(lines[3]).toBe("Decke;D1;Betondecke;EG;;;0.20;20.00");
|
||||
// Tür T1: Breite 0.9, Höhe 2.1, keine Dicke, Fläche 1.89.
|
||||
expect(lines[4]).toBe("Tür;T1;Tür;EG;0.90;2.10;;1.89");
|
||||
// Fenster F1: Breite 1.2, Höhe 1.5, keine Dicke, Fläche 1.80.
|
||||
expect(lines[5]).toBe("Fenster;F1;Fenster;EG;1.20;1.50;;1.80");
|
||||
// Treppe S1: Lauflänge 3 (kein 2. Lauf), Steighöhe 2.6, keine Dicke/Fläche.
|
||||
expect(lines[6]).toBe("Treppe;S1;Treppe;EG;3.00;2.60;;");
|
||||
// Extrusion E1: keine Länge, Höhe 2.5, keine Dicke, Grundrissfläche 6.
|
||||
expect(lines[7]).toBe("Extrusion;E1;Extrusion;EG;;2.50;;6.00");
|
||||
});
|
||||
|
||||
it("hängt bei includeSummary einen Aggregat-Block je Bauteil-Typ an", () => {
|
||||
const csv = exportScheduleCsv(fixtureProject());
|
||||
const lines = csv.split("\r\n");
|
||||
// Kopf(1) + 3 Zeilen + Leerzeile + Titel + 2 Aggregate (Aussenwand, Betondecke) = 8.
|
||||
expect(lines).toHaveLength(8);
|
||||
expect(lines[4]).toBe("");
|
||||
expect(lines[5]).toContain("Zusammenfassung");
|
||||
// Kopf(1) + 7 Zeilen + Leerzeile + Titel + 6 Aggregate = 16.
|
||||
expect(lines).toHaveLength(16);
|
||||
expect(lines[8]).toBe("");
|
||||
expect(lines[9]).toContain("Zusammenfassung");
|
||||
// Wand-Aggregat: 2 Stk, Gesamtlänge 9, Gesamtfläche 23.40.
|
||||
expect(lines[6]).toBe("Wand;;Aussenwand;2 Stk;9.00;;;23.40");
|
||||
expect(lines[10]).toBe("Wand;;Aussenwand;2 Stk;9.00;;;23.40");
|
||||
// Decken-Aggregat: 1 Stk, keine Länge, Fläche 20.
|
||||
expect(lines[7]).toBe("Decke;;Betondecke;1 Stk;;;;20.00");
|
||||
expect(lines[11]).toBe("Decke;;Betondecke;1 Stk;;;;20.00");
|
||||
// Tür-Aggregat: 1 Stk, Gesamtbreite 0.9, Fläche 1.89.
|
||||
expect(lines[12]).toBe("Tür;;Tür;1 Stk;0.90;;;1.89");
|
||||
// Fenster-Aggregat: 1 Stk, Gesamtbreite 1.2, Fläche 1.80.
|
||||
expect(lines[13]).toBe("Fenster;;Fenster;1 Stk;1.20;;;1.80");
|
||||
// Treppen-Aggregat: 1 Stk, Gesamtlänge 3, keine bekannte Fläche (leer statt 0.00).
|
||||
expect(lines[14]).toBe("Treppe;;Treppe;1 Stk;3.00;;;");
|
||||
// Extrusions-Aggregat: 1 Stk, keine Länge, Fläche 6.
|
||||
expect(lines[15]).toBe("Extrusion;;Extrusion;1 Stk;;;;6.00");
|
||||
});
|
||||
|
||||
it("quotet Felder mit Sonderzeichen (Semikolon/Anführungszeichen) RFC-4180-konform", () => {
|
||||
@@ -114,6 +190,10 @@ describe("exportScheduleCsv — Bauteilliste", () => {
|
||||
const proj = fixtureProject();
|
||||
proj.walls = [];
|
||||
proj.ceilings = [];
|
||||
proj.doors = [];
|
||||
proj.openings = [];
|
||||
proj.stairs = [];
|
||||
proj.extrudedSolids = [];
|
||||
const csv = exportScheduleCsv(proj);
|
||||
expect(csv.split("\r\n")).toHaveLength(1);
|
||||
expect(scheduleRows(proj)).toHaveLength(0);
|
||||
|
||||
Reference in new issue
Block a user