CRobotRemoteApp Class Reference

#include <RobotRemote.h>

Inheritance diagram for CRobotRemoteApp:

MessageHandler List of all members.

Public Types

 noImages
 someImages
 allImages
enum  Configuration { noImages, someImages, allImages }

Public Member Functions

 CRobotRemoteApp ()
void updateDialogs ()
void OnIdle ()
void sendJoystickData (JOYINFOEX &ji)
void onChangeJoystick ()
void onChangeConfiguration ()
virtual BOOL InitInstance ()
virtual int ExitInstance ()
virtual BOOL OnIdle (LONG lCount)
virtual bool handleMessage (InMessage &message)

Public Attributes

 DECLARE_SYNC
CRobotRemoteDlg1dlg1
CRobotRemoteDlg2dlg2
MessageQueue toRobot
MessageQueue fromRobot
unsigned long ip
CRobotRemoteWLanThread wlanThread
bool joystickIsConnected
bool wlanIsConnected
Image image
unsigned char joystick
enum Configuration configuration
std::map< int, SpecialActionRequest::SpecialActionIDbuttonMapping
bool invertZ
bool switchYandZ

Detailed Description

The application class of RobotRemote

Definition at line 77 of file RobotRemote.h.


Member Enumeration Documentation

enum CRobotRemoteApp::Configuration

different configurations

Enumerator:
noImages 
someImages 
allImages 

Definition at line 128 of file RobotRemote.h.


Constructor & Destructor Documentation

CRobotRemoteApp::CRobotRemoteApp (  ) 

Constructor

Definition at line 34 of file RobotRemote.cpp.


Member Function Documentation

int CRobotRemoteApp::ExitInstance (  )  [virtual]

Definition at line 342 of file RobotRemote.cpp.

References configuration, ip, CRobotRemoteWLanThread::wlanDisconnect(), and wlanThread.

bool CRobotRemoteApp::handleMessage ( InMessage message  )  [virtual]

Called from a MessageQueue to distribute messages. Use message.getMessageID to decide if the message is relavant for the MesssageHandler derivate. Use message.bin, message.text or message.config as In streams to get the data from.

Parameters:
message The message that can be read.
Returns:
true if the message was read (handled).

Implements MessageHandler.

Definition at line 180 of file RobotRemote.cpp.

References ASSERT, InMessage::bin, InMessage::getMessageID(), InMessage::getMessageSize(), idImage, idJPEGImage, idText, image, PRINT, InTextMessage::readAll(), InMessage::text, JPEGImage::toImage(), and updateDialogs().

BOOL CRobotRemoteApp::InitInstance (  )  [virtual]

Definition at line 143 of file RobotRemote.cpp.

References configuration, dlg1, dlg2, FALSE, IDP_SOCKETS_INIT_FAILED, ip, joystickIsConnected, onChangeConfiguration(), CRobotRemoteWLanThread::wlanDisconnect(), wlanIsConnected, and wlanThread.

void CRobotRemoteApp::onChangeConfiguration (  ) 

is called when configuration changed

Definition at line 47 of file RobotRemote.cpp.

References allImages, DebugKey::always, OutMessage::bin, buttonMapping, configuration, debugKeyTable, DebugKey::disabled, InStream< S, R >::eof(), SolutionRequest::errorWhileReading, DebugKey::every_n_ms, InFile::exists(), OutMessage::finishMessage(), getLocation(), SpecialActionRequest::getSpecialActionIDFromName(), idDebugKeyTable, idQueueFillRequest, idSolutionRequest, invertZ, QueueFillRequest::mode, noImages, SpecialActionRequest::numOfSpecialAction, MessageQueue::out, QueueFillRequest::overwriteOlder, DebugKeyTable::sendJPEGImage, DebugKeyTable::set(), someImages, switchYandZ, and toRobot.

Referenced by InitInstance(), and CRobotRemoteDlg1::OnSelchangeConfigurationCombo().

void CRobotRemoteApp::onChangeJoystick (  ) 

is called when joystick changed

BOOL CRobotRemoteApp::OnIdle ( LONG  lCount  )  [virtual]

Definition at line 211 of file RobotRemote.cpp.

References OnIdle().

void CRobotRemoteApp::OnIdle (  ) 

Idle Processing

Definition at line 224 of file RobotRemote.cpp.

References MessageQueue::clear(), dlg1, fromRobot, MessageQueue::handleAllMessages(), Thread< T >::isRunning(), joystick, joystickIsConnected, MessageQueue::moveAllMessages(), CRobotRemoteWLanThread::queueToRobot, sendJoystickData(), SYNC, SYNC_WITH, toRobot, updateDialogs(), wlanIsConnected, CRobotRemoteWLanThread::wlanIsConnected(), and wlanThread.

Referenced by OnIdle(), CRobotRemoteDlg2::OnTimer(), and CRobotRemoteDlg1::OnTimer().

void CRobotRemoteApp::sendJoystickData ( JOYINFOEX &  ji  ) 

sends the joystick data to the robot

Definition at line 289 of file RobotRemote.cpp.

References OutMessage::bin, buttonMapping, d, OutMessage::finishMessage(), idJoystickData, invertZ, numOfJoystickButtons, SpecialActionRequest::numOfSpecialAction, MessageQueue::out, MessageQueue::removeRepetitions(), switchYandZ, and toRobot.

Referenced by OnIdle().

void CRobotRemoteApp::updateDialogs (  ) 

updates the visible of the both dialogs

Definition at line 218 of file RobotRemote.cpp.

References dlg1, dlg2, CRobotRemoteDlg2::update(), and CRobotRemoteDlg1::update().

Referenced by handleMessage(), and OnIdle().


Member Data Documentation

std::map<int,SpecialActionRequest::SpecialActionID> CRobotRemoteApp::buttonMapping

The special-actions mapped on joystick-buttons

Definition at line 137 of file RobotRemote.h.

Referenced by onChangeConfiguration(), and sendJoystickData().

enum Configuration CRobotRemoteApp::configuration

The current configuration

Definition at line 131 of file RobotRemote.h.

Referenced by ExitInstance(), InitInstance(), onChangeConfiguration(), and CRobotRemoteDlg1::OnSelchangeConfigurationCombo().

CRobotRemoteApp::DECLARE_SYNC

Make this object synchronizable.

Definition at line 80 of file RobotRemote.h.

CRobotRemoteDlg1* CRobotRemoteApp::dlg1

The first configuration dialog

Definition at line 86 of file RobotRemote.h.

Referenced by InitInstance(), OnIdle(), and updateDialogs().

CRobotRemoteDlg2* CRobotRemoteApp::dlg2

The second main dialog

Definition at line 89 of file RobotRemote.h.

Referenced by InitInstance(), and updateDialogs().

MessageQueue CRobotRemoteApp::fromRobot

A message queue for messages from the robot

Definition at line 98 of file RobotRemote.h.

Referenced by OnIdle().

Image CRobotRemoteApp::image

the last received image

Definition at line 116 of file RobotRemote.h.

Referenced by handleMessage().

bool CRobotRemoteApp::invertZ

The configuration for manipulating axis

Definition at line 140 of file RobotRemote.h.

Referenced by onChangeConfiguration(), and sendJoystickData().

unsigned long CRobotRemoteApp::ip

The ip address of the robot

Definition at line 101 of file RobotRemote.h.

Referenced by ExitInstance(), and InitInstance().

unsigned char CRobotRemoteApp::joystick

the current joystick

Definition at line 122 of file RobotRemote.h.

Referenced by OnIdle(), and CRobotRemoteDlg1::OnSelchangeJoystickCombo().

bool CRobotRemoteApp::joystickIsConnected

Determines if a joystick is connected

Definition at line 110 of file RobotRemote.h.

Referenced by InitInstance(), and OnIdle().

bool CRobotRemoteApp::switchYandZ

Definition at line 141 of file RobotRemote.h.

Referenced by onChangeConfiguration(), and sendJoystickData().

MessageQueue CRobotRemoteApp::toRobot

A message queue for messages to the robot

Definition at line 95 of file RobotRemote.h.

Referenced by onChangeConfiguration(), OnIdle(), and sendJoystickData().

bool CRobotRemoteApp::wlanIsConnected

Determines if the WLAN connection is established

Definition at line 113 of file RobotRemote.h.

Referenced by InitInstance(), and OnIdle().

CRobotRemoteWLanThread CRobotRemoteApp::wlanThread

A WLAN thread

Definition at line 104 of file RobotRemote.h.

Referenced by ExitInstance(), InitInstance(), CRobotRemoteDlg1::OnConnectButton(), and OnIdle().


The documentation for this class was generated from the following files:
Generated on Thu Dec 7 01:24:32 2006 for DT2005.panorama by  doxygen 1.4.7