COPASI API  4.16.103
ParaPanel.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 // Qt headers
16 #include <QtCore/QString>
17 #include <QtGui/QValidator>
18 
19 // local copasi headers
20 #include "CQLayoutMainWindow.h"
21 #include "ParaPanel.h"
22 
23 CQParaPanel::CQParaPanel(QWidget* parent):
24  QWidget(parent)
25 {
26  setupUi(this);
27 }
28 
30 {
31  mpScalingButtonGroup_2->setEnabled(true);
32 }
33 
35 {
36  mpScalingButtonGroup_2->setEnabled(false);
37 }
38 
40 {
41  mpSpinBox1->setEnabled(true);
42  mpScalingButtonGroup->setEnabled(true);
43 }
44 
46 {
47  mpSpinBox1->setEnabled(false);
48  mpScalingButtonGroup->setEnabled(false);
49 }
50 
52 {
53  mpStepEdit->setEnabled(true);
54 }
55 
57 {
58  mpStepEdit->setEnabled(false);
59 }
60 
62 {
63  CQLayoutMainWindow * tmp = dynamic_cast<CQLayoutMainWindow *>(parentWidget()->parentWidget()->parentWidget()->parentWidget());
64  assert(tmp);
65 
66  if (tmp) tmp -> setStepsPerSecond(mpSpinBox1->value());
67 }
68 
70 {
71  CQLayoutMainWindow * tmp = dynamic_cast<CQLayoutMainWindow *>(parentWidget()->parentWidget()->parentWidget()->parentWidget());
72  assert(tmp);
73 
74  if (tmp) tmp -> setGlobalScaling();
75 }
76 
78 {
79  CQLayoutMainWindow * tmp = dynamic_cast<CQLayoutMainWindow *>(parentWidget()->parentWidget()->parentWidget()->parentWidget());
80  assert(tmp);
81 
82  if (tmp) tmp -> setIndividualScaling();
83 }
84 
86 {
87  QString s = QString::number(i, 10);
88  mpStepEdit->setText(s);
89 }
90 
92 {
93  QValidator* pValidator = new QIntValidator(0, INT_MAX, this);
94  mpStepEdit->setValidator(pValidator);
95 
96  QString line = mpStepEdit->text();
97  bool ok;
98  int val = line.toInt(&ok, 10);
99 
100  if (ok)
101  {
102  CQLayoutMainWindow * tmp = dynamic_cast<CQLayoutMainWindow *>(parentWidget()->parentWidget()->parentWidget()->parentWidget());
103  assert(tmp);
104 
105  if (tmp) tmp -> setValueOnSlider(val);
106  }
107 }
108 
110 {
111  CQLayoutMainWindow * tmp = dynamic_cast<CQLayoutMainWindow *>(parentWidget()->parentWidget()->parentWidget()->parentWidget());
112  assert(tmp);
113 
114  if (tmp) tmp -> setSizeMode();
115 }
116 
118 {
119  CQLayoutMainWindow * tmp = dynamic_cast<CQLayoutMainWindow *>(parentWidget()->parentWidget()->parentWidget()->parentWidget());
120  assert(tmp);
121 
122  if (tmp) tmp -> setColorMode();
123 }
void setColorMode()
Definition: ParaPanel.cpp:117
CQParaPanel(QWidget *parent=0)
Definition: ParaPanel.cpp:23
void setIndividualScaling()
Definition: ParaPanel.cpp:77
void setStepNumber(int i)
Definition: ParaPanel.cpp:85
void disableModeChoice()
Definition: ParaPanel.cpp:34
void stepEdit_returnPressed()
Definition: ParaPanel.cpp:91
void setGlobalScaling()
Definition: ParaPanel.cpp:69
void changeFrameRate()
Definition: ParaPanel.cpp:61
void disableStepNumberChoice()
Definition: ParaPanel.cpp:56
void enableParameterChoice()
Definition: ParaPanel.cpp:39
void enableModeChoice()
Definition: ParaPanel.cpp:29
void disableParameterChoice()
Definition: ParaPanel.cpp:45
void setSizeMode()
Definition: ParaPanel.cpp:109
void enableStepNumberChoice()
Definition: ParaPanel.cpp:51