forbear_bar_object
Source: src/lib/forbear_bar_object.F90
Dependencies
Contents
- token_object
- field_entry
- bar_object
- isatty
- destroy
- initialize
- start
- update
- suspend
- resume
- finish
- write_message
- draw_progress
- build_frame
- measure
- add_field
- add_token
- default_layout
- parse_template
- parse_zones
- parse_trail
- resolve_fields
- complete
- draw
- update_rate
- create_spinner
- template_error
- zones_error
- is_stdout_locked
- bar_body
- cell_zone
- lit_cells
- numeral
- scanner_body
- unlit_cells
- progress_state
- width_before_bar
- compact_real
- count_text
- done_text
- pick
- pulse_phase
- ramp_level
- display_width
- styled
- token_kind
- duration
- get_environment
- hms
- is_terminal
- render
Variables
| Name | Type | Attributes | Description |
|---|---|---|---|
ESC | character(len=1) | parameter | |
CR | character(len=1) | parameter | |
LF | character(len=1) | parameter | |
FULL_BLOCK | character(len=*) | parameter | |
PARTIAL_BLOCKS | character(len=*) | parameter | |
SEGMENT_DIGITS | character(len=*) | parameter | |
RAMP_BLOCKS | character(len=*) | parameter | |
PROFILE_FLAT | integer(kind=I4P) | parameter | |
PROFILE_RAMP | integer(kind=I4P) | parameter | |
TOKEN_TEXT | integer(kind=I4P) | parameter | |
TOKEN_BAR | integer(kind=I4P) | parameter | |
TOKEN_SPINNER | integer(kind=I4P) | parameter | |
TOKEN_PERCENT | integer(kind=I4P) | parameter | |
TOKEN_COUNT | integer(kind=I4P) | parameter | |
TOKEN_SPEED | integer(kind=I4P) | parameter | |
TOKEN_ETA | integer(kind=I4P) | parameter | |
TOKEN_ELAPSED | integer(kind=I4P) | parameter | |
TOKEN_MESSAGE | integer(kind=I4P) | parameter | |
TOKEN_PREFIX | integer(kind=I4P) | parameter | |
TOKEN_SUFFIX | integer(kind=I4P) | parameter | |
TOKEN_FIELD | integer(kind=I4P) | parameter |
Derived Types
token_object
Components
| Name | Type | Attributes | Description |
|---|---|---|---|
kind | integer(kind=I4P) | ||
decorated | logical | ||
name | character(len=:) | allocatable | |
field | integer(kind=I4P) | ||
style | type(element_object) |
field_entry
Components
| Name | Type | Attributes | Description |
|---|---|---|---|
name | character(len=:) | allocatable | |
field | class(field_object) | allocatable |
bar_object
Components
| Name | Type | Attributes | Description |
|---|---|---|---|
prefix | type(element_object) | ||
suffix | type(element_object) | ||
bracket_left | type(element_object) | ||
bracket_right | type(element_object) | ||
empty_char | type(element_object) | ||
filled_char | type(element_object) | ||
progress_percent | type(element_object) | ||
progress_count | type(element_object) | ||
progress_speed | type(element_object) | ||
eta | type(element_object) | ||
message | type(element_object) | ||
scale_bar | type(element_object) | ||
date_time | type(element_object) | ||
summary | type(element_object) | ||
spinner | type(element_object) | allocatable | |
zone_limit | real(kind=R8P) | allocatable | |
zone_char | type(element_object) | allocatable | |
trail_char | type(element_object) | allocatable | |
width | integer(kind=I4P) | ||
min_value | real(kind=R8P) | ||
max_value | real(kind=R8P) | ||
frequency | integer(kind=I4P) | ||
min_interval | real(kind=R8P) | ||
log_interval | real(kind=R8P) | ||
smoothing | real(kind=R8P) | ||
position | integer(kind=I4P) | ||
add_scale_bar | logical | ||
add_progress_percent | logical | ||
add_progress_count | logical | ||
add_progress_speed | logical | ||
add_eta | logical | ||
add_date_time | logical | ||
add_summary | logical | ||
partial_blocks | logical | ||
profile | integer(kind=I4P) | ||
segment_digits | logical | ||
digits_unlit_color | character(len=:) | allocatable | |
indeterminate | logical | ||
is_interactive_ | logical | ||
is_disabled_ | logical | ||
hide_cursor | logical | ||
is_stdout_locked_ | logical | ||
output_unit | integer(kind=I4P) | ||
progress_drawn_ | integer(kind=I4P) | ||
fraction_drawn_ | real(kind=R8P) | ||
rate_ | real(kind=R8P) | ||
rate_samples_ | integer(kind=I4P) | ||
tic_ | integer(kind=I8P) | ||
tic_start_ | integer(kind=I8P) | ||
spinner_count_ | integer(kind=I4P) | ||
date_time_start_ | character(len=18) | ||
is_complete_ | logical | ||
current_ | real(kind=R8P) | ||
pulse_ | integer(kind=I4P) | ||
is_suspended_ | logical | ||
frame_ | character(kind=UCS4, len=:) | allocatable | |
tokens_ | type(token_object) | allocatable | |
fields_ | type(field_entry) | allocatable | |
has_template_ | logical | ||
template_ | character(len=:) | allocatable |
Type-Bound Procedures
| Name | Attributes | Description |
|---|---|---|
add_field | pass(self) | |
destroy | pass(self) | |
finish | pass(self) | |
initialize | pass(self) | |
is_stdout_locked | pass(self) | |
resume | pass(self) | |
start | pass(self) | |
suspend | pass(self) | |
update | pass(self) | |
write | pass(self) | |
add_token | pass(self) | |
bar_body | pass(self) | |
build_frame | pass(self) | |
cell_zone | pass(self) | |
lit_cells | pass(self) | |
unlit_cells | pass(self) | |
parse_zones | pass(self) | |
parse_trail | pass(self) | |
numeral | pass(self) | |
scanner_body | pass(self) | |
default_layout | pass(self) | |
parse_template | pass(self) | |
measure | pass(self) | |
progress_state | pass(self) | |
resolve_fields | pass(self) | |
width_before_bar | pass(self) | |
complete | pass(self) | |
create_spinner | pass(self) | |
draw | pass(self) | |
draw_progress | pass(self) | |
update_rate | pass(self) |
Interfaces
isatty
Subroutines
destroy
Attributes: pure
subroutine destroy(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(bar_object) | inout |
Call graph
initialize
subroutine initialize(self, prefix_string, prefix_color_fg, prefix_color_bg, prefix_style, suffix_string, suffix_color_fg, suffix_color_bg, suffix_style, bracket_left_string, bracket_left_color_fg, bracket_left_color_bg, bracket_left_style, bracket_right_string, bracket_right_color_fg, bracket_right_color_bg, bracket_right_style, empty_char_string, empty_char_color_fg, empty_char_color_bg, empty_char_style, filled_char_string, filled_char_color_fg, filled_char_color_bg, filled_char_style, spinner_string, spinner_color_fg, spinner_color_bg, spinner_style, add_scale_bar, scale_bar_color_fg, scale_bar_color_bg, scale_bar_style, add_progress_percent, progress_percent_color_fg, progress_percent_color_bg, progress_percent_style, add_progress_count, progress_count_color_fg, progress_count_color_bg, progress_count_style, add_progress_speed, progress_speed_color_fg, progress_speed_color_bg, progress_speed_style, add_eta, eta_color_fg, eta_color_bg, eta_style, add_date_time, date_time_color_fg, date_time_color_bg, date_time_style, add_summary, summary_color_fg, summary_color_bg, summary_style, message_color_fg, message_color_bg, message_style, width, min_value, max_value, frequency, min_interval, smoothing, partial_blocks, position, interactive, disabled, hide_cursor, template, indeterminate, log_interval, output_unit, bar_zones, bar_profile, pulse_trail, digits, digits_unlit_color, theme)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(bar_object) | inout | ||
prefix_string | class(*) | in | optional | |
prefix_color_fg | character(len=*) | in | optional | |
prefix_color_bg | character(len=*) | in | optional | |
prefix_style | character(len=*) | in | optional | |
suffix_string | class(*) | in | optional | |
suffix_color_fg | character(len=*) | in | optional | |
suffix_color_bg | character(len=*) | in | optional | |
suffix_style | character(len=*) | in | optional | |
bracket_left_string | class(*) | in | optional | |
bracket_left_color_fg | character(len=*) | in | optional | |
bracket_left_color_bg | character(len=*) | in | optional | |
bracket_left_style | character(len=*) | in | optional | |
bracket_right_string | class(*) | in | optional | |
bracket_right_color_fg | character(len=*) | in | optional | |
bracket_right_color_bg | character(len=*) | in | optional | |
bracket_right_style | character(len=*) | in | optional | |
empty_char_string | class(*) | in | optional | |
empty_char_color_fg | character(len=*) | in | optional | |
empty_char_color_bg | character(len=*) | in | optional | |
empty_char_style | character(len=*) | in | optional | |
filled_char_string | class(*) | in | optional | |
filled_char_color_fg | character(len=*) | in | optional | |
filled_char_color_bg | character(len=*) | in | optional | |
filled_char_style | character(len=*) | in | optional | |
spinner_string | class(*) | in | optional | |
spinner_color_fg | character(len=*) | in | optional | |
spinner_color_bg | character(len=*) | in | optional | |
spinner_style | character(len=*) | in | optional | |
add_scale_bar | logical | in | optional | |
scale_bar_color_fg | character(len=*) | in | optional | |
scale_bar_color_bg | character(len=*) | in | optional | |
scale_bar_style | character(len=*) | in | optional | |
add_progress_percent | logical | in | optional | |
progress_percent_color_fg | character(len=*) | in | optional | |
progress_percent_color_bg | character(len=*) | in | optional | |
progress_percent_style | character(len=*) | in | optional | |
add_progress_count | logical | in | optional | |
progress_count_color_fg | character(len=*) | in | optional | |
progress_count_color_bg | character(len=*) | in | optional | |
progress_count_style | character(len=*) | in | optional | |
add_progress_speed | logical | in | optional | |
progress_speed_color_fg | character(len=*) | in | optional | |
progress_speed_color_bg | character(len=*) | in | optional | |
progress_speed_style | character(len=*) | in | optional | |
add_eta | logical | in | optional | |
eta_color_fg | character(len=*) | in | optional | |
eta_color_bg | character(len=*) | in | optional | |
eta_style | character(len=*) | in | optional | |
add_date_time | logical | in | optional | |
date_time_color_fg | character(len=*) | in | optional | |
date_time_color_bg | character(len=*) | in | optional | |
date_time_style | character(len=*) | in | optional | |
add_summary | logical | in | optional | |
summary_color_fg | character(len=*) | in | optional | |
summary_color_bg | character(len=*) | in | optional | |
summary_style | character(len=*) | in | optional | |
message_color_fg | character(len=*) | in | optional | |
message_color_bg | character(len=*) | in | optional | |
message_style | character(len=*) | in | optional | |
width | integer(kind=I4P) | in | optional | |
min_value | real(kind=R8P) | in | optional | |
max_value | real(kind=R8P) | in | optional | |
frequency | integer(kind=I4P) | in | optional | |
min_interval | real(kind=R8P) | in | optional | |
smoothing | real(kind=R8P) | in | optional | |
partial_blocks | logical | in | optional | |
position | integer(kind=I4P) | in | optional | |
interactive | logical | in | optional | |
disabled | logical | in | optional | |
hide_cursor | logical | in | optional | |
template | character(len=*) | in | optional | |
indeterminate | logical | in | optional | |
log_interval | real(kind=R8P) | in | optional | |
output_unit | integer(kind=I4P) | in | optional | |
bar_zones | character(len=*) | in | optional | |
bar_profile | character(len=*) | in | optional | |
pulse_trail | character(len=*) | in | optional | |
digits | character(len=*) | in | optional | |
digits_unlit_color | character(len=*) | in | optional | |
theme | character(len=*) | in | optional |
Call graph
start
subroutine start(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(bar_object) | inout |
Call graph
update
subroutine update(self, current, message)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(bar_object) | inout | ||
current | real(kind=R8P) | in | ||
message | class(*) | in | optional |
Call graph
suspend
subroutine suspend(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(bar_object) | inout |
resume
subroutine resume(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(bar_object) | inout |
Call graph
finish
subroutine finish(self, message)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(bar_object) | inout | ||
message | class(*) | in | optional |
Call graph
write_message
subroutine write_message(self, message)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(bar_object) | inout | ||
message | class(*) | in |
Call graph
draw_progress
subroutine draw_progress(self, force)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(bar_object) | inout | ||
force | logical | in |
Call graph
build_frame
subroutine build_frame(self, progress, fraction, elapsed)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(bar_object) | inout | ||
progress | integer(kind=I4P) | in | ||
fraction | real(kind=R8P) | in | ||
elapsed | real(kind=R8P) | in |
Call graph
measure
Attributes: pure
subroutine measure(self, current, fraction, progress)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(bar_object) | in | ||
current | real(kind=R8P) | in | ||
fraction | real(kind=R8P) | out | ||
progress | integer(kind=I4P) | out |
Call graph
add_field
subroutine add_field(self, name, field)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(bar_object) | inout | ||
name | character(len=*) | in | ||
field | class(field_object) | in |
Call graph
add_token
subroutine add_token(self, kind, style, decorated, name)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(bar_object) | inout | ||
kind | integer(kind=I4P) | in | ||
style | type(element_object) | in | optional | |
decorated | logical | in | optional | |
name | character(len=*) | in | optional |
Call graph
default_layout
subroutine default_layout(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(bar_object) | inout |
Call graph
parse_template
subroutine parse_template(self, template)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(bar_object) | inout | ||
template | character(len=*) | in |
Call graph
parse_zones
subroutine parse_zones(self, zones)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(bar_object) | inout | ||
zones | character(len=*) | in |
Call graph
parse_trail
subroutine parse_trail(self, trail)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(bar_object) | inout | ||
trail | character(len=*) | in |
Call graph
resolve_fields
subroutine resolve_fields(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(bar_object) | inout |
Call graph
complete
subroutine complete(self, tic, count_rate)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(bar_object) | inout | ||
tic | integer(kind=I8P) | in | ||
count_rate | integer(kind=I8P) | in |
Call graph
draw
subroutine draw(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(bar_object) | inout |
Call graph
update_rate
subroutine update_rate(self, fraction, tic, count_rate)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(bar_object) | inout | ||
fraction | real(kind=R8P) | in | ||
tic | integer(kind=I8P) | in | ||
count_rate | integer(kind=I8P) | in |
Call graph
create_spinner
subroutine create_spinner(self, string, color_fg, color_bg, style)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(bar_object) | inout | ||
string | class(*) | in | optional | |
color_fg | character(len=*) | in | optional | |
color_bg | character(len=*) | in | optional | |
style | character(len=*) | in | optional |
Call graph
template_error
subroutine template_error(what, template)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
what | character(len=*) | in | ||
template | character(len=*) | in |
Call graph
zones_error
subroutine zones_error(what, zones)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
what | character(len=*) | in | ||
zones | character(len=*) | in |
Call graph
Functions
is_stdout_locked
Attributes: pure
Returns: logical
function is_stdout_locked(self) result(is_locked)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(bar_object) | in |
bar_body
Returns: character(kind=UCS4, len=:)
function bar_body(self, progress, fraction, plain) result(body)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(bar_object) | in | ||
progress | integer(kind=I4P) | in | ||
fraction | real(kind=R8P) | in | ||
plain | logical | in |
Call graph
cell_zone
Attributes: pure
Returns: integer(kind=I4P)
function cell_zone(self, cell) result(zone)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(bar_object) | in | ||
cell | integer(kind=I4P) | in |
Call graph
lit_cells
Attributes: pure
Returns: character(kind=UCS4, len=:)
function lit_cells(self, first, last, plain) result(cells)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(bar_object) | in | ||
first | integer(kind=I4P) | in | ||
last | integer(kind=I4P) | in | ||
plain | logical | in |
Call graph
numeral
Returns: character(kind=UCS4, len=:)
function numeral(self, token, text, plain) result(output)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(bar_object) | in | ||
token | type(token_object) | inout | ||
text | character(len=*) | in | ||
plain | logical | in |
Call graph
scanner_body
Attributes: pure
Returns: character(kind=UCS4, len=:)
function scanner_body(self, plain) result(body)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(bar_object) | in | ||
plain | logical | in |
Call graph
unlit_cells
Attributes: pure
Returns: character(kind=UCS4, len=:)
function unlit_cells(self, first, last, plain) result(cells)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(bar_object) | in | ||
first | integer(kind=I4P) | in | ||
last | integer(kind=I4P) | in | ||
plain | logical | in |
Call graph
progress_state
Returns: type(progress_object)
function progress_state(self, fraction, progress, elapsed) result(state)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(bar_object) | in | ||
fraction | real(kind=R8P) | in | ||
progress | integer(kind=I4P) | in | ||
elapsed | real(kind=R8P) | in |
Call graph
width_before_bar
Returns: integer(kind=I4P)
function width_before_bar(self) result(width)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(bar_object) | in |
Call graph
compact_real
Attributes: pure
Returns: character(len=w)
function compact_real(x, w) result(compact)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
x | real(kind=R8P) | in | ||
w | integer(kind=I4P) | in |
Call graph
count_text
Attributes: pure
Returns: character(len=:)
function count_text(min_value, max_value, fraction) result(text)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
min_value | real(kind=R8P) | in | ||
max_value | real(kind=R8P) | in | ||
fraction | real(kind=R8P) | in |
Call graph
done_text
Attributes: pure
Returns: character(len=:)
function done_text(min_value, done) result(text)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
min_value | real(kind=R8P) | in | ||
done | real(kind=R8P) | in |
Call graph
pick
Attributes: pure
Returns: character(len=:)
function pick(value, default) result(chosen)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
value | character(len=*) | in | optional | |
default | character(len=*) | in |
Call graph
pulse_phase
Attributes: pure
Returns: integer(kind=I4P)
function pulse_phase(drawing, travel) result(phase)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
drawing | integer(kind=I4P) | in | ||
travel | integer(kind=I4P) | in |
Call graph
ramp_level
Attributes: pure
Returns: integer(kind=I4P)
function ramp_level(cell, width) result(level)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
cell | integer(kind=I4P) | in | ||
width | integer(kind=I4P) | in |
Call graph
display_width
Attributes: pure
Returns: integer(kind=I4P)
function display_width(string) result(width)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
string | character(kind=UCS4, len=*) | in |
Call graph
styled
Returns: character(kind=UCS4, len=:)
function styled(token, text, plain) result(output)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
token | type(token_object) | inout | ||
text | character(len=*) | in | ||
plain | logical | in |
Call graph
token_kind
Attributes: pure
Returns: integer(kind=I4P)
function token_kind(name) result(kind)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
name | character(len=*) | in |
Call graph
duration
Attributes: pure
Returns: character(len=:)
function duration(seconds) result(text)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
seconds | real(kind=R8P) | in |
Call graph
get_environment
Returns: logical
function get_environment(name, value) result(is_set)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
name | character(len=*) | in | ||
value | character(len=:) | out | allocatable |
Call graph
hms
Attributes: pure
Returns: character(len=8)
function hms(seconds) result(text)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
seconds | real(kind=R8P) | in |
Call graph
is_terminal
Returns: logical
function is_terminal(unit)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
unit | integer(kind=I4P) | in |
Call graph
render
Attributes: pure
Returns: character(kind=UCS4, len=:)
function render(element, plain) result(text)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
element | type(element_object) | in | ||
plain | logical | in |
Call graph