void CQTrajectoryWidget::slotIntervalSize()
{
    if (!mpEditIntervalSize->hasAcceptableInput())
        return;

    try
    {
        mpTrajectoryProblem->setStepSize(mpEditIntervalSize->text().toDouble());
    }

    catch (...)
    {
        CQMessageBox::information(this, QString("Information"),
                                  FROM_UTF8(CCopasiMessage::getAllMessageText()),
                                  QMessageBox::Ok, QMessageBox::Ok);
    }

    mpEditIntervalSize->setText(QString::number(mpTrajectoryProblem->getStepSize()));
    mpValidatorIntervalSize->revalidate();
    mpEditIntervals->setText(QString::number(mpTrajectoryProblem->getStepNumber()));
    mpValidatorIntervals->revalidate();

    checkTimeSeries();
    updateIntervals();
}
Beispiel #2
0
bool CQTSSAWidget::loadTask()
{
  CTSSATask * pTask =
    dynamic_cast< CTSSATask * >(mpTask);

  if (!pTask) return false;

  loadCommon();
  loadMethod();

  CTSSAProblem* tssaproblem =
    dynamic_cast<CTSSAProblem *>(pTask->getProblem());
  assert(tssaproblem);

  pdelete(mpTSSAProblem);
  mpTSSAProblem = new CTSSAProblem(*tssaproblem);

  //numbers
  mpEditIntervalSize->setText(QString::number(tssaproblem->getStepSize()));
  mpEditIntervals->setText(QString::number(tssaproblem->getStepNumber()));
  mpEditDuration->setText(QString::number(tssaproblem->getDuration()));

  //store time series checkbox
  mpCheckSave->setChecked(tssaproblem->timeSeriesRequested());
  checkTimeSeries();

  mpValidatorDuration->saved();
  mpValidatorIntervalSize->saved();

  return true;
}
Beispiel #3
0
bool CQTrajectoryWidget::loadTask()
{
  CTrajectoryTask * pTask =
    dynamic_cast< CTrajectoryTask * >(mpTask);

  if (!pTask) return false;

  loadCommon();
  loadMethod();

  showUnits();

  CTrajectoryProblem* TrajectoryProblem =
    dynamic_cast<CTrajectoryProblem *>(pTask->getProblem());
  assert(TrajectoryProblem);

  pdelete(mpTrajectoryProblem);

  mpTrajectoryProblem = new CTrajectoryProblem(*TrajectoryProblem, NO_PARENT);

  //numbers
  mpEditIntervalSize->setText(QString::number(TrajectoryProblem->getStepSize()));
  mpEditIntervals->setText(QString::number(TrajectoryProblem->getStepNumber()));
  mpEditDuration->setText(QString::number(TrajectoryProblem->getDuration()));
  mpCheckAutomaticInterval->setChecked(TrajectoryProblem->getAutomaticStepSize());

  assert(CCopasiRootContainer::getDatamodelList()->size() > 0);
  C_FLOAT64 InitialTime = CCopasiRootContainer::getDatamodelList()->operator[](0).getModel()->getInitialTime();

  bool Delayed;

  if (TrajectoryProblem->getStepSize() > 0.0)
    Delayed = (TrajectoryProblem->getOutputStartTime() - InitialTime) > std::numeric_limits< C_FLOAT64 >::min();
  else
    Delayed = (InitialTime - TrajectoryProblem->getOutputStartTime()) > std::numeric_limits< C_FLOAT64 >::min();

  mpCheckDelay->setChecked(Delayed);
  mpEditDelay->setEnabled(Delayed);

  mpEditDelay->setText(QString::number(TrajectoryProblem->getOutputStartTime()));

  mpCheckOutputEvent->setChecked(TrajectoryProblem->getOutputEvent());
  mpCheckContinueEvents->setChecked(TrajectoryProblem->getContinueSimultaneousEvents());
  mpCheckStartInSteadyState->setChecked(TrajectoryProblem->getStartInSteadyState());

  //store time series checkbox
  mpCheckSave->setChecked(TrajectoryProblem->timeSeriesRequested());

  checkTimeSeries();

  updateIntervals();

  mpValidatorDuration->saved();
  mpValidatorIntervalSize->saved();
  mpValidatorIntervals->saved();
  mpValidatorDelay->saved();
  return true;
}
bool CQTrajectoryWidget::runTask()
{
    checkTimeSeries();

    if (!commonBeforeRunTask()) return false;

    bool success = true;

    if (!commonRunTask()) success = false;

    return success;
}
bool CQTrajectoryWidget::loadTask()
{
    CTrajectoryTask * pTask =
        dynamic_cast< CTrajectoryTask * >(mpTask);

    if (!pTask) return false;

    loadCommon();
    loadMethod();

    showUnits();

    CTrajectoryProblem* trajectoryproblem =
        dynamic_cast<CTrajectoryProblem *>(pTask->getProblem());
    assert(trajectoryproblem);

    pdelete(mpTrajectoryProblem);
    mpTrajectoryProblem = new CTrajectoryProblem(*trajectoryproblem);

    //numbers
    mpEditIntervalSize->setText(QString::number(trajectoryproblem->getStepSize()));
    mpEditIntervals->setText(QString::number(trajectoryproblem->getStepNumber()));
    mpEditDuration->setText(QString::number(trajectoryproblem->getDuration()));

    assert(CCopasiRootContainer::getDatamodelList()->size() > 0);
    C_FLOAT64 InitialTime = (*CCopasiRootContainer::getDatamodelList())[0]->getModel()->getInitialTime();

    bool Delayed;

    if (trajectoryproblem->getStepSize() > 0.0)
        Delayed = (trajectoryproblem->getOutputStartTime() - InitialTime) > DBL_MIN;
    else
        Delayed = (InitialTime - trajectoryproblem->getOutputStartTime()) > DBL_MIN;

    mpCheckDelay->setChecked(Delayed);
    mpEditDelay->setEnabled(Delayed);

    mpEditDelay->setText(QString::number(trajectoryproblem->getOutputStartTime()));

    //store time series checkbox
    mpCheckSave->setChecked(trajectoryproblem->timeSeriesRequested());

    checkTimeSeries();

    updateIntervals();

    mpValidatorDuration->saved();
    mpValidatorIntervalSize->saved();
    mpValidatorIntervals->saved();
    mpValidatorDelay->saved();
    return true;
}
Beispiel #6
0
void CQTSSAWidget::slotIntervals()
{
  try
    {
      mpTSSAProblem->setStepNumber(mpEditIntervals->text().toULong());
    }
  catch (...)
    {
      CQMessageBox::information(this, QString("Information"),
                                FROM_UTF8(CCopasiMessage::getAllMessageText()),
                                QMessageBox::Ok, QMessageBox::Ok);
    }

  mpEditIntervalSize->setText(QString::number(mpTSSAProblem->getStepSize()));
  mpValidatorIntervalSize->revalidate();

  checkTimeSeries();
}
Beispiel #7
0
bool CQTSSAWidget::runTask()
{
  assert(CCopasiRootContainer::getDatamodelList()->size() > 0);
  pCTSSATask =
    dynamic_cast<CTSSATask *>((*(*CCopasiRootContainer::getDatamodelList())[0]->getTaskList())["Time Scale Separation Analysis"]);

  if (!pCTSSATask) return false;

  pTSSMethod = dynamic_cast<CTSSAMethod*>(pCTSSATask->getMethod());

  if (!pTSSMethod)
    pTSSMethod->emptyVectors();

  checkTimeSeries();

  if (!commonBeforeRunTask()) return false;

  bool success = true;

  if (!commonRunTask()) success = false;

  return success;
}