Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions docs/.devnotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ This is an additional section for information, generally not relevant for the us

# Python Version

Currently used version (just use uv and see .python-version file):
Currently used version (just use uv and see the .python-version file):

```
Python Version 3.13.x
Expand Down Expand Up @@ -84,15 +84,15 @@ In the following diagram, the DB Architecture is shown. The used DB is a SQLite

**Notes:**

- Even if not all fields are mandatory (NOT NULL) they should be initiated with a value of 0, if no other value is desired. This may be changed in the future with a DEFAULT 0 setting. The CocktailBerry app does always assign a value to all fields, so this is only an issue when using a own script for additional data filling
- Even if not all fields are mandatory (NOT NULL) they should be initialized with a value of 0, if no other value is desired. This may be changed in the future with a DEFAULT 0 setting. The CocktailBerry app always assigns a value to all fields, so this is only an issue when using your own script for additional data filling
- AUTOINCREMENT ID / PK are generated by SQLite and do not need to be provided when inserting data
- SQLite does not have the boolean type, so an integer representation of `0: false 1: true` was used. This is case in following columns:
- SQLite does not have the boolean type, so an integer representation of `0: false 1: true` was used. This is the case in the following columns:
- Hand
- Enabled
- Virgin
- Counter / Consumption should be set to 0 when initiating
- Counter / Consumption should be set to 0 when initializing
- The Recipes.Comment field is historical and will probably be removed in the future, since the new DataClass representation takes this job now. Some testing needs to be done to ensure a working app without this column. This can be left as an empty string or null.
- SQLite does only provides a small amount of [alter operations](https://www.sqlite.org/lang_altertable.html), which is also why some columns still got no default value (schema creation was without this constraint).
- SQLite only provides a small amount of [alter operations](https://www.sqlite.org/lang_altertable.html), which is also why some columns still have no default value (schema creation was without this constraint).

# Addon Schema

Expand All @@ -102,15 +102,15 @@ In the following diagram, the schema and interaction with the addons are shown.

# Translating the UI

One contribution, that does not require any programming skill is the possibility to add a translation to your language.
The language file for the backend and qt app is found in `src/language.yaml` for CocktailBerry, `web_client/src/locales/LANGUAGENAME` and in `dashboard/frontend/language.yaml` for the Dashboard. In the best szenerio, both files get the according translation. You can use any of the existing language to translate into your own language, in most cases english will probably be the best to use. Please add for every existing option a translation, following the current YAML schema. Using an [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_code) **two letter code** language codes is desired.
One contribution that does not require any programming skill is the possibility to add a translation to your language.
The language file for the backend and qt app is found in `src/language.yaml` for CocktailBerry, `web_client/src/locales/LANGUAGENAME` and in `dashboard/frontend/language.yaml` for the Dashboard. In the best scenario, both files get the according translation. You can use any of the existing languages to translate into your own language, in most cases English will probably be the best to use. Please add a translation for every existing option, following the current YAML schema. Using an [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_code) **two-letter code** language codes is desired.

# Other Hardware than RPi

There is also the generic board option, which should work with a broad option of other boards.
There is also the generic board option, which should work with a broad range of other boards.
They only need to be controllable over the GPIO interface, especially with [python-periphery](https://github.com/vsergeev/python-periphery).
Depending on the OS of the system, some set up steps may differ from the RPi ones.
For the Qt GUI its important to run the LXDE or similar Desktop variant.
Depending on the OS of the system, some setup steps may differ from the RPi ones.
For the Qt GUI it's important to run the LXDE or similar Desktop variant.
Gnome or others may break some features like always stays on top or other window settings.

Example for RockPi:
Expand Down Expand Up @@ -210,11 +210,11 @@ To manage the style, a qss (qt-css) file is used. [qtsass](https://github.com/sp
qtsass /src/ui/styles/ -o /src/ui/styles/
```

If you want to implement a new style, copy the default.scss file, rename the copy to your style name and plug your colors into the variables. After that, just compile the file. You got a new style setting. To be supported, the style name needs to be added to the `src.__init__` file into the `SUPPORTED_STYLES` list.
If you want to implement a new style, copy the default.scss file, rename the copy to your style name and plug your colors into the variables. After that, just compile the file. You now have a new style setting. To be supported, the style name needs to be added to the `src.__init__` file into the `SUPPORTED_STYLES` list.

### Button clicked.connect behavior

One issue, which is not clear on the first view, is that there are two signatures for this function. See [this issue on StackOverflow](https://stackoverflow.com/questions/53110309/qpushbutton-clicked-fires-twice-when-autowired-using-ui-form/53110495#53110495) for more details. When using the error logging wrapper and just passing the wrapped function into the connect function, PyQt will also emit the `False` argument into the wrapper. This will result in a crash of the program in case the wrapped function got no arguments. In this case it is better to use a lambda to explicitly tell PyQt the function got no arguments.
One issue, which is not clear on the first view, is that there are two signatures for this function. See [this issue on StackOverflow](https://stackoverflow.com/questions/53110309/qpushbutton-clicked-fires-twice-when-autowired-using-ui-form/53110495#53110495) for more details. When using the error logging wrapper and just passing the wrapped function into the connect function, PyQt will also emit the `False` argument into the wrapper. This will result in a crash of the program in case the wrapped function has no arguments. In this case it is better to use a lambda to explicitly tell PyQt the function got no arguments.

```Python
# Wrapped function without arguments
Expand All @@ -225,16 +225,16 @@ def some_function():
# Good
your_button.clicked.connect(lambda: some_function())

# Will crash because the wrapper got *args=(False,)
# Will crash because the wrapper receives *args=(False,)
# and will call some_function(False)
your_button.clicked.connect(some_function)
```

### Those God Damn Buttons

Even if buttons support a icon element, there seem no way to change the icon color over a css property.
Even if buttons support an icon element, there seems to be no way to change the icon color over a css property.
You either change the icon file (lol) or adjust the color over the property.
Qtawesome got a color argument.
Qtawesome has a color argument.
It could be used to change the color to the given theme color, but therefore some refactoring is needed.

Example:
Expand Down
26 changes: 13 additions & 13 deletions docs/about.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# Overview

CocktailBerry is used to control a cocktail your machine and easily prepare cocktails over a nice-looking user interface.
It also offers the option to create and manage your recipes and ingredients over the interface and calculates the possible cocktails to prepare over given ingredients.
CocktailBerry is used to control your cocktail machine and easily prepare cocktails via a nice-looking user interface.
It also offers the option to create and manage your recipes and ingredients via the interface and calculates the possible cocktails to prepare from given ingredients.
Track and display cocktail data for different teams to even further increase the fun.
Have also a look into the [User Guide](assets/CocktailBerryUserGuide.pdf).
Also have a look at the [User Guide](assets/CocktailBerryUserGuide.pdf).
Let's get started!

## tl;dr

You can easily install the software by just flashing the Raspberry Pi OS on a SD card, insert it, start the device and install the software with just one command.
You can easily install the software by just flashing the Raspberry Pi OS on an SD card, insert it, start the device and install the software with just one command.
Then, get some coffee and let the script do the work.
When you come back, you can set up the machine over the graphical user interface and start mixing cocktails.
This way, you don't have to know much about software an can go full focus on the hardware.
If you want to do your own software part, you can still add this over [addons](addons.md).
When you come back, you can set up the machine via the graphical user interface and start mixing cocktails.
This way, you don't have to know much about software and can focus fully on the hardware.
If you want to do your own software part, you can still add this via [addons](addons.md).

<figure markdown>
![Cocktail in the making](pictures/Cocktailmaker_action.gif){ width="600" }
Expand All @@ -25,7 +25,7 @@ CocktailBerry comes with two versions: v1 and v2.
Most impressions here shown are from v1, but v2 is quite similar.
The main difference is that v2 comes with a more modern design and as a web app, offering more flexibility and accessibility.
You can have a look at the [v2 demo](https://demo.cocktailberry.org/cocktails) to interactively experience it.
The interface was programmed for the users to easily interact with CocktailBerry and manage everything over the GUI.
The interface was programmed for the users to easily interact with CocktailBerry and manage everything via the GUI.
There are different views for the tasks.

<figure markdown>
Expand All @@ -41,7 +41,7 @@ There are different views for the tasks.
This is the main window of the application and the window your guest will interact with.
They can choose a cocktail of their choice, a crossed glass at the start indicates that there is also a virgin option of this cocktail.
The cocktail data is displayed after selection.
The user can choose from your defined list of volume, as well as the alcohol level of the cocktail.
The user can choose from your defined list of volumes, as well as the alcohol level of the cocktail.

<figure markdown>
![Ingredient](pictures/Ingredients_ui.png)
Expand All @@ -59,8 +59,8 @@ This is extremely handy, if you want to prompt the user to add a slice of someth
</figure>

Here you can manage all your recipes.
Define the name and ingredients with corresponding volume.
You can disable recipes, you currently don't want to serve, or activates the virgin option for a cocktail.
Define the name and ingredients with corresponding volumes.
You can disable recipes, you currently don't want to serve, or activate the virgin option for a cocktail.
The number after the ingredient defines the order of the ingredients in the cocktail, same numbers are added in parallel.

<figure markdown>
Expand All @@ -76,8 +76,8 @@ Within this, you can export data, change settings, make and restore backups or r

## Example Machines

The base machine consists out of a Raspberry Pi + touchscreen, 5V relays as well as membrane pumps and some cabling.
The base machine consists of a Raspberry Pi + touchscreen, 5V relays as well as membrane pumps and some cabling.
Using wood, metal or 3D printed parts for the housing, you can create a very nice-looking cocktail machine.
There are a lot of custom-builds out there, check out the [official dashboard](https://stats-cocktailberry.streamlit.app/#existing-machines) for more impressions.
See [Hardware](hardware.md) for a detailed example list of components.
You can also have a look at the official website for cocktailberry for more examples and information: [cocktailberry.org](https://cocktailberry.org).
You can also have a look at the official website for CocktailBerry for more examples and information: [cocktailberry.org](https://cocktailberry.org).
Loading
Loading