#include <RobotRemote.h>
Inheritance diagram for CRobotRemoteApp:
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 | |
CRobotRemoteDlg1 * | dlg1 |
CRobotRemoteDlg2 * | dlg2 |
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::SpecialActionID > | buttonMapping |
bool | invertZ |
bool | switchYandZ |
Definition at line 77 of file RobotRemote.h.
different configurations
Definition at line 128 of file RobotRemote.h.
CRobotRemoteApp::CRobotRemoteApp | ( | ) |
Constructor
Definition at line 34 of file RobotRemote.cpp.
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.
message | The message that can be read. |
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] |
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().
The special-actions mapped on joystick-buttons
Definition at line 137 of file RobotRemote.h.
Referenced by onChangeConfiguration(), and sendJoystickData().
The current configuration
Definition at line 131 of file RobotRemote.h.
Referenced by ExitInstance(), InitInstance(), onChangeConfiguration(), and CRobotRemoteDlg1::OnSelchangeConfigurationCombo().
Make this object synchronizable.
Definition at line 80 of file RobotRemote.h.
The first configuration dialog
Definition at line 86 of file RobotRemote.h.
Referenced by InitInstance(), OnIdle(), and updateDialogs().
The second main dialog
Definition at line 89 of file RobotRemote.h.
Referenced by InitInstance(), and updateDialogs().
A message queue for messages from the robot
Definition at line 98 of file RobotRemote.h.
Referenced by OnIdle().
the last received image
Definition at line 116 of file RobotRemote.h.
Referenced by handleMessage().
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().
Determines if a joystick is connected
Definition at line 110 of file RobotRemote.h.
Referenced by InitInstance(), and OnIdle().
Definition at line 141 of file RobotRemote.h.
Referenced by onChangeConfiguration(), and sendJoystickData().
A message queue for messages to the robot
Definition at line 95 of file RobotRemote.h.
Referenced by onChangeConfiguration(), OnIdle(), and sendJoystickData().
Determines if the WLAN connection is established
Definition at line 113 of file RobotRemote.h.
Referenced by InitInstance(), and OnIdle().
A WLAN thread
Definition at line 104 of file RobotRemote.h.
Referenced by ExitInstance(), InitInstance(), CRobotRemoteDlg1::OnConnectButton(), and OnIdle().