COPASI API  4.16.103
Signals | Public Member Functions | Protected Types | Protected Slots | Protected Member Functions | Protected Attributes | List of all members
SliderSettingsDialog Class Reference

#include <SliderSettingsDialog.h>

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

Signals

void sliderChanged (CSlider *slider)
 

Public Member Functions

virtual void disableObjectChoosing (bool disableChoosing)
 
virtual CSlidergetSlider ()
 
virtual void setDefinedSliders (std::vector< CSlider * > sliderVect)
 
virtual void setModel (CModel *model)
 
virtual void setSlider (CSlider *slider)
 
 SliderSettingsDialog (QWidget *pParent=NULL)
 
virtual void updateSlider ()
 
virtual ~SliderSettingsDialog ()
 

Protected Types

enum  CHANGETYPE {
  NONE, OBJECT, MIN, MAX,
  NUMTICKS, TICKSIZE, TICKFACTOR, ORIGVAL,
  VALUE, LOGARITHMIC
}
 

Protected Slots

virtual void browseButtonPressed ()
 
virtual void cancelButtonPressed ()
 
virtual void extendedOptionsClicked ()
 
virtual void globalCheckBoxToggled ()
 
virtual void logCheckBoxToggled (bool on)
 
virtual void maxValueChanged ()
 
virtual void maxValueTextChanged ()
 
virtual void minorMajorFactorChanged ()
 
virtual void minorTickSizeChanged ()
 
virtual void minValueChanged ()
 
virtual void minValueTextChanged ()
 
virtual void numMinorTicksChanged ()
 
virtual void numTicksTextChanged ()
 
virtual void objectValueChanged ()
 
virtual void okButtonPressed ()
 
virtual void originalValueChanged ()
 
virtual void origValueTextChanged ()
 
virtual void tickFactorTextChanged ()
 
virtual void tickSizeTextChanged ()
 
virtual void valueTextChanged ()
 

Protected Member Functions

void hideOptionsControls ()
 
void init ()
 
void showOptionsControls ()
 
void updateInputFields ()
 
void updateInputFieldsValues ()
 
void updateInternalValues ()
 

Protected Attributes

CHANGETYPE mChanged
 
int mCurrentTaskId
 
std::vector< CSlider * > mDefinedSliders
 
double mMaxValue
 
unsigned int mMinorMajorFactor
 
double mMinorTickSize
 
double mMinValue
 
unsigned int mNumMinorTicks
 
double mOriginalValue
 
CModelmpModel
 
CSlidermpSlider
 
int mScaling
 
double mValue
 

Detailed Description

Definition at line 27 of file SliderSettingsDialog.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

SliderSettingsDialog::SliderSettingsDialog ( QWidget *  pParent = NULL)

Ctor.

Definition at line 31 of file SliderSettingsDialog.cpp.

References init().

31  :
32  QDialog(pParent),
33  mChanged(),
35  mMaxValue(),
36  mMinValue(),
37  mValue(),
42  mpSlider(NULL),
44  mpModel(NULL),
45  mScaling()
46 {
47  setupUi(this);
48  this->init();
49 }
std::vector< CSlider * > mDefinedSliders
SliderSettingsDialog::~SliderSettingsDialog ( )
virtual

Definition at line 51 of file SliderSettingsDialog.cpp.

52 {
53 }

Member Function Documentation

void SliderSettingsDialog::browseButtonPressed ( )
protectedvirtualslot

Definition at line 369 of file SliderSettingsDialog.cpp.

References FROM_UTF8, CCopasiRootContainer::getDatamodelList(), CCopasiObject::getKey(), CCopasiObject::getObjectAncestor(), CCopasiObject::getObjectDisplayName(), CCopasiSelectionDialog::getObjectSingle(), CSlider::getSliderObject(), CQMessageBox::information(), CQSimpleSelectionTree::InitialTime, CCopasiObject::isValueDbl(), CCopasiObject::isValueInt(), mDefinedSliders, mpSlider, CQSimpleSelectionTree::Parameters, CSlider::resetRange(), CSlider::setAssociatedEntityKey(), setSlider(), CSlider::setSliderObject(), updateInputFields(), and updateInputFieldsValues().

370 {
371  const CCopasiObject * pObject =
375 
376  if (pObject)
377  {
378  if (!pObject->isValueDbl() && !pObject->isValueInt())
379  {
380  CQMessageBox::information(this, "Invalid Object",
381  "You chose an object that does not correspond to an integer or float value. Please choose an object that corresponds to an integet or float value.",
382  QMessageBox::Ok, QMessageBox::Ok);
383  mpSlider = NULL;
384  mpObjectNameLineEdit->setText("");
385  return;
386  }
387 
388  /* Determine the associated entity key */
389  CCopasiContainer * pAncestor = pObject->getObjectAncestor("Task");
390 
391  if (!pAncestor) pAncestor = pObject->getObjectAncestor("Model");
392 
393  if (!pAncestor)
394  {
395  CQMessageBox::information(this, "Invalid Object",
396  "You chose an object that cannot be used as a slider. Please choose an other object.",
397  QMessageBox::Ok, QMessageBox::Ok);
398  mpSlider = NULL;
399  mpObjectNameLineEdit->setText("");
400  return;
401  }
402 
403  // We do not have a slider therefore we create one.
404  if (mpSlider == NULL)
405  {
406  // temporarily add the slider the the first datamodel
408  mpSlider->setSliderObject(const_cast< CCopasiObject * >(pObject));
409 
410  if (pAncestor)
411  mpSlider->setAssociatedEntityKey(pAncestor->getKey());
412 
413  mpSlider->resetRange();
416 
417  mpObjectNameLineEdit->setText(FROM_UTF8(mpSlider->getSliderObject()->getObjectDisplayName()));
418  return;
419  }
420 
421  // If the object of an existing slider has not changed we have nothing to do
422  if (mpSlider->getSliderObject() == pObject)
423  return;
424 
425  // Check whether a slider with the object already exists
426  size_t i, iMax = mDefinedSliders.size();
427 
428  for (i = 0; i < iMax; ++i)
429  if (mDefinedSliders[i]->getSliderObject() == pObject)
430  break;
431 
432  // A slider with the new object exists we switch to it.
433  if (i != iMax)
435  else // We need to change the object an reinitialize the slider
436  {
437  mpSlider->setSliderObject(const_cast< CCopasiObject * >(pObject));
438 
439  if (pAncestor)
440  mpSlider->setAssociatedEntityKey(pAncestor->getKey());
441 
442  mpSlider->resetRange();
445  }
446 
447  mpObjectNameLineEdit->setText(FROM_UTF8(mpSlider->getSliderObject()->getObjectDisplayName()));
448  }
449 }
CCopasiContainer * getObjectAncestor(const std::string &type) const
bool isValueInt() const
virtual std::string getObjectDisplayName(bool regular=true, bool richtext=false) const
#define FROM_UTF8(__x)
Definition: qtUtilities.h:73
bool setSliderObject(CCopasiObject *pObject)
Definition: CSlider.cpp:104
virtual void setSlider(CSlider *slider)
static StandardButton information(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons=Ok, StandardButton defaultButton=NoButton)
std::vector< CSlider * > mDefinedSliders
virtual const std::string & getKey() const
bool setAssociatedEntityKey(const std::string &associatedEntityKey)
Definition: CSlider.cpp:94
static CCopasiVector< CCopasiDataModel > * getDatamodelList()
bool isValueDbl() const
void resetRange()
Definition: CSlider.cpp:159
static const CCopasiObject * getObjectSingle(QWidget *pParent, const CQSimpleSelectionTree::ObjectClasses &classes, const CCopasiObject *pCurrentObject=NULL)
CCopasiObject * getSliderObject()
Definition: CSlider.cpp:176
void SliderSettingsDialog::cancelButtonPressed ( )
protectedvirtualslot

Definition at line 183 of file SliderSettingsDialog.cpp.

184 {
185  // close dialog, drop input
186  close();
187 }
void SliderSettingsDialog::disableObjectChoosing ( bool  disableChoosing)
virtual

Definition at line 456 of file SliderSettingsDialog.cpp.

457 {
458  mpObjectBrowseButton->setHidden(disableChoosing);
459 }
void SliderSettingsDialog::extendedOptionsClicked ( )
protectedvirtualslot

Definition at line 486 of file SliderSettingsDialog.cpp.

References hideOptionsControls(), and showOptionsControls().

487 {
488  if (mpExtendedOptionsButton->text() == "Advanced >>")
489  {
490  mpExtendedOptionsButton->setText("Advanced <<");
492  this->setFixedSize(minimumSizeHint());
493  }
494  else
495  {
496  mpExtendedOptionsButton->setText("Advanced >>");
498  int heightChange = mpOptionsGridLayout->geometry().height();
499  QSize size = this->size() - QSize(0, heightChange);
500  this->setFixedSize(size);
501  }
502 }
CSlider * SliderSettingsDialog::getSlider ( )
virtual

Definition at line 55 of file SliderSettingsDialog.cpp.

References mpSlider.

Referenced by SliderDialog::editSlider().

56 {
57  return mpSlider;
58 }
void SliderSettingsDialog::globalCheckBoxToggled ( )
protectedvirtualslot

Definition at line 531 of file SliderSettingsDialog.cpp.

References updateInternalValues().

532 {
534 }
void SliderSettingsDialog::hideOptionsControls ( )
protected

Definition at line 638 of file SliderSettingsDialog.cpp.

Referenced by extendedOptionsClicked(), and init().

639 {
640  mpNumMinorTicksLabel->hide();
641  mpNumMinorTicksEdit->hide();
642  mpMinorTickSizeLabel->hide();
643  mpMinorTickSizeEdit->hide();
644 
645  mpMinorMajorFactorLabel->hide();
646  mpMinorMajorFactorEdit->hide();
647  mpOriginalValueLabel->hide();
648  mpOriginalValueEdit->hide();
649 
650  mpObjectValueLabel->hide();
651  mpObjectValueEdit->hide();
652 }
void SliderSettingsDialog::init ( )
protected

Definition at line 346 of file SliderSettingsDialog.cpp.

References CQIconResource::copasi, hideOptionsControls(), CQIconResource::icon(), CSlider::linear, mChanged, mpSlider, mScaling, NONE, and updateInputFields().

Referenced by SliderSettingsDialog().

347 {
348  mpSlider = NULL;
349  mChanged = NONE;
351  mpObjectBrowseButton->setIcon(CQIconResource::icon(CQIconResource::copasi));
352  mpExtendedOptionsButton->setText("Advanced >>");
354  this->setFixedSize(minimumSizeHint());
355  mpObjectValueEdit->setValidator(new QDoubleValidator(this));
356  mpOriginalValueEdit->setValidator(new QDoubleValidator(this));
357  mpMinValueEdit->setValidator(new QDoubleValidator(this));
358  mpMaxValueEdit->setValidator(new QDoubleValidator(this));
359  mpMinorTickSizeEdit->setValidator(new QDoubleValidator(this));
360  QIntValidator* v = new QIntValidator(this);
361  v->setBottom(0);
362  mpNumMinorTicksEdit->setValidator(v);
363  v = new QIntValidator(this);
364  v->setBottom(0);
365  mpMinorMajorFactorEdit->setValidator(v);
367 }
static const QIcon & icon(const IconID &id)
void SliderSettingsDialog::logCheckBoxToggled ( bool  on)
protectedvirtualslot

Definition at line 504 of file SliderSettingsDialog.cpp.

References CQMessageBox::information(), CSlider::linear, CSlider::logarithmic, LOGARITHMIC, mChanged, mMinValue, mScaling, and updateInternalValues().

