COPASI API  4.16.103
Public Slots | Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | List of all members
TaskWidget Class Referenceabstract

#include <TaskWidget.h>

Inheritance diagram for TaskWidget:
Inheritance graph
[legend]
Collaboration diagram for TaskWidget:
Collaboration graph
[legend]

Public Slots

void adjustTable ()
 
void slotFinishThread ()
 

Public Member Functions

CCopasiTaskgetTask ()
 
virtual bool leave ()
 
virtual bool runTask ()=0
 
 TaskWidget (QWidget *parent=0, const char *name=0, Qt::WFlags fl=0)
 
virtual bool update (ListViews::ObjectType objectType, ListViews::Action action, const std::string &key)
 
 ~TaskWidget ()
 
- Public Member Functions inherited from CopasiWidget
 CopasiWidget (QWidget *parent=0, const char *name=0, Qt::WFlags f=0)
 
bool enter (const std::string &key)
 
CCopasiDataModelgetDataModel ()
 
bool getIgnoreUpdates ()
 
virtual void setFramework (int framework)
 
void setIgnoreUpdates (bool v)
 

Protected Slots

void assistantBtnClicked ()
 
void reportBtnClicked ()
 
void revertBtnClicked ()
 
void runBtnClicked ()
 
- Protected Slots inherited from CopasiWidget
virtual bool protectedNotify (ListViews::ObjectType objectType, ListViews::Action action, const std::string &key="")
 

Protected Member Functions

bool commonAfterRunTask ()
 
bool commonBeforeRunTask ()
 
bool commonRunTask ()
 
virtual CCopasiMethodcreateMethod (const CCopasiMethod::SubType &type)=0
 
virtual bool enterProtected ()
 
void finishTask ()
 
bool loadCommon ()
 
bool loadMethod ()
 
virtual bool loadTask ()=0
 
bool saveCommon ()
 
bool saveMethod ()
 
virtual bool saveTask ()=0
 
virtual bool taskFinishedEvent ()
 

Protected Attributes

bool mChanged
 
CQTaskBtnWidgetmpBtnWidget
 
CQTaskHeaderWidgetmpHeaderWidget
 
CCopasiMethodmpMethod
 
QGridLayout * mpMethodLayout
 
CQTaskMethodWidgetmpMethodWidget
 
CProgressBarmProgressBar
 
QSpacerItem * mpSpacer1
 
QSpacerItem * mpSpacer2
 
CCopasiTaskmpTask
 
CQTaskThreadmpTaskThread
 
- Protected Attributes inherited from CopasiWidget
int mFramework
 
bool mIgnoreUpdates
 
std::string mKey
 
CCopasiDataModelmpDataModel
 
ListViewsmpListView
 
CCopasiObjectmpObject
 

Detailed Description

Definition at line 57 of file TaskWidget.h.

Constructor & Destructor Documentation

TaskWidget::TaskWidget ( QWidget *  parent = 0,
const char *  name = 0,
Qt::WFlags  fl = 0 
)

Definition at line 52 of file TaskWidget.cpp.

References assistantBtnClicked(), mpBtnWidget, mpHeaderWidget, mpMethodWidget, mpTaskThread, reportBtnClicked(), revertBtnClicked(), runBtnClicked(), and slotFinishThread().

