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

#include <CQCrossSectionTaskWidget.h>

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

Public Member Functions

 CQCrossSectionTaskWidget (QWidget *parent=0, const char *name=0)
 
virtual bool runTask ()
 
virtual bool update (ListViews::ObjectType objectType, ListViews::Action action, const std::string &key)
 
virtual ~CQCrossSectionTaskWidget ()
 
- Public Member Functions inherited from TaskWidget
CCopasiTaskgetTask ()
 
virtual bool leave ()
 
 TaskWidget (QWidget *parent=0, const char *name=0, Qt::WFlags fl=0)
 
 ~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 Member Functions

void commitInput ()
 
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 Slots

void slotChooseVariable ()
 
void slotOutputConvergence (bool)
 
void slotOutputConvergenceTolerance ()
 
void slotOutputCrossings (bool)
 
void slotOutputCrossingsLimit ()
 
void slotOutputDelay (bool)
 
void slotOutputDelayTime ()
 
void slotUpdateConvergence (bool)
 
void slotUpdateConvergenceTolerance ()
 
void slotUpdateCrossings (bool)
 
void slotUpdateCrossingsLimit ()
 
void slotUpdateTime ()
 
void slotValueRate ()
 

Private Member Functions

void destroy ()
 
void init ()
 
void setSingleObject (const CCopasiObject *pSingleVariable)
 
void showUnits ()
 
void updateValues ()
 

Private Attributes

CCrossSectionProblemmpCrossSectionProblem
 
const CCopasiObjectmpSingleVariable
 
CQValidatorDoublempValidatorCrossing
 
CQValidatorIntmpValidatorLC
 
CQValidatorIntmpValidatorOutLC
 
CQValidatorDoublempValidatorOutTime
 
CQValidatorDoublempValidatorOutTolerance
 
CQValidatorDoublempValidatorTime
 
CQValidatorDoublempValidatorTolerance
 

Additional Inherited Members

- Public Slots inherited from TaskWidget
void adjustTable ()
 
void slotFinishThread ()
 
- 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 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 23 of file CQCrossSectionTaskWidget.h.

Constructor & Destructor Documentation

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

Definition at line 41 of file CQCrossSectionTaskWidget.cpp.

References CQIconResource::copasi, CQIconResource::icon(), and init().

42  : TaskWidget(parent, name)
43  , mpSingleVariable(NULL)
44  , mpCrossSectionProblem(NULL)
45  , mpValidatorLC(NULL)
46  , mpValidatorTime(NULL)
47  , mpValidatorTolerance(NULL)
48  , mpValidatorOutLC(NULL)
49  , mpValidatorOutTime(NULL)
51  , mpValidatorCrossing(NULL)
52 
53 {
54  setupUi(this);
55  mpButtonVariable->setIcon(CQIconResource::icon(CQIconResource::copasi));
56 
57  init();
58 }
CQValidatorDouble * mpValidatorTime
CQValidatorDouble * mpValidatorOutTolerance
static const QIcon & icon(const IconID &id)
CQValidatorDouble * mpValidatorCrossing
CQValidatorDouble * mpValidatorOutTime
CCrossSectionProblem * mpCrossSectionProblem
CQValidatorDouble * mpValidatorTolerance
const CCopasiObject * mpSingleVariable
TaskWidget(QWidget *parent=0, const char *name=0, Qt::WFlags fl=0)
Definition: TaskWidget.cpp:52
CQCrossSectionTaskWidget::~CQCrossSectionTaskWidget ( )
virtual

Definition at line 63 of file CQCrossSectionTaskWidget.cpp.

References destroy().

64 {
65  destroy();
66  // no need to delete child widgets, Qt does it all for us
67 }

Member Function Documentation

void CQCrossSectionTaskWidget::commitInput ( )
protected

Definition at line 124 of file CQCrossSectionTaskWidget.cpp.

References mpCrossSectionProblem, mpSingleVariable, CCrossSectionProblem::setConvergenceOutTolerance(), CCrossSectionProblem::setConvergenceTolerance(), CCrossSectionProblem::setCrossingsLimit(), CCrossSectionProblem::setFlagLimitConvergence(), CCrossSectionProblem::setFlagLimitCrossings(), CCrossSectionProblem::setFlagLimitOutConvergence(), CCrossSectionProblem::setFlagLimitOutCrossings(), CCrossSectionProblem::setFlagLimitOutTime(), CCrossSectionProblem::setOutCrossingsLimit(), CTrajectoryProblem::setOutputStartTime(), CCrossSectionProblem::setPositiveDirection(), CCrossSectionProblem::setSingleObjectCN(), CCrossSectionProblem::setThreshold(), and CCrossSectionProblem::setTimeLimit().

Referenced by runTask(), slotUpdateTime(), and slotValueRate().

125 {
126  if (!mpCrossSectionProblem) return;
127 
128  mpCrossSectionProblem->setFlagLimitCrossings(mpCheckSimCrossings->isChecked());
129  mpCrossSectionProblem->setCrossingsLimit(mpTxtCrossings->text().toULong());
130  mpCrossSectionProblem->setFlagLimitOutCrossings(mpCheckOutputCrossings->isChecked());
131  mpCrossSectionProblem->setOutCrossingsLimit(mpTxtOutCrossings->text().toULong());
132  mpCrossSectionProblem->setTimeLimit(mpTxtTime->text().toDouble());
133  mpCrossSectionProblem->setOutputStartTime(mpTxtOutTime->text().toDouble());
134  mpCrossSectionProblem->setFlagLimitOutTime(mpCheckOutputDelay->isChecked());
135  mpCrossSectionProblem->setFlagLimitConvergence(mpCheckSimConvergence->isChecked());
136  mpCrossSectionProblem->setConvergenceTolerance(mpTxtConvergence->text().toDouble());
137  mpCrossSectionProblem->setFlagLimitOutConvergence(mpCheckOutputConvergence->isChecked());
138  mpCrossSectionProblem->setConvergenceOutTolerance(mpTxtOutConvergence->text().toDouble());
140  mpCrossSectionProblem->setPositiveDirection(mpDirectionPositive->isChecked());
141  mpCrossSectionProblem->setThreshold(mpLineEditValue->text().toDouble());
142 }
void setTimeLimit(const C_FLOAT64 &timeLimit)
void setCrossingsLimit(const unsigned C_INT32 &crossingLimit)
void setConvergenceTolerance(const C_FLOAT64 &convergenceTolerance)
void setThreshold(const C_FLOAT64 &threshold)
void setFlagLimitOutTime(bool flagLimitTime)
void setFlagLimitConvergence(bool flagLimitConvergence)
void setPositiveDirection(bool isPositive)
void setFlagLimitOutCrossings(bool flagLimitCrossing)
void setFlagLimitCrossings(bool flagLimitCrossing)
void setConvergenceOutTolerance(const C_FLOAT64 &convergenceTolerance)
CCrossSectionProblem * mpCrossSectionProblem
void setSingleObjectCN(const std::string &cn)
void setOutputStartTime(const C_FLOAT64 &endTime)
void setFlagLimitOutConvergence(bool flagLimitConvergence)
const CCopasiObject * mpSingleVariable
void setOutCrossingsLimit(const unsigned C_INT32 &crossingLimit)
CCopasiMethod * CQCrossSectionTaskWidget::createMethod ( const CCopasiMethod::SubType type)
protectedvirtual

Implements TaskWidget.

Definition at line 336 of file CQCrossSectionTaskWidget.cpp.

337 {
338  return NULL;
339 }
void CQCrossSectionTaskWidget::destroy ( )
private

Definition at line 119 of file CQCrossSectionTaskWidget.cpp.

References mpCrossSectionProblem, and pdelete.

Referenced by ~CQCrossSectionTaskWidget().

120 {
122 }
#define pdelete(p)
Definition: copasi.h:215
CCrossSectionProblem * mpCrossSectionProblem
void CQCrossSectionTaskWidget::init ( )
private

Definition at line 69 of file CQCrossSectionTaskWidget.cpp.

References ListViews::findWidgetFromId(), max, TaskWidget::mpBtnWidget, mpCrossSectionProblem, TaskWidget::mpHeaderWidget, CopasiWidget::mpListView, TaskWidget::mpMethodWidget, mpValidatorCrossing, mpValidatorLC, mpValidatorOutLC, mpValidatorOutTime, mpValidatorOutTolerance, mpValidatorTime, mpValidatorTolerance, pResult, CQValidatorDouble::setRange(), CQValidatorInt::setRange(), CQTaskHeaderWidget::setTaskName(), CQTimeSeriesWidget::setTitle(), and CQTaskMethodWidget::showMethodParameters().

Referenced by CQCrossSectionTaskWidget().

70 {
71  mpCrossSectionProblem = NULL;
72 
73  mpHeaderWidget->setTaskName("Cross Section");
74 
75  verticalLayout->insertWidget(0, mpHeaderWidget);
76 
78  mpGridLayout->addWidget(mpMethodWidget->mpLblParameter, 11, 0, 1, 1);
79  mpGridLayout->addWidget(mpMethodWidget->mpTableParameter, 11, 1, 1, 2);
80 
81  // unsigned int ValidMethods = CCopasiMethod::unset;
82  // mpMethodWidget->setValidMethods(&ValidMethods);
83  // mpMethodWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
84 
85  // verticalLayout->addWidget(mpMethodWidget);
86  verticalLayout->addWidget(mpBtnWidget);
87 
88  mpValidatorCrossing = new CQValidatorDouble(mpLineEditValue);
89  mpLineEditValue->setValidator(mpValidatorCrossing);
90 
91  mpValidatorLC = new CQValidatorInt(mpTxtCrossings);
93  mpTxtCrossings->setValidator(mpValidatorLC);
94 
95  mpValidatorTime = new CQValidatorDouble(mpTxtTime);
97  mpTxtTime->setValidator(mpValidatorTime);
98 
99  mpValidatorOutTime = new CQValidatorDouble(mpTxtOutTime);
100  mpTxtOutTime->setValidator(mpValidatorOutTime);
101 
102  mpValidatorTolerance = new CQValidatorDouble(mpTxtConvergence);
103  mpTxtConvergence->setValidator(mpValidatorTolerance);
104 
105  mpValidatorOutLC = new CQValidatorInt(mpTxtOutCrossings);
107  mpTxtOutCrossings->setValidator(mpValidatorOutLC);
108 
109  mpValidatorOutTolerance = new CQValidatorDouble(mpTxtOutConvergence);
110  mpTxtOutConvergence->setValidator(mpValidatorOutTolerance);
111 
113  dynamic_cast< CQTimeSeriesWidget * >(mpListView->findWidgetFromId(281));
114 
115  if (pResult != NULL)
116  pResult->setTitle("<h2>Cross Section Result</h2>");
117 }
CQValidatorDouble * mpValidatorTime
bool setTaskName(const std::string &name)
CQValidatorDouble * mpValidatorOutTolerance
CopasiWidget * findWidgetFromId(const size_t &id) const
Definition: listviews.cpp:678
virtual void setTitle(const QString &title)
ListViews * mpListView
Definition: copasiWidget.h:62
CQValidatorDouble * mpValidatorCrossing
void showMethodParameters(const bool &show)
CQTaskMethodWidget * mpMethodWidget
Definition: TaskWidget.h:123
const CArrayAnnotation * pResult
CQValidatorDouble * mpValidatorOutTime
CCrossSectionProblem * mpCrossSectionProblem
CQTaskBtnWidget * mpBtnWidget
Definition: TaskWidget.h:124
CQValidatorDouble * mpValidatorTolerance
CQTaskHeaderWidget * mpHeaderWidget
Definition: TaskWidget.h:122
void setRange(const C_FLOAT64 &lowerBound, const C_FLOAT64 &upperBound)
Definition: CQValidator.cpp:80
void setRange(const int &lowerBound, const int &upperBound)
Definition: CQValidator.cpp:98
#define max(a, b)
Definition: f2c.h:176
bool CQCrossSectionTaskWidget::loadTask ( )
protectedvirtual

Implements TaskWidget.

Definition at line 234 of file CQCrossSectionTaskWidget.cpp.

References CCrossSectionProblem::getConvergenceOutTolerance(), CCrossSectionProblem::getConvergenceTolerance(), CCrossSectionProblem::getCrossingsLimit(), CCrossSectionProblem::getFlagLimitConvergence(), CCrossSectionProblem::getFlagLimitCrossings(), CCrossSectionProblem::getFlagLimitOutConvergence(), CCrossSectionProblem::getFlagLimitOutCrossings(), CCrossSectionProblem::getFlagLimitOutTime(), CCopasiContainer::getObject(), CCopasiObject::getObjectDataModel(), CCrossSectionProblem::getOutCrossingsLimit(), CTrajectoryProblem::getOutputStartTime(), CCopasiTask::getProblem(), CCrossSectionProblem::getSingleObjectCN(), CCrossSectionProblem::getThreshold(), CCrossSectionProblem::getTimeLimit(), CCrossSectionProblem::isPositiveDirection(), TaskWidget::loadCommon(), TaskWidget::loadMethod(), mpCrossSectionProblem, TaskWidget::mpTask, mpValidatorCrossing, mpValidatorLC, mpValidatorOutLC, mpValidatorOutTime, mpValidatorOutTolerance, mpValidatorTime, mpValidatorTolerance, pdelete, pTask, CQValidator< Type >::saved(), setSingleObject(), and showUnits().