505 {
508 
509  if (on)
510  {
511  // check if the minValue is 0.0 or negative if so, issue an error message and uncheck the checkbox again
512  if (mMinValue <= 0.0)
513  {
514  CQMessageBox::information(this, "Incorrect min value",
515  "For logarithmic sliders, the minimum value may not be 0.0 or negative. Please set the minimum value to some (possibly very small) positive number first.",
516  QMessageBox::Ok, QMessageBox::Ok);
517  mpLogCheckBox->setChecked(false);
519  }
520  else
521  {
523  }
524  }
525  else
526  {
528  }
529 }
static StandardButton information(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons=Ok, StandardButton defaultButton=NoButton)
void SliderSettingsDialog::maxValueChanged ( )
protectedvirtualslot

Definition at line 278 of file SliderSettingsDialog.cpp.

References mChanged, mMaxValue, mMinorTickSize, mMinValue, mNumMinorTicks, mOriginalValue, mValue, NONE, and CQMessageBox::question().

Referenced by updateInternalValues().

279 {
280  // check if it is larget then the current value
281  // else set it to the current value
282  double value = mpMaxValueEdit->text().toDouble();
283 
284  if (value < mOriginalValue)
285  {
286  if (CQMessageBox::question(this, "Default value out of range.",
287  "The maximum value you set is smaller than the default value of the slider. The new default will be set to the maximum. Do you want to procceed?",
288  QMessageBox::Ok | QMessageBox::Cancel, QMessageBox::Cancel) != QMessageBox::Ok)
289  {
290  mpMaxValueEdit->setText(QString::number(mMaxValue));
291  mChanged = NONE;
292  return;
293  }
294 
295  mOriginalValue = value;
296  mpOriginalValueEdit->setText(QString::number(mOriginalValue));
297  }
298 
299  mMaxValue = value;
300 
301  if (mMinValue > mMaxValue)
302  {
304  mpMinValueEdit->setText(QString::number(mMinValue));
305  }
306 
307  if (mMaxValue < mValue)
308  {
309  mValue = mMaxValue;
310  mpObjectValueEdit->setText(QString::number(mValue));
311  }
312 
314  mpMinorTickSizeEdit->setText(QString::number(mMinorTickSize));
315  mChanged = NONE;
316 }
static StandardButton question(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons=Ok, StandardButton defaultButton=NoButton)
void SliderSettingsDialog::maxValueTextChanged ( )
protectedvirtualslot

Definition at line 592 of file SliderSettingsDialog.cpp.

References MAX, and mChanged.

void SliderSettingsDialog::minorMajorFactorChanged ( )
protectedvirtualslot

Definition at line 339 of file SliderSettingsDialog.cpp.

References mChanged, mMinorMajorFactor, and NONE.

Referenced by updateInternalValues().

340 {
341  // get the value and set it in the current slider
342  mMinorMajorFactor = mpMinorMajorFactorEdit->text().toUInt();
343  mChanged = NONE;
344 }
void SliderSettingsDialog::minorTickSizeChanged ( )
protectedvirtualslot

Definition at line 189 of file SliderSettingsDialog.cpp.

References mChanged, mMaxValue, mMinorTickSize, mMinValue, mNumMinorTicks, and NONE.

Referenced by updateInternalValues().

190 {
191  // adjust numMinorTicks
192  mMinorTickSize = mpMinorTickSizeEdit->text().toDouble();
193 
194  if (mMinorTickSize == 0.0)
195  {
196  mNumMinorTicks = 1;
197  }
198  else
199  {
200  mNumMinorTicks = (unsigned int)floor(((mMaxValue - mMinValue) / mMinorTickSize) + 0.5);
201  }
202 
203  if (mNumMinorTicks == 0)
204  {
205  mNumMinorTicks = 1;
207  mpMinorTickSizeEdit->setText(QString::number(mMinorTickSize));
208  }
209 
210  mpNumMinorTicksEdit->setText(QString::number(mNumMinorTicks));
211  mChanged = NONE;
212 }
void SliderSettingsDialog::minValueChanged ( )
protectedvirtualslot

Definition at line 230 of file SliderSettingsDialog.cpp.

