Classes | Functions | Variables
RefreshMap: Disable/Enable map update

Classes

struct  RI_CRefreshMap
 Data structure for the Request "RefreshMap". More...
 

Functions

LRESULT RI_RefreshMap_WriteData (LPARAM, RI_CRefreshMap &)
 Write data to shared memory for "RefreshMap".
 

Variables

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

Detailed Description

Variable Documentation

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

Message ID for the Request "RefreshMap":
RI_MESSAGE_REFRESHMAP

Write Memory:

RI_RefreshMap_WriteData(LPARAM id, RI_CRefreshMap data );

Return Values for RefreshMap:

RI_NOERROR = RefreshMap is enabled
RI_NODESC = RefreshMap is disabled

Description:

Disables or enables the update of the map (only in simulation, tracking and navigation mode).

Example:

#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_RefreshMap::WindowProc ( UINT message , WPARAM wParam , LPARAM lParam )
{
//check messages for answer from RI
if ( message == RI_MESSAGE_REFRESHMAP )
{
if ( (LRESULT)wParam == RI_NOERROR )
//RefreshMap is enabled. errorcode (0)
else if ( (LRESULT)wParam == RI_NODESC )
//RefreshMap is disabled. errorcode (12)
else if ( (LRESULT)wParam == RI_NAVIGATIONNOTACTIVE )
//Navigator is not running or the configuration is not complete. errorcode(3)
}
return CDialog::WindowProc( message, wParam, lParam );
}
void CDlgMFC_RefreshMap::foo()
{
// *** define struct ***
// *** copy data ***
data.m_refresh = true;
//write data to shared memory
LPARAM id = GetUniqueID();
LRESULT sharing_ret = RI_RefreshMap_WriteData( id, data );
if ( sharing_ret != RI_NOERROR )
return;
if ( RI_MESSAGE( RI_MESSAGE_REFRESHMAP, 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