Gestro
Public Slots | Public Member Functions | Private Member Functions | Private Attributes | List of all members
ControllerScreen Class Reference

It sets up the GUI, initializes CaptureAndDetect, and DisplayControl. More...

#include <ControllerScreen.h>

Inheritance diagram for ControllerScreen:
Inheritance graph
Collaboration diagram for ControllerScreen:
Collaboration graph

Public Slots

void unprocessedFeed_clicked ()
 
void skinMask_clicked ()
 
void detector_clicked ()
 
void calibrate_clicked ()
 
void setCalibrationValues ()
 
void calibrateBackground_clicked ()
 
void enableMouse ()
 
void enableSpaceBar ()
 
void enableMinimizeWindow ()
 
void enableMoveWindow ()
 
void enableVolume ()
 

Public Member Functions

 ControllerScreen (QWidget *parent=0)
 
 ~ControllerScreen ()
 
void Callback_controls (FingerAndCoordinates finger)
 
void updateImage (Mat) override
 
void updateCalibratedTrackbar (int, int, int, int) override
 
void updateLogTable (String a, String b) override
 
void keyPressEvent (QKeyEvent *) override
 
- Public Member Functions inherited from ControllerScreenCallbackInterface
virtual void updateImage (cv::Mat)=0
 

Private Member Functions

void connectGuiEvents ()
 
void connectSignals ()
 

Private Attributes

Ui::ControllerScreen * ui
 A pointer to the ui class. More...
 
CaptureAndDetect captureAndDetect
 Creating an instance of the CaptureAndDetect class. More...
 
Display * display = XOpenDisplay(NULL)
 Opening a connection to the X server. More...
 
DisplayControl displayControl = DisplayControl(display)
 Creating an instance of the DisplayControl class. More...
 
Screen * screen = DefaultScreenOfDisplay(display)
 Getting the default screen of the display. More...
 
CustomSignals signal
 Creating an instance of the CustomSignals class. More...
 
EnabledCommand enabledCommands
 A class that is used to store the enabled commands. More...
 

Detailed Description

It sets up the GUI, initializes CaptureAndDetect, and DisplayControl.

Connects the GUI events to the appropriate functions, and connects the signals to the appropriate slots

Parameters
parentThe parent widget of the dialog.

Definition at line 39 of file ControllerScreen.h.

Constructor & Destructor Documentation

◆ ControllerScreen()

ControllerScreen::ControllerScreen ( QWidget *  parent = 0)
explicit

Construtor

Parameters
parent

Definition at line 4 of file ControllerScreen.cpp.

Here is the call graph for this function:

◆ ~ControllerScreen()

ControllerScreen::~ControllerScreen ( )

The destructor for the ControllerScreen class.

Definition at line 52 of file ControllerScreen.cpp.

Member Function Documentation

◆ calibrate_clicked

void ControllerScreen::calibrate_clicked ( )
slot

When the calibrate button is clicked, the skin mask and detector buttons are enabled, the calibrate button is disabled, the calibrate signal is emitted, the image view is changed to the skin mask, and the log table is updated

Definition at line 79 of file ControllerScreen.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ calibrateBackground_clicked

void ControllerScreen::calibrateBackground_clicked ( )
slot

It calls the calibrateBackground() function in the Signal class, and then updates the log table with a message

Definition at line 89 of file ControllerScreen.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Callback_controls()

void ControllerScreen::Callback_controls ( FingerAndCoordinates  finger)

◆ connectGuiEvents()

void ControllerScreen::connectGuiEvents ( )
private

It connects the GUI elements to the appropriate slots

Definition at line 34 of file ControllerScreen.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ connectSignals()

void ControllerScreen::connectSignals ( )
private

It connects the signals from the controller to the slots in the captureAndDetect class

Definition at line 26 of file ControllerScreen.cpp.

Here is the caller graph for this function:

◆ detector_clicked

void ControllerScreen::detector_clicked ( )
slot

It changes the image view to the finger counter

Definition at line 72 of file ControllerScreen.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ enableMinimizeWindow

void ControllerScreen::enableMinimizeWindow ( )
slot

If the checkbox is checked, then the command is enabled

Definition at line 148 of file ControllerScreen.cpp.

Here is the caller graph for this function:

◆ enableMouse

void ControllerScreen::enableMouse ( )
slot

