|
OpenCPN Partial API docs
|
Implement nav_util.h – Utility Functions. More...
#include "gl_headers.h"#include <wx/wxprec.h>#include <algorithm>#include <stdlib.h>#include <time.h>#include <locale>#include <list>#include <limits>#include <string>#include <wx/wx.h>#include <wx/bmpcbox.h>#include <wx/dir.h>#include "wx/dirctrl.h"#include <wx/filename.h>#include <wx/graphics.h>#include <wx/image.h>#include <wx/listbook.h>#include <wx/listimpl.cpp>#include <wx/progdlg.h>#include <wx/sstream.h>#include <wx/tglbtn.h>#include <wx/timectrl.h>#include <wx/tokenzr.h>#include "o_sound/o_sound.h"#include "model/ais_decoder.h"#include "model/ais_state_vars.h"#include "model/cmdline.h"#include "model/config_vars.h"#include "model/conn_params.h"#include "model/cutil.h"#include "model/geodesic.h"#include "model/georef.h"#include "model/gui_vars.h"#include "model/idents.h"#include "model/multiplexer.h"#include "model/nav_object_database.h"#include "model/navutil_base.h"#include "model/navobj_db.h"#include "model/own_ship.h"#include "model/plugin_comm.h"#include "model/route.h"#include "model/routeman.h"#include "model/select.h"#include "model/track.h"#include "ais.h"#include "canvas_config.h"#include "chartbase.h"#include "chartdb.h"#include "chcanv.h"#include "cm93.h"#include "config.h"#include "config_mgr.h"#include "displays.h"#include "dychart.h"#include "font_mgr.h"#include "layer.h"#include "navutil.h"#include "nmea0183.h"#include "observable_globvar.h"#include "ocpndc.h"#include "ocpn_plugin.h"#include "ocpn_platform.h"#include "s52plib.h"#include "s52utils.h"#include "s57_load.h"#include "snd_config.h"#include "styles.h"#include "top_frame.h"#include "user_colors.h"Go to the source code of this file.
Macros | |
| #define | NAN (*(double *)&lNaN) |
Functions | |
| void | navutil::InitGlobals () |
| void | navutil::DeinitGlobals () |
| wxString | GetLayerName (int id) |
| void | appendOSDirSlash (wxString *pString) |
| int | BackupDatabase (wxWindow *parent) |
| bool | ExportGPXRoutes (wxWindow *parent, RouteList *pRoutes, const wxString suggestedName) |
| bool | ExportGPXTracks (wxWindow *parent, std::vector< Track * > *pTracks, const wxString suggestedName) |
| bool | ExportGPXWaypoints (wxWindow *parent, RoutePointList *pRoutePoints, const wxString suggestedName) |
| void | ExportGPX (wxWindow *parent, bool bviz_only, bool blayer) |
| void | UI_ImportGPX (wxWindow *parent, bool islayer, wxString dirpath, bool isdirectory, bool isPersistent) |
| void | ImportFileArray (const wxArrayString &file_array, bool islayer, bool isPersistent, wxString dirpath) |
| void | SwitchInlandEcdisMode (bool Switch) |
| wxString | FormatGPXDateTime (wxDateTime dt) |
| bool | LogMessageOnce (const wxString &msg) |
| wxDateTime | toUsrDateTime (const wxDateTime ts, const int format, const double lon) |
| Converts a timestamp from UTC to the user's preferred time format. | |
| wxDateTime | fromUsrDateTime (const wxDateTime ts, const int format, const double lon) |
| Converts a timestamp from a user's preferred time format to UTC. | |
| double | fromUsrSpeed (double usr_speed, int unit) |
| double | fromUsrWindSpeed (double usr_wspeed, int unit) |
| double | fromUsrTemp (double usr_temp, int unit) |
| wxString | formatAngle (double angle) |
| 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 window_back_color, wxColour ctrl_back_color, wxColour text_color, wxColour uitext, wxColour udkrd, wxColour gridline) |
Variables | |
| MyConfig * | pConfig |
| Global instance. | |
| wxArrayString * | navutil::pMessageOnceArray |
Implement nav_util.h – Utility Functions.
Definition in file navutil.cpp.
| #define NAN (*(double *)&lNaN) |
Definition at line 127 of file navutil.cpp.
| void AlphaBlending | ( | ocpnDC & | dc, |
| int | x, | ||
| int | y, | ||
| int | size_x, | ||
| int | size_y, | ||
| float | radius, | ||
| wxColour | color, | ||
| unsigned char | transparency | ||
| ) |
Definition at line 3081 of file navutil.cpp.
| void appendOSDirSlash | ( | wxString * | pString | ) |
Definition at line 483 of file base_platform.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 | window_back_color, | ||
| wxColour | ctrl_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, | ||
| bool | blayer | ||
| ) |
Definition at line 2597 of file navutil.cpp.
| bool ExportGPXRoutes | ( | wxWindow * | parent, |
| RouteList * | pRoutes, | ||
| const wxString | suggestedName | ||
| ) |
Definition at line 2487 of file navutil.cpp.
| bool ExportGPXTracks | ( | wxWindow * | parent, |
| std::vector< Track * > * | pTracks, | ||
| const wxString | suggestedName | ||
| ) |
Definition at line 2524 of file navutil.cpp.
| bool ExportGPXWaypoints | ( | wxWindow * | parent, |
| RoutePointList * | pRoutePoints, | ||
| const wxString | suggestedName | ||
| ) |
Definition at line 2560 of file navutil.cpp.
| wxString formatAngle | ( | double | angle | ) |
Definition at line 3067 of file navutil.cpp.
| wxString FormatGPXDateTime | ( | wxDateTime | dt | ) |
Definition at line 2896 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 | ||
| ) |
Definition at line 3005 of file navutil.cpp.
| double fromUsrTemp | ( | double | usr_temp, |
| int | unit | ||
| ) |
Definition at line 3050 of file navutil.cpp.
| double fromUsrWindSpeed | ( | double | usr_wspeed, |
| int | unit | ||
| ) |
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.
| 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.
| void UI_ImportGPX | ( | wxWindow * | parent, |
| bool | islayer, | ||
| wxString | dirpath, | ||
| bool | isdirectory, | ||
| bool | isPersistent | ||
| ) |
Definition at line 2682 of file navutil.cpp.
| MyConfig* pConfig |
Global instance.
Definition at line 118 of file navutil.cpp.
| wxArrayString * navutil::pMessageOnceArray |
Definition at line 132 of file navutil.cpp.