Update AsciiArt.cs and Topology

This commit is contained in:
atef 2023-04-18 10:04:08 +02:00
parent dcab3ab4d1
commit bf1c869cba
3 changed files with 19 additions and 17 deletions

View File

@ -1,3 +1,4 @@
using InnovEnergy.Lib.Units;
using InnovEnergy.Lib.Utils;
namespace InnovEnergy.App.SaliMax;

View File

@ -1,8 +1,9 @@
#undef BatteriesAllowed
using InnovEnergy.App.SaliMax.Controller;
using InnovEnergy.App.SaliMax.Log;
using InnovEnergy.Lib.Utils;
using InnovEnergy.Lib.Units;
namespace InnovEnergy.App.SaliMax;
@ -16,12 +17,12 @@ public static class Topology
var pwr = s.InverterStatus!.Ac.ActivePower;
var pvPower = (s.AmptStatus!.Devices[0].Dc.Voltage * s.AmptStatus.Devices[0].Dc.Current + s.AmptStatus!.Devices[1].Dc.Voltage * s.AmptStatus.Devices[1].Dc.Current).Round0(); // TODO using one Ampt
var loadPower = Utils.Round3((s.GridMeterStatus!.ActivePowerL123 + pwr)); // it's a + because the pwr is inverted
var pvPower = (s.AmptStatus!.Strings[0].Voltage * s.AmptStatus.Strings[0].Current + s.AmptStatus!.Strings[1].Voltage * s.AmptStatus.Strings[1].Current); // TODO using one Ampt
var loadPower = Utils.Round3((s.GridMeterStatus!.Ac.ActivePower + pwr)); // it's a + because the pwr is inverted
var gridSeparator = s.GridMeterStatus!.ActivePowerL123 > 0 ? chargingSeparator : dischargingSeparator;
var gridSeparator = s.GridMeterStatus!.Ac.ActivePower > 0 ? chargingSeparator : dischargingSeparator;
var inverterSeparator = -pwr > 0 ? chargingSeparator : dischargingSeparator;
var dcSeparator = -s.DcDcStatus!.Dc.Power > 0 ? chargingSeparator : dischargingSeparator;
var dcSeparator = -s.DcDcStatus!.Right.Power > 0 ? chargingSeparator : dischargingSeparator;
#if BatteriesAllowed
var battery1Separator = s.BatteriesStatus[0]!.Power > 0 ? chargingSeparator : dischargingSeparator;
var battery2Separator = s.BatteriesStatus[1]!.Power > 0 ? chargingSeparator : dischargingSeparator;
@ -36,7 +37,7 @@ public static class Topology
s.GridMeterStatus.Ac.L3.Voltage.V()
).AlignCenterVertical(height);
var gridAcBusArrow = AsciiArt.CreateHorizontalArrow(s.GridMeterStatus!.ActivePowerL123.Round0(), gridSeparator)
var gridAcBusArrow = AsciiArt.CreateHorizontalArrow(s.GridMeterStatus!.Ac.ActivePower, gridSeparator)
.AlignCenterVertical(height);
@ -58,7 +59,7 @@ public static class Topology
var loadRect = StringUtils.AlignBottom(CreateRect(boxAcBus, boxLoad, loadPower), height);
var acBusInvertArrow = AsciiArt.CreateHorizontalArrow(-pwr.Round0(), inverterSeparator)
var acBusInvertArrow = AsciiArt.CreateHorizontalArrow(-pwr, inverterSeparator)
.AlignCenterVertical(height);
//////////////////// Inverter /////////////////////////
@ -69,7 +70,7 @@ public static class Topology
""
).AlignCenterVertical(height);
var inverterArrow = AsciiArt.CreateHorizontalArrow(-pwr.Round0(), inverterSeparator)
var inverterArrow = AsciiArt.CreateHorizontalArrow(-pwr, inverterSeparator)
.AlignCenterVertical(height);
@ -84,7 +85,7 @@ public static class Topology
var pvBox = AsciiArt.CreateBox
(
"MPPT",
((s.AmptStatus!.Devices[0].Dc.Voltage + s.AmptStatus!.Devices[1].Dc.Voltage) / 2).Round0().V(),
((s.AmptStatus!.Strings[0].Voltage + s.AmptStatus!.Strings[1].Voltage) / 2).V(),
""
);
@ -101,8 +102,8 @@ public static class Topology
""
).AlignCenterVertical(height);
#if BatteriesAllowed
var dcArrow1 = AsciiArt.CreateHorizontalArrow(s.BatteriesStatus[0]!.Power.Round0(), battery1Separator);
var dcArrow2 = AsciiArt.CreateHorizontalArrow(s.BatteriesStatus[1]!.Power.Round0(), battery2Separator);
var dcArrow1 = AsciiArt.CreateHorizontalArrow(s.BatteriesStatus[0]!.Power, battery1Separator);
var dcArrow2 = AsciiArt.CreateHorizontalArrow(s.BatteriesStatus[1]!.Power, battery2Separator);
#else
var dcArrow1 ="";
var dcArrow2 = "";

View File

@ -1,6 +1,6 @@
#!/bin/bash
host=debian@10.2.1.87
host=ie-entwicklung@10.2.3.104
tunnel() {
name=$1
@ -22,11 +22,11 @@ tunnel() {
echo ""
tunnel "Trumpf Inverter (http) " 192.168.1.2 80 8001
tunnel "Trumpf DCDC (http) " 192.168.1.3 80 8002
tunnel "Emu Meter (http) " 192.168.1.241 80 8003
tunnel "ADAM (http) " 192.168.1.242 80 8004
tunnel "AMPT (http) " 192.168.1.249 8080 8005
tunnel "Trumpf Inverter (http) " 192.168.1.2 80 7001
tunnel "Trumpf DCDC (http) " 192.168.1.3 80 7002
tunnel "Emu Meter (http) " 192.168.1.241 80 7003
tunnel "ADAM (http) " 192.168.1.242 80 7004
tunnel "AMPT (http) " 192.168.1.249 8080 7005
tunnel "Trumpf Inverter (modbus)" 192.168.1.2 502 5001
tunnel "Trumpf DCDC (modbus) " 192.168.1.3 502 5002