If the checkbox is checked, then the controlMouse variable is set to true, otherwise it is set to false

Definition at line 132 of file ControllerScreen.cpp.

Here is the caller graph for this function:

◆ enableMoveWindow

void ControllerScreen::enableMoveWindow ( )
slot

If the checkbox is checked, then the controlMoveWindow variable is set to true, otherwise it is set to false

Definition at line 156 of file ControllerScreen.cpp.

Here is the caller graph for this function:

◆ enableSpaceBar

void ControllerScreen::enableSpaceBar ( )
slot

If the checkbox is checked, then the controlSpacebar variable is set to true, otherwise it is set to false

Definition at line 140 of file ControllerScreen.cpp.

Here is the caller graph for this function:

◆ enableVolume

void ControllerScreen::enableVolume ( )
slot

If the checkbox is checked, then the controlVolume variable is set to true, otherwise it is set to false

Definition at line 165 of file ControllerScreen.cpp.

Here is the caller graph for this function:

◆ keyPressEvent()

void ControllerScreen::keyPressEvent ( QKeyEvent *  keypress)
override

If the user presses the "B" key, then the calibrateBackground_clicked() function is called

Parameters
keypressthe key that was pressed

Definition at line 173 of file ControllerScreen.cpp.

Here is the call graph for this function:

◆ setCalibrationValues

void ControllerScreen::setCalibrationValues ( )
slot

It sets the calibration values for the signal

Definition at line 95 of file ControllerScreen.cpp.

Here is the caller graph for this function:

◆ skinMask_clicked

void ControllerScreen::skinMask_clicked ( )
slot

When the skinMask button is clicked, the imageViewChanged signal is emitted with the SKINMASK parameter, and the log table is updated.

Definition at line 65 of file ControllerScreen.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unprocessedFeed_clicked

void ControllerScreen::unprocessedFeed_clicked ( )
slot

When the unprocessed feed button is clicked, the image view is changed to the unprocessed feed and the log table is updated

Definition at line 58 of file ControllerScreen.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateCalibratedTrackbar()

void ControllerScreen::updateCalibratedTrackbar ( int  hmin,
int  hmax,
int  smin,
int  smax 
)
overridevirtual

It updates the trackbars on the controller screen with the values passed in

Parameters
hminminimum hue value
hmaxHue maximum value
sminminimum saturation value
smaxThe maximum value of the saturation channel.

Implements ControllerScreenCallbackInterface.

Definition at line 115 of file ControllerScreen.cpp.

◆ updateImage()

void ControllerScreen::updateImage ( Mat  dest)
override

It recieves the latest frame converts from BGR to RGB, then it converts the image to a QImage, and finally it sets the QImage to the label

Parameters
destthe image to be displayed

Definition at line 109 of file ControllerScreen.cpp.

◆ updateLogTable()

void ControllerScreen::updateLogTable ( String  a,
String  b 
)
overridevirtual

It takes two strings as arguments, and adds them to the table widget

Parameters
aThe first parameter is the name of the function that is being called.
bthe message to be displayed

Implements ControllerScreenCallbackInterface.

Definition at line 122 of file ControllerScreen.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ captureAndDetect

CaptureAndDetect ControllerScreen::captureAndDetect
private

Creating an instance of the CaptureAndDetect class.

Definition at line 94 of file ControllerScreen.h.

◆ display

Display* ControllerScreen::display = XOpenDisplay(NULL)
private

Opening a connection to the X server.

Definition at line 97 of file ControllerScreen.h.

◆ displayControl

DisplayControl ControllerScreen::displayControl = DisplayControl(display)
private

Creating an instance of the DisplayControl class.

Definition at line 100 of file ControllerScreen.h.

◆ enabledCommands

EnabledCommand ControllerScreen::enabledCommands
private

A class that is used to store the enabled commands.

Definition at line 109 of file ControllerScreen.h.

◆ screen

Screen* ControllerScreen::screen = DefaultScreenOfDisplay(display)
private

Getting the default screen of the display.

Definition at line 103 of file ControllerScreen.h.

◆ signal

CustomSignals ControllerScreen::signal
private

Creating an instance of the CustomSignals class.

Definition at line 106 of file ControllerScreen.h.

◆ ui

Ui::ControllerScreen* ControllerScreen::ui
private

A pointer to the ui class.

Definition at line 91 of file ControllerScreen.h.


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