#include <factorymachine.h>
Public Slots | |
void | updateTable () |
void | createProcess () |
void | createAutoProcess () |
void | procesaMaquina () |
void | errorControl () |
void | reconfigPaths (QStringList) |
void | reconfigRefresh (QTime) |
Public Member Functions | |
FactoryMachine (QString, QTime) | |
QStandardItemModel * | getSIM () |
void | setSIM (QStandardItemModel *) |
void | setHeaderData (QStandardItemModel *, QStringList) |
int | headerData (QStandardItemModel *, QString) |
Private Attributes | |
QProcess * | m_proc |
Contains the object for execute commands. | |
QStandardItemModel * | m_model |
Contains the model. | |
int | m_numRow |
Contains the number of machines. | |
QStringList | m_paths |
Contains the configuration files. | |
int | m_time |
Contains the refresh timer (in miliseconds). | |
int | m_numColumns |
Contains the number of columns in the model. |
FactoryMachine::FactoryMachine | ( | 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 (FactoryMachine::createAutoProcess()).
fileConfig | file that contains the machine params | |
time | time for autorefresh |
void FactoryMachine::createAutoProcess | ( | ) | [slot] |
This function execute the command condor_status -l every X minuts (specify in the constructor of the class)
void FactoryMachine::createProcess | ( | ) | [slot] |
This function is called when the user force a refresh of the model
void FactoryMachine::errorControl | ( | ) | [slot] |
show a message with the QProcess output.
QStandardItemModel * FactoryMachine::getSIM | ( | ) |
Returns the StandardItemModel
int FactoryMachine::headerData | ( | QStandardItemModel * | model, | |
QString | header | |||
) |
returns the column of the model with the header specify
model | ||
header |
void FactoryMachine::procesaMaquina | ( | ) | [slot] |
This function filter every line generate the output of the command condor_status. Every machine is specify between two blank lines. This function read every line and put its contents into model. When all the params of one machine are processed, a new process call another time this function, until arrive at the end of the output.
void FactoryMachine::reconfigPaths | ( | QStringList | paths | ) | [slot] |
reconfigure the path with the headers (usually condorqview.config)
paths | address of new files |
void FactoryMachine::reconfigRefresh | ( | QTime | time | ) | [slot] |
reconfigure timers of refresh model
time |
void FactoryMachine::setHeaderData | ( | QStandardItemModel * | model, | |
QStringList | header | |||
) |
Set the headerData of the model
model | ||
header | QStringList with the headers |
void FactoryMachine::setSIM | ( | QStandardItemModel * | model | ) |
set a new QStandardItemModel
model |
void FactoryMachine::updateTable | ( | ) | [slot] |
This function update model (in this case is a table model). If the process that execute the command (condor_status) fails, it shows an error message. In other wise read the output of the command.