mirror of
https://github.com/UtilitechAS/amsreader-firmware.git
synced 2026-01-25 11:56:04 +00:00
Divide current another decimal point for Kamstrup CT meters
This commit is contained in:
@@ -309,16 +309,13 @@ IEC6205675::IEC6205675(const char* d, uint8_t useMeterType, uint8_t distribution
|
||||
if(l3PowerFactor != 0)
|
||||
l3PowerFactor /= 100;
|
||||
|
||||
int adiv = 1;
|
||||
int watt = abs((l1voltage * l1current) + (l2voltage * l2current) + (l3voltage * l3current));
|
||||
while(watt / (activeImportPower + activeExportPower + reactiveImportPower + reactiveExportPower) > 2) {
|
||||
adiv *= 10;
|
||||
watt /= 10;
|
||||
if(watt / (activeImportPower + activeExportPower + reactiveImportPower + reactiveExportPower) > 2) {
|
||||
l1current = l1current != 0 ? l1current / 10 : 0;
|
||||
l2current = l2current != 0 ? l2current / 10 : 0;
|
||||
l3current = l3current != 0 ? l3current / 10 : 0;
|
||||
}
|
||||
|
||||
l1current = l1current != 0 ? l1current / adiv : 0;
|
||||
l2current = l2current != 0 ? l2current / adiv : 0;
|
||||
l3current = l3current != 0 ? l3current / adiv : 0;
|
||||
} else if(meterType == AmsTypeSagemcom) {
|
||||
CosemData* meterTs = getCosemDataAt(1, ((char *) (d)));
|
||||
if(meterTs != NULL) {
|
||||
|
||||
Reference in New Issue
Block a user