direcs  2012-09-30
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Gui Class Reference

The class for all GUI actions. More...

#include <gui.h>

Collaboration diagram for Gui:

List of all members.

Public Slots

void appendLog (QString text, bool CR=true, bool sayIt=false, bool addTimestamp=true)
void appendNetworkLog (QString text, bool CR=true, bool sayIt=false)
void appendSerialLog (QString text, bool CR=true)
void disableCompass ()
void disableFaceDetection ()
void hideCameraControls ()
void setCamImage (QImage *image)
void setCamImageDepth (QImage *image)
void setCamImageOpenCV (QImage *image)
void setConsoleMode (bool state)
void setLabelMasterSlave (QString text)
void setLaserscannerAngle (short int laserscanner, int angle)
void setLaserscannerResolution (short int laserscanner, float resolution)
void setLEDCamera (unsigned char state)
void setLEDCompass (unsigned char state)
void setLEDHeartbeat (unsigned char state)
void setLEDJoystick (unsigned char state)
void setLEDLaser (unsigned char state)
void setLEDMasterSlave (unsigned char state)
void setLEDNetwork (unsigned char state)
void setPlotData5 (double *xval, double *yval, int size)
void setPlotData6 (double *xval, double *yval, int size)
void setPlotDataHeartbeat (double *xval, double *yval, int size)
void setRobotControls (bool state)
void showCompassData (float x, float y, float z, float heading)
void showFaceTrackData (int faces, int faceX, int faceY, int faceRadius, int lastFaceX, int lastFaceY)
void showFaceTrackDirection (QString direction)
void showKinectAngle (double angle)
void showLaserFrontAngles (int largestFreeAreaStart, int largestFreeAreaEnd, int centerOfFreeWay, float width)
void showPreferredDirection (QString direction)
void showThreshold (int threshold)
void systemerrorcatcher (int errorlevel)

Signals

void demo (bool state)
void drive (const int command)
void enableFaceDetection (int state)
void enableFaceTracking (int state)
void enableRemoteControlListening (bool state)
void initCircuit ()
void initServos ()
void mediaSkip ()
void resetDrivenDistance (int sensor)
void resetKinectAngle ()
void setKinectAngle (double i)
void setKinectVideoMode (int mode)
void setThreshold (int value)
void shutdown ()
void simulate (bool state)
void speak (QString text)
void test ()
void writeLaserData ()

Public Member Functions

 Gui (bool useSmallGUI, SettingsDialog *s, JoystickDialog *j, AboutDialog *a, QMainWindow *parent=0)
void showAlarm (short int sensor, bool state)
void showDistanceGraphical (int sensor, int distance)
void showDrivenDistance (int sensor, int distance)
void showMotorStatus (int motor, bool power, int direction)
void showVoltage (int sensor, float voltage)
 ~Gui ()

Protected Slots

void on_actionAbout_activated ()
void on_actionAll_activated ()
void on_actionCamera_activated ()
void on_actionDemo_activated ()
void on_actionDrive_activated ()
void on_actionExit_activated ()
void on_actionJoystick_activated ()
void on_actionLog_activated ()
void on_actionMediaSkip_activated ()
void on_actionRemote_activated ()
void on_actionReset_activated ()
void on_actionSaveLaserData_activated ()
void on_actionSettings_activated ()
void on_actionSimulate_activated ()
void on_actionState_activated ()
void on_actionTest_activated ()
void on_actionVoltage_activated ()

Protected Member Functions

void closeEvent (QCloseEvent *event)

Private Slots

void on_actionResetDrivenDistance_activated ()
void on_btnKinectResetAngle_clicked ()
void on_btnSavePicture_clicked ()
void on_checkBoxFaceDetection_stateChanged (int)
void on_checkBoxFaceTracking_stateChanged (int)
void on_checkBoxMirror_stateChanged (int)
void on_sliderThreshold_valueChanged (int)
void on_spinBoxKinectAngle_valueChanged (int i)
void processCam ()
void saveCamImage (void)

Private Member Functions

void init ()
void initCompassView ()
void initPlots ()
QString removeHtml (QString text)

Private Attributes

AboutDialogaboutDialog
QPixmap cameraPicToSave
QColor colorGraphicsSceneBackground
QColor colorHelpLine
QColor colorHelpLineText
QColor colorLaserCenterDrivingDirection
QColor colorLaserFreeWay
QColor colorLaserIgnoreArea
QColor colorLaserObstacle
QColor colorLaserPreferredDrivingDirection
bool consoleMode
QwtPlotCurve curveCurrent1
QwtPlotCurve curveCurrent2
QwtPlotCurve curveCurrent3
QwtPlotCurve curveCurrent4
QwtPlotCurve curveHeartbeat
QwtPlotCurve curveVoltage1
QwtPlotCurve curveVoltage2
QColor gridColor
QwtPlotGrid gridCurrent1
QwtPlotGrid gridCurrent2
QwtPlotGrid gridHeartbeat
QwtPlotGrid gridVoltage1
QwtPlotGrid gridVoltage2
JoystickDialogjoystickDialog
QColor labelFillColorBlue
QColor labelFillColorGreen
QColor labelFillColorRed
int laserscannerAngleFront
int laserscannerAngleRear
 this values holds the range of the laserscanner viewing angle. e.g. 180 oder 270 degrees. just for reading the value here.
float laserscannerResolutionFront
 this values holds the range of the laserscanner viewing angle. e.g. 180 oder 270 degrees. just for reading the value here.
float laserscannerResolutionRear
 this values holds the resolution of the laserscanner.
int mLargestFreeAreaEndFront
 this stores the free area angle from the front laser. Got it from
int mLargestFreeAreaEndRear
 this stores the free area angle from the rear laser. Got it from
