diff --git a/apps/graph/cartesian_function.h b/apps/graph/cartesian_function.h index 3f84dbeb1..2cb0984f4 100644 --- a/apps/graph/cartesian_function.h +++ b/apps/graph/cartesian_function.h @@ -7,7 +7,6 @@ namespace Graph { class CartesianFunction : public Shared::Function { public: - static constexpr const char * Parameter = "(x)"; using Shared::Function::Function; CartesianFunction(const char * text = nullptr, KDColor color = KDColorBlack); bool displayDerivative(); diff --git a/apps/graph/cartesian_function_store.cpp b/apps/graph/cartesian_function_store.cpp index c616bcb42..917efcdb8 100644 --- a/apps/graph/cartesian_function_store.cpp +++ b/apps/graph/cartesian_function_store.cpp @@ -63,6 +63,10 @@ int CartesianFunctionStore::maxNumberOfFunctions() { return k_maxNumberOfFunctions; } +char CartesianFunctionStore::symbol() const { + return 'x'; +} + const char * CartesianFunctionStore::firstAvailableName() { for (int k = 0; k < k_maxNumberOfFunctions; k++) { int j = 0; diff --git a/apps/graph/cartesian_function_store.h b/apps/graph/cartesian_function_store.h index 7c9ef8b40..f02c6cdb9 100644 --- a/apps/graph/cartesian_function_store.h +++ b/apps/graph/cartesian_function_store.h @@ -18,6 +18,7 @@ public: CartesianFunction * addEmptyFunction() override; void removeFunction(Shared::Function * f) override; int maxNumberOfFunctions() override; + char symbol() const override; static constexpr int k_maxNumberOfFunctions = 8; private: const char * firstAvailableName() override; diff --git a/apps/graph/list/list_controller.cpp b/apps/graph/list/list_controller.cpp index c174b5db0..597b32de3 100644 --- a/apps/graph/list/list_controller.cpp +++ b/apps/graph/list/list_controller.cpp @@ -79,7 +79,7 @@ HighlightCell * ListController::expressionCells(int index) { void ListController::willDisplayTitleCellAtIndex(HighlightCell * cell, int j) { FunctionTitleCell * myFunctionCell = (FunctionTitleCell *)cell; CartesianFunction * function = ((CartesianFunctionStore *)m_functionStore)->functionAtIndex(j); - char bufferName[5] = {*function->name(),'(',function->symbol(),')', 0}; + char bufferName[5] = {*function->name(),'(', m_functionStore->symbol(),')', 0}; myFunctionCell->setText(bufferName); KDColor functionNameColor = function->isActive() ? function->color() : Palette::GreyDark; myFunctionCell->setColor(functionNameColor); diff --git a/apps/sequence/sequence.h b/apps/sequence/sequence.h index 588eca590..785809aa3 100644 --- a/apps/sequence/sequence.h +++ b/apps/sequence/sequence.h @@ -24,7 +24,6 @@ public: Poincare::ExpressionLayout * secondInitialConditionLayout(); void setFirstInitialConditionContent(const char * c); void setSecondInitialConditionContent(const char * c); - char symbol() const override; int numberOfElements(); Poincare::ExpressionLayout * definitionName(); Poincare::ExpressionLayout * firstInitialConditionName(); @@ -32,6 +31,7 @@ public: bool isDefined() override; float evaluateAtAbscissa(float x, Poincare::Context * context) const override; private: + char symbol() const override; Type m_type; char m_firstInitialConditionText[Shared::Function::k_bodyLength]; char m_secondInitialConditionText[Shared::Function::k_bodyLength]; diff --git a/apps/sequence/sequence_store.cpp b/apps/sequence/sequence_store.cpp index 4b030cf8b..2c118e5be 100644 --- a/apps/sequence/sequence_store.cpp +++ b/apps/sequence/sequence_store.cpp @@ -56,6 +56,10 @@ int SequenceStore::maxNumberOfFunctions() { return k_maxNumberOfSequences; } +char SequenceStore::symbol() const { + return 'n'; +} + const char * SequenceStore::firstAvailableName() { for (int k = 0; k < k_maxNumberOfSequences; k++) { int j = 0; diff --git a/apps/sequence/sequence_store.h b/apps/sequence/sequence_store.h index 11f96740a..83b1d9335 100644 --- a/apps/sequence/sequence_store.h +++ b/apps/sequence/sequence_store.h @@ -19,6 +19,7 @@ public: void removeFunction(Shared::Function * f) override; int maxNumberOfFunctions() override; const char * firstAvailableName() override; + char symbol() const override; static constexpr int k_maxNumberOfSequences = 3; private: const KDColor firstAvailableColor() override; diff --git a/apps/shared/function_store.h b/apps/shared/function_store.h index 6aa02f57d..497a55806 100644 --- a/apps/shared/function_store.h +++ b/apps/shared/function_store.h @@ -24,6 +24,7 @@ public: // An active function must be defined to be counted int numberOfActiveFunctions(); virtual int maxNumberOfFunctions() = 0; + virtual char symbol() const = 0; protected: int m_numberOfFunctions; private: