From a7b2a235dec4cefbf9f8f80507bda16ad35deedc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Mon, 2 Jan 2017 15:57:55 +0100 Subject: [PATCH] [apps][apps/graph] Move window parameter controller to be used in graph and regression Change-Id: I469e06bfd0e20fe7d93c66c38a53a9a0189de99b --- apps/Makefile | 1 + apps/graph/Makefile | 1 - apps/graph/graph/graph_controller.h | 2 +- .../graph => }/window_parameter_controller.cpp | 9 ++------- .../graph => }/window_parameter_controller.h | 16 ++++++---------- 5 files changed, 10 insertions(+), 19 deletions(-) rename apps/{graph/graph => }/window_parameter_controller.cpp (97%) rename apps/{graph/graph => }/window_parameter_controller.h (73%) diff --git a/apps/Makefile b/apps/Makefile index 6f39bdee3..18d81110e 100644 --- a/apps/Makefile +++ b/apps/Makefile @@ -30,6 +30,7 @@ app_objs += $(addprefix apps/,\ toolbox_node.o\ variable_box_controller.o\ variable_box_leaf_cell.o\ + window_parameter_controller.o\ ) # Tracking which source file uses which image is painful. But we need to ensure diff --git a/apps/graph/Makefile b/apps/graph/Makefile index b32de8cb3..51ddd89db 100644 --- a/apps/graph/Makefile +++ b/apps/graph/Makefile @@ -5,7 +5,6 @@ app_objs += $(addprefix apps/graph/,\ function_title_cell.o\ graph/banner_view.o\ graph/graph_window.o\ - graph/window_parameter_controller.o\ graph/curve_parameter_controller.o\ graph/goto_parameter_controller.o\ graph/graph_controller.o\ diff --git a/apps/graph/graph/graph_controller.h b/apps/graph/graph/graph_controller.h index bfadf8410..451075a6f 100644 --- a/apps/graph/graph/graph_controller.h +++ b/apps/graph/graph/graph_controller.h @@ -4,7 +4,7 @@ #include #include "graph_view.h" #include "graph_window.h" -#include "window_parameter_controller.h" +#include "../../window_parameter_controller.h" #include "curve_parameter_controller.h" #include "initialisation_parameter_controller.h" #include "zoom_parameter_controller.h" diff --git a/apps/graph/graph/window_parameter_controller.cpp b/apps/window_parameter_controller.cpp similarity index 97% rename from apps/graph/graph/window_parameter_controller.cpp rename to apps/window_parameter_controller.cpp index 4569d3bfa..414927192 100644 --- a/apps/graph/graph/window_parameter_controller.cpp +++ b/apps/window_parameter_controller.cpp @@ -1,11 +1,8 @@ #include "window_parameter_controller.h" -#include "../app.h" -#include "../../apps_container.h" +#include "apps_container.h" #include -namespace Graph { - -WindowParameterController::WindowParameterController(Responder * parentResponder, GraphWindow * graphWindow) : +WindowParameterController::WindowParameterController(Responder * parentResponder, CurveViewWindowWithCursor * graphWindow) : FloatParameterController(parentResponder), m_graphWindow(graphWindow), m_windowCells{EditableTextMenuListCell(&m_selectableTableView, this, m_draftTextBuffer, (char *)"Xmin"), EditableTextMenuListCell(&m_selectableTableView, this, m_draftTextBuffer, (char *)"Xmax"), @@ -126,5 +123,3 @@ TableViewCell * WindowParameterController::reusableCell(int index) { int WindowParameterController::reusableCellCount() { return k_numberOfTextCell+1; } - -} diff --git a/apps/graph/graph/window_parameter_controller.h b/apps/window_parameter_controller.h similarity index 73% rename from apps/graph/graph/window_parameter_controller.h rename to apps/window_parameter_controller.h index c41a0568a..e59b63ee4 100644 --- a/apps/graph/graph/window_parameter_controller.h +++ b/apps/window_parameter_controller.h @@ -1,15 +1,13 @@ -#ifndef GRAPH_GRAPH_WINDOW_PARAMETER_CONTROLLER_H -#define GRAPH_GRAPH_WINDOW_PARAMETER_CONTROLLER_H +#ifndef APPS_WINDOW_PARAMETER_CONTROLLER_H +#define APPS_WINDOW_PARAMETER_CONTROLLER_H #include -#include "graph_window.h" -#include "graph_view.h" -#include "../../float_parameter_controller.h" +#include "curve_view_window_with_cursor.h" +#include "float_parameter_controller.h" -namespace Graph { class WindowParameterController : public FloatParameterController { public: - WindowParameterController(Responder * parentResponder, GraphWindow * graphWindow); + WindowParameterController(Responder * parentResponder, CurveViewWindowWithCursor * graphWindow); const char * title() const override; int numberOfRows() override; TableViewCell * reusableCell(int index) override; @@ -22,12 +20,10 @@ private: float parameterAtIndex(int index) override; void setParameterAtIndex(int parameterIndex, float f) override; constexpr static int k_numberOfTextCell = 4; - GraphWindow * m_graphWindow; + CurveViewWindowWithCursor * m_graphWindow; char m_draftTextBuffer[EditableTextMenuListCell::k_bufferLength]; EditableTextMenuListCell m_windowCells[k_numberOfTextCell]; SwitchMenuListCell m_yAutoCell; }; -} - #endif