1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2025-12-16 07:23:07 +01:00

intermediate: prepare for dynamic boat data

This commit is contained in:
wellenvogel
2021-11-23 20:26:59 +01:00
parent a9e1357c7f
commit 3ef74581de
3 changed files with 57 additions and 2 deletions

View File

@@ -10,6 +10,16 @@ GwBoatData::~GwBoatData(){
}
}
template<class T> GwBoatItem<T> *GwBoatData::getOrCreate(T dummy, String name, String format,
unsigned long invalidTime)
{
for (auto it=values.begin();it != values.end();it++){
if ((*it)->getName() == name){
return *it;
}
}
return new GwBoatItem<T>(name,format,invalidTime,&values);
}
String GwBoatData::toJson() const {
unsigned long minTime=millis();
GwBoatItemBase::GwBoatItemMap::const_iterator it;