Merge branch 'worktree-agent-aaa648b3490503402' into claude/practical-noether-1hb2s1

This commit is contained in:
Claude committed 2026-11-11 03:38:55 +00:00
commit e9b5de7e5b
9 files changed
+448 -32

No files matched your search

+2 -2
View File
@@ -37,8 +37,8 @@ export { revealColumns, revealArea } from "../export/openingSchedule";
export type { RevealArea } from "../export/openingSchedule";
export { elementSchedule, uValueOf, uValueText, buildElementReport } from "../export/elementSchedule";
export type { ElementScheduleRow, UValueResult, ElementKind } from "../export/elementSchedule";
export { roomBook, buildRoomBookReport, usageLabel, ROOM_USAGES } from "../export/roomBook";
export type { RoomBook, RoomBookRow, FinishQty } from "../export/roomBook";
export { roomBook, buildRoomBookReport, usageLabel, hasSlope, ROOM_USAGES } from "../export/roomBook";
export type { RoomBook, RoomBookRow, FinishQty, WallSide } from "../export/roomBook";
export { sheetTables, createTable, drawTablesPdf, tableCatalog, tableLabels, tableSourceLabel, TABLE_SOURCES } from "../export/sheetTable";
export type { TableOut, TablePrim, TableColumn } from "../export/sheetTable";
export { computeAreaTable, computeIvhb } from "../analysis/areaTable";
+17 -1
View File
@@ -3,7 +3,7 @@ import { describe, expect, it } from "vitest";
import { sampleProject } from "../model/sampleProject";
import type { Layout, Project, Room } from "../model/types";
import { areaReportToCsv, parseAreaReportCsv } from "./areaReport";
import { buildRoomBookReport, roomBook, usageLabel } from "./roomBook";
import { buildRoomBookReport, hasSlope, roomBook, usageLabel } from "./roomBook";
import { sheetTables, tableLabels } from "./sheetTable";
import { t } from "../i18n/translate";
@@ -47,6 +47,22 @@ describe("Raumbuch ([158])", () => {
expect(ceil.area).toBeCloseTo(w.area + 4, 9);
});
it("Wandseiten, Leibungen, Sockel und Höhenbereiche ([158])", () => {
const w = roomBook(p).rows[0]!;
expect(w.skirting).toBeGreaterThan(0);
expect(w.skirting).toBeLessThanOrEqual(w.perimeter);
expect(w.wallSides.reduce((a, s) => a + s.length, 0)).toBeCloseTo(w.perimeter, 6);
expect(w.wallSides.reduce((a, s) => a + s.area, 0)).toBeCloseTo(w.wallArea, 6);
expect(w.revealArea).toBeGreaterThanOrEqual(0);
// Ohne Dach: überall die lichte Höhe, alles im obersten Höhenbereich.
expect(w.heightMin).toBeCloseTo(w.clearHeight, 9);
expect(hasSlope(w)).toBe(false);
expect(w.areaUnder1 + w.area1To15 + w.areaOver15).toBeCloseTo(w.area, 6);
const rep = buildRoomBookReport(p);
expect(rep.sections[0]!.columns).toContain(t("roomBook.col.skirting"));
expect(rep.sections[0]!.rows[0]!.cells.length).toBe(rep.sections[0]!.columns.length);
});
it("Bericht: Raumbuch und Mengen, CSV-Rundreise", () => {
const rep = buildRoomBookReport(p);
expect(rep.sections.map((s) => s.heading)).toEqual([t("roomBook.title"), t("roomBook.quantities")]);
+35 -3
View File
@@ -19,8 +19,15 @@ export interface RoomBookRow {
/** Nettofläche (m²) = Boden- und Deckenfläche. */
area: number;
perimeter: number;
/** Lichte Höhe (m) aus den Decken, sonst Geschosshöhe. */
/** Lichte Höhe (m) an der höchsten Stelle: aus den Decken, sonst Geschosshöhe. */
clearHeight: number;
/** Kleinste und mittlere lichte Höhe unter Dachschrägen (m). */
heightMin: number;
heightMean: number;
/** Fläche (m²) nach SIA-416-Höhenbereichen: < 1.0 m, 1.0–1.5 m, ≥ 1.5 m lichte Höhe. */
areaUnder1: number;
area1To15: number;
areaOver15: number;
/** Nutzungs-Kennung, leer ohne Angabe. */
usage: RoomUsage | "";
wet: boolean;
@@ -32,8 +39,27 @@ export interface RoomBookRow {
/** Wandfläche netto: Umfang × lichte Höhe − Öffnungen (m²). */
wallArea: number;
openingArea: number;
/** Wandoberflächen je Wandseite (Raumseite der Wand), Höhe = lichte Höhe. */
wallSides: WallSide[];
/** Leibungsflächen aller Öffnungen am Raum (m²). */
revealArea: number;
/** Sockellänge: Umfang minus Türbreiten (m). */
skirting: number;
}
/** Wandseite am Raum (`wallId` leer = Umrisskante ohne Wand). */
export interface WallSide {
wallId: string;
length: number;
gross: number;
openings: number;
area: number;
reveals: number;
}
/** Hat der Raum Flächen unter 1.5 m lichter Höhe (Dachschräge)? */
export const hasSlope = (r: RoomBookRow): boolean => r.areaUnder1 + r.area1To15 > 1e-9;
/** Menge einer Oberfläche je Material/Freitext. */
export interface FinishQty {
surface: "floor" | "wall" | "ceiling";
@@ -75,11 +101,17 @@ function roomSection(rows: RoomBookRow[]): ReportSection {
t("roomBook.col.ceilingFinish"),
t("roomBook.col.buildUp"),
t("roomBook.col.clearHeight"),
t("roomBook.col.heightMin"),
t("roomBook.col.heightMean"),
t("roomBook.col.areaUnder1"),
t("roomBook.col.area1To15"),
t("roomBook.col.wallArea"),
t("roomBook.col.reveals"),
t("roomBook.col.skirting"),
],
widths: [1.2, 1, 2.4, 1.2, 1.6, 2.4, 2.4, 2.4, 3, 1.2, 1.3],
widths: [1.2, 1, 2.4, 1.2, 1.6, 2.4, 2.4, 2.4, 3, 1.2, 1.2, 1.2, 1.2, 1.2, 1.3, 1.2, 1.2],
rows: rows.map((r) => ({
cells: [r.floor, r.number, r.name, num(r.area, 2), usageLabel(r.usage), r.floorFinish, r.wallFinish, r.ceilingFinish, r.floorBuildUp, num(r.clearHeight, 2), num(r.wallArea, 2)],
cells: [r.floor, r.number, r.name, num(r.area, 2), usageLabel(r.usage), r.floorFinish, r.wallFinish, r.ceilingFinish, r.floorBuildUp, num(r.clearHeight, 2), num(r.heightMin, 2), num(r.heightMean, 2), num(r.areaUnder1, 2), num(r.area1To15, 2), num(r.wallArea, 2), num(r.revealArea, 2), num(r.skirting, 2)],
})),
};
}
+7 -1
View File
@@ -3297,7 +3297,7 @@ export const de = {
"roomBook.title": "Raumbuch",
"roomBook.empty": "Keine Räume.",
"roomBook.quantities": "Mengen je Oberfläche",
"roomBook.foot": "Bodenfläche = Deckenfläche = Raumfläche (netto). Wandfläche = Umfang × lichte Höhe − Öffnungen; lichte Höhe aus den Decken über und unter dem Raum, sonst Geschosshöhe.",
"roomBook.foot": "Bodenfläche = Deckenfläche = Raumfläche (netto). Wandfläche = Umfang × lichte Höhe − Öffnungen; lichte Höhe aus den Decken über und unter dem Raum, sonst Geschosshöhe. Unter Dachschrägen gelten die Höhenbereiche nach SIA 416 (< 1.0 m, 1.0–1.5 m, ≥ 1.5 m); Wandseiten mit Öffnungen abgezogen, Leibung = Laibungsumfang × Wanddicke, Sockel = Umfang − Türbreiten.",
"roomBook.exportCsv": "CSV",
"roomBook.exportPdf": "PDF",
"roomBook.exportPdf.fail": "PDF des Raumbuchs konnte nicht erstellt werden.",
@@ -3309,6 +3309,12 @@ export const de = {
"roomBook.col.buildUp": "Bodenaufbau",
"roomBook.col.clearHeight": "Lichte Höhe [m]",
"roomBook.col.wallArea": "Wandfläche [m²]",
"roomBook.col.heightMin": "Lichte Höhe min [m]",
"roomBook.col.heightMean": "Lichte Höhe Ø [m]",
"roomBook.col.areaUnder1": "Fläche < 1.0 m [m²]",
"roomBook.col.area1To15": "Fläche 1.0–1.5 m [m²]",
"roomBook.col.reveals": "Leibungen [m²]",
"roomBook.col.skirting": "Sockel [m]",
"roomBook.col.perimeter": "Umfang [m]",
"roomBook.col.wet": "Nassraum",
"roomBook.col.surface": "Oberfläche",
+7 -1
View File
@@ -3284,7 +3284,7 @@ export const en: Record<TranslationKey, string> = {
"roomBook.title": "Room book",
"roomBook.empty": "No rooms.",
"roomBook.quantities": "Quantities per finish",
"roomBook.foot": "Floor area = ceiling area = room area (net). Wall area = perimeter × clear height − openings; clear height from the slabs above and below the room, otherwise storey height.",
"roomBook.foot": "Floor area = ceiling area = room area (net). Wall area = perimeter × clear height − openings; clear height from the slabs above and below the room, otherwise storey height. Under sloping roofs the SIA 416 height bands apply (< 1.0 m, 1.0–1.5 m, ≥ 1.5 m); wall sides net of openings, reveal = reveal perimeter × wall thickness, skirting = perimeter − door widths.",
"roomBook.exportCsv": "CSV",
"roomBook.exportPdf": "PDF",
"roomBook.exportPdf.fail": "Could not create the room book PDF.",
@@ -3296,6 +3296,12 @@ export const en: Record<TranslationKey, string> = {
"roomBook.col.buildUp": "Floor build-up",
"roomBook.col.clearHeight": "Clear height [m]",
"roomBook.col.wallArea": "Wall area [m²]",
"roomBook.col.heightMin": "Clear height min [m]",
"roomBook.col.heightMean": "Clear height avg [m]",
"roomBook.col.areaUnder1": "Area < 1.0 m [m²]",
"roomBook.col.area1To15": "Area 1.0–1.5 m [m²]",
"roomBook.col.reveals": "Reveals [m²]",
"roomBook.col.skirting": "Skirting [m]",
"roomBook.col.perimeter": "Perimeter [m]",
"roomBook.col.wet": "Wet room",
"roomBook.col.surface": "Surface",
+22 -1
View File
@@ -5,7 +5,7 @@
import { useMemo } from "react";
import { t } from "../i18n";
import { areaReportToCsv, buildAreaReportPdf, buildRoomBookReport, roomBook, usageLabel } from "../core";
import { areaReportToCsv, buildAreaReportPdf, buildRoomBookReport, hasSlope, roomBook, usageLabel } from "../core";
import { downloadCsv } from "./downloadFile";
import { useStore } from "../state/appStore";
@@ -15,6 +15,7 @@ export function RoomBookSection() {
const project = useStore((s) => s.project);
const notify = useStore((s) => s.notify);
const book = useMemo(() => roomBook(project), [project]);
const sloped = book.rows.some(hasSlope);
const stem = `${project.name || "projekt"}-raumbuch`;
const exportPdf = () => {
@@ -56,7 +57,17 @@ export function RoomBookSection() {
<th>{t("roomBook.col.wallFinish")}</th>
<th>{t("roomBook.col.ceilingFinish")}</th>
<th className="num">{t("roomBook.col.clearHeight")}</th>
{sloped && (
<>
<th className="num">{t("roomBook.col.heightMin")}</th>
<th className="num">{t("roomBook.col.heightMean")}</th>
<th className="num">{t("roomBook.col.areaUnder1")}</th>
<th className="num">{t("roomBook.col.area1To15")}</th>
</>
)}
<th className="num">{t("roomBook.col.wallArea")}</th>
<th className="num">{t("roomBook.col.reveals")}</th>
<th className="num">{t("roomBook.col.skirting")}</th>
</tr>
</thead>
<tbody>
@@ -71,7 +82,17 @@ export function RoomBookSection() {
<td>{r.wallFinish}</td>
<td>{r.ceilingFinish}</td>
<td className="num">{m2(r.clearHeight)}</td>
{sloped && (
<>
<td className="num">{m2(r.heightMin)}</td>
<td className="num">{m2(r.heightMean)}</td>
<td className="num">{m2(r.areaUnder1)}</td>
<td className="num">{m2(r.area1To15)}</td>
</>
)}
<td className="num">{m2(r.wallArea)}</td>
<td className="num">{m2(r.revealArea)}</td>
<td className="num">{m2(r.skirting)}</td>
</tr>
))}
</tbody>