Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
GamepadInfo Class Reference

Gamepad handler class. More...

#include <manager_gui.h>

Inheritance diagram for GamepadInfo:
Inheritance graph
[legend]

Public Member Functions

 GamepadInfo (std::string active_path=ros::package::getPath("atlascar_base")+"/images/xbox-360-controller_active_tumb.png")
 Class constructor. More...
 
bool initializeGamepad ()
 Start communications with the gamepad and register callbacks. More...
 
bool stateManager ()
 Graphical representation state manager. More...
 
bool touch ()
 Mark gamepad activity. More...
 
 ~GamepadInfo ()
 Class destructor. More...
 

Public Attributes

std::string device_
 Gamepad device parameter. More...
 
sigc::slot< void, const
atlascar_base::ManagerCommandPtr > 
event_
 Event slot, this event will be called when there is activity with the gamepad. More...
 

Protected Member Functions

void gamepadAutoBrakeCallback (int value)
 Gamepad auto brake handler. More...
 
void gamepadAutoClutchCallback (int value)
 Gamepad auto clutch handler. More...
 
void gamepadAutoDirectionCallback (int value)
 Gamepad auto direction handler. More...
 
void gamepadAutoThrottleCallback (int value)
 Gamepad auto throttle handler. More...
 
void gamepadBrakeCallback (int value)
 Gamepad brake handler. More...
 
void gamepadClutchCallback (int value)
 Gamepad clutch handler. More...
 
void gamepadHighLightCallback (int value)
 Gamepad high light handler. More...
 
void gamepadIgnitionOFFCallback (int value)
 Gamepad ignition off handler. More...
 
void gamepadIgnitionONCallback (int value)
 Gamepad ignition on handler. More...
 
void gamepadLeftLightCallback (int value)
 Gamepad left light handler. More...
 
void gamepadMediumLightCallback (int value)
 Gamepad medium light handler. More...
 
void gamepadRightLightCallback (int value)
 Gamepad right light handler. More...
 
void gamepadSteeringWheelCallback (int value)
 Gamepad steering wheel handler. More...
 
void gamepadThrottleCallback (int value)
 Gamepad throttle handler. More...
 
void gamepadWarningCallback (int value)
 Gamepad warning light handler. More...
 
double map (double value, double min_value, double max_value, double min_required, double max_required)
 Linear mapping function. More...
 
virtual bool on_draw (const Cairo::RefPtr< Cairo::Context > &cr)
 On draw signal handler. More...
 

Protected Attributes

bool active_
 Status of the gamepad connection. More...
 
Glib::RefPtr< Gdk::Pixbuf > active_image_
 Pixbuf that hold the gamepad active thumbnail. More...
 
std::string active_path_
 Path to the gamepad image thumbnail. More...
 
Glib::RefPtr< Gdk::Pixbuf > auxiliary_image_
 Pixbuf that hold the gamepad auxiliary thumbnail. More...
 
atlascar_base::ManagerCommandPtr command_
 Outgoing manager command variable. More...
 
ros::Duration fade_
 Fade duration. More...
 
Gamepad gamepad_
 Gamepad communication class. More...
 
Glib::RefPtr< Gdk::Pixbuf > not_active_image_
 Pixbuf that hold the gamepad not active thumbnail. More...
 
ros::Time ta_
 Last activity time. More...
 

Detailed Description

Gamepad handler class.

This class handles communications with the gamepad, as well as the graphical representation of the gamepad. This class inherits a Gtk::DrawingArea

Definition at line 350 of file manager_gui.h.

Constructor & Destructor Documentation

GamepadInfo::GamepadInfo ( std::string  active_path = ros::package::getPath("atlascar_base")+"/images/xbox-360-controller_active_tumb.png")
inline

Class constructor.

This constructor receives the path to the gamepad image thumbnail. It also initializes variables and state images.

Definition at line 359 of file manager_gui.h.

GamepadInfo::~GamepadInfo ( )
inline

Class destructor.

Does nothing.

Definition at line 409 of file manager_gui.h.

Member Function Documentation

void GamepadInfo::gamepadAutoBrakeCallback ( int  value)
inlineprotected

Gamepad auto brake handler.

Parameters
valuebutton value

Gamepad auto brake event handler. This function is called every time the gamepad changes the auto brake value.

Definition at line 794 of file manager_gui.h.

void GamepadInfo::gamepadAutoClutchCallback ( int  value)
inlineprotected

Gamepad auto clutch handler.

Parameters
valuebutton value

Gamepad auto clutch event handler. This function is called every time the gamepad changes the auto clutch value.

Definition at line 811 of file manager_gui.h.

void GamepadInfo::gamepadAutoDirectionCallback ( int  value)
inlineprotected

Gamepad auto direction handler.

Parameters
valuebutton value

Gamepad auto direction event handler. This function is called every time the gamepad changes the auto direction value.

Definition at line 760 of file manager_gui.h.

void GamepadInfo::gamepadAutoThrottleCallback ( int  value)
inlineprotected

Gamepad auto throttle handler.

Parameters
valuebutton value

Gamepad auto throttle event handler. This function is called every time the gamepad changes the auto throttle value.

Definition at line 777 of file manager_gui.h.

void GamepadInfo::gamepadBrakeCallback ( int  value)
inlineprotected

Gamepad brake handler.

Parameters
valuebutton value

Gamepad brake event handler. This function is called every time the gamepad changes the brake value.

Definition at line 588 of file manager_gui.h.

void GamepadInfo::gamepadClutchCallback ( int  value)
inlineprotected

Gamepad clutch handler.

Parameters
valuebutton value

Gamepad clutch event handler. This function is called every time the gamepad changes the clutch value.

Definition at line 603 of file manager_gui.h.

