Skip to content

Commit

Permalink
- adjust event creation to deal with missing data
Browse files Browse the repository at this point in the history
  • Loading branch information
fbergmann authored and Stefan Hoops committed Mar 3, 2015
1 parent 13fe719 commit 7630d60
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
15 changes: 13 additions & 2 deletions copasi/UI/copasiui3window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1666,8 +1666,19 @@ void CopasiUI3Window::slotCreateEventsForTimeseries()
// Display error messages.
CQMessageBox::information(this, "Event Creation Failed",
CCopasiMessage::getAllMessageText().c_str(),
QMessageBox::Ok | QMessageBox::Default,
QMessageBox::NoButton);
QMessageBox::Ok,
QMessageBox::Ok);
CCopasiMessage::clearDeque();
}

// show any warning messages that occured
if (CCopasiMessage::size() != 0)
{
// Display warnings messages.
CQMessageBox::information(this, "Event Creation succeded with warnings",
CCopasiMessage::getAllMessageText().c_str(),
QMessageBox::Ok,
QMessageBox::Ok);
CCopasiMessage::clearDeque();
}

Expand Down
10 changes: 10 additions & 0 deletions copasi/model/CModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3132,6 +3132,16 @@ CModel::createEventsForTimeseries(CExperiment* experiment/* = NULL*/)

double value = data(i, j);

// don't include missing data points
if (value != value)
{
std::string displayName = currentObject->getObjectParent()->getObjectDisplayName();
CCopasiMessage(CCopasiMessage::WARNING,
"At time %.2f: a missing data point was encountered for '%s', the value has been ignored."
, current, displayName.c_str());
continue;
}

CEventAssignment * pNewAssignment =
new CEventAssignment(currentObject->getObjectParent()->getKey());
std::stringstream assignmentStr; assignmentStr << value;
Expand Down

0 comments on commit 7630d60

Please sign in to comment.