Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
orlopau committed Dec 2, 2024
1 parent 71a9efa commit 77986c7
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 0 deletions.
2 changes: 2 additions & 0 deletions code/src/data/localization.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
#define MODE_NAME_RECIPES "Rezepte"
#define MODE_NAME_SCALE "Waage"
#define MODE_NAME_ESPRESSO "Espresso"
#define MODE_NAME_SETTINGS "Einstellungen"
//////////////////////////////////////////////
#else
/////////////////// ENGLISH ///////////////////
Expand Down Expand Up @@ -111,5 +112,6 @@
#define MODE_NAME_RECIPES "Recipes"
#define MODE_NAME_SCALE "Scale"
#define MODE_NAME_ESPRESSO "Espresso"
#define MODE_NAME_SETTINGS "Settings"
//////////////////////////////////////////////
#endif
18 changes: 18 additions & 0 deletions code/src/modes/mode_settings.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include "modes/mode_settings.h"
#include "user_interface.h"
#include "data/localization.h"

void ModeSettings::update()
{
return;
}

bool ModeSettings::canSwitchMode()
{
return true;
}

const char* ModeSettings::getName()
{
return MODE_NAME_SETTINGS;
}
21 changes: 21 additions & 0 deletions code/src/modes/mode_settings.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#pragma once

#include "mode.h"
#include "loadcell.h"
#include "user_interface.h"
#include "util/stopwatch.h"

class ModeSettings : public Mode
{
public:
ModeSettings(WeightSensor &weightSensor, UserInput &buttons, Display &display, Stopwatch &stopwatch)
: buttons(buttons), display(display){};
~ModeSettings(){};
void update();
bool canSwitchMode();
const char* getName();

private:
UserInput &buttons;
Display &display;
};
25 changes: 25 additions & 0 deletions code/src/settings.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#pragma once

#include <stdint.h>

struct Datapoint
{
const char *name;
}

enum class Setting : Datapoint
{
AVERAGING_SAMPLES = 0x01,
COFFEE_WEIGHT = 0x02,
KASUYA_RATIO = 0x04,
KASUYA_NUM_POURS = 0x08,
};

class Settings
{
public:
long get(uint32_t setting);
void set()
virtual float getPercentage() = 0;
virtual bool isCharging() = 0;
};

0 comments on commit 77986c7

Please sign in to comment.