KiCad PCB EDA Suite
footprint_editor_settings.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2020 Jon Evans <[email protected]>
5 * Copyright (C) 2020-2022 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#include <common.h>
23#include <layer_ids.h>
24#include <pgm_base.h>
27#include <settings/parameters.h>
29#include <wx/config.h>
30#include <base_units.h>
31#include <widgets/ui_common.h>
32#include <wx/log.h>
33#include <pcbnew.h>
34
35
37const int fpEditSchemaVersion = 2;
38
39
42 m_DesignSettings( nullptr, "fpedit.settings" ),
43 m_MagneticItems(),
44 m_Display(),
45 m_UserGrid(),
46 m_PolarCoords( false ),
47 m_RotationAngle( ANGLE_90 ),
48 m_Use45Limit( true ),
50 m_LibWidth( 250 ),
51 m_LastImportExportPath(),
52 m_FootprintTextShownColumns()
53{
57
61
62 m_params.emplace_back( new PARAM<int>( "window.lib_width",
63 &m_LibWidth, 250 ) );
64
65 m_params.emplace_back( new PARAM<bool>( "aui.show_layer_manager",
67
68 m_params.emplace_back( new PARAM<int>( "aui.right_panel_width",
70
71 m_params.emplace_back( new PARAM<int>( "aui.appearance_panel_tab",
73
74 m_params.emplace_back( new PARAM<wxString>( "system.last_import_export_path",
76
77 m_params.emplace_back( new PARAM<wxString>( "window.footprint_text_shown_columns",
78 &m_FootprintTextShownColumns, "0 1 2 3 4 5 6" ) );
79
80 m_params.emplace_back( new PARAM<int>( "editing.magnetic_pads",
81 reinterpret_cast<int*>( &m_MagneticItems.pads ),
82 static_cast<int>( MAGNETIC_OPTIONS::CAPTURE_ALWAYS ) ) );
83
84 m_params.emplace_back( new PARAM<bool>( "editing.magnetic_graphics",
85 &m_MagneticItems.graphics, true ) );
86
87 m_params.emplace_back( new PARAM<bool>( "editing.polar_coords",
88 &m_PolarCoords, false ) );
89
90 m_params.emplace_back( new PARAM_LAMBDA<int>( "editing.rotation_angle",
91 [this] () -> int
92 {
94 },
95 [this] ( int aVal )
96 {
97 if( aVal )
99 },
100 900 ) );
101
102 m_params.emplace_back( new PARAM<bool>( "editing.fp_use_45_degree_limit",
103 &m_Use45Limit, false ) );
104
105 m_params.emplace_back( new PARAM_LAYER_PRESET( "pcb_display.layer_presets", &m_LayerPresets ) );
106
107 m_params.emplace_back( new PARAM<wxString>( "pcb_display.active_layer_preset",
108 &m_ActiveLayerPreset, "" ) );
109
110 m_params.emplace_back( new PARAM_LAMBDA<nlohmann::json>(
111 "design_settings.default_footprint_text_items",
112 [&] () -> nlohmann::json
113 {
114 nlohmann::json js = nlohmann::json::array();
115
117 {
118 js.push_back( nlohmann::json( { item.m_Text.ToUTF8(),
119 item.m_Visible,
120 item.m_Layer } ) );
121 }
122
123 return js;
124 },
125 [&] ( const nlohmann::json& aObj )
126 {
128
129 if( !aObj.is_array() )
130 return;
131
132 for( const nlohmann::json& entry : aObj )
133 {
134 if( entry.empty() || !entry.is_array() )
135 continue;
136
137 TEXT_ITEM_INFO textInfo( wxT( "" ), true, F_SilkS );
138
139 textInfo.m_Text = entry.at(0).get<wxString>();
140 textInfo.m_Visible = entry.at(1).get<bool>();
141 textInfo.m_Layer = entry.at(2).get<int>();
142
143 m_DesignSettings.m_DefaultFPTextItems.push_back( std::move( textInfo ) );
144 }
145 },
146 nlohmann::json::array( {
147 { "REF**", true, F_SilkS },
148 { "", true, F_Fab },
149 { "${REFERENCE}", true, F_Fab }
150 } ) ) );
151
152 m_params.emplace_back( new PARAM_SCALED<int>( "design_settings.silk_line_width",
156
157 m_params.emplace_back( new PARAM_SCALED<int>( "design_settings.silk_text_size_h",
160
161 m_params.emplace_back( new PARAM_SCALED<int>( "design_settings.silk_text_size_v",
164
165 m_params.emplace_back( new PARAM_SCALED<int>( "design_settings.silk_text_thickness",
168
169 m_params.emplace_back( new PARAM<bool>( "design_settings.silk_text_italic",
171
172 m_params.emplace_back( new PARAM_SCALED<int>( "design_settings.copper_line_width",
176
177 m_params.emplace_back( new PARAM_SCALED<int>( "design_settings.copper_text_size_h",
181
182 m_params.emplace_back( new PARAM_SCALED<int>( "design_settings.copper_text_size_v",
186
187 m_params.emplace_back( new PARAM_SCALED<int>( "design_settings.copper_text_thickness",
191
192 m_params.emplace_back( new PARAM<bool>( "design_settings.copper_text_italic",
194
195 m_params.emplace_back( new PARAM_SCALED<int>( "design_settings.edge_line_width",
199
200 m_params.emplace_back( new PARAM_SCALED<int>( "design_settings.courtyard_line_width",
204
205 m_params.emplace_back( new PARAM_SCALED<int>( "design_settings.fab_line_width",
209
210 m_params.emplace_back( new PARAM_SCALED<int>( "design_settings.fab_text_size_h",
213
214 m_params.emplace_back( new PARAM_SCALED<int>( "design_settings.fab_text_size_v",
217
218 m_params.emplace_back( new PARAM_SCALED<int>( "design_settings.fab_text_thickness",
221
222 m_params.emplace_back( new PARAM<bool>( "design_settings.fab_text_italic",
224
225 m_params.emplace_back( new PARAM_SCALED<int>( "design_settings.others_line_width",
229
230 m_params.emplace_back( new PARAM_SCALED<int>( "design_settings.others_text_size_h",
233
234 m_params.emplace_back( new PARAM_SCALED<int>( "design_settings.others_text_size_v",
237
238 m_params.emplace_back( new PARAM_SCALED<int>( "design_settings.others_text_thickness",
241
242 m_params.emplace_back( new PARAM<bool>( "design_settings.others_text_italic",
244
245 m_params.emplace_back( new PARAM_LAMBDA<nlohmann::json>( "editing.selection_filter",
246 [&]() -> nlohmann::json
247 {
248 nlohmann::json ret;
249
250 ret["lockedItems"] = m_SelectionFilter.lockedItems;
251 ret["footprints"] = m_SelectionFilter.footprints;
252 ret["text"] = m_SelectionFilter.text;
253 ret["tracks"] = m_SelectionFilter.tracks;
254 ret["vias"] = m_SelectionFilter.vias;
255 ret["pads"] = m_SelectionFilter.pads;
256 ret["graphics"] = m_SelectionFilter.graphics;
257 ret["zones"] = m_SelectionFilter.zones;
258 ret["keepouts"] = m_SelectionFilter.keepouts;
259 ret["dimensions"] = m_SelectionFilter.dimensions;
260 ret["otherItems"] = m_SelectionFilter.otherItems;
261
262 return ret;
263 },
264 [&]( const nlohmann::json& aVal )
265 {
266 if( aVal.empty() || !aVal.is_object() )
267 return;
268
269 SetIfPresent( aVal, "lockedItems", m_SelectionFilter.lockedItems );
270 SetIfPresent( aVal, "footprints", m_SelectionFilter.footprints );
271 SetIfPresent( aVal, "text", m_SelectionFilter.text );
272 SetIfPresent( aVal, "tracks", m_SelectionFilter.tracks );
273 SetIfPresent( aVal, "vias", m_SelectionFilter.vias );
274 SetIfPresent( aVal, "pads", m_SelectionFilter.pads );
275 SetIfPresent( aVal, "graphics", m_SelectionFilter.graphics );
276 SetIfPresent( aVal, "zones", m_SelectionFilter.zones );
277 SetIfPresent( aVal, "keepouts", m_SelectionFilter.keepouts );
278 SetIfPresent( aVal, "dimensions", m_SelectionFilter.dimensions );
279 SetIfPresent( aVal, "otherItems", m_SelectionFilter.otherItems );
280 },
281 {
282 { "lockedItems", false },
283 { "footprints", true },
284 { "text", true },
285 { "tracks", true },
286 { "vias", true },
287 { "pads", true },
288 { "graphics", true },
289 { "zones", true },
290 { "keepouts", true },
291 { "dimensions", true },
292 { "otherItems", true }
293 } ) );
294
296
297 registerMigration( 1, 2,
298 [&]() -> bool
299 {
300 // This is actually a migration for APP_SETTINGS_BASE::m_LibTree
301 return migrateLibTreeWidth();
302 } );
303}
304
305
307{
308 bool ret = APP_SETTINGS_BASE::MigrateFromLegacy( aCfg );
309
310 //
311 // NOTE: there's no value in line-wrapping these; it just makes the table unreadable.
312 //
313 ret &= fromLegacy<int>( aCfg, "ModeditLibWidth", "window.lib_width" );
314 ret &= fromLegacyString( aCfg, "import_last_path", "system.last_import_export_path" );
315 ret &= fromLegacyString( aCfg, "LibFootprintTextShownColumns", "window.footprint_text_shown_columns" );
316
317 ret &= fromLegacy<int>( aCfg, "FpEditorMagneticPads", "editing.magnetic_pads" );
318 ret &= fromLegacy<bool>( aCfg, "FpEditorDisplayPolarCoords", "editing.polar_coords" );
319 ret &= fromLegacy<int>( aCfg, "FpEditorUse45DegreeGraphicSegments", "editing.use_45_degree_graphic_segments" );
320
321 ret &= fromLegacy<bool>( aCfg, "FpEditorGraphicLinesDisplayMode", "pcb_display.graphic_items_fill" );
322 ret &= fromLegacy<bool>( aCfg, "FpEditorPadDisplayMode", "pcb_display.pad_fill" );
323 ret &= fromLegacy<bool>( aCfg, "FpEditorTextsDisplayMode", "pcb_display.footprint_text" );
324
325 ret &= fromLegacy<double>( aCfg, "FpEditorSilkLineWidth", "design_settings.silk_line_width" );
326 ret &= fromLegacy<double>( aCfg, "FpEditorSilkTextSizeH", "design_settings.silk_text_size_h" );
327 ret &= fromLegacy<double>( aCfg, "FpEditorSilkTextSizeV", "design_settings.silk_text_size_v" );
328 ret &= fromLegacy<double>( aCfg, "FpEditorSilkTextThickness", "design_settings.silk_text_thickness" );
329 ret &= fromLegacy<bool>( aCfg, "FpEditorSilkTextItalic", "design_settings.silk_text_italic" );
330 ret &= fromLegacy<double>( aCfg, "FpEditorCopperLineWidth", "design_settings.copper_line_width" );
331 ret &= fromLegacy<double>( aCfg, "FpEditorCopperTextSizeH", "design_settings.copper_text_size_h" );
332 ret &= fromLegacy<double>( aCfg, "FpEditorCopperTextSizeV", "design_settings.copper_text_size_v" );
333 ret &= fromLegacy<double>( aCfg, "FpEditorCopperTextThickness", "design_settings.copper_text_thickness" );
334 ret &= fromLegacy<bool>( aCfg, "FpEditorCopperTextItalic", "design_settings.copper_text_italic" );
335 ret &= fromLegacy<double>( aCfg, "FpEditorEdgeCutLineWidth", "design_settings.edge_line_width" );
336 ret &= fromLegacy<double>( aCfg, "FpEditorCourtyardLineWidth", "design_settings.courtyard_line_width" );
337 ret &= fromLegacy<double>( aCfg, "FpEditorOthersLineWidth", "design_settings.others_line_width" );
338 ret &= fromLegacy<double>( aCfg, "FpEditorOthersTextSizeH", "design_settings.others_text_size_h" );
339 ret &= fromLegacy<double>( aCfg, "FpEditorOthersTextSizeV", "design_settings.others_text_size_v" );
340 ret &= fromLegacy<double>( aCfg, "FpEditorOthersTextThickness", "design_settings.others_text_thickness" );
341 ret &= fromLegacy<bool>( aCfg, "FpEditorOthersTextItalic", "design_settings.others_text_italic" );
342
343 nlohmann::json textItems = nlohmann::json::array( {
344 { "REF**", true, F_SilkS },
345 { "", true, F_Fab }
346 } );
347
348 Set( "design_settings.default_footprint_text_items", textItems );
349
350 ret &= fromLegacyString( aCfg, "FpEditorRefDefaultText", "design_settings.default_footprint_text_items.0.0" );
351 ret &= fromLegacy<bool>( aCfg, "FpEditorRefDefaultVisibility", "design_settings.default_footprint_text_items.0.1" );
352 ret &= fromLegacy<int>( aCfg, "FpEditorRefDefaultLayer", "design_settings.default_footprint_text_items.0.2" );
353 ret &= fromLegacyString( aCfg, "FpEditorValueDefaultText", "design_settings.default_footprint_text_items.1.0" );
354 ret &= fromLegacy<bool>( aCfg, "FpEditorValueDefaultVisibility", "design_settings.default_footprint_text_items.1.1" );
355 ret &= fromLegacy<int>( aCfg, "FpEditorValueDefaultLayer", "design_settings.default_footprint_text_items.1.2" );
356
357
358 std::string f = "ModEdit";
359
360 // Migrate color settings that were stored in the pcbnew config file
361 // We create a copy of the user scheme for the footprint editor context
362
363 SETTINGS_MANAGER& manager = Pgm().GetSettingsManager();
364 COLOR_SETTINGS* cs = manager.AddNewColorSettings( "user_footprints" );
365
366 cs->SetName( wxT( "User (Footprints)" ) );
367 manager.Save( cs );
368
369 auto migrateLegacyColor = [&] ( const std::string& aKey, int aLayerId )
370 {
371 wxString str;
372
373 if( aCfg->Read( aKey, &str ) )
374 cs->SetColor( aLayerId, COLOR4D( str ) );
375 };
376
377 for( int i = 0; i < PCB_LAYER_ID_COUNT; ++i )
378 {
379 wxString layer = LSET::Name( PCB_LAYER_ID( i ) );
380 migrateLegacyColor( f + "Color4DPCBLayer_" + layer.ToStdString(), PCB_LAYER_ID( i ) );
381 }
382
383 migrateLegacyColor( f + "Color4DAnchorEx", LAYER_ANCHOR );
384 migrateLegacyColor( f + "Color4DAuxItems", LAYER_AUX_ITEMS );
385 migrateLegacyColor( f + "Color4DGrid", LAYER_GRID );
386 migrateLegacyColor( f + "Color4DNonPlatedEx", LAYER_NON_PLATEDHOLES );
387 migrateLegacyColor( f + "Color4DPadThruHoleEx", LAYER_PADS_TH );
388 migrateLegacyColor( f + "Color4DPCBBackground", LAYER_PCB_BACKGROUND );
389 migrateLegacyColor( f + "Color4DPCBCursor", LAYER_CURSOR );
390 migrateLegacyColor( f + "Color4DRatsEx", LAYER_RATSNEST );
391 migrateLegacyColor( f + "Color4DTxtInvisEx", LAYER_MOD_TEXT_INVISIBLE );
392 migrateLegacyColor( f + "Color4DViaBBlindEx", LAYER_VIA_BBLIND );
393 migrateLegacyColor( f + "Color4DViaMicroEx", LAYER_VIA_MICROVIA );
394 migrateLegacyColor( f + "Color4DViaThruEx", LAYER_VIA_THROUGH );
395 migrateLegacyColor( f + "Color4DWorksheet", LAYER_DRAWINGSHEET );
396
397 manager.SaveColorSettings( cs, "board" );
398
399 ( *m_internals )[m_internals->PointerFromString( "appearance.color_theme" )] = "user_footprints";
400
401 double x, y;
402 f = "ModEditFrame";
403
404 if( aCfg->Read( f + "PcbUserGrid_X", &x ) && aCfg->Read( f + "PcbUserGrid_Y", &y ) )
405 {
406 EDA_UNITS u = static_cast<EDA_UNITS>( aCfg->ReadLong( f + "PcbUserGrid_Unit",
407 static_cast<long>( EDA_UNITS::INCHES ) ) );
408
409 // Convert to internal units
412
413 Set( "window.grid.user_grid_x", EDA_UNIT_UTILS::UI::StringFromValue( pcbIUScale, u, x ) );
414 Set( "window.grid.user_grid_y", EDA_UNIT_UTILS::UI::StringFromValue( pcbIUScale, u, y ) );
415 }
416
417 return ret;
418}
419
420
422{
430 if( !m_manager )
431 {
432 wxLogTrace( traceSettings,
433 wxT( "Error: FOOTPRINT_EDITOR_SETTINGS migration cannot run unmanaged!" ) );
434 return false;
435 }
436
437 std::string theme_ptr( "appearance.color_theme" );
438
439 if( !Contains( theme_ptr ) )
440 return true;
441
442 wxString selected = At( theme_ptr ).get<wxString>();
443 wxString search = selected + wxT( "_footprints" );
444
445 for( COLOR_SETTINGS* settings : Pgm().GetSettingsManager().GetColorSettingsList() )
446 {
447 if( settings->GetFilename() == search )
448 {
449 wxLogTrace( traceSettings, wxT( "Updating footprint editor theme from %s to %s" ),
450 selected, search );
451 Set( theme_ptr, search );
452 return true;
453 }
454 }
455
456 return true;
457}
ARC_EDIT_MODE
Settings for arc editing.
Definition: app_settings.h:70
@ KEEP_CENTER_ADJUST_ANGLE_RADIUS
constexpr EDA_IU_SCALE pcbIUScale
Definition: base_units.h:109
#define DEFAULT_TEXT_WIDTH
#define DEFAULT_COPPER_TEXT_WIDTH
#define DEFAULT_SILK_TEXT_SIZE
#define DEFAULT_COPPER_LINE_WIDTH
#define DEFAULT_SILK_LINE_WIDTH
@ LAYER_CLASS_OTHERS
@ LAYER_CLASS_FAB
@ LAYER_CLASS_COURTYARD
@ LAYER_CLASS_SILK
@ LAYER_CLASS_COPPER
@ LAYER_CLASS_EDGES
#define DEFAULT_SILK_TEXT_WIDTH
#define DEFAULT_EDGE_WIDTH
#define DEFAULT_COPPER_TEXT_SIZE
#define DEFAULT_LINE_WIDTH
#define DEFAULT_COURTYARD_WIDTH
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
Definition: app_settings.h:110
virtual bool MigrateFromLegacy(wxConfigBase *aCfg) override
Migrates from wxConfig to JSON-based configuration.
bool migrateLibTreeWidth()
Migrates the library tree width setting from a single column (Item) to multi-column.
std::vector< TEXT_ITEM_INFO > m_DefaultFPTextItems
int m_TextThickness[LAYER_CLASS_COUNT]
int m_LineThickness[LAYER_CLASS_COUNT]
wxSize m_TextSize[LAYER_CLASS_COUNT]
bool m_TextItalic[LAYER_CLASS_COUNT]
Color settings are a bit different than most of the settings objects in that there can be more than o...
void SetName(const wxString &aName)
void SetColor(int aLayer, const COLOR4D &aColor)
int AsTenthsOfADegree() const
Definition: eda_angle.h:151
BOARD_DESIGN_SETTINGS m_DesignSettings
Only some of these settings are actually used for footprint editing.
std::vector< LAYER_PRESET > m_LayerPresets
SELECTION_FILTER_OPTIONS m_SelectionFilter
virtual bool MigrateFromLegacy(wxConfigBase *aLegacyConfig) override
Migrates from wxConfig to JSON-based configuration.
bool fromLegacyString(wxConfigBase *aConfig, const std::string &aKey, const std::string &aDest)
Translates a legacy wxConfig string value to a given JSON pointer value.
SETTINGS_MANAGER * m_manager
A pointer to the settings manager managing this file (may be null)
bool Contains(const std::string &aPath) const
static bool SetIfPresent(const nlohmann::json &aObj, const std::string &aPath, wxString &aTarget)
Sets the given string if the given key/path is present.
std::vector< PARAM_BASE * > m_params
The list of parameters (owned by this object)
void registerMigration(int aOldSchemaVersion, int aNewSchemaVersion, std::function< bool(void)> aMigrator)
Registers a migration from one schema version to another.
nlohmann::json & At(const std::string &aPath)
Wrappers for the underlying JSON API so that most consumers don't need json.hpp All of these function...
std::unique_ptr< JSON_SETTINGS_INTERNALS > m_internals
void Set(const std::string &aPath, ValueType aVal)
Stores a value into the JSON document Will throw an exception if ValueType isn't something that the l...
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:104
static const wxChar * Name(PCB_LAYER_ID aLayerId)
Return the fixed name association with aLayerId.
Definition: lset.cpp:82
Like a normal param, but with custom getter and setter functions.
Definition: parameters.h:282
Represents a parameter that has a scaling factor between the value in the file and the value used int...
Definition: parameters.h:335
void SaveColorSettings(COLOR_SETTINGS *aSettings, const std::string &aNamespace="")
Safely saves a COLOR_SETTINGS to disk, preserving any changes outside the given namespace.
COLOR_SETTINGS * AddNewColorSettings(const wxString &aFilename)
Registers a new color settings object with the given filename.
The common library.
#define DEFAULT_TEXT_SIZE
Ratio of the font height to the baseline of the text above the wire.
@ TENTHS_OF_A_DEGREE_T
Definition: eda_angle.h:30
static constexpr EDA_ANGLE & ANGLE_90
Definition: eda_angle.h:425
EDA_UNITS
Definition: eda_units.h:43
const int fpEditSchemaVersion
! Update the schema version whenever a migration is required
nlohmann::json json
Definition: gerbview.cpp:44
const wxChar *const traceSettings
Flag to enable debug output of settings operations and management.
@ LAYER_GRID
Definition: layer_ids.h:205
@ LAYER_MOD_TEXT_INVISIBLE
text marked as invisible
Definition: layer_ids.h:200
@ LAYER_NON_PLATEDHOLES
handle color for not plated holes (holes, not pads)
Definition: layer_ids.h:197
@ LAYER_DRAWINGSHEET
drawingsheet frame and titleblock
Definition: layer_ids.h:217
@ LAYER_PCB_BACKGROUND
PCB background color.
Definition: layer_ids.h:220
@ LAYER_CURSOR
PCB cursor.
Definition: layer_ids.h:221
@ LAYER_AUX_ITEMS
Auxiliary items (guides, rule, etc)
Definition: layer_ids.h:222
@ LAYER_RATSNEST
Definition: layer_ids.h:204
@ LAYER_ANCHOR
anchor of items having an anchor point (texts, footprints)
Definition: layer_ids.h:201
@ LAYER_PADS_TH
multilayer pads, usually with holes
Definition: layer_ids.h:213
@ LAYER_VIA_MICROVIA
to draw micro vias
Definition: layer_ids.h:194
@ LAYER_VIA_THROUGH
to draw usual through hole vias
Definition: layer_ids.h:196
@ LAYER_VIA_BBLIND
to draw blind/buried vias
Definition: layer_ids.h:195
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:59
@ F_Fab
Definition: layer_ids.h:120
@ F_SilkS
Definition: layer_ids.h:104
@ PCB_LAYER_ID_COUNT
Definition: layer_ids.h:137
double FromUserUnit(const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnit, double aValue)
Return in internal units the value "val" given in a real unit such as "in", "mm" or "deg".
Definition: eda_units.cpp:396
wxString StringFromValue(const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnits, double aValue, bool aAddUnitsText=false, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
Returns the string from aValue according to aUnits (inch, mm ...) for display.
Definition: eda_units.cpp:236
#define TEXTS_MAX_SIZE
Maximum text size in internal units (10 inches)
Definition: pcbnew.h:32
#define TEXTS_MIN_SIZE
Minimum text size in internal units (1 mil)
Definition: pcbnew.h:31
#define TEXTS_MAX_WIDTH
Maximum text width in internal units (10 inches)
Definition: pcbnew.h:33
SETTINGS_MANAGER * GetSettingsManager()
see class PGM_BASE
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:111
const double MM_PER_IU
Definition: base_units.h:79
constexpr int mmToIU(double mm) const
Definition: base_units.h:89
MAGNETIC_OPTIONS tracks
MAGNETIC_OPTIONS pads
bool graphics
Graphic lines, shapes, polygons.
bool text
Text (free or attached to a footprint)
bool lockedItems
Allow selecting locked items.
bool footprints
Allow selecting entire footprints.
bool dimensions
Dimension items.
bool otherItems
Anything not fitting one of the above categories.
Functions to provide common constants and other functions to assist in making a consistent UI.