#include <factoryjob.h>
Public Slots | |
| void | updateTable () |
| void | createProcess () |
| void | createAutoProcess () |
| void | procesaTrabajo () |
| void | errorControl () |
| void | reconfigPaths (QStringList) |
Public Member Functions | |
| FactoryJob (QString, QTime) | |
| ~FactoryJob () | |
| QStandardItemModel * | getSIM () |
| void | setSIM (QStandardItemModel *) |
| int | headerData (QStandardItemModel *, QString) |
| void | setHeaderData (QStandardItemModel *, QStringList) |
Private Member Functions | |
| QStringList | readJob () |
| bool | removeChilds (QModelIndex, int, int) |
Private Attributes | |
| QProcess * | m_proc |
| Contains the object to execute commands. | |
| QStandardItemModel * | m_model |
| Contains the model. | |
| int | m_numRowSchedd |
| Contains the num of schedd. | |
| int | m_numRow |
| Contains the num of jobs. | |
| int | m_numRowChild |
| Contains the num of clusters in a job. | |
| QStringList | m_paths |
| Contains the configuration files. | |
| int | m_time |
| Contains the miliseconds to refresh the model. | |
| int | m_numColumns |
| Contains the number of columns of the model. | |
| FactoryJob::FactoryJob | ( | QString | fileConfig, | |
| QTime | time | |||
| ) |
Construct a model following the config file params and with an autorefresh timer. This constructor create a new QStandardItemModel, initialized the headers of this model reading the config * file and create an autoprocess to autorefresh the content of the model (FactoryJob::createAutoProcess()).
| fileConfig | file that contains the job params | |
| time | time for autorefresh |
| FactoryJob::~FactoryJob | ( | ) |
Destructor
| void FactoryJob::createAutoProcess | ( | ) | [slot] |
This function execute the command condor_q -long -global every X minuts (specify in the constructor of the * class)
| void FactoryJob::createProcess | ( | ) | [slot] |
This function is called when the user force a refresh of the model
| void FactoryJob::errorControl | ( | ) | [slot] |
show a message with the QProcess output.
| QStandardItemModel * FactoryJob::getSIM | ( | ) |
Returns the StandardItemModel
| int FactoryJob::headerData | ( | QStandardItemModel * | model, | |
| QString | header | |||
| ) |
returns the column of the model with the header specify
| model | ||
| header |
| void FactoryJob::procesaTrabajo | ( | ) | [slot] |
This function filter every line generate by the function FactoryJob::readJob() and include all params into the * model. Selecting the ProcId, ClusterId and ScheddName, the function put the new job in a new brach or only * as a new child of the actual branch.
| QStringList FactoryJob::readJob | ( | ) | [private] |
read all params of a condor job. One condor job is specify between to blank lines of the command condor_q -long every line of this job contains a param and it's value. This function analyse this line and split by '=': left part contains the header (or the param) and right part contains the value
| void FactoryJob::reconfigPaths | ( | QStringList | paths | ) | [slot] |
reconfigure the path with the headers (usually condorqview.config)
| bool FactoryJob::removeChilds | ( | QModelIndex | parent, | |
| int | from, | |||
| int | to | |||
| ) | [private] |
remove the child rows
| parent | ||
| from | ||
| to |
| void FactoryJob::setHeaderData | ( | QStandardItemModel * | model, | |
| QStringList | header | |||
| ) |
Set the headerData of the model
| model | ||
| header | QStringList with the headers |
| void FactoryJob::setSIM | ( | QStandardItemModel * | model | ) |
set a new QStandardItemModel
| model |
| void FactoryJob::updateTable | ( | ) | [slot] |
This function update model (in this case is a tree model). If the process that execute the command (condor_q) fails, it shows an error message. In other wise read the output of the command.
1.4.7