Commit 0ae29fc1 authored by charras's avatar charras
Browse files

Revert to previous dialog_layer_setup_base, and added (conditional...

Revert to previous dialog_layer_setup_base, and added (conditional compilation) option to hide/show no used inner copper layers and define inner layers order (see changelog) in dialog layer setup.
parent 89159f75
Loading
Loading
Loading
Loading
+17 −0
Original line number Original line Diff line number Diff line
@@ -4,6 +4,23 @@ KiCad ChangeLog 2010
Please add newer entries at the top, list the date and your name with
Please add newer entries at the top, list the date and your name with
email address.
email address.


2010-Feb-19 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================
++Pcbnew:
    Added (see dialog_layers_setup.cpp) compilation options to
    -hide non active copper layers
    -show inner layers in same order than the layer manager
    Currently these options are 2 define
    HIDE_INACTIVE_LAYERS
    // if defined, displays only active copper layers
    // if not displays always 1=the full set (16 layers)
    USE_LAYER_MANAGER_COPPER_LAYERS_ORDER
    //if defined, used the layer manager copper layers order
    //  (from FRONT to BACK) to display inner layers.
    //  if not, use the default order (from BACK to FRONT)
    
    Currently not active, can be changed if the correponding lines are uncommented in dialog_layers_setup.cpp

2010-Mar-3 UPDATE Dick Hollenbeck <dick@softplc.com>
2010-Mar-3 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
================================================================================
++common
++common
+41 −4
Original line number Original line Diff line number Diff line
@@ -36,6 +36,17 @@


#include "class_board_design_settings.h"
#include "class_board_design_settings.h"


// some define to choose how copper layers widgets are shown

// if defined, displays only active copper layers
// if not displays always 1=the full set (16 layers)
//#define HIDE_INACTIVE_LAYERS 

//if defined, uses the layer manager copper layers order (from FRONT to BACK)
//  to display inner layers.
// if not, use the default order (from BACK to FRONT)
//#define USE_LAYER_MANAGER_COPPER_LAYERS_ORDER



/**
/**
 * Struct CTLs
 * Struct CTLs
@@ -43,11 +54,12 @@
 */
 */
struct CTLs
struct CTLs
{
{
    CTLs( wxControl* aName, wxCheckBox* aCheckBox, wxControl* aChoiceOrDesc )
    CTLs( wxControl* aName, wxCheckBox* aCheckBox, wxControl* aChoiceOrDesc, wxPanel * aPanel = NULL)
    {
    {
        name     = aName;
        name     = aName;
        checkbox = aCheckBox;
        checkbox = aCheckBox;
        choice   = aChoiceOrDesc;
        choice   = aChoiceOrDesc;
        panel = aPanel;
    }
    }


    wxControl*      name;
    wxControl*      name;
@@ -197,8 +209,8 @@ static const int presets[] =


CTLs DIALOG_LAYERS_SETUP::getCTLs( int aLayerNumber )
CTLs DIALOG_LAYERS_SETUP::getCTLs( int aLayerNumber )
{
{
#define RETCOP(x)    return CTLs( x##Name, x##CheckBox, x##Choice );
#define RETCOP(x)    return CTLs( x##Name, x##CheckBox, x##Choice, x##Panel );
#define RETAUX(x)    return CTLs( x##Name, x##CheckBox, x##StaticText );
#define RETAUX(x)    return CTLs( x##Name, x##CheckBox, x##StaticText, x##Panel );


    switch( aLayerNumber )
    switch( aLayerNumber )
    {
    {
@@ -207,6 +219,22 @@ CTLs DIALOG_LAYERS_SETUP::getCTLs( int aLayerNumber )
    case SILKSCREEN_N_FRONT:    RETAUX( m_SilkSFront );
    case SILKSCREEN_N_FRONT:    RETAUX( m_SilkSFront );
    case SOLDERMASK_N_FRONT:    RETAUX( m_MaskFront );
    case SOLDERMASK_N_FRONT:    RETAUX( m_MaskFront );
    case LAYER_N_FRONT:         RETCOP( m_Front );
    case LAYER_N_FRONT:         RETCOP( m_Front );
#ifdef USE_LAYER_MANAGER_COPPER_LAYERS_ORDER
    case LAYER_N_15:            RETCOP( m_Inner2 );
    case LAYER_N_14:            RETCOP( m_Inner3 );
    case LAYER_N_13:            RETCOP( m_Inner4 );
    case LAYER_N_12:            RETCOP( m_Inner5 );
    case LAYER_N_11:            RETCOP( m_Inner6 );
    case LAYER_N_10:            RETCOP( m_Inner7 );
    case LAYER_N_9:             RETCOP( m_Inner8 );
    case LAYER_N_8:             RETCOP( m_Inner9 );
    case LAYER_N_7:             RETCOP( m_Inner10 );
    case LAYER_N_6:             RETCOP( m_Inner11 );
    case LAYER_N_5:             RETCOP( m_Inner12 );
    case LAYER_N_4:             RETCOP( m_Inner13 );
    case LAYER_N_3:             RETCOP( m_Inner14 );
    case LAYER_N_2:             RETCOP( m_Inner15 );
#else
    case LAYER_N_2:             RETCOP( m_Inner2 );
    case LAYER_N_2:             RETCOP( m_Inner2 );
    case LAYER_N_3:             RETCOP( m_Inner3 );
    case LAYER_N_3:             RETCOP( m_Inner3 );
    case LAYER_N_4:             RETCOP( m_Inner4 );
    case LAYER_N_4:             RETCOP( m_Inner4 );
@@ -221,6 +249,7 @@ CTLs DIALOG_LAYERS_SETUP::getCTLs( int aLayerNumber )
    case LAYER_N_13:            RETCOP( m_Inner13 );
    case LAYER_N_13:            RETCOP( m_Inner13 );
    case LAYER_N_14:            RETCOP( m_Inner14 );
    case LAYER_N_14:            RETCOP( m_Inner14 );
    case LAYER_N_15:            RETCOP( m_Inner15 );
    case LAYER_N_15:            RETCOP( m_Inner15 );
#endif
    case LAYER_N_BACK:          RETCOP( m_Back );
    case LAYER_N_BACK:          RETCOP( m_Back );
    case SOLDERMASK_N_BACK:     RETAUX( m_MaskBack );
    case SOLDERMASK_N_BACK:     RETAUX( m_MaskBack );
    case SILKSCREEN_N_BACK:     RETAUX( m_SilkSBack );
    case SILKSCREEN_N_BACK:     RETAUX( m_SilkSBack );
@@ -434,19 +463,27 @@ void DIALOG_LAYERS_SETUP::setCopperLayerCheckBoxes( int copperCount )
    int layer;
    int layer;
    for( layer=LAYER_N_2; layer < NB_COPPER_LAYERS-1;  ++layer, --copperCount )
    for( layer=LAYER_N_2; layer < NB_COPPER_LAYERS-1;  ++layer, --copperCount )
    {
    {
        CTLs ctl = getCTLs(layer);
        bool state = copperCount > 0;
        bool state = copperCount > 0;
#ifdef HIDE_INACTIVE_LAYERS
    // This code hide non active copper layers
        CTLs ctl = getCTLs(layer);
        ctl.name->Show( state );
        ctl.name->Show( state );
        ctl.checkbox->Show( state );
        ctl.checkbox->Show( state );
        ctl.choice->Show( state );
        ctl.choice->Show( state );
        if( ctl.panel )
            ctl.panel->Show( state );
#endif


        setLayerCheckBox( layer, state );
        setLayerCheckBox( layer, state );
    }
    }


#ifdef HIDE_INACTIVE_LAYERS
    // Send an size event to force sizers to be updated,
    // Send an size event to force sizers to be updated,
    // because the number of copper layers can have changed.
    // because the number of copper layers can have changed.
    wxSizeEvent evt_size(m_LayersListPanel->GetSize() );
    wxSizeEvent evt_size(m_LayersListPanel->GetSize() );
    m_LayersListPanel->GetEventHandler()->ProcessEvent( evt_size );
    m_LayersListPanel->GetEventHandler()->ProcessEvent( evt_size );
#endif

}
}




Loading