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;
91
92 m_params.emplace_back( new PARAM<bool>( "aui.show_layer_manager",
94
95 m_params.emplace_back( new PARAM<int>( "aui.right_panel_width",
97
98 m_params.emplace_back( new PARAM<int>( "aui.properties_panel_width",
100
101 m_params.emplace_back( new PARAM<float>( "aui.properties_splitter_proportion",
103
104 m_params.emplace_back( new PARAM<int>( "aui.search_panel_height",
106
107 m_params.emplace_back( new PARAM<int>( "aui.search_panel_width",
109
110 m_params.emplace_back( new PARAM<int>( "aui.search_panel_dock_direction",
112
113 m_params.emplace_back( new PARAM<int>( "aui.appearance_panel_tab",
114 &m_AuiPanels.appearance_panel_tab, 0, 0, 2 ) );
115
116 m_params.emplace_back( new PARAM<bool>( "aui.appearance_expand_layer_display",
118
119 m_params.emplace_back( new PARAM<bool>( "aui.appearance_expand_net_display",
121
122 m_params.emplace_back( new PARAM<bool>( "aui.show_properties",
123 &m_AuiPanels.show_properties, false ) );
124
125 m_params.emplace_back( new PARAM<bool>( "aui.show_search",
126 &m_AuiPanels.show_search, false ) );
127
128 m_params.emplace_back( new PARAM<int>( "footprint_chooser.width",
129 &m_FootprintChooser.width, -1 ) );
130
131 m_params.emplace_back( new PARAM<int>( "footprint_chooser.height",
132 &m_FootprintChooser.height, -1 ) );
133
134 m_params.emplace_back( new PARAM<int>( "footprint_chooser.sash_h",
135 &m_FootprintChooser.sash_h, -1 ) );
136
137 m_params.emplace_back( new PARAM<int>( "footprint_chooser.sash_v",
138 &m_FootprintChooser.sash_v, -1 ) );
139
140 m_params.emplace_back( new PARAM<int>( "footprint_chooser.sort_mode",
142
143 m_params.emplace_back( new PARAM<bool>( "footprint_chooser.filter_on_pin_count",
145
146 m_params.emplace_back( new PARAM<bool>( "footprint_chooser.use_fp_filters",
148
149 m_params.emplace_back( new PARAM<bool>( "editing.flip_left_right",
150 &m_FlipLeftRight, true ) );
151
152 m_params.emplace_back( new PARAM<bool>( "editing.esc_clears_net_highlight",
153 &m_ESCClearsNetHighlight, true ) );
154
155 m_params.emplace_back( new PARAM<bool>( "editing.show_courtyard_collisions",
156 &m_ShowCourtyardCollisions, true ) );
157
158 m_params.emplace_back( new PARAM<bool>( "editing.magnetic_graphics",
159 &m_MagneticItems.graphics, true ) );
160
161 m_params.emplace_back( new PARAM<int>( "editing.magnetic_pads",
162 reinterpret_cast<int*>( &m_MagneticItems.pads ),
163 static_cast<int>( MAGNETIC_OPTIONS::CAPTURE_CURSOR_IN_TRACK_TOOL ) ) );
164
165 m_params.emplace_back( new PARAM<int>( "editing.magnetic_tracks",
166 reinterpret_cast<int*>( &m_MagneticItems.tracks ),
167 static_cast<int>( MAGNETIC_OPTIONS::CAPTURE_CURSOR_IN_TRACK_TOOL ) ) );
168
169 m_params.emplace_back( new PARAM<bool>( "editing.magnetic_all_layers",
170 &m_MagneticItems.allLayers, false ) );
171
172 m_params.emplace_back( new PARAM<bool>( "editing.polar_coords",
173 &m_PolarCoords, false ) );
174
175 m_params.emplace_back( new PARAM<int>( "editing.track_drag_action",
176 reinterpret_cast<int*>( &m_TrackDragAction ),
177 static_cast<int>( TRACK_DRAG_ACTION::DRAG ) ) );
178
179 m_params.emplace_back( new PARAM<int>( "editing.arc_edit_mode",
180 reinterpret_cast<int*>( &m_ArcEditMode ),
181 static_cast<int>( ARC_EDIT_MODE::KEEP_CENTER_ADJUST_ANGLE_RADIUS ) ) );
182
183 m_params.emplace_back( new PARAM<bool>( "editing.ctrl_click_highlight",
184 &m_CtrlClickHighlight, false ) );
185
186 m_params.emplace_back( new PARAM<bool>( "editing.pcb_use_45_degree_limit",
187 &m_Use45DegreeLimit, false ) );
188
189 m_params.emplace_back( new PARAM<bool>( "editing.auto_fill_zones",
190 &m_AutoRefillZones, false ) );
191
192 m_params.emplace_back( new PARAM<bool>( "editing.allow_free_pads",
193 &m_AllowFreePads, false ) );
194
195 m_params.emplace_back( new PARAM_LAMBDA<int>( "editing.rotation_angle",
196 [this] () -> int
197 {
199
200 // Don't store values larger than 360 degrees
201 return rot % 3600;
202 },
203 [this] ( int aVal )
204 {
205 if( aVal )
207
208 // A misconfiguration allowed some angles to be stored as tenth of a degree but read
209 // as tens of degrees. By disallowing storage of values larger than 360, we can weed out
210 // those invalid values here.
211 while( m_RotationAngle > ANGLE_360 )
213
214 },
215 900 ) );
216
217 m_params.emplace_back( new PARAM<bool>( "pcb_display.graphic_items_fill",
219
220 m_params.emplace_back( new PARAM<int>( "pcb_display.max_links_shown",
221 &m_Display.m_MaxLinksShowed, 3, 0, 15 ) );
222
223 m_params.emplace_back( new PARAM<bool>( "pcb_display.graphics_fill",
225
226 m_params.emplace_back( new PARAM<bool>( "pcb_display.text_fill",
228
229 m_params.emplace_back( new PARAM<int>( "pcb_display.net_names_mode",
230 &m_Display.m_NetNames, 3, 0, 3 ) );
231
232 m_params.emplace_back( new PARAM<bool>( "pcb_display.pad_clearance",
233 &m_Display.m_PadClearance, true ) );
234
235 m_params.emplace_back( new PARAM<bool>( "pcb_display.pad_fill",
237
238 m_params.emplace_back( new PARAM<bool>( "pcb_display.pad_numbers",
240
241 m_params.emplace_back( new PARAM<bool>( "pcb_display.ratsnest_global",
243
244 m_params.emplace_back( new PARAM<bool>( "pcb_display.ratsnest_footprint",
246
247 m_params.emplace_back( new PARAM<bool>( "pcb_display.ratsnest_curved",
249
250 m_params.emplace_back( new PARAM<double>( "pcb_display.ratsnest_thickness",
252
253 m_params.emplace_back( new PARAM<int>( "pcb_display.track_clearance_mode",
254 reinterpret_cast<int*>( &m_Display.m_TrackClearance ), SHOW_WITH_VIA_WHILE_ROUTING ) );
255
256 m_params.emplace_back( new PARAM<bool>( "pcb_display.track_fill",
258
259 m_params.emplace_back( new PARAM<bool>( "pcb_display.via_fill",
260 &m_Display.m_DisplayViaFill, true ) );
261
262 m_params.emplace_back( new PARAM<int>( "pcb_display.origin_mode",
263 reinterpret_cast<int*>( &m_Display.m_DisplayOrigin ),
264 PCB_DISPLAY_ORIGIN::PCB_ORIGIN_PAGE ) );
265
266 m_params.emplace_back( new PARAM<bool>( "pcb_display.origin_invert_x_axis",
268
269 m_params.emplace_back( new PARAM<bool>( "pcb_display.origin_invert_y_axis",
271
272 m_params.emplace_back( new PARAM<bool>( "pcb_display.force_show_fields_when_fp_selected",
274
275 m_params.emplace_back( new PARAM<bool>( "pcb_display.live_3d_refresh",
276 &m_Display.m_Live3DRefresh, false ) );
277
278 m_params.emplace_back( new PARAM<bool>( "pcb_display.show_page_borders",
279 &m_ShowPageLimits, true ) );
280
281 m_params.emplace_back( new PARAM<bool>( "cleanup.cleanup_vias",
282 &m_Cleanup.cleanup_vias, true ) );
283
284 m_params.emplace_back( new PARAM<bool>( "cleanup.delete_dangling_vias",
286
287 m_params.emplace_back( new PARAM<bool>( "cleanup.merge_segments",
288 &m_Cleanup.merge_segments, true ) );
289
290 m_params.emplace_back( new PARAM<bool>( "cleanup.cleanup_unconnected",
292
293 m_params.emplace_back( new PARAM<bool>( "cleanup.cleanup_short_circuits",
295
296 m_params.emplace_back( new PARAM<bool>( "cleanup.cleanup_tracks_in_pad",
298
299 m_params.emplace_back( new PARAM<bool>( "drc_dialog.refill_zones",
300 &m_DrcDialog.refill_zones, true ) );
301
302 m_params.emplace_back( new PARAM<bool>( "drc_dialog.test_all_track_errors",
304
305 m_params.emplace_back( new PARAM<bool>( "drc_dialog.test_footprints",
306 &m_DrcDialog.test_footprints, false ) );
307
308 m_params.emplace_back( new PARAM<int>( "drc_dialog.severities",
310
311 m_params.emplace_back( new PARAM<bool>( "gen_drill.merge_pth_npth",
312 &m_GenDrill.merge_pth_npth, false ) );
313
314 m_params.emplace_back( new PARAM<bool>( "gen_drill.minimal_header",
315 &m_GenDrill.minimal_header, false ) );
316
317 m_params.emplace_back( new PARAM<bool>( "gen_drill.mirror",
318 &m_GenDrill.mirror, false ) );
319
320 m_params.emplace_back( new PARAM<bool>( "gen_drill.unit_drill_is_inch",
322
323 m_params.emplace_back( new PARAM<bool>( "gen_drill.use_route_for_oval_holes",
325
326 m_params.emplace_back( new PARAM<int>( "gen_drill.drill_file_type",
328
329 m_params.emplace_back( new PARAM<int>( "gen_drill.map_file_type",
331
332 m_params.emplace_back( new PARAM<int>( "gen_drill.zeros_format",
333 &m_GenDrill.zeros_format, 0, 0, 3 ) );
334
335 m_params.emplace_back( new PARAM<int>( "export_2581.units",
336 &m_Export2581.units, 0 ) );
337
338 m_params.emplace_back( new PARAM<int>( "export_2581.precision",
339 &m_Export2581.precision, 3 ) );
340
341 m_params.emplace_back( new PARAM<int>( "export_2581.version",
342 &m_Export2581.version, 1 ) );
343
344 m_params.emplace_back( new PARAM<bool>( "export_2581.compress",
345 &m_Export2581.compress, false ) );
346
347 m_params.emplace_back( new PARAM<bool>( "export_idf.auto_adjust",
348 &m_ExportIdf.auto_adjust, false ) );
349
350 m_params.emplace_back( new PARAM<int>( "export_idf.ref_units",
351 &m_ExportIdf.ref_units, 0 ) );
352
353 m_params.emplace_back( new PARAM<double>( "export_idf.ref_x",
354 &m_ExportIdf.ref_x, 0 ) );
355
356 m_params.emplace_back( new PARAM<double>( "export_idf.ref_y",
357 &m_ExportIdf.ref_y, 0 ) );
358
359 m_params.emplace_back( new PARAM<bool>( "export_idf.units_mils",
360 &m_ExportIdf.units_mils, false ) );
361
362 m_params.emplace_back( new PARAM<int>( "export_step.origin_mode",
364
365 m_params.emplace_back( new PARAM<int>( "export_step.origin_units",
367
368 m_params.emplace_back( new PARAM<double>( "export_step.origin_x",
369 &m_ExportStep.origin_x, 0 ) );
370
371 m_params.emplace_back( new PARAM<double>( "export_step.origin_y",
372 &m_ExportStep.origin_y, 0 ) );
373
374 m_params.emplace_back( new PARAM<bool>( "export_step.no_unspecified",
375 &m_ExportStep.no_unspecified, false ) );
376
377 m_params.emplace_back( new PARAM<bool>( "export_step.no_dnp",
378 &m_ExportStep.no_dnp, false ) );
379
380 m_params.emplace_back( new PARAM<bool>( "export_step.replace_models",
381 &m_ExportStep.replace_models, true ) );
382
383 m_params.emplace_back( new PARAM<bool>( "export_step.overwrite_file",
384 &m_ExportStep.overwrite_file, true ) );
385
386 m_params.emplace_back( new PARAM<bool>( "export_svg.black_and_white",
387 &m_ExportSvg.black_and_white, false ) );
388
389 m_params.emplace_back( new PARAM<bool>( "export_svg.use_theme",
391
392 m_params.emplace_back( new PARAM<wxString>( "export_svg.color_theme",
393 &m_ExportSvg.color_theme, "" ) );
394
395 m_params.emplace_back( new PARAM<bool>( "export_svg.mirror",
396 &m_ExportSvg.mirror, false ) );
397
398 m_params.emplace_back( new PARAM<bool>( "export_svg.one_file",
399 &m_ExportSvg.one_file, false ) );
400
401 m_params.emplace_back(new PARAM<bool>( "export_svg.plot_board_edges",
402 &m_ExportSvg.plot_board_edges, true ) );
403
404 m_params.emplace_back( new PARAM<int>( "export_svg.page_size",
405 &m_ExportSvg.page_size, 0 ) );
406
407 m_params.emplace_back( new PARAM<wxString>( "export_svg.output_dir",
408 &m_ExportSvg.output_dir, "" ) );
409
410 m_params.emplace_back( new PARAM_LIST<int>( "export_svg.layers",
411 &m_ExportSvg.layers, {} ) );
412
413 m_params.emplace_back( new PARAM<int>( "export_vrml.units",
414 &m_ExportVrml.units, 1 ) );
415
416 m_params.emplace_back( new PARAM<bool>( "export_vrml.copy_3d_models",
417 &m_ExportVrml.copy_3d_models, false ) );
418
419 m_params.emplace_back( new PARAM<bool>( "export_vrml.use_relative_paths",
421
422 m_params.emplace_back( new PARAM<int>( "export_vrml.ref_units",
423 &m_ExportVrml.ref_units, 0 ) );
424
425 m_params.emplace_back( new PARAM<double>( "export_vrml.ref_x",
426 &m_ExportVrml.ref_x, 0 ) );
427
428 m_params.emplace_back( new PARAM<double>( "export_vrml.ref_y",
429 &m_ExportVrml.ref_y, 0 ) );
430
431 m_params.emplace_back( new PARAM<int>( "export_vrml.origin_mode",
433
434 m_params.emplace_back( new PARAM<int>( "zones.net_sort_mode",
435 &m_Zones.net_sort_mode, -1 ) );
436
437 m_params.emplace_back( new PARAM<int>( "import_graphics.layer",
439
440 m_params.emplace_back( new PARAM<bool>( "import_graphics.use_dlg_layer_selection",
442
443 m_params.emplace_back( new PARAM<bool>( "import_graphics.interactive_placement",
445
446 m_params.emplace_back( new PARAM<bool>( "import_graphics.group_items",
447 &m_ImportGraphics.group_items, true ) );
448
449 m_params.emplace_back( new PARAM<bool>( "import_graphics.fix_discontinuities",
451
452 m_params.emplace_back( new PARAM<double>( "import_graphics.tolerance",
453 &m_ImportGraphics.tolerance, 0.01, 0.0, 10.0 ) );
454
455 m_params.emplace_back( new PARAM<int>( "import_graphics.line_width_units",
457
458 m_params.emplace_back( new PARAM<double>( "import_graphics.line_width",
460
461 m_params.emplace_back( new PARAM<int>( "import_graphics.origin_units",
463
464 m_params.emplace_back( new PARAM<double>( "import_graphics.origin_x",
466
467 m_params.emplace_back( new PARAM<double>( "import_graphics.origin_y",
469
470 m_params.emplace_back( new PARAM<int>( "import_graphics.dxf_units",
472
473 m_params.emplace_back( new PARAM<int>( "netlist.report_filter",
475
476 m_params.emplace_back( new PARAM<bool>( "netlist.update_footprints",
478
479 m_params.emplace_back( new PARAM<bool>( "netlist.delete_shorting_tracks",
481
482 m_params.emplace_back( new PARAM<bool>( "netlist.delete_extra_footprints",
484
485 m_params.emplace_back( new PARAM<bool>( "netlist.associate_by_ref_sch",
487
488 m_params.emplace_back( new PARAM<wxString>( "place_file.output_directory",
489 &m_PlaceFile.output_directory, wxEmptyString ) );
490
491 m_params.emplace_back( new PARAM<int>( "place_file.units",
492 &m_PlaceFile.units, 1 ) );
493
494 m_params.emplace_back( new PARAM<int>( "place_file.file_options",
496
497 m_params.emplace_back( new PARAM<int>( "place_file.file_format",
498 &m_PlaceFile.file_format, 0 ) );
499
500 m_params.emplace_back( new PARAM<bool>( "place_file.excludeTH",
501 &m_PlaceFile.exclude_TH, false ) );
502
503 m_params.emplace_back( new PARAM<bool>( "place_file.onlySMD",
504 &m_PlaceFile.only_SMD, false ) );
505
506 m_params.emplace_back( new PARAM<bool>( "place_file.include_board_edge",
508
509 m_params.emplace_back( new PARAM<bool>( "place_file.use_place_file_origin",
510 &m_PlaceFile.use_aux_origin, true ) );
511
512 m_params.emplace_back( new PARAM<bool>( "place_file.negate_xcoord",
513 &m_PlaceFile.negate_xcoord, false ) );
514
515 m_params.emplace_back( new PARAM<int>( "plot.all_layers_on_one_page",
517
518 m_params.emplace_back( new PARAM<bool>( "plot.edgecut_on_all_layers",
519 &m_Plot.edgecut_on_all_layers, true ) );
520
521 m_params.emplace_back( new PARAM<int>( "plot.pads_drill_mode",
522 &m_Plot.pads_drill_mode, 2 ) );
523
524 m_params.emplace_back( new PARAM<double>( "plot.fine_scale_x",
525 &m_Plot.fine_scale_x, 0 ) );
526
527 m_params.emplace_back( new PARAM<double>( "plot.fine_scale_y",
528 &m_Plot.fine_scale_y, 0 ) );
529
530 m_params.emplace_back( new PARAM<double>( "plot.ps_fine_width_adjust",
532
533 m_params.emplace_back( new PARAM<bool>( "plot.check_zones_before_plotting",
535
536 m_params.emplace_back( new PARAM<bool>( "plot.mirror",
537 &m_Plot.mirror, false ) );
538
539 m_params.emplace_back( new PARAM<bool>( "plot.as_item_checkboxes",
540 &m_Plot.as_item_checkboxes, false ) );
541
542 m_params.emplace_back( new PARAM<wxString>( "window.footprint_text_shown_columns",
543 &m_FootprintTextShownColumns, "0 1 2 3 4 5 6" ) );
544
545 m_params.emplace_back( new PARAM<int>( "footprint_wizard_list.width",
547
548 m_params.emplace_back( new PARAM<int>( "footprint_wizard_list.height",
550
551 m_params.emplace_back( new PARAM<bool>( "reannotate_dialog.annotate_sort_on_modules",
553 m_params.emplace_back( new PARAM<bool>( "reannotate_dialog.annotate_remove_front_prefix",
555 m_params.emplace_back( new PARAM<bool>( "reannotate_dialog.annotate_remove_back_prefix",
557 m_params.emplace_back( new PARAM<bool>( "reannotate_dialog.annotate_exclude_locked",
558 &m_Reannotate.exclude_locked, false ) );
559
560 m_params.emplace_back( new PARAM<int>( "reannotate_dialog.annotate_grid_index",
561 &m_Reannotate.grid_index, 0 ) );
562 m_params.emplace_back( new PARAM<int>( "reannotate_dialog.annotate_sort_code",
563 &m_Reannotate.sort_code, 0 ) );
564 m_params.emplace_back( new PARAM<int>( "reannotate_dialog.annotate_choice",
566 m_params.emplace_back( new PARAM<int>( "reannotate_dialog.annotate_report_severity",
568
569 m_params.emplace_back( new PARAM<wxString>( "reannotate_dialog.annotate_front_refdes_start",
571 m_params.emplace_back( new PARAM<wxString>( "reannotate_dialog.annotate_back_refdes_start",
573 m_params.emplace_back( new PARAM<wxString>( "reannotate_dialog.annotate_front_prefix",
574 &m_Reannotate.front_prefix, "" ) );
575 m_params.emplace_back( new PARAM<wxString>( "reannotate_dialog.annotate_back_prefix",
576 &m_Reannotate.back_prefix, "" ) );
577 m_params.emplace_back( new PARAM<wxString>( "reannotate_dialog.annotate_exclude_list",
578 &m_Reannotate.exclude_list, "" ) );
579 m_params.emplace_back( new PARAM<wxString>( "reannotate_dialog.annotate_report_file_name",
581
582 m_params.emplace_back( new PARAM<wxString>( "net_inspector_dialog.group_by_text",
584 m_params.emplace_back( new PARAM<bool>( "net_inspector_dialog.group_by",
585 &m_NetInspector.group_by, false ) );
586 m_params.emplace_back( new PARAM<int>( "net_inspector_dialog.group_by_kind",
588
589 m_params.emplace_back( new PARAM_LAMBDA<nlohmann::json>( "action_plugins",
590 [&]() -> nlohmann::json
591 {
592 nlohmann::json js = nlohmann::json::array();
593
594 for( const auto& pair : m_VisibleActionPlugins )
595 js.push_back( nlohmann::json( { { pair.first.ToUTF8(), pair.second } } ) );
596
597 return js;
598 },
599 [&]( const nlohmann::json& aObj )
600 {
602
603 if( !aObj.is_array() )
604 {
605 return;
606 }
607
608 for( const auto& entry : aObj )
609 {
610 if( entry.empty() || !entry.is_object() )
611 continue;
612
613 for( const auto& pair : entry.items() )
614 {
615 m_VisibleActionPlugins.emplace_back( std::make_pair(
616 wxString( pair.key().c_str(), wxConvUTF8 ), pair.value() ) );
617 }
618 }
619 },
620 nlohmann::json::array() ) );
621
622 addParamsForWindow( &m_FootprintViewer, "footprint_viewer" );
623
624 m_params.emplace_back( new PARAM<double>( "footprint_viewer.zoom",
625 &m_FootprintViewerZoom, 1.0 ) );
626
627 m_params.emplace_back( new PARAM<bool>( "footprint_viewer.autozoom",
629
630 m_params.emplace_back( new PARAM<int>( "footprint_viewer.lib_list_width",
632
633 m_params.emplace_back( new PARAM<int>( "footprint_viewer.fp_list_width",
635
636 addParamsForWindow( &m_FootprintWizard, "footprint_wizard" );
637
638 m_params.emplace_back( new PARAM<wxString>( "system.last_footprint_lib_dir",
639 &m_lastFootprintLibDir, "" ) );
640
641 m_params.emplace_back( new PARAM<wxString>( "system.last_footprint3d_dir",
642 &m_lastFootprint3dDir, "" ) );
643
644 registerMigration( 0, 1,
645 [&]()
646 {
647 if( std::optional<int> optval = Get<int>( "pcb_display.rotation_angle" ) )
648 Set( "editing.rotation_angle", *optval );
649
650 try
651 {
652 At( "pcb_display" ).erase( "rotation_angle" );
653 }
654 catch( ... )
655 {}
656
657 return true;
658 } );
659
660 registerMigration( 1, 2,
661 [&]()
662 {
663 // In version 1 this meant "after Zone Properties dialog", but it now means
664 // "everywhere" so we knock it off on transition.
665 Set( "editing.auto_fill_zones", false );
666
667 return true;
668 } );
669
670
671 registerMigration( 2, 3,
672 [&]() -> bool
673 {
674 // We used to have a bug on GTK which would set the lib tree column width way
675 // too narrow.
676 if( std::optional<int> optval = Get<int>( "lib_tree.column_width" ) )
677 {
678 if( optval < 150 )
679 Set( "lib_tree.column_width", 300 );
680 }
681
682 return true;
683 } );
684
685 registerMigration( 3, 4,
686 [&]() -> bool
687 {
688 // This is actually a migration for APP_SETTINGS_BASE::m_LibTree
689 return migrateLibTreeWidth();
690 } );
691
692 registerMigration( 4, 5,
693 [&]() -> bool
694 {
695 // This default proved to be unpopular; bump it off for everyone
696 Set( "editing.auto_fill_zones", false );
697 return true;
698 } );
699}
700
701
703
704
705bool PCBNEW_SETTINGS::MigrateFromLegacy( wxConfigBase* aCfg )
706{
707 bool ret = APP_SETTINGS_BASE::MigrateFromLegacy( aCfg );
708
709 const std::string f = getLegacyFrameName();
710
711 //
712 // NOTE: there's no value in line-wrapping these; it just makes the table unreadable.
713 //
714 ret &= fromLegacy<bool>( aCfg, "ShowLayerManagerTools", "aui.show_layer_manager" );
715
716 ret &= fromLegacy<int>( aCfg, "FootprintChooserHSashPosition", "footprint_chooser.sash_h" );
717 ret &= fromLegacy<int>( aCfg, "FootprintChooserVSashPosition", "footprint_chooser.sash_v" );
718 ret &= fromLegacy<int>( aCfg, "FootprintChooserWidth", "footprint_chooser.width" );
719 ret &= fromLegacy<int>( aCfg, "FootprintChooserHeight", "footprint_chooser.height" );
720
721 ret &= fromLegacy<bool>( aCfg, "FlipLeftRight", "editing.flip_left_right" );
722 ret &= fromLegacy<bool>( aCfg, "MagneticGraphics", "editing.magnetic_graphics" );
723 ret &= fromLegacy<int>( aCfg, "MagneticPads", "editing.magnetic_pads" );
724 ret &= fromLegacy<int>( aCfg, "MagneticTracks", "editing.magnetic_tracks" );
725 ret &= fromLegacy<bool>( aCfg, "DisplayPolarCoords", "editing.polar_coords" );
726 ret &= fromLegacy<bool>( aCfg, "Use45DegreeGraphicSegments", "editing.use_45_degree_graphic_segments" );
727
728 ret &= fromLegacy<bool>( aCfg, "PcbAffT", "pcb_display.graphic_items_fill" );
729 ret &= fromLegacy<int>( aCfg, "MaxLnkS", "pcb_display.max_links_shown" );
730 ret &= fromLegacy<bool>( aCfg, "ModAffC", "pcb_display.footprint_edge_fill" );
731 ret &= fromLegacy<bool>( aCfg, "ModAffT", "pcb_display.footprint_text_fill" );
732 ret &= fromLegacy<int>( aCfg, "ShowNetNamesMode", "pcb_display.net_names_mode" );
733 ret &= fromLegacy<int>( aCfg, "PcbDisplayOrigin", "pcb_display.origin_mode" );
734 ret &= fromLegacy<bool>( aCfg, "PcbInvertXAxis", "pcb_display.origin_invert_x_axis" );
735 ret &= fromLegacy<bool>( aCfg, "PcbInvertYAxis", "pcb_display.origin_invert_y_axis" );
736 ret &= fromLegacy<bool>( aCfg, "PadAffG", "pcb_display.pad_clearance" );
737 ret &= fromLegacy<bool>( aCfg, "PadFill", "pcb_display.pad_fill" );
738 ret &= fromLegacy<bool>( aCfg, "PadSNum", "pcb_display.pad_numbers" );
739 ret &= fromLegacy<bool>( aCfg, "ShowRatsnestLines", "pcb_display.ratsnest_global" );
740 ret &= fromLegacy<bool>( aCfg, "ShowRatsnestModuleLines", "pcb_display.ratsnest_footprint" );
741 ret &= fromLegacy<bool>( aCfg, "CurvedRatsnestLines", "pcb_display.ratsnest_curved" );
742 ret &= fromLegacy<int>( aCfg, "RotationAngle", "pcb_display.rotation_angle" );
743 ret &= fromLegacy<int>( aCfg, "TrackDisplayClearance", "pcb_display.track_clearance_mode" );
744 ret &= fromLegacy<bool>( aCfg, "DisplayTrackFilled", "pcb_display.track_fill" );
745 ret &= fromLegacy<bool>( aCfg, "ViaFill", "pcb_display.via_fill" );
746 ret &= fromLegacy<int>( aCfg, "PcbShowZonesMode", "pcb_display.zone_mode" );
747
748 ret &= fromLegacy<double>( aCfg, "PlotLineWidth_mm", "plot.line_width" );
749
750 aCfg->SetPath( "/dialogs/cleanup_tracks" );
751 ret &= fromLegacy<bool>( aCfg, "DialogCleanupVias", "cleanup.cleanup_vias" );
752 ret &= fromLegacy<bool>( aCfg, "DialogCleanupMergeSegments", "cleanup.merge_segments" );
753 ret &= fromLegacy<bool>( aCfg, "DialogCleanupUnconnected", "cleanup.cleanup_unconnected" );
754 ret &= fromLegacy<bool>( aCfg, "DialogCleanupShortCircuit", "cleanup.cleanup_short_circuits" );
755 ret &= fromLegacy<bool>( aCfg, "DialogCleanupTracksInPads", "cleanup.cleanup_tracks_in_pad" );
756 aCfg->SetPath( "../.." );
757
758 ret &= fromLegacy<bool>( aCfg, "RefillZonesBeforeDrc", "drc_dialog.refill_zones" );
759 ret &= fromLegacy<bool>( aCfg, "DrcTestFootprints", "drc_dialog.test_footprints" );
760
761 ret &= fromLegacy<bool>( aCfg, "DrillMergePTHNPTH", "gen_drill.merge_pth_npth" );
762 ret &= fromLegacy<bool>( aCfg, "DrillMinHeader", "gen_drill.minimal_header" );
763 ret &= fromLegacy<bool>( aCfg, "DrillMirrorYOpt", "gen_drill.mirror" );
764 ret &= fromLegacy<bool>( aCfg, "DrillUnit", "gen_drill.unit_drill_is_inch" );
765 ret &= fromLegacy<bool>( aCfg, "OvalHolesRouteMode", "gen_drill.use_route_for_oval_holes" );
766 ret &= fromLegacy<int>( aCfg, "DrillFileType", "gen_drill.drill_file_type" );
767 ret &= fromLegacy<int>( aCfg, "DrillMapFileType", "gen_drill.map_file_type" );
768 ret &= fromLegacy<int>( aCfg, "DrillZerosFormat", "gen_drill.zeros_format" );
769
770 ret &= fromLegacy<bool>( aCfg, "IDFRefAutoAdj", "export_idf.auto_adjust" );
771 ret &= fromLegacy<int>( aCfg, "IDFRefUnits", "export_idf.ref_units" );
772 ret &= fromLegacy<double>( aCfg, "IDFRefX", "export_idf.ref_x" );
773 ret &= fromLegacy<double>( aCfg, "IDFRefY", "export_idf.ref_y" );
774 ret &= fromLegacy<bool>( aCfg, "IDFExportThou", "export_idf.units_mils" );
775
776 ret &= fromLegacy<int>( aCfg, "STEP_Origin_Opt", "export_step.origin_mode" );
777 ret &= fromLegacy<int>( aCfg, "STEP_UserOriginUnits", "export_step.origin_units" );
778 ret &= fromLegacy<double>( aCfg, "STEP_UserOriginX", "export_step.origin_x" );
779 ret &= fromLegacy<double>( aCfg, "STEP_UserOriginY", "export_step.origin_y" );
780 ret &= fromLegacy<bool>( aCfg, "STEP_NoVirtual", "export_step.no_virtual" );
781
782 ret &= fromLegacy<bool>( aCfg, "PlotSVGModeColor", "export_svg.black_and_white" );
783 ret &= fromLegacy<bool>( aCfg, "PlotSVGModeMirror", "export_svg.mirror" );
784 ret &= fromLegacy<bool>( aCfg, "PlotSVGModeOneFile", "export_svg.one_file" );
785 ret &= fromLegacy<bool>( aCfg, "PlotSVGBrdEdge", "export_svg.plot_board_edges" );
786 ret &= fromLegacy<int>( aCfg, "PlotSVGPageOpt", "export_svg.page_size" );
787 ret &= fromLegacyString( aCfg, "PlotSVGDirectory", "export_svg.output_dir" );
788
789 {
790 nlohmann::json js = nlohmann::json::array();
791 wxString key;
792 bool val = false;
793
794 for( unsigned i = 0; i < PCB_LAYER_ID_COUNT; ++i )
795 {
796 key.Printf( wxT( "PlotSVGLayer_%d" ), i );
797
798 if( aCfg->Read( key, &val ) && val )
799 js.push_back( i );
800 }
801
802 Set( "export_svg.layers", js );
803 }
804
805 {
806 nlohmann::json js = nlohmann::json::array();
807
808 wxString packed;
809
810 if( aCfg->Read( "ActionPluginButtons", &packed ) )
811 {
812 wxStringTokenizer pluginSettingsTokenizer = wxStringTokenizer( packed, ";" );
813
814 while( pluginSettingsTokenizer.HasMoreTokens() )
815 {
816 nlohmann::json row;
817 wxString plugin = pluginSettingsTokenizer.GetNextToken();
818 wxStringTokenizer pluginTokenizer = wxStringTokenizer( plugin, "=" );
819
820 if( pluginTokenizer.CountTokens() != 2 )
821 {
822 // Bad config
823 continue;
824 }
825
826 std::string key( pluginTokenizer.GetNextToken().ToUTF8() );
827 bool value( pluginTokenizer.GetNextToken().Cmp( wxT( "Visible" ) ) == 0 );
828
829 js.push_back( nlohmann::json( { { key, value } } ) );
830 }
831 }
832
833 Set( "action_plugins", js );
834 }
835
836 //
837 // NOTE: there's no value in line-wrapping these; it just makes the table unreadable.
838 //
839 ret &= fromLegacy<int>( aCfg, "VrmlExportUnit", "export_vrml.units" );
840 ret &= fromLegacy<bool>( aCfg, "VrmlExportCopyFiles", "export_vrml.copy_3d_models" );
841 ret &= fromLegacy<bool>( aCfg, "VrmlUseRelativePaths", "export_vrml.use_relative_paths" );
842 ret &= fromLegacy<int>( aCfg, "VrmlRefUnits", "export_vrml.ref_units" );
843 ret &= fromLegacy<double>( aCfg, "VrmlRefX", "export_vrml.ref_x" );
844 ret &= fromLegacy<double>( aCfg, "VrmlRefY", "export_vrml.ref_y" );
845 ret &= fromLegacy<int> ( aCfg, "VrmlOriginMode", "export_vrml.origin_mode" );
846
847 ret &= fromLegacy<int>( aCfg, "Zone_Ouline_Hatch_Opt", "zones.hatching_style" );
848 ret &= fromLegacy<int>( aCfg, "Zone_NetSort_Opt", "zones.net_sort_mode" );
849 ret &= fromLegacy<double>( aCfg, "Zone_Clearance", "zones.clearance" );
850 ret &= fromLegacy<double>( aCfg, "Zone_Thickness", "zones.min_thickness" );
851 ret &= fromLegacy<double>( aCfg, "Zone_TH_Gap", "zones.thermal_relief_gap" );
852 ret &= fromLegacy<double>( aCfg, "Zone_TH_Copper_Width", "zones.thermal_relief_copper_width" );
853
854 aCfg->SetPath( "ImportGraphics" );
855 ret &= fromLegacy<int>( aCfg, "BoardLayer", "import_graphics.layer" );
856 ret &= fromLegacy<bool>( aCfg, "InteractivePlacement", "import_graphics.interactive_placement" );
857 ret &= fromLegacyString( aCfg, "LastFile", "import_graphics.last_file" );
858 ret &= fromLegacy<double>( aCfg, "LineWidth", "import_graphics.line_width" );
859 ret &= fromLegacy<int>( aCfg, "LineWidthUnits", "import_graphics.line_width_units" );
860 ret &= fromLegacy<int>( aCfg, "PositionUnits", "import_graphics.origin_units" );
861 ret &= fromLegacy<double>( aCfg, "PositionX", "import_graphics.origin_x" );
862 ret &= fromLegacy<double>( aCfg, "PositionY", "import_graphics.origin_y" );
863 aCfg->SetPath( ".." );
864
865 ret &= fromLegacy<int>( aCfg, "NetlistReportFilterMsg", "netlist.report_filter" );
866 ret &= fromLegacy<bool>( aCfg, "NetlistUpdateFootprints", "netlist.update_footprints" );
867 ret &= fromLegacy<bool>( aCfg, "NetlistDeleteShortingTracks", "netlist.delete_shorting_tracks" );
868 ret &= fromLegacy<bool>( aCfg, "NetlistDeleteExtraFootprints", "netlist.delete_extra_footprints" );
869
870 ret &= fromLegacy<int>( aCfg, "PlaceFileUnits", "place_file.units" );
871 ret &= fromLegacy<int>( aCfg, "PlaceFileOpts", "place_file.file_options" );
872 ret &= fromLegacy<int>( aCfg, "PlaceFileFormat", "place_file.file_format" );
873 ret &= fromLegacy<bool>( aCfg, "PlaceFileIncludeBrdEdge", "place_file.include_board_edge" );
874
875 ret &= fromLegacy<int>( aCfg, "PrintSinglePage", "plot.all_layers_on_one_page" );
876 ret &= fromLegacy<int>( aCfg, "PrintPadsDrillOpt", "plot.pads_drill_mode" );
877 ret &= fromLegacy<double>( aCfg, "PlotXFineScaleAdj", "plot.fine_scale_x" );
878 ret &= fromLegacy<double>( aCfg, "PlotYFineScaleAdj", "plot.fine_scale_y" );
879 ret &= fromLegacy<double>( aCfg, "PSPlotFineWidthAdj", "plot.ps_fine_width_adjust" );
880 ret &= fromLegacy<bool>( aCfg, "CheckZonesBeforePlotting", "plot.check_zones_before_plotting" );
881
882 ret &= fromLegacyString( aCfg, "FootprintTextShownColumns", "window.footprint_text_shown_columns" );
883
884 ret &= fromLegacy<int>( aCfg, "FpWizardListWidth", "footprint_wizard_list.width" );
885 ret &= fromLegacy<int>( aCfg, "FpWizardListHeight", "footprint_wizard_list.height" );
886
887 migrateWindowConfig( aCfg, "ModViewFrame", "footprint_viewer" );
888
889 ret &= fromLegacy<bool>( aCfg, "ModViewFrameAutoZoom", "footprint_viewer.auto_zoom" );
890 ret &= fromLegacy<double>( aCfg, "ModViewFrameZoom", "footprint_viewer.zoom" );
891
892 migrateWindowConfig( aCfg, "FootprintWizard", "footprint_wizard" );
893 ret &= fromLegacyString( aCfg, "Fpwizard_auiPerspective", "footprint_wizard.perspective" );
894
895
896 const std::string p = "pcbnew.InteractiveRouter.";
897
898 Set( "tools.pns.meta", nlohmann::json( {
899 { "filename", "pns" },
900 { "version", 0 }
901 } ) );
902
903 ret &= fromLegacy<int>( aCfg, p + "Mode", "tools.pns.mode" );
904 ret &= fromLegacy<int>( aCfg, p + "OptimizerEffort", "tools.pns.effort" );
905 ret &= fromLegacy<bool>( aCfg, p + "RemoveLoops", "tools.pns.remove_loops" );
906 ret &= fromLegacy<bool>( aCfg, p + "SmartPads", "tools.pns.smart_pads" );
907 ret &= fromLegacy<bool>( aCfg, p + "ShoveVias", "tools.pns.shove_vias" );
908 ret &= fromLegacy<bool>( aCfg, p + "StartDiagonal", "tools.pns.start_diagonal" );
909 ret &= fromLegacy<int>( aCfg, p + "ShoveTimeLimit", "tools.pns.shove_time_limit" );
910 ret &= fromLegacy<int>( aCfg, p + "ShoveIterationLimit", "tools.pns.shove_iteration_limit" );
911 ret &= fromLegacy<int>( aCfg, p + "WalkaroundIterationLimit", "tools.pns.walkaround_iteration_limit" );
912 ret &= fromLegacy<bool>( aCfg, p + "JumpOverObstacles", "tools.pns.jump_over_obstacles" );
913 ret &= fromLegacy<bool>( aCfg, p + "SmoothDraggedSegments", "tools.pns.smooth_dragged_segments" );
914 ret &= fromLegacy<bool>( aCfg, p + "CanViolateDRC", "tools.pns.can_violate_drc" );
915 ret &= fromLegacy<bool>( aCfg, p + "SuggestFinish", "tools.pns.suggest_finish" );
916 ret &= fromLegacy<bool>( aCfg, p + "FreeAngleMode", "tools.pns.free_angle_mode" );
917 ret &= fromLegacy<bool>( aCfg, p + "InlineDragEnabled", "editing.track_drag_action" );
918
919 // Initialize some new PNS settings to legacy behaviors if coming from legacy
920 Set( "tools.pns.fix_all_segments", false );
921
922 // Migrate color settings that were stored in the pcbnew config file
923
924 COLOR_SETTINGS* cs = Pgm().GetSettingsManager().GetMigratedColorSettings();
925
926 auto migrateLegacyColor =
927 [&] ( const std::string& aKey, int aLayerId )
928 {
929 wxString str;
930
931 if( aCfg->Read( aKey, &str ) )
932 cs->SetColor( aLayerId, COLOR4D( str ) );
933 };
934
935 for( int i = 0; i < PCB_LAYER_ID_COUNT; ++i )
936 {
937 wxString layer = LSET::Name( PCB_LAYER_ID( i ) );
938 migrateLegacyColor( "Color4DPCBLayer_" + layer.ToStdString(), PCB_LAYER_ID( i ) );
939 }
940
941 migrateLegacyColor( "Color4DAnchorEx", LAYER_ANCHOR );
942 migrateLegacyColor( "Color4DAuxItems", LAYER_AUX_ITEMS );
943 migrateLegacyColor( "Color4DGrid", LAYER_GRID );
944 migrateLegacyColor( "Color4DNonPlatedEx", LAYER_NON_PLATEDHOLES );
945 migrateLegacyColor( "Color4DPadThruHoleEx", LAYER_PADS_TH );
946 migrateLegacyColor( "Color4DPCBBackground", LAYER_PCB_BACKGROUND );
947 migrateLegacyColor( "Color4DPCBCursor", LAYER_CURSOR );
948 migrateLegacyColor( "Color4DRatsEx", LAYER_RATSNEST );
949 migrateLegacyColor( "Color4DTxtInvisEx", LAYER_HIDDEN_TEXT );
950 migrateLegacyColor( "Color4DViaBBlindEx", LAYER_VIA_BBLIND );
951 migrateLegacyColor( "Color4DViaMicroEx", LAYER_VIA_MICROVIA );
952 migrateLegacyColor( "Color4DViaThruEx", LAYER_VIA_THROUGH );
953 migrateLegacyColor( "Color4DWorksheet", LAYER_DRAWINGSHEET );
954 migrateLegacyColor( "Color4DGrid", LAYER_PAGE_LIMITS );
955
956 Pgm().GetSettingsManager().SaveColorSettings( cs, "board" );
957
958 Set( "appearance.color_theme", cs->GetFilename() );
959
960 double x = 0, y = 0;
961
962 if( aCfg->Read( f + "PcbUserGrid_X", &x ) && aCfg->Read( f + "PcbUserGrid_Y", &y ) )
963 {
964 EDA_UNITS u = static_cast<EDA_UNITS>( aCfg->ReadLong( f + "PcbUserGrid_Unit",
965 static_cast<long>( EDA_UNITS::INCHES ) ) );
966
967 // Convert to internal units
970
971 Set( "window.grid.user_grid_x", EDA_UNIT_UTILS::UI::StringFromValue( pcbIUScale, u, x ) );
972 Set( "window.grid.user_grid_y", EDA_UNIT_UTILS::UI::StringFromValue( pcbIUScale, u, y ) );
973 }
974
975 // Footprint editor settings were stored in pcbnew config file. Migrate them here.
976 auto fpedit = Pgm().GetSettingsManager().GetAppSettings<FOOTPRINT_EDITOR_SETTINGS>();
977 fpedit->MigrateFromLegacy( aCfg );
978 fpedit->Load();
979
980 // Same with 3D viewer
981 auto viewer3d = Pgm().GetSettingsManager().GetAppSettings<EDA_3D_VIEWER_SETTINGS>();
982 viewer3d->MigrateFromLegacy( aCfg );
983 viewer3d->Load();
984
985 return ret;
986}
987
988//namespace py = pybind11;
989//
990//PYBIND11_MODULE( pcbnew, m )
991//{
992// py::class_<PCBNEW_SETTINGS>( m, "settings" )
993// .def_readwrite( "Use45DegreeGraphicSegments", &PCBNEW_SETTINGS::m_Use45DegreeGraphicSegments )
994// .def_readwrite( "FlipLeftRight", &PCBNEW_SETTINGS::m_FlipLeftRight )
995// .def_readwrite( "AddUnlockedPads", &PCBNEW_SETTINGS::m_AddUnlockedPads)
996// .def_readwrite( "UsePolarCoords", &PCBNEW_SETTINGS::m_PolarCoords)
997// .def_readwrite( "RotationAngle", &PCBNEW_SETTINGS::m_RotationAngle)
998// .def_readwrite( "ShowPageLimits", &PCBNEW_SETTINGS::m_ShowPageLimits)
999// ;
1000//}
ARC_EDIT_MODE
Settings for arc editing.
Definition: app_settings.h:52
@ 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:104
static const wxChar * Name(PCB_LAYER_ID aLayerId)
Return the fixed name association with aLayerId.
Definition: lset.cpp:89
Like a normal param, but with custom getter and setter functions.
Definition: parameters.h:282
DIALOG_EXPORT_2581 m_Export2581
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
DIALOG_NET_INSPECTOR m_NetInspector
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:443
static constexpr EDA_ANGLE & ANGLE_90
Definition: eda_angle.h:439
EDA_UNITS
Definition: eda_units.h:46
@ LAYER_GRID
Definition: layer_ids.h:206
@ LAYER_PAGE_LIMITS
color for drawing the page extents (visibility stored in PCBNEW_SETTINGS::m_ShowPageLimits)
Definition: layer_ids.h:250
@ LAYER_NON_PLATEDHOLES
handle color for not plated holes (holes, not pads)
Definition: layer_ids.h:198
@ LAYER_DRAWINGSHEET
drawingsheet frame and titleblock
Definition: layer_ids.h:218
@ LAYER_PCB_BACKGROUND
PCB background color.
Definition: layer_ids.h:221
@ LAYER_HIDDEN_TEXT
text marked as invisible
Definition: layer_ids.h:201
@ LAYER_CURSOR
PCB cursor.
Definition: layer_ids.h:222
@ LAYER_AUX_ITEMS
Auxiliary items (guides, rule, etc)
Definition: layer_ids.h:223
@ LAYER_RATSNEST
Definition: layer_ids.h:205
@ LAYER_ANCHOR
anchor of items having an anchor point (texts, footprints)
Definition: layer_ids.h:202
@ LAYER_PADS_TH
multilayer pads, usually with holes
Definition: layer_ids.h:214
@ LAYER_VIA_MICROVIA
to draw micro vias
Definition: layer_ids.h:195
@ LAYER_VIA_THROUGH
to draw usual through hole vias
Definition: layer_ids.h:197
@ LAYER_VIA_BBLIND
to draw blind/buried vias
Definition: layer_ids.h:196
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:60
@ Dwgs_User
Definition: layer_ids.h:110
@ PCB_LAYER_ID_COUNT
Definition: layer_ids.h:138
KICOMMON_API double FromUserUnit(const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnit, double aValue)
Return in internal units the value aValue given in a real unit such as "in", "mm",...
Definition: eda_units.cpp:499
KICOMMON_API 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:284
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:119
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.