Commit 860fbb16 authored by dickelbeck's avatar dickelbeck

++pcbnew & gerbview

  * Moved ReturnLayerName() to static BOARD::GetDefaultLayerName() and migrated
    to a Specctra DSN compatible default layer naming scheme:
        Component becomes Front, Copper becomes Back.
  * set_color.h: Cmp becomes Front, Cu becomes Back.
  * D_PAD::DisplayInfo() changed to use actual copper layer names.
  * more layer setup dialog work, moved all programmatic wxControl instantiation
    into the wxFormbuilder environment, but this is fraught with danger:
    wxFlexGridSizer used the tallest control to establish the row heights, so
    be careful about changing control borders in the scroll panel. The vertical
    size can explode since just a couple of pixels times the number of rows
    is substantial.  Currently I am setting a 5 pixel border only left, top, and right
    but not bottom.
  * Set copper layer count is back in place as a hack until I can get the enabled
    layer bit map fully operational.
parent 5f9aefe8
......@@ -189,7 +189,7 @@ GLuint Pcb3D_GLCanvas::CreateDrawGL_List()
param = g_Parm_3D_Visu.m_LayerZcoord[15];
glFogfv( GL_FOG_END, &param );
glBegin( GL_QUADS );
SetGLColor( g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[CMP_N] );
SetGLColor( g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[LAYER_N_FRONT] );
double sx = DataScale3D * g_Parm_3D_Visu.m_BoardSize.x / 2;
double sy = DataScale3D * g_Parm_3D_Visu.m_BoardSize.y / 2;
double zpos = g_Parm_3D_Visu.m_LayerZcoord[15];
......@@ -201,7 +201,7 @@ GLuint Pcb3D_GLCanvas::CreateDrawGL_List()
glVertex3f( sx, -sy, zpos );
glEnd();
glBegin( GL_QUADS );
SetGLColor( g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[COPPER_LAYER_N] );
SetGLColor( g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[LAYER_N_BACK] );
glNormal3f( 0.0, 0.0, -1.0 ); // Normal is -Z axis
glVertex3f( -sx, -sy, 0 );
glVertex3f( -sx, sy, 0 );
......@@ -369,7 +369,7 @@ void Pcb3D_GLCanvas::Draw3D_Track( TRACK* track )
zpos = g_Parm_3D_Visu.m_LayerZcoord[layer];
SetGLColor( color );
glNormal3f( 0.0, 0.0, (layer == COPPER_LAYER_N) ? -1.0 : 1.0 );
glNormal3f( 0.0, 0.0, (layer == LAYER_N_BACK) ? -1.0 : 1.0 );
w = track->m_Width * g_Parm_3D_Visu.m_BoardScale;
ox = track->m_Start.x * g_Parm_3D_Visu.m_BoardScale;
......@@ -401,7 +401,7 @@ void Pcb3D_GLCanvas::Draw3D_SolidPolygonsInZones( ZONE_CONTAINER* zone_c )
SetGLColor( color );
glNormal3f( 0.0, 0.0, (layer == COPPER_LAYER_N) ? -1.0 : 1.0 );
glNormal3f( 0.0, 0.0, (layer == LAYER_N_BACK) ? -1.0 : 1.0 );
GLUtesselator* tess = gluNewTess();
gluTessCallback( tess, GLU_TESS_BEGIN, ( void (CALLBACK*)() )tessBeginCB );
......@@ -412,7 +412,7 @@ void Pcb3D_GLCanvas::Draw3D_SolidPolygonsInZones( ZONE_CONTAINER* zone_c )
GLdouble v_data[3];
//gluTessProperty(tess, GLU_TESS_WINDING_RULE, GLU_TESS_WINDING_NONZERO);
// Draw solid areas contained in this zone
int StartContour = 1;
for( unsigned ii = 0; ii < zone_c->m_FilledPolysList.size(); ii++ )
......@@ -471,17 +471,17 @@ void Pcb3D_GLCanvas::Draw3D_Via( SEGVIA* via )
}
else
{
if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( CMP_N ) ==
if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( LAYER_N_FRONT ) ==
false )
continue;
color = g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[CMP_N];
color = g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[LAYER_N_FRONT];
}
SetGLColor( color );
// SetGLColor( LIGHTGRAY );
glNormal3f( 0.0, 0.0, (layer == COPPER_LAYER_N) ? -1.0 : 1.0 );
if( layer == COPPER_LAYER_N )
glNormal3f( 0.0, 0.0, (layer == LAYER_N_BACK) ? -1.0 : 1.0 );
if( layer == LAYER_N_BACK )
zpos = zpos - 5 * g_Parm_3D_Visu.m_BoardScale;
else
zpos = zpos + 5 * g_Parm_3D_Visu.m_BoardScale;
......@@ -523,7 +523,7 @@ void Pcb3D_GLCanvas::Draw3D_DrawSegment( DRAWSEGMENT* segment )
{
for( layer = 0; layer < g_Parm_3D_Visu.m_Layers; layer++ )
{
glNormal3f( 0.0, 0.0, (layer == COPPER_LAYER_N) ? -1.0 : 1.0 );
glNormal3f( 0.0, 0.0, (layer == LAYER_N_BACK) ? -1.0 : 1.0 );
zpos = g_Parm_3D_Visu.m_LayerZcoord[layer];
switch( segment->m_Shape )
......@@ -645,12 +645,12 @@ void MODULE::Draw3D( Pcb3D_GLCanvas* glcanvas )
#if 0
if( !DisplayOpt.Show_Modules_Cmp )
{
if( m_Layer == CMP_N )
if( m_Layer == LAYER_N_FRONT )
return;
}
if( !DisplayOpt.Show_Modules_Cu )
{
if( m_Layer == COPPER_LAYER_N )
if( m_Layer == LAYER_N_BACK )
return;
}
#endif
......@@ -678,7 +678,7 @@ void MODULE::Draw3D( Pcb3D_GLCanvas* glcanvas )
{
glRotatef( (double) m_Orient / 10, 0.0, 0.0, 1.0 );
}
if( m_Layer == COPPER_LAYER_N )
if( m_Layer == LAYER_N_BACK )
{
glRotatef( 180.0, 0.0, 1.0, 0.0 );
glRotatef( 180.0, 0.0, 0.0, 1.0 );
......@@ -734,7 +734,7 @@ void EDGE_MODULE::Draw3D( Pcb3D_GLCanvas* glcanvas )
SetGLColor( color );
glNormal3f( 0.0, 0.0, (m_Layer == COPPER_LAYER_N) ? -1.0 : 1.0 );
glNormal3f( 0.0, 0.0, (m_Layer == LAYER_N_BACK) ? -1.0 : 1.0 );
scale = g_Parm_3D_Visu.m_BoardScale;
dx = m_End.x;
......@@ -812,7 +812,7 @@ void D_PAD::Draw3D( Pcb3D_GLCanvas* glcanvas )
{
SetGLColor( DARKGRAY );
Draw3D_FilledCylinder( drillx, -drilly, hole,
g_Parm_3D_Visu.m_LayerZcoord[CMP_N], 0.0 );
g_Parm_3D_Visu.m_LayerZcoord[LAYER_N_FRONT], 0.0 );
}
glNormal3f( 0.0, 0.0, 1.0 ); // Normal is Z axis
......@@ -830,10 +830,10 @@ void D_PAD::Draw3D( Pcb3D_GLCanvas* glcanvas )
for( layer = FIRST_COPPER_LAYER; layer <= LAST_COPPER_LAYER; layer++ )
{
if( layer && (layer == nlmax) )
layer = CMP_N;
if( (layer == CMP_N) && !Oncmp )
layer = LAYER_N_FRONT;
if( (layer == LAYER_N_FRONT) && !Oncmp )
continue;
if( (layer == COPPER_LAYER_N) && !Oncu )
if( (layer == LAYER_N_BACK) && !Oncu )
continue;
if( (layer > FIRST_COPPER_LAYER) && (layer < LAST_COPPER_LAYER)
&& !Both )
......@@ -844,9 +844,9 @@ void D_PAD::Draw3D( Pcb3D_GLCanvas* glcanvas )
continue;
SetGLColor( color );
glNormal3f( 0.0, 0.0, (layer == COPPER_LAYER_N) ? -1.0 : 1.0 );
glNormal3f( 0.0, 0.0, (layer == LAYER_N_BACK) ? -1.0 : 1.0 );
zpos = g_Parm_3D_Visu.m_LayerZcoord[layer];
if( layer == COPPER_LAYER_N )
if( layer == LAYER_N_BACK )
zpos = zpos - 5 * g_Parm_3D_Visu.m_BoardScale;
else
zpos = zpos + 5 * g_Parm_3D_Visu.m_BoardScale;
......@@ -882,23 +882,23 @@ void D_PAD::Draw3D( Pcb3D_GLCanvas* glcanvas )
layer++ )
{
if( layer && (layer == nlmax) )
layer = CMP_N;
if( (layer == CMP_N) && !Oncmp )
layer = LAYER_N_FRONT;
if( (layer == LAYER_N_FRONT) && !Oncmp )
continue;
if( (layer == COPPER_LAYER_N) && !Oncu )
if( (layer == LAYER_N_BACK) && !Oncu )
continue;
if( (layer > FIRST_COPPER_LAYER)
&& (layer < LAST_COPPER_LAYER) && !Both )
continue;
color = g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[layer];
glNormal3f( 0.0, 0.0, (layer == COPPER_LAYER_N) ? -1.0 : 1.0 );
glNormal3f( 0.0, 0.0, (layer == LAYER_N_BACK) ? -1.0 : 1.0 );
if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) ==
false )
continue;
SetGLColor( color );
zpos = g_Parm_3D_Visu.m_LayerZcoord[layer];
if( layer == COPPER_LAYER_N )
if( layer == LAYER_N_BACK )
zpos = zpos - 5 * g_Parm_3D_Visu.m_BoardScale;
else
zpos = zpos + 5 * g_Parm_3D_Visu.m_BoardScale;
......@@ -960,23 +960,23 @@ void D_PAD::Draw3D( Pcb3D_GLCanvas* glcanvas )
for( layer = FIRST_COPPER_LAYER; layer <= LAST_COPPER_LAYER; layer++ )
{
if( layer && (layer == nlmax) )
layer = CMP_N;
if( (layer == CMP_N) && !Oncmp )
layer = LAYER_N_FRONT;
if( (layer == LAYER_N_FRONT) && !Oncmp )
continue;
if( (layer == COPPER_LAYER_N) && !Oncu )
if( (layer == LAYER_N_BACK) && !Oncu )
continue;
if( (layer > FIRST_COPPER_LAYER) && (layer < LAST_COPPER_LAYER)
&& !Both )
continue;
color = g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[layer];
glNormal3f( 0.0, 0.0, (layer == COPPER_LAYER_N) ? -1.0 : 1.0 );
glNormal3f( 0.0, 0.0, (layer == LAYER_N_BACK) ? -1.0 : 1.0 );
if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) ==
false )
continue;
SetGLColor( color );
zpos = g_Parm_3D_Visu.m_LayerZcoord[layer];
if( layer == COPPER_LAYER_N )
if( layer == LAYER_N_BACK )
zpos = zpos - 5 * g_Parm_3D_Visu.m_BoardScale;
else
zpos = zpos + 5 * g_Parm_3D_Visu.m_BoardScale;
......
......@@ -4,6 +4,24 @@ KiCad ChangeLog 2009
Please add newer entries at the top, list the date and your name with
email address.
2009-Dec-6 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
++pcbnew & gerbview
* Moved ReturnLayerName() to static BOARD::GetDefaultLayerName() and migrated
to a Specctra DSN compatible default layer naming scheme:
Component becomes Front, Copper becomes Back.
* set_color.h: Cmp becomes Front, Cu becomes Back.
* D_PAD::DisplayInfo() changed to use actual copper layer names.
* more layer setup dialog work, moved all programmatic wxControl instantiation
into the wxFormbuilder environment, but this is fraught with danger:
wxFlexGridSizer used the tallest control to establish the row heights, so
be careful about changing control borders in the scroll panel. The vertical
size can explode since just a couple of pixels times the number of rows
is substantial. Currently I am setting a 5 pixel border only left, top, and right
but not bottom.
* Set copper layer count is back in place as a hack until I can get the enabled
layer bit map fully operational.
2009-Dec-3 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
......
......@@ -53,6 +53,8 @@ KiCad
PCBNew
------
* Fix DIALOG_PAD_PROPERTIES_BASE class to use actual layer names in the BOARD.
* Use BOARD_ITEM::MenuIcon() in the onrightclick.cpp
* Add unroute option in rightclick menu for components
* Document specctra round tripper, and fix the english translation of help.
......
......@@ -535,51 +535,6 @@ void MyFree( void* pt_mem )
free( pt_mem );
}
/*
* Return the name of the layer number "layer_number".
* if omitSpacePadding == TRUE, the name can be used for a file name
* (no spaces, replaced by _)
*/
wxString ReturnPcbLayerName( int layer_number, bool omitSpacePadding )
{
const unsigned LAYER_LIMIT = 29;
// These are only default layer names. For PCBNEW, the copper names
// may be over-ridden in the BOARD file *.brd.
static const wxString layer_name_list[] =
{
_( "Copper " ), _( "Inner L1 " ), _( "Inner L2 " ), _( "Inner L3 " ),
_( "Inner L4 " ), _( "Inner L5 " ), _( "Inner L6 " ), _( "Inner L7 " ),
_( "Inner L8 " ), _( "Inner L9 " ), _( "Inner L10" ), _( "Inner L11" ),
_( "Inner L12" ), _( "Inner L13" ), _( "Inner L14" ), _( "Component" ),
_( "Adhes Cop" ), _( "Adhes Cmp" ), _( "SoldP Cop" ), _( "SoldP Cmp" ),
_( "SilkS Cop" ), _( "SilkS Cmp" ), _( "Mask Cop " ), _( "Mask Cmp " ),
_( "Drawings " ), _( "Comments " ), _( "Eco1 " ), _( "Eco2 " ),
_( "Edges Pcb" ), _( "BAD INDEX" )
};
if( (unsigned) layer_number > LAYER_LIMIT )
layer_number = LAYER_LIMIT;
const wxString* p = &layer_name_list[layer_number];
if( omitSpacePadding )
{
wxString ret = *p; // copy the string
// modify the copy
ret.Trim();
ret.Replace( wxT( " " ), wxT( "_" ) );
return ret;
}
else
return *p;
}
enum textbox {
ID_TEXTBOX_LIST = 8010
};
......
......@@ -139,7 +139,7 @@ WinEDA_SwapLayerFrame::WinEDA_SwapLayerFrame( WinEDA_GerberFrame* parent ) :
if( (pcb_layer_number == g_DesignSettings.GetCopperLayerCount() - 1)
&& (g_DesignSettings.GetCopperLayerCount() > 1) )
pcb_layer_number = CMP_N;
pcb_layer_number = LAYER_N_FRONT;
ButtonTable[nb_items] = ii;
LayerLookUpTable[ii] = pcb_layer_number;
......@@ -259,17 +259,17 @@ WinEDA_SwapLayerFrame::WinEDA_SwapLayerFrame( WinEDA_GerberFrame* parent ) :
for( int jj = 0; jj < NB_LAYERS; jj++ )
{
text->SetLabel( ReturnPcbLayerName( jj ) );
text->SetLabel( BOARD::GetDefaultLayerName( jj ) );
if( goodSize.x < text->GetSize().x )
goodSize.x = text->GetSize().x;
}
msg = ReturnPcbLayerName( LayerLookUpTable[ButtonTable[ii]] );
msg = BOARD::GetDefaultLayerName( LayerLookUpTable[ButtonTable[ii]] );
text->SetLabel( msg );
}
else
{
msg = ReturnPcbLayerName( LayerLookUpTable[ButtonTable[ii]] );
msg = BOARD::GetDefaultLayerName( LayerLookUpTable[ButtonTable[ii]] );
text = new wxStaticText( this, item_ID, msg, wxDefaultPosition,
wxDefaultSize, 0 );
}
......@@ -356,7 +356,7 @@ void WinEDA_SwapLayerFrame::OnSelectLayer( wxCommandEvent& event )
}
else
{
layer_list[ii]->SetLabel( ReturnPcbLayerName( jj ) );
layer_list[ii]->SetLabel( BOARD::GetDefaultLayerName( jj ) );
// Change the text color to fuchsia (to highlight
// that this layer *is* being exported)
......@@ -383,7 +383,7 @@ void WinEDA_SwapLayerFrame::OnOkClick( wxCommandEvent& event )
int layers_count = 1;
for( ii = 0; ii < 32; ii++ )
{
if( LayerLookUpTable[ii] == CMP_N )
if( LayerLookUpTable[ii] == LAYER_N_FRONT )
AsCmpLayer = true;
else
{
......
......@@ -70,7 +70,7 @@ public:
* @param aLayerIndex = The index of the layer to be tested
* @return bool - true if the layer is visible.
*/
inline bool IsLayerVisible( int aLayerIndex ) const
bool IsLayerVisible( int aLayerIndex ) const
{
if( aLayerIndex < 0 || aLayerIndex >= 32 ) //@@IMB: Altough Pcbnew uses only 29, Gerbview uses all 32 layers
return false;
......@@ -93,7 +93,7 @@ public:
* returns a bit-mask of all the element categories that are visible
* @return int - the visible element categories in bit-mapped form.
*/
inline int GetVisibleElements() const
int GetVisibleElements() const
{
return m_VisibleElements;
}
......@@ -104,7 +104,7 @@ public:
* changes the bit-mask of visible element categories
* @param aMask = The new bit-mask of visible element categories
*/
inline void SetVisibleElements( int aMask )
void SetVisibleElements( int aMask )
{
m_VisibleElements = aMask;
}
......@@ -116,7 +116,7 @@ public:
* @param aCategoryIndex = The index of the element category to be tested.
* @return bool - true if the element is visible.
*/
inline bool IsElementVisible( int aCategoryIndex ) const
bool IsElementVisible( int aCategoryIndex ) const
{
if( aCategoryIndex < 0 || aCategoryIndex > PAD_CMP_VISIBLE )
return false;
......@@ -164,7 +164,7 @@ public:
* @param aLayerIndex = The index of the layer to be tested
* @return bool - true if the layer is enabled
*/
inline bool IsLayerEnabled( int aLayerIndex )
bool IsLayerEnabled( int aLayerIndex )
{
return (bool) ( m_EnabledLayers & 1 << aLayerIndex );
}
......@@ -174,7 +174,7 @@ public:
* Function GetCopperLayerCount
* @return int - the number of neabled copper layers
*/
inline int GetCopperLayerCount() const
int GetCopperLayerCount() const
{
return m_CopperLayerCount;
}
......
......@@ -257,17 +257,6 @@ bool ProcessExecute( const wxString& aCommandLine,
int aFlags = wxEXEC_ASYNC );
/**
* Function ReturnPcbLayerName
* @return a wxString containing the name of the layer number "layer_number".
* @param layer_number the layer number of the layer
* @param is_filename if TRUE, the name can be used for a file name (not
* internationalized, no space)
*/
wxString ReturnPcbLayerName( int layer_number,
bool is_filename = FALSE );
/*******************/
/* about_kicad.cpp */
/*******************/
......
This diff is collapsed.
......@@ -429,10 +429,10 @@ int WinEDA_PcbFrame::GenPlaceBoard()
msg.Printf( wxT( "%d" ), Board.m_MemSize / 1024 );
Affiche_1_Parametre( this, 24, wxT( "Mem(Kb)" ), msg, CYAN );
Route_Layer_BOTTOM = CMP_N;
Route_Layer_BOTTOM = LAYER_N_FRONT;
if( Nb_Sides == TWO_SIDES )
Route_Layer_BOTTOM = COPPER_LAYER_N;
Route_Layer_TOP = CMP_N;
Route_Layer_BOTTOM = LAYER_N_BACK;
Route_Layer_TOP = LAYER_N_FRONT;
/* Place the edge layer segments */
PtStruct = GetBoard()->m_Drawings;
......@@ -525,9 +525,9 @@ void WinEDA_PcbFrame::GenModuleOnBoard( MODULE* Module )
fy = GetBoard()->m_BoundaryBox.GetBottom();
masque_layer = 0;
if( Module->GetLayer() == CMP_N )
if( Module->GetLayer() == LAYER_N_FRONT )
masque_layer = CMP_LAYER;
if( Module->GetLayer() == COPPER_LAYER_N )
if( Module->GetLayer() == LAYER_N_BACK )
masque_layer = CUIVRE_LAYER;
TraceFilledRectangle( GetBoard(), ox, oy, fx, fy, masque_layer,
......@@ -603,7 +603,7 @@ int WinEDA_PcbFrame::RecherchePlacementModule( MODULE* Module, wxDC* DC )
{
D_PAD* Pad; int masque_otherlayer;
masque_otherlayer = CUIVRE_LAYER;
if( Module->GetLayer() == COPPER_LAYER_N )
if( Module->GetLayer() == LAYER_N_BACK )
masque_otherlayer = CMP_LAYER;
for( Pad = Module->m_Pads; Pad != NULL; Pad = Pad->Next() )
......@@ -810,7 +810,7 @@ int TstModuleOnBoard( BOARD* Pcb, MODULE* Module, bool TstOtherSide )
int error, Penalite, marge, side, otherside;
side = TOP; otherside = BOTTOM;
if( Module->GetLayer() == COPPER_LAYER_N )
if( Module->GetLayer() == LAYER_N_BACK )
{
side = BOTTOM; otherside = TOP;
}
......
......@@ -47,7 +47,7 @@ void WinEDA_PcbFrame::Autoroute( wxDC* DC, int mode )
else
{
Route_Layer_TOP =
Route_Layer_BOTTOM = COPPER_LAYER_N;
Route_Layer_BOTTOM = LAYER_N_BACK;
}
switch( mode )
......
......@@ -167,14 +167,14 @@ void WinEDA_BasePcbFrame::SwitchLayer( wxDC* DC, int layer )
// Copper layers cannot be selected unconditionally; how many
// of those layers are currently enabled needs to be checked.
if( (layer >= FIRST_COPPER_LAYER) && (layer <= LAST_COPPER_LAYER) )
if( IsValidCopperLayerIndex( layer ) )
{
// If only one copper layer is enabled, the only such layer
// that can be selected to is the "Copper" layer (so the
// selection of any other copper layer is disregarded).
if( m_Pcb->m_BoardSettings->GetCopperLayerCount() < 2 )
{
if( layer != COPPER_LAYER_N )
if( layer != LAYER_N_BACK )
{
return;
}
......@@ -186,7 +186,7 @@ void WinEDA_BasePcbFrame::SwitchLayer( wxDC* DC, int layer )
// layers are also capable of being selected.
else
{
if( ( layer != COPPER_LAYER_N ) && ( layer != LAYER_CMP_N )
if( ( layer != LAYER_N_BACK ) && ( layer != LAYER_N_FRONT )
&& ( layer >= m_Pcb->m_BoardSettings->GetCopperLayerCount() - 1 ) )
{
return;
......
......@@ -38,7 +38,7 @@ BOARD::BOARD( EDA_BaseStruct* parent, WinEDA_BasePcbFrame* frame ) :
for( int layer = 0; layer < NB_COPPER_LAYERS; ++layer )
{
m_Layer[layer].m_Name = ReturnPcbLayerName( layer, true );
m_Layer[layer].m_Name = GetDefaultLayerName( layer );
m_Layer[layer].m_Type = LT_SIGNAL;
}
......@@ -180,6 +180,7 @@ int BOARD::GetCurrentMicroViaDrill()
}
wxString BOARD::GetLayerName( int aLayerIndex ) const
{
if( !IsValidLayerIndex( aLayerIndex ) )
......@@ -194,7 +195,53 @@ wxString BOARD::GetLayerName( int aLayerIndex ) const
return m_Layer[aLayerIndex].m_Name;
}
return ReturnPcbLayerName( aLayerIndex, true );
return GetDefaultLayerName( aLayerIndex );
}
wxString BOARD::GetDefaultLayerName( int aLayerNumber )
{
const wxChar* txt;
// These are only default layer names. For PCBNEW, the copper names
// may be over-ridden in the BOARD (*.brd) file.
// Use a switch to explicitly show the mapping more clearly
switch( aLayerNumber )
{
case LAYER_N_FRONT: txt = _( "Front" ); break;
case LAYER_N_2: txt = _( "Inner2" ); break;
case LAYER_N_3: txt = _( "Inner3" ); break;
case LAYER_N_4: txt = _( "Inner4" ); break;
case LAYER_N_5: txt = _( "Inner5" ); break;
case LAYER_N_6: txt = _( "Inner6" ); break;
case LAYER_N_7: txt = _( "Inner7" ); break;
case LAYER_N_8: txt = _( "Inner8" ); break;
case LAYER_N_9: txt = _( "Inner9" ); break;
case LAYER_N_10: txt = _( "Inner10" ); break;
case LAYER_N_11: txt = _( "Inner11" ); break;
case LAYER_N_12: txt = _( "Inner12" ); break;
case LAYER_N_13: txt = _( "Inner13" ); break;
case LAYER_N_14: txt = _( "Inner14" ); break;
case LAYER_N_15: txt = _( "Inner15" ); break;
case LAYER_N_BACK: txt = _( "Back" ); break;
case ADHESIVE_N_CU: txt = _( "Adhes_Back" ); break;
case ADHESIVE_N_CMP: txt = _( "Adhes_Front" ); break;
case SOLDERPASTE_N_CU: txt = _( "SoldP_Back" ); break;
case SOLDERPASTE_N_CMP: txt = _( "SoldP_Front" ); break;
case SILKSCREEN_N_CU: txt = _( "SilkS_Back" ); break;
case SILKSCREEN_N_CMP: txt = _( "SilkS_Front" ); break;
case SOLDERMASK_N_CU: txt = _( "Mask_Back" ); break;
case SOLDERMASK_N_CMP: txt = _( "Mask_Front" ); break;
case DRAW_N: txt = _( "Drawings" ); break;
case COMMENT_N: txt = _( "Comments" ); break;
case ECO1_N: txt = _( "Eco1" ); break;
case ECO2_N: txt = _( "Eco2" ); break;
case EDGE_N: txt = _( "PCB_Edges" ); break;
default: txt = _( "BAD INDEX" ); break;
}
return wxString( txt );
}
......
......@@ -148,6 +148,19 @@ public:
BOARD( EDA_BaseStruct* aParent, WinEDA_BasePcbFrame* frame );
~BOARD();
/**
* Function GetDefaultLayerName
* returns a default name of a PCB layer when given \a aLayerNumber. This
* function is static so it can be called without a BOARD instance. Use
* GetLayerName() if want the layer names of a specific BOARD, which could
* be different than the default if the user has renamed any copper layers.
*
* @param aLayerNumber is the layer number to fetch
* @return wxString - containing the layer name or "BAD INDEX" if aLayerNumber
* is not legal
*/
static wxString GetDefaultLayerName( int aLayerNumber );
/**
* Function GetPosition
* is here to satisfy BOARD_ITEM's requirements, but this implementation
......@@ -287,7 +300,7 @@ public:
* Function GetLayerName
* returns the name of the copper layer given by aLayerIndex.
*
* @param aLayerIndex A layer index, like COPPER_LAYER_N, etc.
* @param aLayerIndex A layer index, like LAYER_N_BACK, etc.
* @return wxString - the layer name.
*/
wxString GetLayerName( int aLayerIndex ) const;
......@@ -296,7 +309,7 @@ public:
* Function SetLayerName
* changes the name of the layer given by aLayerIndex.
*
* @param aLayerIndex A layer index, like COPPER_LAYER_N, etc.
* @param aLayerIndex A layer index, like LAYER_N_BACK, etc.
* @param aLayerName The new layer name
* @return bool - true if aLayerName was legal and unique amoung other
* layer names at other layer indices and aLayerIndex was within range, else false.
......@@ -307,7 +320,7 @@ public:
* Function GetLayerType
* returns the type of the copper layer given by aLayerIndex.
*
* @param aLayerIndex A layer index, like COPPER_LAYER_N, etc.
* @param aLayerIndex A layer index, like LAYER_N_BACK, etc.
* @return LAYER_T - the layer type, or LAYER_T(-1) if the
* index was out of range.
*/
......@@ -317,7 +330,7 @@ public:
* Function SetLayerName
* changes the name of the layer given by aLayerIndex.
*
* @param aLayerIndex A layer index, like COPPER_LAYER_N, etc.
* @param aLayerIndex A layer index, like LAYER_N_BACK, etc.
* @param aLayerType The new layer type.
* @return bool - true if aLayerType was legal and aLayerIndex was within range, else false.
*/
......
......@@ -123,8 +123,11 @@ void EDA_BoardDesignSettings::SetCopperLayerCount( int aNewLayerCount )
// ensure consistency with the m_EnabledLayers member
m_EnabledLayers &= ~ALL_CU_LAYERS;
m_EnabledLayers |= CUIVRE_LAYER;
if( m_CopperLayerCount > 1 )
m_EnabledLayers |= CMP_LAYER;
for( int ii = 1; ii < aNewLayerCount - 1; ii++ )
m_EnabledLayers |= 1 << ii;
}
......@@ -66,9 +66,9 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
if ( (pad->m_Masque_Layer & ALL_CU_LAYERS) == ALL_CU_LAYERS )
text << _("all copper layers");
else if( (pad->m_Masque_Layer & CUIVRE_LAYER) == CUIVRE_LAYER )
text << aPcb->GetLayerName( COPPER_LAYER_N ).Trim();
text << aPcb->GetLayerName( LAYER_N_BACK ).Trim();
else if( (pad->m_Masque_Layer & CMP_LAYER) == CMP_LAYER )
text << aPcb->GetLayerName( LAYER_CMP_N );
text << aPcb->GetLayerName( LAYER_N_FRONT );
else text << _("???");
text << _( ") of " ) << ( (MODULE*) GetParent() )->GetReference();
break;
......
......@@ -30,7 +30,7 @@ MODULE::MODULE( BOARD* parent ) :
BOARD_ITEM( parent, TYPE_MODULE )
{
m_Attributs = MOD_DEFAULT;
m_Layer = CMP_N;
m_Layer = LAYER_N_FRONT;
m_Orient = 0;
m_ModuleStatus = 0;
flag = 0;
......
......@@ -23,12 +23,12 @@ int ChangeSideNumLayer( int oldlayer )
switch( oldlayer )
{
case COPPER_LAYER_N:
newlayer = CMP_N;
case LAYER_N_BACK:
newlayer = LAYER_N_FRONT;
break;
case CMP_N:
newlayer = COPPER_LAYER_N;
case LAYER_N_FRONT:
newlayer = LAYER_N_BACK;
break;
case SILKSCREEN_N_CU:
......@@ -198,14 +198,14 @@ void MODULE::Flip(const wxPoint& aCentre )
pt_texte->SetLayer( GetLayer() );
pt_texte->SetLayer( ChangeSideNumLayer( pt_texte->GetLayer() ) );
if( GetLayer() == COPPER_LAYER_N )
if( GetLayer() == LAYER_N_BACK )
pt_texte->SetLayer( SILKSCREEN_N_CU );
if( GetLayer() == CMP_N )
if( GetLayer() == LAYER_N_FRONT )
pt_texte->SetLayer( SILKSCREEN_N_CMP );
if( (GetLayer() == SILKSCREEN_N_CU)
|| (GetLayer() == ADHESIVE_N_CU) || (GetLayer() == COPPER_LAYER_N) )
|| (GetLayer() == ADHESIVE_N_CU) || (GetLayer() == LAYER_N_BACK) )
pt_texte->m_Mirror = true;
/* Mirror value. */
......@@ -219,14 +219,14 @@ void MODULE::Flip(const wxPoint& aCentre )
pt_texte->SetLayer( GetLayer() );
pt_texte->SetLayer( ChangeSideNumLayer( pt_texte->GetLayer() ) );
if( GetLayer() == COPPER_LAYER_N )
if( GetLayer() == LAYER_N_BACK )
pt_texte->SetLayer( SILKSCREEN_N_CU );
if( GetLayer() == CMP_N )
if( GetLayer() == LAYER_N_FRONT )
pt_texte->SetLayer( SILKSCREEN_N_CMP );
if( (GetLayer() == SILKSCREEN_N_CU)
|| (GetLayer() == ADHESIVE_N_CU) || (GetLayer() == COPPER_LAYER_N) )
|| (GetLayer() == ADHESIVE_N_CU) || (GetLayer() == LAYER_N_BACK) )
pt_texte->m_Mirror = true;
/* Reverse mirror footprints. */
......@@ -266,15 +266,15 @@ void MODULE::Flip(const wxPoint& aCentre )
pt_texte->SetLayer( GetLayer() );
pt_texte->SetLayer( ChangeSideNumLayer( pt_texte->GetLayer() ) );
if( GetLayer() == COPPER_LAYER_N )
if( GetLayer() == LAYER_N_BACK )
pt_texte->SetLayer( SILKSCREEN_N_CU );
if( GetLayer() == CMP_N )
if( GetLayer() == LAYER_N_FRONT )
pt_texte->SetLayer( SILKSCREEN_N_CMP );
if( GetLayer() == SILKSCREEN_N_CU
|| GetLayer() == ADHESIVE_N_CU
|| GetLayer() == COPPER_LAYER_N )
|| GetLayer() == LAYER_N_BACK )
{
pt_texte->m_Mirror = true;
}
......
......@@ -540,20 +540,15 @@ bool D_PAD::Save( FILE* aFile ) const
void D_PAD::DisplayInfo( WinEDA_DrawFrame* frame )
{
int ii;
MODULE* module;
wxString Line;
MODULE* module;
wxString Line;
BOARD* board;
/* Pad messages */
static const wxString Msg_Pad_Shape[6] =
{ wxT( "??? " ), wxT( "Circ" ), wxT( "Rect" ), wxT( "Oval" ), wxT( "trap" ),
wxT( "spec" ) };
static const wxString Msg_Pad_Layer[9] =
{
wxT( "??? " ), wxT( "cmp " ), wxT( "cu " ), wxT( "cmp+cu " ),
wxT( "int " ), wxT( "cmp+int " ), wxT( "cu+int " ),
wxT( "all " ), wxT( "No copp" )
wxT( "??? " ), wxT( "Circ" ), wxT( "Rect" ), wxT( "Oval" ), wxT( "trap" ),
wxT( "spec" )
};
static const wxString Msg_Pad_Attribut[5] =
......@@ -570,6 +565,7 @@ void D_PAD::DisplayInfo( WinEDA_DrawFrame* frame )
ReturnStringPadName( Line );
frame->AppendMsgPanel( _( "RefP" ), Line, BROWN );
}
frame->AppendMsgPanel( _( "Net" ), m_Netname, DARKCYAN );
/* For test and debug only: display m_physical_connexion and
......@@ -580,85 +576,112 @@ void D_PAD::DisplayInfo( WinEDA_DrawFrame* frame )
frame->AppendMsgPanel( wxT( "L-P-Z" ), Line, DARKGREEN );
#endif
wxString LayerInfo;
board = GetBoard();
ii = 0;
if( m_Masque_Layer & CUIVRE_LAYER )
ii = 2;
if( m_Masque_Layer & CMP_LAYER )
ii += 1;
if( (m_Masque_Layer & ALL_CU_LAYERS) == ALL_CU_LAYERS )
ii = 7;
wxString layerInfo;
LayerInfo = Msg_Pad_Layer[ii];
if( (m_Masque_Layer & ALL_CU_LAYERS) == 0 )
if( (m_Masque_Layer & ALL_CU_LAYERS) == 0 ) // pad is not on any copper layers
{
if( m_Masque_Layer )
LayerInfo = Msg_Pad_Layer[8];
switch( m_Masque_Layer & ~ALL_CU_LAYERS )
{
case ADHESIVE_LAYER_CU:
LayerInfo = ReturnPcbLayerName( ADHESIVE_N_CU );
layerInfo = board->GetLayerName( ADHESIVE_N_CU );
break;
case ADHESIVE_LAYER_CMP:
LayerInfo = ReturnPcbLayerName( ADHESIVE_N_CMP );
layerInfo = board->GetLayerName( ADHESIVE_N_CMP );
break;
case SOLDERPASTE_LAYER_CU:
LayerInfo = ReturnPcbLayerName( SOLDERPASTE_N_CU );
layerInfo = board->GetLayerName( SOLDERPASTE_N_CU );
break;
case SOLDERPASTE_LAYER_CMP:
LayerInfo = ReturnPcbLayerName( SOLDERPASTE_N_CMP );
layerInfo = board->GetLayerName( SOLDERPASTE_N_CMP );
break;
case SILKSCREEN_LAYER_CU:
LayerInfo = ReturnPcbLayerName( SILKSCREEN_N_CU );
layerInfo = board->GetLayerName( SILKSCREEN_N_CU );
break;
case SILKSCREEN_LAYER_CMP:
LayerInfo = ReturnPcbLayerName( SILKSCREEN_N_CMP );
layerInfo = board->GetLayerName( SILKSCREEN_N_CMP );
break;
case SOLDERMASK_LAYER_CU:
LayerInfo = ReturnPcbLayerName( SOLDERMASK_N_CU );
layerInfo = board->GetLayerName( SOLDERMASK_N_CU );
break;
case SOLDERMASK_LAYER_CMP:
LayerInfo = ReturnPcbLayerName( SOLDERMASK_N_CMP );
layerInfo = board->GetLayerName( SOLDERMASK_N_CMP );
break;
case DRAW_LAYER:
LayerInfo = ReturnPcbLayerName( DRAW_N );
layerInfo = board->GetLayerName( DRAW_N );
break;
case COMMENT_LAYER:
LayerInfo = ReturnPcbLayerName( COMMENT_N );
layerInfo = board->GetLayerName( COMMENT_N );
break;
case ECO1_LAYER:
LayerInfo = ReturnPcbLayerName( ECO1_N );
layerInfo = board->GetLayerName( ECO1_N );
break;
case ECO2_LAYER:
LayerInfo = ReturnPcbLayerName( ECO2_N );
layerInfo = board->GetLayerName( ECO2_N );
break;
case EDGE_LAYER:
LayerInfo = ReturnPcbLayerName( EDGE_N );
layerInfo = board->GetLayerName( EDGE_N );
break;
default:
layerInfo = _( "Non-copper" );
break;
}
}
frame->AppendMsgPanel( _( "Layer" ), LayerInfo, DARKGREEN );
else
{
#define INTERIOR_COPPER (ALL_CU_LAYERS & ~(CUIVRE_LAYER | CMP_LAYER))
static const wxChar* andInternal = _( " & int" );
if( (m_Masque_Layer & (CUIVRE_LAYER | CMP_LAYER)) == CUIVRE_LAYER )
{
layerInfo = board->GetLayerName( LAYER_N_BACK );
if( m_Masque_Layer & INTERIOR_COPPER )
layerInfo += andInternal;
}
else if( (m_Masque_Layer & (CUIVRE_LAYER | CMP_LAYER)) == (CUIVRE_LAYER | CMP_LAYER) )
{
layerInfo = board->GetLayerName( LAYER_N_BACK ) + wxT(", ") +
board->GetLayerName( LAYER_N_FRONT );
if( m_Masque_Layer & INTERIOR_COPPER )
layerInfo += andInternal;
}
else if( (m_Masque_Layer & (CUIVRE_LAYER | CMP_LAYER)) == CMP_LAYER )
{
layerInfo = board->GetLayerName( LAYER_N_FRONT );
if( m_Masque_Layer & INTERIOR_COPPER )
layerInfo += andInternal;
}
else // necessarily true: if( m_Masque_Layer & INTERIOR_COPPER )
layerInfo = _( "internal" );
}
frame->AppendMsgPanel( _( "Layer" ), layerInfo, DARKGREEN );
int attribut = m_Attribut & 15;
if( attribut > 3 )
attribut = 3;
frame->AppendMsgPanel( Msg_Pad_Shape[m_PadShape],
Msg_Pad_Attribut[attribut], DARKGREEN );
......@@ -682,7 +705,6 @@ void D_PAD::DisplayInfo( WinEDA_DrawFrame* frame )
frame->AppendMsgPanel( _( "Drill X / Y" ), Line, RED );
}
int module_orient = module ? module->m_Orient : 0;
if( module_orient )
Line.Printf( wxT( "%3.1f(+%3.1f)" ),
......@@ -690,6 +712,7 @@ void D_PAD::DisplayInfo( WinEDA_DrawFrame* frame )
(float) module_orient / 10 );
else
Line.Printf( wxT( "%3.1f" ), (float) m_Orient / 10 );
frame->AppendMsgPanel( _( "Orient" ), Line, BLUE );
valeur_param( m_Pos.x, Line );
......
......@@ -274,7 +274,7 @@ void TEXTE_PCB::Flip(const wxPoint& aCentre )
{
m_Pos.y = aCentre.y - ( m_Pos.y - aCentre.y );
NEGATE( m_Orient );
if( ( GetLayer() == COPPER_LAYER_N ) || ( GetLayer() == CMP_N ) )
if( ( GetLayer() == LAYER_N_BACK ) || ( GetLayer() == LAYER_N_FRONT ) )
{
m_Mirror = not m_Mirror; /* inverse mirror */
}
......
......@@ -38,16 +38,16 @@ TEXTE_MODULE::TEXTE_MODULE( MODULE* parent, int text_type ) :
int moduleLayer = Module->GetLayer();
if( moduleLayer == COPPER_LAYER_N )
if( moduleLayer == LAYER_N_BACK )
SetLayer( SILKSCREEN_N_CU );
else if( moduleLayer == CMP_N )
else if( moduleLayer == LAYER_N_FRONT )
SetLayer( SILKSCREEN_N_CMP );
else
SetLayer( moduleLayer );
if( moduleLayer == SILKSCREEN_N_CU
|| moduleLayer == ADHESIVE_N_CU
|| moduleLayer == COPPER_LAYER_N )
|| moduleLayer == LAYER_N_BACK )
{
m_Mirror = true;
}
......@@ -144,9 +144,9 @@ int TEXTE_MODULE::ReadDescr( char* aLine, FILE* aFile, int* aLineNum )
layer = 0;
if( layer > LAST_NO_COPPER_LAYER )
layer = LAST_NO_COPPER_LAYER;
if( layer == COPPER_LAYER_N )
if( layer == LAYER_N_BACK )
layer = SILKSCREEN_N_CU;
else if( layer == CMP_N )
else if( layer == LAYER_N_FRONT )
layer = SILKSCREEN_N_CMP;
SetLayer( layer );
......@@ -376,13 +376,13 @@ void TEXTE_MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode,
color = g_DesignSettings.m_LayerColor[Module->GetLayer()];
if( Module->GetLayer() == COPPER_LAYER_N )
if( Module->GetLayer() == LAYER_N_BACK )
{
if( g_DesignSettings.IsElementVisible( MODULE_TEXT_CU_VISIBLE ) == false )
return;
color = g_ModuleTextCUColor;
}
else if( Module->GetLayer() == CMP_N )
else if( Module->GetLayer() == LAYER_N_FRONT )
{
if( g_DesignSettings.IsElementVisible( MODULE_TEXT_CMP_VISIBLE ) == false )
return;
......@@ -499,12 +499,12 @@ bool TEXTE_MODULE::IsOnLayer( int aLayer ) const
if( aLayer == GetParent()->GetLayer() )
return true;
if( aLayer == COPPER_LAYER_N )
if( aLayer == LAYER_N_BACK )
{
if( m_Layer==ADHESIVE_N_CU || m_Layer==SILKSCREEN_N_CU )
return true;
}
else if( aLayer == CMP_N )
else if( aLayer == LAYER_N_FRONT )
{
if( m_Layer==ADHESIVE_N_CMP || m_Layer==SILKSCREEN_N_CMP )
return true;
......
......@@ -373,8 +373,8 @@ void SEGVIA::SetLayerPair( int top_layer, int bottom_layer )
{
if( Shape() == VIA_THROUGH )
{
top_layer = LAYER_CMP_N;
bottom_layer = COPPER_LAYER_N;
top_layer = LAYER_N_FRONT;
bottom_layer = LAYER_N_BACK;
}
if( bottom_layer > top_layer )
......@@ -396,8 +396,8 @@ void SEGVIA::ReturnLayerPair( int* top_layer, int* bottom_layer ) const
* @param bottom_layer = pointer to the last layer (can be null)
*/
{
int b_layer = COPPER_LAYER_N;
int t_layer = LAYER_CMP_N;
int b_layer = LAYER_N_BACK;
int t_layer = LAYER_N_FRONT;
if( Shape() != VIA_THROUGH )
{
......@@ -828,7 +828,7 @@ void SEGVIA::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoi
{
int ax, ay, bx, by;
if( IsOnLayer( COPPER_LAYER_N ) )
if( IsOnLayer( LAYER_N_BACK ) )
{
ax = rayon; ay = 0;
bx = drill_rayon; by = 0;
......
......@@ -96,9 +96,9 @@ void PCB_SCREEN::Init()
/*************************/
{
InitDatas();
m_Active_Layer = COPPER_LAYER_N; /* default active layer = bottom layer */
m_Route_Layer_TOP = CMP_N; /* default layers pair for vias (bottom to top) */
m_Route_Layer_BOTTOM = COPPER_LAYER_N;
m_Active_Layer = LAYER_N_BACK; /* default active layer = bottom layer */
m_Route_Layer_TOP = LAYER_N_FRONT; /* default layers pair for vias (bottom to top) */
m_Route_Layer_BOTTOM = LAYER_N_BACK;
m_Zoom = 150; /* a default value for zoom */
}
......@@ -123,8 +123,8 @@ bool PCB_SCREEN::IsMicroViaAcceptable( void )
return false; // Obvious..
if( copperlayercnt < 4 )
return false; // Only on multilayer boards..
if( ( m_Active_Layer == COPPER_LAYER_N )
|| ( m_Active_Layer == LAYER_CMP_N )
if( ( m_Active_Layer == LAYER_N_BACK )
|| ( m_Active_Layer == LAYER_N_FRONT )
|| ( m_Active_Layer == g_DesignSettings.GetCopperLayerCount( ) - 2 )
|| ( m_Active_Layer == LAYER_N_2 ) )
return true;
......
......@@ -251,10 +251,10 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void*
if( module )
{
if( m_Guide->IgnoreMTextsOnCopper() && module->GetLayer()==COPPER_LAYER_N )
if( m_Guide->IgnoreMTextsOnCopper() && module->GetLayer()==LAYER_N_BACK )
goto exit;
if( m_Guide->IgnoreMTextsOnCmp() && module->GetLayer()==LAYER_CMP_N )
if( m_Guide->IgnoreMTextsOnCmp() && module->GetLayer()==LAYER_N_FRONT )
goto exit;
}
break;
......@@ -271,10 +271,10 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void*
if( module ) // true from case TYPE_PAD, TYPE_TEXTE_MODULE, or TYPE_MODULE
{
if( m_Guide->IgnoreModulesOnCu() && module->GetLayer()==COPPER_LAYER_N )
if( m_Guide->IgnoreModulesOnCu() && module->GetLayer()==LAYER_N_BACK )
goto exit;
if( m_Guide->IgnoreModulesOnCmp() && module->GetLayer()==LAYER_CMP_N )
if( m_Guide->IgnoreModulesOnCmp() && module->GetLayer()==LAYER_N_FRONT )
goto exit;
}
......
......@@ -360,7 +360,7 @@ public:
*/
GENERAL_COLLECTORS_GUIDE( int aVisibleLayerMask, int aPreferredLayer )
{
m_PreferredLayer = LAYER_CMP_N;
m_PreferredLayer = LAYER_N_FRONT;
m_IgnorePreferredLayer = false;
m_LayerLocked = 0;
m_LayerVisible = aVisibleLayerMask;
......
......@@ -130,12 +130,12 @@ void dialog_copper_zone::OnInitDialog( wxInitDialogEvent& event )
int layer_cnt = board->GetCopperLayerCount();
for( int ii = 0; ii < board->GetCopperLayerCount(); ii++ )
{
int layer_number = COPPER_LAYER_N;
int layer_number = LAYER_N_BACK;
if( layer_cnt <= 1 || ii < layer_cnt - 1 )
layer_number = ii;
else if( ii == layer_cnt - 1 )
layer_number = LAYER_CMP_N;
layer_number = LAYER_N_FRONT;
m_LayerId[ii] = layer_number;
......
......@@ -64,7 +64,7 @@ void DIALOG_MODULE_BOARD_EDITOR::InitBoardProperties()
AddUnitSymbol( *YPositionStatic, g_UnitMetric );
m_LayerCtrl->SetSelection(
(m_CurrentModule->GetLayer() == COPPER_LAYER_N) ? 1 : 0 );
(m_CurrentModule->GetLayer() == LAYER_N_BACK) ? 1 : 0 );
bool select = FALSE;
switch( m_CurrentModule->m_Orient )
......@@ -469,10 +469,10 @@ void DIALOG_MODULE_BOARD_EDITOR::OnOkClick( wxCommandEvent& event )
if( m_LayerCtrl->GetSelection() == 0 ) // layer req = COMPONENT
{
if( m_CurrentModule->GetLayer() == COPPER_LAYER_N )
if( m_CurrentModule->GetLayer() == LAYER_N_BACK )
change_layer = TRUE;
}
else if( m_CurrentModule->GetLayer() == CMP_N )
else if( m_CurrentModule->GetLayer() == LAYER_N_FRONT )
change_layer = TRUE;
if( change_layer )
......
This diff is collapsed.
......@@ -4,9 +4,9 @@
/*
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 1992-2009 Isaac Marino Bavaresco, isaacbavaresco@yahoo.com.br
* Copyright (C) 2009 Isaac Marino Bavaresco, isaacbavaresco@yahoo.com.br
* Copyright (C) 2009 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 1992-2009 Kicad Developers, see change_log.txt for contributors.
* Copyright (C) 2009 Kicad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
......@@ -38,28 +38,23 @@ private:
WinEDA_PcbFrame* m_Parent;
int m_ActivesLayersCount;
// int m_ActivesLayersCount;
BOARD* m_Pcb;
LAYER_T m_LayersType[4];
wxString m_LayersTypeName[4];
wxTextCtrl* m_textCtrl1[NB_COPPER_LAYERS];
wxCheckBox* m_checkBox[NB_LAYERS];
private:
wxChoice* m_choice5[NB_COPPER_LAYERS];
void init();
private:
void OnCancelButtonClick( wxCommandEvent& event );
void OnOkButtonClick( wxCommandEvent& event );
void OnLayerCountClick( wxCommandEvent& event );
// void OnLayerGridLeftClick( wxGridEvent& event ){ event.Skip(); }
// void OnLayerGridRighttClick( wxGridEvent& event ){ event.Skip(); }
void Init();
void SetRoutableLayerStatus( );
bool TestDataValidity();
public:
DIALOG_LAYERS_SETUP( WinEDA_PcbFrame* parent );
~DIALOG_LAYERS_SETUP( ) { };
......
This diff is collapsed.
This diff is collapsed.
......@@ -8,6 +8,8 @@
#ifndef __dialog_layers_setup_base2__
#define __dialog_layers_setup_base2__
#include <wx/intl.h>
#include <wx/string.h>
#include <wx/choice.h>
#include <wx/gdicmn.h>
......@@ -18,12 +20,87 @@
#include <wx/statbox.h>
#include <wx/stattext.h>
#include <wx/checkbox.h>
#include <wx/panel.h>
#include <wx/textctrl.h>
#include <wx/scrolwin.h>
#include <wx/button.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
#define ID_ADHESFRONTNAME 1000
#define ID_ADHESFRONTCHECKBOX 1001
#define ID_SOLDPFRONTNAME 1002
#define ID_SOLDPFRONTCHECKBOX 1003
#define ID_SILKSFRONTNAME 1004
#define ID_SILKSFRONTCHECKBOX 1005
#define ID_MASKFRONTNAME 1006
#define ID_MASKFRONTCHECKBOX 1007
#define ID_FRONTNAME 1008
#define ID_FRONTCHECKBOX 1009
#define ID_FRONTCHOICE 1010
#define ID_INNER2NAME 1011
#define ID_INNER2CHECKBOX 1012
#define ID_INNER2CHOICE 1013
#define ID_INNER3NAME 1014
#define ID_INNER3CHECKBOX 1015
#define ID_INNER3CHOICE 1016
#define ID_INNER4NAME 1017
#define ID_INNER4CHECKBOX 1018
#define ID_INNER4CHOICE 1019
#define ID_INNER5NAME 1020
#define ID_INNER5CHECKBOX 1021
#define ID_INNER5CHOICE 1022
#define ID_INNER6NAME 1023
#define ID_INNER6CHECKBOX 1024
#define ID_INNER6CHOICE 1025
#define ID_INNER7NAME 1026
#define ID_INNER7CHECKBOX 1027
#define ID_INNER7CHOICE 1028
#define ID_INNER8NAME 1029
#define ID_INNER8CHECKBOX 1030
#define ID_INNER8CHOICE 1031
#define ID_INNER9NAME 1032
#define ID_INNER9CHECKBOX 1033
#define ID_INNER9CHOICE 1034
#define ID_INNER10NAME 1035
#define ID_INNER10CHECKBOX 1036
#define ID_INNER10CHOICE 1037
#define ID_INNER11NAME 1038
#define ID_INNER11CHECKBOX 1039
#define ID_INNER11CHOICE 1040
#define ID_INNER12NAME 1041
#define ID_INNER12CHECKBOX 1042
#define ID_INNER12CHOICE 1043
#define ID_INNER13NAME 1044
#define ID_INNER13CHECKBOX 1045
#define ID_INNER13CHOICE 1046
#define ID_INNER14NAME 1047
#define ID_INNER14CHECKBOX 1048
#define ID_INNER14CHOICE 1049
#define ID_INNER15NAME 1050
#define ID_INNER15CHECKBOX 1051
#define ID_INNER15CHOICE 1052
#define ID_BACKNAME 1053
#define ID_BACKCHECKBOX 1054
#define ID_BACKCHOICE 1055
#define ID_MASKBACKNAME 1056
#define ID_SILKSBACKNAME 1057
#define ID_SILKSBACKCHECKBOX 1058
#define ID_SOLDPBACKNAME 1059
#define ID_SOLDPBACKCHECKBOX 1060
#define ID_ADHESBACKNAME 1061
#define ID_ADHESBACKCHECKBOX 1062
#define ID_PCBEDGESNAME 1063
#define ID_PCBEDGESCHECKBOX 1064
#define ID_ECO2NAME 1065
#define ID_ECHO2CHECKBOX 1066
#define ID_ECO1NAME 1067
#define ID_ECO1CHECKBOX 1068
#define ID_COMMENTSNAME 1069
#define ID_COMMENTSCHECKBOX 1070
#define ID_DRAWINGSNAME 1071
#define ID_DRAWINGSCHECKBOX 1072
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_LAYERS_SETUP_BASE2
......@@ -40,15 +117,133 @@ class DIALOG_LAYERS_SETUP_BASE2 : public wxDialog
wxStaticText* m_LayerTypeCaption;
wxScrolledWindow* m_LayersListPanel;
wxFlexGridSizer* m_LayerListFlexGridSizer;
wxStaticText* m_junkStaticText;
wxCheckBox* m_junkCheckBox;
wxChoice* m_junkChoice;
wxStaticText* m_AdhesFrontName;
wxPanel* m_AdhesFrontPanel;
wxCheckBox* m_AdhesFrontCheckBox;
wxStaticText* m_AdhesFrontStaticText;
wxStaticText* m_SoldPFrontName;
wxPanel* m_SoldPFrontPanel;
wxCheckBox* m_SoldPFrontCheckBox;
wxStaticText* m_SoldPFrontStaticText;
wxStaticText* m_SilkSFrontName;
wxPanel* m_SilkSFrontPanel;
wxCheckBox* m_SilkSFrontCheckBox;
wxStaticText* m_SilkSFrontStaticText;
wxStaticText* m_MaskFrontName;
wxPanel* m_MaskFrontPanel;
wxCheckBox* m_MaskFrontCheckBox;
wxStaticText* m_MaskFrontStaticText;
wxTextCtrl* m_FrontName;
wxPanel* m_FrontPanel;
wxCheckBox* m_FrontCheckBox;
wxChoice* m_FrontChoice;
wxTextCtrl* m_Inner2Name;
wxPanel* m_Inner2Panel;
wxCheckBox* m_Inner2CheckBox;
wxChoice* m_Inner2Choice;
wxTextCtrl* m_Inner3Name;
wxPanel* m_Inner3Panel;
wxCheckBox* m_Inner3CheckBox;
wxChoice* m_Inner3Choice;
wxTextCtrl* m_Inner4Name;
wxPanel* m_Inner4Panel;
wxCheckBox* m_Inner4CheckBox;
wxChoice* m_Inner4Choice;
wxTextCtrl* m_Inner5Name;
wxPanel* m_Inner5Panel;
wxCheckBox* m_Inner5CheckBox;
wxChoice* m_Inner5Choice;
wxTextCtrl* m_Inner6Name;
wxPanel* m_Inner6Panel;
wxCheckBox* m_Inner6CheckBox;
wxChoice* m_Inner6Choice;
wxTextCtrl* m_Inner7Name;
wxPanel* m_Inner7Panel;
wxCheckBox* m_Inner7CheckBox;
wxChoice* m_Inner7Choice;
wxTextCtrl* m_Inner8Name;
wxPanel* m_Inner8Panel;
wxCheckBox* m_Inner8CheckBox;
wxChoice* m_Inner8Choice;
wxTextCtrl* m_Inner9Name;
wxPanel* m_Inner9Panel;
wxCheckBox* m_Inner9CheckBox;
wxChoice* m_Inner9Choice;
wxTextCtrl* m_Inner10Name;
wxPanel* m_Inner10Panel;
wxCheckBox* m_Inner10CheckBox;
wxChoice* m_Inner10Choice;
wxTextCtrl* m_Inner11Name;
wxPanel* m_Inner11Panel;
wxCheckBox* m_Inner11CheckBox;
wxChoice* m_Inner11Choice;
wxTextCtrl* m_Inner12Name;
wxPanel* m_Inner12Panel;
wxCheckBox* m_Inner12CheckBox;
wxChoice* m_Inner12Choice;
wxTextCtrl* m_Inner13Name;
wxPanel* m_Inner13Panel;
wxCheckBox* m_Inner13CheckBox;
wxChoice* m_Inner13Choice;
wxTextCtrl* m_Inner14Name;
wxPanel* m_Inner14Panel;
wxCheckBox* m_Inner14CheckBox;
wxChoice* m_Inner14Choice;
wxTextCtrl* m_Inner15Name;
wxPanel* m_Inner15Panel;
wxCheckBox* m_Inner15CheckBox;
wxChoice* m_Inner15Choice;
wxTextCtrl* m_BackName;
wxPanel* m_BackPanel;
wxCheckBox* m_BackCheckBox;
wxChoice* m_BackChoice;
wxStaticText* m_MaskBackName;
wxPanel* m_panel21;
wxCheckBox* m_MaskBackCheckBox;
wxStaticText* m_MaskBackStaticText;
wxStaticText* m_SilkSBackName;
wxPanel* m_panel22;
wxCheckBox* m_SilkSBackCheckBox;
wxStaticText* m_SilkSBackStaticText;
wxStaticText* m_SoldPBackName;
wxPanel* m_panel23;
wxCheckBox* m_SoldPBackCheckBox;
wxStaticText* m_SoldPBackStaticText;
wxStaticText* m_AdhesBackName;
wxPanel* m_panel24;
wxCheckBox* m_AdhesBackCheckBox;
wxStaticText* m_AdhesBackStaticText;
wxStaticText* m_PCBEdgesName;
wxPanel* m_panel25;
wxCheckBox* m_PCBEdgesCheckBox;
wxStaticText* m_PCBEdgesStaticText;
wxStaticText* m_Eco2Name;
wxPanel* m_panel26;
wxCheckBox* m_Eco2CheckBox;
wxStaticText* m_Eco2StaticText;
wxStaticText* m_Eco1Name;
wxPanel* m_panel27;
wxCheckBox* m_Eco1CheckBox;
wxStaticText* m_Eco1StaticText;
wxStaticText* m_CommentsName;
wxPanel* m_panel28;
wxCheckBox* m_CommentsCheckBox;
wxStaticText* m_CommentsStaticText;
wxStaticText* m_DrawingsName;
wxPanel* m_panel29;
wxCheckBox* m_DrawingsCheckBox;
wxStaticText* m_DrawingsStaticText;
wxStdDialogButtonSizer* m_sdbSizer2;
wxButton* m_sdbSizer2OK;
wxButton* m_sdbSizer2Cancel;
// Virtual event handlers, overide them in your derived class
virtual void OnCancelButtonClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnOkButtonClick( wxCommandEvent& event ){ event.Skip(); }
public:
DIALOG_LAYERS_SETUP_BASE2( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("Layer Setup"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 700,600 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
DIALOG_LAYERS_SETUP_BASE2( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Layer Setup"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_LAYERS_SETUP_BASE2();
};
......
......@@ -770,9 +770,9 @@ bool DRC::doTrackDrc( TRACK* aRefSeg, TRACK* aStart, bool testPads )
EXCHG( layer1, layer2 );
// test:
if( layer1 == COPPER_LAYER_N && layer2 == LAYER_N_2 )
if( layer1 == LAYER_N_BACK && layer2 == LAYER_N_2 )
err = false;
if( layer1 == (g_DesignSettings.GetCopperLayerCount() - 2 ) && layer2 == LAYER_CMP_N )
if( layer1 == (g_DesignSettings.GetCopperLayerCount() - 2 ) && layer2 == LAYER_N_FRONT )
err = false;
if( err )
{
......
......@@ -171,7 +171,7 @@ void WinEDA_ModuleEditFrame::Edit_Edge_Layer( EDGE_MODULE* Edge )
if( new_layer < 0 )
return;
if( new_layer >= FIRST_COPPER_LAYER && new_layer <= LAST_COPPER_LAYER )
if( IsValidCopperLayerIndex( new_layer ) )
{
/* an edge is put on a copper layer, and it is very dangerous. a
*confirmation is requested */
......@@ -330,9 +330,9 @@ EDGE_MODULE* WinEDA_ModuleEditFrame::Begin_Edge_Module( EDGE_MODULE* Edge,
Edge->m_Width = ModuleSegmentWidth;
Edge->SetLayer( module->GetLayer() );
if( module->GetLayer() == CMP_N )
if( module->GetLayer() == LAYER_N_FRONT )
Edge->SetLayer( SILKSCREEN_N_CMP );
if( module->GetLayer() == COPPER_LAYER_N )
if( module->GetLayer() == LAYER_N_BACK )
Edge->SetLayer( SILKSCREEN_N_CU );
/* Initialise the starting point of the new segment or arc */
......
......@@ -1082,14 +1082,14 @@ void WinEDA_PcbFrame::SwitchLayer( wxDC* DC, int layer )
// Copper layers cannot be selected unconditionally; how many
// of those layers are currently enabled needs to be checked.
if( (layer >= FIRST_COPPER_LAYER) && (layer <= LAST_COPPER_LAYER) )
if( IsValidCopperLayerIndex( layer ) )
{
// If only one copper layer is enabled, the only such layer
// that can be selected to is the "Copper" layer (so the
// selection of any other copper layer is disregarded).
if( GetBoard()->m_BoardSettings->GetCopperLayerCount() < 2 )
{
if( layer != COPPER_LAYER_N )
if( layer != LAYER_N_BACK )
{
// Uncomment following command (and line 17) to beep
// the speaker. (Doing that would provide feedback to
......@@ -1105,7 +1105,7 @@ void WinEDA_PcbFrame::SwitchLayer( wxDC* DC, int layer )
// layers are also capable of being selected.
else
{
if( ( layer != COPPER_LAYER_N ) && ( layer != LAYER_CMP_N )
if( ( layer != LAYER_N_BACK ) && ( layer != LAYER_N_FRONT )
&& ( layer >= GetBoard()->m_BoardSettings->GetCopperLayerCount() - 1 ) )
{
// Uncomment following command (and line 17) to beep
......
......@@ -160,7 +160,7 @@ TEXTE_PCB* WinEDA_PcbFrame::Create_Texte_Pcb( wxDC* DC )
TextePcb->m_Flags = IS_NEW;
TextePcb->SetLayer( ( (PCB_SCREEN*) GetScreen() )->m_Active_Layer );
TextePcb->m_Mirror = false;
if( TextePcb->GetLayer() == COPPER_LAYER_N )
if( TextePcb->GetLayer() == LAYER_N_BACK )
TextePcb->m_Mirror = true;
TextePcb->m_Size = g_DesignSettings.m_PcbTextSize;
......
......@@ -205,15 +205,15 @@ bool WinEDA_PcbFrame::Other_Layer_Route( TRACK* aTrack, wxDC* DC )
break;
case VIA_MICROVIA: // from external to the near neighbor inner layer
if ( old_layer == COPPER_LAYER_N )
if ( old_layer == LAYER_N_BACK )
((PCB_SCREEN*)GetScreen())->m_Active_Layer = LAYER_N_2;
else if ( old_layer == LAYER_CMP_N )
else if ( old_layer == LAYER_N_FRONT )
((PCB_SCREEN*)GetScreen())->m_Active_Layer =
GetBoard()->m_BoardSettings->GetCopperLayerCount() - 2;
else if ( old_layer == LAYER_N_2 )
((PCB_SCREEN*)GetScreen())->m_Active_Layer = COPPER_LAYER_N;
((PCB_SCREEN*)GetScreen())->m_Active_Layer = LAYER_N_BACK;
else if ( old_layer == GetBoard()->m_BoardSettings->GetCopperLayerCount() - 2 )
((PCB_SCREEN*)GetScreen())->m_Active_Layer = LAYER_CMP_N;
((PCB_SCREEN*)GetScreen())->m_Active_Layer = LAYER_N_FRONT;
// else error
via->SetLayerPair( old_layer,
((PCB_SCREEN*)GetScreen())->m_Active_Layer );
......@@ -226,7 +226,7 @@ bool WinEDA_PcbFrame::Other_Layer_Route( TRACK* aTrack, wxDC* DC )
default:
// Usual via is from copper to component; layer pair is 0 and 0x0F.
via->SetDrillValue( GetBoard()->GetCurrentViaDrill() );
via->SetLayerPair( COPPER_LAYER_N, LAYER_CMP_N );
via->SetLayerPair( LAYER_N_BACK, LAYER_N_FRONT );
break;
}
......
......@@ -106,7 +106,7 @@ void WinEDA_PcbFrame::ExportToGenCAD( wxCommandEvent& event )
for( module = GetBoard()->m_Modules; module != NULL; module = module->Next() )
{
module->flag = 0;
if( module->GetLayer() == COPPER_LAYER_N )
if( module->GetLayer() == LAYER_N_BACK )
{
module->Flip( module->m_Pos );
module->flag = 1;
......@@ -356,14 +356,14 @@ void CreateShapesSection( FILE* file, BOARD* pcb )
layer = "ALL";
if( ( pad->m_Masque_Layer & ALL_CU_LAYERS ) == CUIVRE_LAYER )
{
if( module->GetLayer() == CMP_N )
if( module->GetLayer() == LAYER_N_FRONT )
layer = "BOTTOM";
else
layer = "TOP";
}
else if( ( pad->m_Masque_Layer & ALL_CU_LAYERS ) == CMP_LAYER )
{
if( module->GetLayer() == CMP_N )
if( module->GetLayer() == LAYER_N_FRONT )
layer = "TOP";
else
layer = "BOTTOM";
......
......@@ -297,8 +297,8 @@ void GenDrillReportFile( FILE* aFile, BOARD* aPcb,
{
unsigned TotalHoleCount;
char line[1024];
int layer1 = COPPER_LAYER_N;
int layer2 = LAYER_CMP_N;
int layer1 = LAYER_N_BACK;
int layer2 = LAYER_N_FRONT;
bool gen_through_holes = true;
......@@ -334,7 +334,7 @@ void GenDrillReportFile( FILE* aFile, BOARD* aPcb,
}
else
{
if( layer1 == COPPER_LAYER_N ) // First partial hole list
if( layer1 == LAYER_N_BACK ) // First partial hole list
{
sprintf( line, "Drill report for buried and blind vias :\n\n" );
fputs( line, aFile );
......@@ -395,12 +395,12 @@ void GenDrillReportFile( FILE* aFile, BOARD* aPcb,
layer2 = layer1 + 1;
else
{
if( layer2 >= LAYER_CMP_N ) // no more layer pair to consider
if( layer2 >= LAYER_N_FRONT ) // no more layer pair to consider
break;
layer1++; layer2++; // use next layer pair
if( layer2 == g_DesignSettings.GetCopperLayerCount() - 1 )
layer2 = LAYER_CMP_N; // the last layer is always the
layer2 = LAYER_N_FRONT; // the last layer is always the
// component layer
}
gen_through_holes = false;
......
......@@ -87,8 +87,8 @@ void Build_Holes_List( BOARD* aPcb,
if( (new_hole.m_Hole_Top_Layer < aLastLayer) && (aLastLayer >= 0) )
continue;
if( aExcludeThroughHoles && (new_hole.m_Hole_Bottom_Layer == COPPER_LAYER_N)
&& (new_hole.m_Hole_Top_Layer == LAYER_CMP_N) )
if( aExcludeThroughHoles && (new_hole.m_Hole_Bottom_Layer == LAYER_N_BACK)
&& (new_hole.m_Hole_Top_Layer == LAYER_N_FRONT) )
continue;
aHoleListBuffer.push_back( new_hole );
......@@ -117,8 +117,8 @@ void Build_Holes_List( BOARD* aPcb,
new_hole.m_Hole_SizeY = pad->m_Drill.y;
new_hole.m_Hole_Pos_X = pad->m_Pos.x;
new_hole.m_Hole_Pos_Y = pad->m_Pos.y; // hole position
new_hole.m_Hole_Bottom_Layer = COPPER_LAYER_N;
new_hole.m_Hole_Top_Layer = LAYER_CMP_N; // pad holes are through holes
new_hole.m_Hole_Bottom_Layer = LAYER_N_BACK;
new_hole.m_Hole_Top_Layer = LAYER_N_FRONT; // pad holes are through holes
aHoleListBuffer.push_back( new_hole );
}
}
......
......@@ -120,7 +120,7 @@ void WinEDA_PcbFrame::GenModulesPosition( wxCommandEvent& event )
#endif
}
if( module->GetLayer() == COPPER_LAYER_N )
if( module->GetLayer() == LAYER_N_BACK )
doBoardBack = true;
moduleCount++;
......@@ -133,7 +133,7 @@ void WinEDA_PcbFrame::GenModulesPosition( wxCommandEvent& event )
}
fnFront = GetScreen()->m_FileName;
frontLayerName = GetBoard()->GetLayerName( CMP_N );
frontLayerName = GetBoard()->GetLayerName( LAYER_N_FRONT );
fnFront.SetName( fnFront.GetName() + frontLayerName );
fnFront.SetExt( wxT( "pos") );
......@@ -148,7 +148,7 @@ void WinEDA_PcbFrame::GenModulesPosition( wxCommandEvent& event )
if( doBoardBack )
{
fnBack = GetScreen()->m_FileName;
backLayerName = GetBoard()->GetLayerName( COPPER_LAYER_N );
backLayerName = GetBoard()->GetLayerName( LAYER_N_BACK );
fnBack.SetName( fnBack.GetName() + backLayerName );
fnBack.SetExt( wxT( "pos" ) );
......@@ -252,15 +252,15 @@ void WinEDA_PcbFrame::GenModulesPosition( wxCommandEvent& event )
int layer = Liste[ii].m_Module->GetLayer();
wxASSERT( layer==CMP_N || layer==COPPER_LAYER_N );
wxASSERT( layer==LAYER_N_FRONT || layer==LAYER_N_BACK );
if( layer == CMP_N )
if( layer == LAYER_N_FRONT )
{
strcat( line, CONV_TO_UTF8( frontLayerName ) );
strcat( line, "\n" );
fputs( line, fpFront );
}
else if( layer == COPPER_LAYER_N )
else if( layer == LAYER_N_BACK )
{
strcat( line, CONV_TO_UTF8( backLayerName ) );
strcat( line, "\n" );
......@@ -396,9 +396,9 @@ void WinEDA_PcbFrame::GenModuleReport( wxCommandEvent& event )
fputs( line, rptfile );
sprintf( line, "orientation %.2f\n", (double) Module->m_Orient / 10 );
if( Module->GetLayer() == CMP_N )
if( Module->GetLayer() == LAYER_N_FRONT )
strcat( line, "layer component\n" );
else if( Module->GetLayer() == COPPER_LAYER_N )
else if( Module->GetLayer() == LAYER_N_BACK )
strcat( line, "layer copper\n" );
else
strcat( line, "layer other\n" );
......
......@@ -264,8 +264,8 @@ void WinEDA_DrillFrame::GenDrillFiles( wxCommandEvent& event )
bool ExistsBuriedVias = false; /* If true, drill files are created
* layer pair by layer pair for
* buried vias */
int layer1 = COPPER_LAYER_N;
int layer2 = LAYER_CMP_N;
int layer1 = LAYER_N_BACK;
int layer2 = LAYER_N_FRONT;
bool gen_through_holes = true;
UpdateConfig(); /* set params and Save drill options */
......@@ -293,11 +293,11 @@ void WinEDA_DrillFrame::GenDrillFiles( wxCommandEvent& event )
if( !gen_through_holes )
{
if( layer1 == COPPER_LAYER_N )
if( layer1 == LAYER_N_BACK )
layer_extend << wxT( "-copper" );
else
layer_extend << wxT( "-inner" ) << layer1;
if( layer2 == LAYER_CMP_N )
if( layer2 == LAYER_N_FRONT )
layer_extend << wxT( "-cmp" );
else
layer_extend << wxT( "-inner" ) << layer2;
......@@ -359,13 +359,13 @@ void WinEDA_DrillFrame::GenDrillFiles( wxCommandEvent& event )
layer2 = layer1 + 1;
else
{
if( layer2 >= LAYER_CMP_N ) // no more layer pair to consider
if( layer2 >= LAYER_N_FRONT ) // no more layer pair to consider
break;
layer1++;
layer2++; // use next layer pair
if( layer2 == g_DesignSettings.GetCopperLayerCount() - 1 )
layer2 = LAYER_CMP_N; // the last layer is always the
layer2 = LAYER_N_FRONT; // the last layer is always the
// component layer
}
......
......@@ -231,12 +231,13 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct
case HK_SWITCH_LAYER_TO_PREVIOUS:
ll = GetScreen()->m_Active_Layer;
if( (ll <= COPPER_LAYER_N) || (ll > CMP_N) )
if( (ll <= LAYER_N_BACK) || (ll > LAYER_N_FRONT) )
break;
if( GetBoard()->m_BoardSettings->GetCopperLayerCount() < 2 ) // Single layer
ll = COPPER_LAYER_N;
else if( ll == CMP_N )
ll = MAX( COPPER_LAYER_N,
ll = LAYER_N_BACK;
else if( ll == LAYER_N_FRONT )
ll = MAX( LAYER_N_BACK,
GetBoard()->m_BoardSettings->GetCopperLayerCount() - 2 );
else
ll--;
......@@ -245,23 +246,23 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct
case HK_SWITCH_LAYER_TO_NEXT:
ll = GetScreen()->m_Active_Layer;
if( (ll < COPPER_LAYER_N) || (ll >= CMP_N) )
if( (ll < LAYER_N_BACK) || (ll >= LAYER_N_FRONT) )
break;
if( GetBoard()->m_BoardSettings->GetCopperLayerCount() < 2 ) // Single layer
ll = COPPER_LAYER_N;
ll = LAYER_N_BACK;
else if( ll >= GetBoard()->m_BoardSettings->GetCopperLayerCount() - 2 )
ll = CMP_N;
ll = LAYER_N_FRONT;
else
ll++;
SwitchLayer( DC, ll );
break;
case HK_SWITCH_LAYER_TO_COMPONENT:
SwitchLayer( DC, CMP_N );
SwitchLayer( DC, LAYER_N_FRONT );
break;
case HK_SWITCH_LAYER_TO_COPPER:
SwitchLayer( DC, COPPER_LAYER_N );
SwitchLayer( DC, LAYER_N_BACK );
break;
case HK_SWITCH_LAYER_TO_INNER1:
......@@ -343,7 +344,7 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct
case HK_BACK_SPACE:
if( m_ID_current_state == ID_TRACK_BUTT && GetScreen()->m_Active_Layer
<= CMP_N )
<= LAYER_N_FRONT )
{
if( ItemFree )
{
......@@ -462,7 +463,7 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct
break;
case HK_ADD_NEW_TRACK: // Start new track
if( GetScreen()->m_Active_Layer > CMP_N )
if( GetScreen()->m_Active_Layer > LAYER_N_FRONT )
break;
if( m_ID_current_state != ID_TRACK_BUTT && ItemFree )
......@@ -473,8 +474,8 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct
if( m_ID_current_state != ID_TRACK_BUTT )
break;
if( ItemFree ) // no track in progress:
if( ItemFree ) // no track in progress:
{
TRACK* track = Begin_Route( NULL, DC );
SetCurItem( track );
......@@ -723,7 +724,7 @@ bool WinEDA_PcbFrame::OnHotkeyDeleteItem( wxDC* DC, EDA_BaseStruct* DrawStruct )
switch( m_ID_current_state )
{
case ID_TRACK_BUTT:
if( GetScreen()->m_Active_Layer > CMP_N )
if( GetScreen()->m_Active_Layer > LAYER_N_FRONT )
return FALSE;
if( ItemFree )
{
......
......@@ -162,8 +162,8 @@ int WinEDA_BasePcbFrame::ReadListeSegmentDescr( FILE* File,
if( makeType == TYPE_VIA ) // Ensure layers are OK when possible:
{
if( newTrack->Shape() == VIA_THROUGH )
( (SEGVIA*) newTrack )->SetLayerPair( LAYER_CMP_N,
COPPER_LAYER_N );
( (SEGVIA*) newTrack )->SetLayerPair( LAYER_N_FRONT,
LAYER_N_BACK );
}
newTrack->SetNet( net_code );
......
......@@ -78,7 +78,7 @@ void WinEDA_ModuleEditFrame::Load_Module_From_BOARD( MODULE* Module )
GetScreen()->m_Curseur.x = GetScreen()->m_Curseur.y = 0;
Place_Module( Module, NULL );
if( Module->GetLayer() != CMP_N )
if( Module->GetLayer() != LAYER_N_FRONT )
Module->Flip( Module->m_Pos );
Rotate_Module( NULL, Module, 0, FALSE );
GetScreen()->ClrModify();
......
......@@ -241,10 +241,10 @@ MODULE* Locate_Prefered_Module( BOARD* Pcb, int typeloc )
layer = pt_module->GetLayer();
if( layer==ADHESIVE_N_CU || layer==SILKSCREEN_N_CU )
layer = COPPER_LAYER_N;
layer = LAYER_N_BACK;
else if( layer==ADHESIVE_N_CMP || layer==SILKSCREEN_N_CMP )
layer = CMP_N;
layer = LAYER_N_FRONT;
/* Test of minimum size to choosing the best candidate. */
......
......@@ -353,8 +353,8 @@ void WinEDA_PcbFrame::Change_Side_Module( MODULE* Module, wxDC* DC )
{
if( Module == NULL )
return;
if( ( Module->GetLayer() != CMP_N )
&& ( Module->GetLayer() != COPPER_LAYER_N ) )
if( ( Module->GetLayer() != LAYER_N_FRONT )
&& ( Module->GetLayer() != LAYER_N_BACK ) )
return;
GetScreen()->SetModify();
......
......@@ -748,7 +748,7 @@ MODULE* WinEDA_PcbFrame::Create_MuWaveComponent( int shape_type )
Module->m_Drawings.PushFront( edge );
edge->m_Shape = S_POLYGON;
edge->SetLayer( LAYER_CMP_N );
edge->SetLayer( LAYER_N_FRONT );
int numPoints = angle / 50 + 3; // Note: angles are in 0.1 degrees
edge->m_PolyPoints.reserve( numPoints );
......@@ -1064,7 +1064,7 @@ MODULE* WinEDA_PcbFrame::Create_MuWavePolygonShape()
Module->m_Drawings.PushFront( edge );
edge->m_Shape = S_POLYGON;
edge->SetLayer( LAYER_CMP_N );
edge->SetLayer( LAYER_N_FRONT );
npoints = PolyEdgesCount;
edge->m_PolyPoints.reserve( 2 * PolyEdgesCount + 2 );
......
......@@ -61,15 +61,15 @@ extern const wxString g_FootprintLibFileWildcard; // Wildcard for footprint li
* Function IsModuleLayerVisible
* expects either of the two layers on which a module can reside, and returns
* whether that layer is visible.
* @param layer One of the two allowed layers for modules: CMP_N or COPPER_LAYER_N
* @param layer One of the two allowed layers for modules: LAYER_N_FRONT or LAYER_N_BACK
* @return bool - true if the layer is visible, else false.
*/
bool inline IsModuleLayerVisible( int layer )
{
if( layer==CMP_N )
if( layer==LAYER_N_FRONT )
return DisplayOpt.Show_Modules_Cmp;
else if( layer==COPPER_LAYER_N )
else if( layer==LAYER_N_BACK )
return DisplayOpt.Show_Modules_Cu;
else
......
......@@ -215,9 +215,9 @@ static void Print_Module( WinEDA_DrawPanel* panel, wxDC* DC,
/* Print footprint graphic shapes */
PtStruct = Module->m_Drawings;
mlayer = g_TabOneLayerMask[Module->GetLayer()];
if( Module->GetLayer() == COPPER_LAYER_N )
if( Module->GetLayer() == LAYER_N_BACK )
mlayer = SILKSCREEN_LAYER_CU;
else if( Module->GetLayer() == CMP_N )
else if( Module->GetLayer() == LAYER_N_FRONT )
mlayer = SILKSCREEN_LAYER_CMP;
if( mlayer & masklayer )
......
......@@ -61,7 +61,7 @@ enum button_types
type_element,
type_visual
};
struct ColorButton
{
......@@ -94,8 +94,8 @@ static ColorButton Layer_1_Butt =
{
type_layer, // Toggle ITEM_NOT_SHOW bit of the color variable
wxEmptyString,
COPPER_LAYER_N, // Layer
ADR( COPPER_LAYER_N ) // Address of optional parameter
LAYER_N_BACK, // Layer
ADR( LAYER_N_BACK ) // Address of optional parameter
};
static ColorButton Layer_2_Butt =
......@@ -214,8 +214,8 @@ static ColorButton Layer_16_Butt =
{
type_layer, // Toggle ITEM_NOT_SHOW bit of the color variable
wxEmptyString,
CMP_N, // Layer
ADR( CMP_N ) // Address of optional parameter
LAYER_N_FRONT, // Layer
ADR( LAYER_N_FRONT ) // Address of optional parameter
};
......@@ -372,7 +372,7 @@ static ColorButton Ratsnest_Butt =
static ColorButton Pad_Cu_Butt =
{
type_element, // Toggle ITEM_NOT_SHOW bit of the color variable
_( "Pad Cu" ), // Title
_( "Pad Back" ), // Title
PAD_CU_VISIBLE,
&g_PadCUColor // Address of optional parameter
};
......@@ -380,7 +380,7 @@ static ColorButton Pad_Cu_Butt =
static ColorButton Pad_Cmp_Butt =
{
type_element, // Toggle ITEM_NOT_SHOW bit of the color variable
_( "Pad Cmp" ), // Title
_( "Pad Front" ), // Title
PAD_CMP_VISIBLE,
&g_PadCMPColor // Address of optional parameter
};
......@@ -388,7 +388,7 @@ static ColorButton Pad_Cmp_Butt =
static ColorButton Text_Mod_Cu_Butt =
{
type_element, // Toggle ITEM_NOT_SHOW bit of the color variable
_( "Text Module Cu" ), // Title
_( "Text Module Back" ), // Title
MODULE_TEXT_CU_VISIBLE,
&g_ModuleTextCUColor // Address of optional parameter
};
......@@ -396,7 +396,7 @@ static ColorButton Text_Mod_Cu_Butt =
static ColorButton Text_Mod_Cmp_Butt =
{
type_element, // Toggle ITEM_NOT_SHOW bit of the color variable
_( "Text Module Cmp" ), // Title
_( "Text Module Front" ), // Title
MODULE_TEXT_CMP_VISIBLE,
&g_ModuleTextCMPColor // Address of optional parameter
};
......@@ -438,7 +438,7 @@ static ColorButton Show_Pads_Noconnect_Butt =
static ColorButton Show_Modules_Cmp_Butt =
{
type_visual,
_( "Show Modules Cmp" ), // Title
_( "Show Modules Front" ), // Title
-1,
NULL, // Address of optional parameter
&DisplayOpt.Show_Modules_Cmp // Address of boolean display control parameter to toggle
......@@ -447,7 +447,7 @@ static ColorButton Show_Modules_Cmp_Butt =
static ColorButton Show_Modules_Cu_Butt =
{
type_visual,
_( "Show Modules Cu" ), // Title
_( "Show Modules Back" ), // Title
-1,
NULL, // Address of optional parameter
&DisplayOpt.Show_Modules_Cu // Address of boolean display control parameter to toggle
......
......@@ -87,11 +87,11 @@ void SPECCTRA_DB::buildLayerMaps( BOARD* aBoard )
layerIds.clear();
pcbLayer2kicad.resize( layerCount );
kicadLayer2pcb.resize( LAYER_CMP_N+1 );
kicadLayer2pcb.resize( LAYER_N_FRONT+1 );
for( int kiNdx=layerCount-1, pcbNdx=0; kiNdx >= 0; --kiNdx, ++pcbNdx )
{
int kilayer = kiNdx>0 && kiNdx==layerCount-1 ? LAYER_CMP_N : kiNdx;
int kilayer = kiNdx>0 && kiNdx==layerCount-1 ? LAYER_N_FRONT : kiNdx;
// establish bi-directional mapping between kicad's BOARD layer and PCB layer
pcbLayer2kicad[pcbNdx] = kilayer;
......
......@@ -1520,7 +1520,7 @@ void SPECCTRA_DB::FlipMODULEs( BOARD* aBoard )
for( MODULE* module = aBoard->m_Modules; module; module = module->Next() )
{
module->flag = 0;
if( module->GetLayer() == COPPER_LAYER_N )
if( module->GetLayer() == LAYER_N_BACK )
{
module->Flip( module->m_Pos );
module->flag = 1;
......
......@@ -268,7 +268,7 @@ SEGVIA* SPECCTRA_DB::makeVIA( PADSTACK* aPadstack, const POINT& aPoint, int aNet
via->SetDrillValue( drillDiam );
via->m_Shape = VIA_THROUGH;
via->m_Width = viaDiam;
via->SetLayerPair( CMP_N, COPPER_LAYER_N );
via->SetLayerPair( LAYER_N_FRONT, LAYER_N_BACK );
}
else if( shapeCount == copperLayerCount )
{
......@@ -286,7 +286,7 @@ SEGVIA* SPECCTRA_DB::makeVIA( PADSTACK* aPadstack, const POINT& aPoint, int aNet
via->SetDrillValue( drillDiam );
via->m_Shape = VIA_THROUGH;
via->m_Width = viaDiam;
via->SetLayerPair( CMP_N, COPPER_LAYER_N );
via->SetLayerPair( LAYER_N_FRONT, LAYER_N_BACK );
}
else // VIA_MICROVIA or VIA_BLIND_BURIED
{
......@@ -408,7 +408,7 @@ void SPECCTRA_DB::FromSESSION( BOARD* aBoard ) throw( IOError )
{
// convert from degrees to tenths of degrees used in Kicad.
int orientation = (int) (place->rotation * 10.0);
if( module->GetLayer() != CMP_N )
if( module->GetLayer() != LAYER_N_FRONT )
{
// module is on copper layer (back)
module->Flip( module->m_Pos );
......@@ -418,7 +418,7 @@ void SPECCTRA_DB::FromSESSION( BOARD* aBoard ) throw( IOError )
else if( place->side == T_back )
{
int orientation = (int) ((place->rotation + 180.0) * 10.0);
if( module->GetLayer() != COPPER_LAYER_N )
if( module->GetLayer() != LAYER_N_BACK )
{
// module is on component layer (front)
module->Flip( module->m_Pos );
......
......@@ -159,14 +159,14 @@ void BOARD::Draw( WinEDA_DrawPanel* aPanel, wxDC* DC,
if( !DisplayOpt.Show_Modules_Cmp )
{
if( module->GetLayer() == CMP_N )
if( module->GetLayer() == LAYER_N_FRONT )
display = FALSE;
layerMask &= ~CMP_LAYER;
}
if( !DisplayOpt.Show_Modules_Cu )
{
if( module->GetLayer() == COPPER_LAYER_N )
if( module->GetLayer() == LAYER_N_BACK )
display = FALSE;
layerMask &= ~CUIVRE_LAYER;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment