30#include <wx/confbase.h>
31#include <wx/fileconf.h>
35#include <wx/msw/regconf.h>
36#include <wx/msw/iniconf.h>
44#include "model/select_item.h"
46#include "model/navutil_base.h"
48extern bool LogMessageOnce(
const wxString &msg);
49extern double fromUsrDistance(
double usr_distance,
int unit = -1);
50extern double fromUsrSpeed(
double usr_speed,
int unit = -1);
51extern double fromUsrWindSpeed(
double usr_wspeed,
int unit = -1);
52extern double fromUsrTemp(
double usr_temp,
int unit = -1);
53extern wxString getUsrTempUnit();
54extern wxString formatAngle(
double angle);
60#define GLOBAL_SETTINGS_INPUT \
71wxDateTime toUsrDateTime(
const wxDateTime ts,
const int format,
72 const double lon = INFINITY - INFINITY);
81wxDateTime fromUsrDateTime(
const wxDateTime ts,
const int format,
82 const double lon = INFINITY - INFINITY);
84extern void AlphaBlending(
ocpnDC &dc,
int x,
int y,
int size_x,
int size_y,
85 float radius, wxColour color,
86 unsigned char transparency);
89void DimeControl(wxWindow *ctrl);
90void DimeControl(wxWindow *ctrl, wxColour col, wxColour col1,
91 wxColour back_color, wxColour text_color, wxColour uitext,
92 wxColour udkrd, wxColour gridline);
93wxColor GetDimedColor(
const wxColor &c);
96class NavObjectCollection;
97class wxGenericProgressDialog;
127RoutePoint *WaypointExists(
const wxString &name,
double lat,
double lon);
128RoutePoint *WaypointExists(
const wxString &guid);
129Route *RouteExists(
const wxString &guid);
131Track *TrackExists(
const wxString &guid);
133void ExportGPX(wxWindow *parent,
bool bviz_only =
false,
bool blayer =
false);
134void UI_ImportGPX(wxWindow *parent,
bool islayer =
false,
135 wxString dirpath = _T(
""),
bool isdirectory =
true,
136 bool isPersistent =
false);
138bool ExportGPXRoutes(wxWindow *parent, RouteList *pRoutes,
139 const wxString suggestedName = _T(
"routes"));
140bool ExportGPXTracks(wxWindow *parent, std::vector<Track *> *pRoutes,
141 const wxString suggestedName = _T(
"tracks"));
142bool ExportGPXWaypoints(wxWindow *parent, RoutePointList *pRoutePoints,
143 const wxString suggestedName = _T(
"waypoints"));
149 return (2.0 / 100) *
static_cast<double>(slider_pos) + 1.02;
154 return std::round((100.0 * (
static_cast<double>(value) - 1.02)) / 2.0);
163 MyConfig(
const wxString &LocalFileName);
167 void LoadS57Config();
168 wxString FindNewestUsableBackup()
const;
169 void LoadNavObjects();
170 virtual void AddNewRoute(
Route *pr);
171 virtual void UpdateRoute(
Route *pr);
172 virtual void DeleteConfigRoute(
Route *pr);
174 virtual void AddNewTrack(
Track *pt);
175 virtual void UpdateTrack(
Track *pt);
176 virtual void DeleteConfigTrack(
Track *pt);
178 virtual void AddNewWayPoint(
RoutePoint *pWP,
int ConfigRouteNum = -1);
181 virtual void AddNewTrackPoint(
TrackPoint *pWP,
const wxString &parent_GUID);
183 virtual void CreateConfigGroups(ChartGroupArray *pGroupArray);
184 virtual void DestroyConfigGroups(
void);
185 virtual void LoadConfigGroups(ChartGroupArray *pGroupArray);
187 virtual void LoadCanvasConfigs(
bool bApplyAsTemplate =
false);
188 virtual void LoadConfigCanvas(
canvasConfig *cConfig,
bool bApplyAsTemplate);
190 virtual void SaveCanvasConfigs();
193 virtual bool UpdateChartDirs(ArrayOfCDI &dirarray);
194 virtual bool LoadChartDirArray(ArrayOfCDI &ChartDirArray);
195 virtual void UpdateSettings();
196 virtual void UpdateNavObj(
bool bRecreate =
false);
197 virtual void UpdateNavObjOnly();
198 virtual bool IsChangesFileDirty();
200 bool LoadLayers(wxString &path);
201 int LoadMyConfigRaw(
bool bAsTemplate =
false);
203 void CreateRotatingNavObjBackup();
205 wxString m_sNavObjSetFile;
206 wxString m_sNavObjSetChangesFile;
212void SwitchInlandEcdisMode(
bool Switch);
static int config_to_ui(double value)
Convert configuration 1.02..3.0 value to slider scale 1..100.
static double ui_to_config(int slider_pos)
Convert a slider scale 1-100 value to configuration value 1.02..3.0.
Represents a waypoint or mark within the navigation system.
Represents a navigational route in the navigation system.
Represents a single point in a track.
Represents a track, which is a series of connected track points.
Encapsulates persistent canvas configuration.
Device context class that can use either wxDC or OpenGL for drawing.