52  :
53  CopasiWidget(parent, name, fl),
54  mProgressBar(NULL),
55  mpHeaderWidget(NULL),
56  mpMethodWidget(NULL),
57  mpBtnWidget(NULL),
58  mpMethodLayout(NULL),
59  mpSpacer1(NULL),
60  mpSpacer2(NULL),
61  mpTask(NULL),
62  mpMethod(NULL),
63  mChanged(false)
64 {
65  if (!name)
66  setObjectName("TaskWidget");
67 
68  setWindowTitle(trUtf8("TaskWidget"));
69 
70  mpTaskThread = new CQTaskThread(this);
71 
74  mpBtnWidget = new CQTaskBtnWidget(this);
75 
76  connect(mpBtnWidget->mpBtnRun, SIGNAL(clicked()), this, SLOT(runBtnClicked()));
77  connect(mpBtnWidget->mpBtnRevert, SIGNAL(clicked()), this, SLOT(revertBtnClicked()));
78  connect(mpBtnWidget->mpBtnReport, SIGNAL(clicked()), this, SLOT(reportBtnClicked()));
79  connect(mpBtnWidget->mpBtnAssistant, SIGNAL(clicked()), this, SLOT(assistantBtnClicked()));
80 
81  connect(mpTaskThread, SIGNAL(finished()), this, SLOT(slotFinishThread()));
82 }
QGridLayout * mpMethodLayout
Definition: TaskWidget.h:125
void runBtnClicked()
Definition: TaskWidget.cpp:208
QSpacerItem * mpSpacer1
Definition: TaskWidget.h:127
QSpacerItem * mpSpacer2
Definition: TaskWidget.h:128
CProgressBar * mProgressBar
Definition: TaskWidget.h:121
bool mChanged
Definition: TaskWidget.h:133
CopasiWidget(QWidget *parent=0, const char *name=0, Qt::WFlags f=0)
CCopasiTask * mpTask
Definition: TaskWidget.h:130
void assistantBtnClicked()
Definition: TaskWidget.cpp:228
CQTaskMethodWidget * mpMethodWidget
Definition: TaskWidget.h:123
void slotFinishThread()
Definition: TaskWidget.cpp:455
void revertBtnClicked()
Definition: TaskWidget.cpp:193
CQTaskBtnWidget * mpBtnWidget
Definition: TaskWidget.h:124
CQTaskHeaderWidget * mpHeaderWidget
Definition: TaskWidget.h:122
bool fl(const C_FLOAT64 &d1, const C_FLOAT64 &d2)
CQTaskThread * mpTaskThread
Definition: TaskWidget.h:134
void reportBtnClicked()
Definition: TaskWidget.cpp:216
CCopasiMethod * mpMethod
Definition: TaskWidget.h:131
TaskWidget::~TaskWidget ( )

Definition at line 84 of file TaskWidget.cpp.

References mpTaskThread, and pdelete.

85 {
87 }
#define pdelete(p)
Definition: copasi.h:215
CQTaskThread * mpTaskThread
Definition: TaskWidget.h:134

Member Function Documentation

void TaskWidget::adjustTable ( )
slot

Definition at line 293 of file TaskWidget.cpp.

Referenced by CopasiUI3Window::slotFontSelection().

294 {
295 #ifdef DEBUG_UI
296  qDebug() << "--> TaskWidget::adjustTable <--";
297 #endif
298 
299  // mpTblParameter->resizeColumnsToContents();
300  // mpTblParameter->resizeRowsToContents();
301 
302  /*
303  mpTblParameter->setFixedSize(mpTblParameter->columnWidth(0) + mpTblParameter->verticalHeader()->sizeHint().width() + 5,
304  mpTblParameter->verticalHeader()->sizeHint().height() * mpTblParameter->rowCount() + 5);
305  */
306 }
void TaskWidget::assistantBtnClicked ( )
protectedslot

Definition at line 228 of file TaskWidget.cpp.

References ListViews::ADD, mpTask, ListViews::PLOT, CopasiWidget::protectedNotify(), saveTask(), and DefaultPlotDialog::setTask().

Referenced by TaskWidget().

229 {
230  if (!mpTask) return;
231 
232  saveTask(); //this is necessary since the output may use information from the problem
233 
234  DefaultPlotDialog * pDlg = new DefaultPlotDialog(this);
235  pDlg->setTask(mpTask);
236 
237  if (pDlg->exec() == QDialog::Accepted)
238  {
240  }
241 
242  if (pDlg)delete pDlg;
243 }
virtual void setTask(CCopasiTask *t)
CCopasiTask * mpTask
Definition: TaskWidget.h:130
virtual bool protectedNotify(ListViews::ObjectType objectType, ListViews::Action action, const std::string &key="")
virtual bool saveTask()=0
bool TaskWidget::commonAfterRunTask ( )
protected

Definition at line 365 of file TaskWidget.cpp.

References ListViews::CHANGE, CCopasiMessage::clearDeque(), CProgressBar::finish(), CCopasiRootContainer::getDatamodelList(), CopasiUI3Window::getMainWindow(), loadTask(), mProgressBar, mpTask, CopasiWidget::protectedNotify(), CCopasiTask::setCallBack(), ListViews::STATE, CopasiUI3Window::suspendAutoSave(), CModel::updateNonSimulatedValues(), and CModel::updateSimulatedValues().

Referenced by finishTask().

366 {
367  if (!mpTask) return false;
368 
369  if (mProgressBar != NULL)
370  {
371  mProgressBar->finish();
372  mProgressBar->deleteLater();
373  mProgressBar = NULL;
374  }
375 
376  mpTask->setCallBack(NULL);
377 
379 
380  assert(CCopasiRootContainer::getDatamodelList()->size() > 0);
381  (*CCopasiRootContainer::getDatamodelList())[0]->finish();
382 
383  // Update all values shown in the GUI
384  CModel * pModel = (*CCopasiRootContainer::getDatamodelList())[0]->getModel();
385  pModel->updateSimulatedValues(true);
386  pModel->updateNonSimulatedValues();
387 
389  unsetCursor();
391 
392  return loadTask();
393 }
virtual bool setCallBack(CProcessReport *pCallBack)
void suspendAutoSave(const bool &suspend)
virtual bool loadTask()=0
void updateNonSimulatedValues(void)
Definition: CModel.cpp:1892
void updateSimulatedValues(const bool &updateMoieties)
Definition: CModel.cpp:1851
CProgressBar * mProgressBar
Definition: TaskWidget.h:121
static CopasiUI3Window * getMainWindow()
static void clearDeque()
static CCopasiVector< CCopasiDataModel > * getDatamodelList()
CCopasiTask * mpTask
Definition: TaskWidget.h:130
virtual bool protectedNotify(ListViews::ObjectType objectType, ListViews::Action action, const std::string &key="")
virtual bool finish()
Definition: CModel.h:50
bool TaskWidget::commonBeforeRunTask ( )
protected

Definition at line 317 of file TaskWidget.cpp.

References CopasiUI3Window::autoSave(), CCopasiMessage::clearDeque(), CReport::confirmOverwrite(), CProgressBar::create(), CQMessageBox::critical(), CCopasiMessage::getAllMessageText(), CopasiUI3Window::getMainWindow(), CCopasiTask::getReport(), CReport::getTarget(), mProgressBar, mpTask, saveTask(), CCopasiTask::setCallBack(), and CopasiUI3Window::suspendAutoSave().

Referenced by CQCrossSectionTaskWidget::runTask(), CQMoietiesTaskWidget::runTask(), CQLNAWidget::runTask(), CQLyapWidget::runTask(), CQMCAWidget::runTask(), CQFittingWidget::runTask(), CQEFMWidget::runTask(), CQOptimizationWidget::runTask(), ScanWidget::runTask(), CQTSSAWidget::runTask(), SensitivitiesWidget::runTask(), SteadyStateWidget::runTask(), and CQTrajectoryWidget::runTask().

318 {
319  // save the state of the widget
320  if (!saveTask())
321  {
322  CQMessageBox::critical(this, "Simulation Error",
324  QMessageBox::Ok | QMessageBox::Default, QMessageBox::NoButton);
325  return false;
326  }
327 
328  if (!mpTask) return false;
329 
330  if (mProgressBar != NULL)
331  {
332  //CQMessageBox::critical(this, "Task in Progress",
333  // "A task is currently running, another cannot be started before the current task ended.",
334  // QMessageBox::Ok | QMessageBox::Default, QMessageBox::NoButton);
335  return false;
336  }
337 
338  // if overwrite is enabled and the file exists, then ask
339  if (!mpTask->getReport().getTarget().empty() &&
341  QFile(mpTask->getReport().getTarget().c_str()).exists())
342  {
343  if (QMessageBox::question(this,
344  QString("Confirm Overwrite"),
345  QString("The report file already exists. Would you like to overwrite it? \n\n(You can disable this dialog by clicking the 'Report' button.)"),
346  QMessageBox::Yes, QMessageBox::No) == QMessageBox::No)
347  return false;
348  }
349 
350  //set mouse cursor
351  setCursor(Qt::WaitCursor);
352 
353  //handle autosave feature
356 
357  //create progress bar
360 
362  return true;
363 }
virtual bool setCallBack(CProcessReport *pCallBack)
const bool & confirmOverwrite() const
Definition: CReport.cpp:101
void suspendAutoSave(const bool &suspend)
static CProgressBar * create(QWidget *parent=0, const char *name=0, Qt::WindowModality windowModality=Qt::WindowModal)
static std::string getAllMessageText(const bool &chronological=true)
const std::string & getTarget() const
Definition: CReport.cpp:89
CProgressBar * mProgressBar
Definition: TaskWidget.h:121
static CopasiUI3Window * getMainWindow()
static void clearDeque()
CCopasiTask * mpTask
Definition: TaskWidget.h:130
CReport & getReport()
static StandardButton critical(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons=Ok, StandardButton defaultButton=NoButton)
virtual bool saveTask()=0
bool TaskWidget::commonRunTask ( )
protected

Definition at line 395 of file TaskWidget.cpp.

References C_INT, CCopasiMessage::clearDeque(), CCopasiMessage::COMMANDLINE, CQMessageBox::critical(), CCopasiMessage::ERROR, CProgressBar::finish(), finishTask(), CCopasiMessage::getAllMessageText(), CCopasiRootContainer::getDatamodelList(), CCopasiMessage::getHighestSeverity(), CCopasiMessage::getNumber(), CCopasiTask::initialize(), MCCopasiMessage, mProgressBar, mpTask, mpTaskThread, CCopasiTask::OUTPUT_UI, CCopasiMessage::peekLastMessage(), and CQMessageBox::question().

Referenced by CQCrossSectionTaskWidget::runTask(), CQMoietiesTaskWidget::runTask(), CQLNAWidget::runTask(), CQLyapWidget::runTask(), CQMCAWidget::runTask(), CQFittingWidget::runTask(), CQEFMWidget::runTask(), CQOptimizationWidget::runTask(), ScanWidget::runTask(), CQTSSAWidget::runTask(), SensitivitiesWidget::runTask(), SteadyStateWidget::runTask(), and CQTrajectoryWidget::runTask().

396 {
397  // Initialize the task
398  try
399  {
400  assert(CCopasiRootContainer::getDatamodelList()->size() > 0);
401 
404  }
405 
406  catch (CCopasiException & /*Exception*/)
407  {
409  {
410  if (mProgressBar != NULL) mProgressBar->finish();
411 
412  CQMessageBox::critical(this, "Initialization Error",
414  QMessageBox::Ok | QMessageBox::Default, QMessageBox::NoButton);
415 
416  finishTask();
417  return false;
418  }
419  }
420 
422  {
423  if (mProgressBar != NULL) mProgressBar->finish();
424 
425  CQMessageBox::critical(this, "Initialization Error",
427  QMessageBox::Ok | QMessageBox::Default, QMessageBox::NoButton);
428 
429  finishTask();
430  return false;
431  }
432 
434  {
435  C_INT Result =
436  CQMessageBox::question(this, "Initialization Warning",
438  QMessageBox::Ignore | QMessageBox::Abort, QMessageBox::Ignore);
439 
440  if (Result == QMessageBox::Abort)
441  {
442  finishTask();
443  return false;
444  }
445  }
446 
448 
449  // Execute the task
450  mpTaskThread->start();
451 
452  return true;
453 }
#define C_INT
Definition: copasi.h:115
static const CCopasiMessage & peekLastMessage()
void finishTask()
Definition: TaskWidget.cpp:474
virtual bool initialize(const OutputFlag &of, COutputHandler *pOutputHandler, std::ostream *pOstream)
static std::string getAllMessageText(const bool &chronological=true)
const size_t & getNumber() const
CProgressBar * mProgressBar
Definition: TaskWidget.h:121
static void clearDeque()
#define MCCopasiMessage
static CCopasiVector< CCopasiDataModel > * getDatamodelList()
CCopasiTask * mpTask
Definition: TaskWidget.h:130
static StandardButton critical(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons=Ok, StandardButton defaultButton=NoButton)
virtual bool finish()
CQTaskThread * mpTaskThread
Definition: TaskWidget.h:134
static StandardButton question(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons=Ok, StandardButton defaultButton=NoButton)
static CCopasiMessage::Type getHighestSeverity()
virtual CCopasiMethod* TaskWidget::createMethod ( const CCopasiMethod::SubType type)
protectedpure virtual
bool TaskWidget::enterProtected ( )
protectedvirtual

