@signalk/n2k-signalk
Version:
NMEA 2000 to SignalK conversion library
27 lines • 873 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const ts_pgns_1 = require("@canboat/ts-pgns");
const modeMap = {
'standby': ts_pgns_1.SimnetApModeBitfield.Standby,
'auto': ts_pgns_1.SimnetApModeBitfield.NoDrift,
'heading': ts_pgns_1.SimnetApModeBitfield.Heading,
'wind': ts_pgns_1.SimnetApModeBitfield.Wind,
'route': ts_pgns_1.SimnetApModeBitfield.Nav
};
module.exports = [
{
pgnClass: ts_pgns_1.PGN_65305_SimnetPilotMode,
node: 'steering.autopilot.state',
value: function (n2k) {
let res;
Object.keys(modeMap).forEach(key => {
const mode = modeMap[key];
if (n2k.fields.mode?.indexOf(mode) != -1) {
res = key;
}
});
return res;
}
}
];
//# sourceMappingURL=65305.js.map