Skip to content

Commit

Permalink
1) Add 32 Cu Layers and provisions for additional future layers.
Browse files Browse the repository at this point in the history
2) Change from legacy Cu stack to counting down from top=(F_Cu or 0).
   The old Cu stack required knowing the count of Cu layers to make
   sense of the layer number when converting to many exported file types.
   The new Cu stack is more commonly used, although ours still gives
   B_Cu a fixed number.
3) Introduce class LSET and enum LAYER_ID.  LAYER_NUM is only advisory and
   can safely be replaced with int.
4) Change *.kicad_pcb file format version to 4 from 3.
5) Change fixed names Inner1_Cu-Inner14_Cu to In1_Cu-In30_Cu and their
   meanings are typically flipped.
6) Moved the #define LAYER_N_* stuff into legacy_plugin.cpp where they
   can die a quiet death, and switch to enum LAYER_ID symbols throughout.
7) Removed the LEGACY_PLUGIN::Save() and FootprintSave() functions.
   You will need to convert to the format immediately, *.kicad_pcb and
   *.kicad_mod (=pretty) since legacy format was never going to know
   about 32 Cu layers and additional technical layers and the reversed Cu
   stack.
  • Loading branch information
liftoff-sr committed Jun 30, 2014
2 parents 33776f2 + 60140df commit d6d786e
Show file tree
Hide file tree
Showing 228 changed files with 13,411 additions and 5,160 deletions.
175 changes: 106 additions & 69 deletions 3d-viewer/3d_draw.cpp

Large diffs are not rendered by default.

27 changes: 13 additions & 14 deletions 3d-viewer/info3d_visu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,53 +132,52 @@ void INFO3D_VISU::InitSettings( BOARD* aBoard )
// Fill remaining unused copper layers and front layer zpos
// with m_EpoxyThickness
// Solder mask and Solder paste have the same Z position
for( ; layer <= LAST_COPPER_LAYER; layer++ )
for( ; layer < MAX_CU_LAYERS; layer++ )
{
m_LayerZcoord[layer] = m_EpoxyThickness;
}

// calculate z position for each non copper layer
for( int layer_id = FIRST_NON_COPPER_LAYER; layer_id < NB_PCB_LAYERS; layer_id++ )
for( int layer_id = MAX_CU_LAYERS; layer_id < LAYER_ID_COUNT; layer_id++ )
{
double zpos;

switch( layer_id )
{
case ADHESIVE_N_BACK:
case B_Adhes:
zpos = zpos_copper_back - 3 * zpos_offset;
break;

case ADHESIVE_N_FRONT:
case F_Adhes:
zpos = zpos_copper_front + 3 * zpos_offset;
break;

case SOLDERPASTE_N_BACK:
case B_Paste:
zpos = zpos_copper_back - 1 * zpos_offset;
break;

case SOLDERPASTE_N_FRONT:
case F_Paste:
zpos = zpos_copper_front + 1 * zpos_offset;
break;

case SOLDERMASK_N_BACK:
case B_Mask:
zpos = zpos_copper_back - 1 * zpos_offset;
break;

case SOLDERMASK_N_FRONT:
case F_Mask:
zpos = zpos_copper_front + 1 * zpos_offset;
break;

case SILKSCREEN_N_BACK:
case B_SilkS:
zpos = zpos_copper_back - 2 * zpos_offset;
break;

case SILKSCREEN_N_FRONT:
case F_SilkS:
zpos = zpos_copper_front + 2 * zpos_offset;
break;

default:
zpos = zpos_copper_front +
(layer_id - FIRST_NON_COPPER_LAYER + 4) * zpos_offset;
zpos = zpos_copper_front + (layer_id - MAX_CU_LAYERS + 4) * zpos_offset;
break;
}

Expand All @@ -196,8 +195,8 @@ void INFO3D_VISU::InitSettings( BOARD* aBoard )
double INFO3D_VISU::GetModulesZcoord3DIU( bool aIsFlipped )
{
if( aIsFlipped )
return m_LayerZcoord[LAYER_N_BACK] - ( m_CopperThickness / 2 );
return m_LayerZcoord[B_Cu] - ( m_CopperThickness / 2 );
else
return m_LayerZcoord[LAYER_N_FRONT] + ( m_CopperThickness / 2 );
return m_LayerZcoord[F_Cu] + ( m_CopperThickness / 2 );
}

11 changes: 6 additions & 5 deletions 3d-viewer/info3d_visu.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class INFO3D_VISU
double m_CurrentZpos; // temporary storage of current value of Z position,
// used in some calculation
private:
double m_LayerZcoord[NB_LAYERS]; // Z position of each layer (normalized)
double m_LayerZcoord[LAYER_ID_COUNT]; // Z position of each layer (normalized)
double m_CopperThickness; // Copper thickness (normalized)
double m_EpoxyThickness; // Epoxy thickness (normalized)
double m_NonCopperLayerThickness; // Non copper layers thickness
Expand Down Expand Up @@ -188,11 +188,12 @@ public: INFO3D_VISU();
*
* Note: if m_drawFlags[FL_USE_COPPER_THICKNESS] is not set, returns 0
*/
int GetLayerObjectThicknessBIU( int aLayerId) const
int GetLayerObjectThicknessBIU( int aLayerId ) const
{
return aLayerId >= FIRST_NON_COPPER_LAYER ?
GetNonCopperLayerThicknessBIU() :
GetCopperThicknessBIU();
return IsCopperLayer( aLayerId ) ?
GetCopperThicknessBIU() :
GetNonCopperLayerThicknessBIU()
;
}

bool IsRealisticMode() { return GetFlag( FL_USE_REALISTIC_MODE ); }
Expand Down
4 changes: 4 additions & 0 deletions TODO.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ PCBNew
*) Paste (module ...) from clipboard into module editor.




