[5] Doppelspur Door/Opening aufgeloest: Formatversion 2 migriert Legacy-Tueren zu Oeffnungen (kind door), Project.doors und Door entfernt, Legacy-Pfade in Plan/Schnitt/Ansicht/3D/Liste gestrichen; Tests angepasst

This commit is contained in:
karim committed 2026-10-27 20:00:24 +01:00
1 parent 346798eee6
commit b0270bae3e
94 files changed
+100 -367

No files matched your search

-1
View File
@@ -135,7 +135,6 @@ function fixtureProject(): Project {
],
layers: [{ code: "20", name: "Wände", color: "#0a0a0a", lw: 0.5, visible: true, locked: false }],
walls,
doors: [],
openings,
ceilings,
stairs,
-1
View File
@@ -23,7 +23,6 @@ function baseProject(): Project {
],
layers: [{ code: "20", name: "Wände", color: "#0a0a0a", lw: 0.5, visible: true, locked: false }],
walls: [],
doors: [],
openings: [],
ceilings: [],
stairs: [],
+5 -7
View File
@@ -7,7 +7,7 @@
import { describe, it, expect } from "vitest";
import { exportScheduleCsv, scheduleRows } from "./exportSchedule";
import type { Project, Wall, Ceiling, Door, Opening, Stair, ExtrudedSolid } from "../model/types";
import type { Project, Wall, Ceiling, Opening, Stair, ExtrudedSolid } from "../model/types";
/**
* Minimalprojekt: 2 Wände (1 Wandtyp T=0.4) + 1 Decke (Deckentyp T=0.2) +
@@ -52,20 +52,20 @@ function fixtureProject(): Project {
ceilingTypeId: "dt",
},
];
const doors: Door[] = [
const openings: Opening[] = [
{
id: "T1",
type: "door",
type: "opening",
hostWallId: "W1",
categoryCode: "21",
kind: "door",
position: 1,
width: 0.9,
height: 2.1, // Fläche 1.89
sillHeight: 0,
swing: "left",
hinge: "start",
},
];
const openings: Opening[] = [
{
id: "F1",
type: "opening",
@@ -120,7 +120,6 @@ function fixtureProject(): Project {
],
layers: [{ code: "20", name: "Wände", color: "#0a0a0a", lw: 0.5, visible: true, locked: false }],
walls,
doors,
openings,
ceilings,
stairs,
@@ -190,7 +189,6 @@ describe("exportScheduleCsv — Bauteilliste", () => {
const proj = fixtureProject();
proj.walls = [];
proj.ceilings = [];
proj.doors = [];
proj.openings = [];
proj.stairs = [];
proj.extrudedSolids = [];
+1 -18
View File
@@ -14,7 +14,6 @@ import type {
Project,
Wall,
Ceiling,
Door,
Opening,
Stair,
ExtrudedSolid,
@@ -154,24 +153,9 @@ function floorIdOfHostWall(project: Project, hostWallId: string): string | undef
return project.walls.find((w) => w.id === hostWallId)?.floorId;
}
/** Wertet eine Tür für die Bauteilliste aus. */
function evalDoor(project: Project, door: Door): ScheduleRow {
return {
kind: "Tür",
id: door.id,
typeName: "Tür",
floor: floorOfHostWall(project, door.hostWallId),
floorId: floorIdOfHostWall(project, door.hostWallId),
length: door.width,
heightM: door.height,
thickness: null,
area: door.width * door.height,
};
}
/** Wertet eine Öffnung (Fenster oder Tür-Öffnung) für die Bauteilliste aus. */
function evalOpening(project: Project, opening: Opening): ScheduleRow {
const kind = opening.kind === "window" ? "Fenster" : "Öffnung";
const kind = opening.kind === "window" ? "Fenster" : "Tür";
return {
kind,
id: opening.id,
@@ -266,7 +250,6 @@ export function scheduleRows(project: Project): ScheduleRow[] {
const rows: ScheduleRow[] = [];
for (const w of project.walls ?? []) rows.push(evalWall(project, w));
for (const c of project.ceilings ?? []) rows.push(evalCeiling(project, c));
for (const d of project.doors ?? []) rows.push(evalDoor(project, d));
for (const o of project.openings ?? []) rows.push(evalOpening(project, o));
for (const s of project.stairs ?? []) rows.push(evalStair(project, s));
for (const e of project.extrudedSolids ?? []) rows.push(evalExtrudedSolid(project, e));