Reimplemented from CopasiWidget.

Definition at line 547 of file TaskWidget.cpp.

References CCopasiTask::getMethod(), loadTask(), mpMethod, CopasiWidget::mpObject, and mpTask.

548 {
549  mpTask = dynamic_cast< CCopasiTask * >(mpObject);
550 
551  // :TODO: We need a message here.
552  if (!mpTask) return false;
553 
555 
556  return loadTask();
557 }
virtual bool loadTask()=0
CCopasiObject * mpObject
Definition: copasiWidget.h:64
CCopasiTask * mpTask
Definition: TaskWidget.h:130
CCopasiMethod * getMethod()
CCopasiMethod * mpMethod
Definition: TaskWidget.h:131
void TaskWidget::finishTask ( )
protected

Definition at line 474 of file TaskWidget.cpp.

References CCopasiMessage::clearDeque(), CCopasiMessage::COMMANDLINE, commonAfterRunTask(), CQMessageBox::critical(), CProgressBar::finish(), CCopasiMessage::getAllMessageText(), CCopasiMessage::getHighestSeverity(), CQMessageBox::information(), MCCopasiMessage, mProgressBar, mpTask, CCopasiMessage::peekLastMessage(), CCopasiTask::restore(), and taskFinishedEvent().

Referenced by commonRunTask(), and slotFinishThread().

475 {
477 
478  try {mpTask->restore();}
479 
480  catch (CCopasiException & /*Exception*/)
481  {
482  if (CCopasiMessage::peekLastMessage().getNumber() != MCCopasiMessage + 1)
483  {
484  if (mProgressBar != NULL) mProgressBar->finish();
485 
486  CQMessageBox::critical(this, "Calculation Error", CCopasiMessage::getAllMessageText().c_str(),
487  QMessageBox::Ok | QMessageBox::Default, QMessageBox::NoButton);
489  }
490  }
491 
492  catch (...) {}
493 
495  {
496  CQMessageBox::information(this, "Calculation Warning",
498  QMessageBox::Ok | QMessageBox::Default, QMessageBox::NoButton);
499  }
500 
502 
504 
506 }
static const CCopasiMessage & peekLastMessage()
static std::string getAllMessageText(const bool &chronological=true)
static StandardButton information(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons=Ok, StandardButton defaultButton=NoButton)
CProgressBar * mProgressBar
Definition: TaskWidget.h:121
bool commonAfterRunTask()
Definition: TaskWidget.cpp:365
static void clearDeque()
#define MCCopasiMessage
virtual bool taskFinishedEvent()
Definition: TaskWidget.cpp:508
CCopasiTask * mpTask
Definition: TaskWidget.h:130
static StandardButton critical(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons=Ok, StandardButton defaultButton=NoButton)
virtual bool finish()
virtual bool restore()
static CCopasiMessage::Type getHighestSeverity()
CCopasiTask * TaskWidget::getTask ( )

Definition at line 513 of file TaskWidget.cpp.

References mpTask.

Referenced by Worker::getIndexForWidget(), and CQTaskThread::run().

514 {
515  return mpTask;
516 }
CCopasiTask * mpTask
Definition: TaskWidget.h:130
bool TaskWidget::leave ( )
virtual

Reimplemented from CopasiWidget.

Definition at line 542 of file TaskWidget.cpp.

References saveTask().

Referenced by SliderDialog::runTask().

