There has been a lot of activity around Juice Calculators recently. And I've been scratching an itch of my own. It's the end of a long weekend of hacking about but it's ready for at least a demo and requests for comments.
It's a command line tool, using arguments and files and terminals and such.
This quickmix is a bit untested, both it and ejmu are quick frontends
to the backend calculation engine and may be slightly unforgiving.
$ ./quickmix \
n 'Pluid Clone' \
f 'Absinthe (TFA)' 12 \
f 'Kiwi Double (TFA)' 8 \
f 'Ecto Cooler (FW)' 2 \
f 'Sweetener (TFA)' 2 \
nic 18 100 \
r vg 30 pg 100 \
s 10
.--------------------------------------.
| Pluid Clone 18 mg/ml (70/30 PG/VG) |
+-----------------------+------+-------+
| Flavor | ml | Total |
+-----------------------+------+-------+
| VG | 3.00 | 3.00 |
+-----------------------+------+-------+
| PG | 2.80 | 5.80 |
+-----------------------+------+-------+
| 100 mg/ml Nicotine PG | 1.80 | 7.60 |
+-----------------------+------+-------+
| Absinthe (TFA) PG | 1.20 | 8.80 |
+-----------------------+------+-------+
| Kiwi Double (TFA) PG | 0.80 | 9.60 |
+-----------------------+------+-------+
| Ecto Cooler (FW) PG | 0.20 | 9.80 |
+-----------------------+------+-------+
| Sweetener (TFA) PG | 0.20 | 10.00 |
'-----------------------+------+-------'
# one line format for chats and such
Pluid Clone 18 mg/ml (70/30 PG/VG) | Flavor(ml) Total | VG(3.00) 3.00 | PG(2.80) 5.80 | 100 mg/ml Nicotine PG(1.80) 7.60 | Absinthe (TFA) PG(1.20) 8.80 | Kiwi Double (TFA) PG(0.80) 9.60 | Ecto Cooler (FW) PG(0.20) 9.80 | Sweetener (TFA) PG(0.20) 10.00
There's also an eJuice Me Up reader, ATM it doesn't use the mixing information from the .rec files, it just uses the flavor information. But that's easily changed. It's hard coded to my 18mg 70/30 PG/VG 10ml preferences.
$ ./ejmu rec/TinasNYCheesecakeStrawberriesCream.rec
.-----------------------------------------------------------.
| TinasNYCheesecakeStrawberriesCream 18 mg/ml (70/30 PG/VG) |
+--------------------------------------+---------+----------+
| Flavor | ml | Total |
+--------------------------------------+---------+----------+
| PG | 3.20 | 3.20 |
+--------------------------------------+---------+----------+
| VG | 3.00 | 6.20 |
+--------------------------------------+---------+----------+
| 100 mg/ml Nicotine PG | 1.80 | 8.00 |
+--------------------------------------+---------+----------+
| Capella Cheesecake (NY Style) PG | 1.20 | 9.20 |
+--------------------------------------+---------+----------+
| Capella Strawberries & Cream PG | 0.34 | 9.54 |
+--------------------------------------+---------+----------+
| PA Graham Cracker PG | 0.30 | 9.84 |
+--------------------------------------+---------+----------+
| DIYFS Vanilla PG | 0.16 | 10.00 |
'--------------------------------------+---------+----------'
The EJMU engine can also write out EJMU files (to a certain extent),
It does have the ability to read in the older version of the .rec
files and clean them up by moving comments in the flavor fields into
the notes section.
The calculation engine supports a bunch of things not really shown here. Any flavor/nic can have any components of any ratio that can count towards the total volume or not, so it will handle PGA, DW, ACV, ... The final output is rather pluggable so there could be a variety of possibilities (HTML, PDF, D3, ...).
I haven't decided on a canonical recipe format, but it should be flexible enough to handle about anything. And it is missing a few things just because I haven't gotten around to them yet. I want to add more metadata (author, url, notes, ...)
So, what do you think? Does anybody else have a hankering for a command line utility like juice calculation engine?
I could get on board with this, as I haven't used an ejuice calculator because I can do it faster in my head. I would like to see arguments all passed in on a single line though. For example to make my honeydewpearstrawberry (recipe in a plain text file or some other quick to write format) it could be:
quickmix -30ml -18mg -50pg ~/recipies/honeydewpearstrawberry
And that would output a nicely formatted table like in your quickmix output. This is a great idea, so many possibilities.
Already done. :)
Use default base (base strength, base pg/vg, desired strength, desired ratio, size). Which IIRC I have at (100mg, 50PG/50VG, 18mg, 70PG/30VG, 10ml)
$ ./jcalc -f fuzzy_custard.flav
.-----------------------------------------------.
| Fuzzy Custard 18 mg/ml (70/30 PG/VG) |
+--------------------------------+------+-------+
| Flavor | ml | Total |
+--------------------------------+------+-------+
| PG | 4.40 | 4.40 |
+--------------------------------+------+-------+
| VG | 2.10 | 6.50 |
+--------------------------------+------+-------+
| 100 mg/ml Nicotine 50/50 PG/VG | 1.80 | 8.30 |
+--------------------------------+------+-------+
| Vanilla Custard (TFA) PG | 1.30 | 9.60 |
+--------------------------------+------+-------+
| Juicy Peach (TFA) PG | 0.30 | 9.90 |
+--------------------------------+------+-------+
| Butterscotch (TFA) PG | 0.10 | 10.00 |
'--------------------------------+------+-------'
But you can put your desired base in a file (or you can set an environment variable to always use a certain .base file), you can change the size on the fly.
$ ./jcalc -f fuzzy_custard.flav -b juice_talk_13.base -s 30
.------------------------------------------------.
| Fuzzy Custard 13 mg/ml (70/30 PG/VG) |
+--------------------------------+-------+-------+
| Flavor | ml | Total |
+--------------------------------+-------+-------+
| PG | 13.95 | 13.95 |
+--------------------------------+-------+-------+
| VG | 7.05 | 21.00 |
+--------------------------------+-------+-------+
| 100 mg/ml Nicotine 50/50 PG/VG | 3.90 | 24.90 |
+--------------------------------+-------+-------+
| Vanilla Custard (TFA) PG | 3.90 | 28.80 |
+--------------------------------+-------+-------+
| Juicy Peach (TFA) PG | 0.90 | 29.70 |
+--------------------------------+-------+-------+
| Butterscotch (TFA) PG | 0.30 | 30.00 |
'--------------------------------+-------+-------'
And if you want, you can give a base on the fly. A bit rough, but I just added it now. (like ratio in fractions which I prefer greatly and haven't yet added the magic 50/50 == .5/.5 magic yet).
$ ./jcalc -f fuzzy_custard.flav -nic '6 100 pg .5 vg .5'
.-----------------------------------------------.
| Fuzzy Custard 6 mg/ml (70/30 PG/VG) |
+--------------------------------+------+-------+
| Flavor | ml | Total |
+--------------------------------+------+-------+
| PG | 5.00 | 5.00 |
+--------------------------------+------+-------+
| VG | 2.70 | 7.70 |
+--------------------------------+------+-------+
| 100 mg/ml Nicotine 50/50 PG/VG | 0.60 | 8.30 |
+--------------------------------+------+-------+
| Vanilla Custard (TFA) PG | 1.30 | 9.60 |
+--------------------------------+------+-------+
| Juicy Peach (TFA) PG | 0.30 | 9.90 |
+--------------------------------+------+-------+
| Butterscotch (TFA) PG | 0.10 | 10.00 |
'--------------------------------+------+-------'
Really, it will likely end up that you can do anything (all these little scripts are just minor playthings that will get rolled into one. You'll be able to go from specifying every little detail (like the first post's quickmix) to putting things in files and basically importing them (the .flav and .base files are exactly the same sort of thing, you could put them both in the same file if you liked). You could even put the whole damn thing in a single file, chmod +x it and have make_my_juice to have it spit out the details (and still be able to adjust things on the command line.
Alright sounds like you got a great thing going! When will you make the source code available? Or maybe possibly submitting it to the AUR? I want this!
It's a weekend project, so maybe end of next weekend. The last of this weekend's hacking is a bit messy, but if I can clean it up and write some documentation or examples, and get the basics needed for an easy install then I can at least put up an alpha on github.
Are you adventurous? Are you a tiny bit familiar with Perl, or really any other scripting language that follows the 'clone this github repository or download the .zip and unpack' and then maybe run the mostly standard build/test/install commands?
There's now a (hopefully useable) repo up on github. It has a bizarre name because I'm trying to run it against the Travis CI automated testing facility to make sure the build scrip has all of the correct dependencies and such.
It should work on any modern-ish *NIX (Travis only tests back to Perl 5.10, so if you're on RedHat/CentOS 5.x then you're on your own!).
It has some decent tests and examples, not great, but decent. And it would be nice if somebody besides myself tried it out to point out any oddities, mistakes, or just confusing examples.
Bonus: the HTML formatter is cool.