Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into fix-genset-remote-s…
Browse files Browse the repository at this point in the history
…tart-disabled-messages
  • Loading branch information
mman committed Oct 4, 2024
2 parents a4b739c + bbd49be commit 4c25a9c
Showing 1 changed file with 21 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,20 +176,8 @@ const getAvailableDeviceBoxes = function (
}

if (!!generatorRelay.settings) {
if (generatorRelay.settings.includes(AC_SOURCE.GENERATOR)) {
generatorRelay.settings.forEach((source: number, i: number) => {
if (source === AC_SOURCE.GENERATOR)
devices.push(
<GeneratorRelay
key={"generator_relay" + i}
{...generatorRelay}
active={generatorRelay.activeInput === i}
componentMode={componentMode}
compactBoxSize={compactBoxSize}
/>
)
})
} else if (
// we have relay controlled generator present, show it
if (
generatorRelay.relayFunction === RELAY_FUNCTION.GENERATOR_START_STOP &&
generatorRelay.statusCode !== undefined
) {
Expand All @@ -201,6 +189,25 @@ const getAvailableDeviceBoxes = function (
compactBoxSize={compactBoxSize}
/>
)
} else if (generatorRelay.settings.includes(AC_SOURCE.GENERATOR)) {
// we do not have relay controlled generator configured,
// but one or more of the AC inputs is set to GENERATOR
if (generatorConnectedGenset.gensetState.gensetType !== ConnectedGensetType.ACGENSET) {
// display generator controls for each GENERATOR AC input
// unless there is a connected genset
generatorRelay.settings.forEach((source: number, i: number) => {
if (source === AC_SOURCE.GENERATOR)
devices.push(
<GeneratorRelay
key={"generator_relay" + i}
{...generatorRelay}
active={generatorRelay.activeInput === i}
componentMode={componentMode}
compactBoxSize={compactBoxSize}
/>
)
})
}
}
}

Expand Down

0 comments on commit 4c25a9c

Please sign in to comment.