An Architecture For Pumping Drinks
Starting off the day with some learning about Rust!
I started off the day off by watching the into_rust() video lectures and exercises! These really helped me improve my understanding of Rust's Ownership model. My understanding was still stuck in C/C++!
Let's start-off by making a little bit of an architecture! The following
picture was taken from a quick sketch I did, but I believe it has the
core pieces. This architecture only goes up to the
web api. The front-end
website will be dealt with later.
Some terms that are in the diagram:
dispenser: Is an abstraction of the pump. it maintains state of how much liquid is in it, how to pump it at a given rate, and how to pump a given quantity.
recipe: A recipe is a listing of all of the liquids which need to be mixed (by name) and how much of each of them to make a givent quantity (in mL). Recipes also include information about user interactions, such as, if the drink should be mixed or stirred, or if ice should be added. Recipes have names and cam be looked up.
mixercontains a list of named
dispensersget there name from a configuration file, or from the
mixeralso sends down information about the liquid levels. A
mixercreates a drink by taking a
quantityas input. System status information is relayed through the
mixerto the LEDs