int mLargestFreeAreaStartFront
 this values holds the resolution of the laserscanner.
int mLargestFreeAreaStartRear
 this stores the free area angle from the front laser. Got it from
QDateTime now
 is enabled if the argument 'console' was passed by command-line. Sends all GUI messages to the command line.
QPixmap pixmap
 this stores the free area angle from the rear laser. Got it from
QwtPlot qwtPlotCurrent1
QwtPlot qwtPlotCurrent2
QwtPlot qwtPlotHeartbeat
QwtPlot qwtPlotVoltage1
QwtPlot qwtPlotVoltage2
bool robotIsOn
SettingsDialogsettingsDialog
 This is the small GUI, when running on the robots small TFT.
QString string
 this is for the timestamp in the logs in the gui
Ui::mainWindow ui
 if true, we will use the large GUI. If false, we will use the small one for fitting on a small onboard TFT. By default this is decided by the local hostname of the system.
Ui::mainWindowSmall uiSmall
 This is the large default GUI, when not running on the robot.
bool useLargeGUI
 Stores the robots (circuits) state.ON or OFF.

Static Private Attributes

static const int ALLMOTORS = 250
 Motor 4 back right.
static const int BACKWARD = 20
 Motor direction (formerly "clockwise")
static const int CENTEROFLARGESTFREEWAY = 3
static const int FITTOFRAMEFACTOR = 45
 theoratically 5 Volt for heartbeat "high"
static const int FORWARD = 10
 Some driving directions and motor directions for the robot.
static const int FREEWAY = 0
 the tags for the laser lines
static const unsigned char GREEN = 2
static const int IGNORETHIS = 4
static const int INITIALLASERYPOSFRONT = 60.0
static const int INITIALLASERYPOSREAR = 60.0
static const int LARGESTFREEWAY = 2
static const short int LASER1 = 1
static const short int LASER2 = 2
static const short int LASER3 = 4
static const short int LASER4 = 8
static const short int LASER5 = 16
static const int LASERDISTANCECIRCLES = 27
 Number of distance semi circles.
static const int LASERDISTANCEDISTANCE = 60
 Distances between the lines to show the laser distances in pixels.
static const int LASERDISTANCEFIRSTCIRCLE = 82
 the size (diameter) of the first (innerst) circle in pixels
