123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267 |
- /*
- * display.h
- *
- * Created on: Sep 26, 2017
- * Author: Philipp Hinz
- */
- #ifndef DISPLAY2_H_
- #define DISPLAY2_H_
- #include <string>
- #include "coffee.h"
- #define DEFAULT_LANG lang_en // Default display language
- #define REFRESH_FAST 5
- #define REFRESH_STD 2
- #define DISPLAY_ROWS 2
- #define DISPLAY_COLS 16
- //(DO NOT change the following values unless you know what you do -> Integer division)
- typedef enum {
- refresh_fast = 5, // Display refresh rate in Hz when active
- refresh_std = 2 // Display refresh rate in Hz when not active
- } refreshRate_t;
- typedef enum {
- lang_de,
- lang_en,
- lang_last
- } display_lang_t;
- typedef enum {
- str_heating,
- str_heatingready,
- str_ready,
- str_brewing,
- str_cleaning,
- str_fullTank,
- str_error,
- str_flow,
- str_bye,
- str_waitoff,
- str_menu,
- str_menu_softoff,
- str_menu_kill,
- str_menu_stats,
- str_menu_stats2,
- str_menu_nextdesc,
- str_menu_temp,
- str_menu_clean,
- str_menu_reboot,
- str_menu_exit,
- str_menu_settings,
- str_menu_resetkwh,
- str_menu_resetkwh_val,
- str_menu_changepreinf,
- str_menu_changebrewtime,
- str_menu_changebrewml,
- str_menu_changesoaktime,
- str_menu_changeAutoReset,
- str_menu_leavesettings,
- str_postBrew,
- str_last
- } display_strings_t;
- typedef struct {
- char const * const text[lang_last];
- } display_string_t;
- static const display_string_t display_strings[str_last] =
- {
- { // heating
- {
- "Heizt auf",
- "Heating"
- }
- },
- { // heatingready
- {
- "Bereit (Heizt)",
- "Ready (Heating)"
- }
- },
- { // ready
- {
- "Bereit",
- "Ready"
- }
- },
- { // brewing
- {
- "Bezug..",
- "Brewing.."
- }
- },
- { // cleaning
- {
- "Reinigt..",
- "Cleaning.."
- }
- },
- { // full tank
- {
- "Abwasser leeren",
- "Graywater full"
- }
- },
- { // error
- {
- "Fehler",
- "Error"
- }
- },
- { // flow
- {
- "Menge",
- "Flow"
- }
- },
- { // bye
- {
- "Auf wiedersehen",
- "Good bye"
- }
- },
- { // waitoff
- {
- "Ausschalten...",
- "Turning off..."
- }
- },
- { // str_menu
- {
- "CoffeePi Menü",
- "CoffeePi Menu"
- }
- },
- { // str_menu_softoff
- {
- "Ausschalten",
- "Turn off"
- }
- },
- { // str_menu_kill
- {
- "Sofort ausschalten",
- "Turn off now"
- }
- },
- { // str_menu_stats
- {
- "Stats",
- "Stats"
- }
- },
- { // str_menu_stats2
- {
- "Energieverbrauch",
- "Energy consumed"
- }
- },
- { // str_menu_nextdesc
- {
- "Reiningung in",
- "Descaling in"
- }
- },
- { // str_menu_temp
- {
- "Temperatur",
- "Temperature"
- }
- },
- { // str_menu_clean
- {
- "Reinigen",
- "Clean"
- }
- },
- { // str_menu_reboot
- {
- "Neustarten",
- "restart Pi"
- }
- },
- { // str_menu_exit
- {
- "Menü verlassen",
- "Leave menu"
- }
- },
- { // str_menu_settings
- {
- "Einstellungen",
- "Settings"
- }
- },
- { // str_menu_resetkwh
- {
- "Reset kWh Zähler",
- "Reset kWh"
- }
- },
- { // str_menu_resetkwh_val
- {
- "Zurücksetzen?",
- "Confirm to reset"
- }
- },
- { // str_change_preinf
- {
- "Vorbrühmenge",
- "Preinfusion"
- }
- },
- { // str_change_brewtime
- {
- "Extraktionszeit",
- "Brewing time"
- }
- },
- { // str_changebrewml
- {
- "Menge Espresso",
- "Amount Dbl Espr"
- }
- },
- { // str_changesoaktime
- {
- "Quellzeit",
- "Soak time"
- }
- },
- { // str_menu_changeAutoReset
- {
- "Auto reset anp",
- "Auto reset adj"
- }
- },
- { // str_leavesettings
- {
- "Verlassen",
- "Leave"
- }
- },
- { // str_postBrew
- {
- "Qualitaet:",
- "Quality:"
- }
- }
- };
- void *displayThread(void *threadid);
- void *displayTimerHandler(void *threadid);
- void displayInit(void);
- void displayPrintLn(int line, const char* str, bool centered);
- void displayPushState(coffee_status_t state);
- void displayRefresh(void);
- const char* displayGetString(display_strings_t string);
- void displaySetLang(display_lang_t lang);
- #endif /* DISPLAY_H_ */
|