Progress bar class.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| logical, | public | :: | add_date_time | Add date and time. |
|||
| logical, | public | :: | add_progress_percent | Add progress in percent. |
|||
| logical, | public | :: | add_progress_speed | Add progress speed in percent. |
|||
| logical, | public | :: | add_scale_bar | Add scale to the bar. |
|||
| type(element_object), | public | :: | bracket_left | Left bracket surrounding the bar. |
|||
| type(element_object), | public | :: | bracket_right | Right bracket surrounding the bar. |
|||
| type(element_object), | public | :: | date_time | Date and time. |
|||
| type(element_object), | public | :: | empty_char | Characters used for empty bar. |
|||
| type(element_object), | public | :: | filled_char | Characters used for filled bar. |
|||
| integer(kind=I4P), | public | :: | frequency | Bar update frequency, in range |
|||
| logical, | public | :: | is_stdout_locked_ | Flag to store standard output status. |
|||
| real(kind=R8P), | public | :: | max_value | Maximum value. |
|||
| real(kind=R8P), | public | :: | min_value | Minimum value. |
|||
| type(element_object), | public | :: | prefix | Message prefixing the bar. |
|||
| type(element_object), | public | :: | progress_percent | Progress in percent. |
|||
| type(element_object), | public | :: | progress_speed | Progress speed in percent. |
|||
| type(element_object), | public | :: | scale_bar | Scale bar. |
|||
| type(element_object), | public, | allocatable | :: | spinner(:) | Spinner. |
||
| type(element_object), | public | :: | suffix | Message suffixing the bar. |
|||
| integer(kind=I4P), | public | :: | width | With of the bar. |
Operator =.
Initialize bar.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(bar_object), | intent(inout) | :: | lhs | Left hand side. |
||
| type(bar_object), | intent(in) | :: | rhs | Right hand side. |
Overload = operator.
Initialize bar.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(bar_object), | intent(inout) | :: | lhs | Left hand side. |
||
| type(bar_object), | intent(in) | :: | rhs | Right hand side. |
Create spinner.
Create spinner.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(bar_object), | intent(inout) | :: | self | Bar. |
||
| class(*), | intent(in), | optional | :: | string | Spinner char. |
|
| character(len=*), | intent(in), | optional | :: | color_fg | Spinner char foreground color. |
|
| character(len=*), | intent(in), | optional | :: | color_bg | Spinner char background color. |
|
| character(len=*), | intent(in), | optional | :: | style | Spinner char style. |
Destroy bar.
Destroy bar.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(bar_object), | intent(inout) | :: | self | Bar. |
Initialize bar.
Initialize bar.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(bar_object), | intent(inout) | :: | self | Bar. |
||
| class(*), | intent(in), | optional | :: | prefix_string | Prefix string. |
|
| character(len=*), | intent(in), | optional | :: | prefix_color_fg | Prefix foreground color. |
|
| character(len=*), | intent(in), | optional | :: | prefix_color_bg | Prefix background color. |
|
| character(len=*), | intent(in), | optional | :: | prefix_style | Prefix style. |
|
| class(*), | intent(in), | optional | :: | suffix_string | Suffix string. |
|
| character(len=*), | intent(in), | optional | :: | suffix_color_fg | Suffix foreground color. |
|
| character(len=*), | intent(in), | optional | :: | suffix_color_bg | Suffix background color. |
|
| character(len=*), | intent(in), | optional | :: | suffix_style | Suffix style. |
|
| class(*), | intent(in), | optional | :: | bracket_left_string | Left bracket string. |
|
| character(len=*), | intent(in), | optional | :: | bracket_left_color_fg | Left bracket foreground color. |
|
| character(len=*), | intent(in), | optional | :: | bracket_left_color_bg | Left bracket background color. |
|
| character(len=*), | intent(in), | optional | :: | bracket_left_style | Left bracket style. |
|
| class(*), | intent(in), | optional | :: | bracket_right_string | Right bracket string |
|
| character(len=*), | intent(in), | optional | :: | bracket_right_color_fg | Right bracket foreground color. |
|
| character(len=*), | intent(in), | optional | :: | bracket_right_color_bg | Right bracket background color. |
|
| character(len=*), | intent(in), | optional | :: | bracket_right_style | Right bracket style. |
|
| class(*), | intent(in), | optional | :: | empty_char_string | Empty char. |
|
| character(len=*), | intent(in), | optional | :: | empty_char_color_fg | Empty char foreground color. |
|
| character(len=*), | intent(in), | optional | :: | empty_char_color_bg | Empty char background color. |
|
| character(len=*), | intent(in), | optional | :: | empty_char_style | Empty char style. |
|
| class(*), | intent(in), | optional | :: | filled_char_string | Filled char. |
|
| character(len=*), | intent(in), | optional | :: | filled_char_color_fg | Filled char foreground color. |
|
| character(len=*), | intent(in), | optional | :: | filled_char_color_bg | Filled char background color. |
|
| character(len=*), | intent(in), | optional | :: | filled_char_style | Filled char style. |
|
| class(*), | intent(in), | optional | :: | spinner_string | Spinner char. |
|
| character(len=*), | intent(in), | optional | :: | spinner_color_fg | Spinner char foreground color. |
|
| character(len=*), | intent(in), | optional | :: | spinner_color_bg | Spinner char background color. |
|
| character(len=*), | intent(in), | optional | :: | spinner_style | Spinner char style. |
|
| logical, | intent(in), | optional | :: | add_scale_bar | Add scale to the bar. |
|
| character(len=*), | intent(in), | optional | :: | scale_bar_color_fg | Scale bar foreground color. |
|
| character(len=*), | intent(in), | optional | :: | scale_bar_color_bg | Scale bar background color. |
|
| character(len=*), | intent(in), | optional | :: | scale_bar_style | Scale bar style. |
|
| logical, | intent(in), | optional | :: | add_progress_percent | Add progress in percent. |
|
| character(len=*), | intent(in), | optional | :: | progress_percent_color_fg | Progress percent foreground color. |
|
| character(len=*), | intent(in), | optional | :: | progress_percent_color_bg | Progress percent background color. |
|
| character(len=*), | intent(in), | optional | :: | progress_percent_style | Progress percent style. |
|
| logical, | intent(in), | optional | :: | add_progress_speed | Add progress in percent. |
|
| character(len=*), | intent(in), | optional | :: | progress_speed_color_fg | Progress speed foreground color. |
|
| character(len=*), | intent(in), | optional | :: | progress_speed_color_bg | Progress speed background color. |
|
| character(len=*), | intent(in), | optional | :: | progress_speed_style | Progress speed style. |
|
| logical, | intent(in), | optional | :: | add_date_time | Add date and time. |
|
| character(len=*), | intent(in), | optional | :: | date_time_color_fg | Date and time foreground color. |
|
| character(len=*), | intent(in), | optional | :: | date_time_color_bg | Date and time background color. |
|
| character(len=*), | intent(in), | optional | :: | date_time_style | Date and time style. |
|
| integer(kind=I4P), | intent(in), | optional | :: | width | With of the bar. |
|
| real(kind=R8P), | intent(in), | optional | :: | min_value | Minimum value. |
|
| real(kind=R8P), | intent(in), | optional | :: | max_value | Maximum value. |
|
| integer(kind=I4P), | intent(in), | optional | :: | frequency | Bar update frequency, in range |
Return status of standard output unit.
Return status of standard output unit.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(bar_object), | intent(in) | :: | self | Bar. |
Standard output status.
Start bar.
Start bar.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(bar_object), | intent(inout) | :: | self | Bar. |
Update bar.
Update bar.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(bar_object), | intent(inout) | :: | self | Bar. |
||
| real(kind=R8P), | intent(in) | :: | current | Current value. |
type :: bar_object
!< Progress **bar** class.
type(element_object) :: prefix !< Message prefixing the bar.
type(element_object) :: suffix !< Message suffixing the bar.
type(element_object) :: bracket_left !< Left bracket surrounding the bar.
type(element_object) :: bracket_right !< Right bracket surrounding the bar.
type(element_object) :: empty_char !< Characters used for empty bar.
type(element_object) :: filled_char !< Characters used for filled bar.
type(element_object) :: progress_percent !< Progress in percent.
type(element_object) :: progress_speed !< Progress speed in percent.
type(element_object) :: scale_bar !< Scale bar.
type(element_object) :: date_time !< Date and time.
type(element_object), allocatable :: spinner(:) !< Spinner.
integer(I4P) :: width !< With of the bar.
real(R8P) :: min_value !< Minimum value.
real(R8P) :: max_value !< Maximum value.
integer(I4P) :: frequency !< Bar update frequency, in range `[1%,100%]`.
logical :: add_scale_bar !< Add scale to the bar.
logical :: add_progress_percent !< Add progress in percent.
logical :: add_progress_speed !< Add progress speed in percent.
logical :: add_date_time !< Add date and time.
logical :: is_stdout_locked_ !< Flag to store standard output status.
contains
! public methods
procedure, pass(self) :: destroy !< Destroy bar.
procedure, pass(self) :: initialize !< Initialize bar.
procedure, pass(self) :: is_stdout_locked !< Return status of standard output unit.
procedure, pass(self) :: start !< Start bar.
procedure, pass(self) :: update !< Update bar.
! public operators
generic :: assignment(=) => assign_bar !< Overload `=` operator.
! private methods
procedure, pass(lhs), private :: assign_bar !< Operator `=`.
procedure, pass(self), private :: create_spinner !< Create spinner.
endtype bar_object