235 {
236  // load Task
238  dynamic_cast< CCrossSectionTask * >(mpTask);
239 
240  if (!pTask) return false;
241 
242  // load functions from the Parent, TaskWidget
243  loadCommon();
244  loadMethod();
245 
246  showUnits();
247 
248  // load Problem
249  CCrossSectionProblem* pProblem =
250  dynamic_cast<CCrossSectionProblem *>(pTask->getProblem());
251  assert(pProblem);
252 
255 
256  //CCrossSectionMethod* pMethod =
257  // dynamic_cast<CCrossSectionMethod *>(pTask->getMethod());
258  //assert(pMethod);
259 
260  //for now, we use a trajectory method
261  //CTrajectoryMethod* pMethod =
262  // dynamic_cast<CTrajectoryMethod *>(pTask->getMethod());
263  //assert(pMethod);
264 
265  // load the saved values
266  const std::string &name = pProblem->getSingleObjectCN();
267 
268  if (name.empty())
269  setSingleObject(NULL);
270  else
271  setSingleObject(static_cast<const CCopasiObject*>(pTask->getObjectDataModel()->getObject(name)));
272 
273  mpLineEditValue->setText(QString::number(pProblem->getThreshold()));
274  mpDirectionPositive->setChecked(mpCrossSectionProblem->isPositiveDirection());
275  mpDirectionNegative->setChecked(!mpCrossSectionProblem->isPositiveDirection());
276 
277  mpCheckSimConvergence->setChecked(pProblem->getFlagLimitConvergence());
278  mpTxtConvergence->setEnabled(pProblem->getFlagLimitConvergence());
279 
280  if (pProblem->getFlagLimitConvergence())
281  mpTxtConvergence->setText(QString::number(pProblem->getConvergenceTolerance()));
282  else
283  mpTxtConvergence->setText("");
284 
285  mpCheckOutputConvergence->setChecked(pProblem->getFlagLimitOutConvergence());
286  mpTxtOutConvergence->setEnabled(pProblem->getFlagLimitOutConvergence());
287 
288  if (pProblem->getFlagLimitOutConvergence())
289  mpTxtOutConvergence->setText(QString::number(pProblem->getConvergenceOutTolerance()));
290  else
291  mpTxtOutConvergence->setText("");
292 
293  mpCheckSimCrossings->setChecked(pProblem->getFlagLimitCrossings());
294  mpTxtCrossings->setEnabled(pProblem->getFlagLimitCrossings());
295 
296  if (pProblem->getFlagLimitCrossings())
297  mpTxtCrossings->setText(QString::number(pProblem->getCrossingsLimit()));
298  else
299  mpTxtCrossings->setText("");
300 
301  mpCheckOutputCrossings->setChecked(pProblem->getFlagLimitOutCrossings());
302  mpTxtOutCrossings->setEnabled(pProblem->getFlagLimitOutCrossings());
303 
304  if (pProblem->getFlagLimitOutCrossings())
305  mpTxtOutCrossings->setText(QString::number(pProblem->getOutCrossingsLimit()));
306  else
307  mpTxtOutCrossings->setText("");
308 
309  //mpCheckLT->setChecked(pProblem->getFlagLimitTime());
310  if (pProblem->getFlagLimitOutTime())
311  {
312  mpCheckOutputDelay->setChecked(true);
313  mpTxtOutTime->setEnabled(true);
314  mpTxtOutTime->setText(QString::number(pProblem->getOutputStartTime()));
315  }
316  else
317  {
318  mpCheckOutputDelay->setChecked(false);
319  mpTxtOutTime->setEnabled(false);
320  mpTxtOutTime->setText("");
321  }
322 
323  mpTxtTime->setText(QString::number(pProblem->getTimeLimit()));
324 
328  mpValidatorLC->saved();
332 
333  return true;
334 }
CCopasiDataModel * getObjectDataModel()
const C_FLOAT64 & getTimeLimit() const
#define pdelete(p)
Definition: copasi.h:215
const std::string & getSingleObjectCN() const
CCopasiProblem * getProblem()
bool loadCommon()
Definition: TaskWidget.cpp:247
void setSingleObject(const CCopasiObject *pSingleVariable)
bool getFlagLimitCrossings() const
CQValidatorDouble * mpValidatorTime
bool loadMethod()
Definition: TaskWidget.cpp:284
const C_FLOAT64 & getConvergenceOutTolerance() const
bool getFlagLimitConvergence() const
CTSSATask * pTask
CQValidatorDouble * mpValidatorOutTolerance
virtual void saved() const
Definition: CQValidator.h:71
const C_FLOAT64 & getThreshold() const
CQValidatorDouble * mpValidatorCrossing
CCopasiTask * mpTask
Definition: TaskWidget.h:130
const unsigned C_INT32 & getCrossingsLimit() const
const unsigned C_INT32 & getOutCrossingsLimit() const
CQValidatorDouble * mpValidatorOutTime
CCrossSectionProblem * mpCrossSectionProblem
const C_FLOAT64 & getOutputStartTime() const
const C_FLOAT64 & getConvergenceTolerance() const
CQValidatorDouble * mpValidatorTolerance
bool getFlagLimitOutCrossings() const
bool getFlagLimitOutConvergence() const
virtual const CObjectInterface * getObject(const CCopasiObjectName &cn) const
bool CQCrossSectionTaskWidget::runTask ( )
virtual

Implements TaskWidget.

Definition at line 144 of file CQCrossSectionTaskWidget.cpp.

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

Referenced by SliderDialog::runCrossSectionTask().

145 {
146  commitInput();
147 
148  if (!commonBeforeRunTask()) return false;
149 
150  bool success = true;
151 
152  if (!commonRunTask()) success = false;
153 
154  return success;
155 }
bool commonRunTask()
Definition: TaskWidget.cpp:395
bool commonBeforeRunTask()
Definition: TaskWidget.cpp:317
bool CQCrossSectionTaskWidget::saveTask ( )
protectedvirtual

Implements TaskWidget.

Definition at line 160 of file CQCrossSectionTaskWidget.cpp.

References CCopasiTask::getProblem(), mpSingleVariable, TaskWidget::mpTask, mpValidatorCrossing, mpValidatorLC, mpValidatorOutLC, mpValidatorOutTime, mpValidatorOutTolerance, mpValidatorTime, mpValidatorTolerance, pTask, TaskWidget::saveCommon(), CQValidator< Type >::saved(), TaskWidget::saveMethod(), CCrossSectionProblem::setConvergenceOutTolerance(), CCrossSectionProblem::setConvergenceTolerance(), CCrossSectionProblem::setCrossingsLimit(), CCrossSectionProblem::setFlagLimitConvergence(), CCrossSectionProblem::setFlagLimitCrossings(), CCrossSectionProblem::setFlagLimitOutConvergence(), CCrossSectionProblem::setFlagLimitOutCrossings(), CCrossSectionProblem::setFlagLimitOutTime(), CCrossSectionProblem::setOutCrossingsLimit(), CTrajectoryProblem::setOutputStartTime(), CCrossSectionProblem::setPositiveDirection(), CCrossSectionProblem::setSingleObjectCN(), CCrossSectionProblem::setThreshold(), and CCrossSectionProblem::setTimeLimit().

