mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-24 00:00:44 +01:00
[apps/graph] Fix bug in values controller in willDisplayCellAtLocation
Change-Id: Ic3f166caac9d58205a9b896de2a288afe13c66d4
This commit is contained in:
@@ -37,6 +37,7 @@ int ValuesController::numberOfColumns() {
|
||||
}
|
||||
|
||||
void ValuesController::willDisplayCellAtLocation(HighlightCell * cell, int i, int j) {
|
||||
Shared::ValuesController::willDisplayCellAtLocation(cell, i, j);
|
||||
// The cell is the abscissa title cell:
|
||||
if (j == 0 && i == 0) {
|
||||
EvenOddMessageTextCell * mytitleCell = (EvenOddMessageTextCell *)cell;
|
||||
@@ -59,20 +60,7 @@ void ValuesController::willDisplayCellAtLocation(HighlightCell * cell, int i, in
|
||||
}
|
||||
myFunctionCell->setText(name);
|
||||
myFunctionCell->setColor(function->color());
|
||||
return;
|
||||
}
|
||||
// The cell is a derivative value cell
|
||||
if (j > 0 && i > 0 && isDerivativeColumn(i)) {
|
||||
TextFieldDelegateApp * myApp = (TextFieldDelegateApp *)app();
|
||||
char buffer[Complex::bufferSizeForFloatsWithPrecision(Constant::LargeNumberOfSignificantDigits)];
|
||||
EvenOddBufferTextCell * myValueCell = (EvenOddBufferTextCell *)cell;
|
||||
CartesianFunction * function = functionAtColumn(i);
|
||||
float x = m_interval.element(j-1);
|
||||
Complex::convertFloatToText(function->approximateDerivative(x, myApp->localContext()), buffer, Complex::bufferSizeForFloatsWithPrecision(Constant::LargeNumberOfSignificantDigits), Constant::LargeNumberOfSignificantDigits);
|
||||
myValueCell->setText(buffer);
|
||||
return;
|
||||
}
|
||||
Shared::ValuesController::willDisplayCellAtLocation(cell, i, j);
|
||||
}
|
||||
|
||||
I18n::Message ValuesController::emptyMessage() {
|
||||
@@ -169,5 +157,14 @@ FunctionParameterController * ValuesController::functionParameterController() {
|
||||
return &m_functionParameterController;
|
||||
}
|
||||
|
||||
float ValuesController::evaluationOfAbscissaAtColumn(float abscissa, int columnIndex) {
|
||||
CartesianFunction * function = functionAtColumn(columnIndex);
|
||||
TextFieldDelegateApp * myApp = (TextFieldDelegateApp *)app();
|
||||
if (isDerivativeColumn(columnIndex)) {
|
||||
return function->approximateDerivative(abscissa, myApp->localContext());
|
||||
}
|
||||
return function->evaluateAtAbscissa(abscissa, myApp->localContext());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user