Add comments in progress_reporter.h; Remove unused parameter in Fill_All_Zones and remove empty file.

This commit is contained in:
jean-pierre charras 2018-01-16 09:57:53 +01:00
parent 495c4125f9
commit 433b2bff40
5 changed files with 45 additions and 7 deletions

View File

@ -37,12 +37,36 @@ class PROGRESS_REPORTER
PROGRESS_REPORTER( int aNumPhases );
PROGRESS_REPORTER( const PROGRESS_REPORTER& ) = delete;
/**
* initialize the aPhase virtual zone of the dialog progress bar
*/
void BeginPhase( int aPhase );
/**
* Uses the next vailable virtual zone of the dialog progress bar
*/
void AdvancePhase( );
/**
* Display aMessage in the progress bar dialog
*/
void Report ( const wxString& aMessage );
/**
* Fix the value thar gives the 100 precent progress bar length
* (inside the current virtual zone)
*/
void SetMaxProgress ( int aMaxProgress );
/**
* Increment the progress bar length (inside the current virtual zone)
*/
void AdvanceProgress( );
/**
* Update the UI dialog.
* This function is compatible with OPENMP use.
*/
void KeepRefreshing( bool aWait = false );
protected:
@ -57,10 +81,24 @@ class PROGRESS_REPORTER
int m_maxProgress;
};
/**
* This class implements a wxProgressDialog that can be used in a OPENMP environment
* (i.e. the progress bar update can be called from different theads).
* It is mainly used in Zone fill calculations
*/
class WX_PROGRESS_REPORTER : public PROGRESS_REPORTER, public wxProgressDialog
{
public:
/**
* Ctor: the PROGRESS_REPORTER will stay on top of aParent.
* the style is wxPD_AUTO_HIDE | wxPD_CAN_ABORT | wxPD_ELAPSED_TIME
* @param aParent is the wxDialog of Frame that manage this.
* @param aTitle is the dialog progress title
* @param aNumPhases is the number of "virtual sections" of the progress bar
* aNumPhases = 1 is the usual progress bar
* aNumPhases = n creates n virtual progress bar zones: a 0 to 100 percent width
* of a virtual zone fills 0 to 1/n progress bar full size of the nth virtual zone index
*/
WX_PROGRESS_REPORTER( wxWindow *aParent, const wxString &aTitle, int aNumPhases );
~WX_PROGRESS_REPORTER();

View File

@ -410,7 +410,7 @@ void DRC::RunTests( wxTextCtrl* aMessages )
// caller (a wxTopLevelFrame) is the wxDialog or the Pcb Editor frame that call DRC:
wxWindow* caller = aMessages ? aMessages->GetParent() : m_pcbEditorFrame;
m_pcbEditorFrame->Fill_All_Zones( caller, true );
m_pcbEditorFrame->Fill_All_Zones( caller );
// test zone clearances to other zones
if( aMessages )

View File

@ -1412,11 +1412,11 @@ public:
* Function Fill_All_Zones
* Fill all zones on the board
* The old fillings are removed
* @param aActiveWindow = the current active window, if a progress bar is shown
* = NULL to do not display a progress bar
* @param aVerbose = true to show error messages
* @param aActiveWindow = the current active window, if a progress bar is shown.
* the progress bar will be on top of aActiveWindow
* aActiveWindow = NULL to do not display a progress bar
*/
int Fill_All_Zones( wxWindow * aActiveWindow, bool aVerbose = true );
int Fill_All_Zones( wxWindow * aActiveWindow );
/**

View File

@ -90,7 +90,7 @@ void PCB_EDIT_FRAME::Delete_OldZone_Fill( SEGZONE* aZone, timestamp_t aTimestamp
}
}
int PCB_EDIT_FRAME::Fill_All_Zones( wxWindow * aActiveWindow, bool aVerbose )
int PCB_EDIT_FRAME::Fill_All_Zones( wxWindow * aActiveWindow )
{
wxBusyCursor dummy;