webapp: Use max field to determine whether to show a string or not
This commit is contained in:
parent
1df8285833
commit
c46f85db9c
@ -2,6 +2,7 @@ export interface ValueObject {
|
|||||||
v: number; // value
|
v: number; // value
|
||||||
u: string; // unit
|
u: string; // unit
|
||||||
d: number; // digits
|
d: number; // digits
|
||||||
|
max: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface InverterStatistics {
|
export interface InverterStatistics {
|
||||||
|
|||||||
@ -98,7 +98,7 @@
|
|||||||
<template v-for="channel in Object.keys(chanType.obj).sort().reverse().map(x=>+x)" :key="channel">
|
<template v-for="channel in Object.keys(chanType.obj).sort().reverse().map(x=>+x)" :key="channel">
|
||||||
<template v-if="(chanType.name != 'DC') ||
|
<template v-if="(chanType.name != 'DC') ||
|
||||||
(chanType.name == 'DC' && getSumIrridiation(inverter) == 0) ||
|
(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">
|
<div class="col">
|
||||||
<InverterChannelInfo :channelData="chanType.obj[channel]"
|
<InverterChannelInfo :channelData="chanType.obj[channel]"
|
||||||
@ -686,7 +686,7 @@ export default defineComponent({
|
|||||||
getSumIrridiation(inv: Inverter): number {
|
getSumIrridiation(inv: Inverter): number {
|
||||||
let total = 0;
|
let total = 0;
|
||||||
Object.keys(inv.DC).forEach((key) => {
|
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;
|
return total;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user