void GamepadInfo::gamepadHighLightCallback ( int  value)
inlineprotected

Gamepad high light handler.

Parameters
valuebutton value

Gamepad high light event handler. This function is called every time the gamepad changes the high light value.

Definition at line 709 of file manager_gui.h.

void GamepadInfo::gamepadIgnitionOFFCallback ( int  value)
inlineprotected

Gamepad ignition off handler.

Parameters
valuebutton value

Gamepad ignition off event handler. This function is called every time the gamepad changes the ignition off value.

Definition at line 658 of file manager_gui.h.

void GamepadInfo::gamepadIgnitionONCallback ( int  value)
inlineprotected

Gamepad ignition on handler.

Parameters
valuebutton value

Gamepad ignition on event handler. This function is called every time the gamepad changes the ignition on value.

Definition at line 641 of file manager_gui.h.

void GamepadInfo::gamepadLeftLightCallback ( int  value)
inlineprotected

Gamepad left light handler.

Parameters
valuebutton value

Gamepad left light event handler. This function is called every time the gamepad changes the left light value.

Definition at line 675 of file manager_gui.h.

void GamepadInfo::gamepadMediumLightCallback ( int  value)
inlineprotected

Gamepad medium light handler.

Parameters
valuebutton value

Gamepad medium light event handler. This function is called every time the gamepad changes the medium light value.

Definition at line 726 of file manager_gui.h.

void GamepadInfo::gamepadRightLightCallback ( int  value)
inlineprotected

Gamepad right light handler.

Parameters
valuebutton value

Gamepad right light event handler. This function is called every time the gamepad changes the right light value.

Definition at line 692 of file manager_gui.h.

void GamepadInfo::gamepadSteeringWheelCallback ( int  value)
inlineprotected

Gamepad steering wheel handler.

Parameters
valuebutton value

Gamepad steering wheel event handler. This function is called every time the gamepad changes the steering wheel value.

Definition at line 626 of file manager_gui.h.

void GamepadInfo::gamepadThrottleCallback ( int  value)
inlineprotected

Gamepad throttle handler.

Parameters
valuebutton value

Gamepad throttle event handler. This function is called every time the gamepad changes the throttle value.

Definition at line 573 of file manager_gui.h.

void GamepadInfo::gamepadWarningCallback ( int  value)
inlineprotected

Gamepad warning light handler.

Parameters
valuebutton value

Gamepad warning light event handler. This function is called every time the gamepad changes the warning light value.

Definition at line 743 of file manager_gui.h.

bool GamepadInfo::initializeGamepad ( )
inline

Start communications with the gamepad and register callbacks.

This function initializes the communication with the gamepad and also registers all the callbacks to all the buttons and axes.

Definition at line 418 of file manager_gui.h.

double GamepadInfo::map ( double  value,
double  min_value,
double  max_value,
double  min_required,
double  max_required 
)
inlineprotected

Linear mapping function.

Parameters
valueinput value
min_valueminimum value in the old scale
max_valuemaximum value in the old scale
min_requiredminimum value in the requested scale
max_requiredmaximum value in the requested scale
Returns
the remapped value

This function maps a value to a different scale.

Definition at line 519 of file manager_gui.h.

virtual bool GamepadInfo::on_draw ( const Cairo::RefPtr< Cairo::Context > &  cr)
inlineprotectedvirtual

On draw signal handler.

Parameters
crcairo context

This function is called every time there is a redraw event on the DrawingArea.

Definition at line 536 of file manager_gui.h.

bool GamepadInfo::stateManager ( )
inline

Graphical representation state manager.

This function manages the current status of the image representation according to the most recent activity of the gamepad.

Definition at line 461 of file manager_gui.h.

bool GamepadInfo::touch ( )
inline

Mark gamepad activity.

This function updates the most recent use of the gamepad.

Definition at line 494 of file manager_gui.h.

Member Data Documentation

bool GamepadInfo::active_
protected

Status of the gamepad connection.

Definition at line 832 of file manager_gui.h.

Glib::RefPtr<Gdk::Pixbuf> GamepadInfo::active_image_
protected

Pixbuf that hold the gamepad active thumbnail.

Definition at line 825 of file manager_gui.h.

std::string GamepadInfo::active_path_
protected

Path to the gamepad image thumbnail.

Definition at line 823 of file manager_gui.h.

Glib::RefPtr<Gdk::Pixbuf> GamepadInfo::auxiliary_image_
protected

Pixbuf that hold the gamepad auxiliary thumbnail.

Definition at line 829 of file manager_gui.h.

atlascar_base::ManagerCommandPtr GamepadInfo::command_
protected

Outgoing manager command variable.

Definition at line 840 of file manager_gui.h.

std::string GamepadInfo::device_

Gamepad device parameter.

Definition at line 502 of file manager_gui.h.

sigc::slot<void,const atlascar_base::ManagerCommandPtr> GamepadInfo::event_

Event slot, this event will be called when there is activity with the gamepad.

Definition at line 504 of file manager_gui.h.

ros::Duration GamepadInfo::fade_
protected

Fade duration.

Definition at line 836 of file manager_gui.h.

Gamepad GamepadInfo::gamepad_
protected

Gamepad communication class.

Definition at line 838 of file manager_gui.h.

Glib::RefPtr<Gdk::Pixbuf> GamepadInfo::not_active_image_
protected

Pixbuf that hold the gamepad not active thumbnail.

Definition at line 827 of file manager_gui.h.

ros::Time GamepadInfo::ta_
protected

Last activity time.

Definition at line 834 of file manager_gui.h.


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


atlascar_base
Author(s): Jorge Almeida, Sérgio Pinho, Miguel Oliveira, Pedro Salvado, Andre Oliveira and Pedro Pinheiro
autogenerated on Mon Mar 2 2015 01:31:23