25 #ifndef _MULTIPLEXER_H__
26 #define _MULTIPLEXER_H__
30 #include <wx/wxprec.h>
36 #include "model/comm_navmsg.h"
43 std::function<bool()> log_is_active;
44 std::function<void(
const std::string&)> log_message;
46 : log_is_active([]() {
return false; }),
47 log_message([](
const std::string& s) { }) { }
55 bool& legacy_input_filter_behaviour );
58 void LogOutputMessage(
const wxString &msg, wxString stream_name,
60 void LogOutputMessageColor(
const wxString &msg,
const wxString &stream_name,
61 const wxString &color);
62 void LogInputMessage(
const wxString &msg,
const wxString &stream_name,
63 bool b_filter,
bool b_error =
false);
65 bool IsLogActive() {
return m_log_callbacks.log_is_active();}
71 void InitN2KCommListeners();
73 void HandleN0183(std::shared_ptr<const Nmea0183Msg> n0183_msg);
74 bool HandleN2K_Log(std::shared_ptr<const Nmea2000Msg> n2k_msg);
75 std::string N2K_LogMessage_Detail(
unsigned int pgn,
76 std::shared_ptr<const Nmea2000Msg> n2k_msg);
79 unsigned int last_pgn_logged;
81 bool& m_legacy_input_filter_behaviour;
Keeps listening over it's lifespan, removes itself on destruction.