|
OpenCPN Partial API docs
|
Utility functions. More...
#include <cmath>#include <vector>#include <wx/colour.h>#include <wx/config.h>#include <wx/confbase.h>#include <wx/datetime.h>#include <wx/fileconf.h>#include <wx/progdlg.h>#include <wx/sound.h>#include <wx/string.h>#include "model/navutil_base.h"#include "model/nav_object_database.h"#include "model/select_item.h"#include "model/route.h"#include "model/route_point.h"#include "model/track.h"#include "bbox.h"#include "canvas_config.h"#include "chartdbs.h"#include "ocpndc.h"#include "vector2D.h"Go to the source code of this file.
Classes | |
| class | MouseZoom |
| class | MyConfig |
Macros | |
| #define | UTCINPUT 0 |
| Date/time in UTC. | |
| #define | LTINPUT 1 |
| Date/time using PC local timezone. | |
| #define | LMTINPUT 2 |
| Date/time using the remote location LMT time. | |
| #define | GLOBAL_SETTINGS_INPUT 3 |
| Date/time as of global OpenCPN settings. | |
Functions | |
| bool | LogMessageOnce (const wxString &msg) |
| double | fromUsrSpeed (double usr_speed, int unit=-1) |
| double | fromUsrWindSpeed (double usr_wspeed, int unit=-1) |
| double | fromUsrTemp (double usr_temp, int unit=-1) |
| wxString | getUsrTempUnit () |
| wxString | formatAngle (double angle) |
| wxString | GetLayerName (int id) |
| void | navutil::InitGlobals () |
| void | navutil::DeinitGlobals () |
| wxDateTime | toUsrDateTime (const wxDateTime ts, const int format, const double lon=INFINITY - INFINITY) |
| Converts a timestamp from UTC to the user's preferred time format. | |
| wxDateTime | fromUsrDateTime (const wxDateTime ts, const int format, const double lon=INFINITY - INFINITY) |
| Converts a timestamp from a user's preferred time format to UTC. | |
| void | AlphaBlending (ocpnDC &dc, int x, int y, int size_x, int size_y, float radius, wxColour color, unsigned char transparency) |
| void | DimeControl (wxWindow *ctrl) |
| void | DimeControl (wxWindow *ctrl, wxColour col, wxColour col1, wxColour back_color, wxColour text_color, wxColour uitext, wxColour udkrd, wxColour gridline) |
| bool | WptIsInRouteList (RoutePoint *pr) |
| RoutePoint * | WaypointExists (const wxString &name, double lat, double lon) |
| RoutePoint * | WaypointExists (const wxString &guid) |
| Route * | RouteExists (const wxString &guid) |
| Route * | RouteExists (Route *pTentRoute) |
| Track * | TrackExists (const wxString &guid) |
| int | BackupDatabase (wxWindow *parent) |
| void | ExportGPX (wxWindow *parent, bool bviz_only=false, bool blayer=false) |
| void | UI_ImportGPX (wxWindow *parent, bool islayer=false, wxString dirpath="", bool isdirectory=true, bool isPersistent=false) |
| bool | ExportGPXRoutes (wxWindow *parent, RouteList *pRoutes, const wxString suggestedName="routes") |
| bool | ExportGPXTracks (wxWindow *parent, std::vector< Track * > *pRoutes, const wxString suggestedName="tracks") |
| bool | ExportGPXWaypoints (wxWindow *parent, RoutePointList *pRoutePoints, const wxString suggestedName="waypoints") |
| void | ImportFileArray (const wxArrayString &file_array, bool islayer, bool isPersistent, wxString dirpath) |
| void | SwitchInlandEcdisMode (bool Switch) |
Variables | |
| constexpr int | kMaxCogsogFilterSeconds = 60 |
| constexpr int | kMaxCogAverageSeconds = 60 |
| MyConfig * | pConfig |
| Global instance. | |
Utility functions.
Definition in file navutil.h.
| #define GLOBAL_SETTINGS_INPUT 3 |
| #define LMTINPUT 2 |
|
extern |
Definition at line 3081 of file navutil.cpp.
| int BackupDatabase | ( | wxWindow * | parent | ) |
Definition at line 2451 of file navutil.cpp.
| void navutil::DeinitGlobals | ( | ) |
Definition at line 136 of file navutil.cpp.
| void DimeControl | ( | wxWindow * | ctrl | ) |
Definition at line 3158 of file navutil.cpp.
| void DimeControl | ( | wxWindow * | ctrl, |
| wxColour | col, | ||
| wxColour | col1, | ||
| wxColour | back_color, | ||
| wxColour | text_color, | ||
| wxColour | uitext, | ||
| wxColour | udkrd, | ||
| wxColour | gridline | ||
| ) |
Definition at line 3195 of file navutil.cpp.
| void ExportGPX | ( | wxWindow * | parent, |
| bool | bviz_only = false, |
||
| bool | blayer = false |
||
| ) |
Definition at line 2597 of file navutil.cpp.
| bool ExportGPXRoutes | ( | wxWindow * | parent, |
| RouteList * | pRoutes, | ||
| const wxString | suggestedName = "routes" |
||
| ) |
Definition at line 2487 of file navutil.cpp.
| bool ExportGPXTracks | ( | wxWindow * | parent, |
| std::vector< Track * > * | pRoutes, | ||
| const wxString | suggestedName = "tracks" |
||
| ) |
Definition at line 2524 of file navutil.cpp.
| bool ExportGPXWaypoints | ( | wxWindow * | parent, |
| RoutePointList * | pRoutePoints, | ||
| const wxString | suggestedName = "waypoints" |
||
| ) |
Definition at line 2560 of file navutil.cpp.
| wxString formatAngle | ( | double | angle | ) |
Definition at line 3067 of file navutil.cpp.
| wxDateTime fromUsrDateTime | ( | const wxDateTime | ts, |
| const int | format, | ||
| const double | lon = INFINITY - INFINITY |
||
| ) |
Converts a timestamp from a user's preferred time format to UTC.
This function is the inverse of toUsrDateTime, transforming a timestamp from the specified format back to UTC. It handles Universal Time (UTC), Local Mean Time (LMT) based on longitude, and Local time based on the user's system timezone.
| ts | The input timestamp in the specified format. |
| format | The input timestamp format: 0 = UTC, 1 = Local@PC, 2 = LMT@Location, 3 = Global settings. |
| lon | The longitude for LMT calculation. Default is NaN. |
Definition at line 2964 of file navutil.cpp.
| double fromUsrSpeed | ( | double | usr_speed, |
| int | unit = -1 |
||
| ) |
Definition at line 3005 of file navutil.cpp.
| double fromUsrTemp | ( | double | usr_temp, |
| int | unit = -1 |
||
| ) |
Definition at line 3050 of file navutil.cpp.
| double fromUsrWindSpeed | ( | double | usr_wspeed, |
| int | unit = -1 |
||
| ) |
Definition at line 3027 of file navutil.cpp.
| wxString GetLayerName | ( | int | id | ) |
Definition at line 145 of file navutil.cpp.
| void ImportFileArray | ( | const wxArrayString & | file_array, |
| bool | islayer, | ||
| bool | isPersistent, | ||
| wxString | dirpath | ||
| ) |
Definition at line 2750 of file navutil.cpp.
| void navutil::InitGlobals | ( | ) |
Definition at line 134 of file navutil.cpp.
| bool LogMessageOnce | ( | const wxString & | msg | ) |
Definition at line 2905 of file navutil.cpp.
| Route * RouteExists | ( | const wxString & | guid | ) |
Definition at line 1562 of file nav_object_database.cpp.
Definition at line 1569 of file nav_object_database.cpp.
| void SwitchInlandEcdisMode | ( | bool | Switch | ) |
Definition at line 2855 of file navutil.cpp.
| wxDateTime toUsrDateTime | ( | const wxDateTime | ts, |
| const int | format, | ||
| const double | lon = INFINITY - INFINITY |
||
| ) |
Converts a timestamp from UTC to the user's preferred time format.
This function transforms a timestamp based on the specified format or the global application setting. It supports Universal Time (UTC), Local Mean Time (LMT) based on longitude, and Local time based on the user's system timezone.
| ts | The timestamp to convert, must be in UTC. |
| format | The desired output format: 0 = UTC, 1 = Local@PC, 2 = LMT@Location, 3 = Global settings. |
| lon | The longitude in degrees for LMT calculation (positive for east, negative for west). Default is NaN. |
Definition at line 2924 of file navutil.cpp.
| Track * TrackExists | ( | const wxString & | guid | ) |
Definition at line 1576 of file nav_object_database.cpp.
| void UI_ImportGPX | ( | wxWindow * | parent, |
| bool | islayer = false, |
||
| wxString | dirpath = "", |
||
| bool | isdirectory = true, |
||
| bool | isPersistent = false |
||
| ) |
Definition at line 2682 of file navutil.cpp.
| RoutePoint * WaypointExists | ( | const wxString & | guid | ) |
Definition at line 1538 of file nav_object_database.cpp.
| RoutePoint * WaypointExists | ( | const wxString & | name, |
| double | lat, | ||
| double | lon | ||
| ) |
Definition at line 1523 of file nav_object_database.cpp.
| bool WptIsInRouteList | ( | RoutePoint * | pr | ) |
Definition at line 1547 of file nav_object_database.cpp.
|
extern |
Global instance.
Definition at line 118 of file navutil.cpp.