KiCad PCB EDA Suite
|
Progress dialog for PCM system. More...
#include <dialog_pcm_progress.h>
Public Member Functions | |
DIALOG_PCM_PROGRESS (wxWindow *parent, bool aShowDownloadSection=true) | |
Constructor. | |
void | PCMReport (const wxString &aText, SEVERITY aSeverity) |
Safe to call from non-UI thread. Sets the download progress of the current zip entry. | |
void | SetDownloadProgress (uint64_t aDownloaded, uint64_t aTotal) |
Safe to call from non-UI thread. Sets the download prgress of the current package. | |
void | SetPackageProgress (uint64_t aProgress, uint64_t aTotal) |
Safe to call from non-UI thread. Advances to the next package. | |
void | AdvancePhase () override |
Safe to call from non-UI thread. Disables cancel button, enables close button. | |
void | SetFinished () |
void | SetNumPhases (int aNumPhases) override |
Set the number of phases. | |
void | AddPhases (int aNumPhases) override |
virtual void | BeginPhase (int aPhase) override |
Initialize the aPhase virtual zone of the dialog progress bar. | |
virtual void | AdvancePhase (const wxString &aMessage) override |
Use the next available virtual zone of the dialog progress bar and updates the message. | |
virtual void | Report (const wxString &aMessage) override |
Display aMessage in the progress bar dialog. | |
virtual void | SetCurrentProgress (double aProgress) override |
Set the progress value to aProgress (0..1). | |
void | SetMaxProgress (int aMaxProgress) override |
Fix the value that gives the 100 percent progress bar length (inside the current virtual zone). | |
void | AdvanceProgress () override |
Increment the progress bar length (inside the current virtual zone). | |
bool | KeepRefreshing (bool aWait=false) override |
Update the UI dialog. | |
void | SetTitle (const wxString &aTitle) override |
Change the title displayed on the window caption. | |
bool | IsCancelled () const override |
int | CurrentProgress () const |
Protected Member Functions | |
void | OnCancelClicked (wxCommandEvent &event) override |
void | OnCloseClicked (wxCommandEvent &event) override |
Protected Attributes | |
wxPanel * | m_panelDownload |
wxStaticText * | m_downloadText |
wxGauge * | m_downloadGauge |
wxPanel * | m_panel2 |
wxGauge * | m_overallGauge |
WX_HTML_REPORT_BOX * | m_reporter |
wxButton * | m_buttonCancel |
wxButton * | m_buttonClose |
wxString | m_rptMessage |
std::mutex | m_mutex |
std::atomic_int | m_phase |
std::atomic_int | m_numPhases |
std::atomic_int | m_progress |
std::atomic_int | m_maxProgress |
std::atomic_bool | m_cancelled |
std::atomic_bool | m_messageChanged |
Private Member Functions | |
bool | updateUI () override |
Static Private Member Functions | |
static uint64_t | toKb (uint64_t aValue) |
Private Attributes | |
std::atomic_int64_t | m_downloaded |
std::atomic_int64_t | m_downloadTotal |
std::atomic_int64_t | m_currentProgress |
std::atomic_int64_t | m_currentProgressTotal |
std::atomic_bool | m_finished |
std::vector< std::pair< wxString, SEVERITY > > | m_reports |
wxWindowDisabler | m_disabler |
wxAppProgressIndicator | m_appProgressIndicator |
Progress dialog for PCM system.
This dialog is designed to work with PCM_TASK_MANAGER's threading system. Some of it's methods are safe to call from a non-UI thread.
Definition at line 38 of file dialog_pcm_progress.h.
DIALOG_PCM_PROGRESS::DIALOG_PCM_PROGRESS | ( | wxWindow * | parent, |
bool | aShowDownloadSection = true |
||
) |
Constructor.
Safe to call from non-UI thread. Adds a message to detailed report window.
Definition at line 27 of file dialog_pcm_progress.cpp.
References GAUGE_RANGE, m_appProgressIndicator, DIALOG_PCM_PROGRESS_BASE::m_downloadGauge, DIALOG_PCM_PROGRESS_BASE::m_overallGauge, DIALOG_PCM_PROGRESS_BASE::m_panelDownload, DIALOG_PCM_PROGRESS_BASE::m_reporter, and WX_HTML_REPORT_BOX::SetImmediateMode().
|
overridevirtualinherited |
Implements PROGRESS_REPORTER.
Definition at line 98 of file progress_reporter_base.cpp.
References PROGRESS_REPORTER_BASE::m_numPhases.
|
overridevirtual |
Safe to call from non-UI thread. Disables cancel button, enables close button.
Reimplemented from PROGRESS_REPORTER_BASE.
Definition at line 93 of file dialog_pcm_progress.cpp.
References PROGRESS_REPORTER_BASE::AdvancePhase(), and m_currentProgress.
|
overridevirtualinherited |
Use the next available virtual zone of the dialog progress bar and updates the message.
Implements PROGRESS_REPORTER.
Reimplemented in DIALOG_ERC, and DIALOG_DRC.
Definition at line 57 of file progress_reporter_base.cpp.
References PROGRESS_REPORTER_BASE::AdvancePhase(), and PROGRESS_REPORTER_BASE::Report().
|
overridevirtualinherited |
Increment the progress bar length (inside the current virtual zone).
Implements PROGRESS_REPORTER.
Definition at line 86 of file progress_reporter_base.cpp.
References PROGRESS_REPORTER_BASE::m_progress.
|
overridevirtualinherited |
Initialize the aPhase virtual zone of the dialog progress bar.
Implements PROGRESS_REPORTER.
Definition at line 43 of file progress_reporter_base.cpp.
References PROGRESS_REPORTER_BASE::m_phase, and PROGRESS_REPORTER_BASE::m_progress.
|
inherited |
Definition at line 104 of file progress_reporter_base.cpp.
References PROGRESS_REPORTER_BASE::m_maxProgress, PROGRESS_REPORTER_BASE::m_numPhases, PROGRESS_REPORTER_BASE::m_phase, and PROGRESS_REPORTER_BASE::m_progress.
Referenced by WX_PROGRESS_REPORTER::updateUI(), and GAUGE_PROGRESS_REPORTER::updateUI().
|
inlineoverridevirtualinherited |
Implements PROGRESS_REPORTER.
Definition at line 108 of file progress_reporter_base.h.
Referenced by SYMBOL_EDIT_FRAME::SYMBOL_EDIT_FRAME().
|
overridevirtualinherited |
Update the UI dialog.
Implements PROGRESS_REPORTER.
Definition at line 113 of file progress_reporter_base.cpp.
References PROGRESS_REPORTER_BASE::m_cancelled, PROGRESS_REPORTER_BASE::m_maxProgress, PROGRESS_REPORTER_BASE::m_progress, and PROGRESS_REPORTER_BASE::updateUI().
Referenced by PCB_EDIT_FRAME::GenIPC2581File(), and PCB_EDIT_FRAME::GenODBPPFiles().
|
overrideprotectedvirtual |
Reimplemented from DIALOG_PCM_PROGRESS_BASE.
Definition at line 49 of file dialog_pcm_progress.cpp.
References _, PROGRESS_REPORTER_BASE::m_cancelled, m_finished, DIALOG_PCM_PROGRESS_BASE::m_reporter, WX_HTML_REPORT_BOX::Report(), PROGRESS_REPORTER_BASE::SetNumPhases(), and SetPackageProgress().
|
overrideprotectedvirtual |
Reimplemented from DIALOG_PCM_PROGRESS_BASE.
Definition at line 60 of file dialog_pcm_progress.cpp.
References PROGRESS_REPORTER_BASE::m_maxProgress, and PROGRESS_REPORTER_BASE::m_progress.
void DIALOG_PCM_PROGRESS::PCMReport | ( | const wxString & | aText, |
SEVERITY | aSeverity | ||
) |
Safe to call from non-UI thread. Sets the download progress of the current zip entry.
Definition at line 66 of file dialog_pcm_progress.cpp.
References PROGRESS_REPORTER_BASE::m_mutex, and m_reports.
|
overridevirtualinherited |
Display aMessage in the progress bar dialog.
Implements PROGRESS_REPORTER.
Reimplemented in DIALOG_ERC, and BACKGROUND_JOB_REPORTER.
Definition at line 64 of file progress_reporter_base.cpp.
References PROGRESS_REPORTER_BASE::m_messageChanged, PROGRESS_REPORTER_BASE::m_mutex, and PROGRESS_REPORTER_BASE::m_rptMessage.
Referenced by PROGRESS_REPORTER_BASE::AdvancePhase().
|
overridevirtualinherited |
Set the progress value to aProgress (0..1).
Implements PROGRESS_REPORTER.
Reimplemented in CONSOLE_PROGRESS_REPORTER, and CONSOLE_PROGRESS_REPORTER.
Definition at line 79 of file progress_reporter_base.cpp.
References PROGRESS_REPORTER_BASE::m_maxProgress, and PROGRESS_REPORTER_BASE::m_progress.
Referenced by DIALOG_ERC::AdvancePhase(), DIALOG_DRC::AdvancePhase(), and CONSOLE_PROGRESS_REPORTER::SetCurrentProgress().
void DIALOG_PCM_PROGRESS::SetDownloadProgress | ( | uint64_t | aDownloaded, |
uint64_t | aTotal | ||
) |
Safe to call from non-UI thread. Sets the download prgress of the current package.
Definition at line 73 of file dialog_pcm_progress.cpp.
References m_downloaded, and m_downloadTotal.
void DIALOG_PCM_PROGRESS::SetFinished | ( | ) |
Definition at line 100 of file dialog_pcm_progress.cpp.
References m_finished.
|
overridevirtualinherited |
Fix the value that gives the 100 percent progress bar length (inside the current virtual zone).
Implements PROGRESS_REPORTER.
Definition at line 73 of file progress_reporter_base.cpp.
References PROGRESS_REPORTER_BASE::m_maxProgress.
|
overridevirtualinherited |
Set the number of phases.
Implements PROGRESS_REPORTER.
Definition at line 92 of file progress_reporter_base.cpp.
References PROGRESS_REPORTER_BASE::m_numPhases.
Referenced by OnCancelClicked(), and BACKGROUND_JOB_REPORTER::SetNumPhases().
void DIALOG_PCM_PROGRESS::SetPackageProgress | ( | uint64_t | aProgress, |
uint64_t | aTotal | ||
) |
Safe to call from non-UI thread. Advances to the next package.
Definition at line 86 of file dialog_pcm_progress.cpp.
References m_currentProgress, and m_currentProgressTotal.
Referenced by OnCancelClicked().
|
inlineoverridevirtualinherited |
Change the title displayed on the window caption.
Has meaning only for some reporters. Does nothing for others.
Implements PROGRESS_REPORTER.
Reimplemented in WX_PROGRESS_REPORTER.
Definition at line 106 of file progress_reporter_base.h.
|
staticprivate |
Definition at line 80 of file dialog_pcm_progress.cpp.
Referenced by updateUI().
|
overrideprivatevirtual |
Implements PROGRESS_REPORTER_BASE.
Definition at line 106 of file dialog_pcm_progress.cpp.
References _, GAUGE_RANGE, m_appProgressIndicator, DIALOG_PCM_PROGRESS_BASE::m_buttonCancel, DIALOG_PCM_PROGRESS_BASE::m_buttonClose, m_currentProgress, m_currentProgressTotal, m_downloaded, DIALOG_PCM_PROGRESS_BASE::m_downloadGauge, DIALOG_PCM_PROGRESS_BASE::m_downloadText, m_downloadTotal, m_finished, PROGRESS_REPORTER_BASE::m_mutex, PROGRESS_REPORTER_BASE::m_numPhases, DIALOG_PCM_PROGRESS_BASE::m_overallGauge, PROGRESS_REPORTER_BASE::m_phase, DIALOG_PCM_PROGRESS_BASE::m_reporter, m_reports, WX_HTML_REPORT_BOX::Report(), and toKb().
|
private |
Definition at line 82 of file dialog_pcm_progress.h.
Referenced by DIALOG_PCM_PROGRESS(), and updateUI().
|
protectedinherited |
Definition at line 48 of file dialog_pcm_progress_base.h.
Referenced by DIALOG_PCM_PROGRESS_BASE::DIALOG_PCM_PROGRESS_BASE(), updateUI(), and DIALOG_PCM_PROGRESS_BASE::~DIALOG_PCM_PROGRESS_BASE().
|
protectedinherited |
Definition at line 49 of file dialog_pcm_progress_base.h.
Referenced by DIALOG_PCM_PROGRESS_BASE::DIALOG_PCM_PROGRESS_BASE(), updateUI(), and DIALOG_PCM_PROGRESS_BASE::~DIALOG_PCM_PROGRESS_BASE().
|
protectedinherited |
Definition at line 123 of file progress_reporter_base.h.
Referenced by PROGRESS_REPORTER_BASE::KeepRefreshing(), DIALOG_DRC::OnCancelClick(), DIALOG_ERC::OnCancelClick(), OnCancelClicked(), DIALOG_DRC::OnRunDRCClick(), DIALOG_ERC::OnRunERCClick(), DIALOG_ERC::updateUI(), and DIALOG_DRC::updateUI().
|
private |
Definition at line 73 of file dialog_pcm_progress.h.
Referenced by AdvancePhase(), SetPackageProgress(), and updateUI().
|
private |
Definition at line 74 of file dialog_pcm_progress.h.
Referenced by SetPackageProgress(), and updateUI().
|
private |
Definition at line 80 of file dialog_pcm_progress.h.
|
private |
Definition at line 70 of file dialog_pcm_progress.h.
Referenced by SetDownloadProgress(), and updateUI().
|
protectedinherited |
Definition at line 44 of file dialog_pcm_progress_base.h.
Referenced by DIALOG_PCM_PROGRESS(), DIALOG_PCM_PROGRESS_BASE::DIALOG_PCM_PROGRESS_BASE(), and updateUI().
|
protectedinherited |
Definition at line 43 of file dialog_pcm_progress_base.h.
Referenced by DIALOG_PCM_PROGRESS_BASE::DIALOG_PCM_PROGRESS_BASE(), and updateUI().
|
private |
Definition at line 71 of file dialog_pcm_progress.h.
Referenced by SetDownloadProgress(), and updateUI().
|
private |
Definition at line 76 of file dialog_pcm_progress.h.
Referenced by OnCancelClicked(), SetFinished(), and updateUI().
|
protectedinherited |
Definition at line 122 of file progress_reporter_base.h.
Referenced by PROGRESS_REPORTER_BASE::CurrentProgress(), PROGRESS_REPORTER_BASE::KeepRefreshing(), OnCloseClicked(), PROGRESS_REPORTER_BASE::SetCurrentProgress(), PROGRESS_REPORTER_BASE::SetMaxProgress(), DIALOG_DRC::updateUI(), and CONSOLE_PROGRESS_REPORTER::updateUI().
|
protectedinherited |
Definition at line 129 of file progress_reporter_base.h.
Referenced by PROGRESS_REPORTER_BASE::Report(), and WX_PROGRESS_REPORTER::updateUI().
|
mutableprotectedinherited |
Definition at line 118 of file progress_reporter_base.h.
Referenced by PCMReport(), PROGRESS_REPORTER_BASE::Report(), WX_PROGRESS_REPORTER::updateUI(), and updateUI().
|
protectedinherited |
Definition at line 120 of file progress_reporter_base.h.
Referenced by PROGRESS_REPORTER_BASE::AddPhases(), PROGRESS_REPORTER_BASE::CurrentProgress(), BACKGROUND_JOB_REPORTER::SetNumPhases(), PROGRESS_REPORTER_BASE::SetNumPhases(), and updateUI().
|
protectedinherited |
Definition at line 46 of file dialog_pcm_progress_base.h.
Referenced by DIALOG_PCM_PROGRESS(), DIALOG_PCM_PROGRESS_BASE::DIALOG_PCM_PROGRESS_BASE(), and updateUI().
|
protectedinherited |
Definition at line 45 of file dialog_pcm_progress_base.h.
Referenced by DIALOG_PCM_PROGRESS_BASE::DIALOG_PCM_PROGRESS_BASE().
|
protectedinherited |
Definition at line 42 of file dialog_pcm_progress_base.h.
Referenced by DIALOG_PCM_PROGRESS(), and DIALOG_PCM_PROGRESS_BASE::DIALOG_PCM_PROGRESS_BASE().
|
protectedinherited |
Definition at line 119 of file progress_reporter_base.h.
Referenced by BACKGROUND_JOB_REPORTER::AdvancePhase(), PROGRESS_REPORTER_BASE::AdvancePhase(), PROGRESS_REPORTER_BASE::BeginPhase(), PROGRESS_REPORTER_BASE::CurrentProgress(), and updateUI().
|
protectedinherited |
Definition at line 121 of file progress_reporter_base.h.
Referenced by PROGRESS_REPORTER_BASE::AdvancePhase(), PROGRESS_REPORTER_BASE::AdvanceProgress(), PROGRESS_REPORTER_BASE::BeginPhase(), PROGRESS_REPORTER_BASE::CurrentProgress(), PROGRESS_REPORTER_BASE::KeepRefreshing(), OnCloseClicked(), PROGRESS_REPORTER_BASE::SetCurrentProgress(), DIALOG_DRC::updateUI(), and CONSOLE_PROGRESS_REPORTER::updateUI().
|
protectedinherited |
Definition at line 47 of file dialog_pcm_progress_base.h.
Referenced by DIALOG_PCM_PROGRESS(), DIALOG_PCM_PROGRESS_BASE::DIALOG_PCM_PROGRESS_BASE(), OnCancelClicked(), and updateUI().
|
private |
Definition at line 78 of file dialog_pcm_progress.h.
Referenced by PCMReport(), and updateUI().
|
protectedinherited |
Definition at line 116 of file progress_reporter_base.h.
Referenced by PROGRESS_REPORTER_BASE::Report(), WX_PROGRESS_REPORTER::updateUI(), and CONSOLE_PROGRESS_REPORTER::updateUI().