29 #include <wx/config.h>
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"
49 extern bool LogMessageOnce(
const wxString &msg);
50 extern double fromUsrDistance(
double usr_distance,
int unit = -1);
51 extern double fromUsrSpeed(
double usr_speed,
int unit = -1);
52 extern double fromUsrWindSpeed(
double usr_wspeed,
int unit = -1);
53 extern double fromUsrTemp(
double usr_temp,
int unit = -1);
54 extern wxString getUsrTempUnit();
55 extern wxString formatAngle(
double angle);
57 extern void AlphaBlending(
ocpnDC &dc,
int x,
int y,
int size_x,
int size_y,
58 float radius, wxColour color,
59 unsigned char transparency);
62 void DimeControl(wxWindow *ctrl);
63 void DimeControl(wxWindow *ctrl, wxColour col, wxColour col1,
64 wxColour back_color, wxColour text_color, wxColour uitext,
65 wxColour udkrd, wxColour gridline);
66 wxColor GetDimedColor(
const wxColor& c);
70 class NavObjectCollection;
71 class wxGenericProgressDialog;
101 RoutePoint *WaypointExists(
const wxString &name,
double lat,
double lon);
102 RoutePoint *WaypointExists(
const wxString &guid);
103 Route *RouteExists(
const wxString &guid);
105 Track *TrackExists(
const wxString &guid);
107 void ExportGPX(wxWindow *parent,
bool bviz_only =
false,
bool blayer =
false);
108 void UI_ImportGPX(wxWindow *parent,
bool islayer =
false,
109 wxString dirpath = _T(
""),
bool isdirectory =
true,
110 bool isPersistent =
false);
112 bool ExportGPXRoutes(wxWindow *parent, RouteList *pRoutes,
113 const wxString suggestedName = _T(
"routes"));
114 bool ExportGPXTracks(wxWindow *parent, std::vector<Track*> *pRoutes,
115 const wxString suggestedName = _T(
"tracks"));
116 bool ExportGPXWaypoints(wxWindow *parent, RoutePointList *pRoutePoints,
117 const wxString suggestedName = _T(
"waypoints"));
125 return (2.0/100) *
static_cast<double>(slider_pos) + 1.02;
130 return std::round((100.0 * (
static_cast<double>(value) - 1.02)) / 2.0);
140 MyConfig(
const wxString &LocalFileName);
144 void LoadS57Config();
145 wxString FindNewestUsableBackup()
const;
146 void LoadNavObjects();
147 virtual void AddNewRoute(
Route *pr);
148 virtual void UpdateRoute(
Route *pr);
149 virtual void DeleteConfigRoute(
Route *pr);
151 virtual void AddNewTrack(
Track *pt);
152 virtual void UpdateTrack(
Track *pt);
153 virtual void DeleteConfigTrack(
Track *pt);
155 virtual void AddNewWayPoint(
RoutePoint *pWP,
int ConfigRouteNum = -1);
158 virtual void AddNewTrackPoint(
TrackPoint *pWP,
const wxString &parent_GUID);
160 virtual void CreateConfigGroups(ChartGroupArray *pGroupArray);
161 virtual void DestroyConfigGroups(
void);
162 virtual void LoadConfigGroups(ChartGroupArray *pGroupArray);
164 virtual void LoadCanvasConfigs(
bool bApplyAsTemplate =
false);
165 virtual void LoadConfigCanvas(
canvasConfig *cConfig,
bool bApplyAsTemplate);
167 virtual void SaveCanvasConfigs();
170 virtual bool UpdateChartDirs(ArrayOfCDI &dirarray);
171 virtual bool LoadChartDirArray(ArrayOfCDI &ChartDirArray);
172 virtual void UpdateSettings();
173 virtual void UpdateNavObj(
bool bRecreate =
false);
174 virtual void UpdateNavObjOnly();
175 virtual bool IsChangesFileDirty();
177 bool LoadLayers(wxString &path);
178 int LoadMyConfigRaw(
bool bAsTemplate =
false);
180 void CreateRotatingNavObjBackup();
182 wxString m_sNavObjSetFile;
183 wxString m_sNavObjSetChangesFile;
189 void 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.