From bf1c869cbadd675312b7a8ec9e0ad81d4e66a418 Mon Sep 17 00:00:00 2001 From: atef Date: Tue, 18 Apr 2023 10:04:08 +0200 Subject: [PATCH] Update AsciiArt.cs and Topology --- csharp/App/SaliMax/src/AsciiArt.cs | 1 + csharp/App/SaliMax/src/Topology.cs | 23 ++++++++++++----------- csharp/App/SaliMax/tunnels.sh | 12 ++++++------ 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/csharp/App/SaliMax/src/AsciiArt.cs b/csharp/App/SaliMax/src/AsciiArt.cs index 7485a1363..cff4dea90 100644 --- a/csharp/App/SaliMax/src/AsciiArt.cs +++ b/csharp/App/SaliMax/src/AsciiArt.cs @@ -1,3 +1,4 @@ +using InnovEnergy.Lib.Units; using InnovEnergy.Lib.Utils; namespace InnovEnergy.App.SaliMax; diff --git a/csharp/App/SaliMax/src/Topology.cs b/csharp/App/SaliMax/src/Topology.cs index f9db2b68b..defb0f570 100644 --- a/csharp/App/SaliMax/src/Topology.cs +++ b/csharp/App/SaliMax/src/Topology.cs @@ -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 = ""; diff --git a/csharp/App/SaliMax/tunnels.sh b/csharp/App/SaliMax/tunnels.sh index 986fe440c..a6c06948b 100755 --- a/csharp/App/SaliMax/tunnels.sh +++ b/csharp/App/SaliMax/tunnels.sh @@ -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