trikRuntime
trikGui::Controller Class Reference

Provides backend features like Qt Script runner for frontend. More...

#include <controller.h>

Inheritance diagram for trikGui::Controller:
Collaboration diagram for trikGui::Controller:

Public Slots

void abortExecution ()
 Cancels execution of current program. More...
 

Signals

void showRunningWidget (const QString &fileName, int scriptId)
 Emitted when a new script starts and therefore a running widget must be shown with the script's name. More...
 
void hideRunningWidget (int scriptId)
 Emitted when running widget for a script with a given id must be closed. More...
 
void showError (const QString &error, int scriptId)
 Emitted when a script stops due to an error. More...
 
void hideGraphicsWidget ()
 Emitted when a graphics widget must be closed. More...
 
void hideScriptWidgets ()
 Emitted when both graphics and running widget must be closed. More...
 
void brickStopped ()
 Emitted when brick has finished deferred deinitialization so we need to refresh display to clear possible clutter from videosensors. More...
 
void gamepadDisconnected ()
 Emitted when a robot is disconnected from a gamepad. More...
 
void gamepadConnected ()
 Emitted when a robot is connected to a gamepad. More...
 
void wiFiConnected ()
 Emitted when a robot is connected to a network. More...
 
void wiFiDisconnected ()
 Emitted when a robot is disconnected from a network. More...
 
void communicatorStatusChanged (bool status)
 Emitted when Telemetry and Communicator servers' status changes. More...
 
void mailboxStatusChanged (bool connected)
 Emitted when Mailbox server's status changes. More...
 

Public Member Functions

 Controller (const QString &configPath)
 Constructor. More...
 
 ~Controller () override
 
void runFile (const QString &filePath)
 Executes specified file as Qt Script, if it has .qts extension, or as a program otherwise. More...
 
void runScript (const QString &script)
 Executes given script. More...
 
trikControl::BrickInterfacebrick ()
 Returns reference to Brick object, which provides access to robot hardware. More...
 
trikNetwork::MailboxInterfacemailbox ()
 Returns reference to Mailbox object, which provides access to robot-to-robot communications. More...
 
trikWiFi::TrikWiFiwiFi ()
 Reference to WiFi manager. More...
 
void doCloseRunningWidget (MainWidget &widget)
 Asks controller to correctly close given running widget. More...
 
bool communicatorConnectionStatus ()
 Returns communicator connection status (whether or not both Telemetry and Communicator servers are connected). More...
 
bool gamepadConnectionStatus () const
 Returns gamepad connection status. More...
 

Detailed Description

Provides backend features like Qt Script runner for frontend.

Constructor & Destructor Documentation

Controller::Controller ( const QString &  configPath)
explicit

Constructor.

Parameters
configPath- path to config file for trikControl, for example, /home/root/trik/.
Controller::~Controller ( )
override

Member Function Documentation

void Controller::abortExecution ( )
slot

Cancels execution of current program.

trikControl::BrickInterface & Controller::brick ( )

Returns reference to Brick object, which provides access to robot hardware.

void trikGui::Controller::brickStopped ( )
signal

Emitted when brick has finished deferred deinitialization so we need to refresh display to clear possible clutter from videosensors.

bool Controller::communicatorConnectionStatus ( )

Returns communicator connection status (whether or not both Telemetry and Communicator servers are connected).

void trikGui::Controller::communicatorStatusChanged ( bool  status)
signal

Emitted when Telemetry and Communicator servers' status changes.

Parameters
status- true if both servers are connected.
void trikGui::Controller::doCloseRunningWidget ( MainWidget widget)

Asks controller to correctly close given running widget.

void trikGui::Controller::gamepadConnected ( )
signal

Emitted when a robot is connected to a gamepad.

bool Controller::gamepadConnectionStatus ( ) const

Returns gamepad connection status.

void trikGui::Controller::gamepadDisconnected ( )
signal

Emitted when a robot is disconnected from a gamepad.

void trikGui::Controller::hideGraphicsWidget ( )
signal

Emitted when a graphics widget must be closed.

void trikGui::Controller::hideRunningWidget ( int  scriptId)
signal

Emitted when running widget for a script with a given id must be closed.

void trikGui::Controller::hideScriptWidgets ( )
signal

Emitted when both graphics and running widget must be closed.

trikNetwork::MailboxInterface * Controller::mailbox ( )

Returns reference to Mailbox object, which provides access to robot-to-robot communications.

Does not pass ownership to the caller.

void trikGui::Controller::mailboxStatusChanged ( bool  connected)
signal

Emitted when Mailbox server's status changes.

void Controller::runFile ( const QString &  filePath)

Executes specified file as Qt Script, if it has .qts extension, or as a program otherwise.

void Controller::runScript ( const QString &  script)

Executes given script.

void trikGui::Controller::showError ( const QString &  error,
int  scriptId 
)
signal

Emitted when a script stops due to an error.

void trikGui::Controller::showRunningWidget ( const QString &  fileName,
int  scriptId 
)
signal

Emitted when a new script starts and therefore a running widget must be shown with the script's name.

trikWiFi::TrikWiFi & Controller::wiFi ( )

Reference to WiFi manager.

void trikGui::Controller::wiFiConnected ( )
signal

Emitted when a robot is connected to a network.

void trikGui::Controller::wiFiDisconnected ( )
signal

Emitted when a robot is disconnected from a network.


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