FactoryJob Class Reference

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

#include <factoryjob.h>

List of all members.

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.


Detailed Description

Implements the model to control the parameters of condor jobs.

Author:
Author
Nuria Fernández
Version:
Revision
1.0
Date:
2007/01/11 14:16:20
This model consist as a tree model.The parent of the model is a QModelIndex where the childs are all the schedulers that contains condor_q -long -global command. Every scheduler contains its own jobs. If a job is a cluster of jobs, the first job have to be a new child of the scheduler and the others have to be a child of this job. I.e.: QModelIndex parent:


Constructor & Destructor Documentation

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

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

FactoryJob::~FactoryJob (  ) 

Destructor


Member Function Documentation

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

Returns:
QStandardItemModel

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

returns the column of the model with the header specify

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

Returns:
QStringList with all params following by the correct values ([param][value][param][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

Parameters:
parent 
from 
to 

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

Set the headerData of the model

Parameters:
model 
header QStringList with the headers

void FactoryJob::setSIM ( QStandardItemModel *  model  ) 

set a new QStandardItemModel

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


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