Home · All Commands · First Steps · Tutorials · Demos · FAQ
 

Remote Interface Documentation

Classes | Functions | Variables

NaviControls: Zoom in/out or skip station

Classes

struct  RI_CNaviControls
 Data structure for the Request "NaviControls". More...

Functions

LRESULT RI_NaviControls_WriteData (LPARAM, RI_CNaviControls &)
 Write data to shared memory for "NaviControls".

Variables

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

Variable Documentation

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

Message ID for the Request "NaviControls":
RI_MESSAGE_NAVICONTROLS

Write Memory:

RI_NaviControls_WriteData(LPARAM id, RI_CNaviControls data );

Return Values for NaviControls:

RI_NOERROR = transfer to Control.
RI_NODESC = Navigator is not in Navigation Mode.

Description:

Zoom in, out or skip station in navigation, simulation or tracking 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() ) ) 
        return RI_NAVIGATIONNOTACTIVE;
    //send the request
    PostMessage( RI_GetTNS(), request, WPARAM(h_client), id );
    return RI_NOERROR;
}

LRESULT CDlgMFC_NaviControls::WindowProc ( UINT  message , WPARAM  wParam , LPARAM  lParam )
{
    //check messages for answer from RI
    if ( message == RI_MESSAGE_NAVICONTROLS )
    {
        if ( (LRESULT)wParam == RI_NOERROR )
            //transfer to Control. errorcode (0)
        else if ( (LRESULT)wParam == RI_NODESC )
            //Navigator is not in Navigation Mode. 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_NaviControls::foo()
{
    // *** define struct ***
    RI_CNaviControls data;
    // *** copy data ***
    data.m_value = 2;
    //m_value = 0 = Zoomout
    //m_value = 1 = Zoomin
    //m_value = 2 = SkipStation
    //write data to shared memory
    LPARAM id = GetUniqueID();
    LRESULT sharing_ret = RI_NaviControls_WriteData( id, data );
    if ( sharing_ret != RI_NOERROR ) 
        return;
    if ( RI_MESSAGE( RI_MESSAGE_NAVICONTROLS, GetSafeHwnd(), id ) == RI_NOERROR )
        //message sending succeeded
    else
        //navigation software not running
}

© PTV AG 2011 Generated on Fri Oct 14 2011 10:17:32 for RI by doxygen 1.7.1