543 {
544  return saveTask();
545 }
virtual bool saveTask()=0
bool TaskWidget::loadCommon ( )
protected
bool TaskWidget::loadMethod ( )
protected
virtual bool TaskWidget::loadTask ( )
protectedpure virtual
void TaskWidget::reportBtnClicked ( )
protectedslot

Definition at line 216 of file TaskWidget.cpp.

References CQReportDefinitionSelect::exec(), CCopasiTask::getReport(), CQReportDefinitionSelect::loadReportDefinitionVector(), CopasiWidget::mpListView, mpTask, and CQReportDefinitionSelect::setReport().

Referenced by TaskWidget().

217 {
218  if (!mpTask) return;
219 
221  pSelectDlg->setReport(&mpTask->getReport());
222  pSelectDlg->loadReportDefinitionVector();
223  pSelectDlg->exec();
224 
225  delete pSelectDlg;
226 }
void setReport(CReport *newReport)
ListViews * mpListView
Definition: copasiWidget.h:62
CCopasiTask * mpTask
Definition: TaskWidget.h:130
CReport & getReport()
void TaskWidget::revertBtnClicked ( )
protectedslot

Definition at line 193 of file TaskWidget.cpp.

References CCopasiTask::getMethod(), loadTask(), mpMethod, mpTask, and pdelete.

Referenced by TaskWidget().

194 {
195  if (!mpTask) return;
196 
197  CCopasiMethod* pMethod = mpTask->getMethod();
198 
199  if (pMethod != mpMethod)
200  {
201  pdelete(mpMethod);
202  mpMethod = pMethod;
203  }
204 
205  loadTask();
206 }
#define pdelete(p)
Definition: copasi.h:215
virtual bool loadTask()=0
CCopasiTask * mpTask
Definition: TaskWidget.h:130
CCopasiMethod * getMethod()
CCopasiMethod * mpMethod
Definition: TaskWidget.h:131
void TaskWidget::runBtnClicked ( )
protectedslot

Definition at line 208 of file TaskWidget.cpp.

References mpBtnWidget, and runTask().

Referenced by TaskWidget().

209 {
210  // Assure that all edits to the current widget are committed.
211  mpBtnWidget->mpBtnRun->setFocus();
212 
213  runTask();
214 }
CQTaskBtnWidget * mpBtnWidget
Definition: TaskWidget.h:124
virtual bool runTask()=0
virtual bool TaskWidget::runTask ( )
pure virtual
bool TaskWidget::saveCommon ( )
protected

Definition at line 258 of file TaskWidget.cpp.

References CCopasiTask::isScheduled(), CCopasiTask::isUpdateModel(), mChanged, mpHeaderWidget, mpTask, CQTaskHeaderWidget::saved(), CCopasiTask::setScheduled(), and CCopasiTask::setUpdateModel().

Referenced by CQMoietiesTaskWidget::saveTask(), CQEFMWidget::saveTask(), CQCrossSectionTaskWidget::saveTask(), CQLyapWidget::saveTask(), CQLNAWidget::saveTask(), CQMCAWidget::saveTask(), ScanWidget::saveTask(), SensitivitiesWidget::saveTask(), SteadyStateWidget::saveTask(), CQFittingWidget::saveTask(), CQTSSAWidget::saveTask(), CQOptimizationWidget::saveTask(), and CQTrajectoryWidget::saveTask().

259 {
260  if (!mpTask) return false;
261 
262  bool Value = mpHeaderWidget->mpBoxExecutable->isChecked();
263 
264  if (mpTask->isScheduled() != Value)
265  {
266  mpTask->setScheduled(Value);
267  mChanged = true;
268  }
269 
270  Value = mpHeaderWidget->mpUpdateModel->isChecked();
271 
272  if (mpTask->isUpdateModel() != Value)
273  {
274  mpTask->setUpdateModel(Value);
275  mChanged = true;
276  }
277 
279  return true;
280 }
void setScheduled(const bool &scheduled)
const bool & isUpdateModel() const
const bool & isScheduled() const
bool mChanged
Definition: TaskWidget.h:133
CCopasiTask * mpTask
Definition: TaskWidget.h:130
CQTaskHeaderWidget * mpHeaderWidget
Definition: TaskWidget.h:122
void setUpdateModel(const bool &updateModel)
bool TaskWidget::saveMethod ( )
protected
virtual bool TaskWidget::saveTask ( )
protectedpure virtual
void TaskWidget::slotFinishThread ( )
slot

