Gerbview: always search for the first available layer
This commit is contained in:
parent
9a0d4f5ba4
commit
2612b94519
|
@ -279,7 +279,7 @@ bool GERBVIEW_FRAME::LoadListOfGerberAndDrillFiles( const wxString& aPath,
|
|||
|
||||
|
||||
// Make sure we have a layer available to load into
|
||||
layer = getNextAvailableLayer( layer );
|
||||
layer = getNextAvailableLayer();
|
||||
|
||||
if( layer == NO_AVAILABLE_LAYERS )
|
||||
{
|
||||
|
@ -421,7 +421,7 @@ bool GERBVIEW_FRAME::LoadExcellonFiles( const wxString& aFullFileName )
|
|||
|
||||
m_lastFileName = filename.GetFullPath();
|
||||
|
||||
layer = getNextAvailableLayer( layer );
|
||||
layer = getNextAvailableLayer();
|
||||
|
||||
if( layer == NO_AVAILABLE_LAYERS )
|
||||
{
|
||||
|
@ -649,7 +649,7 @@ bool GERBVIEW_FRAME::unarchiveFiles( const wxString& aFullFileName, REPORTER* aR
|
|||
foundX2Gerbers = true;
|
||||
}
|
||||
|
||||
layer = getNextAvailableLayer( layer );
|
||||
layer = getNextAvailableLayer();
|
||||
SetActiveLayer( layer, false );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -450,21 +450,14 @@ void GERBVIEW_FRAME::ApplyDisplaySettingsToGAL()
|
|||
}
|
||||
|
||||
|
||||
int GERBVIEW_FRAME::getNextAvailableLayer( int aLayer ) const
|
||||
int GERBVIEW_FRAME::getNextAvailableLayer() const
|
||||
{
|
||||
int layer = aLayer;
|
||||
|
||||
for( unsigned i = 0; i < ImagesMaxCount(); ++i )
|
||||
{
|
||||
const GERBER_FILE_IMAGE* gerber = GetGbrImage( layer );
|
||||
const GERBER_FILE_IMAGE* gerber = GetGbrImage( i );
|
||||
|
||||
if( gerber == nullptr ) // this graphic layer is available: use it
|
||||
return layer;
|
||||
|
||||
++layer; // try next graphic layer
|
||||
|
||||
if( layer >= (int)ImagesMaxCount() )
|
||||
layer = 0;
|
||||
return i;
|
||||
}
|
||||
|
||||
return NO_AVAILABLE_LAYERS;
|
||||
|
|
|
@ -190,14 +190,13 @@ public:
|
|||
int GetActiveLayer() const { return m_activeLayer; }
|
||||
|
||||
/**
|
||||
* Find the next empty layer starting at \a aLayer and returns it to the caller.
|
||||
* Find the next empty layer.
|
||||
*
|
||||
* If no empty layers are found, #NO_AVAILABLE_LAYERS is return.
|
||||
*
|
||||
* @param aLayer The first layer to search.
|
||||
* @return The first empty layer found or #NO_AVAILABLE_LAYERS.
|
||||
*/
|
||||
int getNextAvailableLayer( int aLayer = 0 ) const;
|
||||
int getNextAvailableLayer() const;
|
||||
|
||||
/**
|
||||
* Update the currently "selected" layer within the #GERBER_LAYER_WIDGET.
|
||||
|
|
Loading…
Reference in New Issue