15 #ifndef BORNAGAIN_GUI_MODEL_MODEL_JOBQUEUEDATA_H
16 #define BORNAGAIN_GUI_MODEL_MODEL_JOBQUEUEDATA_H
48 void cancelJob(
const QString& identifier);
49 void removeJob(
const QString& identifier);
59 QThread*
getThread(
const QString& identifier);
The JobQueueData class holds all objects/logic to run simulation in a thread.
JobWorker * getWorker(const QString &identifier)
Returns job runner for given identifier.
void onStartedJob()
Sets JobItem properties when the job is going to start.
void focusRequest(JobItem *jobItem)
void updateGlobalProgress()
Estimates global progress from the progress of multiple running jobs and emits appropriate signal.
QThread * getThread(const QString &identifier)
Returns the thread for given identifier.
JobQueueData(JobModel *jobModel)
ISimulation * getSimulation(const QString &identifier)
Returns the simulation (if exists) for given identifier.
void removeJob(const QString &identifier)
Remove job from list completely.
void processFinishedJob(JobWorker *worker, JobItem *jobItem)
Set all data of finished job.
void cancelJob(const QString &identifier)
Cancels running job.
QMap< QString, ISimulation * > m_simulations
job identifier to jobWorker
void clearSimulation(const QString &identifier)
void onFinishedJob()
Performs necessary actions when job is finished.
void assignForDeletion(QThread *thread)
Removes QThread from the map of known threads, assigns it for deletion.
JobModel * m_jobModel
job identifier to simulation
QMap< QString, JobWorker * > m_workers
job identifier to the thread
QMap< QString, QThread * > m_threads
void runJob(JobItem *jobItem)
Submits job and run it in a thread.
void onCancelAllJobs()
Cancels all running jobs.
The JobWorker class provides running the domain simulation in a thread.