From 22dd4222cae1c51fe896c60640c8f5fda727243e Mon Sep 17 00:00:00 2001 From: Noe Date: Tue, 14 Nov 2023 16:05:39 +0100 Subject: [PATCH] Added Mode in live tab, fixed max discharge power in configuration --- csharp/App/Backend/Backend.csproj | 171 ++++++++++++++++++ .../App/Backend/DataTypes/Methods/Session.cs | 1 + .../Configuration/Configuration.tsx | 4 +- .../dashboards/Installations/Installation.tsx | 31 +++- .../src/content/dashboards/Log/graph.util.tsx | 6 +- 5 files changed, 210 insertions(+), 3 deletions(-) diff --git a/csharp/App/Backend/Backend.csproj b/csharp/App/Backend/Backend.csproj index 0e70bb5dd..999e039c1 100644 --- a/csharp/App/Backend/Backend.csproj +++ b/csharp/App/Backend/Backend.csproj @@ -43,6 +43,171 @@ PreserveNewest + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -59,4 +224,10 @@ + + + + + + diff --git a/csharp/App/Backend/DataTypes/Methods/Session.cs b/csharp/App/Backend/DataTypes/Methods/Session.cs index 2db8e0ff4..38cadb339 100644 --- a/csharp/App/Backend/DataTypes/Methods/Session.cs +++ b/csharp/App/Backend/DataTypes/Methods/Session.cs @@ -119,6 +119,7 @@ public static class SessionMethods && original is not null && user.HasWriteAccess && user.HasAccessTo(installation) + && installation.SetOrderNumbers() && installation .WithParentOf(original) // prevent moving .Apply(Db.Update); diff --git a/typescript/frontend-marios2/src/content/dashboards/Configuration/Configuration.tsx b/typescript/frontend-marios2/src/content/dashboards/Configuration/Configuration.tsx index 09c4fcdb6..f204ebf6a 100644 --- a/typescript/frontend-marios2/src/content/dashboards/Configuration/Configuration.tsx +++ b/typescript/frontend-marios2/src/content/dashboards/Configuration/Configuration.tsx @@ -101,7 +101,9 @@ function Configuration(props: ConfigurationProps) { value={ ( (props.values.maximumDischargePower.values[0] - .value as number) * 48 + .value as number) * + 48 * + (props.values.DcDcNum.values[0].value as number) ).toString() + ' W' } fullWidth diff --git a/typescript/frontend-marios2/src/content/dashboards/Installations/Installation.tsx b/typescript/frontend-marios2/src/content/dashboards/Installations/Installation.tsx index b4b572cc0..377f19829 100644 --- a/typescript/frontend-marios2/src/content/dashboards/Installations/Installation.tsx +++ b/typescript/frontend-marios2/src/content/dashboards/Installations/Installation.tsx @@ -300,6 +300,35 @@ function Installation(props: singleInstallationProps) { {props.current_installation.name} + {currentTab == 'live' && values && ( +
+ + + + + {values.mode.values[0].value} + +
+ )}
diff --git a/typescript/frontend-marios2/src/content/dashboards/Log/graph.util.tsx b/typescript/frontend-marios2/src/content/dashboards/Log/graph.util.tsx index 442277fd5..00a54f159 100644 --- a/typescript/frontend-marios2/src/content/dashboards/Log/graph.util.tsx +++ b/typescript/frontend-marios2/src/content/dashboards/Log/graph.util.tsx @@ -67,7 +67,9 @@ export type TopologyValues = { installedDcDcPower: BoxData; gridSetPoint: BoxData; maximumDischargePower: BoxData; + DcDcNum: BoxData; calibrationChargeForced: BoxData; + mode: BoxData; }; type TopologyPaths = { [key in keyof TopologyValues]: string[] }; @@ -145,7 +147,9 @@ export const topologyPaths: TopologyPaths = { installedDcDcPower: ['/DcDc/SystemControl/NumberOfConnectedSlaves'], gridSetPoint: ['/Config/GridSetPoint'], maximumDischargePower: ['/Config/MaxBatteryDischargingCurrent'], - calibrationChargeForced: ['/Config/ForceCalibrationCharge'] + DcDcNum: ['/DcDc/SystemControl/NumberOfConnectedSlaves'], + calibrationChargeForced: ['/Config/ForceCalibrationCharge'], + mode: ['/EssControl/Mode'] }; export const extractValues = (