32#include <unordered_map>
38#include "comm_decoder.h"
39#include "comm_navmsg.h"
46 std::string active_source;
47 std::string active_identifier;
48 int active_source_address;
53 int position_watchdog;
54 int variation_watchdog;
56 int velocity_watchdog;
57 int satellite_watchdog;
76 void InitCommListeners();
78 bool HandleN2K_129029(std::shared_ptr<const Nmea2000Msg> n2k_msg);
79 bool HandleN2K_129025(std::shared_ptr<const Nmea2000Msg> n2k_msg);
80 bool HandleN2K_129026(std::shared_ptr<const Nmea2000Msg> n2k_msg);
81 bool HandleN2K_127250(std::shared_ptr<const Nmea2000Msg> n2k_msg);
82 bool HandleN2K_129540(std::shared_ptr<const Nmea2000Msg> n2k_msg);
84 bool HandleN0183_RMC(std::shared_ptr<const Nmea0183Msg> n0183_msg);
85 bool HandleN0183_HDT(std::shared_ptr<const Nmea0183Msg> n0183_msg);
86 bool HandleN0183_HDG(std::shared_ptr<const Nmea0183Msg> n0183_msg);
87 bool HandleN0183_HDM(std::shared_ptr<const Nmea0183Msg> n0183_msg);
88 bool HandleN0183_VTG(std::shared_ptr<const Nmea0183Msg> n0183_msg);
89 bool HandleN0183_GSV(std::shared_ptr<const Nmea0183Msg> n0183_msg);
90 bool HandleN0183_GGA(std::shared_ptr<const Nmea0183Msg> n0183_msg);
91 bool HandleN0183_GLL(std::shared_ptr<const Nmea0183Msg> n0183_msg);
92 bool HandleN0183_AIVDO(std::shared_ptr<const Nmea0183Msg> n0183_msg);
94 bool HandleSignalK(std::shared_ptr<const SignalkMsg> sK_msg);
96 void OnDriverStateChange();
98 void OnWatchdogTimer(wxTimerEvent& event);
99 bool EvalPriority(std::shared_ptr <const NavMsg> msg,
101 std::unordered_map<std::string, int>& priority_map);
102 std::string GetPriorityKey(std::shared_ptr <const NavMsg> msg);
104 std::vector<std::string> GetPriorityMaps();
107 void UpdateAndApplyMaps(std::vector<std::string> new_maps);
108 bool LoadConfig(
void );
109 bool SaveConfig(
void );
112 wxTimer m_watchdog_timer;
138 void PresetWatchdogs();
139 void MakeHDTFromHDM();
140 void InitializePriorityContainers();
141 void PresetPriorityContainers();
143 std::string GetPriorityMap(std::unordered_map<std::string, int> &map);
144 void ApplyPriorityMap(std::unordered_map<std::string, int>& priority_map,
145 wxString &new_prio,
int category);
146 void ApplyPriorityMaps(std::vector<std::string> new_maps);
148 void ClearPriorityMaps();
150 const std::unordered_map<std::string, int> &priority_map);
151 void SelectNextLowerPriority(
const std::unordered_map<std::string, int> &map,
161 std::unordered_map<std::string, int> priority_map_position;
162 std::unordered_map<std::string, int> priority_map_velocity;
163 std::unordered_map<std::string, int> priority_map_heading;
164 std::unordered_map<std::string, int> priority_map_variation;
165 std::unordered_map<std::string, int> priority_map_satellites;
167 DECLARE_EVENT_TABLE()
Handle most incoming messages and make them available for other parties.
Decode received NMEA messages and update global values from comm_vars.h and own_ship....
Keeps listening over it's lifespan, removes itself on destruction.
Data for selected source from multiple candidates.