mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps/*/values_controller] Set correct parameter message
This commit is contained in:
@@ -74,9 +74,7 @@ void ValuesController::willDisplayCellAtLocation(HighlightCell * cell, int i, in
|
||||
Shared::ValuesController::willDisplayCellAtLocation(cell, i, j);
|
||||
if (typeAtLoc == k_abscissaTitleCellType) {
|
||||
AbscissaTitleCell * myTitleCell = (AbscissaTitleCell *)cell;
|
||||
Ion::Storage::Record record = recordAtColumn(i+1);
|
||||
Shared::ExpiringPointer<CartesianFunction> function = functionStore()->modelForRecord(record);
|
||||
myTitleCell->setMessage(function->parameterMessageName());
|
||||
myTitleCell->setMessage(valuesParameterMessageAtColumn(i));
|
||||
myTitleCell->setSeparatorLeft(i > 0);
|
||||
return;
|
||||
}
|
||||
@@ -155,6 +153,10 @@ Shared::Interval * ValuesController::intervalAtColumn(int columnIndex) {
|
||||
return App::app()->intervalForType(plotTypeAtColumn(&columnIndex));
|
||||
}
|
||||
|
||||
I18n::Message ValuesController::valuesParameterMessageAtColumn(int columnIndex) const {
|
||||
return CartesianFunction::ParameterMessageForPlotType(plotTypeAtColumn(&columnIndex));
|
||||
}
|
||||
|
||||
CartesianFunction::PlotType ValuesController::plotTypeAtColumn(int * i) const {
|
||||
int plotTypeIndex = 0;
|
||||
while (plotTypeIndex < CartesianFunction::k_numberOfPlotTypes && *i >= m_numberOfColumnsForType[plotTypeIndex]) {
|
||||
@@ -196,10 +198,6 @@ ViewController * ValuesController::functionParameterController() {
|
||||
return &m_functionParameterController;
|
||||
}
|
||||
|
||||
I18n::Message ValuesController::valuesParameterControllerPageTitle() const {
|
||||
return I18n::Message::X;
|
||||
}
|
||||
|
||||
double ValuesController::evaluationOfAbscissaAtColumn(double abscissa, int columnIndex) {
|
||||
bool isDerivative = false;
|
||||
Ion::Storage::Record record = recordAtColumn(columnIndex, &isDerivative);
|
||||
|
||||
@@ -40,6 +40,7 @@ private:
|
||||
Ion::Storage::Record recordAtColumn(int i, bool * isDerivative);
|
||||
int numberOfColumnsForRecord(Ion::Storage::Record record) const;
|
||||
Shared::Interval * intervalAtColumn(int columnIndex) override;
|
||||
I18n::Message valuesParameterMessageAtColumn(int columnIndex) const override;
|
||||
Shared::CartesianFunction::PlotType plotTypeAtColumn(int * i) const;
|
||||
int maxNumberOfCells() override;
|
||||
int maxNumberOfFunctions() override;
|
||||
@@ -52,7 +53,6 @@ private:
|
||||
int abscissaTitleCellsCount() const override { return Shared::CartesianFunction::k_numberOfPlotTypes; }
|
||||
EvenOddMessageTextCell * abscissaTitleCells(int j) override { assert (j >= 0 && j < abscissaTitleCellsCount()); return &m_abscissaTitleCells[j]; }
|
||||
ViewController * functionParameterController() override;
|
||||
I18n::Message valuesParameterControllerPageTitle() const override;
|
||||
|
||||
int m_numberOfColumnsForType[Shared::CartesianFunction::k_numberOfPlotTypes];
|
||||
Shared::BufferFunctionTitleCell m_functionTitleCells[k_maxNumberOfFunctions];
|
||||
|
||||
@@ -63,6 +63,10 @@ Shared::Interval * ValuesController::intervalAtColumn(int columnIndex) {
|
||||
return App::app()->interval();
|
||||
}
|
||||
|
||||
I18n::Message ValuesController::valuesParameterMessageAtColumn(int columnIndex) const {
|
||||
return I18n::Message::NColumn;
|
||||
}
|
||||
|
||||
ViewController * ValuesController::functionParameterController() {
|
||||
#if COPY_COLUMN
|
||||
m_sequenceParameterController.setRecord(recordAtColumn(selectedColumn()));
|
||||
@@ -72,8 +76,4 @@ ViewController * ValuesController::functionParameterController() {
|
||||
#endif
|
||||
}
|
||||
|
||||
I18n::Message ValuesController::valuesParameterControllerPageTitle() const {
|
||||
return I18n::Message::NColumn;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ public:
|
||||
private:
|
||||
bool setDataAtLocation(double floatBody, int columnIndex, int rowIndex) override;
|
||||
Shared::Interval * intervalAtColumn(int columnIndex) override;
|
||||
I18n::Message valuesParameterMessageAtColumn(int columnIndex) const override;
|
||||
int maxNumberOfCells() override { return k_maxNumberOfCells; }
|
||||
int maxNumberOfFunctions() override { return k_maxNumberOfSequences; }
|
||||
constexpr static int k_maxNumberOfSequences = 3;
|
||||
@@ -29,7 +30,6 @@ private:
|
||||
|
||||
SequenceStore * functionStore() const override { return static_cast<SequenceStore *>(Shared::ValuesController::functionStore()); }
|
||||
ViewController * functionParameterController() override;
|
||||
I18n::Message valuesParameterControllerPageTitle() const override;
|
||||
int abscissaCellsCount() const override { return k_maxNumberOfRows; }
|
||||
EvenOddEditableTextCell * abscissaCells(int j) override {
|
||||
assert (j >= 0 && j < k_maxNumberOfRows);
|
||||
|
||||
@@ -84,7 +84,7 @@ bool ValuesController::handleEvent(Ion::Events::Event event) {
|
||||
if ((event == Ion::Events::OK || event == Ion::Events::EXE) && selectedRow() == 0) {
|
||||
ViewController * parameterController = nullptr;
|
||||
if (typeAtLocation(selectedColumn(), 0) == k_abscissaTitleCellType) {
|
||||
m_abscissaParameterController.setPageTitle(valuesParameterControllerPageTitle());
|
||||
m_abscissaParameterController.setPageTitle(valuesParameterMessageAtColumn(selectedColumn()));
|
||||
intervalParameterController()->setInterval(intervalAtColumn(selectedColumn()));
|
||||
parameterController = &m_abscissaParameterController;
|
||||
} else {
|
||||
|
||||
@@ -65,6 +65,7 @@ private:
|
||||
bool cellAtLocationIsEditable(int columnIndex, int rowIndex) override;
|
||||
double dataAtLocation(int columnIndex, int rowIndex) override;
|
||||
virtual Interval * intervalAtColumn(int columnIndex) = 0;
|
||||
virtual I18n::Message valuesParameterMessageAtColumn(int columnIndex) const = 0;
|
||||
int maxNumberOfElements() const override {
|
||||
return Interval::k_maxNumberOfElements;
|
||||
};
|
||||
@@ -78,7 +79,6 @@ private:
|
||||
virtual int abscissaTitleCellsCount() const = 0;
|
||||
virtual EvenOddMessageTextCell * abscissaTitleCells(int j) = 0;
|
||||
virtual ViewController * functionParameterController() = 0;
|
||||
virtual I18n::Message valuesParameterControllerPageTitle() const = 0;
|
||||
ValuesParameterController m_abscissaParameterController;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user