Files
Upsilon/apps/statistics/histogram_parameter_controller.h
Émilie Feral 6de497c2ed [apps/shared] Templatize FloatParameterController to handle float/double
parameters.

Fix bug: when entering "e^234" as a parameter of a model keeping floats,
the FloatParameterController would accept the number (because e^234 is
defined in double) and store an undefined value in the model (because
e^234 is undefined in float).
2019-09-02 16:55:39 +02:00

29 lines
1.0 KiB
C++

#ifndef STATISTICS_HISTOGRAM_PARAMETER_CONTROLLER_H
#define STATISTICS_HISTOGRAM_PARAMETER_CONTROLLER_H
#include <escher.h>
#include "../shared/float_parameter_controller.h"
#include "store.h"
namespace Statistics {
class HistogramParameterController : public Shared::FloatParameterController<double> {
public:
HistogramParameterController(Responder * parentResponder, InputEventHandlerDelegate * inputEventHandlerDelegateApp, Store * store);
const char * title() override;
int numberOfRows() override { return 1+k_numberOfCells; }
void willDisplayCellForIndex(HighlightCell * cell, int index) override;
private:
constexpr static int k_numberOfCells = 2;
HighlightCell * reusableParameterCell(int index, int type) override;
int reusableParameterCellCount(int type) override { return k_numberOfCells; }
double parameterAtIndex(int index) override;
bool setParameterAtIndex(int parameterIndex, double f) override;
MessageTableCellWithEditableText m_cells[k_numberOfCells];
Store * m_store;
};
}
#endif