Definition at line 455 of file TaskWidget.cpp.

References CCopasiMessage::COMMANDLINE, CQMessageBox::critical(), finishTask(), CCopasiMessage::getAllMessageText(), CCopasiMessage::getHighestSeverity(), CQMessageBox::information(), mpTaskThread, CCopasiMessage::size(), and CQTaskThread::success().

Referenced by TaskWidget().

456 {
457  if (!mpTaskThread->success() &&
458  CCopasiMessage::size() != 0)
459  {
460  CQMessageBox::critical(this, "Calculation Error",
462  QMessageBox::Ok | QMessageBox::Default, QMessageBox::NoButton);
463  }
465  {
466  CQMessageBox::information(this, "Calculation Warning",
468  QMessageBox::Ok | QMessageBox::Default, QMessageBox::NoButton);
469  }
470 
471  finishTask();
472 }
void finishTask()
Definition: TaskWidget.cpp:474
static std::string getAllMessageText(const bool &chronological=true)
static StandardButton information(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons=Ok, StandardButton defaultButton=NoButton)
static size_t size()
static StandardButton critical(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons=Ok, StandardButton defaultButton=NoButton)
CQTaskThread * mpTaskThread
Definition: TaskWidget.h:134
const bool & success() const
static CCopasiMessage::Type getHighestSeverity()
bool TaskWidget::taskFinishedEvent ( )
protectedvirtual
bool TaskWidget::update ( ListViews::ObjectType  objectType,
ListViews::Action  action,
const std::string &  key 
)
virtual

Reimplemented from CopasiWidget.

Reimplemented in CQTrajectoryWidget, CQOscillationTaskWidget, and CQCrossSectionTaskWidget.

Definition at line 519 of file TaskWidget.cpp.

References ListViews::ADD, CQTaskMethodWidget::clearHistory(), CopasiWidget::mIgnoreUpdates, ListViews::MODEL, and mpMethodWidget.

520 {
521  if (mIgnoreUpdates) return true;
522 
523  switch (objectType)
524  {
525  case ListViews::MODEL:
526 
527  if (action == ListViews::ADD &&
528  mpMethodWidget != NULL)
529  {
531  }
532 
533  break;
534 
535  default:
536  break;
537  }
538 
539  return true;
540 }
objectType
bool mIgnoreUpdates
Definition: copasiWidget.h:67
CQTaskMethodWidget * mpMethodWidget
Definition: TaskWidget.h:123

Member Data Documentation

bool TaskWidget::mChanged
protected
CQTaskBtnWidget* TaskWidget::mpBtnWidget
protected
CQTaskHeaderWidget* TaskWidget::mpHeaderWidget
protected
CCopasiMethod* TaskWidget::mpMethod
protected
QGridLayout* TaskWidget::mpMethodLayout
protected

Definition at line 125 of file TaskWidget.h.

CQTaskMethodWidget* TaskWidget::mpMethodWidget
protected
CProgressBar* TaskWidget::mProgressBar
protected

Definition at line 121 of file TaskWidget.h.

Referenced by commonAfterRunTask(), commonBeforeRunTask(), commonRunTask(), and finishTask().

QSpacerItem* TaskWidget::mpSpacer1
protected

Definition at line 127 of file TaskWidget.h.

QSpacerItem* TaskWidget::mpSpacer2
protected

Definition at line 128 of file TaskWidget.h.

CCopasiTask* TaskWidget::mpTask
protected
CQTaskThread* TaskWidget::mpTaskThread
protected

Definition at line 134 of file TaskWidget.h.

Referenced by commonRunTask(), slotFinishThread(), TaskWidget(), and ~TaskWidget().


The documentation for this class was generated from the following files: