[71][111] U-Werte aus dem Schichtaufbau (SIA 180) und lebendige Tabellen auf Layout-Blättern
[71] Kern u_value.rs: R = Rsi + Σ d/λ + Rse, hinterlüftete Schichten, Luftschicht, unvollständig ohne λ; Objekt-Info, Ressourcen-Manager, Bauteilliste (CSV/PDF, CLI --elements), IFC ThermalTransmittance in Wand/Decke/Dach. [111] Layout.tables: Fenster-/Türliste, Flächen SIA 416, Raumprogramm, Bauteile mit U-Wert als Tabelle auf dem Blatt (Spaltenwahl, Schrift, Zeilenhöhe, Linien, Aufteilen auf mehrere Rahmen); Blattansicht, PDF (Vektortext), DXF.
This commit is contained in:
31 files changed
+2274
-14
No files matched your search
@@ -0,0 +1,77 @@
|
||||
// Bauteilliste mit U-Werten im Flächenbilanz-Panel ([71]): je Wand, Decke und Dach Typ, Geschoss, Fläche, Dicke und
|
||||
// U-Wert aus dem Schichtaufbau (SIA 180 / EN ISO 6946, λ je Bauteil). Die Zeilen rechnet der Kern (`elementSchedule`);
|
||||
// ein „–" mit Hinweis steht, wo einer Schicht λ fehlt. CSV und PDF kommen aus dem Berichtsmodell wie die Fenster-/Türliste.
|
||||
|
||||
import { useMemo } from "react";
|
||||
import { t } from "../i18n";
|
||||
import { usePanelHost } from "./host";
|
||||
import { areaReportToCsv, buildAreaReportPdf, buildElementReport, elementSchedule } from "../core";
|
||||
import { downloadCsv } from "./downloadFile";
|
||||
import { useStore } from "../state/appStore";
|
||||
|
||||
export function ElementScheduleSection() {
|
||||
const host = usePanelHost();
|
||||
const project = host.project;
|
||||
const notify = useStore((s) => s.notify);
|
||||
const rows = useMemo(() => elementSchedule(project), [project]);
|
||||
const stem = `${project.name || "projekt"}-bauteile`;
|
||||
const exportPdf = () => {
|
||||
try {
|
||||
buildAreaReportPdf(buildElementReport(project)).save(`${stem}.pdf`);
|
||||
} catch {
|
||||
notify(t("openings.exportPdf.fail"));
|
||||
}
|
||||
};
|
||||
return (
|
||||
<div className="area-section element-section" data-element-schedule>
|
||||
<div className="balance-head">
|
||||
<span className="balance-section-label">{t("elemSchedule.title")}</span>
|
||||
{rows.length > 0 && (
|
||||
<span className="area-actions">
|
||||
<button type="button" className="balance-export" onClick={() => downloadCsv(`${stem}.csv`, areaReportToCsv(buildElementReport(project)))}>
|
||||
{t("openings.exportCsv")}
|
||||
</button>
|
||||
<button type="button" className="balance-export" onClick={exportPdf}>
|
||||
{t("openings.exportPdf")}
|
||||
</button>
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
{rows.length === 0 ? (
|
||||
<div className="balance-empty">{t("elemSchedule.empty")}</div>
|
||||
) : (
|
||||
<div className="area-scroll">
|
||||
<table className="area-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{t("sheetTable.col.kind")}</th>
|
||||
<th>{t("elemSchedule.col.type")}</th>
|
||||
<th>{t("openings.col.floor")}</th>
|
||||
<th className="num">{t("elemSchedule.col.area")}</th>
|
||||
<th className="num">{t("elemSchedule.col.thickness")}</th>
|
||||
<th className="num">{t("openings.col.u")}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{rows.map((r) => (
|
||||
<tr key={`${r.kind}:${r.id}`}>
|
||||
<td>{t(`elemSchedule.kind.${r.kind}`)}</td>
|
||||
<td>{r.typeName}</td>
|
||||
<td>{r.floor}</td>
|
||||
<td className="num">{r.area.toFixed(2)}</td>
|
||||
<td className="num">{(r.thickness * 100).toFixed(1)}</td>
|
||||
<td className="num" title={r.complete ? undefined : t("elemSchedule.incompleteHint")}>
|
||||
{r.u === null ? "–" : r.u.toFixed(2)}
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
)}
|
||||
<ul className="area-notes">
|
||||
<li>{t("elemSchedule.foot")}</li>
|
||||
</ul>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -14,6 +14,7 @@
|
||||
// Bezeichner englisch, UI-Text/Kommentare deutsch (CONVENTIONS.md). Alle sichtbaren
|
||||
// Texte über t(...).
|
||||
|
||||
import { UValueRow } from "./UValueRow";
|
||||
import { lengthFromDisplay, lengthToDisplay, unitsForLevel, xToDisplay, yFromDisplay, yToDisplay } from "../tools/displayUnits";
|
||||
import { solidProps } from "../engine/truckSolid";
|
||||
import type { SolidProps, SolidSpec } from "../engine/truckSolid";
|
||||
@@ -989,6 +990,7 @@ export function RoofSection({
|
||||
width={130}
|
||||
/>
|
||||
</div>
|
||||
<UValueRow project={host.project} kind="roof" typeId={roof.roofTypeId} />
|
||||
|
||||
{/* Firstrichtung (X/Y) — nur bei Formen mit First relevant. */}
|
||||
{roof.shape !== "flach" && roof.shape !== "zelt" && (
|
||||
@@ -1765,6 +1767,7 @@ export function CeilingSection({
|
||||
<span className="objinfo-flabel">{t("objinfo.ceiling.refFloor")}</span>
|
||||
<span className="objinfo-fval">{ceiling.floorName}</span>
|
||||
</div>
|
||||
<UValueRow project={host.project} kind="ceiling" typeId={ceiling.typeId} />
|
||||
|
||||
{/* Fläche + Volumen (read-only). */}
|
||||
<div className="objinfo-field">
|
||||
@@ -1964,6 +1967,7 @@ export function WallSection({
|
||||
<span className="objinfo-flabel">{t("objinfo.wall.refFloor")}</span>
|
||||
<span className="objinfo-fval">{wall.floorName}</span>
|
||||
</div>
|
||||
<UValueRow project={host.project} kind="wall" typeId={wall.wallTypeId} />
|
||||
|
||||
{/* Länge + Volumen (read-only). Volumen ist NETTO — Fenster/Türen
|
||||
abgezogen; der Titel zeigt zusätzlich das Bruttovolumen. */}
|
||||
|
||||
@@ -15,6 +15,7 @@ import { roomDisplayName } from "../model/roomStamp";
|
||||
import { KennzahlenSection } from "./KennzahlenSection";
|
||||
import { AreaTableSection } from "./AreaTableSection";
|
||||
import { OpeningScheduleSection } from "./OpeningScheduleSection";
|
||||
import { ElementScheduleSection } from "./ElementScheduleSection";
|
||||
import { downloadCsv } from "./downloadFile";
|
||||
|
||||
/** Löst je Raum die anrechenbare (Netto-)Fläche + Kategorie auf. */
|
||||
@@ -44,6 +45,7 @@ export function RoomBalancePanel() {
|
||||
<KennzahlenSection />
|
||||
<AreaTableSection />
|
||||
<OpeningScheduleSection />
|
||||
<ElementScheduleSection />
|
||||
<div className="balance-empty">{t("balance.empty")}</div>
|
||||
</div>
|
||||
);
|
||||
@@ -82,6 +84,9 @@ export function RoomBalancePanel() {
|
||||
{/* Fenster- und Türliste. */}
|
||||
<OpeningScheduleSection />
|
||||
|
||||
{/* Bauteilliste mit U-Werten ([71]). */}
|
||||
<ElementScheduleSection />
|
||||
|
||||
{/* Raumliste (je Raum: Name · Geschoss · SIA · Fläche). */}
|
||||
<div className="balance-section-label">{t("balance.rooms")}</div>
|
||||
<div className="balance-table">
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
// U-Wert aus dem Schichtaufbau ([71], SIA 180 / EN ISO 6946) als Zeile im Objekt-Info (Wand/Decke/Dach) und als
|
||||
// Zeile im Ressourcen-Manager (Wand-/Decken-/Dachtyp). Gerechnet wird im Kern (`u_value.rs`); fehlt einer Schicht
|
||||
// λ, steht „unvollständig" statt einer falschen Zahl.
|
||||
|
||||
import { useMemo } from "react";
|
||||
import type { Layer, Project } from "../model/types";
|
||||
import { t } from "../i18n";
|
||||
import { uValueOf } from "../core";
|
||||
import type { ElementKind, UValueResult } from "../core";
|
||||
|
||||
function safe(f: () => UValueResult | null): UValueResult | null {
|
||||
try {
|
||||
return f();
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function valueText(u: UValueResult): string {
|
||||
return u.complete && u.u !== null ? `${u.u.toFixed(2)} W/(m²K)` : t("uvalue.incomplete", { n: u.missing });
|
||||
}
|
||||
|
||||
function hint(u: UValueResult): string {
|
||||
const base = `R = ${u.r.toFixed(2)} m²K/W`;
|
||||
return u.ventilated ? `${base} · ${t("uvalue.ventilated")}` : base;
|
||||
}
|
||||
|
||||
/** Objekt-Info: U-Wert des Aufbaus (Typ-Id); nichts ohne Typ. */
|
||||
export function UValueRow({ project, kind, typeId }: { project: Project; kind: ElementKind; typeId: string | undefined }) {
|
||||
const u = useMemo(() => (typeId ? safe(() => uValueOf(project, kind, { typeId })) : null), [project, kind, typeId]);
|
||||
if (!u) return null;
|
||||
return (
|
||||
<div className="objinfo-field" data-uvalue>
|
||||
<span className="objinfo-flabel">{t("uvalue.label")}</span>
|
||||
<span className="objinfo-fval" title={hint(u)}>{valueText(u)}</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
/** Ressourcen-Manager: U-Wert der gerade bearbeiteten Schichten (live). */
|
||||
export function UValueLine({ project, kind, layers }: { project: Project; kind: ElementKind; layers: readonly Layer[] }) {
|
||||
const u = useMemo(() => safe(() => uValueOf(project, kind, { layers })), [project, kind, layers]);
|
||||
if (!u) return null;
|
||||
return (
|
||||
<div className="res-hint" data-uvalue title={hint(u)}>
|
||||
{t("uvalue.label")}: <b>{valueText(u)}</b> · {hint(u)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user