Skip to content

Commit

Permalink
Changes to make substituted I2 correct when exporting power
Browse files Browse the repository at this point in the history
  • Loading branch information
gskjold committed Jul 25, 2020
1 parent b4f18de commit fcbfe4d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/AmsData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ void AmsData::extractFromAidon(HanReader& hanReader, int listSize, bool substitu
l2voltage = ((double) hanReader.getInt( (int)Aidon_List3PhaseIT::VoltageL2)) / 10;
l3voltage = ((double) hanReader.getInt( (int)Aidon_List3PhaseIT::VoltageL3)) / 10;
if(substituteMissing) {
l2current = ((activeImportPower * sqrt(3)) - (l1voltage * l1current) - (l3voltage * l3current)) / l2voltage;
l2current = (((activeImportPower - activeExportPower) * sqrt(3)) - (l1voltage * l1current) - (l3voltage * l3current)) / l2voltage;
}
break;
}
Expand Down Expand Up @@ -252,7 +252,7 @@ void AmsData::extractFromKamstrup(HanReader& hanReader, int listSize, bool subst
l2voltage = hanReader.getInt( (int)Kamstrup_List3Phase::VoltageL2);
l3voltage = hanReader.getInt( (int)Kamstrup_List3Phase::VoltageL3);
if(substituteMissing) {
l2current = ((activeImportPower * sqrt(3)) - (l1voltage * l1current) - (l3voltage * l3current)) / l2voltage;
l2current = (((activeImportPower - activeExportPower) * sqrt(3)) - (l1voltage * l1current) - (l3voltage * l3current)) / l2voltage;
}
break;
}
Expand Down

0 comments on commit fcbfe4d

Please sign in to comment.