2011-12-16 13:32:23 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2015-01-10 10:27:49 +00:00
|
|
|
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
2012-06-08 09:56:42 +00:00
|
|
|
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
2015-01-30 18:42:46 +00:00
|
|
|
* Copyright (C) 2015 Wayne Stambaugh <stambaughw@verizon.net>
|
2018-05-03 14:03:26 +00:00
|
|
|
* Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors.
|
2012-06-08 09:56:42 +00:00
|
|
|
*
|
2011-12-16 13:32:23 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <fctsys.h>
|
|
|
|
#include <pcbnew.h>
|
2018-01-29 20:58:58 +00:00
|
|
|
#include <footprint_edit_frame.h>
|
2018-02-02 20:57:12 +00:00
|
|
|
#include <board_design_settings.h>
|
2015-01-30 18:42:46 +00:00
|
|
|
#include <layers_id_colors_and_visibility.h>
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
|
2015-01-30 18:42:46 +00:00
|
|
|
PARAM_CFG_ARRAY& FOOTPRINT_EDIT_FRAME::GetConfigurationSettings()
|
|
|
|
{
|
2019-11-07 14:23:09 +00:00
|
|
|
auto& displ_opts = m_DisplayOptions;
|
2015-01-30 18:42:46 +00:00
|
|
|
BOARD_DESIGN_SETTINGS& settings = GetDesignSettings();
|
|
|
|
|
2015-08-15 14:00:34 +00:00
|
|
|
// Update everything
|
2017-09-10 14:21:56 +00:00
|
|
|
m_configParams.clear(); // boost::ptr_vector destroys the pointers inside
|
2015-08-15 14:00:34 +00:00
|
|
|
|
|
|
|
// Display options:
|
2017-09-10 14:21:56 +00:00
|
|
|
m_configParams.push_back( new PARAM_CFG_BOOL( true, wxT( "FpEditorDisplayPolarCoords" ),
|
2019-05-17 11:52:38 +00:00
|
|
|
&m_PolarCoords, false ) );
|
2017-09-10 14:21:56 +00:00
|
|
|
m_configParams.push_back( new PARAM_CFG_BOOL( true, wxT( "FpEditorPadDisplayMode" ),
|
2019-11-07 14:23:09 +00:00
|
|
|
&displ_opts.m_DisplayPadFill, true ) );
|
2017-09-10 14:21:56 +00:00
|
|
|
m_configParams.push_back( new PARAM_CFG_BOOL( true, wxT( "FpEditorGraphicLinesDisplayMode" ),
|
2019-11-07 14:23:09 +00:00
|
|
|
&displ_opts.m_DisplayModEdgeFill, FILLED ) );
|
2017-09-10 14:21:56 +00:00
|
|
|
m_configParams.push_back( new PARAM_CFG_BOOL( true, wxT( "FpEditorTextsDisplayMode" ),
|
2019-11-07 14:23:09 +00:00
|
|
|
&displ_opts.m_DisplayModTextFill, FILLED ) );
|
2017-09-10 14:21:56 +00:00
|
|
|
m_configParams.push_back( new PARAM_CFG_BOOL( true, wxT( "FpEditorTextsDisplayMode" ),
|
2019-11-07 14:23:09 +00:00
|
|
|
&displ_opts.m_DisplayModTextFill, FILLED ) );
|
2017-09-10 14:21:56 +00:00
|
|
|
m_configParams.push_back( new PARAM_CFG_WXSTRING( true, wxT( "FpEditorTextsRefDefaultText" ),
|
2015-08-15 14:00:34 +00:00
|
|
|
&settings.m_RefDefaultText, wxT( "REF**" ) ) );
|
|
|
|
|
|
|
|
// design settings
|
2018-04-28 15:22:25 +00:00
|
|
|
m_configParams.push_back( new PARAM_CFG_INT_WITH_SCALE( true, wxT( "FpEditorSilkLineWidth" ),
|
|
|
|
&settings.m_LineThickness[ LAYER_CLASS_SILK ],
|
|
|
|
Millimeter2iu( DEFAULT_SILK_LINE_WIDTH ), Millimeter2iu( 0.01 ), Millimeter2iu( 100.0 ),
|
|
|
|
nullptr, 1/IU_PER_MM, wxT( "FpEditorGrlineWidth" ) ) );
|
2018-11-28 14:58:41 +00:00
|
|
|
|
2018-04-28 15:22:25 +00:00
|
|
|
m_configParams.push_back( new PARAM_CFG_INT_WITH_SCALE( true, wxT( "FpEditorSilkTextSizeH" ),
|
|
|
|
&settings.m_TextSize[ LAYER_CLASS_SILK ].x,
|
|
|
|
Millimeter2iu( DEFAULT_SILK_TEXT_SIZE ), TEXTS_MIN_SIZE, TEXTS_MAX_SIZE,
|
|
|
|
nullptr, 1/IU_PER_MM, wxT( "FpEditorTextsDefaultSizeH" ) ) );
|
2018-11-28 14:58:41 +00:00
|
|
|
|
2018-04-28 15:22:25 +00:00
|
|
|
m_configParams.push_back( new PARAM_CFG_INT_WITH_SCALE( true, wxT( "FpEditorSilkTextSizeV" ),
|
|
|
|
&settings.m_TextSize[ LAYER_CLASS_SILK ].y,
|
|
|
|
Millimeter2iu( DEFAULT_SILK_TEXT_SIZE ), TEXTS_MIN_SIZE, TEXTS_MAX_SIZE,
|
|
|
|
nullptr, 1/IU_PER_MM, wxT( "FpEditorTextsDefaultSizeV" ) ) );
|
2018-11-28 14:58:41 +00:00
|
|
|
|
2018-04-28 15:22:25 +00:00
|
|
|
m_configParams.push_back( new PARAM_CFG_INT_WITH_SCALE( true, wxT( "FpEditorSilkTextThickness" ),
|
|
|
|
&settings.m_TextThickness[ LAYER_CLASS_SILK ],
|
|
|
|
Millimeter2iu( DEFAULT_SILK_TEXT_WIDTH ), 1, TEXTS_MAX_WIDTH,
|
|
|
|
nullptr, 1/IU_PER_MM, wxT( "FpEditorTextsDefaultThickness" ) ) );
|
|
|
|
|
|
|
|
m_configParams.push_back( new PARAM_CFG_BOOL( true, wxT( "FpEditorSilkTextItalic" ),
|
|
|
|
&settings.m_TextItalic[ LAYER_CLASS_SILK ] ) );
|
|
|
|
|
|
|
|
m_configParams.push_back( new PARAM_CFG_INT_WITH_SCALE( true, wxT( "FpEditorCopperLineWidth" ),
|
|
|
|
&settings.m_LineThickness[ LAYER_CLASS_COPPER ],
|
|
|
|
Millimeter2iu( DEFAULT_SILK_LINE_WIDTH ), Millimeter2iu( 0.01 ), Millimeter2iu( 5.0 ),
|
|
|
|
nullptr, MM_PER_IU ) );
|
|
|
|
|
|
|
|
m_configParams.push_back( new PARAM_CFG_INT_WITH_SCALE( true, wxT( "FpEditorCopperTextSizeV" ),
|
|
|
|
&settings.m_TextSize[ LAYER_CLASS_COPPER ].y,
|
|
|
|
Millimeter2iu( DEFAULT_COPPER_TEXT_SIZE ), TEXTS_MIN_SIZE, TEXTS_MAX_SIZE,
|
|
|
|
nullptr, MM_PER_IU ) );
|
|
|
|
|
|
|
|
m_configParams.push_back( new PARAM_CFG_INT_WITH_SCALE( true, wxT( "FpEditorCopperTextSizeH" ),
|
|
|
|
&settings.m_TextSize[ LAYER_CLASS_COPPER ].x,
|
|
|
|
Millimeter2iu( DEFAULT_COPPER_TEXT_SIZE ), TEXTS_MIN_SIZE, TEXTS_MAX_SIZE,
|
|
|
|
nullptr, MM_PER_IU ) );
|
|
|
|
|
|
|
|
m_configParams.push_back( new PARAM_CFG_INT_WITH_SCALE( true, wxT( "FpEditorCopperTextThickness" ),
|
|
|
|
&settings.m_TextThickness[ LAYER_CLASS_COPPER ],
|
|
|
|
Millimeter2iu( DEFAULT_COPPER_TEXT_WIDTH ), Millimeter2iu( 0.01 ), Millimeter2iu( 5.0 ),
|
|
|
|
nullptr, MM_PER_IU ) );
|
|
|
|
|
|
|
|
m_configParams.push_back( new PARAM_CFG_BOOL( true, wxT( "FpEditorCopperTextItalic" ),
|
|
|
|
&settings.m_TextItalic[ LAYER_CLASS_COPPER ] ) );
|
|
|
|
|
2018-08-24 20:08:30 +00:00
|
|
|
m_configParams.push_back( new PARAM_CFG_INT_WITH_SCALE( true, wxT( "FpEditorEdgeCutLineWidth" ),
|
2018-04-28 15:22:25 +00:00
|
|
|
&settings.m_LineThickness[ LAYER_CLASS_EDGES ],
|
|
|
|
Millimeter2iu( DEFAULT_SILK_LINE_WIDTH ), Millimeter2iu( 0.01 ), Millimeter2iu( 5.0 ),
|
|
|
|
nullptr, MM_PER_IU ) );
|
|
|
|
|
2018-08-24 20:08:30 +00:00
|
|
|
m_configParams.push_back( new PARAM_CFG_INT_WITH_SCALE( true, wxT( "FpEditorCourtyardLineWidth" ),
|
|
|
|
&settings.m_LineThickness[ LAYER_CLASS_COURTYARD ],
|
|
|
|
Millimeter2iu( DEFAULT_SILK_LINE_WIDTH ), Millimeter2iu( 0.01 ), Millimeter2iu( 5.0 ),
|
|
|
|
nullptr, MM_PER_IU ) );
|
|
|
|
|
2018-04-28 15:22:25 +00:00
|
|
|
m_configParams.push_back( new PARAM_CFG_INT_WITH_SCALE( true, wxT( "FpEditorOthersLineWidth" ),
|
|
|
|
&settings.m_LineThickness[ LAYER_CLASS_OTHERS ],
|
|
|
|
Millimeter2iu( DEFAULT_SILK_LINE_WIDTH ), Millimeter2iu( 0.01 ), Millimeter2iu( 5.0 ),
|
|
|
|
nullptr, MM_PER_IU ) );
|
|
|
|
|
|
|
|
m_configParams.push_back( new PARAM_CFG_INT_WITH_SCALE( true, wxT( "FpEditorOthersTextSizeV" ),
|
|
|
|
&settings.m_TextSize[ LAYER_CLASS_OTHERS ].x,
|
|
|
|
Millimeter2iu( DEFAULT_TEXT_SIZE ), TEXTS_MIN_SIZE, TEXTS_MAX_SIZE,
|
|
|
|
nullptr, MM_PER_IU ) );
|
|
|
|
|
|
|
|
m_configParams.push_back( new PARAM_CFG_INT_WITH_SCALE( true, wxT( "FpEditorOthersTextSizeH" ),
|
|
|
|
&settings.m_TextSize[ LAYER_CLASS_OTHERS ].y,
|
|
|
|
Millimeter2iu( DEFAULT_TEXT_SIZE ), TEXTS_MIN_SIZE, TEXTS_MAX_SIZE,
|
|
|
|
nullptr, MM_PER_IU ) );
|
|
|
|
|
|
|
|
m_configParams.push_back( new PARAM_CFG_INT_WITH_SCALE( true, wxT( "FpEditorOthersTextSizeThickness" ),
|
|
|
|
&settings.m_TextThickness[ LAYER_CLASS_OTHERS ],
|
|
|
|
Millimeter2iu( DEFAULT_TEXT_WIDTH ), 1, TEXTS_MAX_WIDTH,
|
|
|
|
nullptr, MM_PER_IU ) );
|
|
|
|
|
|
|
|
m_configParams.push_back( new PARAM_CFG_BOOL( true, wxT( "FpEditorOthersTextItalic" ),
|
|
|
|
&settings.m_TextItalic[ LAYER_CLASS_OTHERS ] ) );
|
|
|
|
|
|
|
|
m_configParams.push_back( new PARAM_CFG_WXSTRING( true, wxT( "FpEditorRefDefaultText" ),
|
|
|
|
&settings.m_RefDefaultText, wxT( "REF**" ) ) );
|
2018-11-28 14:58:41 +00:00
|
|
|
|
2018-04-28 15:22:25 +00:00
|
|
|
m_configParams.push_back( new PARAM_CFG_BOOL( true, wxT( "FpEditorRefDefaultVisibility" ),
|
|
|
|
&settings.m_RefDefaultVisibility, true ) );
|
2018-11-28 14:58:41 +00:00
|
|
|
|
2017-09-10 14:21:56 +00:00
|
|
|
m_configParams.push_back( new PARAM_CFG_INT( true, wxT( "FpEditorRefDefaultLayer" ),
|
2018-04-28 15:22:25 +00:00
|
|
|
&settings.m_RefDefaultlayer,
|
|
|
|
int( F_SilkS ), int( F_SilkS ), int( F_Fab ) ) );
|
2015-08-15 14:00:34 +00:00
|
|
|
|
2017-09-10 14:21:56 +00:00
|
|
|
m_configParams.push_back( new PARAM_CFG_WXSTRING( true, wxT( "FpEditorValueDefaultText" ),
|
2018-04-28 15:22:25 +00:00
|
|
|
&settings.m_ValueDefaultText, wxT( "" ) ) );
|
2018-11-28 14:58:41 +00:00
|
|
|
|
2018-04-28 15:22:25 +00:00
|
|
|
m_configParams.push_back( new PARAM_CFG_BOOL( true, wxT( "FpEditorValueDefaultVisibility" ),
|
|
|
|
&settings.m_ValueDefaultVisibility, true ) );
|
2018-11-28 14:58:41 +00:00
|
|
|
|
2017-09-10 14:21:56 +00:00
|
|
|
m_configParams.push_back( new PARAM_CFG_INT( true, wxT( "FpEditorValueDefaultLayer" ),
|
2018-04-28 15:22:25 +00:00
|
|
|
&settings.m_ValueDefaultlayer,
|
|
|
|
int( F_Fab ), int( F_SilkS ), int( F_Fab ) ) );
|
2015-01-30 18:42:46 +00:00
|
|
|
|
2017-09-10 14:21:56 +00:00
|
|
|
return m_configParams;
|
2015-01-30 18:42:46 +00:00
|
|
|
}
|