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

#include <SteadyStateWidget.h>

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

Public Member Functions

virtual bool runTask ()
 
 SteadyStateWidget (QWidget *parent=0, const char *name=0, Qt::WFlags fl=0)
 
 ~SteadyStateWidget ()
 
- 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

virtual void taskJacobianToggled ()
 
- 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 32 of file SteadyStateWidget.h.

Constructor & Destructor Documentation

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

Constructs a SteadyStateWidget which is a child of 'parent', with the name 'name' and widget flags set to 'f'.

Definition at line 48 of file SteadyStateWidget.cpp.

References init().

49  : TaskWidget(parent, name, fl)
50 {
51  setupUi(this);
52 
53  init();
54  retranslateUi(this);
55 }
bool fl(const C_FLOAT64 &d1, const C_FLOAT64 &d2)
TaskWidget(QWidget *parent=0, const char *name=0, Qt::WFlags fl=0)
Definition: TaskWidget.cpp:52
SteadyStateWidget::~SteadyStateWidget ( )

Definition at line 60 of file SteadyStateWidget.cpp.

61 {}

Member Function Documentation

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

Implements TaskWidget.

Definition at line 76 of file SteadyStateWidget.cpp.

77 {return NULL; /*CTSSMethod::createTSSMethod(type);*/}
void SteadyStateWidget::init ( )
private

Definition at line 63 of file SteadyStateWidget.cpp.

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

Referenced by SteadyStateWidget().

64 {
65  mpHeaderWidget->setTaskName("Steady State");
66 
67  SteadyStateWidgetLayout->insertWidget(0, mpHeaderWidget); // header
68  // SteadyStateWidgetLayout->insertSpacing(1, 14); // space between header and body
69 
71  SteadyStateWidgetLayout->addWidget(mpMethodWidget);
72 
73  SteadyStateWidgetLayout->addWidget(mpBtnWidget); // 'footer'
74 }
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 SteadyStateWidget::loadTask ( )
protectedvirtual

Implements TaskWidget.

Definition at line 136 of file SteadyStateWidget.cpp.

References CKeyFactory::get(), CCopasiRootContainer::getKeyFactory(), CCopasiTask::getMethod(), CCopasiTask::getProblem(), CSteadyStateProblem::isJacobianRequested(), CSteadyStateProblem::isStabilityAnalysisRequested(), TaskWidget::loadCommon(), TaskWidget::loadMethod(), TaskWidget::mChanged, and CopasiWidget::mKey.

137 {
138  loadCommon();
139  loadMethod();
140 
141  CSteadyStateTask* mSteadyStateTask =
143 
144  if (mSteadyStateTask == NULL)
145  return false;
146 
147  CSteadyStateProblem* steadystateproblem =
148  dynamic_cast<CSteadyStateProblem *>(mSteadyStateTask->getProblem());
149 
150  if (steadystateproblem == NULL)
151  return false;
152 
153  CSteadyStateMethod* steadystatemethod =
154  dynamic_cast<CSteadyStateMethod *>(mSteadyStateTask->getMethod());
155 
156  if (steadystatemethod == NULL)
157  return false;
158 
159  bool bJacobian = steadystateproblem->isJacobianRequested();
160  bool bStatistics = steadystateproblem->isStabilityAnalysisRequested();
161  taskJacobian->setChecked(bJacobian);
162 
163  if (bJacobian)
164  {
165  taskStability->setEnabled(true);
166  taskStability->setChecked(bStatistics);
167  }
168 
169  mChanged = false;
170 
171  return true;
172 }
CCopasiProblem * getProblem()
bool loadCommon()
Definition: TaskWidget.cpp:247
CCopasiObject * get(const std::string &key)
bool loadMethod()
Definition: TaskWidget.cpp:284
bool isStabilityAnalysisRequested() const
bool mChanged
Definition: TaskWidget.h:133
CCopasiMethod * getMethod()
static CKeyFactory * getKeyFactory()
bool isJacobianRequested() const
std::string mKey
Definition: copasiWidget.h:63
bool SteadyStateWidget::runTask ( )
virtual

Implements TaskWidget.

Definition at line 79 of file SteadyStateWidget.cpp.

References TaskWidget::commonBeforeRunTask(), and TaskWidget::commonRunTask().

Referenced by SliderDialog::runSteadyStateTask().

80 {
81  bool success = true;
82 
83  if (!commonBeforeRunTask()) return false;
84 
85  if (!commonRunTask()) success = false;
86 
87  return success;
88 }
bool commonRunTask()
Definition: TaskWidget.cpp:395
bool commonBeforeRunTask()
Definition: TaskWidget.cpp:317
bool SteadyStateWidget::saveTask ( )
protectedvirtual

Implements TaskWidget.

Definition at line 174 of file SteadyStateWidget.cpp.

