[139] Fenster- und Türliste (SVG/PDF): lange Zellen umbrechen statt zu überlappen, Spaltenbreiten angepasst
This commit is contained in:
4 files changed
+128
-7
No files matched your search
@@ -302,3 +302,29 @@ describe("scheduleRows — Dächer und Stützen (bisher fehlten sie in Liste/Ele
|
||||
expect(scheduleRows(proj).some((r) => r.id === "RM1")).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe("Fenster- und Türliste als Blatt ([139])", () => {
|
||||
it("keine zwei Texte derselben Zeile überlappen (Musterhaus komplex)", async () => {
|
||||
const { buildComplexSampleProject } = await import("../model/sampleProjectComplex");
|
||||
const { buildOpeningReport } = await import("./openingSchedule");
|
||||
const { layoutAreaReport } = await import("./areaReport");
|
||||
const lay = layoutAreaReport(buildOpeningReport(buildComplexSampleProject()));
|
||||
let texts = 0;
|
||||
for (const page of lay.pages) {
|
||||
const rows = new Map<number, [number, number][]>();
|
||||
for (const p of page) {
|
||||
if (p.k !== "text") continue;
|
||||
texts++;
|
||||
const w = p.s.length * p.size * 0.3528 * 0.45; // untere Schätzung der Breite
|
||||
const box: [number, number] = p.align === "right" ? [p.x - w, p.x] : [p.x, p.x + w];
|
||||
const key = Math.round(p.y * 100);
|
||||
rows.set(key, [...(rows.get(key) ?? []), box]);
|
||||
}
|
||||
for (const boxes of rows.values()) {
|
||||
boxes.sort((a, b) => a[0] - b[0]);
|
||||
for (let i = 1; i < boxes.length; i++) expect(boxes[i - 1]![1]).toBeLessThanOrEqual(boxes[i]![0] + 1e-6);
|
||||
}
|
||||
}
|
||||
expect(texts).toBeGreaterThan(50);
|
||||
});
|
||||
});
|
||||
@@ -102,7 +102,7 @@ function withReveals(sec: ReportSection, rows: OpeningScheduleRow[]): ReportSect
|
||||
return {
|
||||
...sec,
|
||||
columns: [...sec.columns, ...keys.map((name) => t("openings.col.reveal", { name }))],
|
||||
widths: [...sec.widths, ...keys.map(() => 1.4)],
|
||||
widths: [...sec.widths, ...keys.map(() => 1.9)],
|
||||
rows: sec.rows.map((row, i) => ({ ...row, cells: [...row.cells, ...keys.map((k) => num(revealArea(rows[i]!, k), 2))] })),
|
||||
};
|
||||
}
|
||||
@@ -119,7 +119,7 @@ function windowBase(rows: OpeningScheduleRow[]): ReportSection {
|
||||
return {
|
||||
heading: t("openings.windows"),
|
||||
columns: [t("openings.col.mark"), t("openings.col.type"), t("openings.col.floor"), t("openings.col.rooms"), t("openings.col.width"), t("openings.col.height"), t("openings.col.sill"), t("openings.col.sound"), t("openings.col.u"), t("openings.col.rc"), t("openings.col.ext"), t("openings.col.notes")],
|
||||
widths: [1.4, 2.4, 1.4, 3.2, 1.2, 1.2, 1.2, 1.6, 1.1, 1.1, 1.4, 3],
|
||||
widths: [1.3, 3.4, 1.9, 3, 1.4, 1.4, 1.4, 1.5, 1.3, 1.3, 1.6, 2.6],
|
||||
rows: rows.map((r): ReportRow => ({ cells: [r.mark, r.typeName, r.floor, roomsText(r), num(r.width, 2), num(r.height, 2), num(r.sill, 2), r.soundClass, num(r.uValue, 2), r.burglaryClass, externalText(r.external), r.notes] })),
|
||||
};
|
||||
}
|
||||
@@ -128,7 +128,7 @@ function doorBase(rows: OpeningScheduleRow[]): ReportSection {
|
||||
return {
|
||||
heading: t("openings.doors"),
|
||||
columns: [t("openings.col.mark"), t("openings.col.type"), t("openings.col.floor"), t("openings.col.rooms"), t("openings.col.width"), t("openings.col.height"), t("openings.col.clearWidth"), t("openings.col.clearHeight"), t("openings.col.swing"), t("openings.col.fire"), t("openings.col.sound"), t("openings.col.u"), t("openings.col.rc"), t("openings.col.ext"), t("openings.col.notes")],
|
||||
widths: [1.4, 2.2, 1.3, 3, 1.1, 1.1, 1.2, 1.2, 2.6, 1.1, 1.5, 1, 1, 1.3, 2.6],
|
||||
widths: [1.3, 3, 1.9, 3, 1.3, 1.3, 1.4, 1.4, 2.6, 1.1, 1.5, 1.1, 1.3, 1.6, 2.4],
|
||||
rows: rows.map((r): ReportRow => ({ cells: [r.mark, r.typeName, r.floor, roomsText(r), num(r.width, 2), num(r.height, 2), num(r.clearWidth, 2), num(r.clearHeight, 2), swingText(r), r.fireRating, r.soundClass, num(r.uValue, 2), r.burglaryClass, externalText(r.external), r.notes] })),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user