correctly map pressure from bar to pascal in xdr
This commit is contained in:
parent
fc7ca220db
commit
435654a3f6
|
@ -41,19 +41,20 @@ double ps2ph(double v)
|
||||||
GwXDRType *types[] = {
|
GwXDRType *types[] = {
|
||||||
new GwXDRType(GwXDRType::PRESS, "P", "P"),
|
new GwXDRType(GwXDRType::PRESS, "P", "P"),
|
||||||
new GwXDRType(GwXDRType::PRESS, "P", "B",
|
new GwXDRType(GwXDRType::PRESS, "P", "B",
|
||||||
|
BarToP,
|
||||||
PtoBar,
|
PtoBar,
|
||||||
BarToP),
|
"P"),
|
||||||
new GwXDRType(GwXDRType::VOLT, "U", "V"),
|
new GwXDRType(GwXDRType::VOLT, "U", "V"),
|
||||||
new GwXDRType(GwXDRType::AMP, "I", "A"),
|
new GwXDRType(GwXDRType::AMP, "I", "A"),
|
||||||
new GwXDRType(GwXDRType::TEMP, "C", "K"),
|
new GwXDRType(GwXDRType::TEMP, "C", "K"),
|
||||||
new GwXDRType(GwXDRType::TEMP, "C", "C", CToKelvin, KelvinToC),
|
new GwXDRType(GwXDRType::TEMP, "C", "C", CToKelvin, KelvinToC,"K"),
|
||||||
new GwXDRType(GwXDRType::HUMID, "H", "P"), //percent
|
new GwXDRType(GwXDRType::HUMID, "H", "P"), //percent
|
||||||
new GwXDRType(GwXDRType::VOLPERCENT, "V", "P"),
|
new GwXDRType(GwXDRType::VOLPERCENT, "V", "P"),
|
||||||
new GwXDRType(GwXDRType::VOLUME, "V", "M", m3ToL, ltrTom3),
|
new GwXDRType(GwXDRType::VOLUME, "V", "M", m3ToL, ltrTom3,"L"),
|
||||||
new GwXDRType(GwXDRType::FLOW, "R", "I", ps2ph, ph2ps),
|
new GwXDRType(GwXDRType::FLOW, "R", "I", ps2ph, ph2ps),
|
||||||
new GwXDRType(GwXDRType::GENERIC, "G", ""),
|
new GwXDRType(GwXDRType::GENERIC, "G", ""),
|
||||||
new GwXDRType(GwXDRType::DISPLACEMENT, "A", "P"),
|
new GwXDRType(GwXDRType::DISPLACEMENT, "A", "P"),
|
||||||
new GwXDRType(GwXDRType::DISPLACEMENTD, "A", "D",DegToRad,RadToDeg),
|
new GwXDRType(GwXDRType::DISPLACEMENTD, "A", "D",DegToRad,RadToDeg,"rd"),
|
||||||
new GwXDRType(GwXDRType::RPM,"T","R"),
|
new GwXDRType(GwXDRType::RPM,"T","R"),
|
||||||
//important to have 2x NULL!
|
//important to have 2x NULL!
|
||||||
NULL,
|
NULL,
|
||||||
|
|
|
@ -44,14 +44,24 @@ class GwXDRType{
|
||||||
TypeCode code;
|
TypeCode code;
|
||||||
String xdrtype;
|
String xdrtype;
|
||||||
String xdrunit;
|
String xdrunit;
|
||||||
|
String boatDataUnit;
|
||||||
convert tonmea=NULL;
|
convert tonmea=NULL;
|
||||||
convert fromnmea=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->code=tc;
|
||||||
this->xdrtype=xdrtype;
|
this->xdrtype=xdrtype;
|
||||||
this->xdrunit=xdrunit;
|
this->xdrunit=xdrunit;
|
||||||
this->fromnmea=fromnmea;
|
this->fromnmea=fromnmea;
|
||||||
this->tonmea=tonmea;
|
this->tonmea=tonmea;
|
||||||
|
this->boatDataUnit=boatDataUnit.isEmpty()?xdrunit:boatDataUnit;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
class GwXDRTypeMapping{
|
class GwXDRTypeMapping{
|
||||||
|
@ -183,7 +193,7 @@ class GwXDRFoundMapping : public GwBoatItemNameProvider{
|
||||||
return String("xdr")+getTransducerName();
|
return String("xdr")+getTransducerName();
|
||||||
};
|
};
|
||||||
virtual String getBoatItemFormat(){
|
virtual String getBoatItemFormat(){
|
||||||
return "formatXdr:"+type->xdrtype+":"+type->xdrunit;
|
return "formatXdr:"+type->xdrtype+":"+type->boatDataUnit;
|
||||||
};
|
};
|
||||||
virtual ~GwXDRFoundMapping(){}
|
virtual ~GwXDRFoundMapping(){}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue