Acme-FishFarm
view release on metacpan or search on metacpan
docs/Acme-FishFarm-WaterLevelMaintainer-1.01.html view on Meta::CPAN
<p>Acme::FishFarm::WaterLevelMaintainer - Water Level Maintainer for Acme::FishFarm</p>
<h1 id="VERSION">VERSION</h1>
<p>Version 1.01</p>
<h1 id="SYNOPSIS">SYNOPSIS</h1>
<pre><code> use 5.010;
use Acme::FishFarm qw( reduce_precision );
use Acme::FishFarm::WaterFiltration;
my $water_level = Acme::FishFarm::WaterLevelMaintainer->install;
say "Water level maintainer installed and switched on!\n";
my $height_increase;
my $water_level_threshold;
my $current_reading;
while ( "Fish are living under the water..." ) {
$current_reading = reduce_precision( rand(10) );
$height_increase = $water_level->water_level_increase_height;
$water_level_threshold = $water_level->low_water_level_threshold;
$water_level->current_water_level( $current_reading ); # input by user
print "Current Water Level: ", $current_reading, " m (low: < ", $water_level_threshold, " m)\n";
if ( $water_level->is_low_water_level ) {
print " !! Water level is low!\n";
$water_level->pump_water_in;
print " Pumping in ", $height_increase, " m of water...\n";
print "Current Water Level: ", $water_level->current_water_level, "\n";
} else {
print " Water level is still normal.\n";
}
sleep(1);
say "";
}</code></pre>
<h1 id="EXPORT">EXPORT</h1>
<p>None</p>
<h1 id="CREATION-RELATED-MEHODS">CREATION RELATED MEHODS</h1>
<h2 id="install-options">install ( %options )</h2>
<p>Installs a water level maintainer system. This system only pumps water in if the water level is lower than the threshold value.</p>
<p>The supported <code>%options</code> are:</p>
<dl>
<dt id="current_water_level">current_water_level</dt>
<dd>
<p>The default water level is to <code>5 unit</code>.</p>
</dd>
<dt id="low_water_level_threshold">low_water_level_threshold</dt>
<dd>
<p>The default threshold is <code>2 unit</code>.</p>
<p>If the current water level is lower than this threshold, then you need to pump water into the tank.</p>
</dd>
<dt id="increase_water_level_by">increase_water_level_by</dt>
<dd>
<p>This is the height of the water level to increase when the water is pumped in.</p>
<p>The default value is <code>0.5 unit</code>.</p>
</dd>
</dl>
<h1 id="WATER-LEVEL-DETECTION-RELATED-METHODS">WATER LEVEL DETECTION RELATED METHODS</h1>
<h2 id="current_water_level-new_water_level">current_water_level ( $new_water_level )</h2>
<p>Sets / returns the current water level of the water.</p>
<p><code>$new_water_level</code> is optional. If present, the current water level will be set to <code>$new_water_level</code>. Otherwise, returns the current water level (depth).</p>
<h2 id="low_water_level_threshold1">low_water_level_threshold</h2>
<p>Returns the low water level threshold.</p>
<h2 id="set_low_water_level_threshold-new_threshold">set_low_water_level_threshold ( $new_threshold )</h2>
<p>Sets the low water level threshold.</p>
<h2 id="is_low_water_level">is_low_water_level</h2>
<p>Returns <code>1</code> if the DO level is less than the threshold value. Otherwise, returns <code>0</code>.</p>
<h1 id="PUMPS-RELATED-METHODS">PUMPS RELATED METHODS</h1>
<p>For the pumping mechanism, just assume that the pumps can actually pump in certain metres of water each time :)</p>
<h2 id="water_level_increase_height">water_level_increase_height</h2>
<p>Returns the height of water level to increase each water pumping action. See <code>pump_water_in</code> below.</p>
<h2 id="set_water_level_increase_height-new_height">set_water_level_increase_height ( $new_height )</h2>
<p>Sets the height of water level to increase to <code>$new_height</code>.</p>
<h2 id="pump_water_in">pump_water_in</h2>
<p>Pumps water into the tank to increase the height of the water level.</p>
<h1 id="AUTHOR">AUTHOR</h1>
<p>Raphael Jong Jun Jie, <code><ellednera at cpan.org></code></p>
<h1 id="BUGS">BUGS</h1>
<p>Please report any bugs or feature requests to <code>bug-. at rt.cpan.org</code>, or through the web interface at <a href="https://rt.cpan.org/NoAuth/ReportBug.html?Queue=.">https://rt.cpan.org/NoAuth/ReportBug.html?Queue=.</a>. I will be notified,...
<h1 id="SUPPORT">SUPPORT</h1>
<p>You can find documentation for this module with the perldoc command.</p>
<pre><code> perldoc Acme::FishFarm::WaterLevelMaintainer</code></pre>
<p>You can also look for information at:</p>
<ul>
<li><p>RT: CPAN's request tracker (report bugs here)</p>
( run in 1.785 second using v1.01-cache-2.11-cpan-39bf76dae61 )