Classes | Functions | Variables
GPSInfo: Get GPS information

Classes

struct  RI_CGPSInfo
 Data structure for the Request "GPSInfo". More...
 

Functions

LRESULT RI_GPSInfo_ReadData (LPARAM, RI_CGPSInfo &)
 Read data from shared memory for "GPS Info".
 

Variables

const UINT RI_MESSAGE_GPSINFO = RegisterWindowMessage(TEXT("RI_MESSAGE_GPSINFO"))
 

Detailed Description

Variable Documentation

const UINT RI_MESSAGE_GPSINFO = RegisterWindowMessage(TEXT("RI_MESSAGE_GPSINFO"))

Message ID for the Request "GPS info":
RI_MESSAGE_GPSINFO

    <H3>Read Memory:</H3>
    RI_GPSInfo_ReadData(LPARAM id, RI_CGPSInfo data );
    <BR>
    <H3>Return Values for InverseGeoCoding:</H3>
    RI_NOERROR = GPS Signal ok<BR>
    RI_NOFIX = No GPS fix<BR>
    RI_NOTAV = No GPS Device available<BR><BR>

    <h2>Description:</h2>Returns GPS- and navigation information like position, velocity and time to target (see data structure for
    more details).
<h3>Returns a single package</h3>
    <H2>Example:</H2>
#define USE_LOADLIBRARY
#include "TNSRemoteInterfaceDll.h"
LPARAM GetUniqueID()
{
//generate unique ID
static LPARAM id = 0;
if (++id == 0) ++id; // do not use 0 !!!!!
return id;
}
inline LRESULT RI_MESSAGE( const UINT request, HWND h_client, LPARAM id )
{
//check if RI handle is valid
if ( !IsWindow( RI_GetTNS() ) )
//send the request
PostMessage( RI_GetTNS(), request, WPARAM(h_client), id );
return RI_NOERROR;
}
LRESULT CDlgMFC_GPSInfo::WindowProc ( UINT message , WPARAM wParam , LPARAM lParam )
{
//check messages for answer from RI
if ( message == RI_MESSAGE_GPSINFO )
{
if ( (LRESULT)wParam == RI_NOFIX )
//No Fix. errorcode (18)
else if ( (LRESULT)wParam == RI_NOTAV)
//No GPS Device available. errorcode (19)
else if ( (LRESULT)wParam == RI_NOERROR)
{
//read data from Shared Memory
LRESULT read_suc = RI_GPSInfo_ReadData( lParam, data );
//GPS Signal ok.errorcode (0)
TRACE(TEXT("Geodec Pos: %i,%i"), data.m_geodec_x, data.m_geodec_y);
TRACE(TEXT("Mercator Pos: %i,%i"), data.m_mercator_x, data.m_mercator_y);
TRACE(TEXT("Longitude: %i"), data.m_lon);
TRACE(TEXT("Latitude: %i"), data.m_lat);
TRACE(TEXT("Course: %i"), data.m_course);
TRACE(TEXT("Speed: %i"), data.m_velocity);
TRACE(TEXT("Satellites: %i"), data.m_noSatsUsed);
TRACE(TEXT("Altitude: %i"), data.m_Altitude);
TRACE(TEXT("Satellite Date: %s"), data.m_date);
TRACE(TEXT("Satellite Time: %s"), data.m_time);
TRACE(TEXT("Last Valid Pos: %i"), data.m_lastdata);
//read data, when navigation is running (data.flag == true)
if (data.flag == true)
{
TRACE(TEXT("Current Street: %s"), data.m_street);
TRACE(TEXT("Target: %s"), data.m_target);
TRACE(TEXT("Roadmatched Mercator Pos: %s"), data.n_mercator);
TRACE(TEXT("Roadmatched Geodec. Pos: %i,%i"), data.n_geodec_x, data.n_geodec_y);
TRACE(TEXT("Distance to Target: %i"), data.m_disttotarget);
TRACE(TEXT("Time to Target: %i"), data.m_timetotarget);
TRACE(TEXT("Traffic Delay to Target: %i"), data.m_trafficDelayToTarget);
TRACE(TEXT("SpeedLimit: %i"), data.m_SpeedLimit);
}
}
}
return CDialog::WindowProc( message, wParam, lParam );
}
void CDlgMFC_GPSInfo::foo()
{
LPARAM id = GetUniqueID();
if ( RI_MESSAGE( RI_MESSAGE_GPSINFO, GetSafeHwnd(), id ) == RI_NOERROR )
//message sending succeeded
else
//navigation software not running
}

© PTV Group 2020 Generated on Wed Apr 15 2020 12:47:52 for by doxygen 1.8.8