161 {
162  // check the existence of Task
164  dynamic_cast< CCrossSectionTask * >(mpTask);
165 
166  if (!pTask) return false;
167 
168  // save functions from the Parent, TaskWidget
169  saveCommon();
170  saveMethod();
171 
172  // check the existence of Problem
173  CCrossSectionProblem* pProblem =
174  dynamic_cast<CCrossSectionProblem *>(pTask->getProblem());
175  assert(pProblem);
176 
177  // save the actual changes
178  if (mpCheckSimConvergence->isChecked())
179  pProblem->setCrossingsLimit(mpTxtCrossings->text().toULong());
180 
181  pProblem->setPositiveDirection(mpDirectionPositive->isChecked());
182  pProblem->setThreshold(mpLineEditValue->text().toDouble());
183  //if (mpCheckLT->isChecked())
184  pProblem->setTimeLimit(mpTxtTime->text().toDouble());
185 
187 
188  pProblem->setFlagLimitOutTime(mpCheckOutputDelay->isChecked());
189 
190  if (mpCheckOutputDelay->isChecked())
191  {
192  pProblem->setOutputStartTime(mpTxtOutTime->text().toDouble());
193  }
194 
195  pProblem->setFlagLimitCrossings(mpCheckSimCrossings->isChecked());
196  pProblem->setCrossingsLimit(mpTxtCrossings->text().toULong());
197  pProblem->setFlagLimitOutCrossings(mpCheckOutputCrossings->isChecked());
198  pProblem->setOutCrossingsLimit(mpTxtOutCrossings->text().toULong());
199  pProblem->setFlagLimitConvergence(mpCheckSimConvergence->isChecked());
200  pProblem->setConvergenceTolerance(mpTxtConvergence->text().toDouble());
201  pProblem->setFlagLimitOutConvergence(mpCheckOutputConvergence->isChecked());
202  pProblem->setConvergenceOutTolerance(mpTxtOutConvergence->text().toDouble());
203 
207  mpValidatorLC->saved();
211 
212  return true;
213 }
void setTimeLimit(const C_FLOAT64 &timeLimit)
bool saveMethod()
Definition: TaskWidget.cpp:308
void setCrossingsLimit(const unsigned C_INT32 &crossingLimit)
CCopasiProblem * getProblem()
void setConvergenceTolerance(const C_FLOAT64 &convergenceTolerance)
CQValidatorDouble * mpValidatorTime
void setThreshold(const C_FLOAT64 &threshold)
bool saveCommon()
Definition: TaskWidget.cpp:258
void setFlagLimitOutTime(bool flagLimitTime)
void setFlagLimitConvergence(bool flagLimitConvergence)
void setPositiveDirection(bool isPositive)
CTSSATask * pTask
CQValidatorDouble * mpValidatorOutTolerance
void setFlagLimitOutCrossings(bool flagLimitCrossing)
virtual void saved() const
Definition: CQValidator.h:71
void setFlagLimitCrossings(bool flagLimitCrossing)
CQValidatorDouble * mpValidatorCrossing
CCopasiTask * mpTask
Definition: TaskWidget.h:130
void setConvergenceOutTolerance(const C_FLOAT64 &convergenceTolerance)
CQValidatorDouble * mpValidatorOutTime
CQValidatorDouble * mpValidatorTolerance
void setSingleObjectCN(const std::string &cn)
void setOutputStartTime(const C_FLOAT64 &endTime)
void setFlagLimitOutConvergence(bool flagLimitConvergence)
const CCopasiObject * mpSingleVariable
void setOutCrossingsLimit(const unsigned C_INT32 &crossingLimit)
void CQCrossSectionTaskWidget::setSingleObject ( const CCopasiObject pSingleVariable)
private

Definition at line 350 of file CQCrossSectionTaskWidget.cpp.

References FROM_UTF8, CCopasiObject::getObjectDisplayName(), and mpSingleVariable.

Referenced by loadTask(), and slotChooseVariable().

351 {
352  mpSingleVariable = pSingleVariable;
353 
354  if (pSingleVariable == NULL)
355  mpLineEditVariable->setText(tr("[Please Choose Object.] --->"));
356  else
357  mpLineEditVariable->setText(FROM_UTF8(pSingleVariable->getObjectDisplayName()));
358 }
virtual std::string getObjectDisplayName(bool regular=true, bool richtext=false) const
#define FROM_UTF8(__x)
Definition: qtUtilities.h:73
const CCopasiObject * mpSingleVariable
void CQCrossSectionTaskWidget::showUnits ( )
private

Definition at line 565 of file CQCrossSectionTaskWidget.cpp.

