# HG changeset patch # User Michiel Broek # Date 1540491738 -7200 # Node ID d43b393a4461cf06c370e2021bf69653cde10c6d # Parent 34b1eb93e71a07d752c9b39c810bf54d87a9df57 Improved recipes import. diff -r 34b1eb93e71a -r d43b393a4461 main/recipes.c --- a/main/recipes.c Thu Oct 25 17:36:02 2018 +0200 +++ b/main/recipes.c Thu Oct 25 20:22:18 2018 +0200 @@ -355,7 +355,14 @@ } else { recipe.MashStep[0].Temperature = recipe.MashStep[1].Temperature + 1.25; } - recipe.MashStep[0].Resttime = 1; + recipe.MashStep[0].Resttime = recipe.MashStep[0].Ramptime = 1; + recipe.MashStep[0].Type = MASHTYPE_INFUSION; + /* + * Because we inserted the first infusion step and the next (original first) + * step is infusion, change that one into temperature. + */ + if (recipe.MashStep[1].Type == MASHTYPE_INFUSION) + recipe.MashStep[1].Type = MASHTYPE_TEMPERATURE; if (! recipe.MashStep[7].Resttime) { // Move last mash step to position 7. @@ -532,17 +539,23 @@ y = 92; _fg = TFT_WHITE; TFT_print("Maisch stap", 2, y); - TFT_print("Temp.", 200, y); - TFT_print("Rust", 260, y); + TFT_print("T", 200, y); + TFT_print("Temp.", 220, y); + TFT_print("Rust", 280, y); _fg = TFT_YELLOW; y += 16; for (int i = 1; i < 8; i++) { if (recipe.MashStep[i].Resttime) { TFT_print(recipe.MashStep[i].Name, 2, y); + switch (recipe.MashStep[i].Type) { + case MASHTYPE_INFUSION: TFT_print("I", 200, y); break; + case MASHTYPE_TEMPERATURE: TFT_print("T", 200, y); break; + case MASHTYPE_DECOCTION: TFT_print("D", 200, y); break; + } sprintf(tmp, "%.2f", recipe.MashStep[i].Temperature); - TFT_print(tmp, 200, y); - sprintf(tmp, "%2d min", recipe.MashStep[i].Resttime); - TFT_print(tmp, 260, y); + TFT_print(tmp, 220, y); + sprintf(tmp, "%2d m", recipe.MashStep[i].Resttime); + TFT_print(tmp, 280, y); y += 16; } } @@ -610,20 +623,27 @@ sprintf(recipe.Name, "Recipe %d", r_Records + 1); sprintf(recipe.Code, "00%d", r_Records + 1); sprintf(recipe.MashStep[0].Name, "Mash-in"); - recipe.MashStep[0].Temperature = 67.5; + recipe.MashStep[0].Type = MASHTYPE_INFUSION; + recipe.MashStep[0].Temperature = recipe.MashStep[0].Infusion_temp = 67.5; + recipe.MashStep[0].Infusion_amount = 15.0; recipe.MashStep[0].Resttime = 1; + recipe.MashStep[0].Ramptime = 1; sprintf(recipe.MashStep[1].Name, "Mash"); + recipe.MashStep[1].Type = MASHTYPE_TEMPERATURE; recipe.MashStep[1].Temperature = 67.0; recipe.MashStep[1].Resttime = 75; + recipe.MashStep[1].Ramptime = 1; sprintf(recipe.MashStep[7].Name, "Mash-out"); + recipe.MashStep[7].Type = MASHTYPE_TEMPERATURE; recipe.MashStep[7].Temperature = 78.0; recipe.MashStep[7].Resttime = 5; + recipe.MashStep[7].Ramptime = 11; recipe.BoilTime = 60; recipe.Additions = 2; - sprintf(recipe.Addition[0].Name, "Hop"); + sprintf(recipe.Addition[0].Name, "Bitterhop"); recipe.Addition[0].Time = 60; recipe.Addition[0].Type = ADDITION_HOP; - sprintf(recipe.Addition[1].Name, "Hop"); + sprintf(recipe.Addition[1].Name, "Aromahop"); recipe.Addition[1].Time = 10; recipe.Addition[1].Type = ADDITION_HOP; recipe.CoolTemp = 20.0;