Commit d5ea03fd authored by João Lino's avatar João Lino

menu system restructure - initial commit

menu system restructure
parent 9f46351c
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
#ifndef CustomDataStructures_h #ifndef CustomDataStructures_h
#define CustomDataStructures_h #define CustomDataStructures_h
#define SYS_MAX_MENU_ELEMENTS 16
enum eRotaryEncoderMode { enum eRotaryEncoderMode {
eRotaryEncoderMode_Menu, eRotaryEncoderMode_Menu,
eRotaryEncoderMode_Time, eRotaryEncoderMode_Time,
...@@ -111,10 +113,10 @@ enum eBeerProfile { ...@@ -111,10 +113,10 @@ enum eBeerProfile {
}; };
typedef struct menuData_ { typedef struct menuData_ {
char *_title; const char *_title;
const char *_dialog[ SYS_MAX_MENU_ELEMENTS ];
int _position; int _position;
int _selection; int _selection;
char **_dialog;
bool _repaint; bool _repaint;
} MenuData; } MenuData;
......
#ifndef __BREW #ifndef __BREW
#define __BREW #define __BREW
// ++++++++++++++++++++++++ LiquidCrystal_I2C ++++++++++++++++++++++++
#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>
// ++++++++++++++++++++++++ PT100 +++++++++++++++++++++++++++++++++
//#include <PT100.h>
// ++++++++++++++++++++++++ Defines +++++++++++++++++++++++++++++++++
#define NELEMS(x) (sizeof(x) / sizeof((x)[0]))
// ++++++++++++++++++++++++ OTHER +++++++++++++++++++++++++++++++++
#include "CustomDataStructures.h"
#include "debug.h"
#include "config.h"
#include "Melody.h"
#include "Display.h"
#include "Temperature.h"
#include "Profiles.h"
// ++++++++++++++++++++++++ FUNCTIONS +++++++++++++++++++++++++++++++++
void xSetupRotaryEncoder( eRotaryEncoderMode newMode, int newPosition, int newMaxPosition, int newMinPosition, int newSingleStep, int newMultiStep ); void xSetupRotaryEncoder( eRotaryEncoderMode newMode, int newPosition, int newMaxPosition, int newMinPosition, int newSingleStep, int newMultiStep );
// ######################### START ######################### // ######################### START #########################
......
This diff is collapsed.
...@@ -89,6 +89,43 @@ ...@@ -89,6 +89,43 @@
#define MENU_SIZE_MALT_MENU 4 #define MENU_SIZE_MALT_MENU 4
#define MENU_SIZE_SETTINGS_MENU 6 #define MENU_SIZE_SETTINGS_MENU 6
// ++++++++++++++++++++++++ Menus ++++++++++++++++++++++++
#define MENU_MAIN_TITLE "Brewery Menu"
#define MENU_MAIN_DIALOG { "", "-> GO ", "-> GO from stage", "-> STOP ", "-> SKIP ", "-> BeerProfile ", "-> Stages ", "-> Malt ", "-> Hops ", "-> Clean ", "-> Purge ", "-> Settings ", "-> Back " }
#define MENU_MAIN_INIT_POSITION eMainMenu_GO
#define MENU_MAIN_INIT_SELECTION eMainMenu_NULL
#define MENU_MAIN_INIT_REPAINT false
#define MENU_PROFILE_TITLE "Profile Menu"
#define MENU_PROFILE_DIALOG {"", "-> Basic ", "-> Trigo ", "-> IPA ", "-> Belga ", "-> Red ", "-> APA ", "-> Custom ", "-> Back " }
#define MENU_PROFILE_INIT_POSITION eBeerProfileMenu_Basic
#define MENU_PROFILE_INIT_SELECTION eBeerProfileMenu_NULL
#define MENU_PROFILE_INIT_REPAINT false
#define MENU_STAGE_TITLE "Stage Menu"
#define MENU_STAGE_DIALOG {"", "-> Startpoint ", "-> BetaGlucanase", "-> Debranching ", "-> Proteolytic ", "-> Beta Amylase ", "-> Alpha Amylase", "-> Mashout ", "-> Recirculation", "-> Sparge ", "-> Boil ", "-> Cooling ", "-> Back " }
#define MENU_STAGE_INIT_POSITION eStageMenu_Startpoint
#define MENU_STAGE_INIT_SELECTION eStageMenu_NULL
#define MENU_STAGE_INIT_REPAINT false
#define MENU_MALT_TITLE "Malt Menu"
#define MENU_MALT_DIALOG {"", "-> CM Ch. Pilsen", "-> CM Wheat Blan", "-> Back " }
#define MENU_MALT_INIT_POSITION eMaltMenu_CastleMalting_Chteau_Pilsen_2RS
#define MENU_MALT_INIT_SELECTION eMaltMenu_NULL
#define MENU_MALT_INIT_REPAINT false
#define MENU_SETTINGS_TITLE "Settings Menu"
#define MENU_SETTINGS_DIALOG {"", "-> PT100 Element", "-> PT100 Up ", "-> PT100 Down ", "-> Back " }
#define MENU_SETTINGS_INIT_POSITION eSettingsMenu_PT100_Element
#define MENU_SETTINGS_INIT_SELECTION eSettingsMenu_NULL
#define MENU_SETTINGS_INIT_REPAINT false
#define MENU_START_TITLE MENU_STAGE_TITLE
#define MENU_START_DIALOG MENU_STAGE_DIALOG
#define MENU_START_INIT_POSITION MENU_STAGE_INIT_POSITION
#define MENU_START_INIT_SELECTION MENU_STAGE_INIT_SELECTION
#define MENU_START_INIT_REPAINT MENU_STAGE_INIT_REPAINT
// ++++++++++++++++++++++++ Serial Monotor ++++++++++++++++++++++++ // ++++++++++++++++++++++++ Serial Monotor ++++++++++++++++++++++++
#define SETTING_SERIAL_MONITOR_BAUD_RATE 9600 #define SETTING_SERIAL_MONITOR_BAUD_RATE 9600
#define SETTING_SERIAL_MONITOR_WELCOME_MESSAGE "Let's start Brewing!" #define SETTING_SERIAL_MONITOR_WELCOME_MESSAGE "Let's start Brewing!"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment