7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-18 21:29:17 +00:00

++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.
This commit is contained in:
dickelbeck 2009-12-07 03:46:13 +00:00
parent 5f9aefe898
commit 860fbb16d7
54 changed files with 7546 additions and 565 deletions

View File

@ -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;

View File

@ -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>
================================================================================

View File

@ -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.

View File

@ -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
};

View File

@ -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
{

View File

@ -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;
}

View File

@ -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 */
/*******************/

View File

@ -10,113 +10,111 @@
#include "class_board_item.h"
// Definitions relatives aux libraries
#define ENTETE_LIBRAIRIE "PCBNEW-LibModule-V1"
#define ENTETE_LIBDOC "PCBNEW-LibDoc----V1"
#define L_ENTETE_LIB 18
#define EXT_DOC wxT( "mdc" )
#define ENTETE_LIBRAIRIE "PCBNEW-LibModule-V1"
#define ENTETE_LIBDOC "PCBNEW-LibDoc----V1"
#define L_ENTETE_LIB 18
#define EXT_DOC wxT( "mdc" )
#define FLAG1 (1 << 13) /* flag for free local computations */
#define FLAG0 (1 << 12) /* flag for free local computations */
#define BEGIN_ONPAD (1 << 11) /* flag indicating a start of segment pad */
#define END_ONPAD (1 << 10) /* flag indicating an end of segment pad */
#define BUSY (1 << 9) /* flag indicating that the structure has
* already been edited, in some routines */
#define DELETED (1 << 8) /* flag indicating structures erased nd set
* string "DELETED" */
#define NO_TRACE (1 << 7) /* The element must not be displayed */
#define FLAG1 (1 << 13) // flag for free local computations
#define FLAG0 (1 << 12) // flag for free local computations
#define BEGIN_ONPAD (1 << 11) // flag indicating a start of segment pad
#define END_ONPAD (1 << 10) // flag indicating an end of segment pad
#define BUSY (1 << 9) // flag indicating that the structure has
// already been edited, in some routines
#define DELETED (1 << 8) // structures erased and set string "DELETED"
#define NO_TRACE (1 << 7) // The element must not be displayed
#define SURBRILL (1 << 5) /* element highlighted */
#define DRAG (1 << 4) /* segment in drag mode */
#define EDIT (1 << 3) /* element being edited */
#define SEGM_FIXE (1 << 2) /* segment fixed (not erase global) */
#define SEGM_AR (1 << 1) /* segment marked for auto routing */
#define CHAIN (1 << 0) /* mark segment */
#define SURBRILL (1 << 5) // element highlighted
#define DRAG (1 << 4) // segment in drag mode
#define EDIT (1 << 3) // element being edited
#define SEGM_FIXE (1 << 2) // segment fixed (not erase global)
#define SEGM_AR (1 << 1) // segment marked for auto routing
#define CHAIN (1 << 0) // mark segment
/* Layer identification (layer number) */
#define FIRST_COPPER_LAYER 0
#define COPPER_LAYER_N 0
#define LAYER_N_2 1
#define LAYER_N_3 2
#define LAYER_N_4 3
#define LAYER_N_5 4
#define LAYER_N_6 5
#define LAYER_N_7 6
#define LAYER_N_8 7
#define LAYER_N_9 8
#define LAYER_N_10 9
#define LAYER_N_11 10
#define LAYER_N_12 11
#define LAYER_N_13 12
#define LAYER_N_14 13
#define LAYER_N_15 14
#define LAYER_CMP_N 15
#define CMP_N 15
#define LAST_COPPER_LAYER 15
#define NB_COPPER_LAYERS (LAST_COPPER_LAYER + 1)
#define FIRST_COPPER_LAYER 0
#define LAYER_N_BACK 0
#define LAYER_N_2 1
#define LAYER_N_3 2
#define LAYER_N_4 3
#define LAYER_N_5 4
#define LAYER_N_6 5
#define LAYER_N_7 6
#define LAYER_N_8 7
#define LAYER_N_9 8
#define LAYER_N_10 9
#define LAYER_N_11 10
#define LAYER_N_12 11
#define LAYER_N_13 12
#define LAYER_N_14 13
#define LAYER_N_15 14
#define LAYER_N_FRONT 15
#define LAST_COPPER_LAYER LAYER_N_FRONT
#define NB_COPPER_LAYERS (LAST_COPPER_LAYER + 1)
#define FIRST_NO_COPPER_LAYER 16
#define ADHESIVE_N_CU 16
#define ADHESIVE_N_CMP 17
#define SOLDERPASTE_N_CU 18
#define SOLDERPASTE_N_CMP 19
#define SILKSCREEN_N_CU 20
#define SILKSCREEN_N_CMP 21
#define SOLDERMASK_N_CU 22
#define SOLDERMASK_N_CMP 23
#define DRAW_N 24
#define COMMENT_N 25
#define ECO1_N 26
#define ECO2_N 27
#define EDGE_N 28
#define LAST_NO_COPPER_LAYER 28
#define NB_LAYERS (LAST_NO_COPPER_LAYER + 1)
#define FIRST_NO_COPPER_LAYER 16
#define ADHESIVE_N_CU 16
#define ADHESIVE_N_CMP 17
#define SOLDERPASTE_N_CU 18
#define SOLDERPASTE_N_CMP 19
#define SILKSCREEN_N_CU 20
#define SILKSCREEN_N_CMP 21
#define SOLDERMASK_N_CU 22
#define SOLDERMASK_N_CMP 23
#define DRAW_N 24
#define COMMENT_N 25
#define ECO1_N 26
#define ECO2_N 27
#define EDGE_N 28
#define LAST_NO_COPPER_LAYER 28
#define NB_LAYERS (LAST_NO_COPPER_LAYER + 1)
#define LAYER_COUNT 32
#define LAYER_COUNT 32
#define CUIVRE_LAYER (1 << COPPER_LAYER_N) ///< bit mask for copper layer
#define LAYER_2 (1 << LAYER_N_2) ///< bit mask for layer 2
#define LAYER_3 (1 << LAYER_N_3) ///< bit mask for layer 3
#define LAYER_4 (1 << LAYER_N_4) ///< bit mask for layer 4
#define LAYER_5 (1 << LAYER_N_5) ///< bit mask for layer 5
#define LAYER_6 (1 << LAYER_N_6) ///< bit mask for layer 6
#define LAYER_7 (1 << LAYER_N_7) ///< bit mask for layer 7
#define LAYER_8 (1 << LAYER_N_8) ///< bit mask for layer 8
#define LAYER_9 (1 << LAYER_N_9) ///< bit mask for layer 9
#define LAYER_10 (1 << LAYER_N_10) ///< bit mask for layer 10
#define LAYER_11 (1 << LAYER_N_11) ///< bit mask for layer 11
#define LAYER_12 (1 << LAYER_N_12) ///< bit mask for layer 12
#define LAYER_13 (1 << LAYER_N_13) ///< bit mask for layer 13
#define LAYER_14 (1 << LAYER_N_14) ///< bit mask for layer 14
#define LAYER_15 (1 << LAYER_N_15) ///< bit mask for layer 15
#define CMP_LAYER (1 << LAYER_CMP_N) ///< bit mask for component layer
#define ADHESIVE_LAYER_CU (1 << ADHESIVE_N_CU)
#define ADHESIVE_LAYER_CMP (1 << ADHESIVE_N_CMP)
#define SOLDERPASTE_LAYER_CU (1 << SOLDERPASTE_N_CU)
#define SOLDERPASTE_LAYER_CMP (1 << SOLDERPASTE_N_CMP)
#define SILKSCREEN_LAYER_CU (1 << SILKSCREEN_N_CU)
#define SILKSCREEN_LAYER_CMP (1 << SILKSCREEN_N_CMP)
#define SOLDERMASK_LAYER_CU (1 << SOLDERMASK_N_CU)
#define SOLDERMASK_LAYER_CMP (1 << SOLDERMASK_N_CMP)
#define DRAW_LAYER (1 << DRAW_N)
#define COMMENT_LAYER (1 << COMMENT_N)
#define ECO1_LAYER (1 << ECO1_N)
#define ECO2_LAYER (1 << ECO2_N)
#define EDGE_LAYER (1 << EDGE_N)
#define CUIVRE_LAYER (1 << LAYER_N_BACK) ///< bit mask for copper layer
#define LAYER_2 (1 << LAYER_N_2) ///< bit mask for layer 2
#define LAYER_3 (1 << LAYER_N_3) ///< bit mask for layer 3
#define LAYER_4 (1 << LAYER_N_4) ///< bit mask for layer 4
#define LAYER_5 (1 << LAYER_N_5) ///< bit mask for layer 5
#define LAYER_6 (1 << LAYER_N_6) ///< bit mask for layer 6
#define LAYER_7 (1 << LAYER_N_7) ///< bit mask for layer 7
#define LAYER_8 (1 << LAYER_N_8) ///< bit mask for layer 8
#define LAYER_9 (1 << LAYER_N_9) ///< bit mask for layer 9
#define LAYER_10 (1 << LAYER_N_10) ///< bit mask for layer 10
#define LAYER_11 (1 << LAYER_N_11) ///< bit mask for layer 11
#define LAYER_12 (1 << LAYER_N_12) ///< bit mask for layer 12
#define LAYER_13 (1 << LAYER_N_13) ///< bit mask for layer 13
#define LAYER_14 (1 << LAYER_N_14) ///< bit mask for layer 14
#define LAYER_15 (1 << LAYER_N_15) ///< bit mask for layer 15
#define CMP_LAYER (1 << LAYER_N_FRONT) ///< bit mask for component layer
#define ADHESIVE_LAYER_CU (1 << ADHESIVE_N_CU)
#define ADHESIVE_LAYER_CMP (1 << ADHESIVE_N_CMP)
#define SOLDERPASTE_LAYER_CU (1 << SOLDERPASTE_N_CU)
#define SOLDERPASTE_LAYER_CMP (1 << SOLDERPASTE_N_CMP)
#define SILKSCREEN_LAYER_CU (1 << SILKSCREEN_N_CU)
#define SILKSCREEN_LAYER_CMP (1 << SILKSCREEN_N_CMP)
#define SOLDERMASK_LAYER_CU (1 << SOLDERMASK_N_CU)
#define SOLDERMASK_LAYER_CMP (1 << SOLDERMASK_N_CMP)
#define DRAW_LAYER (1 << DRAW_N)
#define COMMENT_LAYER (1 << COMMENT_N)
#define ECO1_LAYER (1 << ECO1_N)
#define ECO2_LAYER (1 << ECO2_N)
#define EDGE_LAYER (1 << EDGE_N)
#define FIRST_NON_COPPER_LAYER ADHESIVE_N_CU
#define LAST_NON_COPPER_LAYER EDGE_N
#define FIRST_NON_COPPER_LAYER ADHESIVE_N_CU
#define LAST_NON_COPPER_LAYER EDGE_N
// extra bits 0xE0000000
/* Helpful global layers mask : */
#define ALL_LAYERS 0x1FFFFFFF // Pcbnew used 29 layers
#define FULL_LAYERS 0xFFFFFFFF // Gerbview used 32 layers
#define ALL_NO_CU_LAYERS 0x1FFF0000
#define ALL_CU_LAYERS 0x0000FFFF
#define INTERNAL_LAYERS 0x00007FFE
#define EXTERNAL_LAYERS 0x00008001
#define ALL_LAYERS 0x1FFFFFFF // Pcbnew used 29 layers
#define FULL_LAYERS 0xFFFFFFFF // Gerbview used 32 layers
#define ALL_NO_CU_LAYERS 0x1FFF0000
#define ALL_CU_LAYERS 0x0000FFFF
#define INTERNAL_LAYERS 0x00007FFE
#define EXTERNAL_LAYERS 0x00008001
class NETINFO_ITEM;
class MARKER_PCB;
@ -163,8 +161,7 @@ inline bool IsValidLayerIndex( int aLayerIndex )
*/
inline bool IsValidCopperLayerIndex( int aLayerIndex )
{
return aLayerIndex >= FIRST_COPPER_LAYER
&& aLayerIndex <= LAST_COPPER_LAYER;
return aLayerIndex >= FIRST_COPPER_LAYER && aLayerIndex <= LAST_COPPER_LAYER;
}
/**
@ -272,5 +269,4 @@ public:
DISPLAY_OPTIONS();
};
#endif /* PCBSTRUCT_H */
#endif // PCBSTRUCT_H

View File

@ -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;
}

View File

@ -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 )

View File

@ -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;

View File

@ -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 );
}

View File

@ -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.
*/

View File

@ -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;
}

View File

@ -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;

View File

@ -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;

View File

@ -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;
}

View File

@ -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 );

View File

@ -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 */
}

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;
}

View File

@ -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;

View File

@ -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;

Some files were not shown because too many files have changed in this diff Show More