NAME
ProgressMonitor::Stringify::Field::Bar - a field implementation that renders progress as a bar.
SYNOPSIS
# call someTask and give it a monitor to call us back
#
my $bar = ProgressMonitor::Stringify::Fields::Bar->new;
someTask(ProgressMonitor::Stringify::ToStream->new({fields => [ $bar ]});
DESCRIPTION
This is a dynamic field representing progress as a bar typically of this form: "[###....]" etc. It will consume as much room as it can get unless limited by maxWidth.
It is very configurable in terms of what it prints. By default it will also do useful things to indicate 'idle' progress, i.e. either no ticks advanced, but still tick is called, or just 'unknown' work.
Inherits from ProgressMonitor::Stringify::Fields::AbstractDynamicField.
METHODS
- new( $hashRef )
-
Configuration data:
- emptyCharacter (default => '.')
-
The character that should be used to indicate an empty location in the bar.
- fillCharacter (default => '#')
-
The character that should be used to indicate a full location in the bar.
- leftWall (default => '[')
-
The string that should be used to indicate the left wall of the bar. This can be set to an empty string if you don't want a wall.
- rightWall (default => ']')
-
The string that should be used to indicate the right wall of the bar. This can be set to an empty string if you don't want a wall.
- idleTraveller (default => '==>')
-
The string that should be used as a moving piece in order to indicate progress for totals that are unknown.
- idleLeftSpace (default => 1)
-
Amount of characters that should be allocated to the left of the idleTraveller. This is necessary to insure that the idleTraveller has at least some room to travel in.
- idleLeftRight (default => 1)
-
Amount of characters that should be allocated to the right of the idleTraveller. This is necessary to insure that the idleTraveller has at least some room to travel in.
- idleSpinnerSequence (default => ['-', '\\', '|', '/'])
-
This should be a reference to a list of characters that should be used in sequence for ticks that doesn't advance the bar, but we still want to show that something is happening. If you do not wish this to happen at all, set to a single element list with the fillCharacter.
AUTHOR
Kenneth Olwing, <knth at cpan.org>
BUGS
I wouldn't be surprised! If you can come up with a minimal test that shows the problem I might be able to take a look. Even better, send me a patch.
Please report any bugs or feature requests to bug-progressmonitor at rt.cpan.org
, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=ProgressMonitor. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
SUPPORT
You can find general documentation for this module with the perldoc command:
perldoc ProgressMonitor
ACKNOWLEDGEMENTS
Thanks to my family. I'm deeply grateful for you!
COPYRIGHT & LICENSE
Copyright 2006,2007 Kenneth Olwing, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.