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 The 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 <lset.h>
30#include <pcbnew_settings.h>
31#include <pgm_base.h>
35#include <settings/parameters.h>
37#include <wx/config.h>
38#include <wx/tokenzr.h>
39#include <zones.h>
40#include <widgets/ui_common.h>
41#include <base_units.h>
42
43#include "../3d-viewer/3d_viewer/eda_3d_viewer_settings.h"
44
45
47const int pcbnewSchemaVersion = 5;
48
49
52 m_AuiPanels(),
53 m_Cleanup(),
54 m_DrcDialog(),
55 m_ExportIdf(),
56 m_ExportStep(),
57 m_ExportODBPP(),
58 m_ExportSvg(),
59 m_ExportVrml(),
60 m_FootprintWizardList(),
61 m_GenDrill(),
62 m_ImportGraphics(),
63 m_NetlistDialog(),
64 m_PlaceFile(),
65 m_Plot(),
66 m_FootprintChooser(),
67 m_Zones(),
68 m_FootprintViewer(),
69 m_FootprintWizard(),
70 m_Display(),
71 m_TrackDragAction( TRACK_DRAG_ACTION::DRAG ),
73 m_CtrlClickHighlight( false ),
74 m_Use45DegreeLimit( false ),
75 m_FlipDirection( FLIP_DIRECTION::TOP_BOTTOM ),
76 m_ESCClearsNetHighlight( true ),
77 m_PolarCoords( false ),
78 m_RotationAngle( ANGLE_90 ),
79 m_ShowPageLimits( true ),
80 m_ShowCourtyardCollisions( true ),
81 m_AutoRefillZones( false ),
82 m_AllowFreePads( false ),
83 m_PnsSettings( nullptr ),
84 m_FootprintViewerZoom( 1.0 ),
85 m_FootprintViewerAutoZoomOnSelect( true ),
86 m_FootprintViewerLibListWidth( 200 ),
87 m_FootprintViewerFPListWidth( 300 )
88{
89 m_MagneticItems.pads = MAGNETIC_OPTIONS::CAPTURE_CURSOR_IN_TRACK_TOOL;
90 m_MagneticItems.tracks = MAGNETIC_OPTIONS::CAPTURE_CURSOR_IN_TRACK_TOOL;
93
95
96 m_params.emplace_back( new PARAM<bool>( "aui.show_layer_manager",
98
99 m_params.emplace_back( new PARAM<int>( "aui.right_panel_width",
101
102 m_params.emplace_back( new PARAM<int>( "aui.net_inspector_width",
104
105 m_params.emplace_back( new PARAM<int>( "aui.properties_panel_width",
107
108 m_params.emplace_back( new PARAM<float>( "aui.properties_splitter_proportion",
110
111 m_params.emplace_back( new PARAM<int>( "aui.search_panel_height",
113
114 m_params.emplace_back( new PARAM<int>( "aui.search_panel_width",
116
117 m_params.emplace_back( new PARAM<int>( "aui.search_panel_dock_direction",
119
120 m_params.emplace_back( new PARAM<int>( "aui.appearance_panel_tab",
121 &m_AuiPanels.appearance_panel_tab, 0, 0, 2 ) );
122
123 m_params.emplace_back( new PARAM<bool>( "aui.appearance_expand_layer_display",
125
126 m_params.emplace_back( new PARAM<bool>( "aui.appearance_expand_net_display",
128
129 m_params.emplace_back( new PARAM<bool>( "aui.show_properties",
130 &m_AuiPanels.show_properties, false ) );
131
132 m_params.emplace_back( new PARAM<bool>( "aui.show_search",
133 &m_AuiPanels.show_search, false ) );
134
135 m_params.emplace_back( new PARAM<bool>( "aui.show_net_inspector",
137
138 m_params.emplace_back( new PARAM<int>( "footprint_chooser.width",
139 &m_FootprintChooser.width, -1 ) );
140
141 m_params.emplace_back( new PARAM<int>( "footprint_chooser.height",
142 &m_FootprintChooser.height, -1 ) );
143
144 m_params.emplace_back( new PARAM<int>( "footprint_chooser.sash_h",
145 &m_FootprintChooser.sash_h, -1 ) );
146
147 m_params.emplace_back( new PARAM<int>( "footprint_chooser.sash_v",
148 &m_FootprintChooser.sash_v, -1 ) );
149
150 m_params.emplace_back( new PARAM<int>( "footprint_chooser.sort_mode",
152
153 m_params.emplace_back( new PARAM<bool>( "footprint_chooser.filter_on_pin_count",
155
156 m_params.emplace_back( new PARAM<bool>( "footprint_chooser.use_fp_filters",
158
159 m_params.emplace_back( new PARAM<bool>( "editing.flip_left_right",
160 reinterpret_cast<bool*>( &m_FlipDirection ),
161 static_cast<bool>( FLIP_DIRECTION::LEFT_RIGHT ) ) );
162
163 m_params.emplace_back( new PARAM<bool>( "editing.esc_clears_net_highlight",
164 &m_ESCClearsNetHighlight, true ) );
165
166 m_params.emplace_back( new PARAM<bool>( "editing.show_courtyard_collisions",
167 &m_ShowCourtyardCollisions, true ) );
168
169 m_params.emplace_back( new PARAM<bool>( "editing.magnetic_graphics",
170 &m_MagneticItems.graphics, true ) );
171
172 m_params.emplace_back( new PARAM<int>( "editing.magnetic_pads",
173 reinterpret_cast<int*>( &m_MagneticItems.pads ),
174 static_cast<int>( MAGNETIC_OPTIONS::CAPTURE_CURSOR_IN_TRACK_TOOL ) ) );
175
176 m_params.emplace_back( new PARAM<int>( "editing.magnetic_tracks",
177 reinterpret_cast<int*>( &m_MagneticItems.tracks ),
178 static_cast<int>( MAGNETIC_OPTIONS::CAPTURE_CURSOR_IN_TRACK_TOOL ) ) );
179
180 m_params.emplace_back( new PARAM<bool>( "editing.magnetic_all_layers",
181 &m_MagneticItems.allLayers, false ) );
182
183 m_params.emplace_back( new PARAM<bool>( "editing.polar_coords",
184 &m_PolarCoords, false ) );
185
186 m_params.emplace_back( new PARAM<int>( "editing.track_drag_action",
187 reinterpret_cast<int*>( &m_TrackDragAction ),
188 static_cast<int>( TRACK_DRAG_ACTION::DRAG ) ) );
189
190 m_params.emplace_back( new PARAM<int>( "editing.arc_edit_mode",
191 reinterpret_cast<int*>( &m_ArcEditMode ),
192 static_cast<int>( ARC_EDIT_MODE::KEEP_CENTER_ADJUST_ANGLE_RADIUS ) ) );
193
194 m_params.emplace_back( new PARAM<bool>( "editing.ctrl_click_highlight",
195 &m_CtrlClickHighlight, false ) );
196
197 m_params.emplace_back( new PARAM<bool>( "editing.pcb_use_45_degree_limit",
198 &m_Use45DegreeLimit, false ) );
199
200 m_params.emplace_back( new PARAM<bool>( "editing.auto_fill_zones",
201 &m_AutoRefillZones, false ) );
202
203 m_params.emplace_back( new PARAM<bool>( "editing.allow_free_pads",
204 &m_AllowFreePads, false ) );
205
206 m_params.emplace_back( new PARAM_LAMBDA<int>( "editing.rotation_angle",
207 [this] () -> int
208 {
210
211 // Don't store values larger than 360 degrees
212 return rot % 3600;
213 },
214 [this] ( int aVal )
215 {
216 if( aVal )
218
219 // A misconfiguration allowed some angles to be stored as tenth of a degree but read
220 // as tens of degrees. By disallowing storage of values larger than 360, we can weed out
221 // those invalid values here.
222 while( m_RotationAngle > ANGLE_360 )
224
225 },
226 900 ) );
227
228 m_params.emplace_back( new PARAM<bool>( "pcb_display.graphic_items_fill",
230
231 m_params.emplace_back( new PARAM<int>( "pcb_display.max_links_shown",
232 &m_Display.m_MaxLinksShowed, 3, 0, 15 ) );
233
234 m_params.emplace_back( new PARAM<bool>( "pcb_display.graphics_fill",
236
237 m_params.emplace_back( new PARAM<bool>( "pcb_display.text_fill",
239
240 m_params.emplace_back( new PARAM<int>( "pcb_display.net_names_mode",
241 &m_Display.m_NetNames, 3, 0, 3 ) );
242
243 m_params.emplace_back( new PARAM<bool>( "pcb_display.pad_clearance",
244 &m_Display.m_PadClearance, true ) );
245
246 m_params.emplace_back( new PARAM<bool>( "pcb_display.pad_fill",
248
249 m_params.emplace_back( new PARAM<bool>( "pcb_display.pad_numbers",
251
252 m_params.emplace_back( new PARAM<bool>( "pcb_display.ratsnest_global",
254
255 m_params.emplace_back( new PARAM<bool>( "pcb_display.ratsnest_footprint",
257
258 m_params.emplace_back( new PARAM<bool>( "pcb_display.ratsnest_curved",
260
261 m_params.emplace_back( new PARAM<double>( "pcb_display.ratsnest_thickness",
263
264 m_params.emplace_back( new PARAM<int>( "pcb_display.track_clearance_mode",
265 reinterpret_cast<int*>( &m_Display.m_TrackClearance ), SHOW_WITH_VIA_WHILE_ROUTING ) );
266
267 m_params.emplace_back( new PARAM<bool>( "pcb_display.track_fill",
269
270 m_params.emplace_back( new PARAM<bool>( "pcb_display.via_fill",
271 &m_Display.m_DisplayViaFill, true ) );
272
273 m_params.emplace_back( new PARAM<int>( "pcb_display.origin_mode",
274 reinterpret_cast<int*>( &m_Display.m_DisplayOrigin ),
275 PCB_DISPLAY_ORIGIN::PCB_ORIGIN_PAGE ) );
276
277 m_params.emplace_back( new PARAM<bool>( "pcb_display.origin_invert_x_axis",
279
280 m_params.emplace_back( new PARAM<bool>( "pcb_display.origin_invert_y_axis",
282
283 m_params.emplace_back( new PARAM<bool>( "pcb_display.force_show_fields_when_fp_selected",
285
286 m_params.emplace_back( new PARAM<bool>( "pcb_display.live_3d_refresh",
287 &m_Display.m_Live3DRefresh, false ) );
288
289 m_params.emplace_back( new PARAM<bool>( "pcb_display.show_page_borders",
290 &m_ShowPageLimits, true ) );
291
292 m_params.emplace_back( new PARAM<bool>( "cleanup.cleanup_refill_zones",
294
295 m_params.emplace_back( new PARAM<bool>( "cleanup.cleanup_vias",
296 &m_Cleanup.cleanup_vias, true ) );
297
298 m_params.emplace_back( new PARAM<bool>( "cleanup.delete_dangling_vias",
300
301 m_params.emplace_back( new PARAM<bool>( "cleanup.merge_segments",
302 &m_Cleanup.merge_segments, true ) );
303
304 m_params.emplace_back( new PARAM<bool>( "cleanup.cleanup_unconnected",
306
307 m_params.emplace_back( new PARAM<bool>( "cleanup.cleanup_short_circuits",
309
310 m_params.emplace_back( new PARAM<bool>( "cleanup.cleanup_tracks_in_pad",
312
313 m_params.emplace_back( new PARAM<bool>( "drc_dialog.refill_zones",
314 &m_DrcDialog.refill_zones, true ) );
315
316 m_params.emplace_back( new PARAM<bool>( "drc_dialog.test_all_track_errors",
318
319 m_params.emplace_back( new PARAM<bool>( "drc_dialog.test_footprints",
320 &m_DrcDialog.test_footprints, false ) );
321
322 m_params.emplace_back( new PARAM<int>( "drc_dialog.severities",
324
325 m_params.emplace_back( new PARAM<bool>( "gen_drill.merge_pth_npth",
326 &m_GenDrill.merge_pth_npth, false ) );
327
328 m_params.emplace_back( new PARAM<bool>( "gen_drill.minimal_header",
329 &m_GenDrill.minimal_header, false ) );
330
331 m_params.emplace_back( new PARAM<bool>( "gen_drill.mirror",
332 &m_GenDrill.mirror, false ) );
333
334 m_params.emplace_back( new PARAM<bool>( "gen_drill.unit_drill_is_inch",
335 &m_GenDrill.unit_drill_is_inch, false ) );
336
337 m_params.emplace_back( new PARAM<bool>( "gen_drill.use_route_for_oval_holes",
339
340 m_params.emplace_back( new PARAM<int>( "gen_drill.drill_file_type",
342
343 m_params.emplace_back( new PARAM<int>( "gen_drill.map_file_type",
345
346 m_params.emplace_back( new PARAM<int>( "gen_drill.zeros_format",
347 &m_GenDrill.zeros_format, 0, 0, 3 ) );
348
349 m_params.emplace_back( new PARAM<bool>( "gen_drill.generate_map",
350 &m_GenDrill.generate_map, false ) );
351
352 m_params.emplace_back( new PARAM<int>( "export_2581.units",
353 &m_Export2581.units, 0 ) );
354
355 m_params.emplace_back( new PARAM<int>( "export_2581.precision",
356 &m_Export2581.precision, 6 ) );
357
358 m_params.emplace_back( new PARAM<int>( "export_2581.version",
359 &m_Export2581.version, 1 ) );
360
361 m_params.emplace_back( new PARAM<bool>( "export_2581.compress",
362 &m_Export2581.compress, false ) );
363
364 m_params.emplace_back( new PARAM<int>( "export_odb.units",
365 &m_ExportODBPP.units, 0 ) );
366
367 m_params.emplace_back( new PARAM<int>( "export_odb.precision",
368 &m_ExportODBPP.precision, 6 ) );
369
370 m_params.emplace_back( new PARAM<int>( "export_odb.compress_format",
372
373 m_params.emplace_back( new PARAM<bool>( "export_idf.auto_adjust",
374 &m_ExportIdf.auto_adjust, false ) );
375
376 m_params.emplace_back( new PARAM<int>( "export_idf.ref_units",
377 &m_ExportIdf.ref_units, 0 ) );
378
379 m_params.emplace_back( new PARAM<double>( "export_idf.ref_x",
380 &m_ExportIdf.ref_x, 0 ) );
381
382 m_params.emplace_back( new PARAM<double>( "export_idf.ref_y",
383 &m_ExportIdf.ref_y, 0 ) );
384
385 m_params.emplace_back( new PARAM<bool>( "export_idf.units_mils",
386 &m_ExportIdf.units_mils, false ) );
387
388 m_params.emplace_back( new PARAM<int>( "export_step.origin_mode",
390
391 m_params.emplace_back( new PARAM<int>( "export_step.origin_units",
393
394 m_params.emplace_back( new PARAM<double>( "export_step.origin_x",
395 &m_ExportStep.origin_x, 0 ) );
396
397 m_params.emplace_back( new PARAM<double>( "export_step.origin_y",
398 &m_ExportStep.origin_y, 0 ) );
399
400 m_params.emplace_back( new PARAM<bool>( "export_step.no_unspecified",
401 &m_ExportStep.no_unspecified, false ) );
402
403 m_params.emplace_back( new PARAM<bool>( "export_step.no_dnp",
404 &m_ExportStep.no_dnp, false ) );
405
406 m_params.emplace_back( new PARAM<bool>( "export_step.replace_models",
407 &m_ExportStep.replace_models, true ) );
408
409 m_params.emplace_back( new PARAM<bool>( "export_step.overwrite_file",
410 &m_ExportStep.overwrite_file, true ) );
411
412 m_params.emplace_back( new PARAM<bool>( "export_svg.black_and_white",
413 &m_ExportSvg.black_and_white, false ) );
414
415 m_params.emplace_back( new PARAM<bool>( "export_svg.use_theme",
417
418 m_params.emplace_back( new PARAM<wxString>( "export_svg.color_theme",
419 &m_ExportSvg.color_theme, "" ) );
420
421 m_params.emplace_back( new PARAM<bool>( "export_svg.mirror",
422 &m_ExportSvg.mirror, false ) );
423
424 m_params.emplace_back( new PARAM<bool>( "export_svg.one_file",
425 &m_ExportSvg.one_file, false ) );
426
427 m_params.emplace_back(new PARAM<bool>( "export_svg.plot_board_edges",
428 &m_ExportSvg.plot_board_edges, true ) );
429
430 m_params.emplace_back( new PARAM<int>( "export_svg.page_size",
431 &m_ExportSvg.page_size, 0 ) );
432
433 m_params.emplace_back( new PARAM<wxString>( "export_svg.output_dir",
434 &m_ExportSvg.output_dir, "" ) );
435
436 m_params.emplace_back( new PARAM_LIST<int>( "export_svg.layers",
437 &m_ExportSvg.layers, {} ) );
438
439 m_params.emplace_back( new PARAM<int>( "export_vrml.units",
440 &m_ExportVrml.units, 1 ) );
441
442 m_params.emplace_back( new PARAM<bool>( "export_vrml.no_unspecified",
443 &m_ExportVrml.no_unspecified, false ) );
444
445 m_params.emplace_back( new PARAM<bool>( "export_vrml.no_dnp",
446 &m_ExportVrml.no_dnp, false ) );
447
448 m_params.emplace_back( new PARAM<bool>( "export_vrml.copy_3d_models",
449 &m_ExportVrml.copy_3d_models, false ) );
450
451 m_params.emplace_back( new PARAM<bool>( "export_vrml.use_relative_paths",
453
454 m_params.emplace_back( new PARAM<int>( "export_vrml.ref_units",
455 &m_ExportVrml.ref_units, 0 ) );
456
457 m_params.emplace_back( new PARAM<double>( "export_vrml.ref_x",
458 &m_ExportVrml.ref_x, 0 ) );
459
460 m_params.emplace_back( new PARAM<double>( "export_vrml.ref_y",
461 &m_ExportVrml.ref_y, 0 ) );
462
463 m_params.emplace_back( new PARAM<int>( "export_vrml.origin_mode",
465
466 m_params.emplace_back( new PARAM<int>( "zones.net_sort_mode",
467 &m_Zones.net_sort_mode, -1 ) );
468
469 m_params.emplace_back( new PARAM<int>( "import_graphics.layer",
471
472 m_params.emplace_back( new PARAM<bool>( "import_graphics.use_dlg_layer_selection",
474
475 m_params.emplace_back( new PARAM<bool>( "import_graphics.interactive_placement",
477
478 m_params.emplace_back( new PARAM<bool>( "import_graphics.group_items",
479 &m_ImportGraphics.group_items, true ) );
480
481 m_params.emplace_back( new PARAM<bool>( "import_graphics.fix_discontinuities",
483
484 m_params.emplace_back( new PARAM<double>( "import_graphics.tolerance",
485 &m_ImportGraphics.tolerance, 1.0, 0.0, 10.0 ) );
486
487 m_params.emplace_back( new PARAM<int>( "import_graphics.line_width_units",
489
490 m_params.emplace_back( new PARAM<double>( "import_graphics.line_width",
492
493 m_params.emplace_back( new PARAM<int>( "import_graphics.origin_units",
495
496 m_params.emplace_back( new PARAM<double>( "import_graphics.origin_x",
498
499 m_params.emplace_back( new PARAM<double>( "import_graphics.origin_y",
501
502 m_params.emplace_back( new PARAM<int>( "import_graphics.dxf_units",
504
505 m_params.emplace_back( new PARAM<int>( "netlist.report_filter",
507
508 m_params.emplace_back( new PARAM<bool>( "netlist.update_footprints",
510
511 m_params.emplace_back( new PARAM<bool>( "netlist.delete_shorting_tracks",
513
514 m_params.emplace_back( new PARAM<bool>( "netlist.delete_extra_footprints",
516
517 m_params.emplace_back( new PARAM<bool>( "netlist.associate_by_ref_sch",
519
520 /*
521 * place_file.output_directory is only used at run-time; actual data is in project file
522 *
523 * m_params.emplace_back( new PARAM<wxString>( "place_file.output_directory",
524 * &m_PlaceFile.output_directory, wxEmptyString ) );
525 */
526
527 m_params.emplace_back( new PARAM<int>( "place_file.units",
528 &m_PlaceFile.units, 1 ) );
529
530 m_params.emplace_back( new PARAM<int>( "place_file.file_options",
532
533 m_params.emplace_back( new PARAM<int>( "place_file.file_format",
534 &m_PlaceFile.file_format, 0 ) );
535
536 m_params.emplace_back( new PARAM<bool>( "place_file.excludeTH",
537 &m_PlaceFile.exclude_TH, false ) );
538
539 m_params.emplace_back( new PARAM<bool>( "place_file.onlySMD",
540 &m_PlaceFile.only_SMD, false ) );
541
542 m_params.emplace_back( new PARAM<bool>( "place_file.include_board_edge",
544
545 m_params.emplace_back( new PARAM<bool>( "place_file.use_place_file_origin",
546 &m_PlaceFile.use_aux_origin, true ) );
547
548 m_params.emplace_back( new PARAM<bool>( "place_file.negate_xcoord",
549 &m_PlaceFile.negate_xcoord, false ) );
550
551 m_params.emplace_back( new PARAM<int>( "plot.all_layers_on_one_page",
553
554 m_params.emplace_back( new PARAM<bool>( "plot.edgecut_on_all_layers",
555 &m_Plot.edgecut_on_all_layers, true ) );
556
557 m_params.emplace_back( new PARAM<int>( "plot.pads_drill_mode",
558 &m_Plot.pads_drill_mode, 2 ) );
559
560 m_params.emplace_back( new PARAM<double>( "plot.fine_scale_x",
561 &m_Plot.fine_scale_x, 0 ) );
562
563 m_params.emplace_back( new PARAM<double>( "plot.fine_scale_y",
564 &m_Plot.fine_scale_y, 0 ) );
565
566 m_params.emplace_back( new PARAM<double>( "plot.ps_fine_width_adjust",
568
569 m_params.emplace_back( new PARAM<bool>( "plot.check_zones_before_plotting",
571
572 m_params.emplace_back( new PARAM<bool>( "plot.mirror",
573 &m_Plot.mirror, false ) );
574
575 m_params.emplace_back( new PARAM<bool>( "plot.as_item_checkboxes",
576 &m_Plot.as_item_checkboxes, false ) );
577
578 m_params.emplace_back( new PARAM<wxString>( "window.footprint_text_shown_columns",
579 &m_FootprintTextShownColumns, "0 1 2 3 4 5 7" ) );
580
581 m_params.emplace_back( new PARAM<int>( "footprint_wizard_list.width",
583
584 m_params.emplace_back( new PARAM<int>( "footprint_wizard_list.height",
586
587 m_params.emplace_back( new PARAM<bool>( "reannotate_dialog.annotate_sort_on_modules",
589 m_params.emplace_back( new PARAM<bool>( "reannotate_dialog.annotate_remove_front_prefix",
591 m_params.emplace_back( new PARAM<bool>( "reannotate_dialog.annotate_remove_back_prefix",
593 m_params.emplace_back( new PARAM<bool>( "reannotate_dialog.annotate_exclude_locked",
594 &m_Reannotate.exclude_locked, false ) );
595
596 m_params.emplace_back( new PARAM<int>( "reannotate_dialog.annotate_grid_index",
597 &m_Reannotate.grid_index, 0 ) );
598 m_params.emplace_back( new PARAM<int>( "reannotate_dialog.annotate_sort_code",
599 &m_Reannotate.sort_code, 0 ) );
600 m_params.emplace_back( new PARAM<int>( "reannotate_dialog.annotate_choice",
602 m_params.emplace_back( new PARAM<int>( "reannotate_dialog.annotate_report_severity",
604
605 m_params.emplace_back( new PARAM<wxString>( "reannotate_dialog.annotate_front_refdes_start",
607 m_params.emplace_back( new PARAM<wxString>( "reannotate_dialog.annotate_back_refdes_start",
609 m_params.emplace_back( new PARAM<wxString>( "reannotate_dialog.annotate_front_prefix",
610 &m_Reannotate.front_prefix, "" ) );
611 m_params.emplace_back( new PARAM<wxString>( "reannotate_dialog.annotate_back_prefix",
612 &m_Reannotate.back_prefix, "" ) );
613 m_params.emplace_back( new PARAM<wxString>( "reannotate_dialog.annotate_exclude_list",
614 &m_Reannotate.exclude_list, "" ) );
615 m_params.emplace_back( new PARAM<wxString>( "reannotate_dialog.annotate_report_file_name",
617
618 m_params.emplace_back( new PARAM_LAMBDA<nlohmann::json>( "action_plugins",
619 [&]() -> nlohmann::json
620 {
621 nlohmann::json js = nlohmann::json::array();
622
623 for( const auto& pair : m_VisibleActionPlugins )
624 js.push_back( nlohmann::json( { { pair.first.ToUTF8(), pair.second } } ) );
625
626 return js;
627 },
628 [&]( const nlohmann::json& aObj )
629 {
631
632 if( !aObj.is_array() )
633 {
634 return;
635 }
636
637 for( const auto& entry : aObj )
638 {
639 if( entry.empty() || !entry.is_object() )
640 continue;
641
642 for( const auto& pair : entry.items() )
643 {
644 m_VisibleActionPlugins.emplace_back( std::make_pair(
645 wxString( pair.key().c_str(), wxConvUTF8 ), pair.value() ) );
646 }
647 }
648 },
649 nlohmann::json::array() ) );
650
651 addParamsForWindow( &m_FootprintViewer, "footprint_viewer" );
652
653 m_params.emplace_back( new PARAM<double>( "footprint_viewer.zoom",
654 &m_FootprintViewerZoom, 1.0 ) );
655
656 m_params.emplace_back( new PARAM<bool>( "footprint_viewer.autozoom",
658
659 m_params.emplace_back( new PARAM<int>( "footprint_viewer.lib_list_width",
661
662 m_params.emplace_back( new PARAM<int>( "footprint_viewer.fp_list_width",
664
665 addParamsForWindow( &m_FootprintWizard, "footprint_wizard" );
666
667 m_params.emplace_back( new PARAM<wxString>( "system.last_footprint_lib_dir",
668 &m_lastFootprintLibDir, "" ) );
669
670 m_params.emplace_back( new PARAM<wxString>( "system.last_footprint3d_dir",
671 &m_lastFootprint3dDir, "" ) );
672
673 registerMigration( 0, 1,
674 [&]()
675 {
676 if( std::optional<int> optval = Get<int>( "pcb_display.rotation_angle" ) )
677 Set( "editing.rotation_angle", *optval );
678
679 try
680 {
681 At( "pcb_display" ).erase( "rotation_angle" );
682 }
683 catch( ... )
684 {}
685
686 return true;
687 } );
688
689 registerMigration( 1, 2,
690 [&]()
691 {
692 // In version 1 this meant "after Zone Properties dialog", but it now means
693 // "everywhere" so we knock it off on transition.
694 Set( "editing.auto_fill_zones", false );
695
696 return true;
697 } );
698
699
700 registerMigration( 2, 3,
701 [&]() -> bool
702 {
703 // We used to have a bug on GTK which would set the lib tree column width way
704 // too narrow.
705 if( std::optional<int> optval = Get<int>( "lib_tree.column_width" ) )
706 {
707 if( optval < 150 )
708 Set( "lib_tree.column_width", 300 );
709 }
710
711 return true;
712 } );
713
714 registerMigration( 3, 4,
715 [&]() -> bool
716 {
717 // This is actually a migration for APP_SETTINGS_BASE::m_LibTree
718 return migrateLibTreeWidth();
719 } );
720
721 registerMigration( 4, 5,
722 [&]() -> bool
723 {
724 // This default proved to be unpopular; bump it off for everyone
725 Set( "editing.auto_fill_zones", false );
726 return true;
727 } );
728}
729
730
732
733
734bool PCBNEW_SETTINGS::MigrateFromLegacy( wxConfigBase* aCfg )
735{
736 bool ret = APP_SETTINGS_BASE::MigrateFromLegacy( aCfg );
737
738 const std::string f = getLegacyFrameName();
739
740 //
741 // NOTE: there's no value in line-wrapping these; it just makes the table unreadable.
742 //
743 ret &= fromLegacy<bool>( aCfg, "ShowLayerManagerTools", "aui.show_layer_manager" );
744
745 ret &= fromLegacy<int>( aCfg, "FootprintChooserHSashPosition", "footprint_chooser.sash_h" );
746 ret &= fromLegacy<int>( aCfg, "FootprintChooserVSashPosition", "footprint_chooser.sash_v" );
747 ret &= fromLegacy<int>( aCfg, "FootprintChooserWidth", "footprint_chooser.width" );
748 ret &= fromLegacy<int>( aCfg, "FootprintChooserHeight", "footprint_chooser.height" );
749
750 ret &= fromLegacy<bool>( aCfg, "FlipLeftRight", "editing.flip_left_right" );
751 ret &= fromLegacy<bool>( aCfg, "MagneticGraphics", "editing.magnetic_graphics" );
752 ret &= fromLegacy<int>( aCfg, "MagneticPads", "editing.magnetic_pads" );
753 ret &= fromLegacy<int>( aCfg, "MagneticTracks", "editing.magnetic_tracks" );
754 ret &= fromLegacy<bool>( aCfg, "DisplayPolarCoords", "editing.polar_coords" );
755 ret &= fromLegacy<bool>( aCfg, "Use45DegreeGraphicSegments", "editing.use_45_degree_graphic_segments" );
756
757 ret &= fromLegacy<bool>( aCfg, "PcbAffT", "pcb_display.graphic_items_fill" );
758 ret &= fromLegacy<int>( aCfg, "MaxLnkS", "pcb_display.max_links_shown" );
759 ret &= fromLegacy<bool>( aCfg, "ModAffC", "pcb_display.footprint_edge_fill" );
760 ret &= fromLegacy<bool>( aCfg, "ModAffT", "pcb_display.footprint_text_fill" );
761 ret &= fromLegacy<int>( aCfg, "ShowNetNamesMode", "pcb_display.net_names_mode" );
762 ret &= fromLegacy<int>( aCfg, "PcbDisplayOrigin", "pcb_display.origin_mode" );
763 ret &= fromLegacy<bool>( aCfg, "PcbInvertXAxis", "pcb_display.origin_invert_x_axis" );
764 ret &= fromLegacy<bool>( aCfg, "PcbInvertYAxis", "pcb_display.origin_invert_y_axis" );
765 ret &= fromLegacy<bool>( aCfg, "PadAffG", "pcb_display.pad_clearance" );
766 ret &= fromLegacy<bool>( aCfg, "PadFill", "pcb_display.pad_fill" );
767 ret &= fromLegacy<bool>( aCfg, "PadSNum", "pcb_display.pad_numbers" );
768 ret &= fromLegacy<bool>( aCfg, "ShowRatsnestLines", "pcb_display.ratsnest_global" );
769 ret &= fromLegacy<bool>( aCfg, "ShowRatsnestModuleLines", "pcb_display.ratsnest_footprint" );
770 ret &= fromLegacy<bool>( aCfg, "CurvedRatsnestLines", "pcb_display.ratsnest_curved" );
771 ret &= fromLegacy<int>( aCfg, "RotationAngle", "pcb_display.rotation_angle" );
772 ret &= fromLegacy<int>( aCfg, "TrackDisplayClearance", "pcb_display.track_clearance_mode" );
773 ret &= fromLegacy<bool>( aCfg, "DisplayTrackFilled", "pcb_display.track_fill" );
774 ret &= fromLegacy<bool>( aCfg, "ViaFill", "pcb_display.via_fill" );
775 ret &= fromLegacy<int>( aCfg, "PcbShowZonesMode", "pcb_display.zone_mode" );
776
777 ret &= fromLegacy<double>( aCfg, "PlotLineWidth_mm", "plot.line_width" );
778
779 aCfg->SetPath( "/dialogs/cleanup_tracks" );
780 ret &= fromLegacy<bool>( aCfg, "DialogCleanupVias", "cleanup.cleanup_vias" );
781 ret &= fromLegacy<bool>( aCfg, "DialogCleanupMergeSegments", "cleanup.merge_segments" );
782 ret &= fromLegacy<bool>( aCfg, "DialogCleanupUnconnected", "cleanup.cleanup_unconnected" );
783 ret &= fromLegacy<bool>( aCfg, "DialogCleanupShortCircuit", "cleanup.cleanup_short_circuits" );
784 ret &= fromLegacy<bool>( aCfg, "DialogCleanupTracksInPads", "cleanup.cleanup_tracks_in_pad" );
785 aCfg->SetPath( "../.." );
786
787 ret &= fromLegacy<bool>( aCfg, "RefillZonesBeforeDrc", "drc_dialog.refill_zones" );
788 ret &= fromLegacy<bool>( aCfg, "DrcTestFootprints", "drc_dialog.test_footprints" );
789
790 ret &= fromLegacy<bool>( aCfg, "DrillMergePTHNPTH", "gen_drill.merge_pth_npth" );
791 ret &= fromLegacy<bool>( aCfg, "DrillMinHeader", "gen_drill.minimal_header" );
792 ret &= fromLegacy<bool>( aCfg, "DrillMirrorYOpt", "gen_drill.mirror" );
793 ret &= fromLegacy<bool>( aCfg, "DrillUnit", "gen_drill.unit_drill_is_inch" );
794 ret &= fromLegacy<bool>( aCfg, "OvalHolesRouteMode", "gen_drill.use_route_for_oval_holes" );
795 ret &= fromLegacy<int>( aCfg, "DrillFileType", "gen_drill.drill_file_type" );
796 ret &= fromLegacy<int>( aCfg, "DrillMapFileType", "gen_drill.map_file_type" );
797 ret &= fromLegacy<int>( aCfg, "DrillZerosFormat", "gen_drill.zeros_format" );
798
799 ret &= fromLegacy<bool>( aCfg, "IDFRefAutoAdj", "export_idf.auto_adjust" );
800 ret &= fromLegacy<int>( aCfg, "IDFRefUnits", "export_idf.ref_units" );
801 ret &= fromLegacy<double>( aCfg, "IDFRefX", "export_idf.ref_x" );
802 ret &= fromLegacy<double>( aCfg, "IDFRefY", "export_idf.ref_y" );
803 ret &= fromLegacy<bool>( aCfg, "IDFExportThou", "export_idf.units_mils" );
804
805 ret &= fromLegacy<int>( aCfg, "STEP_Origin_Opt", "export_step.origin_mode" );
806 ret &= fromLegacy<int>( aCfg, "STEP_UserOriginUnits", "export_step.origin_units" );
807 ret &= fromLegacy<double>( aCfg, "STEP_UserOriginX", "export_step.origin_x" );
808 ret &= fromLegacy<double>( aCfg, "STEP_UserOriginY", "export_step.origin_y" );
809 ret &= fromLegacy<bool>( aCfg, "STEP_NoVirtual", "export_step.no_virtual" );
810
811 ret &= fromLegacy<bool>( aCfg, "PlotSVGModeColor", "export_svg.black_and_white" );
812 ret &= fromLegacy<bool>( aCfg, "PlotSVGModeMirror", "export_svg.mirror" );
813 ret &= fromLegacy<bool>( aCfg, "PlotSVGModeOneFile", "export_svg.one_file" );
814 ret &= fromLegacy<bool>( aCfg, "PlotSVGBrdEdge", "export_svg.plot_board_edges" );
815 ret &= fromLegacy<int>( aCfg, "PlotSVGPageOpt", "export_svg.page_size" );
816 ret &= fromLegacyString( aCfg, "PlotSVGDirectory", "export_svg.output_dir" );
817
818 {
819 nlohmann::json js = nlohmann::json::array();
820 wxString key;
821 bool val = false;
822
823 for( unsigned i = 0; i < PCB_LAYER_ID_COUNT; ++i )
824 {
825 key.Printf( wxT( "PlotSVGLayer_%d" ), i );
826
827 if( aCfg->Read( key, &val ) && val )
828 js.push_back( i );
829 }
830
831 Set( "export_svg.layers", js );
832 }
833
834 {
835 nlohmann::json js = nlohmann::json::array();
836
837 wxString packed;
838
839 if( aCfg->Read( "ActionPluginButtons", &packed ) )
840 {
841 wxStringTokenizer pluginSettingsTokenizer = wxStringTokenizer( packed, ";" );
842
843 while( pluginSettingsTokenizer.HasMoreTokens() )
844 {
845 nlohmann::json row;
846 wxString plugin = pluginSettingsTokenizer.GetNextToken();
847 wxStringTokenizer pluginTokenizer = wxStringTokenizer( plugin, "=" );
848
849 if( pluginTokenizer.CountTokens() != 2 )
850 {
851 // Bad config
852 continue;
853 }
854
855 std::string key( pluginTokenizer.GetNextToken().ToUTF8() );
856 bool value( pluginTokenizer.GetNextToken().Cmp( wxT( "Visible" ) ) == 0 );
857
858 js.push_back( nlohmann::json( { { key, value } } ) );
859 }
860 }
861
862 Set( "action_plugins", js );
863 }
864
865 //
866 // NOTE: there's no value in line-wrapping these; it just makes the table unreadable.
867 //
868 ret &= fromLegacy<int>( aCfg, "VrmlExportUnit", "export_vrml.units" );
869 ret &= fromLegacy<bool>( aCfg, "VrmlExportCopyFiles", "export_vrml.copy_3d_models" );
870 ret &= fromLegacy<bool>( aCfg, "VrmlUseRelativePaths", "export_vrml.use_relative_paths" );
871 ret &= fromLegacy<int>( aCfg, "VrmlRefUnits", "export_vrml.ref_units" );
872 ret &= fromLegacy<double>( aCfg, "VrmlRefX", "export_vrml.ref_x" );
873 ret &= fromLegacy<double>( aCfg, "VrmlRefY", "export_vrml.ref_y" );
874 ret &= fromLegacy<int> ( aCfg, "VrmlOriginMode", "export_vrml.origin_mode" );
875
876 ret &= fromLegacy<int>( aCfg, "Zone_Ouline_Hatch_Opt", "zones.hatching_style" );
877 ret &= fromLegacy<int>( aCfg, "Zone_NetSort_Opt", "zones.net_sort_mode" );
878 ret &= fromLegacy<double>( aCfg, "Zone_Clearance", "zones.clearance" );
879 ret &= fromLegacy<double>( aCfg, "Zone_Thickness", "zones.min_thickness" );
880 ret &= fromLegacy<double>( aCfg, "Zone_TH_Gap", "zones.thermal_relief_gap" );
881 ret &= fromLegacy<double>( aCfg, "Zone_TH_Copper_Width", "zones.thermal_relief_copper_width" );
882
883 aCfg->SetPath( "ImportGraphics" );
884 ret &= fromLegacy<int>( aCfg, "BoardLayer", "import_graphics.layer" );
885 ret &= fromLegacy<bool>( aCfg, "InteractivePlacement", "import_graphics.interactive_placement" );
886 ret &= fromLegacyString( aCfg, "LastFile", "import_graphics.last_file" );
887 ret &= fromLegacy<double>( aCfg, "LineWidth", "import_graphics.line_width" );
888 ret &= fromLegacy<int>( aCfg, "LineWidthUnits", "import_graphics.line_width_units" );
889 ret &= fromLegacy<int>( aCfg, "PositionUnits", "import_graphics.origin_units" );
890 ret &= fromLegacy<double>( aCfg, "PositionX", "import_graphics.origin_x" );
891 ret &= fromLegacy<double>( aCfg, "PositionY", "import_graphics.origin_y" );
892 aCfg->SetPath( ".." );
893
894 ret &= fromLegacy<int>( aCfg, "NetlistReportFilterMsg", "netlist.report_filter" );
895 ret &= fromLegacy<bool>( aCfg, "NetlistUpdateFootprints", "netlist.update_footprints" );
896 ret &= fromLegacy<bool>( aCfg, "NetlistDeleteShortingTracks", "netlist.delete_shorting_tracks" );
897 ret &= fromLegacy<bool>( aCfg, "NetlistDeleteExtraFootprints", "netlist.delete_extra_footprints" );
898
899 ret &= fromLegacy<int>( aCfg, "PlaceFileUnits", "place_file.units" );
900 ret &= fromLegacy<int>( aCfg, "PlaceFileOpts", "place_file.file_options" );
901 ret &= fromLegacy<int>( aCfg, "PlaceFileFormat", "place_file.file_format" );
902 ret &= fromLegacy<bool>( aCfg, "PlaceFileIncludeBrdEdge", "place_file.include_board_edge" );
903
904 ret &= fromLegacy<int>( aCfg, "PrintSinglePage", "plot.all_layers_on_one_page" );
905 ret &= fromLegacy<int>( aCfg, "PrintPadsDrillOpt", "plot.pads_drill_mode" );
906 ret &= fromLegacy<double>( aCfg, "PlotXFineScaleAdj", "plot.fine_scale_x" );
907 ret &= fromLegacy<double>( aCfg, "PlotYFineScaleAdj", "plot.fine_scale_y" );
908 ret &= fromLegacy<double>( aCfg, "PSPlotFineWidthAdj", "plot.ps_fine_width_adjust" );
909 ret &= fromLegacy<bool>( aCfg, "CheckZonesBeforePlotting", "plot.check_zones_before_plotting" );
910
911 ret &= fromLegacyString( aCfg, "FootprintTextShownColumns", "window.footprint_text_shown_columns" );
912
913 ret &= fromLegacy<int>( aCfg, "FpWizardListWidth", "footprint_wizard_list.width" );
914 ret &= fromLegacy<int>( aCfg, "FpWizardListHeight", "footprint_wizard_list.height" );
915
916 migrateWindowConfig( aCfg, "ModViewFrame", "footprint_viewer" );
917
918 ret &= fromLegacy<bool>( aCfg, "ModViewFrameAutoZoom", "footprint_viewer.auto_zoom" );
919 ret &= fromLegacy<double>( aCfg, "ModViewFrameZoom", "footprint_viewer.zoom" );
920
921 migrateWindowConfig( aCfg, "FootprintWizard", "footprint_wizard" );
922 ret &= fromLegacyString( aCfg, "Fpwizard_auiPerspective", "footprint_wizard.perspective" );
923
924
925 const std::string p = "pcbnew.InteractiveRouter.";
926
927 Set( "tools.pns.meta", nlohmann::json( {
928 { "filename", "pns" },
929 { "version", 0 }
930 } ) );
931
932 ret &= fromLegacy<int>( aCfg, p + "Mode", "tools.pns.mode" );
933 ret &= fromLegacy<int>( aCfg, p + "OptimizerEffort", "tools.pns.effort" );
934 ret &= fromLegacy<bool>( aCfg, p + "RemoveLoops", "tools.pns.remove_loops" );
935 ret &= fromLegacy<bool>( aCfg, p + "SmartPads", "tools.pns.smart_pads" );
936 ret &= fromLegacy<bool>( aCfg, p + "ShoveVias", "tools.pns.shove_vias" );
937 ret &= fromLegacy<bool>( aCfg, p + "StartDiagonal", "tools.pns.start_diagonal" );
938 ret &= fromLegacy<int>( aCfg, p + "ShoveTimeLimit", "tools.pns.shove_time_limit" );
939 ret &= fromLegacy<int>( aCfg, p + "ShoveIterationLimit", "tools.pns.shove_iteration_limit" );
940 ret &= fromLegacy<int>( aCfg, p + "WalkaroundIterationLimit", "tools.pns.walkaround_iteration_limit" );
941 ret &= fromLegacy<bool>( aCfg, p + "JumpOverObstacles", "tools.pns.jump_over_obstacles" );
942 ret &= fromLegacy<bool>( aCfg, p + "SmoothDraggedSegments", "tools.pns.smooth_dragged_segments" );
943 ret &= fromLegacy<bool>( aCfg, p + "CanViolateDRC", "tools.pns.can_violate_drc" );
944 ret &= fromLegacy<bool>( aCfg, p + "SuggestFinish", "tools.pns.suggest_finish" );
945 ret &= fromLegacy<bool>( aCfg, p + "FreeAngleMode", "tools.pns.free_angle_mode" );
946 ret &= fromLegacy<bool>( aCfg, p + "InlineDragEnabled", "editing.track_drag_action" );
947
948 // Initialize some new PNS settings to legacy behaviors if coming from legacy
949 Set( "tools.pns.fix_all_segments", false );
950
951 // Migrate color settings that were stored in the pcbnew config file
952
955
956 auto migrateLegacyColor =
957 [&] ( const std::string& aKey, int aLayerId )
958 {
959 wxString str;
960
961 if( aCfg->Read( aKey, &str ) )
962 cs->SetColor( aLayerId, COLOR4D( str ) );
963 };
964
965 for( int i = 0; i < PCB_LAYER_ID_COUNT; ++i )
966 {
967 wxString layer = LSET::Name( PCB_LAYER_ID( i ) );
968 migrateLegacyColor( "Color4DPCBLayer_" + layer.ToStdString(), PCB_LAYER_ID( i ) );
969 }
970
971 migrateLegacyColor( "Color4DAnchorEx", LAYER_ANCHOR );
972 migrateLegacyColor( "Color4DAuxItems", LAYER_AUX_ITEMS );
973 migrateLegacyColor( "Color4DGrid", LAYER_GRID );
974 migrateLegacyColor( "Color4DNonPlatedEx", LAYER_NON_PLATEDHOLES );
975 migrateLegacyColor( "Color4DPCBBackground", LAYER_PCB_BACKGROUND );
976 migrateLegacyColor( "Color4DPCBCursor", LAYER_CURSOR );
977 migrateLegacyColor( "Color4DRatsEx", LAYER_RATSNEST );
978 migrateLegacyColor( "Color4DViaBBlindEx", LAYER_VIA_BBLIND );
979 migrateLegacyColor( "Color4DViaMicroEx", LAYER_VIA_MICROVIA );
980 migrateLegacyColor( "Color4DViaThruEx", LAYER_VIA_THROUGH );
981 migrateLegacyColor( "Color4DWorksheet", LAYER_DRAWINGSHEET );
982 migrateLegacyColor( "Color4DGrid", LAYER_PAGE_LIMITS );
983
984 mgr.SaveColorSettings( cs, "board" );
985
986 Set( "appearance.color_theme", cs->GetFilename() );
987
988 double x = 0, y = 0;
989
990 if( aCfg->Read( f + "PcbUserGrid_X", &x ) && aCfg->Read( f + "PcbUserGrid_Y", &y ) )
991 {
992 EDA_UNITS u = static_cast<EDA_UNITS>( aCfg->ReadLong( f + "PcbUserGrid_Unit",
993 static_cast<long>( EDA_UNITS::INCHES ) ) );
994
995 // Convert to internal units
998
999 Set( "window.grid.user_grid_x", EDA_UNIT_UTILS::UI::StringFromValue( pcbIUScale, u, x ) );
1000 Set( "window.grid.user_grid_y", EDA_UNIT_UTILS::UI::StringFromValue( pcbIUScale, u, y ) );
1001 }
1002
1003 // Footprint editor settings were stored in pcbnew config file. Migrate them here.
1005 fpedit->MigrateFromLegacy( aCfg );
1006 fpedit->Load();
1007
1008 // Same with 3D viewer
1009 EDA_3D_VIEWER_SETTINGS* viewer3d = mgr.GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" );
1010 viewer3d->MigrateFromLegacy( aCfg );
1011 viewer3d->Load();
1012
1013 return ret;
1014}
1015
1016//namespace py = pybind11;
1017//
1018//PYBIND11_MODULE( pcbnew, m )
1019//{
1020// py::class_<PCBNEW_SETTINGS>( m, "settings" )
1021// .def_readwrite( "Use45DegreeGraphicSegments", &PCBNEW_SETTINGS::m_Use45DegreeGraphicSegments )
1022// .def_readwrite( "FlipLeftRight", &PCBNEW_SETTINGS::m_FlipDirection )
1023// .def_readwrite( "AddUnlockedPads", &PCBNEW_SETTINGS::m_AddUnlockedPads)
1024// .def_readwrite( "UsePolarCoords", &PCBNEW_SETTINGS::m_PolarCoords)
1025// .def_readwrite( "RotationAngle", &PCBNEW_SETTINGS::m_RotationAngle)
1026// .def_readwrite( "ShowPageLimits", &PCBNEW_SETTINGS::m_ShowPageLimits)
1027// ;
1028//}
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:108
bool migrateWindowConfig(wxConfigBase *aCfg, const std::string &aFrameName, const std::string &aJsonPath)
Migrate 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)
Add parameters for the given window object.
bool migrateLibTreeWidth()
Migrate 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:115
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.
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...
virtual void Load()
Updates the parameters of this object based on the current JSON document contents.
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...
wxString GetFilename() const
Definition: json_settings.h:80
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:104
static wxString Name(PCB_LAYER_ID aLayerId)
Return the fixed name association with aLayerId.
Definition: lset.cpp:188
Like a normal param, but with custom getter and setter functions.
Definition: parameters.h:295
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
LOCKING_OPTIONS m_LockingOptions
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
FLIP_DIRECTION m_FlipDirection
DIALOG_REANNOTATE m_Reannotate
int m_FootprintViewerFPListWidth
DIALOG_EXPORT_ODBPP m_ExportODBPP
DIALOG_EXPORT_SVG m_ExportSvg
wxString m_FootprintTextShownColumns
int m_FootprintViewerLibListWidth
VIEWERS_DISPLAY_OPTIONS m_ViewersDisplay
virtual SETTINGS_MANAGER & GetSettingsManager() const
Definition: pgm_base.h:125
void SaveColorSettings(COLOR_SETTINGS *aSettings, const std::string &aNamespace="")
Safely save a COLOR_SETTINGS to disk, preserving any changes outside the given namespace.
T * GetAppSettings(const wxString &aFilename)
Return a handle to the a given settings by type.
COLOR_SETTINGS * GetMigratedColorSettings()
Return a color theme for storing colors migrated from legacy (5.x and earlier) settings,...
The common library.
static constexpr EDA_ANGLE ANGLE_90
Definition: eda_angle.h:403
@ TENTHS_OF_A_DEGREE_T
Definition: eda_angle.h:30
static constexpr EDA_ANGLE ANGLE_360
Definition: eda_angle.h:407
EDA_UNITS
Definition: eda_units.h:46
@ LAYER_GRID
Definition: layer_ids.h:216
@ LAYER_PAGE_LIMITS
Color for drawing the page extents (visibility stored in PCBNEW_SETTINGS::m_ShowPageLimits)
Definition: layer_ids.h:286
@ LAYER_NON_PLATEDHOLES
Draw usual through hole vias.
Definition: layer_ids.h:201
@ LAYER_DRAWINGSHEET
Sheet frame and title block.
Definition: layer_ids.h:240
@ LAYER_PCB_BACKGROUND
PCB background color.
Definition: layer_ids.h:243
@ LAYER_CURSOR
PCB cursor.
Definition: layer_ids.h:244
@ LAYER_AUX_ITEMS
Auxiliary items (guides, rule, etc).
Definition: layer_ids.h:245
@ LAYER_RATSNEST
Definition: layer_ids.h:215
@ LAYER_ANCHOR
Anchor of items having an anchor point (texts, footprints).
Definition: layer_ids.h:210
@ LAYER_VIA_MICROVIA
Definition: layer_ids.h:196
@ LAYER_VIA_THROUGH
Draw blind/buried vias.
Definition: layer_ids.h:198
@ LAYER_VIA_BBLIND
Draw micro vias.
Definition: layer_ids.h:197
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:60
@ Dwgs_User
Definition: layer_ids.h:107
@ PCB_LAYER_ID_COUNT
Definition: layer_ids.h:135
FLIP_DIRECTION
Definition: mirror.h:27
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:487
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)
Return the string from aValue according to aUnits (inch, mm ...) for display.
Definition: eda_units.cpp:290
const int pcbnewSchemaVersion
! Update the schema version whenever a migration is required
@ SHOW_WITH_VIA_WHILE_ROUTING
TRACK_DRAG_ACTION
PGM_BASE & Pgm()
The global program "get" accessor.
Definition: pgm_base.cpp:1073
see class PGM_BASE
@ RPT_SEVERITY_WARNING
@ RPT_SEVERITY_ERROR
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.