Show logical feeder loads in project and circuit views

This commit is contained in:
Julian Appel 2026-09-27 22:37:04 +02:00
parent dfeb0e3cb6
commit 042a050876
12 changed files with 319 additions and 11 deletions

View file

@ -22,6 +22,9 @@ export function deriveCircuitPhase(
* Rows without cos φ count as 1; a circuit without load yields 1.
*/
export function deriveCircuitCosPhi(circuit: CircuitTreeCircuitDto): number {
if (Number.isFinite(circuit.circuitCosPhi) && circuit.circuitCosPhi > 0) {
return Math.round(circuit.circuitCosPhi * 100) / 100;
}
let activePowerKw = 0;
let apparentPowerKva = 0;
for (const row of circuit.deviceRows) {

View file

@ -1,5 +1,6 @@
"use client";
import Link from "next/link";
import { DragEvent, KeyboardEvent, useEffect, useMemo, useRef, useState } from "react";
import {
ArrowDown,
@ -3293,6 +3294,23 @@ export function CircuitTreeEditor(props: { projectId: string; circuitListId: str
threePhaseVoltageV={data.threePhaseVoltageV}
/>
) : null}
{data.feedingReference ? (
<div className="alert alert-info py-2" role="status">
Gespeist von{" "}
<Link
href={`/projects/${projectId}/circuit-lists/${
data.feedingReference.circuitListId
}/tree-edit`}
>
{data.feedingReference.distributionBoardNumber ??
data.feedingReference.distributionBoardName}
{data.feedingReference.circuitEquipmentIdentifier ?? ""}
</Link>
{data.feedingReference.circuitId
? null
: " (speisender Stromkreis noch nicht festgelegt)"}
</div>
) : null}
<div className="editor-toolbar">
<IconButton
disabled={!historyState || historyState.undoDepth === 0 || historyBusy || isSaving}
@ -4062,6 +4080,8 @@ export function CircuitTreeEditor(props: { projectId: string; circuitListId: str
? "summary-row"
: row.rowType === "deviceRow"
? "device-row"
: row.rowType === "downstreamBoardLoad"
? "downstream-board-load-row"
: row.rowType === "reserveCircuit"
? "empty-circuit-row"
: row.rowType === "placeholder"
@ -4667,7 +4687,10 @@ export function CircuitTreeEditor(props: { projectId: string; circuitListId: str
: ""
}`}
>
{row.circuit && row.rowType !== "deviceRow" ? (
{row.circuit &&
(row.rowType === "circuitCompact" ||
row.rowType === "circuitSummary" ||
row.rowType === "reserveCircuit") ? (
<>
<IconButton
disabled={isSaving}

View file

@ -13,7 +13,7 @@ export type DistributionBoardInfoDraft = Record<DistributionBoardInfoField, stri
const placeholders: Record<DistributionBoardInfoField, string> = {
boardNumber: "z. B. UV 1.1",
location: "z. B. Raum 003 Technik",
fedFrom: "z. B. HV 0.1 oder HAK / Zähleranlage",
fedFrom: "z. B. HAK, Zähleranlage, Trafo oder NEA",
remark: "",
};
@ -98,8 +98,8 @@ export function DistributionBoardInfoCard({
)}
{field === "fedFrom" ? (
<div className="form-text">
Vorerst Freitext. Die logische Verknüpfung mit dem
speisenden Verteiler folgt.
Für externe Einspeisungen oder ergänzende Hinweise. Eine
speisende Projektverteilung wird oben logisch verknüpft.
</div>
) : null}
</div>