References FROM_UTF8, CCopasiDataModel::getModel(), CModel::getTimeUnitsDisplayString(), and CopasiWidget::mpDataModel.

Referenced by loadTask(), and update().

566 {
567  const CModel * pModel = NULL;
568 
569  QString TimeUnits;
570 
571  if (mpDataModel != NULL &&
572  (pModel = mpDataModel->getModel()) != NULL)
573  {
574  TimeUnits = "(" + FROM_UTF8(pModel->getTimeUnitsDisplayString()) + ")";
575  }
576 
577  mpLblDurationLimit->setText("if detection time " + TimeUnits + " larger:");
578  mpCheckOutputDelay->setText("if time " + TimeUnits + " larger:");
579 }
#define FROM_UTF8(__x)
Definition: qtUtilities.h:73
std::string getTimeUnitsDisplayString() const
Definition: CModel.cpp:4531
CCopasiDataModel * mpDataModel
Definition: copasiWidget.h:65
Definition: CModel.h:50
void CQCrossSectionTaskWidget::slotChooseVariable ( )
privateslot

Definition at line 341 of file CQCrossSectionTaskWidget.cpp.

References CCopasiSelectionDialog::getObjectSingle(), mpSingleVariable, CQSimpleSelectionTree::ObservedValues, setSingleObject(), and CQSimpleSelectionTree::Variables.

342 {
343  const CCopasiObject * pObject =
346 
347  setSingleObject(pObject);
348 }
void setSingleObject(const CCopasiObject *pSingleVariable)
const CCopasiObject * mpSingleVariable
static const CCopasiObject * getObjectSingle(QWidget *pParent, const CQSimpleSelectionTree::ObjectClasses &classes, const CCopasiObject *pCurrentObject=NULL)
void CQCrossSectionTaskWidget::slotOutputConvergence ( bool  b)
privateslot

Definition at line 454 of file CQCrossSectionTaskWidget.cpp.

References FROM_UTF8, CCopasiMessage::getAllMessageText(), CQMessageBox::information(), mpCrossSectionProblem, and CCrossSectionProblem::setConvergenceOutTolerance().

455 {
456  mpTxtOutConvergence->setEnabled(b);
457 
458  if (!mpTxtOutConvergence->hasAcceptableInput())
459  return;
460 
461  try
462  {
463  mpCrossSectionProblem->setConvergenceOutTolerance(mpTxtOutConvergence->text().toDouble());
464  }
465 
466  catch (...)
467  {
468  CQMessageBox::information(this, QString("Information"),
470  QMessageBox::Ok, QMessageBox::Ok);
471  }
472 }
#define FROM_UTF8(__x)
Definition: qtUtilities.h:73
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)
void setConvergenceOutTolerance(const C_FLOAT64 &convergenceTolerance)
CCrossSectionProblem * mpCrossSectionProblem
void CQCrossSectionTaskWidget::slotOutputConvergenceTolerance ( )
privateslot

Definition at line 498 of file CQCrossSectionTaskWidget.cpp.

499 {
500  if (!mpTxtOutConvergence->hasAcceptableInput())
501  return;
502 
503  // TODO: Implement
504 }
void CQCrossSectionTaskWidget::slotOutputCrossings ( bool  b)
privateslot

Definition at line 435 of file CQCrossSectionTaskWidget.cpp.

References FROM_UTF8, CCopasiMessage::getAllMessageText(), CQMessageBox::information(), mpCrossSectionProblem, and CCrossSectionProblem::setOutCrossingsLimit().

436 {
437  mpTxtOutCrossings->setEnabled(b);
438 
439  if (!mpTxtOutCrossings->hasAcceptableInput())
440  return;
441 
442  try
443  {
444  mpCrossSectionProblem->setOutCrossingsLimit(mpTxtOutCrossings->text().toDouble());
445  }
446 
447  catch (...)
448  {
449  CQMessageBox::information(this, QString("Information"),
451  QMessageBox::Ok, QMessageBox::Ok);
452  }
453 }
#define FROM_UTF8(__x)
Definition: qtUtilities.h:73
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)
CCrossSectionProblem * mpCrossSectionProblem
void setOutCrossingsLimit(const unsigned C_INT32 &crossingLimit)
void CQCrossSectionTaskWidget::slotOutputCrossingsLimit ( )
privateslot

Definition at line 505 of file CQCrossSectionTaskWidget.cpp.

506 {
507  if (!mpTxtOutCrossings->hasAcceptableInput())
508  return;
509 
510  // TODO: Implement
511 }
void CQCrossSectionTaskWidget::slotOutputDelay ( bool  b)
privateslot

Definition at line 413 of file CQCrossSectionTaskWidget.cpp.

References FROM_UTF8, CCopasiMessage::getAllMessageText(), CQMessageBox::information(), mpCrossSectionProblem, and CTrajectoryProblem::setOutputStartTime().