References CQMessageBox::information(), CSlider::linear, mChanged, mMaxValue, mMinorTickSize, mMinValue, mNumMinorTicks, mOriginalValue, mScaling, mValue, NONE, and CQMessageBox::question().

Referenced by updateInternalValues().

231 {
232  // check if it is smaller than the current value
233  // if not, set it to the current value
234  double value = mpMinValueEdit->text().toDouble();
235 
236  if ((value > mOriginalValue) &&
237  (CQMessageBox::question(this, "Default value out of range.",
238  "The minimum value you set is larger than the default value of the slider. The new default will be set to the minimum. Do you want to procceed?",
239  QMessageBox::Ok | QMessageBox::Cancel, QMessageBox::Cancel) != QMessageBox::Ok)
240  )
241  {
242  mpMinValueEdit->setText(QString::number(mMinValue));
243  }
244  else
245  {
246  mOriginalValue = value;
247  mpOriginalValueEdit->setText(QString::number(mOriginalValue));
248  mMinValue = value;
249 
250  if (mMinValue > mMaxValue)
251  {
253  mpMaxValueEdit->setText(QString::number(mMaxValue));
254  }
255 
256  if (mMinValue > mValue)
257  {
258  mValue = mMinValue;
259  mpObjectValueEdit->setText(QString::number(mValue));
260  }
261 
263  mpMinorTickSizeEdit->setText(QString::number(mMinorTickSize));
264 
265  if (mMinValue <= 0.0 && mpLogCheckBox->isChecked())
266  {
267  CQMessageBox::information(this, "Incorrect min value",
268  "For logarithmic sliders, the minimum value may not be 0.0 or negative. Please set the minimum value to some (possibly very small) positive number first.",
269  QMessageBox::Ok, QMessageBox::Ok);
270  mpLogCheckBox->setChecked(false);
272  }
273  }
274 
275  mChanged = NONE;
276 }
static StandardButton information(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons=Ok, StandardButton defaultButton=NoButton)
static StandardButton question(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons=Ok, StandardButton defaultButton=NoButton)
void SliderSettingsDialog::minValueTextChanged ( )
protectedvirtualslot

Definition at line 587 of file SliderSettingsDialog.cpp.

References mChanged, and MIN.

void SliderSettingsDialog::numMinorTicksChanged ( )
protectedvirtualslot

Definition at line 214 of file SliderSettingsDialog.cpp.

References mChanged, mMaxValue, mMinorTickSize, mMinValue, mNumMinorTicks, and NONE.

Referenced by updateInputFieldsValues(), and updateInternalValues().

215 {
216  // adjust minorTickSize
217  mNumMinorTicks = mpNumMinorTicksEdit->text().toUInt();
218 
219  if (mNumMinorTicks == 1)
220  {
221  mNumMinorTicks = 1;
222  mpNumMinorTicksEdit->setText(QString::number(mNumMinorTicks));
223  }
224 
226  mpMinorTickSizeEdit->setText(QString::number(mMinorTickSize));
227  mChanged = NONE;
228 }
void SliderSettingsDialog::numTicksTextChanged ( )
protectedvirtualslot

Definition at line 597 of file SliderSettingsDialog.cpp.

References mChanged, and NUMTICKS.

void SliderSettingsDialog::objectValueChanged ( )
protectedvirtualslot

Definition at line 318 of file SliderSettingsDialog.cpp.

References mChanged, mMaxValue, mMinValue, mValue, and NONE.

Referenced by updateInternalValues().

319 {
320  // check if the value is within range, else set a new range
321  // get the value and set it in the current slider
322  mValue = mpObjectValueEdit->text().toDouble();
323 
324  if (mValue > mMaxValue)
325  {
326  mMaxValue = mValue;
327  mpMaxValueEdit->setText(QString::number(mMaxValue));
328  }
329 
330  if (mValue < mMinValue)
331  {
332  mMinValue = mValue;
333  mpMinValueEdit->setText(QString::number(mMinValue));
334  }
335 
336  mChanged = NONE;
337 }
void SliderSettingsDialog::okButtonPressed ( )
protectedvirtualslot

