mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[apps/statistics] Set the formula input view label
This commit is contained in:
@@ -11,7 +11,8 @@ namespace Regression {
|
||||
class StoreController : public Shared::StoreController {
|
||||
public:
|
||||
StoreController(Responder * parentResponder, Store * store, ButtonRowController * header);
|
||||
void fillColumnWithFormula(Poincare::Expression * formula) {}
|
||||
void setFormulaLabel() override {} //TODO
|
||||
void fillColumnWithFormula(Poincare::Expression * formula) override {} //TODO
|
||||
void willDisplayCellAtLocation(HighlightCell * cell, int i, int j) override;
|
||||
private:
|
||||
HighlightCell * titleCells(int index) override;
|
||||
|
||||
@@ -5,11 +5,10 @@ namespace Shared {
|
||||
BufferTextViewWithTextField::BufferTextViewWithTextField(Responder * parentResponder, TextFieldDelegate * delegate, KDText::FontSize size) :
|
||||
View(),
|
||||
Responder(parentResponder),
|
||||
m_bufferTextView(size, 0.0f, 0.5f),
|
||||
m_bufferTextView(size, 1.0f, 0.5f),
|
||||
m_textField(this, m_textFieldBuffer, m_textFieldBuffer, k_textFieldBufferSize, delegate, false, size, 0.0f, 0.5f),
|
||||
m_textFieldBuffer{}
|
||||
{
|
||||
m_bufferTextView.setText("TODO");
|
||||
}
|
||||
|
||||
KDSize BufferTextViewWithTextField::minimalSizeForOptimalDisplay() const {
|
||||
|
||||
@@ -58,6 +58,7 @@ StoreController::StoreController(Responder * parentResponder, FloatPairStore * s
|
||||
}
|
||||
|
||||
void StoreController::displayFormulaInput() {
|
||||
setFormulaLabel();
|
||||
contentView()->displayFormulaInput(true);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ public:
|
||||
StoreController(Responder * parentResponder, FloatPairStore * store, ButtonRowController * header);
|
||||
|
||||
void displayFormulaInput();
|
||||
virtual void setFormulaLabel() = 0;
|
||||
virtual void fillColumnWithFormula(Poincare::Expression * formula) = 0;
|
||||
|
||||
// TextFieldDelegate
|
||||
|
||||
@@ -19,12 +19,18 @@ StoreController::StoreController(Responder * parentResponder, Store * store, But
|
||||
{
|
||||
}
|
||||
|
||||
void StoreController::setFormulaLabel() {
|
||||
int series = selectedColumn() / Store::k_numberOfColumnsPerSeries;
|
||||
int isValueColumn = selectedColumn() % Store::k_numberOfColumnsPerSeries == 0;
|
||||
char text[] = {isValueColumn ? 'V' : 'N', static_cast<char>('1' + series), '=', 0};
|
||||
static_cast<ContentView *>(view())->formulaInputView()->setBufferText(text);
|
||||
}
|
||||
|
||||
void StoreController::fillColumnWithFormula(Expression * formula) {
|
||||
int currentColumn = selectedColumn();
|
||||
// Fetch the series used in the formula to compute the size of the filled in series
|
||||
char variables[7] = {0, 0, 0, 0, 0, 0, 0};
|
||||
int numberOfVariables = formula->getVariables(Symbol::isSeriesSymbol, variables);
|
||||
assert(numberOfVariables >= 0);
|
||||
formula->getVariables(Symbol::isSeriesSymbol, variables);
|
||||
int numberOfValuesToCompute = -1;
|
||||
int index = 0;
|
||||
while (variables[index] != 0) {
|
||||
|
||||
@@ -11,6 +11,7 @@ namespace Statistics {
|
||||
class StoreController : public Shared::StoreController {
|
||||
public:
|
||||
StoreController(Responder * parentResponder, Store * store, ButtonRowController * header);
|
||||
void setFormulaLabel() override;
|
||||
void fillColumnWithFormula(Poincare::Expression * formula) override;
|
||||
void willDisplayCellAtLocation(HighlightCell * cell, int i, int j) override;
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user