This commit is contained in:
Noe 2023-07-03 14:47:18 +02:00
commit 30b45281d6
20 changed files with 170 additions and 134 deletions

View File

@ -1,8 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configurations>Debug;Release;Release-Server</Configurations>
<Platforms>AnyCPU;linux-arm</Platforms>
</PropertyGroup>
<Import Project="../InnovEnergy.App.props" />
<ItemGroup>

View File

@ -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

View File

@ -24,4 +24,16 @@ public static class Logger
_logger.LogDebug(t.ToString()); // TODO: check warning
return t;
}
public static T LogError<T>(this T t) where T : notnull
{
_logger.LogError(t.ToString()); // TODO: check warning
return t;
}
public static T LogWarning<T>(this T t) where T : notnull
{
_logger.LogWarning(t.ToString()); // TODO: check warning
return t;
}
}

View File

@ -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<TextBlock> 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);
}
}
}

View File

@ -1,4 +1,4 @@
j#!/bin/bash
#!/bin/bash
host=ie-entwicklung@10.2.3.104

View File

@ -9,12 +9,12 @@
<TargetFramework>net6.0</TargetFramework>
<InvariantGlobalization>true</InvariantGlobalization>
<SuppressTrimAnalysisWarnings>false</SuppressTrimAnalysisWarnings>
<RootNamespace>Please.reload.the.project.Rider.is.stupid</RootNamespace>
<!-- <RootNamespace>Please.reload.the.project.Rider.is.stupid</RootNamespace>-->
<Authors>$(Company) Team</Authors>
</PropertyGroup>
<PropertyGroup Condition="'$(SolutionDir)' != ''">
<RootNamespace>$(Company).$(MSBuildProjectDirectory.Replace($(SolutionDir), "").Replace("/",".").Replace("\","."))</RootNamespace>
</PropertyGroup>
<!-- <PropertyGroup Condition="'$(SolutionDir)' != ''">-->
<!-- <RootNamespace>$(Company).$(MSBuildProjectDirectory.Replace($(SolutionDir), "").Replace("/",".").Replace("\","."))</RootNamespace>-->
<!-- </PropertyGroup>-->
</Project>

View File

@ -24,6 +24,10 @@ public partial class Battery48TlRecord
public Percent Soc => _Soc;
public Current BusCurrent => _BusCurrent;
public Current HeatingCurrent => _BusCurrent - _CellsCurrent;
public readonly struct Leds_
{
public LedState Blue => Self.ParseLed(LedColor.Blue);
@ -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; }

View File

@ -17,8 +17,10 @@ public partial class Battery48TlRecord
[InputRegister<UInt64>(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;

View File

@ -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 (
<Box sx={{ width: "100%" }}>
<Box sx={{}}>
<AntTabs
value={routeMatch?.pattern?.path}
aria-label={intl.formatMessage({
id: "groupTabs",
defaultMessage: "Group tabs",
})}
>
<InnovenergyTabs id="group-tabs" value={routeMatch?.pattern?.path}>
{currentType === "Folder" ? (
<StyledTabBlue
<InnovenergyTab
id="styled-tab-folder"
label={intl.formatMessage({
id: "folder",
@ -48,7 +40,9 @@ const GroupTabs = () => {
to={routes.folder + id}
/>
) : (
<StyledTabBlue
<InnovenergyTab
sx={{ bgcolor: "#90A7C5" }}
id="styled-tab-installation"
label={intl.formatMessage({
id: "installation",
@ -65,8 +59,8 @@ const GroupTabs = () => {
/>
)}
<StyledTabBlue
sx={{ bgcolor: colors.greyLight }}
<InnovenergyTab
sx={{ bgcolor: "#90A7C5" }}
id="styled-tab-manage-access"
label={intl.formatMessage({
id: "manageAccess",
@ -78,7 +72,7 @@ const GroupTabs = () => {
component={Link}
to={routes.manageAccess + id}
/>
</AntTabs>
</InnovenergyTabs>
</Box>
</Box>
);

View File

@ -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 (
<Box sx={{ width: "100%" }}>
<Box sx={{}}>
<AntTabs
<InnovenergyTabs
id="installation-tabs"
value={routeMatch?.pattern?.path ?? routes.installation + ":id"}
aria-label={intl.formatMessage({
id: "installationTabs",
defaultMessage: "Installation tabs",
})}
>
<StyledTabBlue
sx={{ bgcolor: colors }}
<InnovenergyTab
id={"installation-tab-installation"}
label={intl.formatMessage({
id: "installation",
@ -47,8 +38,7 @@ const InstallationTabs = () => {
component={Link}
to={routes.installation + id}
/>
<StyledTabWhite
sx={{ bgcolor: colors.greyLight}}
<InnovenergyTab
id={"installation-tab-liveView"}
label={intl.formatMessage({
id: "liveView",
@ -60,8 +50,7 @@ const InstallationTabs = () => {
component={Link}
to={routes.liveView + id}
/>
<StyledTab
sx={{ bgcolor: colors.greyLight }}
<InnovenergyTab
id={"installation-tab-log"}
label={intl.formatMessage({
id: "log",
@ -71,7 +60,7 @@ const InstallationTabs = () => {
component={Link}
to={routes.log + id}
/>
</AntTabs>
</InnovenergyTabs>
</Box>
</Box>
);

View File

@ -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 {

View File

@ -75,6 +75,7 @@ const DateRangePicker = (props: DateRangePickerProps) => {
},
".Mui-focused fieldset.MuiOutlinedInput-notchedOutline": {
borderColor: theme.palette.secondary.main, },
}}
onChange={(newValue) => {
if (newValue) {

View File

@ -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<RecordSeries>([]);
@ -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 (
<div style={{ marginTop: "20px" }}>

View File

@ -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 (
<Tab
{...props}
disableRipple
sx={{
...props.sx,
bottom: -1,
textTransform: "uppercase",
fontWeight: theme.typography.fontWeightRegular,
fontSize: theme.typography.pxToRem(14),
marginRight: theme.spacing(1),
background: "0 0",
border: "1px solid transparent",
borderTopLeftRadius: "0.3rem",
borderTopRightRadius: "0.3rem",
padding: ".5rem 1rem",
textDecoration: "none",
transition: `color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out`,
"&.Mui-selected": {
color: "#000000",
backgroundColor: "#CCD6E4",
borderColor: "#90A7c5 #90A7c5 #F2F4F8",
marginTop: "1px",
bottom: -1,
...(props.sx ? props.sx["&.Mui-selected"] : {}),
},
"&.Mui-focusVisible": {
backgroundColor: "rgba(100, 95, 228, 0.32)",
...(props.sx ? props.sx["&.Mui-focusVisible"] : {}),
},
}}
/>
);
};
export default InnovenergyTab;

View File

@ -0,0 +1,42 @@
import { SxProps, Tabs, Theme } from "@mui/material";
import { ReactNode } from "react";
interface AntTabsProps {
id: string;
value?: string;
sx?: SxProps<Theme>;
children: ReactNode;
}
const InnovenergyTabs = (props: AntTabsProps) => {
return (
<Tabs
{...props}
sx={{
...props.sx,
borderBottom: "1px solid #90A7c5",
overflow: "visible!important",
"& div.MuiTabs-scroller": {
overflow: "visible!important",
},
"&.Mui-selected": {
color: "#000000",
backgroundColor: "red",
borderColor: `#90A7c5 #90A7c5 #fff`,
},
"& .MuiTabs-indicator": {
display: "flex",
justifyContent: "center",
backgroundColor: "transparent",
},
"&.MuiTabs-root": {
width: "100%",
},
}}
>
{props.children}
</Tabs>
);
};
export default InnovenergyTabs;

View File

@ -15,23 +15,6 @@ const ModeButtons = () => {
return (
<>
{/* <AntTabs
value={routeMatch?.pattern?.path ?? routes.installation + ":id"}
aria-label="basic tabs example"
>
<StyledTab
icon={<ListIcon />}
value={routes.installations + routes.list + "*"}
component={Link}
to={routes.list}
/>
<StyledTab
icon={<AccountTreeIcon />}
value={routes.installations + routes.tree + "*"}
component={Link}
to={routes.tree}
/>
</AntTabs> */}
<ToggleButtonGroup
id="mode-button-group"
color="primary"

View File

@ -2,13 +2,8 @@ import { FormattedMessage, useIntl } from "react-intl";
import { Link } from "react-router-dom";
import useRouteMatch from "../../hooks/useRouteMatch";
import routes from "../../routes.json";
import {
AntTabs,
AntTabsBig,
StyledTab,
StyledTabBig,
} from "../../util/installation.util";
import { Background } from "reactflow";
import InnovenergyTab from "./InnovenergyTab";
import InnovenergyTabs from "./InnovenergyTabs";
const NavigationButtons = () => {
const routeMatch = useRouteMatch([
@ -19,37 +14,11 @@ const NavigationButtons = () => {
return (
<>
{/* <ToggleButtonGroup
color="primary"
<InnovenergyTabs
id="navigation-buttons-tabs"
value={routeMatch?.pattern?.path}
exclusive
sx={{ mb: 1 }}
fullWidth
>
<ToggleButton
value={routes.installations + "*"}
component={Link}
to={routes.installations}
>
<FormattedMessage id="installations" defaultMessage="Installations" />
</ToggleButton>
<ToggleButton
value={routes.users + "*"}
component={Link}
to={routes.users}
>
<FormattedMessage id="users" defaultMessage="Users" />
</ToggleButton>
</ToggleButtonGroup> */}
<AntTabsBig
id="navigation-buttons-group"
value={routeMatch?.pattern?.path}
aria-label={intl.formatMessage({
id: "navigationTabs",
defaultMessage: "Navigation tabs",
})}
>
<StyledTabBig
<InnovenergyTab
id="navigation-tab-installations"
value={routes.installations + "*"}
component={Link}
@ -61,14 +30,14 @@ const NavigationButtons = () => {
/>
}
/>
<StyledTabBig
<InnovenergyTab
id="navigation-tab-users"
value={routes.users + "*"}
component={Link}
to={routes.users}
label={<FormattedMessage id="users" defaultMessage="Users" />}
/>
</AntTabsBig>
</InnovenergyTabs>
</>
);
};

View File

@ -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 (
<AntTabs
<InnovenergyTabs
id="users-tabs"
value={routeMatch?.pattern?.path ?? routes.user + ":id"}
aria-label={intl.formatMessage({
@ -25,7 +22,7 @@ const UserTabs = () => {
defaultMessage: "user tabs",
})}
>
<StyledTabBlue
<InnovenergyTab
id="users-tab-user"
label={intl.formatMessage({
id: "user",
@ -34,8 +31,13 @@ const UserTabs = () => {
value={routes.users + routes.user + ":id"}
component={Link}
to={routes.user + id}
sx={{
"&.Mui-selected": {
backgroundColor: "#CCD6E4",
},
}}
/>
</AntTabs>
</InnovenergyTabs>
);
}
return null;

View File

@ -0,0 +1 @@
$innovenergy-orange: #F59100;

View File

@ -1,5 +1,6 @@
{
"compilerOptions": {
"baseUrl": "src",
"target": "es5",
"lib": [
"dom",