mirror of
https://github.com/lumapu/ahoy.git
synced 2025-06-04 11:41:38 +02:00
fix yield correction (data type was not correct during save)
This commit is contained in:
parent
c147906834
commit
0118fd1431
4 changed files with 4 additions and 4 deletions
|
@ -132,7 +132,7 @@ typedef struct {
|
|||
char name[MAX_NAME_LENGTH];
|
||||
serial_u serial;
|
||||
uint16_t chMaxPwr[6];
|
||||
double yieldCor[6]; // signed YieldTotal correction value
|
||||
double yieldCor[6]; // YieldTotal correction value
|
||||
char chName[6][MAX_NAME_LENGTH];
|
||||
} cfgIv_t;
|
||||
|
||||
|
|
|
@ -315,7 +315,7 @@ class RestApi {
|
|||
obj2[F("version")] = String(iv->getFwVersion());
|
||||
|
||||
for(uint8_t j = 0; j < iv->channels; j ++) {
|
||||
obj2[F("ch_yield_cor")][j] = iv->config->yieldCor[j];
|
||||
obj2[F("ch_yield_cor")][j] = (double)iv->config->yieldCor[j];
|
||||
obj2[F("ch_name")][j] = iv->config->chName[j];
|
||||
obj2[F("ch_max_pwr")][j] = iv->config->chMaxPwr[j];
|
||||
}
|
||||
|
|
|
@ -593,7 +593,7 @@
|
|||
for(var j of [
|
||||
["ModPwr", "ch_max_pwr", "Max Module Power (Wp)", 4, "[0-9]+"],
|
||||
["ModName", "ch_name", "Module Name", 15, null],
|
||||
["YieldCor", "ch_yield_cor", "Yield Total Correction [kWh]", 8, "[0-9-]+"]]) {
|
||||
["YieldCor", "ch_yield_cor", "Yield Total Correction [kWh]", 8, "[0-9-\.]+"]]) {
|
||||
|
||||
var cl = (re.test(obj["serial"])) ? "" : " hide";
|
||||
|
||||
|
|
|
@ -509,7 +509,7 @@ class Web {
|
|||
|
||||
// max channel power / name
|
||||
for (uint8_t j = 0; j < 6; j++) {
|
||||
iv->config->yieldCor[j] = request->arg("inv" + String(i) + "YieldCor" + String(j)).toInt();
|
||||
iv->config->yieldCor[j] = request->arg("inv" + String(i) + "YieldCor" + String(j)).toDouble();
|
||||
iv->config->chMaxPwr[j] = request->arg("inv" + String(i) + "ModPwr" + String(j)).toInt() & 0xffff;
|
||||
request->arg("inv" + String(i) + "ModName" + String(j)).toCharArray(iv->config->chName[j], MAX_NAME_LENGTH);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue