SedSat3 1.1.6
Sediment Source Apportionment Tool - Advanced statistical methods for environmental pollution research
Loading...
Searching...
No Matches
ProgressWindow Class Reference

Graphical ProgressReporter that draws progress as charts in a dialog. More...

#include </home/runner/work/SedSat3/SedSat3/ProgressWindow.h>

Inheritance diagram for ProgressWindow:
Inheritance graph
Collaboration diagram for ProgressWindow:
Collaboration graph

Public Member Functions

 ProgressWindow (QWidget *parent=Q_NULLPTR, int number_of_panels=1, bool extra_label_and_progressbar=false)
 ~ProgressWindow ()
void AppendPoint (const double &x, const double &y, int chart=0) override
 Adds a point to one of the progress charts.
void SetProgress (const double &prog) override
 Sets the primary progress fraction.
void SetProgress2 (const double &prog) override
 Sets the secondary progress fraction, where one is displayed.
void SetLabel (const QString &label) override
 Sets the free-text status label.
void SetYRange (const double &y0, const double &y1, int chart=0) override
 Sets the vertical range of a chart.
void SetXRange (const double &x0, const double &x1, int chart=0) override
 Sets the horizontal range of a chart.
void SetTitle (const QString &title, int chart=0) override
 Sets the title of a chart.
void SetXAxisTitle (const QString &title, int chart=0) override
 Sets the horizontal axis title of a chart.
void SetYAxisTitle (const QString &title, int chart=0) override
 Sets the vertical axis title of a chart.
void ClearGraph (int chart=0) override
 Discards the points accumulated in a chart.
void SetChartTitle (int i, const QString &title) override
 Sets the title of chart i.
void Start () override
 Shows the dialog. Named Start() because QWidget::show() is not virtual.
void Finish () override
 Closes the dialog. Named Finish() because QWidget::close() is not virtual.
Public Member Functions inherited from ProgressReporter
virtual ~ProgressReporter ()=default

Private Member Functions

bool HasChart (int chart) const
 True if chart is one of this window's chart panels.

Private Attributes

Ui::ProgressWindow ui {}
QVector< ChartCollection > ChartItems
QVector< QString > charttitles

Detailed Description

Graphical ProgressReporter that draws progress as charts in a dialog.

QDialog is listed first because Qt requires the QObject-derived base to come first in the base list of a class using Q_OBJECT.

Definition at line 39 of file ProgressWindow.h.

Constructor & Destructor Documentation

◆ ProgressWindow()

ProgressWindow::ProgressWindow ( QWidget * parent = Q_NULLPTR,
int number_of_panels = 1,
bool extra_label_and_progressbar = false )

Definition at line 8 of file ProgressWindow.cpp.

References ChartItems, charttitles, and ui.

◆ ~ProgressWindow()

ProgressWindow::~ProgressWindow ( )

Definition at line 77 of file ProgressWindow.cpp.

Member Function Documentation

◆ AppendPoint()

void ProgressWindow::AppendPoint ( const double & x,
const double & y,
int chart = 0 )
overridevirtual

Adds a point to one of the progress charts.

Parameters
xHorizontal coordinate, typically an iteration or generation number
yVertical coordinate, typically a fitness or likelihood value
chartIndex of the chart to append to

Implements ProgressReporter.

Definition at line 81 of file ProgressWindow.cpp.

References ChartItems, HasChart(), x, and y.

◆ ClearGraph()

void ProgressWindow::ClearGraph ( int chart = 0)
overridevirtual

Discards the points accumulated in a chart.

Implements ProgressReporter.

Definition at line 103 of file ProgressWindow.cpp.

References ChartItems, and HasChart().

◆ Finish()

void ProgressWindow::Finish ( )
inlineoverridevirtual

Closes the dialog. Named Finish() because QWidget::close() is not virtual.

Reimplemented from ProgressReporter.

Definition at line 68 of file ProgressWindow.h.

◆ HasChart()

bool ProgressWindow::HasChart ( int chart) const
private

True if chart is one of this window's chart panels.

Definition at line 63 of file ProgressWindow.cpp.

References ChartItems.

Referenced by AppendPoint(), ClearGraph(), SetTitle(), SetXAxisTitle(), SetXRange(), SetYAxisTitle(), and SetYRange().

◆ SetChartTitle()

void ProgressWindow::SetChartTitle ( int i,
const QString & title )
inlineoverridevirtual

Sets the title of chart i.

Implements ProgressReporter.

Definition at line 56 of file ProgressWindow.h.

References ChartItems, and charttitles.

◆ SetLabel()

void ProgressWindow::SetLabel ( const QString & label)
overridevirtual

Sets the free-text status label.

Implements ProgressReporter.

Definition at line 122 of file ProgressWindow.cpp.

References ui.

◆ SetProgress()

void ProgressWindow::SetProgress ( const double & prog)
overridevirtual

Sets the primary progress fraction.

Parameters
progProgress in the range [0,1]

Implements ProgressReporter.

Definition at line 110 of file ProgressWindow.cpp.

References ui.

◆ SetProgress2()

void ProgressWindow::SetProgress2 ( const double & prog)
overridevirtual

Sets the secondary progress fraction, where one is displayed.

Parameters
progProgress in the range [0,1]

Implements ProgressReporter.

Definition at line 116 of file ProgressWindow.cpp.

References ui.

◆ SetTitle()

void ProgressWindow::SetTitle ( const QString & title,
int chart = 0 )
overridevirtual

Sets the title of a chart.

Implements ProgressReporter.

Definition at line 70 of file ProgressWindow.cpp.

References ChartItems, and HasChart().

◆ SetXAxisTitle()

void ProgressWindow::SetXAxisTitle ( const QString & title,
int chart = 0 )
overridevirtual

Sets the horizontal axis title of a chart.

Implements ProgressReporter.

Definition at line 149 of file ProgressWindow.cpp.

References ChartItems, and HasChart().

◆ SetXRange()

void ProgressWindow::SetXRange ( const double & x0,
const double & x1,
int chart = 0 )
overridevirtual

Sets the horizontal range of a chart.

Implements ProgressReporter.

Definition at line 139 of file ProgressWindow.cpp.

References ChartItems, and HasChart().

◆ SetYAxisTitle()

void ProgressWindow::SetYAxisTitle ( const QString & title,
int chart = 0 )
overridevirtual

Sets the vertical axis title of a chart.

Implements ProgressReporter.

Definition at line 155 of file ProgressWindow.cpp.

References ChartItems, and HasChart().

◆ SetYRange()

void ProgressWindow::SetYRange ( const double & y0,
const double & y1,
int chart = 0 )
overridevirtual

Sets the vertical range of a chart.

Implements ProgressReporter.

Definition at line 129 of file ProgressWindow.cpp.

References ChartItems, and HasChart().

◆ Start()

void ProgressWindow::Start ( )
inlineoverridevirtual

Shows the dialog. Named Start() because QWidget::show() is not virtual.

Reimplemented from ProgressReporter.

Definition at line 65 of file ProgressWindow.h.

Member Data Documentation

◆ ChartItems

QVector<ChartCollection> ProgressWindow::ChartItems
private

◆ charttitles

QVector<QString> ProgressWindow::charttitles
private

Definition at line 74 of file ProgressWindow.h.

Referenced by ProgressWindow(), and SetChartTitle().

◆ ui

Ui::ProgressWindow ProgressWindow::ui {}
private

Definition at line 72 of file ProgressWindow.h.

Referenced by ProgressWindow(), SetLabel(), SetProgress(), and SetProgress2().


The documentation for this class was generated from the following files: