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

#include <background_jobs_monitor.h>

Inheritance diagram for BACKGROUND_JOB_REPORTER:
PROGRESS_REPORTER_BASE PROGRESS_REPORTER

Public Member Functions

 BACKGROUND_JOB_REPORTER (BACKGROUND_JOBS_MONITOR *aMonitor, std::shared_ptr< BACKGROUND_JOB > aJob)
 
void SetTitle (const wxString &aTitle) override
 Change the title displayed on the window caption.
 
void Report (const wxString &aMessage) override
 Display aMessage in the progress bar dialog.
 
void Cancel ()
 
void AdvancePhase () override
 Use the next available virtual zone of the dialog progress bar.
 
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 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.
 
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

bool updateUI () override
 

Private Attributes

BACKGROUND_JOBS_MONITORm_monitor
 
std::shared_ptr< BACKGROUND_JOBm_job
 
wxString m_title
 
wxString m_report
 

Detailed Description

Definition at line 45 of file background_jobs_monitor.h.

Constructor & Destructor Documentation

◆ BACKGROUND_JOB_REPORTER()

BACKGROUND_JOB_REPORTER::BACKGROUND_JOB_REPORTER ( BACKGROUND_JOBS_MONITOR aMonitor,
std::shared_ptr< BACKGROUND_JOB aJob 
)

Definition at line 174 of file background_jobs_monitor.cpp.

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 PROGRESS_REPORTER_BASE::m_numPhases.

◆ AdvancePhase() [1/2]

void BACKGROUND_JOB_REPORTER::AdvancePhase ( )
overridevirtual

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

Reimplemented from PROGRESS_REPORTER_BASE.

Definition at line 204 of file background_jobs_monitor.cpp.

References PROGRESS_REPORTER_BASE::AdvancePhase(), BACKGROUND_JOBS_MONITOR::jobUpdated(), m_job, m_monitor, and PROGRESS_REPORTER_BASE::m_phase.

◆ 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_ERC, and DIALOG_DRC.

Definition at line 57 of file progress_reporter_base.cpp.

References PROGRESS_REPORTER_BASE::AdvancePhase(), and PROGRESS_REPORTER_BASE::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 PROGRESS_REPORTER_BASE::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 PROGRESS_REPORTER_BASE::m_phase, and PROGRESS_REPORTER_BASE::m_progress.

◆ Cancel()

void BACKGROUND_JOB_REPORTER::Cancel ( )
inline

Definition at line 57 of file background_jobs_monitor.h.

◆ CurrentProgress()

◆ IsCancelled()

bool PROGRESS_REPORTER_BASE::IsCancelled ( ) const
inlineoverridevirtualinherited

Implements PROGRESS_REPORTER.

Definition at line 108 of file progress_reporter_base.h.

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 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().

◆ Report()

void BACKGROUND_JOB_REPORTER::Report ( const wxString &  aMessage)
overridevirtual

Display aMessage in the progress bar dialog.

Reimplemented from PROGRESS_REPORTER_BASE.

Definition at line 189 of file background_jobs_monitor.cpp.

References BACKGROUND_JOBS_MONITOR::jobUpdated(), m_job, and m_monitor.

◆ SetCurrentProgress()

void PROGRESS_REPORTER_BASE::SetCurrentProgress ( double  aProgress)
overridevirtualinherited

◆ 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 PROGRESS_REPORTER_BASE::m_maxProgress.

◆ SetNumPhases()

void BACKGROUND_JOB_REPORTER::SetNumPhases ( int  aNumPhases)
overridevirtual

◆ SetTitle()

void BACKGROUND_JOB_REPORTER::SetTitle ( const wxString &  aTitle)
inlineoverridevirtual

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.

Definition at line 51 of file background_jobs_monitor.h.

◆ updateUI()

bool BACKGROUND_JOB_REPORTER::updateUI ( )
overrideprivatevirtual

Implements PROGRESS_REPORTER_BASE.

Definition at line 183 of file background_jobs_monitor.cpp.

Member Data Documentation

◆ m_cancelled

◆ m_job

std::shared_ptr<BACKGROUND_JOB> BACKGROUND_JOB_REPORTER::m_job
private

Definition at line 67 of file background_jobs_monitor.h.

Referenced by AdvancePhase(), Report(), and SetNumPhases().

◆ m_maxProgress

◆ m_messageChanged

std::atomic_bool PROGRESS_REPORTER_BASE::m_messageChanged
protectedinherited

◆ m_monitor

BACKGROUND_JOBS_MONITOR* BACKGROUND_JOB_REPORTER::m_monitor
private

Definition at line 66 of file background_jobs_monitor.h.

Referenced by AdvancePhase(), Report(), and SetNumPhases().

◆ 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_report

wxString BACKGROUND_JOB_REPORTER::m_report
private

Definition at line 69 of file background_jobs_monitor.h.

◆ m_rptMessage

wxString PROGRESS_REPORTER_BASE::m_rptMessage
protectedinherited

◆ m_title

wxString BACKGROUND_JOB_REPORTER::m_title
private

Definition at line 68 of file background_jobs_monitor.h.


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