Did you know ... Search Documentation:
Packs (add-ons) for SWI-Prolog

Package "progress_bar"

Title:Progress-bar and spinner (text-based)
Rating:Not rated. Create the first rating!
Latest version:0.0.5
SHA1 sum:53541ed3c50ba003a2f62117e4cd322e0259eb76
Author:Jozef Geurts http://joostgeurts.com/
Home page:https://github.com/grsjst/progress_bar

Reviews

No reviews. Create the first review!.

Details by download location

VersionSHA1#DownloadsURL
0.0.553541ed3c50ba003a2f62117e4cd322e0259eb761https://github.com/grsjst/progress_bar.git

Progress-bar and spinner for SWIPL (progress_bar)

Progress-bar and spinner portray the progress of a user defined process for SWI-Prolog (https://www.swi-prolog.org/). Several options are availe to adapt the visual appearance of the progress-bar (see the pldoc documentation for details).

This is what the simple_progress_bar looks like

% [******************************************************************                                  ][71%]

and this is default_progress_bar

% default demo [=============================================>                                 ] 3.47 seconds

It is meant to be hooked to the prolog messageing system (see https://www.swi-prolog.org/pldoc/man?predicate=print_message/2).

Installation

pack_install(progress_bar).

Usage

In your SWIPL programme include the directive:

:- use_module(progress_bar).
prolog:message(demo(Msg)) --> Msg.

As an example, run the following query:

Total =  1000,
forall(
        between(1,Total,Index),
        print_message(informational,demo(simple_progress_bar(Index,Total)))).

Examples

In the file `examples\demo.pl` a number of demos are provided

:- ['./examples/demo.pl']. 	% loads the demo
:- demo_progress_bar.		% runs demo simple_progress_bar, default_progress_bar and fancy_progress_bar
:- demo_spinner.			% runs demo simple_spinner, default_spinner and fancy_spinner

Documentation

See the pldoc documentation for additional information

Files

progress_bar.pl - the progress_bar module
examples/demo.pl - a number of progress_bar and spinner examples

Contents of pack "progress_bar"

Pack contains 6 files holding a total of 22.1K bytes.