robomon Class Reference

Main Robomon application class. More...

#include <robomon.h>

Inheritance diagram for robomon:

Inheritance graph
[legend]
Collaboration diagram for robomon:

Collaboration graph
[legend]

List of all members.

Public Slots

void moveServo (int value)
void frontDoor (int value)
void innerDoor (int value)
void backDoor (int value)
void launchFront (int value)
void stopDopravnikFront ()
void stopDopravnikBack ()
void setDO (int x)
void setIR (unsigned short int)
void setMotor (int)
void setSimul (int)
void setSharpVal (int)
void stopMotors (void)
void changeObstacle (QPointF pos)
void showMap (void)
 This function sets-up the application to load map from shared memory and display it.
void paintMap (void)

Public Member Functions

 robomon (QWidget *parent=0, Qt::WFlags fl=0)
 Robomon class constructor.
 ~robomon ()
 Robomon class destructor.
bool event (QEvent *evet)
 QT event processing.
void setDI (stateDigIn)
 Digital inputs visualization.
void setSharp ()
 Sharp IR sensors data visualization.

Public Attributes

int shared_segment_size
 Size of the shared memory segment.
int segment_id
 ID of the shared memory segment.
PlaygroundScenescene
 Graphics scene used to paint the graphic objects.
robotrob
 Robot graphical object.
sharpShorts sharpyLahve
 Structure for saving sensor values during sensor simulation.
sharpLongs sharpySouper
 Structure for saving sensor values during sensor simulation.
QTimer * timer
 Timer for automatic map display refresh.
_Mapmap
 Pointer to map representation in shared memory.
int size
 Size of a map cell in px.

Protected Slots

void obstackleSimulation (int state)
void simulateObstackles ()

Protected Attributes

QTimer * obstSimTimer
Point simulatedObstacle


Detailed Description

Main Robomon application class.

This class serves to set up GUI.

Definition at line 84 of file robomon.h.


Constructor & Destructor Documentation

robomon::robomon ( QWidget *  parent = 0,
Qt::WFlags  fl = 0 
)

Robomon class constructor.

This is the robomon class constructor. First signals from all the controls on the main panel are connected to appropriate slots. Then the GraphicsScene object is created (scene). When the scene is set up, the playgroung graphics are added to it. After the playground is painted, new instance of robot class is created and the pointer to it is saved to rob. ORTE initialization function is also called from the constructor and pointer to this instance of robomon is passed to it. In the end, all servos are set to initial position.

Definition at line 86 of file robomon.cpp.

References stateServa::backDoor, backDoor(), changeObstacle(), stateServa::frontDoor, frontDoor(), Ui_Form::gvPlayground, stateServa::innerDoor, innerDoor(), launchFront(), moveServo(), obstackleSimulation(), rob, scene, setDO(), setMotor(), setSharpVal(), setSimul(), Ui_Form::setupUi(), showMap(), stopDopravnikBack(), stopDopravnikFront(), stopMotors(), stateServa::transporterFront, and stateServa::transporterInner.

Here is the call graph for this function:

robomon::~robomon (  ) 

Robomon class destructor.

This is the robomon class destructor. It is used to detach the shared memory segment and to destroy ORTE application domain.

Definition at line 154 of file robomon.cpp.


Member Function Documentation

bool robomon::event ( QEvent *  evet  ) 

QT event processing.

This function serves for processing of all QT events. If the event is one of user defined ones, appropriate function is called to process it, otherwise the event is passed on to the QT engine.

See also:
setIR(), setSharp(), setDI(), paintMap()

Definition at line 19 of file robomon.cpp.

References robot::moveRobot(), position::phi, rob, setDI(), setIR(), setSharp(), Ui_Form::tbPhi, Ui_Form::tbX, Ui_Form::tbY, position::x, and position::y.

Here is the call graph for this function:

void robomon::setDI ( stateDigIn  stateDI  ) 

Digital inputs visualization.

This function sets the checkboxes that represent digital inputs according DI data received from ORTE. It is called from event() when EVENT_DI is received (from DI subscriber callback from ORTE).

See also:
event()

Definition at line 54 of file robomon.cpp.

References Ui_Form::cbDI0, Ui_Form::cbDI1, Ui_Form::cbDI2, Ui_Form::cbDI3, Ui_Form::cbDI4, Ui_Form::cbDI5, Ui_Form::cbDI6, Ui_Form::cbDI7, and stateDigIn::state.

