diff --git a/csharp/App/SaliMax/SaliMax.csproj b/csharp/App/SaliMax/SaliMax.csproj index 8c66b470f..0360f4ae5 100644 --- a/csharp/App/SaliMax/SaliMax.csproj +++ b/csharp/App/SaliMax/SaliMax.csproj @@ -1,8 +1,4 @@ - - Debug;Release;Release-Server - AnyCPU;linux-arm - @@ -26,4 +22,4 @@ - \ No newline at end of file + diff --git a/csharp/App/SaliMax/run (SalimnaxProto Meiringen).sh b/csharp/App/SaliMax/run (SalimnaxProto Meiringen).sh index f41f8ee9b..d2ed6e95d 100755 --- a/csharp/App/SaliMax/run (SalimnaxProto Meiringen).sh +++ b/csharp/App/SaliMax/run (SalimnaxProto Meiringen).sh @@ -18,17 +18,17 @@ echo -e "\n============================ Deploy ============================\n" rsync -v \ ./bin/Release/$dotnet_version/linux-x64/publish/* \ - ie-entwicklung@10.2.3.115:~/salimax + $username@$salimax_ip:~/salimax echo -e "\n============================ Restart Salimax sevice ============================\n" ssh -tt \ - ie-entwicklung@10.2.3.115 \ + $username@$salimax_ip \ sudo systemctl restart salimax.service echo -e "\n============================ Print service output ============================\n" ssh -tt \ - ie-entwicklung@10.2.3.115 \ + $username@$salimax_ip \ journalctl -f -u salimax.service diff --git a/csharp/App/SaliMax/src/Logger.cs b/csharp/App/SaliMax/src/Logger.cs index f89ecb653..666cad058 100644 --- a/csharp/App/SaliMax/src/Logger.cs +++ b/csharp/App/SaliMax/src/Logger.cs @@ -24,4 +24,16 @@ public static class Logger _logger.LogDebug(t.ToString()); // TODO: check warning return t; } + + public static T LogError(this T t) where T : notnull + { + _logger.LogError(t.ToString()); // TODO: check warning + return t; + } + + public static T LogWarning(this T t) where T : notnull + { + _logger.LogWarning(t.ToString()); // TODO: check warning + return t; + } } \ No newline at end of file diff --git a/csharp/App/SaliMax/src/Program.cs b/csharp/App/SaliMax/src/Program.cs index 010d2a447..0de19fc93 100644 --- a/csharp/App/SaliMax/src/Program.cs +++ b/csharp/App/SaliMax/src/Program.cs @@ -249,11 +249,11 @@ internal static class Program // Voltage Measurement Values //var inverterVoltage = new Voltage [(Int32)s.AcDc.Ac.L1.Voltage, (Int32)s.AcDc.Ac.L2.Voltage, (Int32)s.AcDc.Ac.L3.Voltage]; //var dcLinkVoltage = s.DcDc.Dc.Link.Voltage; - var dc48Voltage = s.DcDc.Dc.Battery.Voltage; - var batteryVoltage = s.Battery.Dc.Voltage; - var batterySoc = s.Battery.Soc; - var batteryCurrent = s.Battery.Dc.Current; - var batteryTemp = s.Battery.Temperature; + var dc48Voltage = s.DcDc.Dc.Battery.Voltage.ToDisplayString(); + var batteryVoltage = s.Battery.Dc.Voltage.ToDisplayString; + var batterySoc = s.Battery.Soc.ToDisplayString(); + var batteryCurrent = s.Battery.Dc.Current.ToDisplayString(); + var batteryTemp = s.Battery.Temperature.ToDisplayString(); var gridBusColumn = ColumnBox("Pv", "Grid Bus", "Load" , gridVoltageByPhase , gridLoadPower); var islandBusColumn = ColumnBox("Pv", "Island Bus", "Load" , inverterPowerByPhase, islandLoadPower); @@ -268,16 +268,16 @@ internal static class Program var gridBox = TextBlock.AlignLeft(gridPowerByPhase).TitleBox("Grid"); var inverterBox = TextBlock.AlignLeft(inverterPowerByAcDc).TitleBox("Inverter"); var dcDcBox = TextBlock.AlignLeft(dc48Voltage).TitleBox("DC/DC"); - var batteryAvgBox = TextBlock.AlignLeft(batteryVoltage.ToDisplayString(), - batterySoc.ToDisplayString(), - batteryCurrent.ToDisplayString(), - batteryTemp.ToDisplayString()) + var batteryAvgBox = TextBlock.AlignLeft(batteryVoltage, + batterySoc, + batteryCurrent, + batteryTemp) .TitleBox("Battery"); //////////////////// Batteries ///////////////////////// - IReadOnlyList batteryBoxes = s.Battery + var batteryBoxes = s.Battery .Devices .Select(CreateIndividualBattery) .ToArray(s.Battery.Devices.Count); @@ -304,10 +304,13 @@ internal static class Program private static TextBlock CreateIndividualBattery(Battery48TlRecord battery, Int32 i) { + var content = TextBlock.AlignLeft(battery.Dc.Voltage.ToDisplayString(), battery.Soc.ToDisplayString(), battery.Dc.Current.ToDisplayString(), - battery.Temperatures.Heating); + battery.Temperatures.Cells.Average.ToDisplayString(), + battery.BusCurrent.ToDisplayString(), + battery.HeatingCurrent.ToDisplayString()); var box = content.TitleBox($"Battery {i + 1}"); @@ -434,6 +437,5 @@ internal static class Program Console.WriteLine(error); } } - } diff --git a/csharp/App/SaliMax/tunnelstoSalimax0001.sh b/csharp/App/SaliMax/tunnelstoSalimax0001.sh index 4dd7a96af..f538423bb 100755 --- a/csharp/App/SaliMax/tunnelstoSalimax0001.sh +++ b/csharp/App/SaliMax/tunnelstoSalimax0001.sh @@ -1,4 +1,4 @@ -j#!/bin/bash +#!/bin/bash host=ie-entwicklung@10.2.3.104 diff --git a/csharp/InnovEnergy.props b/csharp/InnovEnergy.props index b1a90c16d..106c6030a 100644 --- a/csharp/InnovEnergy.props +++ b/csharp/InnovEnergy.props @@ -9,12 +9,12 @@ net6.0 true false - Please.reload.the.project.Rider.is.stupid + $(Company) Team - - $(Company).$(MSBuildProjectDirectory.Replace($(SolutionDir), "").Replace("/",".").Replace("\",".")) - + + + \ No newline at end of file diff --git a/csharp/Lib/Devices/Battery48TL/Battery48TlRecord.Api.cs b/csharp/Lib/Devices/Battery48TL/Battery48TlRecord.Api.cs index 40d925310..9f99e104c 100644 --- a/csharp/Lib/Devices/Battery48TL/Battery48TlRecord.Api.cs +++ b/csharp/Lib/Devices/Battery48TL/Battery48TlRecord.Api.cs @@ -23,6 +23,10 @@ public partial class Battery48TlRecord public Strings Alarms => ParseAlarms() .OrderBy(w => w).ToList(); public Percent Soc => _Soc; + + public Current BusCurrent => _BusCurrent; + + public Current HeatingCurrent => _BusCurrent - _CellsCurrent; public readonly struct Leds_ { @@ -65,9 +69,9 @@ public partial class Battery48TlRecord public readonly struct Dc_ { - public Voltage Voltage => Self._DcVoltage; - public Current Current => Self._DcCurrent; - public ActivePower Power => Self._DcVoltage * Self._DcCurrent; + public Voltage Voltage => Self._CellsVoltage; + public Current Current => Self._CellsCurrent; + public ActivePower Power => Self._CellsVoltage * Self._CellsCurrent; internal Dc_(Battery48TlRecord self) => Self = self; private Battery48TlRecord Self { get; } diff --git a/csharp/Lib/Devices/Battery48TL/Battery48TlRecord.Modbus.cs b/csharp/Lib/Devices/Battery48TL/Battery48TlRecord.Modbus.cs index 45e41f8a5..e2bf89a13 100644 --- a/csharp/Lib/Devices/Battery48TL/Battery48TlRecord.Modbus.cs +++ b/csharp/Lib/Devices/Battery48TL/Battery48TlRecord.Modbus.cs @@ -17,8 +17,10 @@ public partial class Battery48TlRecord [InputRegister(1009)] private UInt64 _AlarmFlags; [InputRegister(1013)] private UInt16 _IoStates; - [InputRegister(999, Scale = 0.01)] private Double _DcVoltage; - [InputRegister(1000, Scale = 0.01, Offset = -10000)] private Double _DcCurrent; + [InputRegister(999, Scale = 0.01)] private Double _CellsVoltage; + [InputRegister(1001, Scale = 0.01)] private Double _BusVoltage; + [InputRegister(1000, Scale = 0.01, Offset = -10000)] private Double _CellsCurrent; + [InputRegister(1062, Scale = 0.01, Offset = -10000)] private Double _BusCurrent; [InputRegister(1053, Scale = 0.1)] private Double _Soc; diff --git a/typescript/Frontend/src/components/Groups/GroupTabs.tsx b/typescript/Frontend/src/components/Groups/GroupTabs.tsx index e52121c34..bfa8a317b 100644 --- a/typescript/Frontend/src/components/Groups/GroupTabs.tsx +++ b/typescript/Frontend/src/components/Groups/GroupTabs.tsx @@ -5,12 +5,9 @@ import useRouteMatch from "../../hooks/useRouteMatch"; import { useIntl } from "react-intl"; import { GroupContext } from "../Context/GroupContextProvider"; import { useContext } from "react"; -import { - AntTabs, - StyledTab, - StyledTabBlue, -} from "../../util/installation.util"; import { colors } from "../.."; +import InnovenergyTab from "../Layout/InnovenergyTab"; +import InnovenergyTabs from "components/Layout/InnovenergyTabs"; const GroupTabs = () => { const routeMatch = useRouteMatch([ @@ -27,15 +24,10 @@ const GroupTabs = () => { return ( - + {currentType === "Folder" ? ( - { to={routes.folder + id} /> ) : ( - { /> )} - { component={Link} to={routes.manageAccess + id} /> - + ); diff --git a/typescript/Frontend/src/components/Installations/InstallationTabs.tsx b/typescript/Frontend/src/components/Installations/InstallationTabs.tsx index e91d6fb10..6d0bd352d 100644 --- a/typescript/Frontend/src/components/Installations/InstallationTabs.tsx +++ b/typescript/Frontend/src/components/Installations/InstallationTabs.tsx @@ -4,14 +4,8 @@ import { Link } from "react-router-dom"; import routes from "../../routes.json"; import useRouteMatch from "../../hooks/useRouteMatch"; import { useIntl } from "react-intl"; -import { - AntTabs, - StyledTab, - StyledTabBlue, - StyledTabWhite, -} from "../../util/installation.util"; -import { Background } from "reactflow"; -import {colors} from '/home/ig/code/git_trunk/typescript/Frontend/src/index'; +import InnovenergyTab from "../Layout/InnovenergyTab"; +import InnovenergyTabs from "components/Layout/InnovenergyTabs"; const InstallationTabs = () => { const routeMatch = useRouteMatch([ @@ -27,15 +21,12 @@ const InstallationTabs = () => { return ( - - { component={Link} to={routes.installation + id} /> - { component={Link} to={routes.liveView + id} /> - { component={Link} to={routes.log + id} /> - + ); diff --git a/typescript/Frontend/src/components/Installations/Log/CheckboxTree.tsx b/typescript/Frontend/src/components/Installations/Log/CheckboxTree.tsx index ec83f2a09..bace93645 100644 --- a/typescript/Frontend/src/components/Installations/Log/CheckboxTree.tsx +++ b/typescript/Frontend/src/components/Installations/Log/CheckboxTree.tsx @@ -7,7 +7,6 @@ import ChevronRightIcon from "@mui/icons-material/ChevronRight"; import useRouteMatch from "../../../hooks/useRouteMatch"; import routes from "../../../routes.json"; import React from "react"; -import { blueGrey } from "@mui/material/colors"; import {colors} from "/home/ig/code/git_trunk/typescript/Frontend/src/index"; export interface ToggleElement { diff --git a/typescript/Frontend/src/components/Installations/Log/DateRangePicker.tsx b/typescript/Frontend/src/components/Installations/Log/DateRangePicker.tsx index 10a7454e4..0749763d0 100644 --- a/typescript/Frontend/src/components/Installations/Log/DateRangePicker.tsx +++ b/typescript/Frontend/src/components/Installations/Log/DateRangePicker.tsx @@ -75,6 +75,7 @@ const DateRangePicker = (props: DateRangePickerProps) => { }, ".Mui-focused fieldset.MuiOutlinedInput-notchedOutline": { borderColor: theme.palette.secondary.main, }, + }} onChange={(newValue) => { if (newValue) { diff --git a/typescript/Frontend/src/components/Installations/Log/ScalarGraph.tsx b/typescript/Frontend/src/components/Installations/Log/ScalarGraph.tsx index c1db57e39..4be24ca54 100644 --- a/typescript/Frontend/src/components/Installations/Log/ScalarGraph.tsx +++ b/typescript/Frontend/src/components/Installations/Log/ScalarGraph.tsx @@ -60,7 +60,7 @@ export const fetchData = ( const ScalarGraph = () => { const timeRange = createTimes( UnixTime.now() /* .fromTicks(1682085650) */ - .rangeBefore(TimeSpan.fromDays(4)), + .rangeBefore(TimeSpan.fromDays(5)), NUMBER_OF_NODES ); const [timeSeries, setTimeSeries] = useState([]); @@ -173,10 +173,8 @@ const ScalarGraph = () => { if (checkedToggles.length > 0) { const coordinateTimeSeries = transformToGraphData(timeSeries); const visibleGraphs = Object.keys(coordinateTimeSeries).filter((path) => { - return checkedToggles.find((toggle) => toggle === path); }); - if (visibleGraphs.length > 0) { return (
diff --git a/typescript/Frontend/src/components/Layout/InnovenergyTab.tsx b/typescript/Frontend/src/components/Layout/InnovenergyTab.tsx new file mode 100644 index 000000000..43a04815f --- /dev/null +++ b/typescript/Frontend/src/components/Layout/InnovenergyTab.tsx @@ -0,0 +1,41 @@ +import { styled, SxProps, Tab, Tabs, Theme, useTheme } from "@mui/material"; +import { TabProps } from "@mui/material/Tab/Tab"; + +const InnovenergyTab = (props: any) => { + const theme = useTheme(); + return ( + + ); +}; + +export default InnovenergyTab; diff --git a/typescript/Frontend/src/components/Layout/InnovenergyTabs.tsx b/typescript/Frontend/src/components/Layout/InnovenergyTabs.tsx new file mode 100644 index 000000000..bf98f5510 --- /dev/null +++ b/typescript/Frontend/src/components/Layout/InnovenergyTabs.tsx @@ -0,0 +1,42 @@ +import { SxProps, Tabs, Theme } from "@mui/material"; +import { ReactNode } from "react"; + +interface AntTabsProps { + id: string; + value?: string; + sx?: SxProps; + children: ReactNode; +} + +const InnovenergyTabs = (props: AntTabsProps) => { + return ( + + {props.children} + + ); +}; + +export default InnovenergyTabs; diff --git a/typescript/Frontend/src/components/Layout/ModeButtons.tsx b/typescript/Frontend/src/components/Layout/ModeButtons.tsx index 094b46a71..aee76e50e 100644 --- a/typescript/Frontend/src/components/Layout/ModeButtons.tsx +++ b/typescript/Frontend/src/components/Layout/ModeButtons.tsx @@ -15,23 +15,6 @@ const ModeButtons = () => { return ( <> - {/* - } - value={routes.installations + routes.list + "*"} - component={Link} - to={routes.list} - /> - } - value={routes.installations + routes.tree + "*"} - component={Link} - to={routes.tree} - /> - */} { const routeMatch = useRouteMatch([ @@ -19,37 +14,11 @@ const NavigationButtons = () => { return ( <> - {/* - - - - - - - */} - - { /> } /> - } /> - + ); }; diff --git a/typescript/Frontend/src/components/Users/UserTabs.tsx b/typescript/Frontend/src/components/Users/UserTabs.tsx index 16d84292c..c2d60c5b4 100644 --- a/typescript/Frontend/src/components/Users/UserTabs.tsx +++ b/typescript/Frontend/src/components/Users/UserTabs.tsx @@ -3,11 +3,8 @@ import { Link } from "react-router-dom"; import routes from "../../routes.json"; import useRouteMatch from "../../hooks/useRouteMatch"; import { useIntl } from "react-intl"; -import { - AntTabs, - StyledTab, - StyledTabBlue, -} from "../../util/installation.util"; +import InnovenergyTab from "../Layout/InnovenergyTab"; +import InnovenergyTabs from "components/Layout/InnovenergyTabs"; const UserTabs = () => { const routeMatch = useRouteMatch([routes.users + routes.user + ":id"]); @@ -17,7 +14,7 @@ const UserTabs = () => { if (id) { return ( - { defaultMessage: "user tabs", })} > - { value={routes.users + routes.user + ":id"} component={Link} to={routes.user + id} + sx={{ + "&.Mui-selected": { + backgroundColor: "#CCD6E4", + }, + }} /> - + ); } return null; diff --git a/typescript/Frontend/src/library.scss b/typescript/Frontend/src/library.scss new file mode 100644 index 000000000..27a714e89 --- /dev/null +++ b/typescript/Frontend/src/library.scss @@ -0,0 +1 @@ +$innovenergy-orange: #F59100; diff --git a/typescript/Frontend/tsconfig.json b/typescript/Frontend/tsconfig.json index 423cb75a1..888329764 100644 --- a/typescript/Frontend/tsconfig.json +++ b/typescript/Frontend/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "baseUrl": "src", "target": "es5", "lib": [ "dom",