OpenCPN Partial API docs
Loading...
Searching...
No Matches
comm_n0183_output.h
1/***************************************************************************
2 *
3 * Project: OpenCPN
4 * Purpose: NMEA Data Multiplexer Object
5 * Author: David Register
6 *
7 ***************************************************************************
8 * Copyright (C) 2010 by David S. Register *
9 * *
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
14 * *
15 * This program is distributed in the hope that it will be useful, *
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
18 * GNU General Public License for more details. *
19 * *
20 * You should have received a copy of the GNU General Public License *
21 * along with this program; if not, write to the *
22 * Free Software Foundation, Inc., *
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
24 **************************************************************************/
25
26#ifndef _COMMN0183_OUT_H
27#define _COMMN0183_OUT_H
28
29#include <functional>
30
31#include <wx/wxprec.h>
32
33#include "model/nmea_log.h"
34#include "model/multiplexer.h"
35#include "observable_evtvar.h"
36
37#ifndef WX_PRECOMP
38#include <wx/wx.h>
39#endif // precompiled headers
40
41class RoutePoint;
42class Route;
43
47#define ERR_GARMIN_INITIALIZE -1
51#define ERR_GARMIN_SEND_MESSAGE -2
55#define ERR_GPS_DRIVER_NOT_AVAILAIBLE -3
56
57void BroadcastNMEA0183Message(const wxString& msg, NmeaLog* nmea_log,
58 EventVar& on_msg_sent);
59
61public:
62 std::function<void(int)> set_value;
63 std::function<void(int)> set_range;
64 std::function<void(void)> pulse;
65 std::function<void(const std::string&)> set_message;
66 std::function<bool()> confirm_overwrite;
67
69 : set_value([](int) {}),
70 set_range([](int) {}),
71 pulse([](void) {}),
72 set_message([](const std::string&) {}),
73 confirm_overwrite([]() { return true; }) {}
74};
75
76int SendRouteToGPS_N0183(Route* pr, const wxString& com_name,
77 bool bsend_waypoints, Multiplexer& multiplexer,
78 N0183DlgCtx ctx);
79
80int SendWaypointToGPS_N0183(RoutePoint* prp, const wxString& com_name,
81 Multiplexer& multiplexer, N0183DlgCtx ctx);
82
83#endif // _COMMN0183>>UT_H
Generic event handling between MVC Model and Controller based on a shared EventVar variable.
Represents a waypoint or mark within the navigation system.
Definition route_point.h:70
Represents a navigational route in the navigation system.
Definition route.h:98