Merge remote-tracking branch 'origin/main'

This commit is contained in:
atef 2024-02-07 14:32:23 +01:00
commit d5c870b4eb
6 changed files with 59 additions and 29 deletions

View File

@ -1,7 +1,7 @@
Prototype ie-entwicklung@10.2.3.115 Prototype Prototype ie-entwicklung@10.2.3.115 Prototype
Salimax0001 ie-entwicklung@10.2.3.104 Marti Technik (Bern) Salimax0001 ie-entwicklung@10.2.3.104 Marti Technik (Bern)
Salimax0002 ie-entwicklung@10.2.4.29 Weidmann Oberwil (ZG) Salimax0002 ie-entwicklung@10.2.4.29 Weidmann d (ZG)
Salimax0003 ie-entwicklung@10.2.4.33 Elektrotechnik Stefan GmbH Salimax0003 ie-entwicklung@10.2.4.33 Elektrotechnik Stefan GmbH
Salimax0004 ie-entwicklung@10.2.4.32 Biohof Gubelmann (Walde) Salimax0004 ie-entwicklung@10.2.4.32 Biohof Gubelmann (Walde)
Salimax0004A ie-entwicklung@10.2.4.153 Salimax0004A ie-entwicklung@10.2.4.153

View File

@ -109,7 +109,6 @@ public static class Aggregator
var batteryChargePower = new List<Double>(); var batteryChargePower = new List<Double>();
Console.WriteLine("-----------------------------------------------------------------------------------------------------------------");
Console.WriteLine("File timestamp should start after "+ afterTimestamp); Console.WriteLine("File timestamp should start after "+ afterTimestamp);
foreach (var csvFile in csvFiles) foreach (var csvFile in csvFiles)

View File

@ -19,7 +19,7 @@ public class AcDcDevicesRecord
public SystemControlRegisters? SystemControl { get; } public SystemControlRegisters? SystemControl { get; }
public IReadOnlyList<AcDcRecord> Devices { get; init; } public IReadOnlyList<AcDcRecord> Devices { get; init; }
//public IEnumerable<AlarmMessage> Alarms => new []{AlarmMessage.OvercurrentBalancer}; //Devices.SelectMany(d => d.Status.Alarms).Distinct(); //public IEnumerable<AlarmMessage> Alarms => new []{AlarmMessage.}; //Devices.SelectMany(d => d.Status.Alarms).Distinct();
//public IEnumerable<WarningMessage> Warnings => new []{WarningMessage.DcOffset}; //Devices.SelectMany(d => d.Status.Warnings).Distinct(); //public IEnumerable<WarningMessage> Warnings => new []{WarningMessage.DcOffset}; //Devices.SelectMany(d => d.Status.Warnings).Distinct();
public IEnumerable<AlarmMessage> Alarms => Devices.SelectMany(d => d.Status.Alarms).Distinct(); public IEnumerable<AlarmMessage> Alarms => Devices.SelectMany(d => d.Status.Alarms).Distinct();

View File

