<commit_before>// Begin CVS Header
//   $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/layoutUI/Attic/ParaPanel.ui.h,v $
//   $Revision: 1.7 $
//   $Name:  $
//   $Author: urost $
//   $Date: 2007/08/31 10:58:05 $
// End CVS Header

// Copyright (C) 2007 by <NAME>, Virginia Tech Intellectual
// Properties, Inc. and EML Research, gGmbH.
// All rights reserved.

/****************************************************************************
 ** ui.h extension file, included from the uic-generated form implementation.
 **
 ** If you want to add, delete, or rename functions or slots, use
 ** Qt Designer to update this file, preserving your code.
 **
 ** You should not define a constructor or destructor in this file.
 ** Instead, write your code in functions called init() and destroy().
 ** These will automatically be called by the form's constructor and
 ** destructor.
 *****************************************************************************/
#include "copasi.h"
#include "copasi/layoutUI/CVisParameters.h"
#include "copasi/layoutUI/CQLayoutMainWindow.h"

#include <qstring.h>
#include <qvalidator.h>

void ParaPanel::enableParameterChoice()
{
  spinBox1->setEnabled(true);
  scalingButtonGroup->setEnabled(true);
}

void ParaPanel::disableParameterChoice()
{
  spinBox1->setEnabled(false);
  scalingButtonGroup->setEnabled(false);
}

void ParaPanel::enableStepNumberChoice()
{
  stepEdit->setEnabled(true);
}

void ParaPanel::disableStepNumberChoice()
{
  stepEdit->setEnabled(false);
}

void ParaPanel::changeFrameRate()
{
  //CVisParameters::stepsPerSecond = spinBox1->value();
  CQLayoutMainWindow * tmp = dynamic_cast<CQLayoutMainWindow *>(parentWidget()->parentWidget()->parentWidget());
  assert(tmp);
  if (tmp) tmp -> setStepsPerSecond(spinBox1->value());
}

void ParaPanel::setGlobalScaling()
{
  CQLayoutMainWindow * tmp = dynamic_cast<CQLayoutMainWindow *>(parentWidget()->parentWidget()->parentWidget());
  assert(tmp);
  if (tmp) tmp -> setGlobalScaling();
  //((CQLayoutMainWindow *)(this->parentWidget()))->setGlobalScaling();
}

void ParaPanel::setIndividualScaling()
{
  CQLayoutMainWindow * tmp = dynamic_cast<CQLayoutMainWindow *>(parentWidget()->parentWidget()->parentWidget());
  assert(tmp);
  if (tmp) tmp -> setIndividualScaling();

  //((CQLayoutMainWindow *)(this->parentWidget()))->setIndividualScaling();
}

void ParaPanel::setStepNumber(int i)
{
  QString s = QString::number(i, 10);
  stepEdit->setText(s);
}

void ParaPanel::stepEdit_returnPressed()
{
  QValidator* validator = new QIntValidator(0, INT_MAX, this);
  stepEdit->setValidator(validator);

  //if (validator->validate(stepEdit->text()) == QValidator::Acceptable) {
  QString line = stepEdit->text();
  bool ok;
  int val = line.toInt(&ok, 10);
  if (ok)
    {
      CQLayoutMainWindow * tmp = dynamic_cast<CQLayoutMainWindow *>(parentWidget()->parentWidget()->parentWidget());
      assert(tmp);
      if (tmp) tmp -> setValueOnSlider(val);
    }
  //}
}

void ParaPanel::setSizeMode()
{
  CQLayoutMainWindow * tmp = dynamic_cast<CQLayoutMainWindow *>(parentWidget()->parentWidget()->parentWidget());
  assert(tmp);
  if (tmp) tmp -> setSizeMode();
}

void ParaPanel::setColorMode()
{
  CQLayoutMainWindow * tmp = dynamic_cast<CQLayoutMainWindow *>(parentWidget()->parentWidget()->parentWidget());
  assert(tmp);
  if (tmp) tmp -> setColorMode();
}
<commit_msg>number of calls to getParent modified, as ParaPanel was located deeper in layoz of main window<commit_after>// Begin CVS Header
//   $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/layoutUI/Attic/ParaPanel.ui.h,v $
//   $Revision: 1.8 $
//   $Name:  $
//   $Author: urost $
//   $Date: 2008/09/01 09:43:57 $
// End CVS Header

