Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build dcdischarge sum out of hybridess channel instead of plain calculation #1800

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ private void calculateChannelValues() {
final var essDcChargeEnergy = new CalculateLongSum();
final var essDcDischargeEnergy = new CalculateLongSum();
final var essCapacity = new CalculateIntegerSum();

final var essDcDischargePower = new CalculateIntegerSum();

// Grid
final var gridActivePower = new CalculateIntegerSum();
final var gridActivePowerL1 = new CalculateIntegerSum();
Expand All @@ -156,6 +157,7 @@ private void calculateChannelValues() {
final var productionMaxDcActualPower = new CalculateIntegerSum();
final var productionAcActiveEnergy = new CalculateLongSum();
final var productionDcActiveEnergy = new CalculateLongSum();

// handling the corner-case of wrongly measured negative production, due to
// cabling errors, etc.
final var productionAcActiveEnergyNegative = new CalculateLongSum();
Expand Down Expand Up @@ -195,6 +197,7 @@ private void calculateChannelValues() {
var e = (HybridEss) ess;
essDcChargeEnergy.addValue(e.getDcChargeEnergyChannel());
essDcDischargeEnergy.addValue(e.getDcDischargeEnergyChannel());
essDcDischargePower.addValue(e.getDcDischargePowerChannel());
} else {
essDcChargeEnergy.addValue(ess.getActiveChargeEnergyChannel());
essDcDischargeEnergy.addValue(ess.getActiveDischargeEnergyChannel());
Expand Down Expand Up @@ -387,8 +390,9 @@ private void calculateChannelValues() {
Optional.ofNullable(enterTheSystem).orElse(0L) - Optional.ofNullable(leaveTheSystem).orElse(0L));

// Further calculated Channels
var essDischargePowerSum = essDcDischargePower.calculate();
this.getEssDischargePowerChannel()
.setNextValue(TypeUtils.subtract(essActivePowerSum, productionDcActualPowerSum));
.setNextValue(essDischargePowerSum);
}

/**
Expand Down