Referenced by event().

Here is the caller graph for this function:

void robomon::setSharp (  ) 

Sharp IR sensors data visualization.

This function sets the progress bars that represent IR sensors values according to data received from ORTE. It is called from event() when EVENT_SHARP is received (from sharp data subscriber from ORTE).

See also:
event()

Definition at line 248 of file robomon.cpp.

References sharpLongs::longSharpDist1, sharpLongs::longSharpDist2, sharpLongs::longSharpDist3, Ui_Form::pbSharpLong1, Ui_Form::pbSharpLong2, Ui_Form::pbSharpLong3, Ui_Form::pbSharpShort1, Ui_Form::pbSharpShort2, Ui_Form::pbSharpShort3, Ui_Form::pbSharpShort4, sharpShorts::short1, sharpShorts::short2, sharpShorts::short3, sharpShorts::short4, Ui_Form::tbSharpLong1, Ui_Form::tbSharpLong2, Ui_Form::tbSharpLong3, Ui_Form::tbSharpShort1, Ui_Form::tbSharpShort2, Ui_Form::tbSharpShort3, and Ui_Form::tbSharpShort4.

Referenced by event().

Here is the caller graph for this function:

void robomon::showMap ( void   )  [slot]

This function sets-up the application to load map from shared memory and display it.

The function finds out the size of map square representation on the screen (in px) and the size of the shared memory segment. Then the function tries to get the shm id and in case of failure an error message is displayed. If the function could get the segment id (segment_id), the segment is attached to map pointer.

Definition at line 309 of file robomon.cpp.

References MAP_HEIGHT, MAP_WIDTH, paintMap(), segment_id, shared_segment_size, SHM_MAP_KEY, size, and timer.

Referenced by robomon().


Member Data Documentation

int robomon::shared_segment_size

Size of the shared memory segment.

The size computed in showMap() function as a size of char variable multiplied by MAP_WIDTH and MAP_HEIGHT from map_definitions.h

Definition at line 93 of file robomon.h.

Referenced by showMap().

int robomon::segment_id

ID of the shared memory segment.

Shared memory segment ID is saved to this variable.

See also:
showMap()

Definition at line 100 of file robomon.h.

Referenced by showMap().

PlaygroundScene* robomon::scene

Graphics scene used to paint the graphic objects.

This scene is painted in gvPlaygroud GraphicsView. All the graphical obejcts to be painted should be added to this scene.

Definition at line 106 of file robomon.h.

Referenced by paintMap(), and robomon().

robot* robomon::rob

Robot graphical object.

This is a pointer to the graphical representation of robot on the playground.

Definition at line 112 of file robomon.h.

Referenced by event(), and robomon().

sharpShorts robomon::sharpyLahve

Structure for saving sensor values during sensor simulation.

This structure is used to save IR sensor values from sliding bars during sensor simulation. It is then published on ORTE.

Definition at line 118 of file robomon.h.

Referenced by setSharpVal().

sharpLongs robomon::sharpySouper

Structure for saving sensor values during sensor simulation.

This structure is used to save IR sensor values from sliding bars during sensor simulation. It is then published on ORTE.

Definition at line 124 of file robomon.h.

Referenced by obstackleSimulation(), setSharpVal(), and simulateObstackles().

QTimer* robomon::timer

Timer for automatic map display refresh.

This timer serves for periodic calling of map display refreshing function (paintMap()). It is initialized in showMap(). Timer value is set to 2000 miliseconds.

Definition at line 130 of file robomon.h.

Referenced by showMap().

_Map* robomon::map

Pointer to map representation in shared memory.

This pointer contains the address of the map variable in shared memory. It is initialized in showMap().

Definition at line 136 of file robomon.h.

int robomon::size

Size of a map cell in px.

This variable contains size of map cells on the screen in px. It is calculated as PG_X / MAP_WIDTH in showMap() and is used in paintMap().

See also:
showMap(), paintMap()

Definition at line 144 of file robomon.h.

Referenced by paintMap(), and showMap().


The documentation for this class was generated from the following files:
Generated on Thu Sep 13 11:28:29 2007 for DCE-Eurobot by  doxygen 1.5.3