#include <RobotControlPhysicalRobots.h>
Public Member Functions | |
CRobotControlPhysicalRobots () | |
~CRobotControlPhysicalRobots () | |
void | onIdle () |
void | connect (CRobotControlWLANConfiguration &config) |
void | disconnect () |
void | setSelectedRobot (int robot) |
int | getSelectedRobot () const |
bool | isConnected (int robot) const |
bool | isSomeoneConnected () |
Public Attributes | |
DECLARE_SYNC | |
Protected Attributes | |
CRobotControlDebugConnection * | debugConnection [8] |
MessageQueue | queueToRobot [8] |
MessageQueue | queueFromRobot [8] |
int | selectedRobot |
Martin Lötzsch
Definition at line 85 of file RobotControlPhysicalRobots.h.
CRobotControlPhysicalRobots::CRobotControlPhysicalRobots | ( | ) |
Default constructor
Definition at line 17 of file RobotControlPhysicalRobots.cpp.
References debugConnection, getQueues(), queueFromRobot, and queueToRobot.
CRobotControlPhysicalRobots::~CRobotControlPhysicalRobots | ( | ) |
Destructor
Definition at line 25 of file RobotControlPhysicalRobots.cpp.
References debugConnection, and disconnect().
void CRobotControlPhysicalRobots::connect | ( | CRobotControlWLANConfiguration & | config | ) |
Connects all robots contained in config
Definition at line 70 of file RobotControlPhysicalRobots.cpp.
References debugConnection, CRobotControlWLANConfiguration::ipBlue, CRobotControlWLANConfiguration::ipRed, CRobotControlWLANConfiguration::useBlue, CRobotControlWLANConfiguration::useRed, and CRobotControlDebugConnection::wLanIsConnected().
Referenced by CWLANToolBar::OnConnectAll().
void CRobotControlPhysicalRobots::disconnect | ( | ) |
Disconnects all connected robots
Definition at line 95 of file RobotControlPhysicalRobots.cpp.
References debugConnection.
Referenced by CRobotControlMainFrame::OnClose(), CWLANToolBar::OnConnectAll(), and ~CRobotControlPhysicalRobots().
int CRobotControlPhysicalRobots::getSelectedRobot | ( | ) | const |
Returns the selected physical robot. If -1, then no robot is selected.
Definition at line 42 of file RobotControlPhysicalRobots.cpp.
References selectedRobot.
Referenced by CRobotControlQueues::isFromSelectedOrUndefinedRobot(), onIdle(), and CWLANToolBar::OnSelect().
bool CRobotControlPhysicalRobots::isConnected | ( | int | robot | ) | const |
return whether a certain robot is connected via WLAN
Definition at line 47 of file RobotControlPhysicalRobots.cpp.
References debugConnection.
Referenced by isSomeoneConnected(), and CWLANToolBar::updateUI().
bool CRobotControlPhysicalRobots::isSomeoneConnected | ( | ) |
return whether at least one robot is connected and select that if no one else is selected
Definition at line 51 of file RobotControlPhysicalRobots.cpp.
References isConnected(), and selectedRobot.
void CRobotControlPhysicalRobots::onIdle | ( | ) |
Should be called when the application is idle, used for communication
Definition at line 104 of file RobotControlPhysicalRobots.cpp.
References CRobotControlQueuesToRobots::allRobots, MessageQueue::clear(), debugConnection, getQueues(), getSelectedRobot(), MessageQueue::moveAllMessages(), queueFromRobot, queueToRobot, CRobotControlQueuesToRobots::robot, CRobotControlQueuesToRobots::selectedRobot, CRobotControlDebugConnection::sendMessageQueue(), and CRobotControlQueues::toPhysical.
Referenced by CRobotControlApp::OnIdle().
void CRobotControlPhysicalRobots::setSelectedRobot | ( | int | robot | ) |
Selects a physical robot. If -1, then no robot is selected.
Definition at line 37 of file RobotControlPhysicalRobots.cpp.
References selectedRobot.
Referenced by CWLANToolBar::OnSelect().
Definition at line 119 of file RobotControlPhysicalRobots.h.
Referenced by connect(), CRobotControlPhysicalRobots(), disconnect(), isConnected(), onIdle(), and ~CRobotControlPhysicalRobots().
Definition at line 89 of file RobotControlPhysicalRobots.h.
MessageQueue CRobotControlPhysicalRobots::queueFromRobot[8] [protected] |
Definition at line 121 of file RobotControlPhysicalRobots.h.
Referenced by CRobotControlPhysicalRobots(), and onIdle().
MessageQueue CRobotControlPhysicalRobots::queueToRobot[8] [protected] |
Definition at line 120 of file RobotControlPhysicalRobots.h.
Referenced by CRobotControlPhysicalRobots(), and onIdle().
int CRobotControlPhysicalRobots::selectedRobot [protected] |
The robot that is connected to the gui
Definition at line 124 of file RobotControlPhysicalRobots.h.
Referenced by getSelectedRobot(), isSomeoneConnected(), and setSelectedRobot().