[263] UX-Reste: Quellen-Auswahl voll lesbar, Hilfe → Kurzanleitung und Fehler melden, Nachweis-Export im leeren Projekt mit Hinweis
This commit is contained in:
19 files changed
+432
-11
No files matched your search
@@ -1,8 +1,8 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { sampleProject } from "../model/sampleProject";
|
||||
import { emptyProject, sampleProject } from "../model/sampleProject";
|
||||
import type { Project, Room, Wall } from "../model/types";
|
||||
import { computeAreaTable, computeIvhb } from "../analysis/areaTable";
|
||||
import { areaReportToCsv, areaReportToSvg, buildAreaReport, buildAreaReportPdf, layoutAreaReport, parseAreaReportCsv } from "./areaReport";
|
||||
import { isAreaReportEmpty, areaReportToCsv, areaReportToSvg, buildAreaReport, buildAreaReportPdf, layoutAreaReport, parseAreaReportCsv } from "./areaReport";
|
||||
|
||||
// Einfaches Haus: Achsen 10 × 8 m, Wände 0.3 m, EG-Räume innen 9.7 × 7.7 m (Handrechnung siehe flaechen.rs).
|
||||
function house(): Project {
|
||||
@@ -113,3 +113,10 @@ describe("Bericht", () => {
|
||||
expect(lay.pages.length).toBeGreaterThan(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe("isAreaReportEmpty [263]", () => {
|
||||
it("leeres Projekt: leer; Musterhaus: nicht leer", () => {
|
||||
expect(isAreaReportEmpty(emptyProject)).toBe(true);
|
||||
expect(isAreaReportEmpty(sampleProject)).toBe(false);
|
||||
});
|
||||
});
|
||||
@@ -65,6 +65,12 @@ function areaCells(r: AreaRow): Cell[] {
|
||||
return [r.hnf, r.nnf, r.nf, r.vf, r.ff, r.ngf, r.kf, r.gf, r.agf].map((v) => num(v, 2)).concat(num(r.gv, 1));
|
||||
}
|
||||
|
||||
/** [263] Ohne Bauteile (kein Raum, keine Fläche, kein Volumen) wäre der Nachweis nur Nullen: dann kein Export, sondern ein Hinweis. */
|
||||
export function isAreaReportEmpty(project: Project): boolean {
|
||||
const { total, gv } = computeAreaTable(project);
|
||||
return [total.hnf, total.nnf, total.vf, total.ff, total.kf, total.gf, total.agf, total.rooms, gv].every((v) => !(Math.abs(v) > 0));
|
||||
}
|
||||
|
||||
/** Baut den Bericht aus dem Projekt. */
|
||||
export function buildAreaReport(project: Project, opts: AreaReportOptions = {}): AreaReport {
|
||||
const sections: ReportSection[] = [];
|
||||
|
||||
Reference in new issue
Block a user