// Copyright (C) 2008 by <NAME>, Virginia Tech Intellectual
// Properties, Inc., EML Research, gGmbH, University of Heidelberg,
// and The University of Manchester.
// All rights reserved.

// Copyright (C) 2001 - 2007 by <NAME>, Virginia Tech Intellectual
// Properties, Inc. and EML Research, gGmbH.
// All rights reserved.

/****************************************************************************
 ** ui.h extension file, included from the uic-generated form implementation.
 **
 ** If you want to add, delete, or rename functions or slots, use
 ** Qt Designer to update this file, preserving your code.
 **
 ** You should not define a constructor or destructor in this file.
 ** Instead, write your code in functions called init() and destroy().
 ** These will automatically be called by the form's constructor and
 ** destructor.
 *****************************************************************************/
#include "copasi.h"
#include "copasi/layoutUI/CVisParameters.h"
#include "copasi/layoutUI/CQLayoutMainWindow.h"

#include <qstring.h>
#include <qvalidator.h>

void ParaPanel::enableParameterChoice()
{
  spinBox1->setEnabled(true);
  scalingButtonGroup->setEnabled(true);
}

void ParaPanel::disableParameterChoice()
{
  spinBox1->setEnabled(false);
  scalingButtonGroup->setEnabled(false);
}

void ParaPanel::enableStepNumberChoice()
{
  stepEdit->setEnabled(true);
}

void ParaPanel::disableStepNumberChoice()
{
  stepEdit->setEnabled(false);
}

void ParaPanel::changeFrameRate()
{
  //CVisParameters::stepsPerSecond = spinBox1->value();
  CQLayoutMainWindow * tmp = dynamic_cast<CQLayoutMainWindow *>(parentWidget()->parentWidget()->parentWidget()->parentWidget());
  assert(tmp);
  if (tmp) tmp -> setStepsPerSecond(spinBox1->value());
}

void ParaPanel::setGlobalScaling()
{
  CQLayoutMainWindow * tmp = dynamic_cast<CQLayoutMainWindow *>(parentWidget()->parentWidget()->parentWidget()->parentWidget());
  assert(tmp);
  if (tmp) tmp -> setGlobalScaling();
  //((CQLayoutMainWindow *)(this->parentWidget()))->setGlobalScaling();
}

void ParaPanel::setIndividualScaling()
{
  CQLayoutMainWindow * tmp = dynamic_cast<CQLayoutMainWindow *>(parentWidget()->parentWidget()->parentWidget()->parentWidget());
  assert(tmp);
  if (tmp) tmp -> setIndividualScaling();

  //((CQLayoutMainWindow *)(this->parentWidget()))->setIndividualScaling();
}

void ParaPanel::setStepNumber(int i)
{
  QString s = QString::number(i, 10);
  stepEdit->setText(s);
}

void ParaPanel::stepEdit_returnPressed()
{
  QValidator* validator = new QIntValidator(0, INT_MAX, this);
  stepEdit->setValidator(validator);

  //if (validator->validate(stepEdit->text()) == QValidator::Acceptable) {
  QString line = stepEdit->text();
  bool ok;
  int val = line.toInt(&ok, 10);
  if (ok)
    {
      CQLayoutMainWindow * tmp = dynamic_cast<CQLayoutMainWindow *>(parentWidget()->parentWidget()->parentWidget()->parentWidget());
      assert(tmp);
      if (tmp) tmp -> setValueOnSlider(val);
    }
  //}
}

void ParaPanel::setSizeMode()
{
  CQLayoutMainWindow * tmp = dynamic_cast<CQLayoutMainWindow *>(parentWidget()->parentWidget()->parentWidget()->parentWidget());
  assert(tmp);
  if (tmp) tmp -> setSizeMode();
}

void ParaPanel::setColorMode()
{
  CQLayoutMainWindow * tmp = dynamic_cast<CQLayoutMainWindow *>(parentWidget()->parentWidget()->parentWidget()->parentWidget());
  assert(tmp);
  if (tmp) tmp -> setColorMode();
}

{'fraction_non_alphanumeric': 0.19077656293804318, 'fraction_numerical': 0.009251471825063078, 'mean_word_length': 5.353517364203028, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 98, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4601017', 'n_tokens_mistral': 2236, 'n_tokens_neox': 2155, 'n_words': 482}