FactoryMachine Class Reference

Implements the model to control the parameters of the condor machines. More...

#include <factorymachine.h>

List of all members.

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.


Detailed Description

Implements the model to control the parameters of the condor machines.

Author:
Author
Nuria Fernández
Version:
Revision
1.0
Date:
2007/01/11 14:16:20
This model consist as a table model.The parent of the model is a QModelIndex where the childs are all the machines that contains condor_status -long command. I.e.: QModelIndex parent:


Constructor & Destructor Documentation

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()).

Parameters:
fileConfig file that contains the machine params
time time for autorefresh


Member Function Documentation

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

Returns:
QStandardItemModel

int FactoryMachine::headerData ( QStandardItemModel *  model,
QString  header 
)

returns the column of the model with the header specify

Parameters:
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)

Parameters:
paths address of new files

void FactoryMachine::reconfigRefresh ( QTime  time  )  [slot]

reconfigure timers of refresh model

Parameters:
time 

void FactoryMachine::setHeaderData ( QStandardItemModel *  model,
QStringList  header 
)

Set the headerData of the model

Parameters:
model 
header QStringList with the headers

void FactoryMachine::setSIM ( QStandardItemModel *  model  ) 

set a new QStandardItemModel

Parameters:
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.


The documentation for this class was generated from the following files:
Generated on Sun Jan 14 23:38:42 2007 for QCondor by  doxygen 1.4.7