Acme-FishFarm

 view release on metacpan or  search on metacpan

docs/Acme-FishFarm-WaterFiltration-1.01.html  view on Meta::CPAN

    while ( "Fish are living under the water..." ) {
        $water_filter->current_waste_count( reduce_precision ( rand(100) ) );
        
        $current_reading = $water_filter->current_waste_count;
        $waste_threshold = $water_filter->waste_count_threshold;
        
        print "Current Waste Count: ", $current_reading, " (high: >= ", $waste_threshold, ")\n";

        if ( $water_filter->is_cylinder_dirty ) {
            print "  !! Filtering cylinder is dirty!\n";
            print "  Cleaned the filter!\n";
            $water_filter->clean_cylinder;
        } else {
            print "  Filtering cylinder is still clean.\n";
        }
        sleep(1);
        say "";
    }</code></pre>

<h1 id="EXPORT">EXPORT</h1>

<p>None</p>

<h1 id="DESCRIPTION">DESCRIPTION</h1>

<p>This module assumes a cool water filter with a filtering cylinder constantly filtering water in the tank. It has inlet, outlet and a drainage valves. The drainage valve is only opened when the cleaners are switched on automatically to remove waste...

<p>This feature is based on the water filter found <a href="https://www.filternox.com/filters/spt-wbv-mr/">here</a></p>

<h1 id="CREATION-SUBROUTINES-METHODS">CREATION SUBROUTINES/METHODS</h1>

<h2 id="install-options">install ( %options )</h2>

<p>Installs a cool water filtration system.</p>

<p>The following are avaiable for <code>%options</code>:</p>

<dl>

<dt id="current_waste_count">current_waste_count</dt>
<dd>

<p>The current waste count in the cylinder. Default is <code>0</code>.</p>

</dd>
<dt id="waste_threshold">waste_threshold</dt>
<dd>

<p>Default value is <code>75</code>.</p>

<p>Sets the waste treshold.</p>

<p>This is the maximum limit of waste in the cylinder. When this count is hit, it will turn on the cleaners / spatulas or whatever it&#39;s called :).</p>

</dd>
<dt id="reduce_waste_count_by">reduce_waste_count_by</dt>
<dd>

<p>Default is <code>10</code>.</p>

<p>The amount of waste to remove from the cylinder / filter each time the cleaning process is called.</p>

</dd>
</dl>

<h1 id="WASTE-LEVEL-DETECTING-SUBROUTINES-METHODS">WASTE LEVEL DETECTING SUBROUTINES/METHODS</h1>

<h2 id="current_waste_count-new_waste_count">current_waste_count ( $new_waste_count )</h2>

<p>Sets / returns the current waste count inside the cylinder.</p>

<p><code>$new_waste_count</code> is optional. If present, the current waste count will be set to <code>$new_waste_count</code>. Otherwise, returns the current waste count.</p>

<h2 id="waste_count_threshold">waste_count_threshold</h2>

<p>Returns the waste count threshold.</p>

<h2 id="set_waste_count_threshold">set_waste_count_threshold</h2>

<p>Sets the waste count threshold.</p>

<h2 id="reduce_waste_count_by1">reduce_waste_count_by</h2>

<p>Returns the amount of waste to be reduce each time the cleaning process is called.</p>

<h2 id="set_waste_count_to_reduce-new_count">set_waste_count_to_reduce ( $new_count )</h2>

<p>Sets the waste count reduction value to <code>$new_count</code>.</p>

<h2 id="is_filter_layer_dirty">is_filter_layer_dirty</h2>

<p>Synonym for <code>is_cylinder_dirty</code>. See next method.</p>

<h2 id="is_cylinder_dirty">is_cylinder_dirty</h2>

<p>Returns <code>1</code> if the filtering cylinder is dirty ie current waste count hits the waste count threshold. Returns <code>0</code> otherwise.</p>

<p>Remember to clean your cylinder ie. filter layer as soon as possible if it is dirty.</p>

<h1 id="CLEANING-RELATED-SUBROUTINES-METHODS">CLEANING RELATED SUBROUTINES/METHODS</h1>

<h2 id="clean_filter_layer">clean_filter_layer</h2>

<p>Synonym for <code>is_cylinder_dirty</code>. See next method.</p>

<h2 id="clean_cylinder-reduce_waste_by">clean_cylinder ( $reduce_waste_by )</h2>

<p>Cleans the filter layer in the cylinder.</p>

<p><code>$reduce_waste_by</code> is optional. If present, it will reduce waste by that specific value. Otherwise, it cleans the cylinder completly in one shot ie waste count will be <code>0</code>.</p>

<p>If <code>$reduce_waste_by</code> is a negative value, it will be turned into a positive value with the same magnitude.</p>

<p>Make sure that you turn on the spatulas, if not this process will not do anything :) See <code>turn_on_spatulas</code> below.</p>

<h2 id="turn_on_spatulas">turn_on_spatulas</h2>

<p>Activates the cleaning mechanism ie the spatulas :)</p>

<p>Take note that turning on the spatulas does not clean the cylinder. You need to do it explicitly. See <code>clean_cylinder</code> method above for more info :)</p>

<h2 id="turn_off_spatulas">turn_off_spatulas</h2>

<p>Deactivates the cleaning mechanism ie the spatulas :)</p>

<h2 id="is_on_spatulas">is_on_spatulas</h2>

<p>Returns <code>1</code> if the spatula are turned on. The spatula will not clean the cylinder until you explicitly tell the system to do so. See <code>clean_cylinder</code> method above for more info.</p>

<h1 id="AUTHOR">AUTHOR</h1>

<p>Raphael Jong Jun Jie, <code>&lt;ellednera at cpan.org&gt;</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::WaterFiltration</code></pre>

<p>You can also look for information at:</p>

<ul>

<li><p>RT: CPAN&#39;s request tracker (report bugs here)</p>

<p><a href="https://rt.cpan.org/NoAuth/Bugs.html?Dist=.">https://rt.cpan.org/NoAuth/Bugs.html?Dist=.</a></p>

</li>
<li><p>CPAN Ratings</p>

<p><a href="https://cpanratings.perl.org/d/.">https://cpanratings.perl.org/d/.</a></p>

</li>
<li><p>Search CPAN</p>

<p><a href="https://metacpan.org/release/.">https://metacpan.org/release/.</a></p>

</li>
</ul>

<h1 id="ACKNOWLEDGEMENTS">ACKNOWLEDGEMENTS</h1>

<p>Besiyata d&#39;shmaya</p>

<h1 id="LICENSE-AND-COPYRIGHT">LICENSE AND COPYRIGHT</h1>

<p>This software is Copyright (c) 2021 by Raphael Jong Jun Jie.</p>

<p>This is free software, licensed under:</p>



( run in 0.666 second using v1.01-cache-2.11-cpan-39bf76dae61 )