[apps/regression] Avoid displaying the regression graph in there is not

enough data for a regression

Change-Id: If0f65e2a377fb3f91d008d21812e318e92583548
This commit is contained in:
Émilie Feral
2017-01-03 15:12:58 +01:00
parent 12fbbb3dca
commit 176cd6d539

View File

@@ -16,14 +16,17 @@ ViewController * GraphController::initialisationParameterController() {
}
bool GraphController::isEmpty() {
if (m_data->numberOfPairs() == 0) {
if (m_data->numberOfPairs() < 2 || isinf(m_data->slope()) || isnan(m_data->slope())) {
return true;
}
return false;
}
const char * GraphController::emptyMessage() {
return "Aucune donnee a tracer";
if (m_data->numberOfPairs() == 0) {
return "Aucune donnee a tracer";
}
return "Pas assez de donnees pour un regression";
}
bool GraphController::handleEnter() {