COPASI API  4.16.103
Public Member Functions | Protected Slots | Protected Member Functions | Private Member Functions | List of all members
CQLyapWidget Class Reference

#include <CQLyapWidget.h>

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

Public Member Functions

 CQLyapWidget (QWidget *parent=0, const char *name=0)
 
virtual bool runTask ()
 
 ~CQLyapWidget ()
 
- Public Member Functions inherited from TaskWidget
CCopasiTaskgetTask ()
 
virtual bool leave ()
 
 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 slotDelayChecked ()
 
- Protected Slots inherited from TaskWidget
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

virtual CCopasiMethodcreateMethod (const CCopasiMethod::SubType &type)
 
virtual bool loadTask ()
 
virtual bool saveTask ()
 
virtual bool taskFinishedEvent ()
 
- Protected Member Functions inherited from TaskWidget
bool commonAfterRunTask ()
 
bool commonBeforeRunTask ()
 
bool commonRunTask ()
 
virtual bool enterProtected ()
 
void finishTask ()
 
bool loadCommon ()
 
bool loadMethod ()
 
bool saveCommon ()
 
bool saveMethod ()
 

Private Member Functions

void init ()
 

Additional Inherited Members

- Public Slots inherited from TaskWidget
void adjustTable ()
 
void slotFinishThread ()
 
- Protected Attributes inherited from TaskWidget
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 26 of file CQLyapWidget.h.

Constructor & Destructor Documentation

CQLyapWidget::CQLyapWidget ( QWidget *  parent = 0,
const char *  name = 0 
)

Definition at line 35 of file CQLyapWidget.cpp.

References init().

36  : TaskWidget(parent, name)
37 {
38  setupUi(this);
39 
40  init();
41 }
TaskWidget(QWidget *parent=0, const char *name=0, Qt::WFlags fl=0)
Definition: TaskWidget.cpp:52
CQLyapWidget::~CQLyapWidget ( )

Definition at line 46 of file CQLyapWidget.cpp.

47 {
48  // no need to delete child widgets, Qt does it all for us
49 }

Member Function Documentation

CCopasiMethod * CQLyapWidget::createMethod ( const CCopasiMethod::SubType type)
protectedvirtual

Implements TaskWidget.

Definition at line 69 of file CQLyapWidget.cpp.

References CLyapMethod::createMethod().

70 {return CLyapMethod::createMethod(type);}
static CLyapMethod * createMethod(CCopasiMethod::SubType subType=CCopasiMethod::lyapWolf)
Definition: CLyapMethod.cpp:58
void CQLyapWidget::init ( )
private

Definition at line 151 of file CQLyapWidget.cpp.

References TaskWidget::mpBtnWidget, TaskWidget::mpHeaderWidget, TaskWidget::mpMethodWidget, CQTaskHeaderWidget::setTaskName(), and CQTaskMethodWidget::showMethodParameters().

Referenced by CQLyapWidget().

152 {
153  mpHeaderWidget->setTaskName("Lyapunov Exponents");
154 
155  vboxLayout->insertWidget(0, mpHeaderWidget); // header
156  // vboxLayout->insertSpacing(1, 14); // space between header and body
157 
159  vboxLayout->addWidget(mpMethodWidget);
160 
161  vboxLayout->addWidget(mpBtnWidget); // 'footer'
162 }
bool setTaskName(const std::string &name)
void showMethodParameters(const bool &show)
CQTaskMethodWidget * mpMethodWidget
Definition: TaskWidget.h:123
CQTaskBtnWidget * mpBtnWidget
Definition: TaskWidget.h:124
CQTaskHeaderWidget * mpHeaderWidget
Definition: TaskWidget.h:122
bool CQLyapWidget::loadTask ( )
protectedvirtual

Implements TaskWidget.

Definition at line 72 of file CQLyapWidget.cpp.

References CLyapProblem::divergenceRequested(), CCopasiRootContainer::getDatamodelList(), CLyapProblem::getExponentNumber(), CCopasiTask::getProblem(), CLyapProblem::getTransientTime(), TaskWidget::loadCommon(), TaskWidget::loadMethod(), TaskWidget::mChanged, TaskWidget::mpTask, and pTask.

73 {
74  CLyapTask * pTask = dynamic_cast< CLyapTask * >(mpTask);
75 
76  if (!pTask) return false;
77 
78  loadCommon();
79  loadMethod();
80 
81  CLyapProblem* pProblem =
82  dynamic_cast< CLyapProblem * >(mpTask->getProblem());
83 
84  if (!pProblem) return false;
85 
86  mpEditExponent->setText(QString::number(pProblem->getExponentNumber()));
87 
88  assert(CCopasiRootContainer::getDatamodelList()->size() > 0);
89  bool enabled =
90  ((*CCopasiRootContainer::getDatamodelList())[0]->getModel()->getInitialTime() != pProblem->getTransientTime());
91 
92  mpCheckDelay->setChecked(enabled);
93  mpEditDelay->setEnabled(enabled);
94  mpEditDelay->setText(QString::number(pProblem->getTransientTime()));
95 
96  mpCheckDivergence->setChecked(pProblem->divergenceRequested());
97 
98  mChanged = false;
99 
100  return true;
101 }
CCopasiProblem * getProblem()
bool loadCommon()
Definition: TaskWidget.cpp:247
bool loadMethod()
Definition: TaskWidget.cpp:284
bool mChanged
Definition: TaskWidget.h:133
CTSSATask * pTask
const C_FLOAT64 & getTransientTime() const
static CCopasiVector< CCopasiDataModel > * getDatamodelList()
CCopasiTask * mpTask
Definition: TaskWidget.h:130
const unsigned C_INT32 & getExponentNumber() const
bool divergenceRequested() const
bool CQLyapWidget::runTask ( )
virtual

