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:
parent
f2518a5120
commit
86f9ed1dd9
|
@ -59,11 +59,16 @@ namespace AC_STACK
|
|||
*/
|
||||
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)
|
||||
* Because this feature needs some fixes (how to retrieve the info in netlist)
|
||||
* and because it adds a new keyword in *.kicad_pcb files, this is an advanced feature
|
||||
* Because this feature adds a new keyword in *.kicad_pcb files, this is an advanced feature
|
||||
* until it is fully finalized
|
||||
*/
|
||||
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,
|
||||
// then the values will remain as set here.
|
||||
m_EnableUsePadProperty = false;
|
||||
m_EnableUsePinFunction = false;
|
||||
m_allowLegacyCanvasInGtk3 = false;
|
||||
m_realTimeConnectivity = true;
|
||||
|
@ -202,6 +208,9 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg )
|
|||
{
|
||||
PARAM_CFG_ARRAY configParams;
|
||||
|
||||
configParams.push_back(
|
||||
new PARAM_CFG_BOOL( true, AC_KEYS::UsePadProperty, &m_EnableUsePadProperty, false ) );
|
||||
|
||||
configParams.push_back(
|
||||
new PARAM_CFG_BOOL( true, AC_KEYS::UsePinFunction, &m_EnableUsePinFunction, false ) );
|
||||
|
||||
|
|
|
@ -73,6 +73,11 @@ public:
|
|||
*/
|
||||
bool m_EnableUsePinFunction;
|
||||
|
||||
/**
|
||||
* Enable pad property handling in pcbnew.
|
||||
*/
|
||||
bool m_EnableUsePadProperty;
|
||||
|
||||
/**
|
||||
* Do real-time connectivity
|
||||
*/
|
||||
|
|
|
@ -41,6 +41,8 @@
|
|||
#include <html_messagebox.h>
|
||||
#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.
|
||||
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();
|
||||
|
||||
// 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_OrientValidator.SetRange( -360.0, 360.0 );
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
#include <convert_basic_shapes_to_polygon.h> // for enum RECT_CHAMFER_POSITIONS definition
|
||||
#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;
|
||||
|
||||
|
@ -1380,8 +1380,9 @@ void PCB_IO::format( D_PAD* aPad, int aNestLevel ) const
|
|||
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 );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue