From 9645b6edeab527496416d927f8c91c6df20df3ff Mon Sep 17 00:00:00 2001 From: Fidelis Huber Date: Fri, 9 Oct 2026 19:49:37 +0200 Subject: [PATCH] =?UTF-8?q?Kabelliste:=20Netzwerkkabel=20(Meinhart=20LAN)?= =?UTF-8?q?=20und=20Buskabel=20(J-Y(ST)Y,=20KNX)=20erg=C3=A4nzt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Kabelrechner-Auswahl nutzt jetzt Name|kg/m, da gleiche kg/m bei verschiedenen Typen vorkommen. Co-Authored-By: Claude Sonnet 5.5 --- client/src/components/KabelOptions.tsx | 11 +++++---- client/src/data/kabelData.ts | 32 ++++++++++++++++++++++++-- client/src/pages/Kabelrechner.tsx | 6 ++--- client/src/styles.css | 6 +++++ 4 files changed, 45 insertions(+), 10 deletions(-) diff --git a/client/src/components/KabelOptions.tsx b/client/src/components/KabelOptions.tsx index 674268f..fa36c0d 100644 --- a/client/src/components/KabelOptions.tsx +++ b/client/src/components/KabelOptions.tsx @@ -6,18 +6,19 @@ const GROUPS: { label: string; test: (c: KabelTyp) => boolean }[] = [ { label: 'YSLY-JZ – Steuerleitung', test: c => c.typ === 'YSLY-JZ' }, { label: 'Aderleitung starr (H05V-U / H07V-U)', test: c => c.typ === 'H05V-U' || c.typ === 'H07V-U' }, { label: 'Aderleitung flexibel (H05V-K / H07V-K)', test: c => c.typ === 'H05V-K' || c.typ === 'H07V-K' }, - { label: 'H05VV-F / A05VV-F – Schlauchleitung', test: c => c.typ === 'H05VV-F' || c.typ === 'A05VV-F' } + { label: 'H05VV-F / A05VV-F – Schlauchleitung', test: c => c.typ === 'H05VV-F' || c.typ === 'A05VV-F' }, + { label: 'Netzwerkkabel (LAN Cat.5e / 6 / 7)', test: c => c.badge === 'lan' }, + { label: 'Buskabel (KNX/EIB, J-Y(ST)Y)', test: c => c.badge === 'bus' } ]; -// mode "combo": Value = "Name|kgpm" (für die Materialliste – Bezeichnung braucht den Namen). -// mode "kgpm": Value = reine kg/m-Zahl (für den Kabelrechner, der nur mit dem Faktor rechnet). -export default function KabelOptions({ mode = 'combo' }: { mode?: 'combo' | 'kgpm' }) { +// Value = "Name|kgpm": Materialliste und Kabelrechner brauchen beide Name und Faktor (kg/m allein ist nicht eindeutig). +export default function KabelOptions() { return ( <> {GROUPS.map(g => ( {KAB_DATA.filter(g.test).map(c => ( - ))} diff --git a/client/src/data/kabelData.ts b/client/src/data/kabelData.ts index e186faa..b05ad68 100644 --- a/client/src/data/kabelData.ts +++ b/client/src/data/kabelData.ts @@ -2,7 +2,7 @@ export interface KabelTyp { typ: string; name: string; kgpm: number; - badge: 'nym' | 'nyy' | 'h07' | 'ysly' | 'schlauch'; + badge: 'nym' | 'nyy' | 'h07' | 'ysly' | 'schlauch' | 'lan' | 'bus'; } // Alle Werte aus den offiziellen Meinhart-Kabel-Datenblättern (Meinhart Kabel Österreich GmbH). @@ -67,7 +67,35 @@ export const KAB_DATA: KabelTyp[] = [ { typ: 'H05VV-F', name: 'H05VV-F 5G4 mm²', kgpm: 0.350, badge: 'schlauch' }, { typ: 'A05VV-F', name: 'A05VV-F 5G6 mm²', kgpm: 0.480, badge: 'schlauch' }, { typ: 'A05VV-F', name: 'A05VV-F 7G1 mm²', kgpm: 0.150, badge: 'schlauch' }, { typ: 'A05VV-F', name: 'A05VV-F 7G1,5 mm²', kgpm: 0.196, badge: 'schlauch' }, { typ: 'A05VV-F', name: 'A05VV-F 7G2,5 mm²', kgpm: 0.315, badge: 'schlauch' }, - { typ: 'A05VV-F', name: 'A05VV-F 10G1,5 mm²', kgpm: 0.305, badge: 'schlauch' } + { typ: 'A05VV-F', name: 'A05VV-F 10G1,5 mm²', kgpm: 0.305, badge: 'schlauch' }, + { typ: 'LAN 200U', name: 'LAN 200U Cat.5e U/UTP 4×2×AWG24', kgpm: 0.026, badge: 'lan' }, + { typ: 'LAN 200', name: 'LAN 200 Cat.5e F/UTP 4×2×AWG24 PVC', kgpm: 0.041, badge: 'lan' }, + { typ: 'LAN 200', name: 'LAN 200 Cat.5e F/UTP 4×2×AWG24 FRNC', kgpm: 0.041, badge: 'lan' }, + { typ: 'LAN 200', name: 'LAN 200 Cat.5e F/UTP Duplex 2×(4×2×AWG24)', kgpm: 0.082, badge: 'lan' }, + { typ: 'LAN 200C', name: 'LAN 200C Cat.5e SF/UTP 4×2×AWG24 PVC', kgpm: 0.060, badge: 'lan' }, + { typ: 'LAN 200C', name: 'LAN 200C Cat.5e SF/UTP 4×2×AWG24 FRNC', kgpm: 0.060, badge: 'lan' }, + { typ: 'LAN 200C', name: 'LAN 200C Cat.5e SF/UTP Duplex 2×(4×2×AWG24)', kgpm: 0.120, badge: 'lan' }, + { typ: 'LAN 350', name: 'LAN 350 Cat.6 F/UTP 4×2×AWG23 FRNC', kgpm: 0.068, badge: 'lan' }, + { typ: 'LAN 350', name: 'LAN 350 Cat.6 F/UTP Duplex 2×(4×2×AWG23) FRNC', kgpm: 0.110, badge: 'lan' }, + { typ: 'LAN 1000', name: 'LAN 1000 Cat.7 S/FTP 4×2×AWG23 FRNC', kgpm: 0.059, badge: 'lan' }, + { typ: 'LAN 1000', name: 'LAN 1000 Cat.7 S/FTP Duplex 2×(4×2×AWG23) FRNC', kgpm: 0.119, badge: 'lan' }, + { typ: 'LAN 1200', name: 'LAN 1200 Cat.7 S/FTP 4×2×AWG22 FRNC', kgpm: 0.078, badge: 'lan' }, + { typ: 'LAN 1200', name: 'LAN 1200 Cat.7 S/FTP Duplex 2×(4×2×AWG22) FRNC', kgpm: 0.156, badge: 'lan' }, + { typ: 'J-Y(ST)Y EIB/KNX', name: 'J-Y(ST)Y EIB/KNX 2×2×0,8 mm', kgpm: 0.060, badge: 'bus' }, + { typ: 'J-Y(ST)Y', name: 'J-Y(ST)Y 1×2×0,6 mm', kgpm: 0.026, badge: 'bus' }, + { typ: 'J-Y(ST)Y', name: 'J-Y(ST)Y 2×2×0,6 mm', kgpm: 0.035, badge: 'bus' }, + { typ: 'J-Y(ST)Y', name: 'J-Y(ST)Y 3×2×0,6 mm', kgpm: 0.049, badge: 'bus' }, + { typ: 'J-Y(ST)Y', name: 'J-Y(ST)Y 4×2×0,6 mm', kgpm: 0.058, badge: 'bus' }, + { typ: 'J-Y(ST)Y', name: 'J-Y(ST)Y 5×2×0,6 mm', kgpm: 0.059, badge: 'bus' }, + { typ: 'J-Y(ST)Y', name: 'J-Y(ST)Y 6×2×0,6 mm', kgpm: 0.061, badge: 'bus' }, + { typ: 'J-Y(ST)Y', name: 'J-Y(ST)Y 10×2×0,6 mm', kgpm: 0.113, badge: 'bus' }, + { typ: 'J-Y(ST)Y', name: 'J-Y(ST)Y 12×2×0,6 mm', kgpm: 0.129, badge: 'bus' }, + { typ: 'J-Y(ST)Y', name: 'J-Y(ST)Y 20×2×0,6 mm', kgpm: 0.191, badge: 'bus' }, + { typ: 'J-Y(ST)Y', name: 'J-Y(ST)Y 30×2×0,6 mm', kgpm: 0.284, badge: 'bus' }, + { typ: 'J-Y(ST)Y', name: 'J-Y(ST)Y 40×2×0,6 mm', kgpm: 0.358, badge: 'bus' }, + { typ: 'J-Y(ST)Y', name: 'J-Y(ST)Y 50×2×0,6 mm', kgpm: 0.438, badge: 'bus' }, + { typ: 'J-Y(ST)Y', name: 'J-Y(ST)Y 60×2×0,6 mm', kgpm: 0.512, badge: 'bus' }, + { typ: 'J-Y(ST)Y', name: 'J-Y(ST)Y 100×2×0,6 mm', kgpm: 0.829, badge: 'bus' } ]; export function kabelInfoForBez(bez: string): KabelTyp | undefined { diff --git a/client/src/pages/Kabelrechner.tsx b/client/src/pages/Kabelrechner.tsx index 7a582ac..d16a2d4 100644 --- a/client/src/pages/Kabelrechner.tsx +++ b/client/src/pages/Kabelrechner.tsx @@ -14,7 +14,7 @@ export default function Kabelrechner() { function onTypChange(v: string) { setTypSel(v); if (v === 'custom') { setKgpm(''); setKgpmReadOnly(false); setTypName('Eigenes kg/m'); } - else { setKgpm(v); setKgpmReadOnly(true); const opt = KAB_DATA.find(c => String(c.kgpm) === v); setTypName(opt?.name ?? 'Kabel'); } + else { const [name, f] = v.split('|'); setKgpm(f); setKgpmReadOnly(true); setTypName(name); } } const kgpmNum = parseFloat(kgpm); @@ -25,7 +25,7 @@ export default function Kabelrechner() { const laenge = visible ? netto / kgpmNum : 0; function pickFromRef(c: { kgpm: number; name: string }) { - setTypSel(String(c.kgpm)); + setTypSel(`${c.name}|${c.kgpm}`); setKgpm(String(c.kgpm)); setKgpmReadOnly(true); setTypName(c.name); @@ -40,7 +40,7 @@ export default function Kabelrechner() { diff --git a/client/src/styles.css b/client/src/styles.css index ccc88fa..b9f9cf5 100644 --- a/client/src/styles.css +++ b/client/src/styles.css @@ -34,6 +34,8 @@ button,input,select,textarea{font-family:inherit} :root[data-theme="light"] .badge-h07{background:rgba(120,0,180,.14);color:#7a1fae} :root[data-theme="light"] .badge-ysly{background:rgba(210,40,40,.14);color:#b32a2a} :root[data-theme="light"] .badge-schlauch{background:rgba(20,150,90,.14);color:#0f7d4f} +:root[data-theme="light"] .badge-lan{background:rgba(190,150,0,.16);color:#8a6a00} +:root[data-theme="light"] .badge-bus{background:rgba(190,40,130,.14);color:#a3206e} :root[data-theme="light"] label.field select option{background:#fff;color:#0f2130} @media(prefers-color-scheme:light){ @@ -49,6 +51,8 @@ button,input,select,textarea{font-family:inherit} :root:not([data-theme="dark"]) .badge-h07{background:rgba(120,0,180,.14);color:#7a1fae} :root:not([data-theme="dark"]) .badge-ysly{background:rgba(210,40,40,.14);color:#b32a2a} :root:not([data-theme="dark"]) .badge-schlauch{background:rgba(20,150,90,.14);color:#0f7d4f} + :root:not([data-theme="dark"]) .badge-lan{background:rgba(190,150,0,.16);color:#8a6a00} + :root:not([data-theme="dark"]) .badge-bus{background:rgba(190,40,130,.14);color:#a3206e} :root:not([data-theme="dark"]) label.field select option{background:#fff;color:#0f2130} } @@ -176,6 +180,8 @@ table.reftab tr:hover td{background:rgba(0,200,216,.06);cursor:pointer} .badge-h07{background:rgba(140,0,200,.2);color:#d07aff} .badge-ysly{background:rgba(255,70,70,.2);color:#ff8080} .badge-schlauch{background:rgba(60,200,130,.2);color:#60e0a0} +.badge-lan{background:rgba(240,200,40,.2);color:#f0d060} +.badge-bus{background:rgba(230,90,170,.2);color:#ff90cc} /* Dashboard */ .dash-toolbar{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin-bottom:16px}