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; }
bool CQTSSAWidget::saveTask() { CTSSATask * pTask = dynamic_cast< CTSSATask * >(mpTask); if (!pTask) return false; saveCommon(); saveMethod(); CTSSAProblem* tssaproblem = dynamic_cast<CTSSAProblem *>(pTask->getProblem()); assert(tssaproblem); //numbers if (tssaproblem->getStepSize() != mpEditIntervalSize->text().toDouble()) { tssaproblem->setStepSize(mpEditIntervalSize->text().toDouble()); mChanged = true; } else if (tssaproblem->getStepNumber() != mpEditIntervals->text().toULong()) { tssaproblem->setStepNumber(mpEditIntervals->text().toLong()); mChanged = true; } if (tssaproblem->getDuration() != mpEditDuration->text().toDouble()) { tssaproblem->setDuration(mpEditDuration->text().toDouble()); mChanged = true; } if (tssaproblem->timeSeriesRequested() != mpCheckSave->isChecked()) { tssaproblem->setTimeSeriesRequested(mpCheckSave->isChecked()); mChanged = true; } mpValidatorDuration->saved(); mpValidatorIntervalSize->saved(); return true; }