create and update toplogy for kaco installation
This commit is contained in:
parent
94c9a7b28f
commit
b7742ac937
|
|
@ -44,7 +44,7 @@ public static class SimpleTopology
|
||||||
var h = status.InverterRecord?.ActivePowerW;
|
var h = status.InverterRecord?.ActivePowerW;
|
||||||
|
|
||||||
var i = 0;
|
var i = 0;
|
||||||
var j = 0;
|
var j = h - a;
|
||||||
|
|
||||||
var k = status.DcDc?.Dc.Battery.Power.Value;
|
var k = status.DcDc?.Dc.Battery.Power.Value;
|
||||||
|
|
||||||
|
|
@ -53,8 +53,8 @@ public static class SimpleTopology
|
||||||
var l = status.ListOfBatteriesRecord?.Sum(r => r.Power);
|
var l = status.ListOfBatteriesRecord?.Sum(r => r.Power);
|
||||||
|
|
||||||
var grid = status.CreateGridColumn(a);
|
var grid = status.CreateGridColumn(a);
|
||||||
var acdc = status.CreateAcDcColumn(h);
|
var acdc = status.CreateAcDcColumn(h,j);
|
||||||
var dcBus = status.CreateDcBusColumn(i, j, k);
|
var dcBus = status.CreateDcBusColumn( k);
|
||||||
var dcdc = status.CreateDcDcColumn(l);
|
var dcdc = status.CreateDcDcColumn(l);
|
||||||
var batteries = status.CreateBatteriesRow();
|
var batteries = status.CreateBatteriesRow();
|
||||||
|
|
||||||
|
|
@ -94,7 +94,7 @@ public static class SimpleTopology
|
||||||
return TextBlock.AlignCenterVertical(gridBox, flow);
|
return TextBlock.AlignCenterVertical(gridBox, flow);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static TextBlock CreateAcDcColumn(this StatusRecord status, ActivePower? h)
|
private static TextBlock CreateAcDcColumn(this StatusRecord status, ActivePower? h, ActivePower? j)
|
||||||
{
|
{
|
||||||
// ┌─────────┐
|
// ┌─────────┐
|
||||||
// │ AC/DC │
|
// │ AC/DC │
|
||||||
|
|
@ -102,33 +102,6 @@ public static class SimpleTopology
|
||||||
// │ dev1 P │
|
// │ dev1 P │
|
||||||
// │ dev2 P │
|
// │ dev2 P │
|
||||||
// └─────────┘ (h) flow to DC Bus
|
// └─────────┘ (h) flow to DC Bus
|
||||||
|
|
||||||
var acdcBox = TextBlock
|
|
||||||
.AlignLeft(status.InverterRecord?.ActivePowerW.ToString() ?? "???")
|
|
||||||
.TitleBox("AC/DC");
|
|
||||||
|
|
||||||
var flowToDcBus = Flow.Horizontal(h);
|
|
||||||
|
|
||||||
return TextBlock.AlignCenterVertical(acdcBox, flowToDcBus);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static TextBlock CreateDcBusColumn(
|
|
||||||
this StatusRecord status,
|
|
||||||
ActivePower? i,
|
|
||||||
ActivePower? j,
|
|
||||||
ActivePower? k)
|
|
||||||
{
|
|
||||||
// ┌────┐
|
|
||||||
// │ PV │
|
|
||||||
// └────┘
|
|
||||||
// V
|
|
||||||
// (i) 13.2 kW
|
|
||||||
// V
|
|
||||||
// ┌────────┐ (k) >>>>>>>>> to DC/DC
|
|
||||||
// │ Dc Bus │>>>>>>>>>>>>>>>>>>>
|
|
||||||
// ├────────┤
|
|
||||||
// │ 776 V │
|
|
||||||
// └────────┘
|
|
||||||
// V
|
// V
|
||||||
// (j) 0 W
|
// (j) 0 W
|
||||||
// V
|
// V
|
||||||
|
|
@ -136,9 +109,42 @@ public static class SimpleTopology
|
||||||
// │ Load │
|
// │ Load │
|
||||||
// └──────┘
|
// └──────┘
|
||||||
|
|
||||||
// PV box + vertical flow
|
var acdcBox = TextBlock
|
||||||
|
.AlignLeft(status.InverterRecord?.ActivePowerW.ToString() ?? "???")
|
||||||
|
.TitleBox("AC/DC");
|
||||||
|
|
||||||
|
////////////// top //////////////
|
||||||
|
ActivePower i = 0;
|
||||||
var pvBox = TextBlock.FromString("PV").Box();
|
var pvBox = TextBlock.FromString("PV").Box();
|
||||||
var pvToBus = Flow.Vertical(i);
|
var pvFlow = Flow.Vertical(i);
|
||||||
|
|
||||||
|
// Load box + vertical flow
|
||||||
|
var busToLoad = Flow.Vertical(j);
|
||||||
|
var loadBox = TextBlock.FromString("Load").Box();
|
||||||
|
|
||||||
|
var flowToDcBus = Flow.Horizontal(h);
|
||||||
|
|
||||||
|
return TextBlock.AlignCenterVertical (
|
||||||
|
TextBlock.AlignCenterHorizontal(pvBox, pvFlow, acdcBox, busToLoad, loadBox),
|
||||||
|
flowToDcBus
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static TextBlock CreateDcBusColumn(
|
||||||
|
this StatusRecord status,
|
||||||
|
ActivePower? k)
|
||||||
|
{
|
||||||
|
|
||||||
|
// ┌────────┐ (k) >>>>>>>>> to DC/DC
|
||||||
|
// │ Dc Bus │>>>>>>>>>>>>>>>>>>>
|
||||||
|
// ├────────┤
|
||||||
|
// │ 776 V │
|
||||||
|
// └────────┘
|
||||||
|
|
||||||
|
|
||||||
|
// PV box + vertical flow
|
||||||
|
// var pvBox = TextBlock.FromString("PV").Box();
|
||||||
|
// var pvToBus = Flow.Vertical(i);
|
||||||
|
|
||||||
// DC bus box (voltage from your DcDc record matches your existing code)
|
// DC bus box (voltage from your DcDc record matches your existing code)
|
||||||
var dcBusVoltage = status.DcDc.Dc.Link.Voltage.Value;
|
var dcBusVoltage = status.DcDc.Dc.Link.Voltage.Value;
|
||||||
|
|
@ -150,13 +156,10 @@ public static class SimpleTopology
|
||||||
// Horizontal flow from DC Bus to DC/DC
|
// Horizontal flow from DC Bus to DC/DC
|
||||||
var busToDcDc = Flow.Horizontal(k);
|
var busToDcDc = Flow.Horizontal(k);
|
||||||
|
|
||||||
// Load box + vertical flow
|
|
||||||
var busToLoad = Flow.Vertical(j);
|
|
||||||
var loadBox = TextBlock.FromString("Load").Box();
|
|
||||||
|
|
||||||
// Assemble: put PV above DC Bus, Load below DC Bus, and the (k) flow beside the bus.
|
// Assemble: put PV above DC Bus, Load below DC Bus, and the (k) flow beside the bus.
|
||||||
return TextBlock.AlignCenterVertical(
|
return TextBlock.AlignCenterVertical(
|
||||||
TextBlock.AlignCenterHorizontal(pvBox, pvToBus, dcBusBox, busToLoad, loadBox),
|
TextBlock.AlignCenterHorizontal( dcBusBox),
|
||||||
busToDcDc
|
busToDcDc
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue