Implement #633: Show only strings with irridiation > 0
If no irridiation is entered for all strings, all strings are shown.
This commit is contained in:
parent
a341c884ab
commit
220884f72e
@ -95,9 +95,14 @@
|
|||||||
<div class="row flex-row-reverse flex-wrap-reverse g-3">
|
<div class="row flex-row-reverse flex-wrap-reverse g-3">
|
||||||
<template v-for="chanType in [{obj: inverter.INV, name: 'INV'}, {obj: inverter.AC, name: 'AC'}, {obj: inverter.DC, name: 'DC'}].reverse()">
|
<template v-for="chanType in [{obj: inverter.INV, name: 'INV'}, {obj: inverter.AC, name: 'AC'}, {obj: inverter.DC, name: 'DC'}].reverse()">
|
||||||
<div v-for="channel in Object.keys(chanType.obj).sort().reverse().map(x=>+x)" :key="channel" class="col">
|
<div v-for="channel in Object.keys(chanType.obj).sort().reverse().map(x=>+x)" :key="channel" class="col">
|
||||||
|
<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)
|
||||||
|
">
|
||||||
<InverterChannelInfo :channelData="chanType.obj[channel]"
|
<InverterChannelInfo :channelData="chanType.obj[channel]"
|
||||||
:channelType="chanType.name"
|
:channelType="chanType.name"
|
||||||
:channelNumber="channel" />
|
:channelNumber="channel" />
|
||||||
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
@ -666,6 +671,13 @@ export default defineComponent({
|
|||||||
calculateAbsoluteTime(lastTime: number): string {
|
calculateAbsoluteTime(lastTime: number): string {
|
||||||
const date = new Date(Date.now() - lastTime * 1000);
|
const date = new Date(Date.now() - lastTime * 1000);
|
||||||
return this.$d(date, 'datetime');
|
return this.$d(date, 'datetime');
|
||||||
|
},
|
||||||
|
getSumIrridiation(inv: Inverter): number {
|
||||||
|
let total = 0;
|
||||||
|
Object.keys(inv.DC).forEach((key) => {
|
||||||
|
total += inv.DC[key as unknown as number].Irradiation?.v || 0;
|
||||||
|
});
|
||||||
|
return total;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user