mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[apps] Display 3 series in Regression and Stats
This commit is contained in:
@@ -16,12 +16,17 @@ StoreController::StoreController(Responder * parentResponder, Store * store, But
|
||||
Shared::StoreController(parentResponder, store, header),
|
||||
m_titleCells{}
|
||||
{
|
||||
m_titleLayout[0] = new HorizontalLayout(new CharLayout('X', KDText::FontSize::Small), new VerticalOffsetLayout(new CharLayout('i', KDText::FontSize::Small), VerticalOffsetLayout::Type::Subscript, false), false);
|
||||
m_titleLayout[1] = new HorizontalLayout(new CharLayout('Y', KDText::FontSize::Small), new VerticalOffsetLayout(new CharLayout('i', KDText::FontSize::Small), VerticalOffsetLayout::Type::Subscript, false), false);
|
||||
for (int i = 0; i < k_numberOfSeries; i++) {
|
||||
/* If the index is too big, the layout creation should take into account the
|
||||
* possibility of a two-digits index. */
|
||||
assert(k_numberOfSeries < 10);
|
||||
m_titleLayout[k_numberOfColumnsPerSeries*i] = new HorizontalLayout(new CharLayout('X', KDText::FontSize::Small), new VerticalOffsetLayout(new CharLayout('0'+ i, KDText::FontSize::Small), VerticalOffsetLayout::Type::Subscript, false), false);
|
||||
m_titleLayout[k_numberOfColumnsPerSeries*i+1] = new HorizontalLayout(new CharLayout('Y', KDText::FontSize::Small), new VerticalOffsetLayout(new CharLayout('0' + i, KDText::FontSize::Small), VerticalOffsetLayout::Type::Subscript, false), false);
|
||||
}
|
||||
}
|
||||
|
||||
StoreController::~StoreController() {
|
||||
for (int i = 0; i < 2; i++) {
|
||||
for (int i = 0; i < k_numberOfTitleCells; i++) {
|
||||
if (m_titleLayout[i]) {
|
||||
delete m_titleLayout[i];
|
||||
m_titleLayout[i] = nullptr;
|
||||
|
||||
@@ -21,7 +21,7 @@ private:
|
||||
View * loadView() override;
|
||||
void unloadView(View * view) override;
|
||||
EvenOddExpressionCell * m_titleCells[k_numberOfTitleCells];
|
||||
Poincare::ExpressionLayout * m_titleLayout[2];
|
||||
Poincare::ExpressionLayout * m_titleLayout[k_numberOfTitleCells];
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -21,8 +21,8 @@ const char * StoreController::title() {
|
||||
}
|
||||
|
||||
int StoreController::numberOfColumns() {
|
||||
return 2;
|
||||
};
|
||||
return k_numberOfColumnsPerSeries * k_numberOfSeries;
|
||||
}
|
||||
|
||||
KDCoordinate StoreController::columnWidth(int i) {
|
||||
return k_cellWidth;
|
||||
@@ -67,7 +67,7 @@ void StoreController::willDisplayCellAtLocation(HighlightCell * cell, int i, int
|
||||
}
|
||||
|
||||
void StoreController::didBecomeFirstResponder() {
|
||||
if (selectedRow() < 0) {
|
||||
if (selectedRow() < 0 || selectedColumn() < 0) {
|
||||
selectCellAtLocation(0, 0);
|
||||
}
|
||||
EditableCellTableViewController::didBecomeFirstResponder();
|
||||
@@ -80,8 +80,9 @@ bool StoreController::handleEvent(Ion::Events::Event event) {
|
||||
app()->setFirstResponder(tabController());
|
||||
return true;
|
||||
}
|
||||
assert(selectedColumn() >= 0 && selectedColumn() < numberOfColumns());
|
||||
if ((event == Ion::Events::OK || event == Ion::Events::EXE) && selectedRow() == 0) {
|
||||
m_storeParameterController.selectXColumn(selectedColumn() == 0);
|
||||
m_storeParameterController.selectXColumn(selectedColumn()%k_numberOfColumnsPerSeries == 0);
|
||||
StackViewController * stack = ((StackViewController *)parentResponder()->parentResponder());
|
||||
stack->push(&m_storeParameterController);
|
||||
return true;
|
||||
|
||||
@@ -24,8 +24,11 @@ public:
|
||||
void didBecomeFirstResponder() override;
|
||||
protected:
|
||||
static constexpr KDCoordinate k_cellWidth = Ion::Display::Width/2 - Metric::CommonRightMargin/2 - Metric::CommonLeftMargin/2;
|
||||
constexpr static int k_maxNumberOfEditableCells = 22;
|
||||
constexpr static int k_numberOfTitleCells = 2;
|
||||
constexpr static int k_numberOfSeries = 3;
|
||||
constexpr static int k_numberOfColumnsPerSeries = 2;
|
||||
constexpr static int k_maxNumberOfEditableCells = 22 * k_numberOfSeries;
|
||||
constexpr static int k_numberOfTitleCells = k_numberOfColumnsPerSeries * k_numberOfSeries;
|
||||
// TODO Put finer number of cells
|
||||
static constexpr int k_titleCellType = 0;
|
||||
static constexpr int k_editableCellType = 1;
|
||||
Responder * tabController() const override;
|
||||
|
||||
@@ -3,8 +3,12 @@ StatsAppCapital = "STATISTIKEN"
|
||||
HistogramTab = "Histogramm"
|
||||
BoxTab = "Boxplot"
|
||||
StatTab = "Stats"
|
||||
Values = "Werte"
|
||||
Sizes = "Haufigkeiten"
|
||||
Values1 = "Werte V1"
|
||||
Values2 = "Werte V2"
|
||||
Values3 = "Werte V3"
|
||||
Sizes1 = "Haufigkeiten N1"
|
||||
Sizes2 = "Haufigkeiten N2"
|
||||
Sizes3 = "Haufigkeiten N3"
|
||||
ImportList = "Laden eine Liste"
|
||||
NoDataToPlot = "Keine Daten zu zeichnen"
|
||||
Interval = " Intervall"
|
||||
|
||||
@@ -3,8 +3,12 @@ StatsAppCapital = "STATISTICS"
|
||||
HistogramTab = "Histogram"
|
||||
BoxTab = "Box"
|
||||
StatTab = "Stats"
|
||||
Values = "Values"
|
||||
Sizes = "Sizes"
|
||||
Values1 = "Values V1"
|
||||
Values2 = "Values V2"
|
||||
Values3 = "Values V3"
|
||||
Sizes1 = "Sizes N1"
|
||||
Sizes2 = "Sizes N2"
|
||||
Sizes3 = "Sizes N3"
|
||||
ImportList = "Import from a list"
|
||||
NoDataToPlot = "No data to draw"
|
||||
Interval = " Interval "
|
||||
|
||||
@@ -3,8 +3,12 @@ StatsAppCapital = "ESTADISTICA"
|
||||
HistogramTab = "Histograma"
|
||||
BoxTab = "Caja"
|
||||
StatTab = "Medidas"
|
||||
Values = "Valores"
|
||||
Sizes = "Frecuencias"
|
||||
Values1 = "Valores V1"
|
||||
Values2 = "Valores V2"
|
||||
Values3 = "Valores V3"
|
||||
Sizes1 = "Frecuencias N1"
|
||||
Sizes2 = "Frecuencias N2"
|
||||
Sizes3 = "Frecuencias N3"
|
||||
ImportList = "Importar una lista"
|
||||
NoDataToPlot = "Ningunos datos que dibujar"
|
||||
Interval = " Intervalo"
|
||||
|
||||
@@ -3,8 +3,12 @@ StatsAppCapital = "STATISTIQUES"
|
||||
HistogramTab = "Histogramme"
|
||||
BoxTab = "Boite"
|
||||
StatTab = "Stats"
|
||||
Values = "Valeurs"
|
||||
Sizes = "Effectifs"
|
||||
Values1 = "Valeurs V1"
|
||||
Values2 = "Valeurs V2"
|
||||
Values3 = "Valeurs V3"
|
||||
Sizes1 = "Effectifs N1"
|
||||
Sizes2 = "Effectifs N2"
|
||||
Sizes3 = "Effectifs N3"
|
||||
ImportList = "Importer une liste"
|
||||
NoDataToPlot = "Aucune donnee a tracer"
|
||||
Interval = " Intervalle "
|
||||
|
||||
@@ -3,8 +3,12 @@ StatsAppCapital = "ESTATISTICA"
|
||||
HistogramTab = "Histograma"
|
||||
BoxTab = "Caixa"
|
||||
StatTab = "Estat"
|
||||
Values = "Valores"
|
||||
Sizes = "Frequencias"
|
||||
Values1 = "Valores V1"
|
||||
Values2 = "Valores V2"
|
||||
Values3 = "Valores V3"
|
||||
Sizes1 = "Frequencias N1"
|
||||
Sizes2 = "Frequencias N2"
|
||||
Sizes3 = "Frequencias N3"
|
||||
ImportList = "Importar de uma lista"
|
||||
NoDataToPlot = "Nao ha dados para desenhar"
|
||||
Interval = " Intervalo"
|
||||
|
||||
@@ -22,11 +22,16 @@ void StoreController::willDisplayCellAtLocation(HighlightCell * cell, int i, int
|
||||
return;
|
||||
}
|
||||
EvenOddMessageTextCell * mytitleCell = (EvenOddMessageTextCell *)cell;
|
||||
if (i == 0) {
|
||||
mytitleCell->setMessage(I18n::Message::Values);
|
||||
return;
|
||||
bool valuesColumn = i%k_numberOfColumnsPerSeries == 0;
|
||||
int seriesIndex = i/k_numberOfColumnsPerSeries;
|
||||
assert(seriesIndex >= 0 && seriesIndex < FloatPairStore::k_numberOfSeries);
|
||||
if (valuesColumn) {
|
||||
I18n::Message valuesMessages[] = {I18n::Message::Values1, I18n::Message::Values2, I18n::Message::Values3};
|
||||
mytitleCell->setMessage(valuesMessages[seriesIndex]);
|
||||
} else {
|
||||
I18n::Message sizesMessages[] = {I18n::Message::Sizes1, I18n::Message::Sizes2, I18n::Message::Sizes3};
|
||||
mytitleCell->setMessage(sizesMessages[seriesIndex]);
|
||||
}
|
||||
mytitleCell->setMessage(I18n::Message::Sizes);
|
||||
}
|
||||
|
||||
HighlightCell * StoreController::titleCells(int index) {
|
||||
|
||||
Reference in New Issue
Block a user