References CCopasiDataModel::changed(), CKeyFactory::get(), CCopasiRootContainer::getKeyFactory(), CCopasiTask::getMethod(), CCopasiTask::getProblem(), TaskWidget::mChanged, CopasiWidget::mKey, CopasiWidget::mpDataModel, TaskWidget::saveCommon(), TaskWidget::saveMethod(), CSteadyStateProblem::setJacobianRequested(), and CSteadyStateProblem::setStabilityAnalysisRequested().

175 {
176  saveCommon();
177  saveMethod();
178 
179  CSteadyStateTask* mSteadyStateTask =
181 
182  if (mSteadyStateTask == NULL)
183  return false;
184 
185  CSteadyStateProblem* steadystateproblem =
186  dynamic_cast<CSteadyStateProblem *>(mSteadyStateTask->getProblem());
187 
188  if (steadystateproblem == NULL)
189  return false;
190 
191  CSteadyStateMethod* steadystatemethod =
192  dynamic_cast<CSteadyStateMethod *>(mSteadyStateTask->getMethod());
193 
194  if (steadystatemethod == NULL)
195  return false;
196 
197  bool bJacobian = taskJacobian->isChecked();
198  bool bStatistics = taskStability->isChecked();
199 
200  steadystateproblem->setJacobianRequested(bJacobian);
201  steadystateproblem->setStabilityAnalysisRequested(bStatistics);
202 
203  if (mChanged)
204  {
205  if (mpDataModel != NULL)
206  {
207  mpDataModel->changed();
208  }
209 
210  mChanged = false;
211  }
212 
213  return true;
214 }
bool saveMethod()
Definition: TaskWidget.cpp:308
CCopasiProblem * getProblem()
CCopasiObject * get(const std::string &key)
bool saveCommon()
Definition: TaskWidget.cpp:258
void changed(const bool &changed=true)
bool mChanged
Definition: TaskWidget.h:133
void setJacobianRequested(bool &jacobianRequested)
CCopasiDataModel * mpDataModel
Definition: copasiWidget.h:65
CCopasiMethod * getMethod()
static CKeyFactory * getKeyFactory()
void setStabilityAnalysisRequested(bool &stabilityAnalysisRequested)
std::string mKey
Definition: copasiWidget.h:63
bool SteadyStateWidget::taskFinishedEvent ( )
protectedvirtual

Reimplemented from TaskWidget.

Definition at line 90 of file SteadyStateWidget.cpp.

References ListViews::findWidgetFromId(), CSteadyStateMethod::found, CSteadyStateMethod::foundEquilibrium, CSteadyStateMethod::foundNegative, CCopasiParameterGroup::getParameter(), CSteadyStateTask::getResult(), CCopasiParameter::getValue(), CQSteadyStateResult::loadResult(), CopasiWidget::mpListView, TaskWidget::mpMethod, CopasiWidget::mpObject, CCopasiParameter::Value::pBOOL, pResult, and ListViews::switchToOtherWidget().

91 {
92  bool success = false;
93 
94  CSteadyStateTask* pSteadyStateTask = dynamic_cast<CSteadyStateTask *>(mpObject);
95 
96  if (pSteadyStateTask == NULL)
97  return success;
98 
99  switch (pSteadyStateTask->getResult())
100  {
103  success = true;
104  break;
105 
107 
108  if (mpMethod != NULL)
109  {
110  const CCopasiParameter *pParm = mpMethod->getParameter("Accept Negative Concentrations");
111 
112  if (pParm != NULL)
113  {
114  success = *pParm->getValue().pBOOL;
115  }
116  }
117 
118  break;
119 
120  default:
121  break;
122  }
123 
125  dynamic_cast< CQSteadyStateResult * >(mpListView->findWidgetFromId(211));
126 
127  if (pResult)
128  pResult->loadResult();
129 
130  if (success && isVisible())
131  mpListView->switchToOtherWidget(211, ""); //change to the results window
132 
133  return success;
134 }
const CSteadyStateMethod::ReturnCode & getResult() const
void switchToOtherWidget(const size_t &id, const std::string &key)
Definition: listviews.cpp:926
CCopasiObject * mpObject
Definition: copasiWidget.h:64
CopasiWidget * findWidgetFromId(const size_t &id) const
Definition: listviews.cpp:678
ListViews * mpListView
Definition: copasiWidget.h:62
const Value & getValue() const
CCopasiParameter * getParameter(const std::string &name)
const CArrayAnnotation * pResult
CCopasiMethod * mpMethod
Definition: TaskWidget.h:131
void SteadyStateWidget::taskJacobianToggled ( )
protectedvirtualslot

Definition at line 216 of file SteadyStateWidget.cpp.

217 {
218  if (!taskJacobian->isChecked())
219  {
220  taskStability->setChecked(false);
221  taskStability->setEnabled(false);
222  }
223  else taskStability->setEnabled(true);
224 }

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