#!/usr/bin/perl -w #################################################################### use Brewery; use Brewing::Burner; use Water; use Water::Filter; use Time::HiRes qw/ get_timeofday tv_interval /; my $brewery => new Brewery("really.. my normal brewery..."); my $recipe = $brewery-> lookup_recipe("Bosun's Madness Belgian Trippel", { size => '10 gallons' } ); my $hot_liquor_tank = $brewery->setup_hot_liquor_tank(); my $mash_tun = $brewery->setup_mash_tun(); my $brewpot = $brewery->setup_brewpot(); my $rims_heater = $brewery->setup_rims_heater(); $hot_liquor_tank -> add_water ( (new Water::Filter(new Water())) -> get_qty($recipe->dough_in_water_qty())); my $hlt_heater = new Brewing::Burner(); $hlt_heater->on(); my $water_temp = $hot_liquor_tank -> get_temp(); while( $water_temp < $recipe->strike_temp() ) { $water_temp = $hot_liquor_tank -> get_temp(); } $hlt_heater->off(); $mash_tun -> add($recipe->grain_bill()); my $mash_temp = $recipe->mash_temp(); my $infusion_time = $recipe->infusion_time(); # as a tv my $t1 = [ gettimeofday() ]; # # mash grain until saccaranification is complete... while ( tv_interval( $t1,$infusion_time) > 0 ) { if ( $rims_heater->status() eq 'OFF' ) { if ( $mash_tun -> get_temp() < $mash_temp ) { $rims_heater->on(); } } else { if ( $mash_tun -> get_temp() >= $mash_temp ) { $rims_heater->off(); } } } $rims_heater->on(); while($mash_tun->get_temp() < $recipe->mashout()){}; $rims_heater->off(); $mash_tun->begin_worlauf(); while( $mash_tun->check_grant()->runnings() ne 'CLEAR' ){ $mash_tun->worlauf()->pump()->recirculate(); } $brewpot->recieve($mash_tun->pump()->wort()); $brewery->boiler_heater->on(); while($brewpot->boiling() ne 'TRUE') { } # Wait until comes to a boil my $start_boil = [ gettimeofday()]; my $currtime=$start_boil; my $stop_boil = $recipe->get_boil_time(); while ( my $time_left=tv_interval($currtime,$stop_boil)){ # Hops are added at 90, 60, 45, 30 and 15 minute to boil # time intervals, typically. (Not all 5 intervals though!) if ( $recipe->hop_time($time_left) ) { $brewpot->add_hops($recipe->scheduled_hops($time_left)); } # # Adjuncts such as candi sugar, irish moss (and other finings) and # spices get added at certain times of the schedule if ( $recipe->adjunct_time($time_left) ) { $brewpot->add_adjuncts($recipe->scheduled_adjuncts($time_left)); } } $brewery->boiler_heater->off(); $brewery->fermenter->recieve( $brewery->wort_chiller(new Water(),$brewpot->wort_out) ); $brewery->fermenter->add_yeast($recipe->yeast());