COPASI API  4.16.103
CMCAResultWidget.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) 2004 - 2007 by Pedro Mendes, Virginia Tech Intellectual
12 // Properties, Inc. and EML Research, gGmbH.
13 // All rights reserved.
14 
15 #include <QtGui/QLayout>
16 
17 #include "copasi.h"
18 
19 #include "CMCAResultWidget.h"
20 #include "CMCAResultSubwidget.h"
23 #include "steadystate/CMCATask.h"
24 #include "steadystate/CMCAMethod.h"
25 #include "qtUtilities.h"
27 
28 /*
29  * Constructs a CMCAResultWidget which is a child of 'parent', with the
30  * name 'name' and widget flags set to 'f'.
31  */
32 CMCAResultWidget::CMCAResultWidget(QWidget* parent, const char* name, Qt::WFlags fl)
33  : CopasiWidget(parent, name, fl)
34 {
35  if (!name)
36  setObjectName("CMCAResultWidget");
37 
38  setWindowTitle(trUtf8("CMCAResultWidget"));
39 
40  mWidgetLayout = new QGridLayout(this);
41  mWidgetLayout->setObjectName("Layout");
42 
43  mCentralWidget = new CMCAResultSubwidget(this, "CMCAResultSubwidget");
44  mWidgetLayout->addWidget(mCentralWidget, 0, 0);
45 }
46 
47 /*
48  * Destroys the object and frees any allocated resources
49  */
51 {}
52 
53 /* This function loads the compartments widget when its name is
54  clicked in the tree */
56 {
57  assert(CCopasiRootContainer::getDatamodelList()->size() > 0);
58  CMCATask * pTask =
59  dynamic_cast<CMCATask *>((*(*CCopasiRootContainer::getDatamodelList())[0]->getTaskList())["Metabolic Control Analysis"]);
60 
61  if (!pTask) return false;
62 
63  mCentralWidget->loadAll(dynamic_cast<CMCAMethod*>(pTask->getMethod()));
64  return true;
65 }
66 
68 {
69  return true;
70 }
71 
73  ListViews::Action action,
74  const std::string & C_UNUSED(key))
75 {
76  if (objectType == ListViews::MODEL && action == ListViews::ADD)
77  mCentralWidget->loadAll(NULL);
78 
79  return true;
80 }
81 
83 {
84  return true;
85 }
86 
88 {
89  return true;
90 }
virtual bool update(ListViews::ObjectType objectType, ListViews::Action action, const std::string &key)
virtual void loadAll(const CMCAMethod *mcaMethod)
CMCAResultSubwidget * mCentralWidget
#define C_UNUSED(p)
Definition: copasi.h:220
CTSSATask * pTask
static CCopasiVector< CCopasiDataModel > * getDatamodelList()
virtual bool leave()
CCopasiMethod * getMethod()
virtual bool enterProtected()
bool fl(const C_FLOAT64 &d1, const C_FLOAT64 &d2)
CMCAResultWidget(QWidget *parent=0, const char *name=0, Qt::WFlags fl=0)
QGridLayout * mWidgetLayout