[255] Baurecht-Nachweis: Ausnützung (GFZ/AZ/BMZ/ÜZ/GZ), Höhen und Grenzabstand gegen das Modell als Tabelle (Panel, CSV/PDF, Blatt-Tabelle, CLI)

This commit is contained in:
Claude committed 2026-11-14 02:14:12 +00:00
1 parent 4d8500104d
commit 3eef56563e
21 files changed
+690 -15

No files matched your search

+27
View File
@@ -17,6 +17,7 @@ import { t } from "../i18n/translate";
import { core } from "../engine/coreWasm";
import { computeAreaTable, computeIvhb } from "../analysis/areaTable";
import type { AreaRow, IvhbOptions } from "../analysis/areaTable";
import { computeSiteProof } from "../analysis/siteProof";
/** Zelle: Text oder Zahl (`d` Nachkommastellen, `null` = nicht berechenbar). */
export type Cell = string | { n: number | null; d: number; g?: boolean };
@@ -51,6 +52,8 @@ export interface AreaReportOptions {
/** IVHB-Kennziffern aufnehmen (Default nein). */
ivhb?: boolean;
ivhbOptions?: IvhbOptions;
/** Baurecht-Nachweis ([255]): Vorgaben der Parzelle gegen Kennzahlen, mit Grundlagen (Default nein). */
siteProof?: boolean;
}
const num = (n: number | null | undefined, d: number): Cell => ({ n: n === undefined || n === null || !Number.isFinite(n) ? null : n, d });
@@ -115,6 +118,30 @@ export function buildAreaReport(project: Project, opts: AreaReportOptions = {}):
notes.push(t("areas.foot.ivhb"));
addNotes(v.notes);
}
if (opts.siteProof) {
const pr = computeSiteProof(project, opts.ivhbOptions);
const dash = t("siteProof.none");
const val = (n: number | null, d: number): Cell => (n === null || !Number.isFinite(n) ? dash : { n, d });
sections.push({
heading: t("siteProof.table"),
columns: [t("siteProof.col.item"), t("siteProof.col.allowed"), t("siteProof.col.actual"), t("siteProof.col.reserve"), t("siteProof.col.ok")],
widths: [5, 1.6, 1.6, 2.2, 1.1],
rows: pr.rows.map((r) => ({
cells: [t(`siteProof.row.${r.key}`), val(r.allowed, r.decimals), val(r.actual, r.decimals), val(r.reserve, r.decimals), r.ok === null ? dash : t(r.ok ? "siteProof.ok.yes" : "siteProof.ok.no")],
})),
});
sections.push({
heading: t("siteProof.basis.title"),
columns: [t("siteProof.col.item"), t("siteProof.col.value"), t("siteProof.col.source")],
widths: [5, 1.8, 4.5],
rows: pr.basis.map((b) => ({ cells: [t(`siteProof.basis.${b.key}`), val(b.value, b.decimals), t(`siteProof.src.${b.source}`)] })),
});
notes.push(t("siteProof.foot"));
for (const k of pr.notes) {
const text = t(`siteProof.note.${k}`);
if (!notes.includes(text)) notes.push(text);
}
}
return { title: t("areas.title"), ...reportHead(project), sections, notes };
}
+3 -3
View File
@@ -55,10 +55,10 @@ describe("Tabellen auf dem Blatt ([111])", () => {
it("alle Quellen liefern Primitive; Katalog nennt die Spalten", () => {
const cat = tableCatalog(sampleProject);
expect(Object.keys(cat.sources).sort()).toEqual(["areas", "costs", "earthworks", "elements", "openings", "roomBook", "rooms"]);
const p = withTables((["openings", "areas", "rooms", "elements", "earthworks", "roomBook", "costs"] as const).map((source) => table({ id: source, source })));
expect(Object.keys(cat.sources).sort()).toEqual(["areas", "costs", "earthworks", "elements", "openings", "roomBook", "rooms", "siteProof"]);
const p = withTables((["openings", "areas", "rooms", "elements", "earthworks", "roomBook", "costs", "siteProof"] as const).map((source) => table({ id: source, source })));
const out = sheetTables(p, "L1");
expect(out.map((o) => o.id)).toEqual(["openings", "areas", "rooms", "elements", "earthworks", "roomBook", "costs"]);
expect(out.map((o) => o.id)).toEqual(["openings", "areas", "rooms", "elements", "earthworks", "roomBook", "costs", "siteProof"]);
for (const o of out) expect(o.prims.some((x) => x.k === "text")).toBe(true);
});
+1 -1
View File
@@ -38,7 +38,7 @@ interface Catalog {
valueKeys: string[];
}
export const TABLE_SOURCES: readonly LayoutTableSource[] = ["openings", "areas", "rooms", "elements", "earthworks", "roomBook", "costs"];
export const TABLE_SOURCES: readonly LayoutTableSource[] = ["openings", "areas", "rooms", "elements", "earthworks", "roomBook", "costs", "siteProof"];
export function tableSourceLabel(s: LayoutTableSource): string {
return t(`sheetTable.source.${s}`);