static const unsigned char LEDOFF = 0
static const int LEFT = 30
 Motor direction (formerly "counterclockwise".
static const float MAXIMUMPLOTHEARTBEAT = 5.00
 for plot widgets
static const float MAXIMUMPLOTVOLTAGE1 = 18.00
 for progress bars
static const float MAXIMUMPLOTVOLTAGE2 = 26.00
 for plot widgets
static const float MAXIMUMVOLTAGE1 = 18.00
static const float MAXIMUMVOLTAGE2 = 26.00
 for progress bars
static const float MINIMUMVOLTAGE1 = 13.20
static const float MINIMUMVOLTAGE2 = 24.00
static const int MOTOR1 = 210
 Motor direction/power "same like before".
static const int MOTOR1BW = 310
static const int MOTOR1FW = 300
 used for letting the robot getting only one command for all motors (like 'forward all'). This is to reduce commands on the serial line.
static const int MOTOR1OFF = 320
static const int MOTOR2 = 220
 Motor 1 front left.
static const int MOTOR2BW = 340
static const int MOTOR2FW = 330
static const int MOTOR2OFF = 350
static const int MOTOR3 = 230
 Motor 2 front right.
static const int MOTOR3BW = 370
static const int MOTOR3FW = 360
static const int MOTOR3OFF = 380
static const int MOTOR4 = 240
 Motor 3 back left.
static const int MOTOR4BW = 400
static const int MOTOR4FW = 390
static const int MOTOR4OFF = 410
static const short int MOTORSENSOR1 = 0
static const short int MOTORSENSOR2 = 1
static const short int MOTORSENSOR3 = 2
static const short int MOTORSENSOR4 = 3
static const short int NONE = 0
static const int OBSTACLE = 1
static const bool OFF = false
static const bool ON = true
static const int READ_AXIS_X = 500
static const int READ_AXIS_Y = 510
static const int READ_AXIS_Z = 520
static const unsigned char RED = 1
static const int RIGHT = 40
static const int SAME = 200
static const short int SENSOR1 = 1
static const short int SENSOR16 = 256
static const short int SENSOR2 = 2
static const short int SENSOR3 = 4
static const short int SENSOR4 = 8
static const short int SENSOR5 = 16
static const short int SENSOR6 = 32
static const short int SENSOR7 = 64
static const short int SENSOR8 = 128
static const int SENSORPROGRESSBARMAXIR = 50
static const int SENSORPROGRESSBARMAXUS = 400
static const int START = 70
static const int STARTZOOMLEVEL = 3
static const int STOP = 80
static const int TURNLEFT = 50
static const int TURNRIGHT = 60
static const short int VOLTAGESENSOR1 = 0
static const short int VOLTAGESENSOR2 = 1
static const int WAIT = 90

Detailed Description

The class for all GUI actions.

Author:
Markus Knapp

Definition at line 67 of file gui.h.


Constructor & Destructor Documentation

Gui::Gui ( bool  useSmallGUI,
SettingsDialog s,
JoystickDialog j,
AboutDialog a,
QMainWindow *  parent = 0 
)

Definition at line 24 of file gui.cpp.

Here is the call graph for this function:

Gui::~Gui ( )

Definition at line 174 of file gui.cpp.


Member Function Documentation

void Gui::appendLog ( QString  text,
bool  CR = true,
bool  sayIt = false,
bool  addTimestamp = true 
)
slot

Appends text to the main log in the main window.

Parameters:
textis the text to be displayed.
CRadds a carriage return (CR) to the text, if true (default). This parameter is optional.
sayItIf true, the text is also spoken (default=false). This parameter is optional.
addTimestampIf true, the a timestamp is added in front of the text. This parameter is optional.

Definition at line 309 of file gui.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Gui::appendNetworkLog ( QString  text,
bool  CR = true,
bool  sayIt = false 
)
slot

Append text to the network log in the main window

Parameters:
textis the text to be displayed.
CRadds a carriage return (CR) to the text, if true (default). This parameter is optional!
sayItIf true, the text is also spoken (default=false). This parameter is optional!
See also:
appendLog()

Definition at line 372 of file gui.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Gui::appendSerialLog ( QString  text,
bool  CR = true 
)
slot

Append text to the serial log in the main window

Parameters:
textis the text to be displayed.
CRadds a carriage return (CR) to the text, if true (default). This parameter is optional!

Definition at line 435 of file gui.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Gui::closeEvent ( QCloseEvent *  event)
protected

Definition at line 246 of file gui.cpp.

Here is the call graph for this function:

void Gui::demo ( bool  state)
signal

Emits the demo mode signal

Parameters:
statecan be true or false.

Here is the caller graph for this function:

void Gui::disableCompass ( )
slot

Disables the compass window in the GUI.

Definition at line 2092 of file gui.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Gui::disableFaceDetection ( )
slot

Disables face detection checkBoxes in the GUI.

See also:
CameraThread::setCascadePath()

Definition at line 2061 of file gui.cpp.

Here is the call graph for this function:

void Gui::drive ( const int  command)
signal

Instructs the robot to drive FORWARD, BACKWARD, LEFT and RIGHT. The commands START, STOP or WAIT are also possible.

Parameters:
command

Here is the caller graph for this function:

void Gui::enableFaceDetection ( int  state)
signal

Enables or disables the face detection. When activated, a circle for each face is drawn on the camera live image.

Parameters:
statehas to be Qt::Checked to enable the detection. All other states disable.

Here is the caller graph for this function:

void Gui::enableFaceTracking ( int  state)
signal

Enables or disables the face tracking. When activated, a face will be tracked by the camera.

Parameters:
statehas to be Qt::Checked to enable the detection. All other states disable.

Here is the caller graph for this function:

void Gui::enableRemoteControlListening ( bool  state)
signal

Enables or disables the listening for the robot remote control. This signal is sent from the remote control button.

Parameters:
statecan be true or false.
See also:
NetworkThread()

Here is the caller graph for this function:

void Gui::hideCameraControls ( )
slot

Hides the camera controls in the GUI (e.g. no camera detected). But can be enabled again anyway.

See also:
CameraThread::init()

Definition at line 2077 of file gui.cpp.

Here is the caller graph for this function:

void Gui::init ( )
private

Definition at line 65 of file gui.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Gui::initCircuit ( )
signal

Initializes the robots basic circuit.

Here is the caller graph for this function:

void Gui::initCompassView ( )
private
void Gui::initPlots ( )
private
Todo:
put plot voltage title to method or init call
Todo:
put plot voltage title to method or init call

Definition at line 3862 of file gui.cpp.

Here is the caller graph for this function:

void Gui::initServos ( )
signal

Initializes the servos.

Here is the caller graph for this function:

void Gui::mediaSkip ( )
signal

Emits a mediaplayer skip (track) signal

Here is the caller graph for this function:

void Gui::on_actionAbout_activated ( )
protectedslot

Definition at line 993 of file gui.cpp.

void Gui::on_actionAll_activated ( )
protectedslot

Definition at line 819 of file gui.cpp.

void Gui::on_actionCamera_activated ( )
protectedslot

Definition at line 846 of file gui.cpp.

void Gui::on_actionDemo_activated ( )
protectedslot

Definition at line 2622 of file gui.cpp.

Here is the call graph for this function:

void Gui::on_actionDrive_activated ( )
protectedslot

Definition at line 491 of file gui.cpp.

Here is the call graph for this function:

void Gui::on_actionExit_activated ( )
protectedslot

Action if a menu item or a toolbar button is clicked

Definition at line 257 of file gui.cpp.

void Gui::on_actionJoystick_activated ( )
protectedslot

Definition at line 980 of file gui.cpp.

void Gui::on_actionLog_activated ( )
protectedslot

Definition at line 959 of file gui.cpp.

void Gui::on_actionMediaSkip_activated ( )
protectedslot

Definition at line 2649 of file gui.cpp.

Here is the call graph for this function:

void Gui::on_actionRemote_activated ( )
protectedslot

Definition at line 2543 of file gui.cpp.

Here is the call graph for this function:

void Gui::on_actionReset_activated ( )
protectedslot

Definition at line 547 of file gui.cpp.

Here is the call graph for this function:

void Gui::on_actionResetDrivenDistance_activated ( )
privateslot

Definition at line 608 of file gui.cpp.

Here is the call graph for this function:

void Gui::on_actionSaveLaserData_activated ( )
protectedslot

Definition at line 2616 of file gui.cpp.

Here is the call graph for this function:

void Gui::on_actionSettings_activated ( )
protectedslot

Definition at line 945 of file gui.cpp.

void Gui::on_actionSimulate_activated ( )
protectedslot

Definition at line 2581 of file gui.cpp.

Here is the call graph for this function:

void Gui::on_actionState_activated ( )
protectedslot

Definition at line 924 of file gui.cpp.

void Gui::on_actionTest_activated ( )
protectedslot

Definition at line 745 of file gui.cpp.

Here is the call graph for this function:

void Gui::on_actionVoltage_activated ( )
protectedslot

Definition at line 871 of file gui.cpp.

void Gui::on_btnKinectResetAngle_clicked ( )
privateslot

Definition at line 2177 of file gui.cpp.

Here is the call graph for this function:

void Gui::on_btnSavePicture_clicked ( )
privateslot

Definition at line 2028 of file gui.cpp.

Here is the call graph for this function:

void Gui::on_checkBoxFaceDetection_stateChanged ( int  state)
privateslot

Definition at line 2803 of file gui.cpp.

void Gui::on_checkBoxFaceTracking_stateChanged ( int  state)
privateslot

Definition at line 2831 of file gui.cpp.

void Gui::on_checkBoxMirror_stateChanged ( int  state)
privateslot

Definition at line 2793 of file gui.cpp.

void Gui::on_sliderThreshold_valueChanged ( int  value)
privateslot

Definition at line 2191 of file gui.cpp.

Here is the call graph for this function:

void Gui::on_spinBoxKinectAngle_valueChanged ( int  i)
privateslot

Definition at line 2171 of file gui.cpp.

Here is the call graph for this function:

void Gui::processCam ( )
privateslot

Definition at line 4542 of file gui.cpp.

QString Gui::removeHtml ( QString  text)
private

Removes HTML code from a given string.

Parameters:
textis the string to be cleaned
Returns:
the cleaned string

Definition at line 4514 of file gui.cpp.

Here is the caller graph for this function:

void Gui::resetDrivenDistance ( int  sensor)
signal

Resets the driven distance to 0.

Parameters:
sensoris the sensor number.

Here is the caller graph for this function:

void Gui::resetKinectAngle ( )
signal

Here is the caller graph for this function:

void Gui::saveCamImage ( void  )
privateslot

Saves the current picture to disk (one time shot).

Definition at line 2197 of file gui.cpp.

Here is the caller graph for this function:

void Gui::setCamImage ( QImage *  image)
slot

Shows the new RGB picture from the Kienct camera.

Parameters:
frame
See also:
CamThread::camDataComplete()

Definition at line 2098 of file gui.cpp.

void Gui::setCamImageDepth ( QImage *  image)
slot

Shows the new depth picture from the Kienct camera.

Parameters:
frame
See also:
CamThread::camDepthComplete()

Definition at line 2122 of file gui.cpp.

void Gui::setCamImageOpenCV ( QImage *  image)
slot

Shows the OpenCV processed picture from the Kienct camera.

Parameters:
frame
See also:
CamThread::camOpenCVComplete()

Definition at line 2136 of file gui.cpp.

void Gui::setConsoleMode ( bool  state)
slot

Turns the CONSOLE mode on or off. If enabled, all log messages are passed to the console.

Parameters:
statecan be true or false.

Definition at line 4508 of file gui.cpp.

void Gui::setKinectAngle ( double  i)
signal

Here is the caller graph for this function:

void Gui::setKinectVideoMode ( int  mode)
signal
void Gui::setLabelMasterSlave ( QString  text)
slot

Changes the text of the netowrk master/slave label

Parameters:
textis the etxt to be shown (normally 'Master' or 'Slave)

Definition at line 4468 of file gui.cpp.

Here is the caller graph for this function:

void Gui::setLaserscannerAngle ( short int  laserscanner,
int  angle 
)
slot

Gets the angle of a laser from the

See also:
laserThread for drawing the correct laser scanner angles (e.g. 180 or 270 degrees)
Parameters:
laserScannercan be LASER1 or LASER2
anglein degrees

Definition at line 3427 of file gui.cpp.

Here is the caller graph for this function:

void Gui::setLaserscannerResolution ( short int  laserscanner,
float  resolution 
)
slot

Gets the resolution of a laser from the

See also:
laserThread for drawing the correct laser scanner angles (e.g. 0.5 or 1.0 degrees)
Parameters:
laserScannercan be LASER1 or LASER2
anglein degrees

Definition at line 3445 of file gui.cpp.

Here is the caller graph for this function:

void Gui::setLEDCamera ( unsigned char  state)
slot

Turns the camera GUI LED red, green or off.

Parameters:
statecan be RED, GREEN or OFF.

Definition at line 4316 of file gui.cpp.

Here is the caller graph for this function:

void Gui::setLEDCompass ( unsigned char  state)
slot

Turns the GUI compass LED red, green or off.

Parameters:
statecan be RED, GREEN or OFF.

Definition at line 4240 of file gui.cpp.

Here is the caller graph for this function:

void Gui::setLEDHeartbeat ( unsigned char  state)
slot

Turns the heartbeat/state GUI LED red, green or off.

Parameters:
statecan be RED, GREEN or OFF.

Definition at line 4202 of file gui.cpp.

Here is the caller graph for this function:

void Gui::setLEDJoystick ( unsigned char  state)
slot

Turns the joystick GUI LED red, green or off.

Parameters:
statecan be RED, GREEN or OFF.

Definition at line 4278 of file gui.cpp.

Here is the caller graph for this function:

void Gui::setLEDLaser ( unsigned char  state)
slot

Turns the lase scanner GUI LED red, green or off.

Parameters:
statecan be RED, GREEN or OFF.

Definition at line 4430 of file gui.cpp.

Here is the caller graph for this function:

void Gui::setLEDMasterSlave ( unsigned char  state)
slot

Turns the network master/slave GUI LED red, green or off.

Parameters:
statecan be RED, GREEN or OFF.

Definition at line 4392 of file gui.cpp.

void Gui::setLEDNetwork ( unsigned char  state)
slot

Turns the network GUI LED red, green or off.

Parameters:
statecan be RED, GREEN or OFF.

Definition at line 4354 of file gui.cpp.

Here is the caller graph for this function:

void Gui::setPlotData5 ( double *  xval,
double *  yval,
int  size 
)
slot

Shows the actual plot data (e.g. measured voltage from sensor 1). This slot is called from the plot thread.

Parameters:
xvalpoints to an array with the values for the x axis (usually the time line).
yvalpoints to an array with the values for the y axis (usually the measured values).
sizeis the size of the array.
See also:
PlotThread()

Definition at line 2307 of file gui.cpp.

void Gui::setPlotData6 ( double *  xval,
double *  yval,
int  size 
)
slot

Shows the actual plot data (e.g. measured voltage from sensor 2). This slot is called from the plot thread.

Parameters:
xvalpoints to an array with the values for the x axis (usually the time line).
yvalpoints to an array with the values for the y axis (usually the measured values).
sizeis the size of the array.
See also:
PlotThread()

Definition at line 2326 of file gui.cpp.

void Gui::setPlotDataHeartbeat ( double *  xval,
double *  yval,
int  size 
)
slot

Shows the actual plot data (heartbeat from the robot). This slot is called from the plot thread.

Parameters:
xvalpoints to an array with the values for the x axis (usually the time line).
yvalpoints to an array with the values for the y axis (usually the measured values).
sizeis the size of the array.
See also:
PlotThread()

Definition at line 2345 of file gui.cpp.

void Gui::setRobotControls ( bool  state)
slot

Enables/Disables some controls in the GUI if the robot, depending on the robots state.

Parameters:
statecan be ON or OFF
See also:
CameraThread::robotState()
Todo:
test if this really is needed. Is the heartbeaet in the sensorthread sufficient?
Todo:
still needed? state already checked in motorControl at lower level. :-)

Definition at line 263 of file gui.cpp.

Here is the call graph for this function:

void Gui::setThreshold ( int  value)
signal

Sets the threshold on the OpenCV iamge stuff. This Signal is sent to the

See also:
CamThread

Here is the caller graph for this function:

void Gui::showAlarm ( short int  sensor,
bool  state 
)

Shows a sensor alarm (turns progressBars red, text in bold etc.)

Parameters:
sensoris the sensor number.
statecan be ON or OFF.

Definition at line 1301 of file gui.cpp.

Here is the caller graph for this function:

void Gui::showCompassData ( float  x,
float  y,
float  z,
float  heading 
)
slot

Shows the compass axes values in labels. Also sets the compass needle to the value of the x axis and sets the 3D OpenGL compass!

Parameters:
xis the x axis value
yis the y axis value
zis the z axis value
headingis the heading of the compass

Definition at line 4170 of file gui.cpp.

void Gui::showDistanceGraphical ( int  sensor,
int  distance 
)

Shows a sensor distance in a progress bar.

Parameters:
sensoris the sensor number.
distanceis the distance in cm.
See also:
SensorThread::convertToSensorValue(), SensorThread::convertToDistance()

Definition at line 1060 of file gui.cpp.

void Gui::showDrivenDistance ( int  sensor,
int  distance 
)

Shows the driven distance in a text label.

Parameters:
sensoris the sensor number.
distanceis the distance in cm.

Definition at line 1116 of file gui.cpp.

Here is the caller graph for this function:

void Gui::showFaceTrackData ( int  faces,
int  faceX,
int  faceY,
int  faceRadius,
int  lastFaceX,
int  lastFaceY 
)
slot

Show some face track data in the GUI.

Parameters:
facesis the number of detected faces
faceXis the X coordinate to the middle of a detected face (0, if none)
faceYis the Y coordinate to the middle of a detected face (0, if none)
faceRadiusis the radius (0, if none)

Definition at line 2035 of file gui.cpp.

void Gui::showFaceTrackDirection ( QString  direction)
slot

Shows the face tracking direction in a lable.

Parameters:
directioncan be UP, DOWN, LEFT, RIGHT or NONE

Definition at line 1907 of file gui.cpp.

void Gui::showKinectAngle ( double  angle)
slot

Shows the angle of the Kinect

Parameters:
angleis the angle in degrees

Definition at line 4481 of file gui.cpp.

void Gui::showLaserFrontAngles ( int  largestFreeAreaStart,
int  largestFreeAreaEnd,
int  centerOfFreeWay,
float  width 
)
slot

Shows the angles of the free area where to drive in lables.

Parameters:
largestFreeAreaStart
largestFreeAreaEnd
centerOfFreeWay
widthof the estimated drive-trough area
Todo:
do all this stuff for the rear scanner?

Definition at line 1731 of file gui.cpp.

Here is the call graph for this function:

void Gui::showMotorStatus ( int  motor,
bool  power,
int  direction 
)

Shows the status and direction of a motor (ON, OFF, RIGHT, LEFT)

Parameters:
motoris the motor number.
powercan be ON or OFF.
directioncan be FORWARD or BACKWARD.

Definition at line 1508 of file gui.cpp.

Here is the caller graph for this function:

void Gui::showPreferredDirection ( QString  direction)
slot

Shows the preferred driving direction in a lable.

Parameters:
directioncan be FORWARD, BACKWARD, LEFT or RIGHT
See also:
Direcs::logicalUnit

Definition at line 1849 of file gui.cpp.

Here is the call graph for this function:

void Gui::showThreshold ( int  threshold)
slot

Shows the threshold / sets the threshold slider regarding to the value from e.g. an inifile or CamThread.

Parameters:
threshold

Definition at line 4495 of file gui.cpp.

Here is the caller graph for this function:

void Gui::showVoltage ( int  sensor,
float  voltage 
)

Shows the voltage from the power supply in a text label.

Parameters:
sensoris the sensor number.
voltageis the voltage in V.

Definition at line 1177 of file gui.cpp.

Here is the caller graph for this function:

void Gui::shutdown ( )
signal

Exits the whole programm.

Here is the caller graph for this function:

void Gui::simulate ( bool  state)
signal

Enables or disables the robots simulation mode. This signal is sent from the simulation button and received from all threads which deliver real signals from the bot. Once the signal is received, the slots switches to simulation mode.

Parameters:
statecan be true or false.
See also:
Direcs::setSimulationMode()
SensorThread::setSimulationMode()
LaserThread::setSimulationMode()
ObstackeCheckThread::setSimulationMode()

Here is the caller graph for this function:

void Gui::speak ( QString  text)
signal

Emits a speak signal. This signal is sent to the speakThread.

Here is the caller graph for this function:

void Gui::systemerrorcatcher ( int  errorlevel)
slot

This slot catches all signals from the signal

See also:
systemerror

Definition at line 4532 of file gui.cpp.

Here is the call graph for this function:

void Gui::test ( )
signal

Emits a signal to call the test method in the Direcs class..

Here is the caller graph for this function:

void Gui::writeLaserData ( )
signal

Saves the current laser data to a file. This signal is sent to the

See also:
LaserThread::writeLaserData via
Direcs

Here is the caller graph for this function:


Member Data Documentation

AboutDialog* Gui::aboutDialog
private

Definition at line 639 of file gui.h.

const int Gui::ALLMOTORS = 250
staticprivate

Motor 4 back right.

Definition at line 750 of file gui.h.

const int Gui::BACKWARD = 20
staticprivate

Motor direction (formerly "clockwise")

Definition at line 732 of file gui.h.

QPixmap Gui::cameraPicToSave
private

Definition at line 660 of file gui.h.

const int Gui::CENTEROFLARGESTFREEWAY = 3
staticprivate

Definition at line 837 of file gui.h.

QColor Gui::colorGraphicsSceneBackground
private

Definition at line 673 of file gui.h.

QColor Gui::colorHelpLine
private

Definition at line 671 of file gui.h.

QColor Gui::colorHelpLineText
private

Definition at line 672 of file gui.h.

QColor Gui::colorLaserCenterDrivingDirection
private

Definition at line 669 of file gui.h.

QColor Gui::colorLaserFreeWay
private

Definition at line 667 of file gui.h.

QColor Gui::colorLaserIgnoreArea
private

Definition at line 670 of file gui.h.

QColor Gui::colorLaserObstacle
private

Definition at line 666 of file gui.h.

QColor Gui::colorLaserPreferredDrivingDirection
private

Definition at line 668 of file gui.h.

bool Gui::consoleMode
private

Definition at line 712 of file gui.h.

QwtPlotCurve Gui::curveCurrent1
private

Definition at line 648 of file gui.h.

QwtPlotCurve Gui::curveCurrent2
private

Definition at line 649 of file gui.h.

QwtPlotCurve Gui::curveCurrent3
private

Definition at line 650 of file gui.h.

QwtPlotCurve Gui::curveCurrent4
private

Definition at line 651 of file gui.h.

QwtPlotCurve Gui::curveHeartbeat
private

Definition at line 652 of file gui.h.

QwtPlotCurve Gui::curveVoltage1
private

Definition at line 646 of file gui.h.

QwtPlotCurve Gui::curveVoltage2
private

Definition at line 647 of file gui.h.

const int Gui::FITTOFRAMEFACTOR = 45
staticprivate

theoratically 5 Volt for heartbeat "high"

See also:
SensorThread::run Factor for fitting 6 meters (measured from the laser scanner) into a frame with a height of 270 pixels at a default zoom level of 5 !! Example:

laservalue = 0.18 cm fit factor = 45 zoom level = 5

0.18 x 45 x 5 = 40.5 Pixel -> 41 Pixel is the length of the laser line in the GUI

Definition at line 818 of file gui.h.

const int Gui::FORWARD = 10
staticprivate

Some driving directions and motor directions for the robot.

For motor "OFF"

See also:
Direcs::drive() [Slot]

Definition at line 731 of file gui.h.

const int Gui::FREEWAY = 0
staticprivate

the tags for the laser lines

See also:
ObstacleCheckThread

Definition at line 834 of file gui.h.

const unsigned char Gui::GREEN = 2
staticprivate

Definition at line 861 of file gui.h.

QColor Gui::gridColor
private

Definition at line 665 of file gui.h.

QwtPlotGrid Gui::gridCurrent1
private

Definition at line 655 of file gui.h.

QwtPlotGrid Gui::gridCurrent2
private

Definition at line 656 of file gui.h.

QwtPlotGrid Gui::gridHeartbeat
private

Definition at line 657 of file gui.h.

QwtPlotGrid Gui::gridVoltage1
private

Definition at line 653 of file gui.h.

QwtPlotGrid Gui::gridVoltage2
private

Definition at line 654 of file gui.h.

const int Gui::IGNORETHIS = 4
staticprivate

Definition at line 838 of file gui.h.

const int Gui::INITIALLASERYPOSFRONT = 60.0
staticprivate

the initial Y position of the laser lines and the robot image in the GUI This is the difference in pixel measured drom the absolute center within the robot pixmap!

Definition at line 823 of file gui.h.

const int Gui::INITIALLASERYPOSREAR = 60.0
staticprivate

Definition at line 824 of file gui.h.

JoystickDialog* Gui::joystickDialog
private

Definition at line 638 of file gui.h.

QColor Gui::labelFillColorBlue
private

Definition at line 664 of file gui.h.

QColor Gui::labelFillColorGreen
private

Definition at line 663 of file gui.h.

QColor Gui::labelFillColorRed
private

Definition at line 662 of file gui.h.

const int Gui::LARGESTFREEWAY = 2
staticprivate

Definition at line 836 of file gui.h.

const short int Gui::LASER1 = 1
staticprivate

Defines the size of the laserLines[] array This es equal to the number of degrees. See also laserThread.h For the laserThread

Definition at line 850 of file gui.h.

const short int Gui::LASER2 = 2
staticprivate

Definition at line 851 of file gui.h.

const short int Gui::LASER3 = 4
staticprivate

Definition at line 852 of file gui.h.

const short int Gui::LASER4 = 8
staticprivate

Definition at line 853 of file gui.h.

const short int Gui::LASER5 = 16
staticprivate

Definition at line 854 of file gui.h.

const int Gui::LASERDISTANCECIRCLES = 27
staticprivate

Number of distance semi circles.

Definition at line 827 of file gui.h.

const int Gui::LASERDISTANCEDISTANCE = 60
staticprivate

Distances between the lines to show the laser distances in pixels.

Definition at line 831 of file gui.h.

const int Gui::LASERDISTANCEFIRSTCIRCLE = 82
staticprivate

the size (diameter) of the first (innerst) circle in pixels

Definition at line 829 of file gui.h.

int Gui::laserscannerAngleFront
private

Definition at line 674 of file gui.h.

int Gui::laserscannerAngleRear
private

this values holds the range of the laserscanner viewing angle. e.g. 180 oder 270 degrees. just for reading the value here.

See also:
laserThread

Definition at line 675 of file gui.h.

float Gui::laserscannerResolutionFront
private

this values holds the range of the laserscanner viewing angle. e.g. 180 oder 270 degrees. just for reading the value here.

See also:
laserThread

Definition at line 676 of file gui.h.

float Gui::laserscannerResolutionRear
private

this values holds the resolution of the laserscanner.

See also:
laserThread

Definition at line 677 of file gui.h.

const unsigned char Gui::LEDOFF = 0
staticprivate

The GUI LED colors

Definition at line 859 of file gui.h.

const int Gui::LEFT = 30
staticprivate

Motor direction (formerly "counterclockwise".

Definition at line 733 of file gui.h.

const float Gui::MAXIMUMPLOTHEARTBEAT = 5.00
staticprivate

for plot widgets

Todo:
put to ini-file

Definition at line 806 of file gui.h.

const float Gui::MAXIMUMPLOTVOLTAGE1 = 18.00
staticprivate

for progress bars

Todo:
put max. voltage 2 in the ini-file (LiPo: 4,2 Volt x 6S = 25,2 Volt)

Definition at line 803 of file gui.h.

const float Gui::MAXIMUMPLOTVOLTAGE2 = 26.00
staticprivate

for plot widgets

Todo:
put to ini-file

Definition at line 804 of file gui.h.

const float Gui::MAXIMUMVOLTAGE1 = 18.00
staticprivate
Todo:
put min. voltage 2 in the ini-file (LiPo: 3.3 Volt x 6S = 19,8 Volt)

Definition at line 800 of file gui.h.

const float Gui::MAXIMUMVOLTAGE2 = 26.00
staticprivate

for progress bars

Todo:
put max. voltage 1 in the ini-file (LiPo: 4,2 Volt x 4S = 16,8 Volt)

Definition at line 801 of file gui.h.

const float Gui::MINIMUMVOLTAGE1 = 13.20
staticprivate

Definition at line 797 of file gui.h.

const float Gui::MINIMUMVOLTAGE2 = 24.00
staticprivate
Todo:
put min. voltage 1 in the ini-file (LiPo: 3,3 Volt x 4S = 13,2 Volt)

Definition at line 798 of file gui.h.

int Gui::mLargestFreeAreaEndFront
private

this stores the free area angle from the front laser. Got it from

See also:
showLaserFrontAngles()

Definition at line 679 of file gui.h.

int Gui::mLargestFreeAreaEndRear
private

this stores the free area angle from the rear laser. Got it from

See also:
showLaserFrontAngles()

Definition at line 681 of file gui.h.

int Gui::mLargestFreeAreaStartFront
private

this values holds the resolution of the laserscanner.

See also:
laserThread

Definition at line 678 of file gui.h.

int Gui::mLargestFreeAreaStartRear
private

this stores the free area angle from the front laser. Got it from

See also:
showLaserFrontAngles()

Definition at line 680 of file gui.h.

const int Gui::MOTOR1 = 210
staticprivate

Motor direction/power "same like before".

Definition at line 746 of file gui.h.

const int Gui::MOTOR1BW = 310
staticprivate

Definition at line 753 of file gui.h.

const int Gui::MOTOR1FW = 300
staticprivate

used for letting the robot getting only one command for all motors (like 'forward all'). This is to reduce commands on the serial line.

Definition at line 752 of file gui.h.

const int Gui::MOTOR1OFF = 320
staticprivate

Definition at line 754 of file gui.h.

const int Gui::MOTOR2 = 220
staticprivate

Motor 1 front left.

Definition at line 747 of file gui.h.

const int Gui::MOTOR2BW = 340
staticprivate

Definition at line 756 of file gui.h.

const int Gui::MOTOR2FW = 330
staticprivate

Definition at line 755 of file gui.h.

const int Gui::MOTOR2OFF = 350
staticprivate

Definition at line 757 of file gui.h.

const int Gui::MOTOR3 = 230
staticprivate

Motor 2 front right.

Definition at line 748 of file gui.h.

const int Gui::MOTOR3BW = 370
staticprivate

Definition at line 759 of file gui.h.

const int Gui::MOTOR3FW = 360
staticprivate

Definition at line 758 of file gui.h.

const int Gui::MOTOR3OFF = 380
staticprivate

Definition at line 760 of file gui.h.

const int Gui::MOTOR4 = 240
staticprivate

Motor 3 back left.

Definition at line 749 of file gui.h.

const int Gui::MOTOR4BW = 400
staticprivate

Definition at line 762 of file gui.h.

const int Gui::MOTOR4FW = 390
staticprivate

Definition at line 761 of file gui.h.

const int Gui::MOTOR4OFF = 410
staticprivate

Definition at line 763 of file gui.h.

const short int Gui::MOTORSENSOR1 = 0
staticprivate

Definition at line 789 of file gui.h.

const short int Gui::MOTORSENSOR2 = 1
staticprivate

Definition at line 790 of file gui.h.

const short int Gui::MOTORSENSOR3 = 2
staticprivate

Definition at line 791 of file gui.h.

const short int Gui::MOTORSENSOR4 = 3
staticprivate

Definition at line 792 of file gui.h.

const short int Gui::NONE = 0
staticprivate

Value if no sensor has a value to react

Definition at line 787 of file gui.h.

QDateTime Gui::now
private

is enabled if the argument 'console' was passed by command-line. Sends all GUI messages to the command line.

Definition at line 713 of file gui.h.

const int Gui::OBSTACLE = 1
staticprivate

Definition at line 835 of file gui.h.

const bool Gui::OFF = false
staticprivate

For motor "ON"

Definition at line 728 of file gui.h.

const bool Gui::ON = true
staticprivate

max value in cm for us sensor

Definition at line 727 of file gui.h.

QPixmap Gui::pixmap
private

this stores the free area angle from the rear laser. Got it from

See also:
showLaserFrontAngles()

Definition at line 709 of file gui.h.

QwtPlot Gui::qwtPlotCurrent1
private

Definition at line 643 of file gui.h.

QwtPlot Gui::qwtPlotCurrent2
private

Definition at line 644 of file gui.h.

QwtPlot Gui::qwtPlotHeartbeat
private

Definition at line 645 of file gui.h.

QwtPlot Gui::qwtPlotVoltage1
private

Definition at line 641 of file gui.h.

QwtPlot Gui::qwtPlotVoltage2
private

Definition at line 642 of file gui.h.

const int Gui::READ_AXIS_X = 500
staticprivate

Definition at line 765 of file gui.h.

const int Gui::READ_AXIS_Y = 510
staticprivate

Definition at line 766 of file gui.h.

const int Gui::READ_AXIS_Z = 520
staticprivate

Definition at line 767 of file gui.h.

const unsigned char Gui::RED = 1
staticprivate

Definition at line 860 of file gui.h.

const int Gui::RIGHT = 40
staticprivate

Definition at line 734 of file gui.h.

bool Gui::robotIsOn
private
Todo:
fix me to leave the last char in the string.
See also:
Logfile

Definition at line 633 of file gui.h.

const int Gui::SAME = 200
staticprivate

Definition at line 745 of file gui.h.

const short int Gui::SENSOR1 = 1
staticprivate

Give the sensors some names

DONT CHANGE THIS NUMBERS! THEY ARE ALSO USED TO ADRESS THE ARRAY "iRSensorValue[]" !!

Definition at line 775 of file gui.h.

const short int Gui::SENSOR16 = 256
staticprivate

ultrasonic sensor

Definition at line 785 of file gui.h.

const short int Gui::SENSOR2 = 2
staticprivate

Definition at line 776 of file gui.h.

const short int Gui::SENSOR3 = 4
staticprivate

Definition at line 777 of file gui.h.

const short int Gui::SENSOR4 = 8
staticprivate

Definition at line 778 of file gui.h.

const short int Gui::SENSOR5 = 16
staticprivate

Definition at line 779 of file gui.h.

const short int Gui::SENSOR6 = 32
staticprivate

Definition at line 780 of file gui.h.

const short int Gui::SENSOR7 = 64
staticprivate

Definition at line 781 of file gui.h.

const short int Gui::SENSOR8 = 128
staticprivate

Definition at line 782 of file gui.h.

const int Gui::SENSORPROGRESSBARMAXIR = 50
staticprivate

Definition at line 719 of file gui.h.

const int Gui::SENSORPROGRESSBARMAXUS = 400
staticprivate

max value in cm for ir sensor

Definition at line 720 of file gui.h.

SettingsDialog* Gui::settingsDialog
private

This is the small GUI, when running on the robots small TFT.

Definition at line 637 of file gui.h.

const int Gui::START = 70
staticprivate

Definition at line 737 of file gui.h.

const int Gui::STARTZOOMLEVEL = 3
staticprivate

Definition at line 819 of file gui.h.

const int Gui::STOP = 80
staticprivate

Definition at line 738 of file gui.h.

QString Gui::string
private

this is for the timestamp in the logs in the gui

Definition at line 714 of file gui.h.

const int Gui::TURNLEFT = 50
staticprivate

Definition at line 735 of file gui.h.

const int Gui::TURNRIGHT = 60
staticprivate

Definition at line 736 of file gui.h.

Ui::mainWindow Gui::ui
private

if true, we will use the large GUI. If false, we will use the small one for fitting on a small onboard TFT. By default this is decided by the local hostname of the system.

See also:
Direcs

Definition at line 635 of file gui.h.

Ui::mainWindowSmall Gui::uiSmall
private

This is the large default GUI, when not running on the robot.

Definition at line 636 of file gui.h.

bool Gui::useLargeGUI
private

Stores the robots (circuits) state.ON or OFF.

Definition at line 634 of file gui.h.

const short int Gui::VOLTAGESENSOR1 = 0
staticprivate

Definition at line 794 of file gui.h.

const short int Gui::VOLTAGESENSOR2 = 1
staticprivate

Definition at line 795 of file gui.h.

const int Gui::WAIT = 90
staticprivate

Definition at line 739 of file gui.h.


The documentation for this class was generated from the following files: