30#include <wx/confbase.h>
31#include <wx/fileconf.h>
35#include <wx/msw/regconf.h>
36#include <wx/msw/iniconf.h>
44#include "select_item.h"
46#include "navutil_base.h"
49enum { TEMPERATURE_C = 0, TEMPERATURE_F = 1, TEMPERATURE_K = 2 };
52extern bool LogMessageOnce(
const wxString &msg);
53extern double fromUsrDistance(
double usr_distance,
int unit = -1);
54extern double fromUsrSpeed(
double usr_speed,
int unit = -1);
55extern double toUsrTemp(
double cel_temp,
int unit = -1);
56extern double fromUsrTemp(
double usr_temp,
int unit = -1);
57extern wxString getUsrTempUnit(
int unit = -1);
58extern wxString formatAngle(
double angle);
60extern void AlphaBlending(
ocpnDC &dc,
int x,
int y,
int size_x,
int size_y,
61 float radius, wxColour color,
62 unsigned char transparency);
65void DimeControl(wxWindow *ctrl);
66void DimeControl(wxWindow *ctrl, wxColour col, wxColour col1,
67 wxColour back_color, wxColour text_color, wxColour uitext,
68 wxColour udkrd, wxColour gridline);
72class NavObjectCollection;
73class wxGenericProgressDialog;
103RoutePoint *WaypointExists(
const wxString &name,
double lat,
double lon);
104RoutePoint *WaypointExists(
const wxString &guid);
105Route *RouteExists(
const wxString &guid);
107Track *TrackExists(
const wxString &guid);
109void ExportGPX(wxWindow *parent,
bool bviz_only =
false,
bool blayer =
false);
110void UI_ImportGPX(wxWindow *parent,
bool islayer =
false,
111 wxString dirpath = _T(
""),
bool isdirectory =
true,
112 bool isPersistent =
false);
114bool ExportGPXRoutes(wxWindow *parent, RouteList *pRoutes,
115 const wxString suggestedName = _T(
"routes"));
116bool ExportGPXTracks(wxWindow *parent, std::vector<Track*> *pRoutes,
117 const wxString suggestedName = _T(
"tracks"));
118bool ExportGPXWaypoints(wxWindow *parent, RoutePointList *pRoutePoints,
119 const wxString suggestedName = _T(
"waypoints"));
127 return (2.0/100) *
static_cast<double>(slider_pos) + 1.02;
132 return std::round((100.0 * (
static_cast<double>(value) - 1.02)) / 2.0);
142 MyConfig(
const wxString &LocalFileName);
145 void LoadS57Config();
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 bool IsChangesFileDirty();
176 bool LoadLayers(wxString &path);
177 int LoadMyConfigRaw(
bool bAsTemplate =
false);
179 void CreateRotatingNavObjBackup();
181 wxString m_sNavObjSetFile;
182 wxString m_sNavObjSetChangesFile;
188void 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.