Dick's Final TODO List:
======================
*) Get licensing cleaned up.
Expand All @@ -75,3 +77,5 @@ Dick's Final TODO List:
* Clear all/some? retained strings on project change.
* Clear the FP_LIB_TABLE when the last KIWAY_PLAYER using it is closed.


Fix export gencad
2 changes: 1 addition & 1 deletion bitmap2component/bitmap2component.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ void BITMAPCONV_INFO::OuputOnePolygon( KPolygon & aPolygon )

case PCBNEW_LEGACY_EMP:
{
LAYER_NUM layer = SILKSCREEN_N_FRONT;
LAYER_NUM layer = F_SilkS;
int width = 1;
fprintf( m_Outfile, "DP %d %d %d %d %d %d %d\n",
0, 0, 0, 0,
Expand Down
1 change: 1 addition & 0 deletions common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ set( PCB_COMMON_SRCS
eda_text.cpp
class_page_info.cpp
pcbcommon.cpp
lset.cpp
footprint_info.cpp
../pcbnew/basepcbframe.cpp
../pcbnew/class_board.cpp
Expand Down
26 changes: 18 additions & 8 deletions common/class_colors_design_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
/* Initial colors values: optimized for Pcbnew, but are also Ok for Eeschema
* these values are superseded by config reading
*/
static const EDA_COLOR_T default_layer_color[LAYERSCOLORSBUFFERSIZE] =
{
static const EDA_COLOR_T default_layer_color[] = {
GREEN, BLUE, LIGHTGRAY, BROWN,
RED, MAGENTA, LIGHTGRAY, MAGENTA,
DARKGRAY, BLUE, GREEN, CYAN,
Expand All @@ -34,8 +33,8 @@ static const EDA_COLOR_T default_layer_color[LAYERSCOLORSBUFFERSIZE] =
DARKGRAY
};

static const EDA_COLOR_T default_items_color[LAYERSCOLORSBUFFERSIZE] =
{

static const EDA_COLOR_T default_items_color[] = {
LIGHTGRAY, // unused
CYAN, // VIA_MICROVIA_VISIBLE
BROWN, // VIA_BBLIND_VISIBLE
Expand All @@ -56,13 +55,24 @@ static const EDA_COLOR_T default_items_color[LAYERSCOLORSBUFFERSIZE] =
LIGHTGRAY, LIGHTGRAY, LIGHTGRAY
};


COLORS_DESIGN_SETTINGS::COLORS_DESIGN_SETTINGS()
{
for( unsigned ii = 0; ii < DIM(m_LayersColors); ii++ )
m_LayersColors[ii] = default_layer_color[ii];
for( unsigned src = 0, dst = 0; dst < DIM(m_LayersColors); ++dst )
{
m_LayersColors[dst] = default_layer_color[src++];

for( unsigned ii = 0; ii < DIM(m_ItemsColors); ii++ )
m_ItemsColors[ii] = default_items_color[ii];
if( src >= DIM( default_layer_color ) )
src = 0; // wrap the source.
}

for( unsigned src = 0, dst = 0; dst < DIM(m_ItemsColors); ++dst )
{
m_ItemsColors[dst] = default_items_color[src++];

if( src >= DIM( default_items_color ) )
src = 0;
}
}


Expand Down
15 changes: 5 additions & 10 deletions common/class_layer_box_selector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,11 @@

LAYER_SELECTOR::LAYER_SELECTOR()
{
m_layerorder = true;
m_layerhotkeys = true;
m_hotkeys = NULL;
}


bool LAYER_SELECTOR::SetLayersOrdered( bool value )
{
m_layerorder = value;
return m_layerorder;
}


bool LAYER_SELECTOR::SetLayersHotkeys( bool value )
{
m_layerhotkeys = value;
Expand Down Expand Up @@ -120,12 +112,15 @@ int LAYER_BOX_SELECTOR::SetLayerSelection( LAYER_NUM layer )
return -1;
}


void LAYER_BOX_SELECTOR::ResyncBitmapOnly()
{
LAYER_NUM elements = GetCount();
for( LAYER_NUM i = FIRST_LAYER; i < elements; ++i )
int elements = GetCount();

for( LAYER_NUM i = 0; i < elements; ++i )
{
wxBitmap layerbmp( 14, 14 );
SetBitmapLayer( layerbmp, i );
}
}

14 changes: 7 additions & 7 deletions common/common_plotSVG_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -420,14 +420,14 @@ void SVG_PLOTTER::PlotPoly( const std::vector<wxPoint>& aCornerList,

switch( aFill )
{
case NO_FILL:
fprintf( outputFile, "<polyline fill=\"none;\"\n" );
break;
case NO_FILL:
fprintf( outputFile, "<polyline fill=\"none;\"\n" );
break;

case FILLED_WITH_BG_BODYCOLOR:
case FILLED_SHAPE:
fprintf( outputFile, "<polyline style=\"fill-rule:evenodd;\"\n" );
break;
case FILLED_WITH_BG_BODYCOLOR:
case FILLED_SHAPE:
fprintf( outputFile, "<polyline style=\"fill-rule:evenodd;\"\n" );
break;
}

DPOINT pos = userToDeviceCoordinates( aCornerList[0] );
Expand Down
Loading

0 comments on commit d6d786e

Please sign in to comment.