414 {
415  mpTxtOutTime->setEnabled(b);
416 
417  if (!mpTxtOutTime->hasAcceptableInput())
418  return;
419 
420  try
421  {
422  mpCrossSectionProblem->setOutputStartTime(mpTxtOutTime->text().toDouble());
423  }
424 
425  catch (...)
426  {
427  CQMessageBox::information(this, QString("Information"),
429  QMessageBox::Ok, QMessageBox::Ok);
430  }
431 
432 // updateValues();
433 }
#define FROM_UTF8(__x)
Definition: qtUtilities.h:73
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)
CCrossSectionProblem * mpCrossSectionProblem
void setOutputStartTime(const C_FLOAT64 &endTime)
void CQCrossSectionTaskWidget::slotOutputDelayTime ( )
privateslot

Definition at line 512 of file CQCrossSectionTaskWidget.cpp.

513 {
514  if (!mpTxtOutTime->hasAcceptableInput())
515  return;
516 
517  // TODO: Implement
518 }
void CQCrossSectionTaskWidget::slotUpdateConvergence ( bool  b)
privateslot

Definition at line 391 of file CQCrossSectionTaskWidget.cpp.

References FROM_UTF8, CCopasiMessage::getAllMessageText(), CQMessageBox::information(), mpCrossSectionProblem, and CCrossSectionProblem::setConvergenceTolerance().

392 {
393  mpTxtConvergence->setEnabled(b);
394 
395  if (!mpTxtConvergence->hasAcceptableInput())
396  return;
397 
398  try
399  {
400  mpCrossSectionProblem->setConvergenceTolerance(mpTxtConvergence->text().toDouble());
401  }
402 
403  catch (...)
404  {
405  CQMessageBox::information(this, QString("Information"),
407  QMessageBox::Ok, QMessageBox::Ok);
408  }
409 
410 // updateValues();
411 }
#define FROM_UTF8(__x)
Definition: qtUtilities.h:73
void setConvergenceTolerance(const C_FLOAT64 &convergenceTolerance)
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)
CCrossSectionProblem * mpCrossSectionProblem
void CQCrossSectionTaskWidget::slotUpdateConvergenceTolerance ( )
privateslot

Definition at line 483 of file CQCrossSectionTaskWidget.cpp.

484 {
485  if (!mpTxtConvergence->hasAcceptableInput())
486  return;
487 
488  // TODO: Implement
489 }
void CQCrossSectionTaskWidget::slotUpdateCrossings ( bool  b)
privateslot

Definition at line 368 of file CQCrossSectionTaskWidget.cpp.

References FROM_UTF8, CCopasiMessage::getAllMessageText(), CQMessageBox::information(), mpCrossSectionProblem, CCrossSectionProblem::setCrossingsLimit(), and CCrossSectionProblem::setFlagLimitCrossings().

369 {
370  mpTxtCrossings->setEnabled(b);
371 
372  if (!mpTxtCrossings->hasAcceptableInput())
373  return;
374 
375  try
376  {
378  mpCrossSectionProblem->setCrossingsLimit(mpTxtCrossings->text().toULong());
379  }
380 
381  catch (...)
382  {
383  CQMessageBox::information(this, QString("Information"),
385  QMessageBox::Ok, QMessageBox::Ok);
386  }
387 
388 // updateValues();
389 }
#define FROM_UTF8(__x)
Definition: qtUtilities.h:73
void setCrossingsLimit(const unsigned C_INT32 &crossingLimit)
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)
void setFlagLimitCrossings(bool flagLimitCrossing)
CCrossSectionProblem * mpCrossSectionProblem
void CQCrossSectionTaskWidget::slotUpdateCrossingsLimit ( )
privateslot

Definition at line 490 of file CQCrossSectionTaskWidget.cpp.

491 {
492  if (!mpTxtCrossings->hasAcceptableInput())
493  return;
494 
495  // TODO: Implement
496 }
void CQCrossSectionTaskWidget::slotUpdateTime ( )
privateslot

Definition at line 474 of file CQCrossSectionTaskWidget.cpp.

References commitInput().

475 {
476  if (!mpTxtTime->hasAcceptableInput())
477  return;
478 
479  commitInput();
480 
481  // TODO: Implement
482 }
void CQCrossSectionTaskWidget::slotValueRate ( )
privateslot

Definition at line 360 of file CQCrossSectionTaskWidget.cpp.

References commitInput().

361 {
362  if (!mpLineEditValue->hasAcceptableInput())
363  return;
364 
365  commitInput();
366 }
bool CQCrossSectionTaskWidget::taskFinishedEvent ( )
protectedvirtual

Reimplemented from TaskWidget.

Definition at line 215 of file CQCrossSectionTaskWidget.cpp.

References ListViews::findWidgetFromId(), CQTimeSeriesWidget::loadResult(), CopasiWidget::mpListView, TaskWidget::mpTask, and pResult.

216 {
217  bool success = true;
218  // We need to load the result here as this is the only place where
219  // we know that it is correct.
221  dynamic_cast< CQTimeSeriesWidget * >(mpListView->findWidgetFromId(281));
222 
223  if (pResult == NULL)
224  return false;
225 
226  success &= pResult->loadResult(mpTask);
227 
228  return success;
229 }
virtual bool loadResult(const CCopasiTask *pTask)
CopasiWidget * findWidgetFromId(const size_t &id) const
Definition: listviews.cpp:678
ListViews * mpListView
Definition: copasiWidget.h:62
CCopasiTask * mpTask
Definition: TaskWidget.h:130
const CArrayAnnotation * pResult
bool CQCrossSectionTaskWidget::update ( ListViews::ObjectType  objectType,
ListViews::Action  action,
const std::string &  key 
)
virtual

Reimplemented from TaskWidget.

Definition at line 545 of file CQCrossSectionTaskWidget.cpp.

References ListViews::CHANGE, ListViews::MODEL, and showUnits().

546 {
547  switch (objectType)
548  {
549  case ListViews::MODEL:
550 
551  if (action == ListViews::CHANGE)
552  {
553  showUnits();
554  }
555 
556  break;
557 
558  default:
559  break;
560  }
561 
562  return true;
563 }
objectType
void CQCrossSectionTaskWidget::updateValues ( )
private

Definition at line 520 of file CQCrossSectionTaskWidget.cpp.

References CCrossSectionProblem::getConvergenceOutTolerance(), CCrossSectionProblem::getConvergenceTolerance(), CCrossSectionProblem::getCrossingsLimit(), CCrossSectionProblem::getOutCrossingsLimit(), CTrajectoryProblem::getOutputStartTime(), CCrossSectionProblem::getThreshold(), CCrossSectionProblem::getTimeLimit(), mpCrossSectionProblem, mpValidatorCrossing, mpValidatorLC, mpValidatorOutLC, mpValidatorOutTime, mpValidatorOutTolerance, mpValidatorTime, mpValidatorTolerance, and CQValidator< Type >::revalidate().

521 {
522  mpTxtCrossings->setText(QString::number(mpCrossSectionProblem->getCrossingsLimit()));
524 
525  mpTxtOutCrossings->setText(QString::number(mpCrossSectionProblem->getOutCrossingsLimit()));
527 
528  mpTxtTime->setText(QString::number(mpCrossSectionProblem->getTimeLimit()));
530 
531  mpTxtOutTime->setText(QString::number(mpCrossSectionProblem->getOutputStartTime()));
533 
534  mpTxtConvergence->setText(QString::number(mpCrossSectionProblem->getConvergenceTolerance()));
536 
537  mpTxtOutConvergence->setText(QString::number(mpCrossSectionProblem->getConvergenceOutTolerance()));
539 
540  mpLineEditValue->setText(QString::number(mpCrossSectionProblem->getThreshold()));
542 }
const C_FLOAT64 & getTimeLimit() const
CQValidatorDouble * mpValidatorTime
const C_FLOAT64 & getConvergenceOutTolerance() const
CQValidatorDouble * mpValidatorOutTolerance
virtual State revalidate()
Definition: CQValidator.h:63
const C_FLOAT64 & getThreshold() const
CQValidatorDouble * mpValidatorCrossing
const unsigned C_INT32 & getCrossingsLimit() const
const unsigned C_INT32 & getOutCrossingsLimit() const
CQValidatorDouble * mpValidatorOutTime
CCrossSectionProblem * mpCrossSectionProblem
const C_FLOAT64 & getOutputStartTime() const
const C_FLOAT64 & getConvergenceTolerance() const
CQValidatorDouble * mpValidatorTolerance

Member Data Documentation

CCrossSectionProblem* CQCrossSectionTaskWidget::mpCrossSectionProblem
private
const CCopasiObject* CQCrossSectionTaskWidget::mpSingleVariable
private
CQValidatorDouble* CQCrossSectionTaskWidget::mpValidatorCrossing
private

Definition at line 61 of file CQCrossSectionTaskWidget.h.

Referenced by init(), loadTask(), saveTask(), and updateValues().

CQValidatorInt* CQCrossSectionTaskWidget::mpValidatorLC
private

Definition at line 55 of file CQCrossSectionTaskWidget.h.

Referenced by init(), loadTask(), saveTask(), and updateValues().

CQValidatorInt* CQCrossSectionTaskWidget::mpValidatorOutLC
private

Definition at line 58 of file CQCrossSectionTaskWidget.h.

Referenced by init(), loadTask(), saveTask(), and updateValues().

CQValidatorDouble* CQCrossSectionTaskWidget::mpValidatorOutTime
private

Definition at line 59 of file CQCrossSectionTaskWidget.h.

Referenced by init(), loadTask(), saveTask(), and updateValues().

CQValidatorDouble* CQCrossSectionTaskWidget::mpValidatorOutTolerance
private

Definition at line 60 of file CQCrossSectionTaskWidget.h.

Referenced by init(), loadTask(), saveTask(), and updateValues().

CQValidatorDouble* CQCrossSectionTaskWidget::mpValidatorTime
private

Definition at line 56 of file CQCrossSectionTaskWidget.h.

Referenced by init(), loadTask(), saveTask(), and updateValues().

CQValidatorDouble* CQCrossSectionTaskWidget::mpValidatorTolerance
private

Definition at line 57 of file CQCrossSectionTaskWidget.h.

Referenced by init(), loadTask(), saveTask(), and updateValues().


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