Definition at line 169 of file SliderSettingsDialog.cpp.

References updateSlider().

170 {
171  // disconnect all signal receivers from
172  // the min and max value edit fields
173  // otherwise, they would generate an
174  // uneccesary focusLost signal
175  disconnect(mpMinValueEdit, 0, 0, 0);
176  disconnect(mpMaxValueEdit, 0, 0, 0);
177  // only now change underlying slider
178  updateSlider();
179  // close dialog with positive feedback
180  done(QDialog::Accepted);
181 }
void SliderSettingsDialog::originalValueChanged ( )
protectedvirtualslot

Definition at line 566 of file SliderSettingsDialog.cpp.

References mChanged, mMaxValue, mMinValue, mOriginalValue, and NONE.

Referenced by updateInternalValues().

567 {
568  // check if the value is within range, else set it to
569  // set new values for the range
570  mOriginalValue = mpOriginalValueEdit->text().toDouble();
571 
573  {
575  mpMaxValueEdit->setText(QString::number(mMaxValue));
576  }
577 
579  {
581  mpMinValueEdit->setText(QString::number(mMinValue));
582  }
583 
584  mChanged = NONE;
585 }
void SliderSettingsDialog::origValueTextChanged ( )
protectedvirtualslot

Definition at line 612 of file SliderSettingsDialog.cpp.

References mChanged, and ORIGVAL.

void SliderSettingsDialog::setDefinedSliders ( std::vector< CSlider * >  sliderVect)
virtual

Definition at line 100 of file SliderSettingsDialog.cpp.

References mDefinedSliders.

Referenced by SliderDialog::editSlider().

101 {
102  mDefinedSliders = sliderVect;
103 }
std::vector< CSlider * > mDefinedSliders
void SliderSettingsDialog::setModel ( CModel model)
virtual

Definition at line 451 of file SliderSettingsDialog.cpp.

References mpModel.

Referenced by SliderDialog::editSlider().

452 {
453  mpModel = model;
454 }
void SliderSettingsDialog::setSlider ( CSlider slider)
virtual

Definition at line 60 of file SliderSettingsDialog.cpp.

References FROM_UTF8, CCopasiObject::getObjectDisplayName(), CSlider::getSliderObject(), mDefinedSliders, mpSlider, updateInputFields(), and updateInputFieldsValues().

Referenced by browseButtonPressed(), and SliderDialog::editSlider().

61 {
62  size_t i;
63  size_t iMax = mDefinedSliders.size();
64  bool found = false;
65 
66  for (i = 0; i < iMax; ++i)
67  {
68  if (mDefinedSliders[i] == slider)
69  {
70  found = true;
71  break;
72  }
73  }
74 
75  if (found)
76  {
77  mpSlider = slider;
78 
79  if (slider->getSliderObject())
80  {
81  mpObjectNameLineEdit->setText(FROM_UTF8(slider->getSliderObject()->getObjectDisplayName()));
82  }
83  else
84  {
85  mpObjectNameLineEdit->setText("Object not avalable!");
86  }
87 
90  }
91  else
92  {
93  mpSlider = NULL;
94  mpObjectNameLineEdit->setText("NULL");
95  mpObjectBrowseButton->show();
97  }
98 }
virtual std::string getObjectDisplayName(bool regular=true, bool richtext=false) const
#define FROM_UTF8(__x)
Definition: qtUtilities.h:73
std::vector< CSlider * > mDefinedSliders
CCopasiObject * getSliderObject()
Definition: CSlider.cpp:176
void SliderSettingsDialog::showOptionsControls ( )
protected

Definition at line 622 of file SliderSettingsDialog.cpp.

Referenced by extendedOptionsClicked().

623 {
624  mpNumMinorTicksLabel->show();
625  mpNumMinorTicksEdit->show();
626  mpMinorTickSizeLabel->show();
627  mpMinorTickSizeEdit->show();
628 
629  mpMinorMajorFactorLabel->show();
630  mpMinorMajorFactorEdit->show();
631  mpOriginalValueLabel->show();
632  mpOriginalValueEdit->show();
633 
634  mpObjectValueLabel->show();
635  mpObjectValueEdit->show();
636 }
void SliderSettingsDialog::sliderChanged ( CSlider slider)
signal
void SliderSettingsDialog::tickFactorTextChanged ( )
protectedvirtualslot

