OpenCPN Partial API docs
Loading...
Searching...
No Matches
Position Class Reference

GNSS Lat/Long container. More...

#include <comm_appmsg.h>

Public Types

enum class  Type {
  NE , NW , SE , SW ,
  Undef
}
 

Public Member Functions

 Position (double _lat, double _lon, Type t)
 Construct a position from positive lat/long values and Position::Type. More...
 
 Position (double _lat, double _lon)
 Construct a position with signed lat/long defining Type. More...
 
 Position ()
 Construct a (0,0) position, type == Undef. More...
 
bool IsValid () const
 
std::string to_string () const
 Return utf string like 65°25,11N 21°12,01E. More...
 

Static Public Member Functions

static Position ParseGGA (const std::string gga)
 Parse a GGA string like "5800.588,N,01145.776,E" as present in GGA and other n0183 messages. More...
 

Public Attributes

const double lat
 
const double lon
 
const Type type
 

Detailed Description

GNSS Lat/Long container.

Definition at line 45 of file comm_appmsg.h.

Member Enumeration Documentation

◆ Type

enum class Position::Type
strong

Definition at line 47 of file comm_appmsg.h.

Constructor & Destructor Documentation

◆ Position() [1/3]

Position::Position ( double  _lat,
double  _lon,
Type  t 
)

Construct a position from positive lat/long values and Position::Type.

Definition at line 71 of file comm_appmsg.cpp.

◆ Position() [2/3]

Position::Position ( double  _lat,
double  _lon 
)

Construct a position with signed lat/long defining Type.

Definition at line 74 of file comm_appmsg.cpp.

◆ Position() [3/3]

Position::Position ( )

Construct a (0,0) position, type == Undef.

Definition at line 77 of file comm_appmsg.cpp.

Member Function Documentation

◆ IsValid()

bool Position::IsValid ( ) const
inline

Definition at line 59 of file comm_appmsg.h.

◆ ParseGGA()

Position Position::ParseGGA ( const std::string  gga)
static

Parse a GGA string like "5800.588,N,01145.776,E" as present in GGA and other n0183 messages.

Returns
Position where IsValid() is false on errors, else true.

Definition at line 134 of file comm_appmsg.cpp.

◆ to_string()

std::string Position::to_string ( ) const

Return utf string like 65°25,11N 21°12,01E.

Definition at line 79 of file comm_appmsg.cpp.

Member Data Documentation

◆ lat

const double Position::lat

Definition at line 64 of file comm_appmsg.h.

◆ lon

const double Position::lon

Definition at line 65 of file comm_appmsg.h.

◆ type

const Type Position::type

Definition at line 66 of file comm_appmsg.h.


The documentation for this class was generated from the following files: