main/recipes.c

changeset 16
d43b393a4461
parent 15
34b1eb93e71a
child 17
f3451031d6c6
equal deleted inserted replaced
15:34b1eb93e71a 16:d43b393a4461
353 if (_xml_tun_temp > recipe.MashStep[1].Temperature) { 353 if (_xml_tun_temp > recipe.MashStep[1].Temperature) {
354 recipe.MashStep[0].Temperature = _xml_tun_temp; 354 recipe.MashStep[0].Temperature = _xml_tun_temp;
355 } else { 355 } else {
356 recipe.MashStep[0].Temperature = recipe.MashStep[1].Temperature + 1.25; 356 recipe.MashStep[0].Temperature = recipe.MashStep[1].Temperature + 1.25;
357 } 357 }
358 recipe.MashStep[0].Resttime = 1; 358 recipe.MashStep[0].Resttime = recipe.MashStep[0].Ramptime = 1;
359 recipe.MashStep[0].Type = MASHTYPE_INFUSION;
360 /*
361 * Because we inserted the first infusion step and the next (original first)
362 * step is infusion, change that one into temperature.
363 */
364 if (recipe.MashStep[1].Type == MASHTYPE_INFUSION)
365 recipe.MashStep[1].Type = MASHTYPE_TEMPERATURE;
359 366
360 if (! recipe.MashStep[7].Resttime) { 367 if (! recipe.MashStep[7].Resttime) {
361 // Move last mash step to position 7. 368 // Move last mash step to position 7.
362 for (int i = 6; i > 1; i--) { 369 for (int i = 6; i > 1; i--) {
363 if (recipe.MashStep[i].Resttime) { 370 if (recipe.MashStep[i].Resttime) {
530 ShowFloat(2, 76, "Maisch in", " C", recipe.MashStep[0].Temperature, 2); 537 ShowFloat(2, 76, "Maisch in", " C", recipe.MashStep[0].Temperature, 2);
531 ShowFloat(162, 76, "Spoelwater", " C", recipe.SpargeTemp, 2); 538 ShowFloat(162, 76, "Spoelwater", " C", recipe.SpargeTemp, 2);
532 y = 92; 539 y = 92;
533 _fg = TFT_WHITE; 540 _fg = TFT_WHITE;
534 TFT_print("Maisch stap", 2, y); 541 TFT_print("Maisch stap", 2, y);
535 TFT_print("Temp.", 200, y); 542 TFT_print("T", 200, y);
536 TFT_print("Rust", 260, y); 543 TFT_print("Temp.", 220, y);
544 TFT_print("Rust", 280, y);
537 _fg = TFT_YELLOW; 545 _fg = TFT_YELLOW;
538 y += 16; 546 y += 16;
539 for (int i = 1; i < 8; i++) { 547 for (int i = 1; i < 8; i++) {
540 if (recipe.MashStep[i].Resttime) { 548 if (recipe.MashStep[i].Resttime) {
541 TFT_print(recipe.MashStep[i].Name, 2, y); 549 TFT_print(recipe.MashStep[i].Name, 2, y);
550 switch (recipe.MashStep[i].Type) {
551 case MASHTYPE_INFUSION: TFT_print("I", 200, y); break;
552 case MASHTYPE_TEMPERATURE: TFT_print("T", 200, y); break;
553 case MASHTYPE_DECOCTION: TFT_print("D", 200, y); break;
554 }
542 sprintf(tmp, "%.2f", recipe.MashStep[i].Temperature); 555 sprintf(tmp, "%.2f", recipe.MashStep[i].Temperature);
543 TFT_print(tmp, 200, y); 556 TFT_print(tmp, 220, y);
544 sprintf(tmp, "%2d min", recipe.MashStep[i].Resttime); 557 sprintf(tmp, "%2d m", recipe.MashStep[i].Resttime);
545 TFT_print(tmp, 260, y); 558 TFT_print(tmp, 280, y);
546 y += 16; 559 y += 16;
547 } 560 }
548 } 561 }
549 if (recipe.Additions) { 562 if (recipe.Additions) {
550 _fg = TFT_YELLOW; 563 _fg = TFT_YELLOW;
608 case 1: memset(&recipe, 0, sizeof(recipe)); 621 case 1: memset(&recipe, 0, sizeof(recipe));
609 recipe.Version = 1; 622 recipe.Version = 1;
610 sprintf(recipe.Name, "Recipe %d", r_Records + 1); 623 sprintf(recipe.Name, "Recipe %d", r_Records + 1);
611 sprintf(recipe.Code, "00%d", r_Records + 1); 624 sprintf(recipe.Code, "00%d", r_Records + 1);
612 sprintf(recipe.MashStep[0].Name, "Mash-in"); 625 sprintf(recipe.MashStep[0].Name, "Mash-in");
613 recipe.MashStep[0].Temperature = 67.5; 626 recipe.MashStep[0].Type = MASHTYPE_INFUSION;
627 recipe.MashStep[0].Temperature = recipe.MashStep[0].Infusion_temp = 67.5;
628 recipe.MashStep[0].Infusion_amount = 15.0;
614 recipe.MashStep[0].Resttime = 1; 629 recipe.MashStep[0].Resttime = 1;
630 recipe.MashStep[0].Ramptime = 1;
615 sprintf(recipe.MashStep[1].Name, "Mash"); 631 sprintf(recipe.MashStep[1].Name, "Mash");
632 recipe.MashStep[1].Type = MASHTYPE_TEMPERATURE;
616 recipe.MashStep[1].Temperature = 67.0; 633 recipe.MashStep[1].Temperature = 67.0;
617 recipe.MashStep[1].Resttime = 75; 634 recipe.MashStep[1].Resttime = 75;
635 recipe.MashStep[1].Ramptime = 1;
618 sprintf(recipe.MashStep[7].Name, "Mash-out"); 636 sprintf(recipe.MashStep[7].Name, "Mash-out");
637 recipe.MashStep[7].Type = MASHTYPE_TEMPERATURE;
619 recipe.MashStep[7].Temperature = 78.0; 638 recipe.MashStep[7].Temperature = 78.0;
620 recipe.MashStep[7].Resttime = 5; 639 recipe.MashStep[7].Resttime = 5;
640 recipe.MashStep[7].Ramptime = 11;
621 recipe.BoilTime = 60; 641 recipe.BoilTime = 60;
622 recipe.Additions = 2; 642 recipe.Additions = 2;
623 sprintf(recipe.Addition[0].Name, "Hop"); 643 sprintf(recipe.Addition[0].Name, "Bitterhop");
624 recipe.Addition[0].Time = 60; 644 recipe.Addition[0].Time = 60;
625 recipe.Addition[0].Type = ADDITION_HOP; 645 recipe.Addition[0].Type = ADDITION_HOP;
626 sprintf(recipe.Addition[1].Name, "Hop"); 646 sprintf(recipe.Addition[1].Name, "Aromahop");
627 recipe.Addition[1].Time = 10; 647 recipe.Addition[1].Time = 10;
628 recipe.Addition[1].Type = ADDITION_HOP; 648 recipe.Addition[1].Type = ADDITION_HOP;
629 recipe.CoolTemp = 20.0; 649 recipe.CoolTemp = 20.0;
630 recipe.Whirlpool9 = 0; 650 recipe.Whirlpool9 = 0;
631 recipe.Whirlpool7 = 0; 651 recipe.Whirlpool7 = 0;

mercurial