mirror of
https://github.com/thooge/esp32-nmea2000-obp60.git
synced 2025-12-16 07:23:07 +01:00
add new function getBoatDataValues to api for easier access
This commit is contained in:
@@ -329,6 +329,17 @@ String GwBoatData::toString(){
|
||||
}
|
||||
return rt;
|
||||
}
|
||||
bool GwBoatData::isValid(String name){
|
||||
auto it=values.find(name);
|
||||
if (it == values.end()) return false;
|
||||
return it->second->isValid();
|
||||
}
|
||||
double GwBoatData::getDoubleValue(String name,double defaultv){
|
||||
auto it=values.find(name);
|
||||
if (it == values.end()) return defaultv;
|
||||
if (! it->second->isValid()) return defaultv;
|
||||
return it->second->getDoubleValue();
|
||||
}
|
||||
double formatCourse(double cv)
|
||||
{
|
||||
double rt = cv * 180.0 / M_PI;
|
||||
|
||||
Reference in New Issue
Block a user