direcs
2012-09-30
|
The class for all GUI actions. More...
#include <gui.h>
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 | |
AboutDialog * | aboutDialog |
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 |
JoystickDialog * | joystickDialog |
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 |
SettingsDialog * | settingsDialog |
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 |
Gui::Gui | ( | bool | useSmallGUI, |
SettingsDialog * | s, | ||
JoystickDialog * | j, | ||
AboutDialog * | a, | ||
QMainWindow * | parent = 0 |
||
) |
|
slot |
Appends text to the main log in the main window.
text | is the text to be displayed. |
CR | adds a carriage return (CR) to the text, if true (default). This parameter is optional. |
sayIt | If true, the text is also spoken (default=false). This parameter is optional. |
addTimestamp | If true, the a timestamp is added in front of the text. This parameter is optional. |
Definition at line 309 of file gui.cpp.
|
slot |
Append text to the network log in the main window
text | is the text to be displayed. |
CR | adds a carriage return (CR) to the text, if true (default). This parameter is optional! |
sayIt | If true, the text is also spoken (default=false). This parameter is optional! |
Definition at line 372 of file gui.cpp.
|
slot |
Append text to the serial log in the main window
text | is the text to be displayed. |
CR | adds a carriage return (CR) to the text, if true (default). This parameter is optional! |
Definition at line 435 of file gui.cpp.
|
protected |
|
signal |
Emits the demo mode signal
state | can be true or false. |
|
slot |
|
slot |
|
signal |
Instructs the robot to drive FORWARD, BACKWARD, LEFT and RIGHT. The commands START, STOP or WAIT are also possible.
command |
|
signal |
Enables or disables the face detection. When activated, a circle for each face is drawn on the camera live image.
state | has to be Qt::Checked to enable the detection. All other states disable. |
|
signal |
Enables or disables the face tracking. When activated, a face will be tracked by the camera.
state | has to be Qt::Checked to enable the detection. All other states disable. |
|
signal |
Enables or disables the listening for the robot remote control. This signal is sent from the remote control button.
state | can be true or false. |
|
slot |
|
private |
|
signal |
Initializes the robots basic circuit.
|
private |
|
private |
|
signal |
Initializes the servos.
|
signal |
Emits a mediaplayer skip (track) signal
|
protectedslot |
|
protectedslot |
|
protectedslot |
|
protectedslot |
|
protectedslot |
|
protectedslot |
|
privateslot |
|
protectedslot |
|
protectedslot |
|
protectedslot |
|
privateslot |
|
privateslot |
|
privateslot |
|
privateslot |
|
privateslot |
|
privateslot |
|
privateslot |
|
private |
|
signal |
Resets the driven distance to 0.
sensor | is the sensor number. |
|
signal |
|
privateslot |
|
slot |
|
slot |
|
slot |
|
slot |
|
signal |
|
signal |
|
slot |
|
slot |
|
slot |
|
slot |
|
slot |
|
slot |
|
slot |
|
slot |
|
slot |
|
slot |
|
slot |
Shows the actual plot data (e.g. measured voltage from sensor 1). This slot is called from the plot thread.
xval | points to an array with the values for the x axis (usually the time line). |
yval | points to an array with the values for the y axis (usually the measured values). |
size | is the size of the array. |
|
slot |
Shows the actual plot data (e.g. measured voltage from sensor 2). This slot is called from the plot thread.
xval | points to an array with the values for the x axis (usually the time line). |
yval | points to an array with the values for the y axis (usually the measured values). |
size | is the size of the array. |
|
slot |
Shows the actual plot data (heartbeat from the robot). This slot is called from the plot thread.
xval | points to an array with the values for the x axis (usually the time line). |
yval | points to an array with the values for the y axis (usually the measured values). |
size | is the size of the array. |
|
slot |
Enables/Disables some controls in the GUI if the robot, depending on the robots state.
state | can be ON or OFF |
Definition at line 263 of file gui.cpp.
|
signal |
Sets the threshold on the OpenCV iamge stuff. This Signal is sent to the
void Gui::showAlarm | ( | short int | sensor, |
bool | state | ||
) |
|
slot |
void Gui::showDistanceGraphical | ( | int | sensor, |
int | distance | ||
) |
Shows a sensor distance in a progress bar.
sensor | is the sensor number. |
distance | is the distance in cm. |
void Gui::showDrivenDistance | ( | int | sensor, |
int | distance | ||
) |
|
slot |
Show some face track data in the GUI.
faces | is the number of detected faces |
faceX | is the X coordinate to the middle of a detected face (0, if none) |
faceY | is the Y coordinate to the middle of a detected face (0, if none) |
faceRadius | is the radius (0, if none) |
|
slot |
|
slot |
|
slot |
void Gui::showMotorStatus | ( | int | motor, |
bool | power, | ||
int | direction | ||
) |
|
slot |
Shows the preferred driving direction in a lable.
direction | can be FORWARD, BACKWARD, LEFT or RIGHT |
Definition at line 1849 of file gui.cpp.
|
slot |
void Gui::showVoltage | ( | int | sensor, |
float | voltage | ||
) |
|
signal |
Exits the whole programm.
|
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.
state | can be true or false. |
|
signal |
Emits a speak signal. This signal is sent to the speakThread.
|
slot |
|
signal |
Emits a signal to call the test method in the Direcs class..
|
signal |
Saves the current laser data to a file. This signal is sent to the
|
private |
|
staticprivate |
|
staticprivate |
|
staticprivate |
theoratically 5 Volt for heartbeat "high"
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
|
staticprivate |
Some driving directions and motor directions for the robot.
For motor "OFF"
|
staticprivate |
|
staticprivate |
|
private |
|
staticprivate |
Defines the size of the laserLines[] array This es equal to the number of degrees. See also laserThread.h For the laserThread
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
private |
|
private |
|
private |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
private |
this stores the free area angle from the front laser. Got it from
|
private |
this stores the free area angle from the rear laser. Got it from
|
private |
|
private |
this stores the free area angle from the front laser. Got it from
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
private |
|
staticprivate |
|
private |
this stores the free area angle from the rear laser. Got it from
|
private |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
private |
|
private |
|
private |
|
private |
|
private |