KiCad PCB EDA Suite
Loading...
Searching...
No Matches
CONSOLE_PROGRESS_REPORTER Class Reference

#include <console_log.h>

Inheritance diagram for CONSOLE_PROGRESS_REPORTER:
PROGRESS_REPORTER_BASE PROGRESS_REPORTER_BASE PROGRESS_REPORTER PROGRESS_REPORTER

Public Member Functions

 CONSOLE_PROGRESS_REPORTER (CONSOLE_LOG *log)
 
 ~CONSOLE_PROGRESS_REPORTER ()
 
virtual void SetCurrentProgress (double aProgress) override
 Set the progress value to aProgress (0..1).
 
 CONSOLE_PROGRESS_REPORTER (CONSOLE_LOG *log)
 
 ~CONSOLE_PROGRESS_REPORTER ()
 
virtual void SetCurrentProgress (double aProgress) override
 Set the progress value to aProgress (0..1).
 
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 () override
 Use the next available 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.
 
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 Attributes

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

virtual bool updateUI () override
 
virtual bool updateUI () override
 

Private Attributes

CONSOLE_LOGm_log
 

Detailed Description

Definition at line 95 of file console_log.h.

Constructor & Destructor Documentation

◆ CONSOLE_PROGRESS_REPORTER() [1/2]

CONSOLE_PROGRESS_REPORTER::CONSOLE_PROGRESS_REPORTER ( CONSOLE_LOG * log)
inline

Definition at line 98 of file console_log.h.

References m_log, and PROGRESS_REPORTER_BASE::PROGRESS_REPORTER_BASE().

◆ ~CONSOLE_PROGRESS_REPORTER() [1/2]

CONSOLE_PROGRESS_REPORTER::~CONSOLE_PROGRESS_REPORTER ( )
inline

Definition at line 101 of file console_log.h.

◆ CONSOLE_PROGRESS_REPORTER() [2/2]

CONSOLE_PROGRESS_REPORTER::CONSOLE_PROGRESS_REPORTER ( CONSOLE_LOG * log)
inline

Definition at line 100 of file drc_proto.h.

References m_log, and PROGRESS_REPORTER_BASE::PROGRESS_REPORTER_BASE().

◆ ~CONSOLE_PROGRESS_REPORTER() [2/2]

CONSOLE_PROGRESS_REPORTER::~CONSOLE_PROGRESS_REPORTER ( )
inline

Definition at line 103 of file drc_proto.h.

Member Function Documentation

◆ AddPhases()

void PROGRESS_REPORTER_BASE::AddPhases ( int aNumPhases)
overridevirtualinherited

Implements PROGRESS_REPORTER.

Definition at line 98 of file progress_reporter_base.cpp.

References m_numPhases.

◆ AdvancePhase() [1/2]

void PROGRESS_REPORTER_BASE::AdvancePhase ( )
overridevirtualinherited

Use the next available virtual zone of the dialog progress bar.

Implements PROGRESS_REPORTER.

Reimplemented in BACKGROUND_JOB_REPORTER, DIALOG_PCM_PROGRESS, and JOBS_PROGRESS_REPORTER.

Definition at line 50 of file progress_reporter_base.cpp.

References m_phase, and m_progress.

Referenced by BACKGROUND_JOB_REPORTER::AdvancePhase(), DIALOG_DRC::AdvancePhase(), DIALOG_ERC::AdvancePhase(), DIALOG_PCM_PROGRESS::AdvancePhase(), and AdvancePhase().

◆ AdvancePhase() [2/2]

void PROGRESS_REPORTER_BASE::AdvancePhase ( const wxString & aMessage)
overridevirtualinherited

Use the next available virtual zone of the dialog progress bar and updates the message.

Implements PROGRESS_REPORTER.

Reimplemented in DIALOG_DRC, and DIALOG_ERC.

Definition at line 57 of file progress_reporter_base.cpp.

References AdvancePhase(), and Report().

◆ AdvanceProgress()

void PROGRESS_REPORTER_BASE::AdvanceProgress ( )
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 m_progress.

◆ BeginPhase()

void PROGRESS_REPORTER_BASE::BeginPhase ( int aPhase)
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 m_phase, and m_progress.

◆ CurrentProgress()

int PROGRESS_REPORTER_BASE::CurrentProgress ( ) const
inherited

◆ IsCancelled()

bool PROGRESS_REPORTER_BASE::IsCancelled ( ) const
inlineoverridevirtualinherited

Implements PROGRESS_REPORTER.

Definition at line 108 of file progress_reporter_base.h.

References m_cancelled.

Referenced by SYMBOL_EDIT_FRAME::SYMBOL_EDIT_FRAME().

◆ KeepRefreshing()

bool PROGRESS_REPORTER_BASE::KeepRefreshing ( bool aWait = false)
overridevirtualinherited

Update the UI dialog.

Warning
This should only be called from the main thread.
Returns
false if the user clicked Cancel.

Implements PROGRESS_REPORTER.

Definition at line 113 of file progress_reporter_base.cpp.

References m_cancelled, m_maxProgress, m_progress, and updateUI().

Referenced by SCH_EDIT_FRAME::importFile(), and SCH_EDIT_FRAME::OpenProjectFiles().

◆ Report()

void PROGRESS_REPORTER_BASE::Report ( const wxString & aMessage)
overridevirtualinherited

Display aMessage in the progress bar dialog.

Implements PROGRESS_REPORTER.

Reimplemented in BACKGROUND_JOB_REPORTER, DIALOG_ERC, and JOBS_PROGRESS_REPORTER.

Definition at line 64 of file progress_reporter_base.cpp.

References m_messageChanged, m_mutex, and m_rptMessage.

Referenced by AdvancePhase(), SCH_EDIT_FRAME::importFile(), and SCH_EDIT_FRAME::OpenProjectFiles().

◆ SetCurrentProgress() [1/2]

virtual void CONSOLE_PROGRESS_REPORTER::SetCurrentProgress ( double aProgress)
inlineoverridevirtual

Set the progress value to aProgress (0..1).

Reimplemented from PROGRESS_REPORTER_BASE.

Definition at line 103 of file console_log.h.

References PROGRESS_REPORTER_BASE::SetCurrentProgress(), and updateUI().

◆ SetCurrentProgress() [2/2]

virtual void CONSOLE_PROGRESS_REPORTER::SetCurrentProgress ( double aProgress)
inlineoverridevirtual

Set the progress value to aProgress (0..1).

Reimplemented from PROGRESS_REPORTER_BASE.

Definition at line 105 of file drc_proto.h.

References PROGRESS_REPORTER_BASE::SetCurrentProgress(), and updateUI().

◆ SetMaxProgress()

void PROGRESS_REPORTER_BASE::SetMaxProgress ( int aMaxProgress)
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 m_maxProgress.

◆ SetNumPhases()

void PROGRESS_REPORTER_BASE::SetNumPhases ( int aNumPhases)
overridevirtualinherited

Set the number of phases.

Implements PROGRESS_REPORTER.

Definition at line 92 of file progress_reporter_base.cpp.

References m_numPhases.

Referenced by DIALOG_PCM_PROGRESS::OnCancelClicked(), and BACKGROUND_JOB_REPORTER::SetNumPhases().

◆ SetTitle()

void PROGRESS_REPORTER_BASE::SetTitle ( const wxString & aTitle)
inlineoverridevirtualinherited

Change the title displayed on the window caption.

Has meaning only for some reporters. Does nothing for others.

Warning
This should only be called from the main thread.

Implements PROGRESS_REPORTER.

Reimplemented in WX_PROGRESS_REPORTER.

Definition at line 106 of file progress_reporter_base.h.

◆ updateUI() [1/2]

virtual bool CONSOLE_PROGRESS_REPORTER::updateUI ( )
inlineoverrideprivatevirtual

◆ updateUI() [2/2]

virtual bool CONSOLE_PROGRESS_REPORTER::updateUI ( )
inlineoverrideprivatevirtual

Member Data Documentation

◆ m_cancelled

◆ m_log

CONSOLE_LOG * CONSOLE_PROGRESS_REPORTER::m_log
private

Definition at line 120 of file console_log.h.

Referenced by CONSOLE_PROGRESS_REPORTER(), and updateUI().

◆ m_maxProgress

◆ m_messageChanged

std::atomic_bool PROGRESS_REPORTER_BASE::m_messageChanged
protectedinherited

◆ m_mutex

std::mutex PROGRESS_REPORTER_BASE::m_mutex
mutableprotectedinherited

◆ m_numPhases

std::atomic_int PROGRESS_REPORTER_BASE::m_numPhases
protectedinherited

◆ m_phase

std::atomic_int PROGRESS_REPORTER_BASE::m_phase
protectedinherited

◆ m_progress

◆ m_rptMessage

wxString PROGRESS_REPORTER_BASE::m_rptMessage
protectedinherited

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