コード例 #1
0
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();
}
コード例 #2
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;
}
コード例 #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);

    //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;
}
コード例 #4
0
ファイル: timescale.cpp プロジェクト: aemanov/seiscomp3
void TimeScale::setAbsoluteTimeEnabled(bool absoluteTime, bool absoluteDate) {
	absoluteDate = absoluteTime && absoluteDate;
	if ( _showAbsoluteValues == absoluteTime &&
	     _showAbsoluteDate == absoluteDate )
		return;

	_showAbsoluteValues = absoluteTime;
	_showAbsoluteDate = absoluteDate;
	_ofs = _showAbsoluteValues ? (double)_alignment : 0;
	setLineCount(_showAbsoluteDate ? 2 : 1);

	updateIntervals();
	update();
}
コード例 #5
0
void CQTrajectoryWidget::slotOutputDelay(bool checked)
{
    mpEditDelay->setEnabled(checked);
    updateIntervals();
}
コード例 #6
0
void PlotSectorHistogram::update( const SectorHistogram & histogram )
{
	updateDatas(histogram);
	updateMaximums(histogram);
	updateIntervals(histogram);
}
コード例 #7
0
void PlotNearestPointsHistogram::update( const NearestPointsHistogram & histogram )
{
	updateDatas( histogram );
	updateMaximums( histogram );
	updateIntervals( histogram );
}