Definition at line 607 of file SliderSettingsDialog.cpp.

References mChanged, and TICKFACTOR.

void SliderSettingsDialog::tickSizeTextChanged ( )
protectedvirtualslot

Definition at line 602 of file SliderSettingsDialog.cpp.

References mChanged, and TICKSIZE.

void SliderSettingsDialog::updateInputFields ( )
protected

Definition at line 140 of file SliderSettingsDialog.cpp.

References mpSlider.

Referenced by browseButtonPressed(), init(), and setSlider().

141 {
142  // if the current slider is NULL, disable all input fields
143  if (mpSlider)
144  {
145  mpObjectNameLineEdit->setEnabled(false);
146  mpMaxValueEdit->setEnabled(true);
147  mpMinValueEdit->setEnabled(true);
148  mpMinorMajorFactorEdit->setEnabled(true);
149  mpMinorTickSizeEdit->setEnabled(true);
150  mpNumMinorTicksEdit->setEnabled(true);
151  mpObjectValueEdit->setEnabled(true);
152  mpLogCheckBox->setEnabled(true);
153  mpOriginalValueEdit->setEnabled(true);
154  }
155  else
156  {
157  mpObjectNameLineEdit->setEnabled(true);
158  mpMaxValueEdit->setEnabled(false);
159  mpMinValueEdit->setEnabled(false);
160  mpMinorMajorFactorEdit->setEnabled(false);
161  mpMinorTickSizeEdit->setEnabled(false);
162  mpNumMinorTicksEdit->setEnabled(false);
163  mpObjectValueEdit->setEnabled(false);
164  mpOriginalValueEdit->setEnabled(false);
165  mpLogCheckBox->setEnabled(false);
166  }
167 }
void SliderSettingsDialog::updateInputFieldsValues ( )
protected

Definition at line 105 of file SliderSettingsDialog.cpp.

References CSlider::getMaxValue(), CSlider::getMinValue(), CSlider::getOriginalValue(), CSlider::getScaling(), CSlider::getSliderValue(), CSlider::getTickFactor(), CSlider::getTickNumber(), CSlider::logarithmic, mMaxValue, mMinorMajorFactor, mMinValue, mNumMinorTicks, mOriginalValue, mpSlider, mValue, and numMinorTicksChanged().

Referenced by browseButtonPressed(), and setSlider().

106 {
107  if (mpSlider)
108  {
110  mpObjectValueEdit->setText(QString::number(mValue));
111 
113  mpOriginalValueEdit->setText(QString::number(mOriginalValue));
114 
116  mpMinValueEdit->setText(QString::number(mMinValue));
117 
119  mpMaxValueEdit->setText(QString::number(mMaxValue));
120 
122  mpNumMinorTicksEdit->setText(QString::number(mNumMinorTicks));
123 
125  mpMinorMajorFactorEdit->setText(QString::number(mMinorMajorFactor));
126 
128 
130  {
131  mpLogCheckBox->setChecked(true);
132  }
133  else
134  {
135  mpLogCheckBox->setChecked(false);
136  }
137  }
138 }
virtual void numMinorTicksChanged()
const C_FLOAT64 & getSliderValue() const
Definition: CSlider.cpp:290
const C_FLOAT64 & getOriginalValue() const
Definition: CSlider.cpp:285
const C_FLOAT64 & getMaxValue() const
Definition: CSlider.cpp:348
unsigned C_INT32 getTickNumber() const
Definition: CSlider.cpp:357
const C_FLOAT64 & getMinValue() const
Definition: CSlider.cpp:320
unsigned C_INT32 getTickFactor() const
Definition: CSlider.cpp:366
Scale getScaling() const
Definition: CSlider.cpp:369
void SliderSettingsDialog::updateInternalValues ( )
protected

