COPASI API  4.16.103
CLNAResultWidget.cpp
Go to the documentation of this file.
1 // Copyright (C) 2011 - 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 #include <QtGui/QGridLayout>
7 #include "copasi.h"
8 
9 #include "CLNAResultWidget.h"
10 #include "CLNAResultSubwidget.h"
13 #include "lna/CLNATask.h"
14 #include "lna/CLNAMethod.h"
15 #include "qtUtilities.h"
17 
18 /*
19  * Constructs a CLNAResultWidget which is a child of 'parent', with the
20  * name 'name' and widget flags set to 'f'.
21  */
22 CLNAResultWidget::CLNAResultWidget(QWidget* parent, const char* name, Qt::WFlags fl)
23  : CopasiWidget(parent, name, fl)
24 {
25  if (!name)
26  setObjectName("CLNAResultWidget");
27 
28  setWindowTitle(trUtf8("CLNAResultWidget"));
29 
30  mWidgetLayout = new QGridLayout(this);
31  mWidgetLayout->setObjectName("Layout");
32 
33  mCentralWidget = new CLNAResultSubwidget(this, "CLNAResultSubwidget");
34  mWidgetLayout->addWidget(mCentralWidget, 0, 0);
35 }
36 
37 /*
38  * Destroys the object and frees any allocated resources
39  */
41 {}
42 
43 /* This function loads the compartments widget when its name is
44  clicked in the tree */
46 {
47  assert(CCopasiRootContainer::getDatamodelList()->size() > 0);
48  CLNATask * pTask =
49  dynamic_cast<CLNATask *>((*(*CCopasiRootContainer::getDatamodelList())[0]->getTaskList())["Linear Noise Approximation"]);
50 
51  if (!pTask) return false;
52 
53  mCentralWidget->loadAll(dynamic_cast<CLNAMethod*>(pTask->getMethod()));
54  return true;
55 }
56 
58 {
59  return true;
60 }
61 
63  ListViews::Action action,
64  const std::string & C_UNUSED(key))
65 {
66  if (objectType == ListViews::MODEL && action == ListViews::ADD)
67  mCentralWidget->loadAll(NULL);
68 
69  return true;
70 }
71 
73 {
74  return true;
75 }
76 
78 {
79  return true;
80 }
virtual bool leave()
virtual void loadAll(const CLNAMethod *lnaMethod)
#define C_UNUSED(p)
Definition: copasi.h:220
CLNAResultWidget(QWidget *parent=0, const char *name=0, Qt::WFlags fl=0)
CTSSATask * pTask
static CCopasiVector< CCopasiDataModel > * getDatamodelList()
CCopasiMethod * getMethod()
virtual bool enterProtected()
bool fl(const C_FLOAT64 &d1, const C_FLOAT64 &d2)
CLNAResultSubwidget * mCentralWidget
QGridLayout * mWidgetLayout
virtual bool update(ListViews::ObjectType objectType, ListViews::Action action, const std::string &key)