Fix: DC capacity now updates when AC capacity changes
This commit is contained in:
parent
941843e441
commit
206b9a0f99
1 changed files with 6 additions and 1 deletions
|
|
@ -219,7 +219,12 @@ function StepSolar({
|
||||||
value={state.solar_ac_mw}
|
value={state.solar_ac_mw}
|
||||||
step={5}
|
step={5}
|
||||||
min={1}
|
min={1}
|
||||||
onChange={(v) => set("solar_ac_mw", Number(v))}
|
onChange={(v) => {
|
||||||
|
const ac = Number(v);
|
||||||
|
const ratio = state.solar_dc_ac_ratio;
|
||||||
|
set("solar_ac_mw", ac);
|
||||||
|
set("solar_dc_mwp", parseFloat((ac * ratio).toFixed(3)));
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
</Field>
|
</Field>
|
||||||
<Field label="DC:AC Ratio">
|
<Field label="DC:AC Ratio">
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue