Skip to content

Commit

Permalink
webapp: Use max field to determine whether to show a string or not
Browse files Browse the repository at this point in the history
  • Loading branch information
tbnobody committed Sep 4, 2023
1 parent 1df8285 commit c46f85d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions webapp/src/types/LiveDataStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export interface ValueObject {
v: number; // value
u: string; // unit
d: number; // digits
max: number;
}

export interface InverterStatistics {
Expand Down
4 changes: 2 additions & 2 deletions webapp/src/views/HomeView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
<template v-for="channel in Object.keys(chanType.obj).sort().reverse().map(x=>+x)" :key="channel">
<template v-if="(chanType.name != 'DC') ||
(chanType.name == 'DC' && getSumIrridiation(inverter) == 0) ||
(chanType.name == 'DC' && getSumIrridiation(inverter) > 0 && chanType.obj[channel].Irradiation?.v || 0 > 0)
(chanType.name == 'DC' && getSumIrridiation(inverter) > 0 && chanType.obj[channel].Irradiation?.max || 0 > 0)
">
<div class="col">
<InverterChannelInfo :channelData="chanType.obj[channel]"
Expand Down Expand Up @@ -686,7 +686,7 @@ export default defineComponent({
getSumIrridiation(inv: Inverter): number {
let total = 0;
Object.keys(inv.DC).forEach((key) => {
total += inv.DC[key as unknown as number].Irradiation?.v || 0;
total += inv.DC[key as unknown as number].Irradiation?.max || 0;
});
return total;
}
Expand Down

0 comments on commit c46f85d

Please sign in to comment.