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

correctly map pressure from bar to pascal in xdr

This commit is contained in:
andreas
2023-03-17 20:54:00 +01:00
parent fc7ca220db
commit 435654a3f6
2 changed files with 17 additions and 6 deletions

View File

@@ -44,14 +44,24 @@ class GwXDRType{
TypeCode code;
String xdrtype;
String xdrunit;
String boatDataUnit;
convert tonmea=NULL;
convert fromnmea=NULL;
GwXDRType(TypeCode tc,String xdrtype,String xdrunit,convert fromnmea=NULL,convert tonmea=NULL){
GwXDRType(TypeCode tc,String xdrtype,String xdrunit){
this->code=tc;
this->xdrtype=xdrtype;
this->xdrunit=xdrunit;
this->boatDataUnit=xdrunit;
this->fromnmea=fromnmea;
this->tonmea=tonmea;
}
GwXDRType(TypeCode tc,String xdrtype,String xdrunit,convert fromnmea,convert tonmea,String boatDataUnit=String()){
this->code=tc;
this->xdrtype=xdrtype;
this->xdrunit=xdrunit;
this->fromnmea=fromnmea;
this->tonmea=tonmea;
this->boatDataUnit=boatDataUnit.isEmpty()?xdrunit:boatDataUnit;
}
};
class GwXDRTypeMapping{
@@ -183,7 +193,7 @@ class GwXDRFoundMapping : public GwBoatItemNameProvider{
return String("xdr")+getTransducerName();
};
virtual String getBoatItemFormat(){
return "formatXdr:"+type->xdrtype+":"+type->xdrunit;
return "formatXdr:"+type->xdrtype+":"+type->boatDataUnit;
};
virtual ~GwXDRFoundMapping(){}
};