mirror of
https://github.com/lumapu/ahoy.git
synced 2025-05-12 08:26:38 +02:00
replace "n/a" with const 'notAvail;'
notAvail is in "hmDefines.h", I think its a good idea to change the location of all words they are often use to another file. const char* const notAvail = "n/a"; Please check befor PR it!
This commit is contained in:
parent
797cc0c22f
commit
688e1016a8
1 changed files with 7 additions and 7 deletions
|
@ -282,8 +282,8 @@ void webApi::getLive(JsonObject obj) {
|
|||
for (uint8_t fld = 0; fld < 11; fld++) {
|
||||
pos = (iv->getPosByChFld(CH0, list[fld], rec));
|
||||
ch0[fld] = (0xff != pos) ? round3(iv->getValue(pos, rec)) : 0.0;
|
||||
obj[F("ch0_fld_units")][fld] = (0xff != pos) ? String(iv->getUnit(pos, rec)) : F("n/a");
|
||||
obj[F("ch0_fld_names")][fld] = (0xff != pos) ? String(iv->getFieldName(pos, rec)) : F("n/a");
|
||||
obj[F("ch0_fld_units")][fld] = (0xff != pos) ? String(iv->getUnit(pos, rec)) : notAvail;
|
||||
obj[F("ch0_fld_names")][fld] = (0xff != pos) ? String(iv->getFieldName(pos, rec)) : notAvail;
|
||||
}
|
||||
|
||||
for(uint8_t j = 1; j <= iv->channels; j ++) {
|
||||
|
@ -300,8 +300,8 @@ void webApi::getLive(JsonObject obj) {
|
|||
}
|
||||
cur[k] = (0xff != pos) ? round3(iv->getValue(pos, rec)) : 0.0;
|
||||
if(1 == j) {
|
||||
obj[F("fld_units")][k] = (0xff != pos) ? String(iv->getUnit(pos, rec)) : F("n/a");
|
||||
obj[F("fld_names")][k] = (0xff != pos) ? String(iv->getFieldName(pos, rec)) : F("n/a");
|
||||
obj[F("fld_units")][k] = (0xff != pos) ? String(iv->getUnit(pos, rec)) : notAvail;
|
||||
obj[F("fld_names")][k] = (0xff != pos) ? String(iv->getFieldName(pos, rec)) : notAvail;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -323,9 +323,9 @@ void webApi::getRecord(JsonObject obj, record_t<> *rec) {
|
|||
for(uint8_t j = 0; j < rec->length; j++) {
|
||||
byteAssign_t *assign = iv->getByteAssign(j, rec);
|
||||
pos = (iv->getPosByChFld(assign->ch, assign->fieldId, rec));
|
||||
obj2[j]["fld"] = (0xff != pos) ? String(iv->getFieldName(pos, rec)) : F("n/a");
|
||||
obj2[j]["unit"] = (0xff != pos) ? String(iv->getUnit(pos, rec)) : F("n/a");
|
||||
obj2[j]["val"] = (0xff != pos) ? String(iv->getValue(pos, rec)) : F("n/a");
|
||||
obj2[j]["fld"] = (0xff != pos) ? String(iv->getFieldName(pos, rec)) : notAvail;
|
||||
obj2[j]["unit"] = (0xff != pos) ? String(iv->getUnit(pos, rec)) : notAvail;
|
||||
obj2[j]["val"] = (0xff != pos) ? String(iv->getValue(pos, rec)) : notAvail;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue