COPASI API  4.16.103
Public Member Functions | Private Member Functions | List of all members
CScanWidgetRepeat Class Reference

#include <CScanWidgetRepeat.h>

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

Public Member Functions

 CScanWidgetRepeat (QWidget *parent=0)
 
 CScanWidgetRepeat (const CScanWidgetRepeat &src, QWidget *parent=0)
 
virtual void load (const CCopasiParameterGroup *pItem)
 
virtual bool save (CCopasiParameterGroup *pItem) const
 
virtual ~CScanWidgetRepeat ()
 
- Public Member Functions inherited from CScanItemData
 CScanItemData (const CScanItemData &src)
 
const CScanProblem::TypegetType () const
 
virtual ~CScanItemData ()
 

Private Member Functions

void init ()
 

Additional Inherited Members

- Protected Member Functions inherited from CScanItemData
 CScanItemData (const CScanProblem::Type &type)
 
- Protected Attributes inherited from CScanItemData
CCopasiParameterGroupmpData
 
CScanProblem::Type mType
 

Detailed Description

Definition at line 27 of file CScanWidgetRepeat.h.

Constructor & Destructor Documentation

CScanWidgetRepeat::CScanWidgetRepeat ( QWidget *  parent = 0)

Definition at line 33 of file CScanWidgetRepeat.cpp.

References init().

33  :
34  QWidget(parent),
36 {
37  setupUi(this);
38  init();
39 }
CScanWidgetRepeat::CScanWidgetRepeat ( const CScanWidgetRepeat src,
QWidget *  parent = 0 
)

Definition at line 41 of file CScanWidgetRepeat.cpp.

References init(), load(), and CScanItemData::mpData.

41  :
42  QWidget(parent),
43  CScanItemData(src)
44 {
45  setupUi(this);
46  init();
47  load(mpData);
48 }
virtual void load(const CCopasiParameterGroup *pItem)
CCopasiParameterGroup * mpData
Definition: CScanItemData.h:42
CScanWidgetRepeat::~CScanWidgetRepeat ( )
virtual

Definition at line 53 of file CScanWidgetRepeat.cpp.

54 {
55  // no need to delete child widgets, Qt does it all for us
56 }

Member Function Documentation

void CScanWidgetRepeat::init ( )
private

Definition at line 58 of file CScanWidgetRepeat.cpp.

Referenced by CScanWidgetRepeat().

59 {
60  lineEditNumber->setValidator(new QIntValidator(lineEditNumber));
61 }
void CScanWidgetRepeat::load ( const CCopasiParameterGroup pItem)
virtual

Implements CScanItemData.

Definition at line 64 of file CScanWidgetRepeat.cpp.

References C_INT32, CCopasiParameterGroup::getValue(), CScanItemData::mpData, CCopasiParameter::Value::pINT, and CScanProblem::SCAN_REPEAT.

Referenced by CScanWidgetRepeat(), ScanWidget::loadTask(), and ScanWidget::slotAddItem().

65 {
66  if (pItem == NULL) return;
67 
68  *mpData = *pItem;
69 
70  C_INT32 * tmp;
71 
72  if (!(tmp = mpData->getValue("Type").pINT))
73  return;
74 
76  return;
77 
78  if (!(tmp = mpData->getValue("Number of steps").pINT))
79  return;
80 
81  lineEditNumber->setText(QString::number(* tmp));
82 
83  return;
84 }
#define C_INT32
Definition: copasi.h:90
CCopasiParameterGroup * mpData
Definition: CScanItemData.h:42
const CCopasiParameter::Value & getValue(const std::string &name) const
bool CScanWidgetRepeat::save ( CCopasiParameterGroup pItem) const
virtual

Implements CScanItemData.

Definition at line 87 of file CScanWidgetRepeat.cpp.

References CScanItemData::mpData, and CCopasiParameterGroup::setValue().

88 {
89  mpData->setValue("Number of steps", lineEditNumber->text().toUInt());
90 
91  if (pItem != NULL)
92  {
93  if (*mpData == *pItem) return false;
94 
95  *pItem = *mpData;
96  return true;
97  }
98 
99  return false;
100 }
CCopasiParameterGroup * mpData
Definition: CScanItemData.h:42
bool setValue(const std::string &name, const CType &value)

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