diff --git a/apps/graph/values/values_controller.cpp b/apps/graph/values/values_controller.cpp index bfc53dfa5..044a4c882 100644 --- a/apps/graph/values/values_controller.cpp +++ b/apps/graph/values/values_controller.cpp @@ -6,7 +6,8 @@ ValuesController::ValuesController(Responder * parentResponder, Graph::FunctionS m_tableView(TableView(this, k_topMargin, k_rightMargin, k_bottomMargin, k_leftMargin)), m_activeCellX(0), m_activeCellY(-1), - m_functionStore(functionStore) + m_functionStore(functionStore), + m_interval(Graph::Interval(-1.0f, 1.0f, 0.25f)) { } @@ -23,11 +24,11 @@ Responder * ValuesController::tabController() const{ } int ValuesController::numberOfRows() { - return 4; + return 1 + m_interval.numberOfElements(); }; int ValuesController::numberOfColumns() { - return 1+m_functionStore->numberOfActiveFunctions(); + return 1 + m_functionStore->numberOfActiveFunctions(); }; KDCoordinate ValuesController::rowHeight(int j) { @@ -180,7 +181,13 @@ void ValuesController::willDisplayCellAtLocation(View * cell, int i, int j) { } } else { ValueCell * myCell = (ValueCell *)cell; - myCell->setFloat(12.33f); + if (i == 0){ + myCell->setFloat(m_interval.element(j-1)); + } else { + Graph::Function * function = m_functionStore->activeFunctionAtIndex(i-1); + float x = m_interval.element(j-1); + myCell->setFloat(function->evaluateAtAbscissa(x)); + } myCell->setEven(j%2 == 0); } } diff --git a/apps/graph/values/values_controller.h b/apps/graph/values/values_controller.h index afd730ae0..7eb4fcc53 100644 --- a/apps/graph/values/values_controller.h +++ b/apps/graph/values/values_controller.h @@ -5,6 +5,7 @@ #include "../function_store.h" #include "value_cell.h" #include "title_cell.h" +#include "interval.h" class ValuesController : public ViewController, public TableViewDataSource { public: @@ -50,6 +51,7 @@ private: int m_activeCellX; int m_activeCellY; Graph::FunctionStore * m_functionStore; + Graph::Interval m_interval; }; #endif