Skip to content
Snippets Groups Projects
Commit 70fea32e authored by C-Glick's avatar C-Glick
Browse files

Added comments to worker functions

parent c21e0f5f
No related branches found
No related tags found
3 merge requests!76lots of gui updates,!75Lost of gui updates,!74lots of gui updates among others
......@@ -19,6 +19,12 @@ ControlWorker::~ControlWorker()
disconnectBackend();
}
/**
* @brief ControlWorker::connectBackend
* Command the worker to connect to the backend
* will set the private class struct, conn, once done.
* The connected() signal is emitted once complete.
*/
void ControlWorker::connectBackend()
{
if (conn == NULL) {
......@@ -29,6 +35,12 @@ void ControlWorker::connectBackend()
}
}
/**
* @brief ControlWorker::disconnectBackend
* Command the worker to disconnect from the backend,
* sets the conn struct to null and emits the
* disconnected() signal once complete
*/
void ControlWorker::disconnectBackend()
{
if (conn) {
......@@ -38,6 +50,10 @@ void ControlWorker::disconnectBackend()
}
}
/**
* @brief ControlWorker::getNodes
* Get the nodes from the quad to display
*/
void ControlWorker::getNodes()
{
if (conn) {
......@@ -117,6 +133,12 @@ void ControlWorker::getNodes()
}
}
/**
* Return a node by its ID string
* @brief ControlWorker::getNodeId
* @param node
* @return
*/
frontend_node_data ControlWorker::getNodeId(QString node)
{
if (nodeIdCache.contains(node)) {
......@@ -130,6 +152,13 @@ frontend_node_data ControlWorker::getNodeId(QString node)
}
}
/**
* get the parameters of the given node in the control graph.
* Result passed back to the main thread through a signal
* @brief ControlWorker::getParams
* @param node
*/
void ControlWorker::getParams(QString node)
{
if (conn) {
......@@ -146,12 +175,19 @@ void ControlWorker::getParams(QString node)
for (ssize_t j = 0; j < type->n_params; j++) {
params.append(QString(type->param_names[j]));
}
//pass the data back to the main thread
emit(gotParams(params));
}
}
/**
* Get a specific parameter of a specific node in the control graph.
* Returned through a signal that must be connected to.
* @brief ControlWorker::getParamValue
* @param node
* @param param
*/
void ControlWorker::getParamValue(QString node, QString param)
{
if (conn) {
......@@ -177,6 +213,11 @@ void ControlWorker::getParamValue(QString node, QString param)
}
}
/**
* Retrieve a node's output, return through a signal that must be connected to
* @brief ControlWorker::getNodeOutput
* @param node
*/
void ControlWorker::getNodeOutput(QString node)
{
if (conn) {
......@@ -196,6 +237,13 @@ void ControlWorker::getNodeOutput(QString node)
}
}
/**
* Set a parameter value of a specifc node in the control graph
* @brief ControlWorker::setParamValue
* @param node
* @param param
* @param value
*/
void ControlWorker::setParamValue(QString node, QString param, float value)
{
if (conn) {
......
......@@ -7,6 +7,11 @@
#include "frontend_common.h"
#include "frontend_nodes.h"
/**
* The contol worker handles managing the control graph nodes and edges.
* It can get, and set node parameters.
* @brief The ControlWorker class
*/
class ControlWorker : public QObject
{
Q_OBJECT
......
......@@ -14,7 +14,12 @@ TrackerWorker::~TrackerWorker()
{
disconnectBackend();
}
/**
* @brief TrackerWorker::connectBackend
* Command the worker to connect to the backend
* will set the private class struct, conn, once done.
* The connected() signal is emitted once complete.
*/
void TrackerWorker::connectBackend()
{
if (conn == NULL) {
......@@ -25,6 +30,12 @@ void TrackerWorker::connectBackend()
}
}
/**
* @brief TrackerWorker::disconnectBackend
* Command the worker to disconnect from the backend,
* sets the conn struct to null and emits the
* disconnected() signal once complete
*/
void TrackerWorker::disconnectBackend()
{
if (conn) {
......@@ -34,6 +45,10 @@ void TrackerWorker::disconnectBackend()
}
}
/**
* @brief TrackerWorker::process
* Recieve tracking data from the backend from the VRPN system
*/
void TrackerWorker::process()
{
if (conn) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment