[apps/regession] Return warning when the user want to go to a point no

reached by the regression curve

Change-Id: Iefaabcc470e65ee5bc2b447af9f2dacbf2902f31
This commit is contained in:
Émilie Feral
2017-02-17 11:33:17 +01:00
parent 00d4688a86
commit 4b3e5f30b6
3 changed files with 23 additions and 0 deletions

View File

@@ -39,6 +39,10 @@ bool FloatParameterController::textFieldDidFinishEditing(TextField * textField,
AppsContainer * appsContainer = ((TextFieldDelegateApp *)app())->container();
Context * globalContext = appsContainer->globalContext();
float floatBody = Expression::parse(text)->approximate(*globalContext);
if (isnan(floatBody)) {
app()->displayWarning("Valeur non defini");
return false;
}
setParameterAtIndex(m_selectableTableView.selectedRow(), floatBody);
willDisplayCellForIndex(m_selectableTableView.cellAtLocation(m_selectableTableView.selectedColumn(),
m_selectableTableView.selectedRow()), activeCell());