Implements TaskWidget.

Definition at line 51 of file CQLyapWidget.cpp.

References TaskWidget::commonBeforeRunTask(), TaskWidget::commonRunTask(), CKeyFactory::get(), CCopasiRootContainer::getKeyFactory(), CopasiWidget::mKey, and pTask.

52 {
53  CLyapTask * pTask =
55 
56  if (!pTask) return false;
57 
58  if (!commonBeforeRunTask()) return false;
59 
60  return commonRunTask();
61 }
CCopasiObject * get(const std::string &key)
CTSSATask * pTask
static CKeyFactory * getKeyFactory()
bool commonRunTask()
Definition: TaskWidget.cpp:395
bool commonBeforeRunTask()
Definition: TaskWidget.cpp:317
std::string mKey
Definition: copasiWidget.h:63
bool CQLyapWidget::saveTask ( )
protectedvirtual

Implements TaskWidget.

Definition at line 103 of file CQLyapWidget.cpp.

References CLyapProblem::divergenceRequested(), CCopasiRootContainer::getDatamodelList(), CLyapProblem::getExponentNumber(), CCopasiTask::getProblem(), CLyapProblem::getTransientTime(), max, TaskWidget::mChanged, TaskWidget::mpTask, pTask, TaskWidget::saveCommon(), TaskWidget::saveMethod(), CLyapProblem::setDivergenceRequested(), CLyapProblem::setExponentNumber(), and CLyapProblem::setTransientTime().

104 {
105  CLyapTask * pTask = dynamic_cast< CLyapTask * >(mpTask);
106 
107  if (!pTask) return false;
108 
109  saveCommon();
110  saveMethod();
111 
112  CLyapProblem* pProblem =
113  dynamic_cast< CLyapProblem * >(mpTask->getProblem());
114 
115  if (!pProblem) return false;
116 
117  if (QString::number(pProblem->getExponentNumber()) != mpEditExponent->text())
118  {
119  pProblem->setExponentNumber(std::max(0, mpEditExponent->text().toInt()));
120  mChanged = true;
121  }
122 
123  assert(CCopasiRootContainer::getDatamodelList()->size() > 0);
124  bool enabled =
125  ((*CCopasiRootContainer::getDatamodelList())[0]->getModel()->getInitialTime() != pProblem->getTransientTime());
126 
127  if (mpCheckDelay->isChecked() != enabled ||
128  (mpCheckDelay->isChecked() &&
129  mpEditDelay->text() != QString::number(pProblem->getTransientTime())))
130  {
131  if (mpCheckDelay->isChecked())
132  pProblem->setTransientTime(mpEditDelay->text().toDouble());
133  else
134  pProblem->setTransientTime((*CCopasiRootContainer::getDatamodelList())[0]->getModel()->getInitialTime());
135 
136  mChanged = true;
137  }
138 
139  if (mpCheckDivergence->isChecked() != pProblem->divergenceRequested())
140  {
141  pProblem->setDivergenceRequested(mpCheckDivergence->isChecked());
142  mChanged = true;
143  }
144 
145  if (mChanged)(*CCopasiRootContainer::getDatamodelList())[0]->changed();
146 
147  mChanged = false;
148  return true;
149 }
bool saveMethod()
Definition: TaskWidget.cpp:308
CCopasiProblem * getProblem()
void setDivergenceRequested(bool flag)
bool saveCommon()
Definition: TaskWidget.cpp:258
void setTransientTime(const C_FLOAT64 &endTime)
bool mChanged
Definition: TaskWidget.h:133
CTSSATask * pTask
void setExponentNumber(const unsigned C_INT32 &number)
const C_FLOAT64 & getTransientTime() const
static CCopasiVector< CCopasiDataModel > * getDatamodelList()
CCopasiTask * mpTask
Definition: TaskWidget.h:130
const unsigned C_INT32 & getExponentNumber() const
bool divergenceRequested() const
#define max(a, b)
Definition: f2c.h:176
void CQLyapWidget::slotDelayChecked ( )
protectedslot

Definition at line 164 of file CQLyapWidget.cpp.

165 {
166  mpEditDelay->setEnabled(mpCheckDelay->isChecked());
167 }
bool CQLyapWidget::taskFinishedEvent ( )
protectedvirtual

Reimplemented from TaskWidget.

Definition at line 63 of file CQLyapWidget.cpp.

References CopasiWidget::mpListView, and ListViews::switchToOtherWidget().

64 {
65  mpListView->switchToOtherWidget(261, ""); //change to the results window
66  return true;
67 }
void switchToOtherWidget(const size_t &id, const std::string &key)
Definition: listviews.cpp:926
ListViews * mpListView
Definition: copasiWidget.h:62

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