KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pcbnew_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-2023 KiCad Developers, see AUTHORS.txt for contributors.
5*
6* This program is free software; you can redistribute it and/or
7* modify it under the terms of the GNU General Public License
8* as published by the Free Software Foundation; either version 2
9* of the License, or (at your option) any later version.
10*
11* This program is distributed in the hope that it will be useful,
12* but WITHOUT ANY WARRANTY; without even the implied warranty of
13* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14* GNU General Public License for more details.
15*
16* You should have received a copy of the GNU General Public License
17* along with this program; if not, you may find one here:
18* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19* or you may search the http://www.gnu.org website for the version 2 license,
20* or you may write to the Free Software Foundation, Inc.,
21* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22*/
23
24#include <pybind11/pybind11.h>
25
26#include <common.h>
28#include <layer_ids.h>
29#include <pcbnew_settings.h>
30#include <pgm_base.h>
34#include <settings/parameters.h>
36#include <wx/config.h>
37#include <wx/tokenzr.h>
38#include <zones.h>
39#include <widgets/ui_common.h>
40#include <base_units.h>
41
42#include "../3d-viewer/3d_viewer/eda_3d_viewer_settings.h"
43
44
46const int pcbnewSchemaVersion = 5;
47
48
51 m_AuiPanels(),
52 m_Cleanup(),
53 m_DrcDialog(),
54 m_ExportIdf(),
55 m_ExportStep(),
56 m_ExportSvg(),
57 m_ExportVrml(),
58 m_FootprintWizardList(),
59 m_GenDrill(),
60 m_ImportGraphics(),
61 m_NetlistDialog(),
62 m_PlaceFile(),
63 m_Plot(),
64 m_FootprintChooser(),
65 m_Zones(),
66 m_FootprintViewer(),
67 m_FootprintWizard(),
68 m_Display(),
69 m_TrackDragAction( TRACK_DRAG_ACTION::DRAG ),
71 m_CtrlClickHighlight( false ),
72 m_Use45DegreeLimit( false ),
73 m_FlipLeftRight( false ),
74 m_ESCClearsNetHighlight( true ),
75 m_PolarCoords( false ),
76 m_RotationAngle( ANGLE_90 ),
77 m_ShowPageLimits( true ),
78 m_ShowCourtyardCollisions( true ),
79 m_AutoRefillZones( false ),
80 m_AllowFreePads( false ),
81 m_PnsSettings( nullptr ),
82 m_FootprintViewerZoom( 1.0 ),
83 m_FootprintViewerAutoZoomOnSelect( true ),
84 m_FootprintViewerLibListWidth( 200 ),
85 m_FootprintViewerFPListWidth( 300 )
86{
87 m_MagneticItems.pads = MAGNETIC_OPTIONS::CAPTURE_CURSOR_IN_TRACK_TOOL;
88 m_MagneticItems.tracks = MAGNETIC_OPTIONS::CAPTURE_CURSOR_IN_TRACK_TOOL;
90
91 m_params.emplace_back( new PARAM<bool>( "aui.show_layer_manager",
93
94 m_params.emplace_back( new PARAM<int>( "aui.right_panel_width",
96
97 m_params.emplace_back( new PARAM<int>( "aui.properties_panel_width",
99
100 m_params.emplace_back( new PARAM<float>( "aui.properties_splitter_proportion",
102
103 m_params.emplace_back( new PARAM<int>( "aui.search_panel_height",
105
106 m_params.emplace_back( new PARAM<int>( "aui.appearance_panel_tab",
107 &m_AuiPanels.appearance_panel_tab, 0, 0, 2 ) );
108
109 m_params.emplace_back( new PARAM<bool>( "aui.appearance_expand_layer_display",
111
112 m_params.emplace_back( new PARAM<bool>( "aui.appearance_expand_net_display",
114
115 m_params.emplace_back( new PARAM<bool>( "aui.show_properties",
116 &m_AuiPanels.show_properties, false ) );
117
118 m_params.emplace_back( new PARAM<bool>( "aui.show_search",
119 &m_AuiPanels.show_search, false ) );
120
121 m_params.emplace_back( new PARAM<int>( "footprint_chooser.width",
122 &m_FootprintChooser.width, -1 ) );
123
124 m_params.emplace_back( new PARAM<int>( "footprint_chooser.height",
125 &m_FootprintChooser.height, -1 ) );
126
127 m_params.emplace_back( new PARAM<int>( "footprint_chooser.sash_h",
128 &m_FootprintChooser.sash_h, -1 ) );
129
130 m_params.emplace_back( new PARAM<int>( "footprint_chooser.sash_v",
131 &m_FootprintChooser.sash_v, -1 ) );
132
133 m_params.emplace_back( new PARAM<int>( "footprint_chooser.sort_mode",
135
136 m_params.emplace_back( new PARAM<bool>( "editing.flip_left_right",
137 &m_FlipLeftRight, true ) );
138
139 m_params.emplace_back( new PARAM<bool>( "editing.esc_clears_net_highlight",
140 &m_ESCClearsNetHighlight, true ) );
141
142 m_params.emplace_back( new PARAM<bool>( "editing.show_courtyard_collisions",
143 &m_ShowCourtyardCollisions, true ) );
144
145 m_params.emplace_back( new PARAM<bool>( "editing.magnetic_graphics",
146 &m_MagneticItems.graphics, true ) );
147
148 m_params.emplace_back( new PARAM<int>( "editing.magnetic_pads",
149 reinterpret_cast<int*>( &m_MagneticItems.pads ),
150 static_cast<int>( MAGNETIC_OPTIONS::CAPTURE_CURSOR_IN_TRACK_TOOL ) ) );
151
152 m_params.emplace_back( new PARAM<int>( "editing.magnetic_tracks",
153 reinterpret_cast<int*>( &m_MagneticItems.tracks ),
154 static_cast<int>( MAGNETIC_OPTIONS::CAPTURE_CURSOR_IN_TRACK_TOOL ) ) );
155
156 m_params.emplace_back( new PARAM<bool>( "editing.polar_coords",
157 &m_PolarCoords, false ) );
158
159 m_params.emplace_back( new PARAM<int>( "editing.track_drag_action",
160 reinterpret_cast<int*>( &m_TrackDragAction ),
161 static_cast<int>( TRACK_DRAG_ACTION::DRAG ) ) );
162
163 m_params.emplace_back( new PARAM<int>( "editing.arc_edit_mode",
164 reinterpret_cast<int*>( &m_ArcEditMode ),
165 static_cast<int>( ARC_EDIT_MODE::KEEP_CENTER_ADJUST_ANGLE_RADIUS ) ) );
166
167 m_params.emplace_back( new PARAM<bool>( "editing.ctrl_click_highlight",
168 &m_CtrlClickHighlight, false ) );
169
170 m_params.emplace_back( new PARAM<bool>( "editing.pcb_use_45_degree_limit",
171 &m_Use45DegreeLimit, false ) );
172
173 m_params.emplace_back( new PARAM<bool>( "editing.auto_fill_zones",
174 &m_AutoRefillZones, false ) );
175
176 m_params.emplace_back( new PARAM<bool>( "editing.allow_free_pads",
177 &m_AllowFreePads, false ) );
178
179 m_params.emplace_back( new PARAM_LAMBDA<int>( "editing.rotation_angle",
180 [this] () -> int
181 {
183
184 // Don't store values larger than 360 degrees
185 return rot % 3600;
186 },
187 [this] ( int aVal )
188 {
189 if( aVal )
191
192 // A misconfiguration allowed some angles to be stored as tenth of a degree but read
193 // as tens of degrees. By disallowing storage of values larger than 360, we can weed out
194 // those invalid values here.
195 while( m_RotationAngle > ANGLE_360 )
197
198 },
199 900 ) );
200
201 m_params.emplace_back( new PARAM<bool>( "pcb_display.graphic_items_fill",
203
204 m_params.emplace_back( new PARAM<int>( "pcb_display.max_links_shown",
205 &m_Display.m_MaxLinksShowed, 3, 0, 15 ) );
206
207 m_params.emplace_back( new PARAM<bool>( "pcb_display.graphics_fill",
209
210 m_params.emplace_back( new PARAM<bool>( "pcb_display.text_fill",
212
213 m_params.emplace_back( new PARAM<int>( "pcb_display.net_names_mode",
214 &m_Display.m_NetNames, 3, 0, 3 ) );
215
216 m_params.emplace_back( new PARAM<bool>( "pcb_display.pad_clearance",
217 &m_Display.m_PadClearance, true ) );
218
219 m_params.emplace_back( new PARAM<bool>( "pcb_display.pad_fill",
221
222 m_params.emplace_back( new PARAM<bool>( "pcb_display.pad_numbers",
224
225 m_params.emplace_back( new PARAM<bool>( "pcb_display.ratsnest_global",
227
228 m_params.emplace_back( new PARAM<bool>( "pcb_display.ratsnest_footprint",
230
231 m_params.emplace_back( new PARAM<bool>( "pcb_display.ratsnest_curved",
233
234 m_params.emplace_back( new PARAM<double>( "pcb_display.ratsnest_thickness",
236
237 m_params.emplace_back( new PARAM<int>( "pcb_display.track_clearance_mode",
238 reinterpret_cast<int*>( &m_Display.m_TrackClearance ), SHOW_WITH_VIA_WHILE_ROUTING ) );
239
240 m_params.emplace_back( new PARAM<bool>( "pcb_display.track_fill",
242
243 m_params.emplace_back( new PARAM<bool>( "pcb_display.via_fill",
244 &m_Display.m_DisplayViaFill, true ) );
245
246 m_params.emplace_back( new PARAM<int>( "pcb_display.origin_mode",
247 reinterpret_cast<int*>( &m_Display.m_DisplayOrigin ),
248 PCB_DISPLAY_ORIGIN::PCB_ORIGIN_PAGE ) );
249
250 m_params.emplace_back( new PARAM<bool>( "pcb_display.origin_invert_x_axis",
252
253 m_params.emplace_back( new PARAM<bool>( "pcb_display.origin_invert_y_axis",
255
256 m_params.emplace_back( new PARAM<bool>( "pcb_display.live_3d_refresh",
257 &m_Display.m_Live3DRefresh, false ) );
258
259 m_params.emplace_back( new PARAM<bool>( "pcb_display.show_page_borders",
260 &m_ShowPageLimits, true ) );
261
262 m_params.emplace_back( new PARAM<bool>( "cleanup.cleanup_vias",
263 &m_Cleanup.cleanup_vias, true ) );
264
265 m_params.emplace_back( new PARAM<bool>( "cleanup.delete_dangling_vias",
267
268 m_params.emplace_back( new PARAM<bool>( "cleanup.merge_segments",
269 &m_Cleanup.merge_segments, true ) );
270
271 m_params.emplace_back( new PARAM<bool>( "cleanup.cleanup_unconnected",
273
274 m_params.emplace_back( new PARAM<bool>( "cleanup.cleanup_short_circuits",
276
277 m_params.emplace_back( new PARAM<bool>( "cleanup.cleanup_tracks_in_pad",
279
280 m_params.emplace_back( new PARAM<bool>( "drc_dialog.refill_zones",
281 &m_DrcDialog.refill_zones, true ) );
282
283 m_params.emplace_back( new PARAM<bool>( "drc_dialog.test_all_track_errors",
285
286 m_params.emplace_back( new PARAM<bool>( "drc_dialog.test_footprints",
287 &m_DrcDialog.test_footprints, false ) );
288
289 m_params.emplace_back( new PARAM<int>( "drc_dialog.severities",
291
292 m_params.emplace_back( new PARAM<bool>( "gen_drill.merge_pth_npth",
293 &m_GenDrill.merge_pth_npth, false ) );
294
295 m_params.emplace_back( new PARAM<bool>( "gen_drill.minimal_header",
296 &m_GenDrill.minimal_header, false ) );
297
298 m_params.emplace_back( new PARAM<bool>( "gen_drill.mirror",
299 &m_GenDrill.mirror, false ) );
300
301 m_params.emplace_back( new PARAM<bool>( "gen_drill.unit_drill_is_inch",
303
304 m_params.emplace_back( new PARAM<bool>( "gen_drill.use_route_for_oval_holes",
306
307 m_params.emplace_back( new PARAM<int>( "gen_drill.drill_file_type",
309
310 m_params.emplace_back( new PARAM<int>( "gen_drill.map_file_type",
312
313 m_params.emplace_back( new PARAM<int>( "gen_drill.zeros_format",
314 &m_GenDrill.zeros_format, 0, 0, 3 ) );
315
316 m_params.emplace_back( new PARAM<bool>( "export_idf.auto_adjust",
317 &m_ExportIdf.auto_adjust, false ) );
318
319 m_params.emplace_back( new PARAM<int>( "export_idf.ref_units",
320 &m_ExportIdf.ref_units, 0 ) );
321
322 m_params.emplace_back( new PARAM<double>( "export_idf.ref_x",
323 &m_ExportIdf.ref_x, 0 ) );
324
325 m_params.emplace_back( new PARAM<double>( "export_idf.ref_y",
326 &m_ExportIdf.ref_y, 0 ) );
327
328 m_params.emplace_back( new PARAM<bool>( "export_idf.units_mils",
329 &m_ExportIdf.units_mils, false ) );
330
331 m_params.emplace_back( new PARAM<int>( "export_step.origin_mode",
333
334 m_params.emplace_back( new PARAM<int>( "export_step.origin_units",
336
337 m_params.emplace_back( new PARAM<double>( "export_step.origin_x",
338 &m_ExportStep.origin_x, 0 ) );
339
340 m_params.emplace_back( new PARAM<double>( "export_step.origin_y",
341 &m_ExportStep.origin_y, 0 ) );
342
343 m_params.emplace_back( new PARAM<bool>( "export_step.no_unspecified",
344 &m_ExportStep.no_unspecified, false ) );
345
346 m_params.emplace_back( new PARAM<bool>( "export_step.no_dnp",
347 &m_ExportStep.no_dnp, false ) );
348
349 m_params.emplace_back( new PARAM<bool>( "export_step.replace_models",
350 &m_ExportStep.replace_models, true ) );
351
352 m_params.emplace_back( new PARAM<bool>( "export_step.overwrite_file",
353 &m_ExportStep.overwrite_file, true ) );
354
355 m_params.emplace_back( new PARAM<bool>( "export_svg.black_and_white",
356 &m_ExportSvg.black_and_white, false ) );
357
358 m_params.emplace_back( new PARAM<bool>( "export_svg.mirror",
359 &m_ExportSvg.mirror, false ) );
360
361 m_params.emplace_back( new PARAM<bool>( "export_svg.one_file",
362 &m_ExportSvg.one_file, false ) );
363
364 m_params.emplace_back(new PARAM<bool>( "export_svg.plot_board_edges",
365 &m_ExportSvg.plot_board_edges, true ) );
366
367 m_params.emplace_back( new PARAM<int>( "export_svg.page_size",
368 &m_ExportSvg.page_size, 0 ) );
369
370 m_params.emplace_back( new PARAM<wxString>( "export_svg.output_dir",
371 &m_ExportSvg.output_dir, "" ) );
372
373 m_params.emplace_back( new PARAM_LIST<int>( "export_svg.layers",
374 &m_ExportSvg.layers, {} ) );
375
376 m_params.emplace_back( new PARAM<int>( "export_vrml.units",
377 &m_ExportVrml.units, 1 ) );
378
379 m_params.emplace_back( new PARAM<bool>( "export_vrml.copy_3d_models",
380 &m_ExportVrml.copy_3d_models, false ) );
381
382 m_params.emplace_back( new PARAM<bool>( "export_vrml.use_relative_paths",
384
385 m_params.emplace_back( new PARAM<int>( "export_vrml.ref_units",
386 &m_ExportVrml.ref_units, 0 ) );
387
388 m_params.emplace_back( new PARAM<double>( "export_vrml.ref_x",
389 &m_ExportVrml.ref_x, 0 ) );
390
391 m_params.emplace_back( new PARAM<double>( "export_vrml.ref_y",
392 &m_ExportVrml.ref_y, 0 ) );
393
394 m_params.emplace_back( new PARAM<int>( "export_vrml.origin_mode",
396
397 m_params.emplace_back( new PARAM<int>( "zones.net_sort_mode",
398 &m_Zones.net_sort_mode, -1 ) );
399
400 m_params.emplace_back( new PARAM<int>( "import_graphics.layer",
402
403 m_params.emplace_back( new PARAM<bool>( "import_graphics.interactive_placement",
405
406 m_params.emplace_back( new PARAM<int>( "import_graphics.line_width_units",
408
409 m_params.emplace_back( new PARAM<double>( "import_graphics.line_width",
411
412 m_params.emplace_back( new PARAM<int>( "import_graphics.origin_units",
414
415 m_params.emplace_back( new PARAM<double>( "import_graphics.origin_x",
417
418 m_params.emplace_back( new PARAM<double>( "import_graphics.origin_y",
420
421 m_params.emplace_back( new PARAM<int>( "import_graphics.dxf_units",
423
424 m_params.emplace_back( new PARAM<int>( "netlist.report_filter",
426
427 m_params.emplace_back( new PARAM<bool>( "netlist.update_footprints",
429
430 m_params.emplace_back( new PARAM<bool>( "netlist.delete_shorting_tracks",
432
433 m_params.emplace_back( new PARAM<bool>( "netlist.delete_extra_footprints",
435
436 m_params.emplace_back( new PARAM<bool>( "netlist.associate_by_ref_sch",
438
439 m_params.emplace_back( new PARAM<wxString>( "place_file.output_directory",
440 &m_PlaceFile.output_directory, wxEmptyString ) );
441
442 m_params.emplace_back( new PARAM<int>( "place_file.units",
443 &m_PlaceFile.units, 1 ) );
444
445 m_params.emplace_back( new PARAM<int>( "place_file.file_options",
447
448 m_params.emplace_back( new PARAM<int>( "place_file.file_format",
449 &m_PlaceFile.file_format, 0 ) );
450
451 m_params.emplace_back( new PARAM<bool>( "place_file.excludeTH",
452 &m_PlaceFile.exclude_TH, false ) );
453
454 m_params.emplace_back( new PARAM<bool>( "place_file.onlySMD",
455 &m_PlaceFile.only_SMD, false ) );
456
457 m_params.emplace_back( new PARAM<bool>( "place_file.include_board_edge",
459
460 m_params.emplace_back( new PARAM<bool>( "place_file.use_place_file_origin",
461 &m_PlaceFile.use_aux_origin, true ) );
462
463 m_params.emplace_back( new PARAM<bool>( "place_file.negate_xcoord",
464 &m_PlaceFile.negate_xcoord, false ) );
465
466 m_params.emplace_back( new PARAM<int>( "plot.all_layers_on_one_page",
468
469 m_params.emplace_back( new PARAM<bool>( "plot.edgecut_on_all_layers",
470 &m_Plot.edgecut_on_all_layers, true ) );
471
472 m_params.emplace_back( new PARAM<int>( "plot.pads_drill_mode",
473 &m_Plot.pads_drill_mode, 2 ) );
474
475 m_params.emplace_back( new PARAM<double>( "plot.fine_scale_x",
476 &m_Plot.fine_scale_x, 0 ) );
477
478 m_params.emplace_back( new PARAM<double>( "plot.fine_scale_y",
479 &m_Plot.fine_scale_y, 0 ) );
480
481 m_params.emplace_back( new PARAM<double>( "plot.ps_fine_width_adjust",
483
484 m_params.emplace_back( new PARAM<bool>( "plot.check_zones_before_plotting",
486
487 m_params.emplace_back( new PARAM<bool>( "plot.mirror",
488 &m_Plot.mirror, false ) );
489
490 m_params.emplace_back( new PARAM<wxString>( "window.footprint_text_shown_columns",
491 &m_FootprintTextShownColumns, "0 1 2 3 4 5 6" ) );
492
493 m_params.emplace_back( new PARAM<int>( "footprint_wizard_list.width",
495
496 m_params.emplace_back( new PARAM<int>( "footprint_wizard_list.height",
498
499 m_params.emplace_back( new PARAM<bool>( "reannotate_dialog.annotate_sort_on_modules",
501 m_params.emplace_back( new PARAM<bool>( "reannotate_dialog.annotate_remove_front_prefix",
503 m_params.emplace_back( new PARAM<bool>( "reannotate_dialog.annotate_remove_back_prefix",
505 m_params.emplace_back( new PARAM<bool>( "reannotate_dialog.annotate_exclude_locked",
506 &m_Reannotate.exclude_locked, false ) );
507
508 m_params.emplace_back( new PARAM<int>( "reannotate_dialog.annotate_grid_index",
509 &m_Reannotate.grid_index, 0 ) );
510 m_params.emplace_back( new PARAM<int>( "reannotate_dialog.annotate_sort_code",
511 &m_Reannotate.sort_code, 0 ) );
512 m_params.emplace_back( new PARAM<int>( "reannotate_dialog.annotate_choice",
514 m_params.emplace_back( new PARAM<int>( "reannotate_dialog.annotate_report_severity",
516
517 m_params.emplace_back( new PARAM<wxString>( "reannotate_dialog.annotate_front_refdes_start",
519 m_params.emplace_back( new PARAM<wxString>( "reannotate_dialog.annotate_back_refdes_start",
521 m_params.emplace_back( new PARAM<wxString>( "reannotate_dialog.annotate_front_prefix",
522 &m_Reannotate.front_prefix, "" ) );
523 m_params.emplace_back( new PARAM<wxString>( "reannotate_dialog.annotate_back_prefix",
524 &m_Reannotate.back_prefix, "" ) );
525 m_params.emplace_back( new PARAM<wxString>( "reannotate_dialog.annotate_exclude_list",
526 &m_Reannotate.exclude_list, "" ) );
527 m_params.emplace_back( new PARAM<wxString>( "reannotate_dialog.annotate_report_file_name",
529
530 m_params.emplace_back( new PARAM_LAMBDA<nlohmann::json>( "action_plugins",
531 [&]() -> nlohmann::json
532 {
533 nlohmann::json js = nlohmann::json::array();
534
535 for( const auto& pair : m_VisibleActionPlugins )
536 js.push_back( nlohmann::json( { { pair.first.ToUTF8(), pair.second } } ) );
537
538 return js;
539 },
540 [&]( const nlohmann::json& aObj )
541 {
543
544 if( !aObj.is_array() )
545 {
546 return;
547 }
548
549 for( const auto& entry : aObj )
550 {
551 if( entry.empty() || !entry.is_object() )
552 continue;
553
554 for( const auto& pair : entry.items() )
555 {
556 m_VisibleActionPlugins.emplace_back( std::make_pair(
557 wxString( pair.key().c_str(), wxConvUTF8 ), pair.value() ) );
558 }
559 }
560 },
561 nlohmann::json::array() ) );
562
563 addParamsForWindow( &m_FootprintViewer, "footprint_viewer" );
564
565 m_params.emplace_back( new PARAM<double>( "footprint_viewer.zoom",
566 &m_FootprintViewerZoom, 1.0 ) );
567
568 m_params.emplace_back( new PARAM<bool>( "footprint_viewer.autozoom",
570
571 m_params.emplace_back( new PARAM<int>( "footprint_viewer.lib_list_width",
573
574 m_params.emplace_back( new PARAM<int>( "footprint_viewer.fp_list_width",
576
577 addParamsForWindow( &m_FootprintWizard, "footprint_wizard" );
578
579 m_params.emplace_back( new PARAM<wxString>( "system.last_footprint_lib_dir",
580 &m_lastFootprintLibDir, "" ) );
581
582 m_params.emplace_back( new PARAM<wxString>( "system.last_footprint3d_dir",
583 &m_lastFootprint3dDir, "" ) );
584
585 registerMigration( 0, 1,
586 [&]()
587 {
588 if( std::optional<int> optval = Get<int>( "pcb_display.rotation_angle" ) )
589 Set( "editing.rotation_angle", *optval );
590
591 try
592 {
593 At( "pcb_display" ).erase( "rotation_angle" );
594 }
595 catch( ... )
596 {}
597
598 return true;
599 } );
600
601 registerMigration( 1, 2,
602 [&]()
603 {
604 // In version 1 this meant "after Zone Properties dialog", but it now means
605 // "everywhere" so we knock it off on transition.
606 Set( "editing.auto_fill_zones", false );
607
608 return true;
609 } );
610
611
612 registerMigration( 2, 3,
613 [&]() -> bool
614 {
615 // We used to have a bug on GTK which would set the lib tree column width way
616 // too narrow.
617 if( std::optional<int> optval = Get<int>( "lib_tree.column_width" ) )
618 {
619 if( optval < 150 )
620 Set( "lib_tree.column_width", 300 );
621 }
622
623 return true;
624 } );
625
626 registerMigration( 3, 4,
627 [&]() -> bool
628 {
629 // This is actually a migration for APP_SETTINGS_BASE::m_LibTree
630 return migrateLibTreeWidth();
631 } );
632
633 registerMigration( 4, 5,
634 [&]() -> bool
635 {
636 // This default proved to be unpopular; bump it off for everyone
637 Set( "editing.auto_fill_zones", false );
638 return true;
639 } );
640}
641
642
644
645
646bool PCBNEW_SETTINGS::MigrateFromLegacy( wxConfigBase* aCfg )
647{
648 bool ret = APP_SETTINGS_BASE::MigrateFromLegacy( aCfg );
649
650 const std::string f = getLegacyFrameName();
651
652 //
653 // NOTE: there's no value in line-wrapping these; it just makes the table unreadable.
654 //
655 ret &= fromLegacy<bool>( aCfg, "ShowLayerManagerTools", "aui.show_layer_manager" );
656
657 ret &= fromLegacy<int>( aCfg, "FootprintChooserHSashPosition", "footprint_chooser.sash_h" );
658 ret &= fromLegacy<int>( aCfg, "FootprintChooserVSashPosition", "footprint_chooser.sash_v" );
659 ret &= fromLegacy<int>( aCfg, "FootprintChooserWidth", "footprint_chooser.width" );
660 ret &= fromLegacy<int>( aCfg, "FootprintChooserHeight", "footprint_chooser.height" );
661
662 ret &= fromLegacy<bool>( aCfg, "FlipLeftRight", "editing.flip_left_right" );
663 ret &= fromLegacy<bool>( aCfg, "MagneticGraphics", "editing.magnetic_graphics" );
664 ret &= fromLegacy<int>( aCfg, "MagneticPads", "editing.magnetic_pads" );
665 ret &= fromLegacy<int>( aCfg, "MagneticTracks", "editing.magnetic_tracks" );
666 ret &= fromLegacy<bool>( aCfg, "DisplayPolarCoords", "editing.polar_coords" );
667 ret &= fromLegacy<bool>( aCfg, "Use45DegreeGraphicSegments", "editing.use_45_degree_graphic_segments" );
668
669 ret &= fromLegacy<bool>( aCfg, "PcbAffT", "pcb_display.graphic_items_fill" );
670 ret &= fromLegacy<int>( aCfg, "MaxLnkS", "pcb_display.max_links_shown" );
671 ret &= fromLegacy<bool>( aCfg, "ModAffC", "pcb_display.footprint_edge_fill" );
672 ret &= fromLegacy<bool>( aCfg, "ModAffT", "pcb_display.footprint_text_fill" );
673 ret &= fromLegacy<int>( aCfg, "ShowNetNamesMode", "pcb_display.net_names_mode" );
674 ret &= fromLegacy<int>( aCfg, "PcbDisplayOrigin", "pcb_display.origin_mode" );
675 ret &= fromLegacy<bool>( aCfg, "PcbInvertXAxis", "pcb_display.origin_invert_x_axis" );
676 ret &= fromLegacy<bool>( aCfg, "PcbInvertYAxis", "pcb_display.origin_invert_y_axis" );
677 ret &= fromLegacy<bool>( aCfg, "PadAffG", "pcb_display.pad_clearance" );
678 ret &= fromLegacy<bool>( aCfg, "PadFill", "pcb_display.pad_fill" );
679 ret &= fromLegacy<bool>( aCfg, "PadSNum", "pcb_display.pad_numbers" );
680 ret &= fromLegacy<bool>( aCfg, "ShowRatsnestLines", "pcb_display.ratsnest_global" );
681 ret &= fromLegacy<bool>( aCfg, "ShowRatsnestModuleLines", "pcb_display.ratsnest_footprint" );
682 ret &= fromLegacy<bool>( aCfg, "CurvedRatsnestLines", "pcb_display.ratsnest_curved" );
683 ret &= fromLegacy<int>( aCfg, "RotationAngle", "pcb_display.rotation_angle" );
684 ret &= fromLegacy<int>( aCfg, "TrackDisplayClearance", "pcb_display.track_clearance_mode" );
685 ret &= fromLegacy<bool>( aCfg, "DisplayTrackFilled", "pcb_display.track_fill" );
686 ret &= fromLegacy<bool>( aCfg, "ViaFill", "pcb_display.via_fill" );
687 ret &= fromLegacy<int>( aCfg, "PcbShowZonesMode", "pcb_display.zone_mode" );
688
689 ret &= fromLegacy<double>( aCfg, "PlotLineWidth_mm", "plot.line_width" );
690
691 aCfg->SetPath( "/dialogs/cleanup_tracks" );
692 ret &= fromLegacy<bool>( aCfg, "DialogCleanupVias", "cleanup.cleanup_vias" );
693 ret &= fromLegacy<bool>( aCfg, "DialogCleanupMergeSegments", "cleanup.merge_segments" );
694 ret &= fromLegacy<bool>( aCfg, "DialogCleanupUnconnected", "cleanup.cleanup_unconnected" );
695 ret &= fromLegacy<bool>( aCfg, "DialogCleanupShortCircuit", "cleanup.cleanup_short_circuits" );
696 ret &= fromLegacy<bool>( aCfg, "DialogCleanupTracksInPads", "cleanup.cleanup_tracks_in_pad" );
697 aCfg->SetPath( "../.." );
698
699 ret &= fromLegacy<bool>( aCfg, "RefillZonesBeforeDrc", "drc_dialog.refill_zones" );
700 ret &= fromLegacy<bool>( aCfg, "DrcTestFootprints", "drc_dialog.test_footprints" );
701
702 ret &= fromLegacy<bool>( aCfg, "DrillMergePTHNPTH", "gen_drill.merge_pth_npth" );
703 ret &= fromLegacy<bool>( aCfg, "DrillMinHeader", "gen_drill.minimal_header" );
704 ret &= fromLegacy<bool>( aCfg, "DrillMirrorYOpt", "gen_drill.mirror" );
705 ret &= fromLegacy<bool>( aCfg, "DrillUnit", "gen_drill.unit_drill_is_inch" );
706 ret &= fromLegacy<bool>( aCfg, "OvalHolesRouteMode", "gen_drill.use_route_for_oval_holes" );
707 ret &= fromLegacy<int>( aCfg, "DrillFileType", "gen_drill.drill_file_type" );
708 ret &= fromLegacy<int>( aCfg, "DrillMapFileType", "gen_drill.map_file_type" );
709 ret &= fromLegacy<int>( aCfg, "DrillZerosFormat", "gen_drill.zeros_format" );
710
711 ret &= fromLegacy<bool>( aCfg, "IDFRefAutoAdj", "export_idf.auto_adjust" );
712 ret &= fromLegacy<int>( aCfg, "IDFRefUnits", "export_idf.ref_units" );
713 ret &= fromLegacy<double>( aCfg, "IDFRefX", "export_idf.ref_x" );
714 ret &= fromLegacy<double>( aCfg, "IDFRefY", "export_idf.ref_y" );
715 ret &= fromLegacy<bool>( aCfg, "IDFExportThou", "export_idf.units_mils" );
716
717 ret &= fromLegacy<int>( aCfg, "STEP_Origin_Opt", "export_step.origin_mode" );
718 ret &= fromLegacy<int>( aCfg, "STEP_UserOriginUnits", "export_step.origin_units" );
719 ret &= fromLegacy<double>( aCfg, "STEP_UserOriginX", "export_step.origin_x" );
720 ret &= fromLegacy<double>( aCfg, "STEP_UserOriginY", "export_step.origin_y" );
721 ret &= fromLegacy<bool>( aCfg, "STEP_NoVirtual", "export_step.no_virtual" );
722
723 ret &= fromLegacy<bool>( aCfg, "PlotSVGModeColor", "export_svg.black_and_white" );
724 ret &= fromLegacy<bool>( aCfg, "PlotSVGModeMirror", "export_svg.mirror" );
725 ret &= fromLegacy<bool>( aCfg, "PlotSVGModeOneFile", "export_svg.one_file" );
726 ret &= fromLegacy<bool>( aCfg, "PlotSVGBrdEdge", "export_svg.plot_board_edges" );
727 ret &= fromLegacy<int>( aCfg, "PlotSVGPageOpt", "export_svg.page_size" );
728 ret &= fromLegacyString( aCfg, "PlotSVGDirectory", "export_svg.output_dir" );
729
730 {
731 nlohmann::json js = nlohmann::json::array();
732 wxString key;
733 bool val = false;
734
735 for( unsigned i = 0; i < PCB_LAYER_ID_COUNT; ++i )
736 {
737 key.Printf( wxT( "PlotSVGLayer_%d" ), i );
738
739 if( aCfg->Read( key, &val ) && val )
740 js.push_back( i );
741 }
742
743 Set( "export_svg.layers", js );
744 }
745
746 {
747 nlohmann::json js = nlohmann::json::array();
748
749 wxString packed;
750
751 if( aCfg->Read( "ActionPluginButtons", &packed ) )
752 {
753 wxStringTokenizer pluginSettingsTokenizer = wxStringTokenizer( packed, ";" );
754
755 while( pluginSettingsTokenizer.HasMoreTokens() )
756 {
757 nlohmann::json row;
758 wxString plugin = pluginSettingsTokenizer.GetNextToken();
759 wxStringTokenizer pluginTokenizer = wxStringTokenizer( plugin, "=" );
760
761 if( pluginTokenizer.CountTokens() != 2 )
762 {
763 // Bad config
764 continue;
765 }
766
767 std::string key( pluginTokenizer.GetNextToken().ToUTF8() );
768 bool value( pluginTokenizer.GetNextToken().Cmp( wxT( "Visible" ) ) == 0 );
769
770 js.push_back( nlohmann::json( { { key, value } } ) );
771 }
772 }
773
774 Set( "action_plugins", js );
775 }
776
777 //
778 // NOTE: there's no value in line-wrapping these; it just makes the table unreadable.
779 //
780 ret &= fromLegacy<int>( aCfg, "VrmlExportUnit", "export_vrml.units" );
781 ret &= fromLegacy<bool>( aCfg, "VrmlExportCopyFiles", "export_vrml.copy_3d_models" );
782 ret &= fromLegacy<bool>( aCfg, "VrmlUseRelativePaths", "export_vrml.use_relative_paths" );
783 ret &= fromLegacy<int>( aCfg, "VrmlRefUnits", "export_vrml.ref_units" );
784 ret &= fromLegacy<double>( aCfg, "VrmlRefX", "export_vrml.ref_x" );
785 ret &= fromLegacy<double>( aCfg, "VrmlRefY", "export_vrml.ref_y" );
786 ret &= fromLegacy<int> ( aCfg, "VrmlOriginMode", "export_vrml.origin_mode" );
787
788 ret &= fromLegacy<int>( aCfg, "Zone_Ouline_Hatch_Opt", "zones.hatching_style" );
789 ret &= fromLegacy<int>( aCfg, "Zone_NetSort_Opt", "zones.net_sort_mode" );
790 ret &= fromLegacy<double>( aCfg, "Zone_Clearance", "zones.clearance" );
791 ret &= fromLegacy<double>( aCfg, "Zone_Thickness", "zones.min_thickness" );
792 ret &= fromLegacy<double>( aCfg, "Zone_TH_Gap", "zones.thermal_relief_gap" );
793 ret &= fromLegacy<double>( aCfg, "Zone_TH_Copper_Width", "zones.thermal_relief_copper_width" );
794
795 aCfg->SetPath( "ImportGraphics" );
796 ret &= fromLegacy<int>( aCfg, "BoardLayer", "import_graphics.layer" );
797 ret &= fromLegacy<bool>( aCfg, "InteractivePlacement", "import_graphics.interactive_placement" );
798 ret &= fromLegacyString( aCfg, "LastFile", "import_graphics.last_file" );
799 ret &= fromLegacy<double>( aCfg, "LineWidth", "import_graphics.line_width" );
800 ret &= fromLegacy<int>( aCfg, "LineWidthUnits", "import_graphics.line_width_units" );
801 ret &= fromLegacy<int>( aCfg, "PositionUnits", "import_graphics.origin_units" );
802 ret &= fromLegacy<double>( aCfg, "PositionX", "import_graphics.origin_x" );
803 ret &= fromLegacy<double>( aCfg, "PositionY", "import_graphics.origin_y" );
804 aCfg->SetPath( ".." );
805
806 ret &= fromLegacy<int>( aCfg, "NetlistReportFilterMsg", "netlist.report_filter" );
807 ret &= fromLegacy<bool>( aCfg, "NetlistUpdateFootprints", "netlist.update_footprints" );
808 ret &= fromLegacy<bool>( aCfg, "NetlistDeleteShortingTracks", "netlist.delete_shorting_tracks" );
809 ret &= fromLegacy<bool>( aCfg, "NetlistDeleteExtraFootprints", "netlist.delete_extra_footprints" );
810
811 ret &= fromLegacy<int>( aCfg, "PlaceFileUnits", "place_file.units" );
812 ret &= fromLegacy<int>( aCfg, "PlaceFileOpts", "place_file.file_options" );
813 ret &= fromLegacy<int>( aCfg, "PlaceFileFormat", "place_file.file_format" );
814 ret &= fromLegacy<bool>( aCfg, "PlaceFileIncludeBrdEdge", "place_file.include_board_edge" );
815
816 ret &= fromLegacy<int>( aCfg, "PrintSinglePage", "plot.all_layers_on_one_page" );
817 ret &= fromLegacy<int>( aCfg, "PrintPadsDrillOpt", "plot.pads_drill_mode" );
818 ret &= fromLegacy<double>( aCfg, "PlotXFineScaleAdj", "plot.fine_scale_x" );
819 ret &= fromLegacy<double>( aCfg, "PlotYFineScaleAdj", "plot.fine_scale_y" );
820 ret &= fromLegacy<double>( aCfg, "PSPlotFineWidthAdj", "plot.ps_fine_width_adjust" );
821 ret &= fromLegacy<bool>( aCfg, "CheckZonesBeforePlotting", "plot.check_zones_before_plotting" );
822
823 ret &= fromLegacyString( aCfg, "FootprintTextShownColumns", "window.footprint_text_shown_columns" );
824
825 ret &= fromLegacy<int>( aCfg, "FpWizardListWidth", "footprint_wizard_list.width" );
826 ret &= fromLegacy<int>( aCfg, "FpWizardListHeight", "footprint_wizard_list.height" );
827
828 migrateWindowConfig( aCfg, "ModViewFrame", "footprint_viewer" );
829
830 ret &= fromLegacy<bool>( aCfg, "ModViewFrameAutoZoom", "footprint_viewer.auto_zoom" );
831 ret &= fromLegacy<double>( aCfg, "ModViewFrameZoom", "footprint_viewer.zoom" );
832
833 migrateWindowConfig( aCfg, "FootprintWizard", "footprint_wizard" );
834 ret &= fromLegacyString( aCfg, "Fpwizard_auiPerspective", "footprint_wizard.perspective" );
835
836
837 const std::string p = "pcbnew.InteractiveRouter.";
838
839 Set( "tools.pns.meta", nlohmann::json( {
840 { "filename", "pns" },
841 { "version", 0 }
842 } ) );
843
844 ret &= fromLegacy<int>( aCfg, p + "Mode", "tools.pns.mode" );
845 ret &= fromLegacy<int>( aCfg, p + "OptimizerEffort", "tools.pns.effort" );
846 ret &= fromLegacy<bool>( aCfg, p + "RemoveLoops", "tools.pns.remove_loops" );
847 ret &= fromLegacy<bool>( aCfg, p + "SmartPads", "tools.pns.smart_pads" );
848 ret &= fromLegacy<bool>( aCfg, p + "ShoveVias", "tools.pns.shove_vias" );
849 ret &= fromLegacy<bool>( aCfg, p + "StartDiagonal", "tools.pns.start_diagonal" );
850 ret &= fromLegacy<int>( aCfg, p + "ShoveTimeLimit", "tools.pns.shove_time_limit" );
851 ret &= fromLegacy<int>( aCfg, p + "ShoveIterationLimit", "tools.pns.shove_iteration_limit" );
852 ret &= fromLegacy<int>( aCfg, p + "WalkaroundIterationLimit", "tools.pns.walkaround_iteration_limit" );
853 ret &= fromLegacy<bool>( aCfg, p + "JumpOverObstacles", "tools.pns.jump_over_obstacles" );
854 ret &= fromLegacy<bool>( aCfg, p + "SmoothDraggedSegments", "tools.pns.smooth_dragged_segments" );
855 ret &= fromLegacy<bool>( aCfg, p + "CanViolateDRC", "tools.pns.can_violate_drc" );
856 ret &= fromLegacy<bool>( aCfg, p + "SuggestFinish", "tools.pns.suggest_finish" );
857 ret &= fromLegacy<bool>( aCfg, p + "FreeAngleMode", "tools.pns.free_angle_mode" );
858 ret &= fromLegacy<bool>( aCfg, p + "InlineDragEnabled", "editing.track_drag_action" );
859
860 // Initialize some new PNS settings to legacy behaviors if coming from legacy
861 Set( "tools.pns.fix_all_segments", false );
862
863 // Migrate color settings that were stored in the pcbnew config file
864
865 COLOR_SETTINGS* cs = Pgm().GetSettingsManager().GetMigratedColorSettings();
866
867 auto migrateLegacyColor =
868 [&] ( const std::string& aKey, int aLayerId )
869 {
870 wxString str;
871
872 if( aCfg->Read( aKey, &str ) )
873 cs->SetColor( aLayerId, COLOR4D( str ) );
874 };
875
876 for( int i = 0; i < PCB_LAYER_ID_COUNT; ++i )
877 {
878 wxString layer = LSET::Name( PCB_LAYER_ID( i ) );
879 migrateLegacyColor( "Color4DPCBLayer_" + layer.ToStdString(), PCB_LAYER_ID( i ) );
880 }
881
882 migrateLegacyColor( "Color4DAnchorEx", LAYER_ANCHOR );
883 migrateLegacyColor( "Color4DAuxItems", LAYER_AUX_ITEMS );
884 migrateLegacyColor( "Color4DGrid", LAYER_GRID );
885 migrateLegacyColor( "Color4DNonPlatedEx", LAYER_NON_PLATEDHOLES );
886 migrateLegacyColor( "Color4DPadThruHoleEx", LAYER_PADS_TH );
887 migrateLegacyColor( "Color4DPCBBackground", LAYER_PCB_BACKGROUND );
888 migrateLegacyColor( "Color4DPCBCursor", LAYER_CURSOR );
889 migrateLegacyColor( "Color4DRatsEx", LAYER_RATSNEST );
890 migrateLegacyColor( "Color4DTxtInvisEx", LAYER_MOD_TEXT_INVISIBLE );
891 migrateLegacyColor( "Color4DViaBBlindEx", LAYER_VIA_BBLIND );
892 migrateLegacyColor( "Color4DViaMicroEx", LAYER_VIA_MICROVIA );
893 migrateLegacyColor( "Color4DViaThruEx", LAYER_VIA_THROUGH );
894 migrateLegacyColor( "Color4DWorksheet", LAYER_DRAWINGSHEET );
895 migrateLegacyColor( "Color4DGrid", LAYER_PAGE_LIMITS );
896
897 Pgm().GetSettingsManager().SaveColorSettings( cs, "board" );
898
899 Set( "appearance.color_theme", cs->GetFilename() );
900
901 double x = 0, y = 0;
902
903 if( aCfg->Read( f + "PcbUserGrid_X", &x ) && aCfg->Read( f + "PcbUserGrid_Y", &y ) )
904 {
905 EDA_UNITS u = static_cast<EDA_UNITS>( aCfg->ReadLong( f + "PcbUserGrid_Unit",
906 static_cast<long>( EDA_UNITS::INCHES ) ) );
907
908 // Convert to internal units
911
912 Set( "window.grid.user_grid_x", EDA_UNIT_UTILS::UI::StringFromValue( pcbIUScale, u, x ) );
913 Set( "window.grid.user_grid_y", EDA_UNIT_UTILS::UI::StringFromValue( pcbIUScale, u, y ) );
914 }
915
916 // Footprint editor settings were stored in pcbnew config file. Migrate them here.
917 auto fpedit = Pgm().GetSettingsManager().GetAppSettings<FOOTPRINT_EDITOR_SETTINGS>();
918 fpedit->MigrateFromLegacy( aCfg );
919 fpedit->Load();
920
921 // Same with 3D viewer
922 auto viewer3d = Pgm().GetSettingsManager().GetAppSettings<EDA_3D_VIEWER_SETTINGS>();
923 viewer3d->MigrateFromLegacy( aCfg );
924 viewer3d->Load();
925
926 return ret;
927}
928
929//namespace py = pybind11;
930//
931//PYBIND11_MODULE( pcbnew, m )
932//{
933// py::class_<PCBNEW_SETTINGS>( m, "settings" )
934// .def_readwrite( "Use45DegreeGraphicSegments", &PCBNEW_SETTINGS::m_Use45DegreeGraphicSegments )
935// .def_readwrite( "FlipLeftRight", &PCBNEW_SETTINGS::m_FlipLeftRight )
936// .def_readwrite( "AddUnlockedPads", &PCBNEW_SETTINGS::m_AddUnlockedPads)
937// .def_readwrite( "UsePolarCoords", &PCBNEW_SETTINGS::m_PolarCoords)
938// .def_readwrite( "RotationAngle", &PCBNEW_SETTINGS::m_RotationAngle)
939// .def_readwrite( "ShowPageLimits", &PCBNEW_SETTINGS::m_ShowPageLimits)
940// ;
941//}
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
bool migrateWindowConfig(wxConfigBase *aCfg, const std::string &aFrameName, const std::string &aJsonPath)
Migrates legacy window settings into the JSON document.
virtual bool MigrateFromLegacy(wxConfigBase *aCfg) override
Migrates from wxConfig to JSON-based configuration.
void addParamsForWindow(WINDOW_SETTINGS *aWindow, const std::string &aJsonPath)
Adds parameters for the given window object.
bool migrateLibTreeWidth()
Migrates the library tree width setting from a single column (Item) to multi-column.
Color settings are a bit different than most of the settings objects in that there can be more than o...
void SetColor(int aLayer, const COLOR4D &aColor)
virtual bool MigrateFromLegacy(wxConfigBase *aLegacyConfig) override
Migrates from wxConfig to JSON-based configuration.
int AsTenthsOfADegree() const
Definition: eda_angle.h:151
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.
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...
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...
wxString GetFilename() const
Definition: json_settings.h:73
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:103
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
double m_FootprintViewerZoom
The last zoom level used (0 for auto)
DISPLAY_OPTIONS m_Display
DIALOG_NETLIST m_NetlistDialog
DIALOG_CLEANUP m_Cleanup
EDA_ANGLE m_RotationAngle
DIALOG_PLACE_FILE m_PlaceFile
bool m_FootprintViewerAutoZoomOnSelect
true to use automatic zoom on fp selection
DIALOG_FOOTPRINT_WIZARD_LIST m_FootprintWizardList
ARC_EDIT_MODE m_ArcEditMode
FOOTPRINT_CHOOSER m_FootprintChooser
virtual ~PCBNEW_SETTINGS()
DIALOG_EXPORT_VRML m_ExportVrml
DIALOG_EXPORT_IDF m_ExportIdf
TRACK_DRAG_ACTION m_TrackDragAction
wxString m_lastFootprintLibDir
virtual std::string getLegacyFrameName() const override
virtual bool MigrateFromLegacy(wxConfigBase *aLegacyConfig) override
Migrates from wxConfig to JSON-based configuration.
DIALOG_PLOT m_Plot
WINDOW_SETTINGS m_FootprintWizard
ACTION_PLUGIN_SETTINGS_LIST m_VisibleActionPlugins
DIALOG_IMPORT_GRAPHICS m_ImportGraphics
DIALOG_DRC m_DrcDialog
AUI_PANELS m_AuiPanels
DIALOG_EXPORT_STEP m_ExportStep
WINDOW_SETTINGS m_FootprintViewer
wxString m_lastFootprint3dDir
bool m_ShowCourtyardCollisions
DIALOG_GENERATE_DRILL m_GenDrill
MAGNETIC_SETTINGS m_MagneticItems
DIALOG_REANNOTATE m_Reannotate
int m_FootprintViewerFPListWidth
DIALOG_EXPORT_SVG m_ExportSvg
wxString m_FootprintTextShownColumns
int m_FootprintViewerLibListWidth
VIEWERS_DISPLAY_OPTIONS m_ViewersDisplay
The common library.
@ TENTHS_OF_A_DEGREE_T
Definition: eda_angle.h:30
static constexpr EDA_ANGLE & ANGLE_360
Definition: eda_angle.h:435
static constexpr EDA_ANGLE & ANGLE_90
Definition: eda_angle.h:431
EDA_UNITS
Definition: eda_units.h:43
@ LAYER_GRID
Definition: layer_ids.h:205
@ LAYER_MOD_TEXT_INVISIBLE
text marked as invisible
Definition: layer_ids.h:200
@ LAYER_PAGE_LIMITS
color for drawing the page extents (visibility stored in PCBNEW_SETTINGS::m_ShowPageLimits)
Definition: layer_ids.h:249
@ 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
@ Dwgs_User
Definition: layer_ids.h:109
@ 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:385
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:225
const int pcbnewSchemaVersion
! Update the schema version whenever a migration is required
@ SHOW_WITH_VIA_WHILE_ROUTING
TRACK_DRAG_ACTION
see class PGM_BASE
@ RPT_SEVERITY_WARNING
@ RPT_SEVERITY_ERROR
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:115
MAGNETIC_OPTIONS tracks
MAGNETIC_OPTIONS pads
TRACK_CLEARANCE_MODE m_TrackClearance
Functions to provide common constants and other functions to assist in making a consistent UI.