Show logical feeder loads in project and circuit views
This commit is contained in:
parent
dfeb0e3cb6
commit
042a050876
12 changed files with 319 additions and 11 deletions
|
|
@ -267,6 +267,15 @@ describe("cable sizing defaults from the circuit", () => {
|
|||
sortOrder: 1,
|
||||
isReserve: rows.length === 0,
|
||||
circuitTotalPower: rows.reduce((sum, row) => sum + row.power, 0),
|
||||
circuitApparentPower: rows.reduce(
|
||||
(sum, row) => sum + row.power / (row.cosPhi ?? 1),
|
||||
0
|
||||
),
|
||||
circuitCosPhi: rows.length
|
||||
? rows.reduce((sum, row) => sum + row.power, 0) /
|
||||
rows.reduce((sum, row) => sum + row.power / (row.cosPhi ?? 1), 0)
|
||||
: 1,
|
||||
downstreamBoardLoads: [],
|
||||
deviceRows: rows.map((row, index) => ({
|
||||
id: `row-${index}`,
|
||||
sortOrder: index,
|
||||
|
|
@ -288,6 +297,19 @@ describe("cable sizing defaults from the circuit", () => {
|
|||
assert.equal(deriveCircuitCosPhi(circuit([])), 1);
|
||||
});
|
||||
|
||||
it("uses the projected cos φ including downstream boards", () => {
|
||||
const feeder = circuit([{ power: 1, cosPhi: 1 }]);
|
||||
feeder.circuitCosPhi = 0.67;
|
||||
feeder.downstreamBoardLoads = [{
|
||||
distributionBoardId: "uv-2",
|
||||
name: "UV 2",
|
||||
activePowerKw: 3,
|
||||
apparentPowerKva: 5,
|
||||
cosPhi: 0.6,
|
||||
}];
|
||||
assert.equal(deriveCircuitCosPhi(feeder), 0.67);
|
||||
});
|
||||
|
||||
it("derives the phase from the group category or three-phase rows", () => {
|
||||
assert.equal(deriveCircuitPhase(circuit([{ power: 1, phaseType: "single_phase" }]), "single_phase"), 1);
|
||||
assert.equal(deriveCircuitPhase(circuit([{ power: 1, phaseType: "three_phase" }]), "single_phase"), 3);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue