COPASI API  4.16.103
CQTSSAResultWidget.cpp
Go to the documentation of this file.
1 // Copyright (C) 2010 - 2013 by Pedro Mendes, Virginia Tech Intellectual
2 // Properties, Inc., University of Heidelberg, and The University
3 // of Manchester.
4 // All rights reserved.
5 
6 // Copyright (C) 2008 - 2009 by Pedro Mendes, Virginia Tech Intellectual
7 // Properties, Inc., EML Research, gGmbH, University of Heidelberg,
8 // and The University of Manchester.
9 // All rights reserved.
10 
11 // Copyright (C) 2007 by Pedro Mendes, Virginia Tech Intellectual
12 // Properties, Inc. and EML Research, gGmbH.
13 // All rights reserved.
14 
15 #include <QtGui/QGridLayout>
16 #include "copasi.h"
17 
18 #include "CQTSSAResultWidget.h"
19 #include "CQTSSAResultSubWidget.h"
23 #include "tssanalysis/CTSSATask.h"
24 
25 //#include "report/CKeyFactory.h"
26 #include "qtUtilities.h"
28 
29 #include "tssanalysis/CTSSATask.h"
30 
33 
34 /*
35  * Constructs a CQTSSAResultWidget which is a child of 'parent', with the
36  * name 'name' and widget flags set to 'f'.
37  */
38 CQTSSAResultWidget::CQTSSAResultWidget(QWidget* parent, const char* name, Qt::WFlags fl)
39  : CopasiWidget(parent, name, fl)
40 {
41  if (!name)
42  setObjectName("CQTSSAResultWidget");
43 
44  setWindowTitle(trUtf8("CQTSSAResultWidget"));
45 
46  mWidgetLayout = new QGridLayout(this);
47  mWidgetLayout->setObjectName("Layout");
48 
50  mCentralWidget->setObjectName("CQTSSAResultSubWidget");
51  mWidgetLayout->addWidget(mCentralWidget, 0, 0);
52 
53  /*commitChanges = new QPushButton(this, "commitChanges");
54  commitChanges->setText(trUtf8("Commit"));
55  Layout5->addWidget(commitChanges);
56 
57  cancelChanges = new QPushButton(this, "cancelChanges");
58  cancelChanges->setText(trUtf8("Revert"));
59  Layout5->addWidget(cancelChanges);*/
60 
61  // signals and slots connections
62  //connect(commitChanges, SIGNAL(clicked()), this, SLOT(slotBtnOKClicked()));
63  //connect(cancelChanges, SIGNAL(clicked()), this, SLOT(slotBtnCancelClicked()));
64 }
65 
66 /*
67  * Destroys the object and frees any allocated resources
68  */
70 {}
71 
73 {
74 
75 #if 0
76  mCentralWidget->displayOptimizationTab(false);
77  assert(CCopasiRootContainer::getDatamodelList()->size() > 0);
78  mCentralWidget->table()->setTimeSeries(dynamic_cast<CTSSATask *>((*(*CCopasiRootContainer::getDatamodelList())[0]->getTaskList())["Time Scale Separation Analysis"])->getTimeSeries());
79 #endif
80 
81  return true;
82 }
83 
85 {
86  return true;
87 }
88 
89 /*void CQTSSAResultWidget::slotBtnCancelClicked()
90 {
91  enter(objKey); // reload
92 }*/
93 
94 /*void CQTSSAResultWidget::slotBtnOKClicked()
95 {
96  saveToCompartment();
97 }*/
98 
100  ListViews::Action /* action */,
101  const std::string & /* key */)
102 {
103 
104 #if 0
105 
106  if (objectType == ListViews::MODEL &&
107  action == ListViews::ADD)
108  mCentralWidget->table()->setTimeSeries(CTimeSeries());
109 
110 #endif
111 
112  return true;
113 }
114 
116 {
117  //return saveToCompartment();
118  return true;
119 }
120 
122 {
123  pTask =
124  dynamic_cast<CTSSATask *>((*(*CCopasiRootContainer::getDatamodelList())[0]->getTaskList())["Time Scale Separation Analysis"]);
125  pTSSILDM = dynamic_cast<CTSSAMethod*>(pTask->getMethod());
126 
127  if (!pTSSILDM->getCurrentStep())
128  {
129 #if 0
130  mCentralWidget->setStepSelectionDisabled(true);
131 #endif
133  }
134 
135 #if 0
136  else
137  mCentralWidget->setStepSelectionDisabled(false);
138 
139 #endif
140 
141  return loadFromBackend();
142  /*objKey = key;
143  CCompartment* comp = dynamic_cast< CCompartment * >(CCopasiRootContainer::getKeyFactory()->get(key));
144 
145  if (comp) return loadFromCompartment(comp);
146  else return false;*/
147 }
CTSSAMethod * pTSSILDM
QGridLayout * mWidgetLayout
virtual bool update(ListViews::ObjectType objectType, ListViews::Action action, const std::string &key)
objectType
const int & getCurrentStep() const
CTSSATask * pTask
static CCopasiVector< CCopasiDataModel > * getDatamodelList()
CQTSSAResultSubWidget * mCentralWidget
CCopasiMethod * getMethod()
bool fl(const C_FLOAT64 &d1, const C_FLOAT64 &d2)
virtual bool enterProtected()
CQTSSAResultWidget(QWidget *parent=0, const char *name=0, Qt::WFlags fl=0)