mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/shared][apps/graph][apps/sequence] Clean ValuesController
This commit is contained in:
committed by
LeaNumworks
parent
164572ca1e
commit
dc3c67a2d2
@@ -34,6 +34,8 @@ ValuesController::ValuesController(Responder * parentResponder, InputEventHandle
|
||||
setupSelectableTableViewAndCells(inputEventHandlerDelegate);
|
||||
}
|
||||
|
||||
// TableViewDataSource
|
||||
|
||||
KDCoordinate ValuesController::columnWidth(int i) {
|
||||
return k_cellWidth;
|
||||
}
|
||||
@@ -53,6 +55,7 @@ void ValuesController::willDisplayCellAtLocation(HighlightCell * cell, int i, in
|
||||
}
|
||||
}
|
||||
|
||||
// AlternateEmptyViewDelegate
|
||||
I18n::Message ValuesController::emptyMessage() {
|
||||
if (functionStore()->numberOfDefinedModels() == 0) {
|
||||
return I18n::Message::NoSequence;
|
||||
@@ -60,10 +63,17 @@ I18n::Message ValuesController::emptyMessage() {
|
||||
return I18n::Message::NoActivatedSequence;
|
||||
}
|
||||
|
||||
// ValuesController
|
||||
void ValuesController::setStartEndMessages(Shared::IntervalParameterController * controller, int column) {
|
||||
m_intervalParameterController.setStartEndMessages(I18n::Message::NStart, I18n::Message::NEnd);
|
||||
}
|
||||
|
||||
I18n::Message ValuesController::valuesParameterMessageAtColumn(int columnIndex) const {
|
||||
return I18n::Message::NColumn;
|
||||
}
|
||||
|
||||
// EditableCellViewController
|
||||
|
||||
bool ValuesController::setDataAtLocation(double floatBody, int columnIndex, int rowIndex) {
|
||||
if (floatBody < 0) {
|
||||
return false;
|
||||
@@ -71,6 +81,14 @@ bool ValuesController::setDataAtLocation(double floatBody, int columnIndex, int
|
||||
return Shared::ValuesController::setDataAtLocation(std::round(floatBody), columnIndex, rowIndex);
|
||||
}
|
||||
|
||||
// Model getters
|
||||
|
||||
Shared::Interval * ValuesController::intervalAtColumn(int columnIndex) {
|
||||
return App::app()->interval();
|
||||
}
|
||||
|
||||
// Function evaluation memoization
|
||||
|
||||
void ValuesController::fillMemoizedBuffer(int column, int row, int index) {
|
||||
char * buffer = memoizedBufferAtIndex(index);
|
||||
double abscissa = intervalAtColumn(column)->element(row-1);
|
||||
@@ -79,13 +97,7 @@ void ValuesController::fillMemoizedBuffer(int column, int row, int index) {
|
||||
Shared::PoincareHelpers::ConvertFloatToText<double>(xy.x2(), buffer, k_valuesCellBufferSize, Preferences::LargeNumberOfSignificantDigits);
|
||||
}
|
||||
|
||||
Shared::Interval * ValuesController::intervalAtColumn(int columnIndex) {
|
||||
return App::app()->interval();
|
||||
}
|
||||
|
||||
I18n::Message ValuesController::valuesParameterMessageAtColumn(int columnIndex) const {
|
||||
return I18n::Message::NColumn;
|
||||
}
|
||||
// Parameters controllers getter
|
||||
|
||||
ViewController * ValuesController::functionParameterController() {
|
||||
#if COPY_COLUMN
|
||||
|
||||
Reference in New Issue
Block a user