Skip to content

Commit

Permalink
removed "calendar events view", rearranged sequence
Browse files Browse the repository at this point in the history
Nobody uses "calendar events view" and it takes work to refresh all its dates.
  • Loading branch information
barry-ha committed Mar 31, 2023
1 parent a773007 commit 3cf1c52
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
13 changes: 7 additions & 6 deletions Griduino.ino
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ enum VIEW_INDEX {
/*const*/ int splash_view = SPLASH_VIEW;
/*const*/ int screen1_view = SCREEN1_VIEW;
/*const*/ int grid_view = GRID_VIEW;
/*const*/ int grid_crossings_view = GRID_CROSSINGS_VIEW;
/*const*/ int goto_next_view = GOTO_NEXT_VIEW;
/*const*/ int goto_next_cfg = GOTO_SETTINGS;

Expand Down Expand Up @@ -402,14 +403,14 @@ void selectNewView(int cmd) {
switch (currentView) {
case SCREEN1_VIEW: nextView = HELP_VIEW; break; // skip SPLASH_VIEW (simplify startup, now that animated logo shows version number)
case SPLASH_VIEW: nextView = GRID_VIEW; break;
case GRID_VIEW: nextView = TEN_MILE_ALERT_VIEW; break; // skip GRID_CROSSINGS_VIEW (not ready for prime time)
case GRID_CROSSINGS_VIEW: nextView= TEN_MILE_ALERT_VIEW; break;
case TEN_MILE_ALERT_VIEW: nextView = BARO_VIEW; break;
case GRID_VIEW: nextView = TIME_VIEW; break;
case GRID_CROSSINGS_VIEW: nextView= TIME_VIEW; break; // skip GRID_CROSSINGS_VIEW (not ready for prime time)
case TIME_VIEW: nextView = BARO_VIEW; break;
case BARO_VIEW: nextView = ALTIMETER_VIEW; break;
case ALTIMETER_VIEW: nextView = STATUS_VIEW; break;
case STATUS_VIEW: nextView = TIME_VIEW; break;
case TIME_VIEW: nextView = DATE_VIEW; break;
case DATE_VIEW: nextView = GRID_VIEW; break;
case STATUS_VIEW: nextView = TEN_MILE_ALERT_VIEW; break;
case TEN_MILE_ALERT_VIEW: nextView = GRID_VIEW; break;
case DATE_VIEW: nextView = GRID_VIEW; break; // skip DATE_VIEW (nobody uses it)
// none of above: we must be showing some settings view, so go to the first normal user view
default: nextView = GRID_VIEW; break;
}
Expand Down
21 changes: 14 additions & 7 deletions commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,18 @@
#include "view.h" // View base class, public interface

// ========== extern ===========================================
extern Logger logger; // Griduino.ino
extern bool showTouchTargets; // Griduino.ino
extern Model *model; // "model" portion of model-view-controller
extern BarometerModel baroModel; // singleton instance of the barometer model
extern View *pView; // Griduino.ino
extern Logger logger; // Griduino.ino
extern bool showTouchTargets; // Griduino.ino
extern Model *model; // "model" portion of model-view-controller
extern BarometerModel baroModel; // singleton instance of the barometer model
extern void selectNewView(int cmd); // Griduino.ino
extern View *pView; // Griduino.ino

// ----- forward references
void help(), version();
void dump_kml(), dump_gps_history(), erase_gps_history(), list_files();
void start_nmea(), stop_nmea(), start_gmt(), stop_gmt();
void view_help(), view_screen1(), view_splash();
void view_help(), view_screen1(), view_splash(), view_crossings();
void show_touch(), hide_touch();
void run_unittest();

Expand Down Expand Up @@ -60,6 +61,7 @@ Command cmdList[] = {
{"view help", view_help, Newline},
{"view splash", view_splash, 0},
{"view screen1", view_screen1, 0},
{"view crossings", view_crossings, 0},

{"list files", list_files, Newline},
{"run unittest", run_unittest, 0},
Expand Down Expand Up @@ -128,7 +130,6 @@ void stop_gmt() {
logger.print_gmt = false;
}

extern void selectNewView(int cmd); // extern declaration
void view_help() {
Serial.println("view Help screen");
extern /*const*/ int help_view; // see "Griduino.ino"
Expand All @@ -147,6 +148,12 @@ void view_screen1() {
selectNewView(screen1_view); // see "Griduino.ino"
}

void view_crossings() {
logger.info("view grid corssings");
extern /*const*/ int grid_crossings_view; // see Griduino.com
selectNewView(grid_crossings_view);
}

void show_touch() {
Serial.println("showing touch targets");
showTouchTargets = true;
Expand Down

0 comments on commit 3cf1c52

Please sign in to comment.