also set water temperature (MTW) from PGN 130312 - with condition
This commit is contained in:
parent
0cd552d590
commit
09b583ebd6
|
@ -70,6 +70,7 @@ class GwConverterConfig{
|
||||||
int min2KInterval=50;
|
int min2KInterval=50;
|
||||||
int rmcInterval=1000;
|
int rmcInterval=1000;
|
||||||
int rmcCheckTime=4000;
|
int rmcCheckTime=4000;
|
||||||
|
int winst312=256;
|
||||||
std::vector<WindMapping> windMappings;
|
std::vector<WindMapping> windMappings;
|
||||||
void init(GwConfigHandler *config, GwLog*logger){
|
void init(GwConfigHandler *config, GwLog*logger){
|
||||||
minXdrInterval=config->getInt(GwConfigDefinitions::minXdrInterval,100);
|
minXdrInterval=config->getInt(GwConfigDefinitions::minXdrInterval,100);
|
||||||
|
@ -82,6 +83,7 @@ class GwConverterConfig{
|
||||||
rmcInterval=config->getInt(GwConfigDefinitions::sendRMCi,1000);
|
rmcInterval=config->getInt(GwConfigDefinitions::sendRMCi,1000);
|
||||||
if (rmcInterval < 0) rmcInterval=0;
|
if (rmcInterval < 0) rmcInterval=0;
|
||||||
if (rmcInterval > 0 && rmcInterval <100) rmcInterval=100;
|
if (rmcInterval > 0 && rmcInterval <100) rmcInterval=100;
|
||||||
|
winst312=config->getInt(GwConfigDefinitions::winst312,256);
|
||||||
for (auto && it:windConfigs){
|
for (auto && it:windConfigs){
|
||||||
String cfg=config->getString(it.second);
|
String cfg=config->getString(it.second);
|
||||||
WindMapping mapping(it.first,cfg);
|
WindMapping mapping(it.first,cfg);
|
||||||
|
|
|
@ -1344,7 +1344,6 @@ private:
|
||||||
return;
|
return;
|
||||||
|
|
||||||
SendMessage(NMEA0183Msg);
|
SendMessage(NMEA0183Msg);
|
||||||
i++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GwXDRFoundMapping mapping=xdrMappings->getMapping(XDRTEMP,TempSource,0,0);
|
GwXDRFoundMapping mapping=xdrMappings->getMapping(XDRTEMP,TempSource,0,0);
|
||||||
|
@ -1379,6 +1378,21 @@ private:
|
||||||
LOG_DEBUG(GwLog::DEBUG,"unable to parse PGN %d",msg.PGN);
|
LOG_DEBUG(GwLog::DEBUG,"unable to parse PGN %d",msg.PGN);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (TemperatureSource == N2kts_SeaTemperature &&
|
||||||
|
(config.winst312 == TemperatureInstance || config.winst312 == 256)) {
|
||||||
|
updateDouble(boatData->WTemp, Temperature);
|
||||||
|
tNMEA0183Msg NMEA0183Msg;
|
||||||
|
|
||||||
|
if (!NMEA0183Msg.Init("MTW", talkerId))
|
||||||
|
return;
|
||||||
|
if (!NMEA0183Msg.AddDoubleField(KelvinToC(Temperature)))
|
||||||
|
return;
|
||||||
|
if (!NMEA0183Msg.AddStrField("C"))
|
||||||
|
return;
|
||||||
|
|
||||||
|
SendMessage(NMEA0183Msg);
|
||||||
|
}
|
||||||
|
|
||||||
GwXDRFoundMapping mapping=xdrMappings->getMapping(XDRTEMP,(int)TemperatureSource,0,TemperatureInstance);
|
GwXDRFoundMapping mapping=xdrMappings->getMapping(XDRTEMP,(int)TemperatureSource,0,TemperatureInstance);
|
||||||
if (updateDouble(&mapping,Temperature)){
|
if (updateDouble(&mapping,Temperature)){
|
||||||
LOG_DEBUG(GwLog::DEBUG+1,"found temperature mapping %s",mapping.definition->toString().c_str());
|
LOG_DEBUG(GwLog::DEBUG+1,"found temperature mapping %s",mapping.definition->toString().c_str());
|
||||||
|
|
|
@ -228,6 +228,46 @@
|
||||||
"check": "checkMinMax",
|
"check": "checkMinMax",
|
||||||
"category": "converter"
|
"category": "converter"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "timeouts",
|
||||||
|
"type": "array",
|
||||||
|
"replace": [
|
||||||
|
{
|
||||||
|
"n": "Default",
|
||||||
|
"d": "4000",
|
||||||
|
"l": "default",
|
||||||
|
"t": "NMEA"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n": "Sensor",
|
||||||
|
"d": "60000",
|
||||||
|
"l": "sensor",
|
||||||
|
"t": "sensor"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n": "Long",
|
||||||
|
"d": "32000",
|
||||||
|
"l": "long",
|
||||||
|
"t": "special NMEA"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"n": "Ais",
|
||||||
|
"d": "120000",
|
||||||
|
"l": "ais",
|
||||||
|
"t": "ais"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"name": "timo$n",
|
||||||
|
"label": "timeout $l",
|
||||||
|
"default": "$d",
|
||||||
|
"type": "number",
|
||||||
|
"description": "data timeouts(ms) for $t data",
|
||||||
|
"category": "converter"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "stbRudderI",
|
"name": "stbRudderI",
|
||||||
"label":"stb rudder instance",
|
"label":"stb rudder instance",
|
||||||
|
@ -305,44 +345,15 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "timeouts",
|
"name": "winst312",
|
||||||
"type": "array",
|
"label": "130312 WTemp iid",
|
||||||
"replace":[
|
|
||||||
{
|
|
||||||
"n":"Default",
|
|
||||||
"d":"4000",
|
|
||||||
"l": "default",
|
|
||||||
"t": "NMEA"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"n":"Sensor",
|
|
||||||
"d":"60000",
|
|
||||||
"l": "sensor",
|
|
||||||
"t": "sensor"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"n":"Long",
|
|
||||||
"d":"32000",
|
|
||||||
"l": "long",
|
|
||||||
"t": "special NMEA"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"n":"Ais",
|
|
||||||
"d":"120000",
|
|
||||||
"l": "ais",
|
|
||||||
"t": "ais"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"children":[
|
|
||||||
{
|
|
||||||
"name":"timo$n",
|
|
||||||
"label":"timeout $l",
|
|
||||||
"default": "$d",
|
|
||||||
"type": "number",
|
"type": "number",
|
||||||
"description": "data timeouts(ms) for $t data",
|
"check": "checkMinMax",
|
||||||
|
"min": -1,
|
||||||
|
"max": 256,
|
||||||
|
"description": "the temp instance of PGN 130312 used for water temperature, use -1 for none, 256 for any",
|
||||||
|
"default": "256",
|
||||||
"category":"converter"
|
"category":"converter"
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "usbActisense",
|
"name": "usbActisense",
|
||||||
|
|
Loading…
Reference in New Issue