@ -5,7 +5,8 @@ import { findPower, formatPowerForGraph } from 'src/Resources/formatPower';
export const getChartOptions = ( export const getChartOptions = (
chartInfo: chartInfoInterface, chartInfo: chartInfoInterface,
type: string, type: string,
dateList: string[] dateList: string[],
stacked: Boolean
): ApexOptions => { ): ApexOptions => {
return type.includes('daily') return type.includes('daily')
? { ? {
@ -215,7 +216,8 @@ export const getChartOptions = (
bar: { bar: {
//If min<0 and max>0, then we have 2 stacked bars, one with positive and one with negative values, so each one of them should have border radius. \ //If min<0 and max>0, then we have 2 stacked bars, one with positive and one with negative values, so each one of them should have border radius. \
//Otherwise, we have a single bar or two stacked bars either with positive or negative values. //Otherwise, we have a single bar or two stacked bars either with positive or negative values.
borderRadius: chartInfo.min <= 0 && chartInfo.max > 0 ? [10] : 10, borderRadius:
stacked && chartInfo.min <= 0 && chartInfo.max > 0 ? [10] : 10,
dataLabels: { dataLabels: {
position: 'top' position: 'top'
} }
@ -259,9 +261,13 @@ export const getChartOptions = (
? Math.ceil(chartInfo.min / findPower(chartInfo.min).value) * ? Math.ceil(chartInfo.min / findPower(chartInfo.min).value) *
findPower(chartInfo.min).value findPower(chartInfo.min).value
: Math.abs(chartInfo.min) < 1 : Math.abs(chartInfo.min) < 1
? +( ? -Math.max(
Math.ceil(chartInfo.min / findPower(chartInfo.min).value) * Math.abs(
findPower(chartInfo.min).value Math.ceil(chartInfo.min / findPower(chartInfo.min).value) *
findPower(chartInfo.min).value
),
Math.ceil(chartInfo.max / findPower(chartInfo.max).value) *
findPower(chartInfo.max).value
).toFixed(2) ).toFixed(2)
: undefined, : undefined,
max: max:
@ -273,9 +279,13 @@ export const getChartOptions = (
: chartInfo.max <= 0 : chartInfo.max <= 0
? 0 ? 0
: Math.abs(chartInfo.min) < 1 : Math.abs(chartInfo.min) < 1
? +( ? +Math.max(
Math.abs(
Math.ceil(chartInfo.min / findPower(chartInfo.min).value) *
findPower(chartInfo.min).value
),
Math.ceil(chartInfo.max / findPower(chartInfo.max).value) * Math.ceil(chartInfo.max / findPower(chartInfo.max).value) *
findPower(chartInfo.max).value findPower(chartInfo.max).value
).toFixed(2) ).toFixed(2)
: undefined, : undefined,
title: { title: {

View File

@ -584,7 +584,8 @@ function Overview(props: OverviewProps) {
...getChartOptions( ...getChartOptions(
dailyDataArray[chartState].chartOverview.overview, dailyDataArray[chartState].chartOverview.overview,
'dailyoverview', 'dailyoverview',
[] [],
true
), ),
chart: { chart: {
events: { events: {
@ -664,7 +665,8 @@ function Overview(props: OverviewProps) {
...getChartOptions( ...getChartOptions(
weeklyDataArray.chartOverview.overview, weeklyDataArray.chartOverview.overview,
'overview', 'overview',
weeklyDateList weeklyDateList,
true
) )
}} }}
series={[ series={[
@ -701,7 +703,8 @@ function Overview(props: OverviewProps) {
...getChartOptions( ...getChartOptions(
monthlyDataArray.chartOverview.overview, monthlyDataArray.chartOverview.overview,
'overview', 'overview',
monthlyDateList monthlyDateList,
true
) )
}} }}
series={[ series={[
@ -782,7 +785,8 @@ function Overview(props: OverviewProps) {
...getChartOptions( ...getChartOptions(
dailyDataArray[chartState].chartOverview.soc, dailyDataArray[chartState].chartOverview.soc,
'daily', 'daily',
[] [],
true
), ),
chart: { chart: {
events: { events: {
@ -807,7 +811,8 @@ function Overview(props: OverviewProps) {
...getChartOptions( ...getChartOptions(
weeklyDataArray.chartOverview.soc, weeklyDataArray.chartOverview.soc,
'weekly', 'weekly',
weeklyDateList weeklyDateList,
true
) )
}} }}
series={[ series={[
@ -831,7 +836,8 @@ function Overview(props: OverviewProps) {
...getChartOptions( ...getChartOptions(
monthlyDataArray.chartOverview.soc, monthlyDataArray.chartOverview.soc,
'monthly', 'monthly',
monthlyDateList monthlyDateList,
true
) )
}} }}
series={[ series={[
@ -891,7 +897,8 @@ function Overview(props: OverviewProps) {
...getChartOptions( ...getChartOptions(
dailyDataArray[chartState].chartOverview.dcPower, dailyDataArray[chartState].chartOverview.dcPower,
'daily', 'daily',
[] [],
true
), ),
chart: { chart: {
events: { events: {
@ -916,7 +923,8 @@ function Overview(props: OverviewProps) {
...getChartOptions( ...getChartOptions(
weeklyDataArray.chartOverview.dcPower, weeklyDataArray.chartOverview.dcPower,
'weekly', 'weekly',
weeklyDateList weeklyDateList,
false
) )
}} }}
series={[ series={[
@ -926,7 +934,7 @@ function Overview(props: OverviewProps) {
}, },
{ {
...weeklyDataArray.chartData.heatingPower, ...weeklyDataArray.chartData.heatingPower,
color: '#000000' color: '#ff9900'
}, },
{ {
...weeklyDataArray.chartData.dcDischargingPower, ...weeklyDataArray.chartData.dcDischargingPower,
@ -944,7 +952,8 @@ function Overview(props: OverviewProps) {
...getChartOptions( ...getChartOptions(
monthlyDataArray.chartOverview.dcPower, monthlyDataArray.chartOverview.dcPower,
'monthly', 'monthly',
monthlyDateList monthlyDateList,
false
) )
}} }}
series={[ series={[
@ -952,6 +961,10 @@ function Overview(props: OverviewProps) {
...monthlyDataArray.chartData.dcChargingPower, ...monthlyDataArray.chartData.dcChargingPower,
color: '#69d2e7' color: '#69d2e7'
}, },
{
...weeklyDataArray.chartData.heatingPower,
color: '#ff9900'
},
{ {
...monthlyDataArray.chartData.dcDischargingPower, ...monthlyDataArray.chartData.dcDischargingPower,
color: '#008FFB' color: '#008FFB'
@ -1011,7 +1024,8 @@ function Overview(props: OverviewProps) {
dailyDataArray[chartState].chartOverview dailyDataArray[chartState].chartOverview
.temperature, .temperature,
'daily', 'daily',
[] [],
true
), ),
chart: { chart: {
events: { events: {
@ -1068,7 +1082,8 @@ function Overview(props: OverviewProps) {
dailyDataArray[chartState].chartOverview dailyDataArray[chartState].chartOverview
.dcBusVoltage, .dcBusVoltage,
'daily', 'daily',
[] [],
true
), ),
chart: { chart: {
events: { events: {
@ -1139,7 +1154,8 @@ function Overview(props: OverviewProps) {
dailyDataArray[chartState].chartOverview dailyDataArray[chartState].chartOverview
.pvProduction, .pvProduction,
'daily', 'daily',
[] [],
true
), ),
chart: { chart: {
events: { events: {
@ -1165,7 +1181,8 @@ function Overview(props: OverviewProps) {
...getChartOptions( ...getChartOptions(
weeklyDataArray.chartOverview.pvProduction, weeklyDataArray.chartOverview.pvProduction,
'weekly', 'weekly',
weeklyDateList weeklyDateList,
true
) )
}} }}
series={[ series={[
@ -1185,7 +1202,8 @@ function Overview(props: OverviewProps) {
...getChartOptions( ...getChartOptions(
monthlyDataArray.chartOverview.pvProduction, monthlyDataArray.chartOverview.pvProduction,
'monthly', 'monthly',
monthlyDateList monthlyDateList,
true
) )
}} }}
series={[ series={[
@ -1241,7 +1259,8 @@ function Overview(props: OverviewProps) {
dailyDataArray[chartState].chartOverview dailyDataArray[chartState].chartOverview
.gridPower, .gridPower,
'daily', 'daily',
[] [],
true
), ),
chart: { chart: {
events: { events: {
@ -1265,7 +1284,8 @@ function Overview(props: OverviewProps) {
...getChartOptions( ...getChartOptions(
weeklyDataArray.chartOverview.gridPower, weeklyDataArray.chartOverview.gridPower,
'weekly', 'weekly',
weeklyDateList weeklyDateList,
true
) )
}} }}
series={[ series={[
@ -1290,7 +1310,8 @@ function Overview(props: OverviewProps) {
...getChartOptions( ...getChartOptions(
monthlyDataArray.chartOverview.gridPower, monthlyDataArray.chartOverview.gridPower,
'monthly', 'monthly',
monthlyDateList monthlyDateList,
true
) )
}} }}
series={[ series={[

View File

@ -108,7 +108,7 @@ export const transformInputToDailyData = async (
while (startUnixTime < endTimestamp) { while (startUnixTime < endTimestamp) {
timestampPromises.push(fetchData(startUnixTime, s3Credentials)); timestampPromises.push(fetchData(startUnixTime, s3Credentials));
startUnixTime = UnixTime.fromTicks(startUnixTime.ticks + diff / 100); startUnixTime = UnixTime.fromTicks(startUnixTime.ticks + diff / 200);
if (startUnixTime.ticks % 2 !== 0) { if (startUnixTime.ticks % 2 !== 0) {
startUnixTime = UnixTime.fromTicks(startUnixTime.ticks + 1); startUnixTime = UnixTime.fromTicks(startUnixTime.ticks + 1);
} }