[177] Raumstempel im Archicad-Stil: linksbündig, Name · Nummer · Fläche, SIA-Kategorie nur auf Wunsch, optionale Trennlinie
This commit is contained in:
22 files changed
+195
-93
No files matched your search
@@ -4,9 +4,8 @@
|
||||
<g stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="4">
|
||||
<polygon points="0,4.6725 5,4.6725 5,0.6725 0,0.6725" fill="none" stroke="none" stroke-width="0"/>
|
||||
<polygon points="0.1725,4.5 4.8275,4.5 4.8275,0.845 0.1725,0.845" fill="#6b728000" stroke="#6b7280" stroke-width="0.002"/>
|
||||
<text x="0.98291" y="2.31972" font-family="Inter, sans-serif" text-anchor="start"><tspan font-size="0.3528" fill="#111111">Wohnen</tspan></text>
|
||||
<text x="2.5" y="2.77833" font-family="Inter, sans-serif" text-anchor="middle"><tspan font-size="0.28222" fill="#111111">17.01 m²</tspan></text>
|
||||
<text x="2.5" y="3.23694" font-family="Inter, sans-serif" text-anchor="middle"><tspan font-size="0.28222" fill="#111111">HNF · Hauptnutzfläche</tspan></text>
|
||||
<text x="1.80481" y="2.54903" font-family="Inter, sans-serif" text-anchor="start"><tspan font-size="0.3528" fill="#111111">Wohnen</tspan></text>
|
||||
<text x="1.80481" y="3.00764" font-family="Inter, sans-serif" text-anchor="start"><tspan font-size="0.28222" fill="#111111">17.01 m²</tspan></text>
|
||||
<polygon points="-0.1725,4.845 0.8,4.845 0.8,4.5 0.1725,4.5" fill="#0f0f0f" stroke="#0f0f0f" stroke-width="0.012"/>
|
||||
<polygon points="1.7,4.845 3,4.845 3,4.5 1.7,4.5" fill="#0f0f0f" stroke="#1a1a1a" stroke-width="0.025"/>
|
||||
<polygon points="4,4.845 5.1725,4.845 4.8275,4.5 4,4.5" fill="#0f0f0f" stroke="#0f0f0f" stroke-width="0.012"/>
|
||||
|
||||
|
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 6.7 KiB |
@@ -186,13 +186,14 @@ describe.skipIf(!hasEzdxf)("Fachplaner-Export gegen ezdxf", { timeout: 60_000 },
|
||||
expect(noFont.r.fonts.DOSSIER).toBe("Arial");
|
||||
});
|
||||
|
||||
it("Raumstempel: Name und Fläche als zentrierte TEXTe im Massstab (Punkt → Meter)", () => {
|
||||
it("Raumstempel: Name und Fläche als linksbündige TEXTe im Massstab (Punkt → Meter)", () => {
|
||||
const r = read();
|
||||
const stamps = r.entities.filter((e) => e.type === "TEXT" && e.halign === 1);
|
||||
// [177] Stempel sind linksbündig (halign 0), der Block liegt um den Stempelpunkt.
|
||||
const stamps = r.entities.filter((e) => e.type === "TEXT" && e.halign === 0 && /m²/.test(e.text as string));
|
||||
expect(stamps.length).toBeGreaterThan(0);
|
||||
const texts = stamps.map((e) => e.text as string);
|
||||
expect(texts.some((t) => /m²/.test(t))).toBe(true);
|
||||
for (const s of stamps) expect(s.height as number).toBeGreaterThan(0.2); // 10 pt bei 1:100 ≈ 0.35 m
|
||||
for (const s of stamps) expect(s.height as number).toBeGreaterThan(0.2); // 0.8 × 10 pt bei 1:100 ≈ 0.28 m
|
||||
});
|
||||
|
||||
it("Papierbereich: Layout mit Ansichtsfenster im Planmassstab", () => {
|
||||
|
||||
+2
-1
@@ -3102,7 +3102,8 @@ export const de = {
|
||||
"roomStamp.nameLine2": "Raumname Zeile 2",
|
||||
"roomStamp.showFloorArea": "Bodenfläche anzeigen",
|
||||
"roomStamp.floorAreaPrefix": "Präfix Bodenfläche",
|
||||
"roomStamp.showUsage": "Nutzung anzeigen",
|
||||
"roomStamp.showUsage": "SIA-Kategorie anzeigen",
|
||||
"roomStamp.showDivider": "Trennlinie unter dem Namen",
|
||||
"roomStamp.showFinish": "Bodenbelag anzeigen",
|
||||
"roomStamp.roundingStep": "Flächen-Rundung",
|
||||
"roomStamp.roundingStepDefault": "Standard (2 Nachkommastellen)",
|
||||
|
||||
+2
-1
@@ -3090,7 +3090,8 @@ export const en: Record<TranslationKey, string> = {
|
||||
"roomStamp.nameLine2": "Room name line 2",
|
||||
"roomStamp.showFloorArea": "Show floor area",
|
||||
"roomStamp.floorAreaPrefix": "Floor area prefix",
|
||||
"roomStamp.showUsage": "Show usage",
|
||||
"roomStamp.showUsage": "Show SIA category",
|
||||
"roomStamp.showDivider": "Divider line below the name",
|
||||
"roomStamp.showFinish": "Show floor finish",
|
||||
"roomStamp.roundingStep": "Area rounding",
|
||||
"roomStamp.roundingStepDefault": "Default (2 decimal places)",
|
||||
|
||||
@@ -26,7 +26,7 @@ describe("defaultRoomStamp", () => {
|
||||
const stamp = defaultRoomStamp(makeRoom());
|
||||
expect(stamp.name).toBe("Wohnen");
|
||||
expect(stamp.showFloorArea).toBe(true);
|
||||
expect(stamp.showUsage).toBe(true);
|
||||
expect(stamp.showUsage).toBe(false);
|
||||
expect(stamp.number).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -6,14 +6,15 @@ import type { Room, RoomStamp } from "./types";
|
||||
import type { Align } from "../text/richText";
|
||||
|
||||
/**
|
||||
* Standard-Stempel aus einem Raum ableiten: Name = Raum-Name, Bodenfläche und
|
||||
* Nutzung angezeigt. Nummer/Zeile 2 bleiben leer (frei ergänzbar).
|
||||
* Standard-Stempel aus einem Raum ableiten (Archicad-Stil, linksbündig): Name = Raum-Name, Bodenfläche
|
||||
* angezeigt, SIA-Kategorie nicht. Nummer/Zeile 2 bleiben leer (frei ergänzbar).
|
||||
*/
|
||||
export function defaultRoomStamp(room: Room): RoomStamp {
|
||||
return {
|
||||
name: room.name,
|
||||
showFloorArea: true,
|
||||
showUsage: true,
|
||||
// [177] Die SIA-416-Kategorie ist ein Attribut des Raums, nicht Teil des Stempels (nur auf Wunsch).
|
||||
showUsage: false,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -659,7 +659,7 @@ function addRooms(p: Project): Project {
|
||||
const ops = withDocument(p, (d) => d.cmdOps({ cmd: "room", at: [at.x, at.y], ctx: { level, floorHeight: lvl?.floorHeight ?? null, cat: "60", wallType: "" }, stamp: `raum${nr}` }));
|
||||
const made = ops.find((o) => o.kind === "add" && o.collection === "rooms");
|
||||
if (!made || made.kind !== "add") throw new Error(`Musterhaus komplex: Raum ${nr} nicht erkannt`);
|
||||
const stamp: RoomStamp = { number: nr, name, showFloorArea: true, showUsage: true, roundingStep: 0.1 };
|
||||
const stamp: RoomStamp = { number: nr, name, showFloorArea: true, showUsage: false, roundingStep: 0.1 };
|
||||
const room = { ...(made.items[0] as unknown as Room), id: `raum-${nr}`, name, siaCategory: sia, stamp, stampDoc: textDoc([{ text: nr }, { text: name, bold: true }], "center") };
|
||||
p = applyOps(p, [{ kind: "add", collection: "rooms", items: [room as unknown as { id: string }] }]);
|
||||
}
|
||||
|
||||
@@ -3047,15 +3047,18 @@ export type RoomStamp = {
|
||||
showFloorArea: boolean;
|
||||
/** Präfix vor der Bodenfläche, z. B. "BF " (Default leer). */
|
||||
floorAreaPrefix?: string;
|
||||
/** Nutzung (HNF/… · Bezeichnung) anzeigen (Live-Zeile). */
|
||||
/**
|
||||
* SIA-416-Kategorie (HNF/… · Bezeichnung) im Stempel anzeigen (Live-Zeile). [177]: Vorgabe aus, die
|
||||
* Kategorie ist ein Attribut des Raums.
|
||||
*/
|
||||
showUsage: boolean;
|
||||
/** Ausrichtung der Namenszeile (Zeile 1). Fehlt sie, gilt „links". */
|
||||
nameAlign?: Align;
|
||||
/** Ausrichtung der zweiten Namenszeile. Fehlt sie, gilt „links". */
|
||||
line2Align?: Align;
|
||||
/** Ausrichtung der Bodenflächen-Zeile. Fehlt sie, gilt „zentriert" (Alt-Verhalten). */
|
||||
/** Ausrichtung der Bodenflächen-Zeile. Fehlt sie, gilt „links" ([177], Archicad-Stil). */
|
||||
floorAreaAlign?: Align;
|
||||
/** Ausrichtung der Nutzungs-Zeile. Fehlt sie, gilt „zentriert" (Alt-Verhalten). */
|
||||
/** Ausrichtung der Nutzungs-Zeile. Fehlt sie, gilt „links" ([177], Archicad-Stil). */
|
||||
usageAlign?: Align;
|
||||
/**
|
||||
* Personenzahl (Live-Zeile), z. B. für Nutzungsauflagen. Fehlt/undefined:
|
||||
@@ -3070,6 +3073,8 @@ export type RoomStamp = {
|
||||
roundingStep?: number;
|
||||
/** [158] Bodenbelag des Raums als Zeile anzeigen (Live-Zeile). Fehlt/false: keine Belagszeile. */
|
||||
showFinish?: boolean;
|
||||
/** [177] Trennlinie unter dem Namen anzeigen. Fehlt/false: keine Linie. */
|
||||
showDivider?: boolean;
|
||||
};
|
||||
|
||||
/** [158] Nutzung eines Raums (Raumbuch). Nassräume: Bad, WC, Dusche, Waschküche. */
|
||||
|
||||
@@ -165,7 +165,7 @@ export function RoomStampEditor({ value, onApply, onCancel }: RoomStampEditorPro
|
||||
</label>
|
||||
<AlignToggle
|
||||
value={draft.floorAreaAlign}
|
||||
fallback="center"
|
||||
fallback="left"
|
||||
disabled={!draft.showFloorArea}
|
||||
label={`${t("roomStamp.showFloorArea")} — ${t("text.group")}`}
|
||||
onChange={(floorAreaAlign) => patch({ floorAreaAlign })}
|
||||
@@ -213,13 +213,20 @@ export function RoomStampEditor({ value, onApply, onCancel }: RoomStampEditorPro
|
||||
</label>
|
||||
<AlignToggle
|
||||
value={draft.usageAlign}
|
||||
fallback="center"
|
||||
fallback="left"
|
||||
disabled={!draft.showUsage}
|
||||
label={`${t("roomStamp.showUsage")} — ${t("text.group")}`}
|
||||
onChange={(usageAlign) => patch({ usageAlign })}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="roomstamp-row">
|
||||
<label className="roomstamp-check">
|
||||
<input type="checkbox" checked={draft.showDivider === true} onChange={(e) => patch({ showDivider: e.target.checked ? true : undefined })} />
|
||||
<span>{t("roomStamp.showDivider")}</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div className="roomstamp-row">
|
||||
<label className="roomstamp-check">
|
||||
<input type="checkbox" checked={draft.showFinish === true} onChange={(e) => patch({ showFinish: e.target.checked ? true : undefined })} />
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
viewBox -12.8 0 37.6 33.6
|
||||
bytes 22835
|
||||
bytes 22857
|
||||
circle 14
|
||||
g 1
|
||||
line 91
|
||||
@@ -7,6 +7,6 @@ polygon 21
|
||||
polyline 22
|
||||
rect 1
|
||||
svg 1
|
||||
text 34
|
||||
tspan 9
|
||||
hash 487fdee19e8a1bb9
|
||||
text 35
|
||||
tspan 8
|
||||
hash 0a9a2f9d64e7e04d
|
||||
@@ -1,12 +1,12 @@
|
||||
viewBox -12.65 0 37.3 33.3
|
||||
bytes 324730
|
||||
bytes 327626
|
||||
circle 14
|
||||
g 1
|
||||
line 3206
|
||||
line 3240
|
||||
polygon 67
|
||||
polyline 80
|
||||
rect 1
|
||||
svg 1
|
||||
text 36
|
||||
tspan 12
|
||||
hash c0957914c8802677
|
||||
tspan 9
|
||||
hash a6f9780337dacdea
|
||||
@@ -1,5 +1,5 @@
|
||||
viewBox -41.5 0 95 63.6
|
||||
bytes 68177
|
||||
bytes 68576
|
||||
circle 16
|
||||
g 1
|
||||
line 171
|
||||
@@ -8,6 +8,6 @@ polygon 79
|
||||
polyline 115
|
||||
rect 1
|
||||
svg 1
|
||||
text 114
|
||||
text 119
|
||||
tspan 24
|
||||
hash 88d7db00378ec35c
|
||||
hash 513bd828c55d7821
|
||||
@@ -1,13 +1,13 @@
|
||||
viewBox -41.5 0 95 63.6
|
||||
bytes 112644
|
||||
bytes 110320
|
||||
circle 16
|
||||
g 1
|
||||
line 418
|
||||
line 399
|
||||
path 66
|
||||
polygon 200
|
||||
polyline 133
|
||||
rect 1
|
||||
svg 1
|
||||
text 119
|
||||
tspan 32
|
||||
hash bdfbc7accc7f94f6
|
||||
tspan 24
|
||||
hash 8b159d6d6fc45df4
|
||||
@@ -1,5 +1,5 @@
|
||||
viewBox -12.8 0 37.6 33.6
|
||||
bytes 47484
|
||||
bytes 47773
|
||||
circle 14
|
||||
g 1
|
||||
line 141
|
||||
@@ -8,6 +8,6 @@ polygon 44
|
||||
polyline 106
|
||||
rect 1
|
||||
svg 1
|
||||
text 86
|
||||
text 90
|
||||
tspan 19
|
||||
hash f19942a5776e3e58
|
||||
hash a15f1fe5af3cb8ca
|
||||
@@ -1,13 +1,13 @@
|
||||
viewBox -12.65 0 37.3 33.3
|
||||
bytes 359191
|
||||
bytes 363133
|
||||
circle 14
|
||||
g 1
|
||||
line 3237
|
||||
line 3284
|
||||
path 37
|
||||
polygon 144
|
||||
polyline 175
|
||||
rect 1
|
||||
svg 1
|
||||
text 89
|
||||
tspan 24
|
||||
hash 5a9ba42671732b46
|
||||
tspan 18
|
||||
hash 7abb9592f4ee90d0
|
||||
@@ -1,5 +1,5 @@
|
||||
viewBox -12.8 0 37.6 33.6
|
||||
bytes 41256
|
||||
bytes 41219
|
||||
circle 15
|
||||
g 1
|
||||
line 119
|
||||
@@ -8,6 +8,6 @@ polygon 35
|
||||
polyline 72
|
||||
rect 1
|
||||
svg 1
|
||||
text 72
|
||||
tspan 18
|
||||
hash b2e3449dc7032be6
|
||||
text 74
|
||||
tspan 15
|
||||
hash 1d06bb6982a76a59
|
||||
@@ -1,5 +1,5 @@
|
||||
viewBox -12.65 0 37.3 33.3
|
||||
bytes 47879
|
||||
bytes 47530
|
||||
circle 15
|
||||
g 1
|
||||
line 115
|
||||
@@ -9,5 +9,5 @@ polyline 79
|
||||
rect 1
|
||||
svg 1
|
||||
text 74
|
||||
tspan 20
|
||||
hash 43eee872c063493e
|
||||
tspan 15
|
||||
hash 0e6b2b1c5141bc75
|
||||
@@ -1,11 +1,11 @@
|
||||
viewBox -1.961 0 8.922 7.473
|
||||
bytes 6795
|
||||
bytes 6643
|
||||
g 1
|
||||
line 28
|
||||
polygon 16
|
||||
polyline 6
|
||||
rect 1
|
||||
svg 1
|
||||
text 7
|
||||
tspan 3
|
||||
hash e88f9f3a80df2cf2
|
||||
text 6
|
||||
tspan 2
|
||||
hash 121d60361d8f0a18
|
||||
@@ -1,11 +1,11 @@
|
||||
viewBox -1.731 0 8.461 7.322
|
||||
bytes 10226
|
||||
bytes 10072
|
||||
g 1
|
||||
line 29
|
||||
polygon 43
|
||||
polyline 10
|
||||
rect 1
|
||||
svg 1
|
||||
text 7
|
||||
tspan 3
|
||||
hash 45acd3ebb788ed59
|
||||
text 6
|
||||
tspan 2
|
||||
hash 7731ecdd9e544749
|
||||
Reference in new issue
Block a user