Definition at line 536 of file SliderSettingsDialog.cpp.

References MAX, maxValueChanged(), mChanged, MIN, minorMajorFactorChanged(), minorTickSizeChanged(), minValueChanged(), numMinorTicksChanged(), NUMTICKS, objectValueChanged(), originalValueChanged(), ORIGVAL, TICKFACTOR, TICKSIZE, and VALUE.

Referenced by globalCheckBoxToggled(), logCheckBoxToggled(), and updateSlider().

537 {
538  switch (mChanged)
539  {
540  case VALUE:
542  break;
543  case ORIGVAL:
545  break;
546  case MIN:
547  minValueChanged();
548  break;
549  case MAX:
550  maxValueChanged();
551  break;
552  case TICKFACTOR:
554  break;
555  case TICKSIZE:
557  break;
558  case NUMTICKS:
560  break;
561  default:
562  break;
563  }
564 }
virtual void numMinorTicksChanged()
virtual void minorTickSizeChanged()
virtual void originalValueChanged()
virtual void minorMajorFactorChanged()
void SliderSettingsDialog::updateSlider ( )
virtual

Definition at line 461 of file SliderSettingsDialog.cpp.

References mMaxValue, mMinorMajorFactor, mMinValue, mNumMinorTicks, mOriginalValue, mpSlider, mScaling, mValue, CSlider::setMaxValue(), CSlider::setMinValue(), CSlider::setOriginalValue(), CSlider::setScaling(), CSlider::setSliderValue(), CSlider::setTickFactor(), CSlider::setTickNumber(), and updateInternalValues().

Referenced by okButtonPressed().

462 {
464 
465  if (mpSlider)
466  {
467  if (mMinValue < mpSlider->getMaxValue())
468  {
471  }
472  else
473  {
476  }
477 
483  }
484 }
bool setScaling(Scale scaling)
Definition: CSlider.cpp:374
bool setOriginalValue(const C_FLOAT64 value)
Definition: CSlider.cpp:191
bool setMaxValue(const C_FLOAT64 maxValue)
Definition: CSlider.cpp:323
bool setTickFactor(const unsigned C_INT32 tickFactor)
Definition: CSlider.cpp:360
bool setTickNumber(const unsigned C_INT32 tickNumber)
Definition: CSlider.cpp:351
bool setMinValue(const C_FLOAT64 minValue)
Definition: CSlider.cpp:295
bool setSliderValue(const C_FLOAT64 value, const bool &writeToObject=true)
Definition: CSlider.cpp:215
void SliderSettingsDialog::valueTextChanged ( )
protectedvirtualslot

Definition at line 617 of file SliderSettingsDialog.cpp.

References mChanged, and VALUE.

Member Data Documentation

CHANGETYPE SliderSettingsDialog::mChanged
protected
int SliderSettingsDialog::mCurrentTaskId
protected

Definition at line 61 of file SliderSettingsDialog.h.

std::vector< CSlider* > SliderSettingsDialog::mDefinedSliders
protected

Definition at line 59 of file SliderSettingsDialog.h.

Referenced by browseButtonPressed(), setDefinedSliders(), and setSlider().

double SliderSettingsDialog::mMaxValue
protected
unsigned int SliderSettingsDialog::mMinorMajorFactor
protected
double SliderSettingsDialog::mMinorTickSize
protected
double SliderSettingsDialog::mMinValue
protected
unsigned int SliderSettingsDialog::mNumMinorTicks
protected
double SliderSettingsDialog::mOriginalValue
protected
CModel* SliderSettingsDialog::mpModel
protected

Definition at line 62 of file SliderSettingsDialog.h.

Referenced by setModel().

CSlider* SliderSettingsDialog::mpSlider
protected
int SliderSettingsDialog::mScaling
protected

Definition at line 63 of file SliderSettingsDialog.h.

Referenced by init(), logCheckBoxToggled(), minValueChanged(), and updateSlider().

double SliderSettingsDialog::mValue
protected

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