Allows pad property only by the kicad_advanced feature.

pad property is allowed if "UsePadProperty=1" is found in kicad_advanced.
This commit is contained in:
jean-pierre charras 2020-01-06 18:11:01 +01:00
parent f2518a5120
commit 86f9ed1dd9
4 changed files with 28 additions and 4 deletions

View File

@ -59,11 +59,16 @@ namespace AC_STACK
*/ */
namespace AC_KEYS namespace AC_KEYS
{ {
/**
* In Pcbnew, pads can have a fabrication property
* Because this feature adds a new keyword in *.kicad_pcb and *.kicad_modfiles,
* this is an advanced feature until it is fully finalized
*/
static const wxChar UsePadProperty[] = wxT( "UsePadProperty" );
/** /**
* In Pcbnew, pads can handle a pin function info (this is the schematic pin name) * In Pcbnew, pads can handle a pin function info (this is the schematic pin name)
* Because this feature needs some fixes (how to retrieve the info in netlist) * Because this feature adds a new keyword in *.kicad_pcb files, this is an advanced feature
* and because it adds a new keyword in *.kicad_pcb files, this is an advanced feature
* until it is fully finalized * until it is fully finalized
*/ */
static const wxChar UsePinFunction[] = wxT( "UsePinFunction" ); static const wxChar UsePinFunction[] = wxT( "UsePinFunction" );
@ -165,6 +170,7 @@ ADVANCED_CFG::ADVANCED_CFG()
// Init defaults - this is done in case the config doesn't exist, // Init defaults - this is done in case the config doesn't exist,
// then the values will remain as set here. // then the values will remain as set here.
m_EnableUsePadProperty = false;
m_EnableUsePinFunction = false; m_EnableUsePinFunction = false;
m_allowLegacyCanvasInGtk3 = false; m_allowLegacyCanvasInGtk3 = false;
m_realTimeConnectivity = true; m_realTimeConnectivity = true;
@ -202,6 +208,9 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg )
{ {
PARAM_CFG_ARRAY configParams; PARAM_CFG_ARRAY configParams;
configParams.push_back(
new PARAM_CFG_BOOL( true, AC_KEYS::UsePadProperty, &m_EnableUsePadProperty, false ) );
configParams.push_back( configParams.push_back(
new PARAM_CFG_BOOL( true, AC_KEYS::UsePinFunction, &m_EnableUsePinFunction, false ) ); new PARAM_CFG_BOOL( true, AC_KEYS::UsePinFunction, &m_EnableUsePinFunction, false ) );

View File

@ -73,6 +73,11 @@ public:
*/ */
bool m_EnableUsePinFunction; bool m_EnableUsePinFunction;
/**
* Enable pad property handling in pcbnew.
*/
bool m_EnableUsePadProperty;
/** /**
* Do real-time connectivity * Do real-time connectivity
*/ */

View File

@ -41,6 +41,8 @@
#include <html_messagebox.h> #include <html_messagebox.h>
#include <convert_basic_shapes_to_polygon.h> // for enum RECT_CHAMFER_POSITIONS definition #include <convert_basic_shapes_to_polygon.h> // for enum RECT_CHAMFER_POSITIONS definition
#include <advanced_config.h> // for pad property feature management
// list of pad shapes, ordered like the pad shape wxChoice in dialog. // list of pad shapes, ordered like the pad shape wxChoice in dialog.
static PAD_SHAPE_T code_shape[] = static PAD_SHAPE_T code_shape[] =
@ -124,6 +126,13 @@ DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES( PCB_BASE_FRAME* aParent, D_PAD* aP
m_board = m_parent->GetBoard(); m_board = m_parent->GetBoard();
// Disable the pad property if not allowed in advanced config
if( !ADVANCED_CFG::GetCfg().m_EnableUsePadProperty )
{
m_staticTextFabProperty->Show( false );
m_choiceFabProperty->Show( false );
}
m_PadNetSelector->SetNetInfo( &m_board->GetNetInfo() ); m_PadNetSelector->SetNetInfo( &m_board->GetNetInfo() );
m_OrientValidator.SetRange( -360.0, 360.0 ); m_OrientValidator.SetRange( -360.0, 360.0 );

View File

@ -52,7 +52,7 @@
#include <convert_basic_shapes_to_polygon.h> // for enum RECT_CHAMFER_POSITIONS definition #include <convert_basic_shapes_to_polygon.h> // for enum RECT_CHAMFER_POSITIONS definition
#include <kiface_i.h> #include <kiface_i.h>
#include <advanced_config.h> // for pad pin function feature management #include <advanced_config.h> // for pad pin function and pad property feature management
using namespace PCB_KEYS_T; using namespace PCB_KEYS_T;
@ -1380,8 +1380,9 @@ void PCB_IO::format( D_PAD* aPad, int aNestLevel ) const
m_out->Print( 0, ")" ); m_out->Print( 0, ")" );
} }
if( property ) if( property && ADVANCED_CFG::GetCfg().m_EnableUsePadProperty )
{ {
// Add pad property, if exists.
m_out->Print( 0, " (property %s)", property ); m_out->Print( 0, " (property %s)", property );
} }