used PvPower for Growatt and sum PvPower1-4 for Sinexcel in frontend

This commit is contained in:
Yinyin Liu 2025-11-24 10:24:28 +01:00
parent 13b3e8cd63
commit d3e3bedd65
1 changed files with 11 additions and 7 deletions

View File

@ -56,6 +56,12 @@ function TopologySodistoreHome(props: TopologySodistoreHomeProps) {
: 0 : 0
); );
const pvPower =
props.values?.InverterRecord?.PvPower ??
['PvPower1', 'PvPower2', 'PvPower3', 'PvPower4']
.map((key) => props.values?.InverterRecord?.[key] ?? 0)
.reduce((sum, val) => sum + val, 0);
return ( return (
<Container maxWidth="xl" style={{ backgroundColor: 'white' }}> <Container maxWidth="xl" style={{ backgroundColor: 'white' }}>
<Grid container> <Grid container>
@ -169,25 +175,23 @@ function TopologySodistoreHome(props: TopologySodistoreHomeProps) {
data: props.values?.InverterRecord data: props.values?.InverterRecord
? [ ? [
{ {
value: props.values.InverterRecord.PvPower, value: pvPower,
unit: 'W' unit: 'W'
} }
] ]
: undefined, : undefined,
connected:true connected: true
}} }}
topConnection={{ topConnection={{
orientation: 'vertical', orientation: 'vertical',
position: 'top', position: 'top',
data: props.values?.InverterRecord data: props.values?.InverterRecord
? { ? {
value: props.values.InverterRecord.PvPower, value: pvPower,
unit: 'W' unit: 'W'
} }
: undefined, : undefined,
amount: props.values?.InverterRecord amount: props.values?.InverterRecord ? getAmount(highestConnectionValue, pvPower) : 0,
? getAmount(highestConnectionValue, props.values.InverterRecord.PvPower)
: 0,
showValues: showValues showValues: showValues
}} }}
centerBox={{ centerBox={{