Files
Upsilon/apps/regression/graph_controller.h
Émilie Feral 39f422a95a [apps/shared] In interactive curve view controller, repaire bugs due to
wrong initialisation of the range

Change-Id: I2222e27df19b8130ddb3926eba584f7e6d90b7ba
2017-06-05 11:17:17 +02:00

56 lines
2.2 KiB
C++

#ifndef REGRESSION_GRAPH_CONTROLLER_H
#define REGRESSION_GRAPH_CONTROLLER_H
#include <escher.h>
#include "banner_view.h"
#include "store.h"
#include "graph_view.h"
#include "initialisation_parameter_controller.h"
#include "prediction_parameter_controller.h"
#include "../shared/interactive_curve_view_controller.h"
#include "../shared/curve_view_cursor.h"
namespace Regression {
class GraphController : public Shared::InteractiveCurveViewController {
public:
GraphController(Responder * parentResponder, ButtonRowController * header, Store * store, Shared::CurveViewCursor * cursor, uint32_t * modelVersion, uint32_t * rangeVersion);
ViewController * initialisationParameterController() override;
bool isEmpty() const override;
I18n::Message emptyMessage() override;
void selectRegressionCurve();
private:
constexpr static float k_cursorTopMarginRatio = 0.07f; // (cursorHeight/2)/graphViewHeight
constexpr static float k_cursorRightMarginRatio = 0.04f; // (cursorWidth/2)/graphViewWidth
constexpr static float k_cursorBottomMarginRatio = 0.24f; // (cursorHeight/2+bannerHeigh)/graphViewHeight
constexpr static float k_cursorLeftMarginRatio = 0.04f; // (cursorWidth/2)/graphViewWidth
constexpr static int k_maxLegendLength = 16;
constexpr static int k_maxNumberOfCharacters = 20;
BannerView * bannerView() override;
Shared::CurveView * curveView() override;
Shared::InteractiveCurveViewRange * interactiveCurveViewRange() override;
bool handleEnter() override;
void reloadBannerView() override;
void initRangeParameters() override;
void initCursorParameters() override;
bool moveCursorHorizontally(int direction) override;
bool moveCursorVertically(int direction) override;
uint32_t modelVersion() override;
uint32_t rangeVersion() override;
bool isCursorVisible() override;
BannerView m_bannerView;
GraphView m_view;
Store * m_store;
InitialisationParameterController m_initialisationParameterController;
PredictionParameterController m_predictionParameterController;
/* The selectedDotIndex is -1 when no dot is selected, m_numberOfPairs when
* the mean dot is selected and the dot index otherwise */
int m_selectedDotIndex;
};
}
#endif