Fixed bugs on frontend
This commit is contained in:
parent
38a14ca79b
commit
34891e489d
|
@ -1,7 +1,7 @@
|
|||
|
||||
Prototype ie-entwicklung@10.2.3.115 Prototype
|
||||
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
|
||||
Salimax0004 ie-entwicklung@10.2.4.32 Biohof Gubelmann (Walde)
|
||||
Salimax0004A ie-entwicklung@10.2.4.153
|
||||
|
|
|
@ -109,7 +109,6 @@ public static class Aggregator
|
|||
var batteryChargePower = new List<Double>();
|
||||
|
||||
|
||||
Console.WriteLine("-----------------------------------------------------------------------------------------------------------------");
|
||||
Console.WriteLine("File timestamp should start after "+ afterTimestamp);
|
||||
|
||||
foreach (var csvFile in csvFiles)
|
||||
|
|
|
@ -19,7 +19,7 @@ public class AcDcDevicesRecord
|
|||
public SystemControlRegisters? SystemControl { get; }
|
||||
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<AlarmMessage> Alarms => Devices.SelectMany(d => d.Status.Alarms).Distinct();
|
||||
|
|
|
@ -5,7 +5,8 @@ import { findPower, formatPowerForGraph } from 'src/Resources/formatPower';
|
|||
export const getChartOptions = (
|
||||
chartInfo: chartInfoInterface,
|
||||
type: string,
|
||||
dateList: string[]
|
||||
dateList: string[],
|
||||
stacked: Boolean
|
||||
): ApexOptions => {
|
||||
return type.includes('daily')
|
||||
? {
|
||||
|
@ -215,7 +216,8 @@ export const getChartOptions = (
|
|||
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. \
|
||||
//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: {
|
||||
position: 'top'
|
||||
}
|
||||
|
@ -259,9 +261,13 @@ export const getChartOptions = (
|
|||
? Math.ceil(chartInfo.min / findPower(chartInfo.min).value) *
|
||||
findPower(chartInfo.min).value
|
||||
: Math.abs(chartInfo.min) < 1
|
||||
? +(
|
||||
Math.ceil(chartInfo.min / findPower(chartInfo.min).value) *
|
||||
findPower(chartInfo.min).value
|
||||
? -Math.max(
|
||||
Math.abs(
|
||||
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)
|
||||
: undefined,
|
||||
max:
|
||||
|
@ -273,9 +279,13 @@ export const getChartOptions = (
|
|||
: chartInfo.max <= 0
|
||||
? 0
|
||||
: 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) *
|
||||
findPower(chartInfo.max).value
|
||||
findPower(chartInfo.max).value
|
||||
).toFixed(2)
|
||||
: undefined,
|
||||
title: {
|
||||
|
|
|
@ -584,7 +584,8 @@ function Overview(props: OverviewProps) {
|
|||
...getChartOptions(
|
||||
dailyDataArray[chartState].chartOverview.overview,
|
||||
'dailyoverview',
|
||||
[]
|
||||
[],
|
||||
true
|
||||
),
|
||||
chart: {
|
||||
events: {
|
||||
|
@ -664,7 +665,8 @@ function Overview(props: OverviewProps) {
|
|||
...getChartOptions(
|
||||
weeklyDataArray.chartOverview.overview,
|
||||
'overview',
|
||||
weeklyDateList
|
||||
weeklyDateList,
|
||||
true
|
||||
)
|
||||
}}
|
||||
series={[
|
||||
|
@ -701,7 +703,8 @@ function Overview(props: OverviewProps) {
|
|||
...getChartOptions(
|
||||
monthlyDataArray.chartOverview.overview,
|
||||
'overview',
|
||||
monthlyDateList
|
||||
monthlyDateList,
|
||||
true
|
||||
)
|
||||
}}
|
||||
series={[
|
||||
|
@ -782,7 +785,8 @@ function Overview(props: OverviewProps) {
|
|||
...getChartOptions(
|
||||
dailyDataArray[chartState].chartOverview.soc,
|
||||
'daily',
|
||||
[]
|
||||
[],
|
||||
true
|
||||
),
|
||||
chart: {
|
||||
events: {
|
||||
|
@ -807,7 +811,8 @@ function Overview(props: OverviewProps) {
|
|||
...getChartOptions(
|
||||
weeklyDataArray.chartOverview.soc,
|
||||
'weekly',
|
||||
weeklyDateList
|
||||
weeklyDateList,
|
||||
true
|
||||
)
|
||||
}}
|
||||
series={[
|
||||
|
@ -831,7 +836,8 @@ function Overview(props: OverviewProps) {
|
|||
...getChartOptions(
|
||||
monthlyDataArray.chartOverview.soc,
|
||||
'monthly',
|
||||
monthlyDateList
|
||||
monthlyDateList,
|
||||
true
|
||||
)
|
||||
}}
|
||||
series={[
|
||||
|
@ -891,7 +897,8 @@ function Overview(props: OverviewProps) {
|
|||
...getChartOptions(
|
||||
dailyDataArray[chartState].chartOverview.dcPower,
|
||||
'daily',
|
||||
[]
|
||||
[],
|
||||
true
|
||||
),
|
||||
chart: {
|
||||
events: {
|
||||
|
@ -916,7 +923,8 @@ function Overview(props: OverviewProps) {
|
|||
...getChartOptions(
|
||||
weeklyDataArray.chartOverview.dcPower,
|
||||
'weekly',
|
||||
weeklyDateList
|
||||
weeklyDateList,
|
||||
false
|
||||
)
|
||||
}}
|
||||
series={[
|
||||
|
@ -926,7 +934,7 @@ function Overview(props: OverviewProps) {
|
|||
},
|
||||
{
|
||||
...weeklyDataArray.chartData.heatingPower,
|
||||
color: '#000000'
|
||||
color: '#ff9900'
|
||||
},
|
||||
{
|
||||
...weeklyDataArray.chartData.dcDischargingPower,
|
||||
|
@ -944,7 +952,8 @@ function Overview(props: OverviewProps) {
|
|||
...getChartOptions(
|
||||
monthlyDataArray.chartOverview.dcPower,
|
||||
'monthly',
|
||||
monthlyDateList
|
||||
monthlyDateList,
|
||||
false
|
||||
)
|
||||
}}
|
||||
series={[
|
||||
|
@ -952,6 +961,10 @@ function Overview(props: OverviewProps) {
|
|||
...monthlyDataArray.chartData.dcChargingPower,
|
||||
color: '#69d2e7'
|
||||
},
|
||||
{
|
||||
...weeklyDataArray.chartData.heatingPower,
|
||||
color: '#ff9900'
|
||||
},
|
||||
{
|
||||
...monthlyDataArray.chartData.dcDischargingPower,
|
||||
color: '#008FFB'
|
||||
|
@ -1011,7 +1024,8 @@ function Overview(props: OverviewProps) {
|
|||
dailyDataArray[chartState].chartOverview
|
||||
.temperature,
|
||||
'daily',
|
||||
[]
|
||||
[],
|
||||
true
|
||||
),
|
||||
chart: {
|
||||
events: {
|
||||
|
@ -1068,7 +1082,8 @@ function Overview(props: OverviewProps) {
|
|||
dailyDataArray[chartState].chartOverview
|
||||
.dcBusVoltage,
|
||||
'daily',
|
||||
[]
|
||||
[],
|
||||
true
|
||||
),
|
||||
chart: {
|
||||
events: {
|
||||
|
@ -1139,7 +1154,8 @@ function Overview(props: OverviewProps) {
|
|||
dailyDataArray[chartState].chartOverview
|
||||
.pvProduction,
|
||||
'daily',
|
||||
[]
|
||||
[],
|
||||
true
|
||||
),
|
||||
chart: {
|
||||
events: {
|
||||
|
@ -1165,7 +1181,8 @@ function Overview(props: OverviewProps) {
|
|||
...getChartOptions(
|
||||
weeklyDataArray.chartOverview.pvProduction,
|
||||
'weekly',
|
||||
weeklyDateList
|
||||
weeklyDateList,
|
||||
true
|
||||
)
|
||||
}}
|
||||
series={[
|
||||
|
@ -1185,7 +1202,8 @@ function Overview(props: OverviewProps) {
|
|||
...getChartOptions(
|
||||
monthlyDataArray.chartOverview.pvProduction,
|
||||
'monthly',
|
||||
monthlyDateList
|
||||
monthlyDateList,
|
||||
true
|
||||
)
|
||||
}}
|
||||
series={[
|
||||
|
@ -1241,7 +1259,8 @@ function Overview(props: OverviewProps) {
|
|||
dailyDataArray[chartState].chartOverview
|
||||
.gridPower,
|
||||
'daily',
|
||||
[]
|
||||
[],
|
||||
true
|
||||
),
|
||||
chart: {
|
||||
events: {
|
||||
|
@ -1265,7 +1284,8 @@ function Overview(props: OverviewProps) {
|
|||
...getChartOptions(
|
||||
weeklyDataArray.chartOverview.gridPower,
|
||||
'weekly',
|
||||
weeklyDateList
|
||||
weeklyDateList,
|
||||
true
|
||||
)
|
||||
}}
|
||||
series={[
|
||||
|
@ -1290,7 +1310,8 @@ function Overview(props: OverviewProps) {
|
|||
...getChartOptions(
|
||||
monthlyDataArray.chartOverview.gridPower,
|
||||
'monthly',
|
||||
monthlyDateList
|
||||
monthlyDateList,
|
||||
true
|
||||
)
|
||||
}}
|
||||
series={[
|
||||
|
|
|
@ -108,7 +108,7 @@ export const transformInputToDailyData = async (
|
|||
while (startUnixTime < endTimestamp) {
|
||||
timestampPromises.push(fetchData(startUnixTime, s3Credentials));
|
||||
|
||||
startUnixTime = UnixTime.fromTicks(startUnixTime.ticks + diff / 100);
|
||||
startUnixTime = UnixTime.fromTicks(startUnixTime.ticks + diff / 200);
|
||||
if (startUnixTime.ticks % 2 !== 0) {
|
||||
startUnixTime = UnixTime.fromTicks(startUnixTime.ticks + 1);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue