KiCad PCB EDA Suite
Loading...
Searching...
No Matches
eeschema_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 <functional>
25
26#include <dialogs/dialog_bom_cfg_lexer.h>
27#include <eda_draw_frame.h>
28#include <eeschema_settings.h>
29#include <layer_ids.h>
31#include <string_utils.h>
32#include <pgm_base.h>
35#include <settings/parameters.h>
38#include <wx/config.h>
39#include <widgets/ui_common.h>
40#include <default_values.h> // For some default values
41
42using namespace T_BOMCFG_T; // for the BOM_CFG_PARSER parser and its keywords
43
46
47
49const nlohmann::json defaultBomPlugins =
50 {
51 {
52 { "name", "bom_csv_grouped_extra" },
53 { "path", "bom_csv_grouped_extra.py" }
54 },
55 {
56 { "name", "bom_csv_grouped_by_value" },
57 { "path", "bom_csv_grouped_by_value.py" }
58 },
59 {
60 { "name", "bom_csv_grouped_by_value_with_fp" },
61 { "path", "bom_csv_grouped_by_value_with_fp.py" }
62 },
63 };
64
65
66const wxAuiPaneInfo& defaultNetNavigatorPaneInfo()
67{
68 static wxAuiPaneInfo paneInfo;
69
70 paneInfo.Name( wxS( "NetNavigator" ) )
71 .Caption( _( "Net Navigator" ) )
72 .CaptionVisible( true )
73 .PaneBorder( true )
74 .Left().Layer( 3 ).Position( 0 )
75 .TopDockable( false )
76 .BottomDockable( false )
77 .CloseButton( true )
78 .MinSize( 120, 60 )
79 .BestSize( 200, 200 )
80 .FloatingSize( 200, 200 )
81 .FloatingPosition( 50, 200 )
82 .Show( false );
83
84 return paneInfo;
85}
86
87
88const wxAuiPaneInfo& defaultPropertiesPaneInfo( wxWindow* aWindow )
89{
90 static wxAuiPaneInfo paneInfo;
91
92 paneInfo.Name( EDA_DRAW_FRAME::PropertiesPaneName() )
93 .Caption( _( "Properties" ) )
94 .CaptionVisible( true )
95 .PaneBorder( true )
96 .Left().Layer( 3 ).Position( 2 )
97 .TopDockable( false )
98 .BottomDockable( false )
99 .CloseButton( true )
100 .MinSize( aWindow->FromDIP( wxSize( 240, 60 ) ) )
101 .BestSize( aWindow->FromDIP( wxSize( 300, 200 ) ) )
102 .FloatingSize( aWindow->FromDIP( wxSize( 300, 400 ) ) )
103 .FloatingPosition( aWindow->FromDIP( wxPoint( 50, 200 ) ) )
104 .Show( true );
105
106 return paneInfo;
107}
108
109
110const wxAuiPaneInfo& defaultSchSelectionFilterPaneInfo( wxWindow* aWindow )
111{
112 static wxAuiPaneInfo paneInfo;
113
114 paneInfo.Name( wxS( "SelectionFilter" ) )
115 .Caption( _( "Selection Filter" ) )
116 .CaptionVisible( true )
117 .PaneBorder( false )
118 .Left().Layer( 3 ).Position( 4 )
119 .TopDockable( false )
120 .BottomDockable( false )
121 .CloseButton( true )
122 .MinSize( aWindow->FromDIP( wxSize( 180, -1 ) ) )
123 .BestSize( aWindow->FromDIP( wxSize( 180, -1 ) ) )
124 .Show( true );
125
126 return paneInfo;
127}
128
129
130const wxAuiPaneInfo& defaultDesignBlocksPaneInfo( wxWindow* aWindow )
131{
132 static wxAuiPaneInfo paneInfo;
133
134 paneInfo.Name( EDA_DRAW_FRAME::DesignBlocksPaneName() )
135 .Caption( _( "Design Blocks" ) )
136 .CaptionVisible( true )
137 .PaneBorder( true )
138 .Right().Layer( 3 ).Position( 2 )
139 .TopDockable( false )
140 .BottomDockable( false )
141 .CloseButton( true )
142 .MinSize( aWindow->FromDIP( wxSize( 240, 60 ) ) )
143 .BestSize( aWindow->FromDIP( wxSize( 300, 200 ) ) )
144 .FloatingSize( aWindow->FromDIP( wxSize( 800, 600 ) ) )
145 .FloatingPosition( aWindow->FromDIP( wxPoint( 50, 200 ) ) )
146 .Show( true );
147
148 return paneInfo;
149}
150
151
154 m_Appearance(),
155 m_AutoplaceFields(),
156 m_Drawing(),
157 m_FindReplaceExtra(),
158 m_Input(),
159 m_PageSettings(),
160 m_AnnotatePanel(),
161 m_BomPanel(),
162 m_FieldEditorPanel(),
163 m_LibViewPanel(),
164 m_NetlistPanel(),
165 m_SymChooserPanel(),
166 m_ImportGraphics(),
167 m_Selection(),
168 m_Simulator(),
169 m_RescueNeverShow( false )
170{
171 m_params.emplace_back( new PARAM<wxString>( "appearance.edit_symbol_visible_columns",
172 &m_Appearance.edit_symbol_visible_columns, "0 1 2 3 4 5 6 7" ) );
173
174 m_params.emplace_back( new PARAM<int>( "appearance.edit_symbol_width",
176
177 m_params.emplace_back( new PARAM<int>( "appearance.edit_symbol_height",
179
180 m_params.emplace_back( new PARAM<wxString>( "appearance.edit_sheet_visible_columns",
181 &m_Appearance.edit_sheet_visible_columns, "0 1 2 3 4 5 6 7" ) );
182
183 m_params.emplace_back( new PARAM<wxString>( "appearance.edit_label_visible_columns",
184 &m_Appearance.edit_label_visible_columns, "0 1 2 3 4 5 6 7" ) );
185
186 m_params.emplace_back( new PARAM<int>( "appearance.edit_label_width",
188
189 m_params.emplace_back( new PARAM<int>( "appearance.edit_label_height",
191
192 m_params.emplace_back( new PARAM<int>( "appearance.erc_severities",
194
195 m_params.emplace_back( new PARAM<bool>( "appearance.footprint_preview",
197
198 m_params.emplace_back( new PARAM<bool>( "appearance.print_sheet_reference",
200
201 m_params.emplace_back( new PARAM<wxString>( "appearance.default_font",
202 &m_Appearance.default_font, "KiCad Font" ) );
203
204 m_params.emplace_back( new PARAM<bool>( "appearance.show_hidden_pins",
205 &m_Appearance.show_hidden_pins, false ) );
206
207 m_params.emplace_back( new PARAM<bool>( "appearance.show_hidden_fields",
209
210 m_params.emplace_back( new PARAM<bool>( "appearance.show_directive_labels",
212
213 m_params.emplace_back( new PARAM<bool>( "appearance.show_erc_warnings",
215
216 m_params.emplace_back( new PARAM<bool>( "appearance.show_erc_errors",
217 &m_Appearance.show_erc_errors, true ) );
218
219 m_params.emplace_back( new PARAM<bool>( "appearance.show_erc_exclusions",
221
222 m_params.emplace_back( new PARAM<bool>( "appearance.mark_sim_exclusions",
224
225 m_params.emplace_back( new PARAM<bool>( "appearance.show_op_voltages",
227
228 m_params.emplace_back( new PARAM<bool>( "appearance.show_op_currents",
230
231 m_params.emplace_back( new PARAM<bool>( "appearance.show_pin_alt_icons",
233
234 m_params.emplace_back( new PARAM<bool>( "appearance.show_illegal_symbol_lib_dialog",
236
237 m_params.emplace_back( new PARAM<bool>( "appearance.show_page_limits",
239
240 m_params.emplace_back( new PARAM<bool>( "appearance.show_sexpr_file_convert_warning",
242
243 m_params.emplace_back( new PARAM<bool>( "appearance.show_sheet_filename_case_sensitivity_dialog",
245
246 m_params.emplace_back( new PARAM<bool>( "aui.show_schematic_hierarchy",
248
249 m_params.emplace_back( new PARAM<int>( "aui.hierarchy_panel_docked_width",
251
252 m_params.emplace_back( new PARAM<int>( "aui.hierarchy_panel_docked_height",
254
255 m_params.emplace_back( new PARAM<int>( "aui.hierarchy_panel_float_width",
257
258 m_params.emplace_back( new PARAM<int>( "aui.hierarchy_panel_float_height",
260
261 m_params.emplace_back( new PARAM<bool>( "aui.design_blocks_show",
263
264 m_params.emplace_back( new PARAM<int>( "aui.design_blocks_panel_docked_width",
266
267 m_params.emplace_back( new PARAM<int>( "aui.design_blocks_panel_float_width",
269
270 m_params.emplace_back( new PARAM<int>( "aui.design_blocks_panel_float_height",
272
273 m_params.emplace_back( new PARAM<bool>( "aui.schematic_hierarchy_float",
275
276 m_params.emplace_back( new PARAM<int>( "aui.search_panel_height",
278
279 m_params.emplace_back( new PARAM<int>( "aui.search_panel_width",
281
282 m_params.emplace_back( new PARAM<int>( "aui.search_panel_dock_direction",
284
285 m_params.emplace_back( new PARAM<bool>( "aui.show_search",
286 &m_AuiPanels.show_search, false ) );
287
288 m_params.emplace_back( new PARAM<bool>( "aui.show_net_nav_panel",
290
291 m_params.emplace_back( new PARAM<bool>( "aui.float_net_nav_panel",
293
294 m_params.emplace_back( new PARAM<wxSize>( "aui.net_nav_panel_docked_size",
295 &m_AuiPanels.net_nav_panel_docked_size, wxSize( 120, -1 ) ) );
296
297 m_params.emplace_back( new PARAM<wxPoint>( "aui.net_nav_panel_float_pos",
298 &m_AuiPanels.net_nav_panel_float_pos, wxPoint( 50, 200 ), false ) );
299
300 m_params.emplace_back( new PARAM<wxSize>( "aui.net_nav_panel_float_size",
301 &m_AuiPanels.net_nav_panel_float_size, wxSize( 200, 200 ) ) );
302
303 m_params.emplace_back( new PARAM<bool>( "aui.show_properties",
304 &m_AuiPanels.show_properties, true ) );
305
306 m_params.emplace_back( new PARAM<int>( "aui.properties_panel_width",
308
309 m_params.emplace_back( new PARAM<float>( "aui.properties_splitter_proportion",
311
312 m_params.emplace_back( new PARAM<bool>( "autoplace_fields.enable",
313 &m_AutoplaceFields.enable, true ) );
314
315 m_params.emplace_back( new PARAM<bool>( "autoplace_fields.allow_rejustify",
317
318 m_params.emplace_back( new PARAM<bool>( "autoplace_fields.align_to_grid",
320
321 m_params.emplace_back( new PARAM<int>( "drawing.default_bus_thickness",
323
324 m_params.emplace_back( new PARAM<int>( "drawing.default_junction_size",
326
327 m_params.emplace_back( new PARAM<int>( "drawing.pin_symbol_size",
329
330 m_params.emplace_back( new PARAM<double>( "drawing.text_offset_ratio",
331 &m_Drawing.text_offset_ratio, 0.08 ) );
332
333 m_params.emplace_back( new PARAM<int>( "drawing.default_line_thickness",
335
336 m_params.emplace_back( new PARAM<int>( "drawing.default_repeat_offset_x",
338
339 m_params.emplace_back( new PARAM<int>( "drawing.default_repeat_offset_y",
341
342 m_params.emplace_back( new PARAM<int>( "drawing.default_wire_thickness",
344
345 m_params.emplace_back( new PARAM<int>( "drawing.default_text_size",
347
348 m_params.emplace_back( new PARAM<wxString>( "drawing.field_names",
349 &m_Drawing.field_names, "" ) );
350
351 m_params.emplace_back( new PARAM<int>( "drawing.line_mode",
352 &m_Drawing.line_mode, LINE_MODE::LINE_MODE_90 ) );
353
354 m_params.emplace_back( new PARAM<int>( "editing.arc_edit_mode",
355 reinterpret_cast<int*>( &m_Drawing.arc_edit_mode ),
356 static_cast<int>( ARC_EDIT_MODE::KEEP_CENTER_ADJUST_ANGLE_RADIUS ) ) );
357
358 m_params.emplace_back( new PARAM<bool>( "drawing.auto_start_wires",
359 &m_Drawing.auto_start_wires, true ) );
360
361 m_params.emplace_back( new PARAM<int>( "drawing.repeat_label_increment",
363
364 m_params.emplace_back( new PARAM<COLOR4D>( "drawing.default_sheet_border_color",
365 &m_Drawing.default_sheet_border_color, COLOR4D::UNSPECIFIED ) );
366
367 m_params.emplace_back( new PARAM<COLOR4D>( "drawing.default_sheet_background_color",
368 &m_Drawing.default_sheet_background_color, COLOR4D::UNSPECIFIED ) );
369
370 m_params.emplace_back( new PARAM_ENUM<POWER_SYMBOLS>( "drawing.new_power_symbols",
371 &m_Drawing.new_power_symbols, POWER_SYMBOLS::DEFAULT, POWER_SYMBOLS::DEFAULT, POWER_SYMBOLS::LOCAL ) );
372
373 m_params.emplace_back( new PARAM_LIST<double>( "drawing.junction_size_mult_list",
374 &m_Drawing.junction_size_mult_list, { 0.0, 1.7, 4.0, 6.0, 9.0, 12.0 } ) );
375
376 m_params.emplace_back( new PARAM<int>( "drawing.junction_size_choice",
378
379 m_params.emplace_back( new PARAM<int>( "drawing.hop_over_size_choice",
381
382 m_params.emplace_back( new PARAM<bool>( "find_replace.search_all_fields",
384
385 m_params.emplace_back( new PARAM<bool>( "find_replace.search_all_pins",
387
388 m_params.emplace_back( new PARAM<bool>( "find_replace.search_current_sheet_only",
390
391 m_params.emplace_back( new PARAM<bool>( "find_replace.replace_references",
393
394 m_params.emplace_back( new PARAM<bool>( "input.drag_is_move",
395 &m_Input.drag_is_move, false ) );
396
397 m_params.emplace_back( new PARAM<bool>( "input.esc_clears_net_highlight",
399
400 m_params.emplace_back( new PARAM<int>( "selection.thickness",
402
403 m_params.emplace_back( new PARAM<int>( "selection.highlight_thickness",
405
406 m_params.emplace_back( new PARAM<bool>( "selection.draw_selected_children",
408
409 m_params.emplace_back( new PARAM<bool>( "selection.fill_shapes",
410 &m_Selection.fill_shapes, false ) );
411
412 m_params.emplace_back( new PARAM<bool>( "selection.highlight_netclass_colors",
414
415 m_params.emplace_back( new PARAM<int>( "selection.highlight_netclass_colors_thickness",
417
418 m_params.emplace_back( new PARAM<double>( "selection.highlight_netclass_colors_alpha",
420
421 m_params.emplace_back( new PARAM<bool>( "annotation.automatic",
422 &m_AnnotatePanel.automatic, true ) );
423
424 m_params.emplace_back( new PARAM<bool>( "annotation.recursive",
425 &m_AnnotatePanel.recursive, true ) );
426
427 m_params.emplace_back( new PARAM<int>( "annotation.method",
428 &m_AnnotatePanel.method, 0, 0, 2 ) );
429
430 m_params.emplace_back( new PARAM<int>( "annotation.scope",
431 &m_AnnotatePanel.scope, 0, 0, 2 ) );
432
433 m_params.emplace_back( new PARAM<int>( "annotation.options",
434 &m_AnnotatePanel.options, 0, 0, 2 ) );
435
436 m_params.emplace_back( new PARAM<int>( "annotation.messages_filter",
438
439 m_params.emplace_back( new PARAM<int>( "annotation.sort_order",
440 &m_AnnotatePanel.sort_order, 0, 0, 1 ) );
441
442 m_params.emplace_back( new PARAM<wxString>( "bom.selected_plugin",
444
445 m_params.emplace_back( new PARAM_LAMBDA<nlohmann::json>( "bom.plugins",
446 std::bind( &EESCHEMA_SETTINGS::bomSettingsToJson, this ),
447 [&]( const nlohmann::json& aObj )
448 {
449 if( !aObj.is_array() )
450 return;
451
452 const nlohmann::json& list = aObj.empty() ? defaultBomPlugins : aObj;
453
455 },
457
458 m_params.emplace_back( new PARAM_LAMBDA<nlohmann::json>( "netlist.plugins",
460 [&]( const nlohmann::json& aObj )
461 {
462 if( !aObj.is_array() )
463 return;
464
465 if( aObj.empty() )
466 return;
467
468 const nlohmann::json& list = aObj;
469
471 },
472 nullptr ) );
473
474 m_params.emplace_back( new PARAM<bool>( "page_settings.export_paper",
475 &m_PageSettings.export_paper, false ) );
476
477 m_params.emplace_back( new PARAM<bool>( "page_settings.export_revision",
479
480 m_params.emplace_back( new PARAM<bool>( "page_settings.export_date",
481 &m_PageSettings.export_date, false ) );
482
483 m_params.emplace_back( new PARAM<bool>( "page_settings.export_title",
484 &m_PageSettings.export_title, false ) );
485
486 m_params.emplace_back( new PARAM<bool>( "page_settings.export_company",
487 &m_PageSettings.export_company, false ) );
488
489 m_params.emplace_back( new PARAM<bool>( "page_settings.export_comment1",
491
492 m_params.emplace_back( new PARAM<bool>( "page_settings.export_comment2",
494
495 m_params.emplace_back( new PARAM<bool>( "page_settings.export_comment3",
497
498 m_params.emplace_back( new PARAM<bool>( "page_settings.export_comment4",
500
501 m_params.emplace_back( new PARAM<bool>( "page_settings.export_comment5",
503
504 m_params.emplace_back( new PARAM<bool>( "page_settings.export_comment6",
506
507 m_params.emplace_back( new PARAM<bool>( "page_settings.export_comment7",
509
510 m_params.emplace_back( new PARAM<bool>( "page_settings.export_comment8",
512
513 m_params.emplace_back( new PARAM<bool>( "page_settings.export_comment9",
515
516 m_params.emplace_back( new PARAM_MAP<int>( "field_editor.field_widths",
518
519 m_params.emplace_back( new PARAM<int>( "field_editor.width",
521
522 m_params.emplace_back( new PARAM<int>( "field_editor.height",
524
525 m_params.emplace_back( new PARAM<int>( "field_editor.page",
526 &m_FieldEditorPanel.page, 0 ) );
527
528 m_params.emplace_back( new PARAM<wxString>( "field_editor.export_filename",
529 &m_FieldEditorPanel.export_filename, wxT( "" ) ) );
530
531 m_params.emplace_back( new PARAM<int>( "field_editor.selection_mode",
533
534 m_params.emplace_back( new PARAM<int>( "field_editor.scope",
536
537 addParamsForWindow( &m_Simulator.window, "simulator.window", 500, 400 );
538
539 m_params.emplace_back( new PARAM<int>( "simulator.plot_panel_width",
541
542 m_params.emplace_back( new PARAM<int>( "simulator.plot_panel_height",
544
545 m_params.emplace_back( new PARAM<int>( "simulator.signal_panel_height",
547
548 m_params.emplace_back( new PARAM<int>( "simulator.cursors_panel_height",
550
551 m_params.emplace_back( new PARAM<int>( "simulator.measurements_panel_height",
553
554 m_params.emplace_back( new PARAM<bool>( "simulator.white_background",
556
557 m_params.emplace_back( new PARAM_ENUM<SIM_MOUSE_WHEEL_ACTION>( "simulator.mouse_wheel_actions.vertical_unmodified",
559 SIM_MOUSE_WHEEL_ACTION::ZOOM, SIM_MOUSE_WHEEL_ACTION::NONE,
560 SIM_MOUSE_WHEEL_ACTION::ZOOM_VERTICALLY ) );
561
562 m_params.emplace_back( new PARAM_ENUM<SIM_MOUSE_WHEEL_ACTION>( "simulator.mouse_wheel_actions.vertical_with_ctrl",
564 SIM_MOUSE_WHEEL_ACTION::PAN_LEFT_RIGHT, SIM_MOUSE_WHEEL_ACTION::NONE,
565 SIM_MOUSE_WHEEL_ACTION::ZOOM_VERTICALLY ) );
566
567 m_params.emplace_back( new PARAM_ENUM<SIM_MOUSE_WHEEL_ACTION>( "simulator.mouse_wheel_actions.vertical_with_shift",
569 SIM_MOUSE_WHEEL_ACTION::PAN_UP_DOWN, SIM_MOUSE_WHEEL_ACTION::NONE,
570 SIM_MOUSE_WHEEL_ACTION::ZOOM_VERTICALLY ) );
571
572 m_params.emplace_back( new PARAM_ENUM<SIM_MOUSE_WHEEL_ACTION>( "simulator.mouse_wheel_actions.vertical_with_alt",
574 SIM_MOUSE_WHEEL_ACTION::NONE, SIM_MOUSE_WHEEL_ACTION::NONE,
575 SIM_MOUSE_WHEEL_ACTION::ZOOM_VERTICALLY ) );
576
577 m_params.emplace_back( new PARAM_ENUM<SIM_MOUSE_WHEEL_ACTION>( "simulator.mouse_wheel_actions.horizontal",
578 &m_Simulator.preferences.mouse_wheel_actions.horizontal, SIM_MOUSE_WHEEL_ACTION::NONE,
579 SIM_MOUSE_WHEEL_ACTION::NONE, SIM_MOUSE_WHEEL_ACTION::ZOOM_VERTICALLY ) );
580
581 m_params.emplace_back( new PARAM<int>( "symbol_chooser.sash_pos_h",
583
584 m_params.emplace_back( new PARAM<int>( "symbol_chooser.sash_pos_v",
586
587 m_params.emplace_back( new PARAM<int>( "symbol_chooser.width",
588 &m_SymChooserPanel.width, -1 ) );
589
590 m_params.emplace_back( new PARAM<int>( "symbol_chooser.height",
591 &m_SymChooserPanel.height, -1 ) );
592
593 m_params.emplace_back( new PARAM<int>( "symbol_chooser.sort_mode",
595
596 m_params.emplace_back( new PARAM<bool>( "import_graphics.interactive_placement",
598
599 m_params.emplace_back( new PARAM<int>( "import_graphics.line_width_units",
601
602 m_params.emplace_back( new PARAM<double>( "import_graphics.line_width",
604
605 m_params.emplace_back( new PARAM<int>( "import_graphics.origin_units",
607
608 m_params.emplace_back( new PARAM<double>( "import_graphics.origin_x",
610
611 m_params.emplace_back( new PARAM<double>( "import_graphics.origin_y",
613
614 m_params.emplace_back( new PARAM<int>( "import_graphics.dxf_units",
616
617 m_params.emplace_back( new PARAM<bool>( "system.never_show_rescue_dialog",
618 &m_RescueNeverShow, false ) );
619
620 addParamsForWindow( &m_LibViewPanel.window, "lib_view.window", 500, 400 );
621
622 m_params.emplace_back( new PARAM<int>( "lib_view.lib_list_width",
624
625 m_params.emplace_back( new PARAM<int>( "lib_view.cmp_list_width",
627
628 m_params.emplace_back( new PARAM<bool>( "lib_view.show_pin_electrical_type",
630
631 m_params.emplace_back( new PARAM<wxString>( "system.last_symbol_lib_dir",
632 &m_lastSymbolLibDir, "" ) );
633
634 // Migrations
635 registerMigration( 0, 1,
636 [&]() -> bool
637 {
638 // Version 0 to 1: BOM plugin settings moved from sexpr to JSON
639 return migrateBomSettings();
640 } );
641
642
643 registerMigration( 1, 2,
644 [&]() -> bool
645 {
646 // We used to have a bug on GTK which would set the lib tree column width way
647 // too narrow.
648 if( std::optional<int> optval = Get<int>( "lib_tree.column_width" ) )
649 {
650 if( optval < 150 )
651 Set( "lib_tree.column_width", 300 );
652 }
653
654 return true;
655 } );
656
657 registerMigration( 2, 3,
658 [&]() -> bool
659 {
660 // This is actually a migration for APP_SETTINGS_BASE::m_LibTree
661 return migrateLibTreeWidth();
662 } );
663}
664
665
666bool EESCHEMA_SETTINGS::MigrateFromLegacy( wxConfigBase* aCfg )
667{
668 bool ret = APP_SETTINGS_BASE::MigrateFromLegacy( aCfg );
669
670 // Now modify the loaded grid selection, because in earlier versions the grids index was shared
671 // between all applications and started at 1000 mils. There is a 4-position offset between
672 // this index and the possible eeschema grids list that we have to subtract.
673 std::string gridSizePtr = "window.grid.last_size";
674
675 if( std::optional<int> currentSize = Get<int>( gridSizePtr ) )
676 {
677 Set( gridSizePtr, *currentSize - 4 );
678 }
679 else
680 {
681 // Otherwise, default grid size should be 50 mils; index 1
682 Set( gridSizePtr, 1 );
683 }
684
685 ret &= fromLegacy<bool>( aCfg, "FootprintPreview", "appearance.footprint_preview" );
686 ret &= fromLegacy<bool>( aCfg, "NavigatorStaysOpen", "appearance.navigator_stays_open" );
687 ret &= fromLegacy<bool>( aCfg, "PrintSheetReferenceAndTitleBlock",
688 "appearance.print_sheet_reference" );
689 ret &= fromLegacy<bool>( aCfg, "ShowHiddenPins", "appearance.show_hidden_pins" );
690 ret &= fromLegacy<bool>( aCfg, "ShowIllegalSymbolLibDialog",
691 "appearance.show_illegal_symbol_lib_dialog" );
692 ret &= fromLegacy<bool>( aCfg, "ShowPageLimits", "appearance.show_page_limits" );
693 ret &= fromLegacy<bool>( aCfg, "ShowSheetFileNameCaseSensitivityDlg",
694 "appearance.show_sheet_filename_case_sensitivity_dialog" );
695
696 ret &= fromLegacy<bool>( aCfg, "AutoplaceFields", "autoplace_fields.enable" );
697 ret &= fromLegacy<bool>( aCfg, "AutoplaceJustify", "autoplace_fields.allow_rejustify" );
698 ret &= fromLegacy<bool>( aCfg, "AutoplaceAlign", "autoplace_fields.align_to_grid" );
699
700 ret &= fromLegacy<int>( aCfg, "DefaultBusWidth", "drawing.default_bus_thickness" );
701 ret &= fromLegacy<int>( aCfg, "DefaultJunctionSize", "drawing.default_junction_size" );
702 ret &= fromLegacy<int>( aCfg, "DefaultDrawLineWidth", "drawing.default_line_thickness" );
703 ret &= fromLegacy<int>( aCfg, "RepeatStepX", "drawing.default_repeat_offset_x" );
704 ret &= fromLegacy<int>( aCfg, "RepeatStepY", "drawing.default_repeat_offset_y" );
705 ret &= fromLegacy<int>( aCfg, "DefaultWireWidth", "drawing.default_wire_thickness" );
706 ret &= fromLegacyString( aCfg, "FieldNames", "drawing.field_names" );
707 ret &= fromLegacy<bool>( aCfg, "HorizVertLinesOnly", "drawing.line_mode" );
708 ret &= fromLegacy<int>( aCfg, "RepeatLabelIncrement", "drawing.repeat_label_increment" );
709
710 ret &= fromLegacy<bool>( aCfg, "DragActionIsMove", "input.drag_is_move" );
711
712 ret &= fromLegacy<int>( aCfg, "SelectionThickness", "selection.thickness" );
713 ret &= fromLegacy<bool>( aCfg, "SelectionDrawChildItems", "selection.draw_selected_children" );
714 ret &= fromLegacy<bool>( aCfg, "SelectionFillShapes", "selection.fill_shapes" );
715 ret &= fromLegacy<bool>( aCfg, "SelectPinSelectSymbolOpt",
716 "selection.select_pin_selects_symbol" );
717
718 ret &= fromLegacy<int>( aCfg, "AnnotateAlgoOption", "annotation.method" );
719 ret &= fromLegacy<int>( aCfg, "AnnotateFilterMsg", "annotation.messages_filter" );
720 ret &= fromLegacy<int>( aCfg, "AnnotateSortOption", "annotation.sort_order" );
721
722 ret &= fromLegacyString( aCfg, "bom_plugin_selected", "bom.selected_plugin" );
723 ret &= fromLegacyString( aCfg, "bom_plugins", "bom.plugins" );
724
726
727 ret &= fromLegacyString( aCfg, "SymbolFieldsShownColumns",
728 "edit_sch_component.visible_columns" );
729
730 ret &= fromLegacy<bool>( aCfg, "PageSettingsExportRevision", "page_settings.export_revision" );
731 ret &= fromLegacy<bool>( aCfg, "PageSettingsExportDate", "page_settings.export_date" );
732 ret &= fromLegacy<bool>( aCfg, "PageSettingsExportTitle", "page_settings.export_title" );
733 ret &= fromLegacy<bool>( aCfg, "PageSettingsExportCompany", "page_settings.export_company" );
734 ret &= fromLegacy<bool>( aCfg, "PageSettingsExportComment1", "page_settings.export_comment1" );
735 ret &= fromLegacy<bool>( aCfg, "PageSettingsExportComment2", "page_settings.export_comment2" );
736 ret &= fromLegacy<bool>( aCfg, "PageSettingsExportComment3", "page_settings.export_comment3" );
737 ret &= fromLegacy<bool>( aCfg, "PageSettingsExportComment4", "page_settings.export_comment4" );
738 ret &= fromLegacy<bool>( aCfg, "PageSettingsExportComment5", "page_settings.export_comment5" );
739 ret &= fromLegacy<bool>( aCfg, "PageSettingsExportComment6", "page_settings.export_comment6" );
740 ret &= fromLegacy<bool>( aCfg, "PageSettingsExportComment7", "page_settings.export_comment7" );
741 ret &= fromLegacy<bool>( aCfg, "PageSettingsExportComment8", "page_settings.export_comment8" );
742 ret &= fromLegacy<bool>( aCfg, "PageSettingsExportComment9", "page_settings.export_comment9" );
743
744 #if 0 // To do: move this code to the new netlist plugin management in settings
745 {
746 constexpr int max_custom_commands = 8; // from DIALOG_NETLIST
747 nlohmann::json js_cmd = nlohmann::json::array();
748 nlohmann::json js_title = nlohmann::json::array();
749 wxString cmd_key, title_key, cmd, title;
750
751 for( int i = 1; i <= max_custom_commands; ++i )
752 {
753 // Only migrate if both title and command are specified
754 cmd_key.Printf( "CustomNetlistCommand%d", i );
755 title_key.Printf( "CustomNetlistTitle%d", i );
756
757 if( aCfg->Read( cmd_key, &cmd ) && aCfg->Read( title_key, &title )
758 && !cmd.IsEmpty() && !title.IsEmpty() )
759 {
760 js_cmd.push_back( cmd.ToUTF8() );
761 js_title.push_back( title.ToUTF8() );
762 }
763 }
764
765 Set( "netlist.custom_command_titles", js_title );
766 Set( "netlist.custom_command_paths", js_cmd );
767 }
768 #endif
769
770 {
771 // NOTE(JE) These parameters should move to project-local storage before V6, but we are
772 // migrating them here in order to preserve data. There is a bug here that is preserved:
773 // keys are taken directly from the (translated) UI and stored in the config, so if the user
774 // changes languages the keys will no longer work.
775 aCfg->SetPath( "SymbolFieldEditor/Show/" );
776
777 nlohmann::json js = nlohmann::json( {} );
778 wxString key;
779 bool value = false;
780 long index = 0;
781
782 while( aCfg->GetNextEntry( key, index ) )
783 {
784 if( aCfg->Read( key, &value ) )
785 {
786 std::string key_utf( key.ToUTF8() );
787
788 try
789 {
790 js[ std::move( key_utf ) ] = value;
791 }
792 catch(...)
793 {
794 continue;
795 }
796 }
797 }
798
799 Set( "field_editor.fields_show", js );
800
801 aCfg->SetPath( "../GroupBy" );
802
803 while( aCfg->GetNextEntry( key, index ) )
804 {
805 if( aCfg->Read( key, &value ) )
806 {
807 std::string key_utf( key.ToUTF8() );
808
809 try
810 {
811 js[ std::move( key_utf ) ] = value;
812 }
813 catch(...)
814 {
815 continue;
816 }
817 }
818 }
819
820 Set( "field_editor.fields_group_by", js );
821
822 aCfg->SetPath( "../.." );
823 }
824
825 ret &= fromLegacy<bool>( aCfg, "PlotModeColor", "plot.color" );
826 ret &= fromLegacy<int>( aCfg, "PlotFormat", "plot.format" );
827 ret &= fromLegacy<bool>( aCfg, "PlotFrameRef", "plot.frame_reference" );
828
829 ret &= fromLegacy<int>( aCfg, "SIM_PLOT_FRAMEPos_x", "simulator.window.pos_x" );
830 ret &= fromLegacy<int>( aCfg, "SIM_PLOT_FRAMEPos_y", "simulator.window.pos_y" );
831 ret &= fromLegacy<int>( aCfg, "SIM_PLOT_FRAMESize_x", "simulator.window.size_x" );
832 ret &= fromLegacy<int>( aCfg, "SIM_PLOT_FRAMESize_y", "simulator.window.size_y" );
833 ret &= fromLegacy<bool>( aCfg, "SIM_PLOT_FRAMEMaximized", "simulator.window.maximized" );
834 ret &= fromLegacyString( aCfg, "SIM_PLOT_FRAMEPerspective", "simulator.window.perspective" );
835 ret &= fromLegacyString( aCfg, "SIM_PLOT_FRAMEMostRecentlyUsedPath", "simulator.mru_path" );
836 ret &= fromLegacy<int>( aCfg, "SimPlotPanelWidth", "simulator.plot_panel_width" );
837 ret &= fromLegacy<int>( aCfg, "SimPlotPanelHeight", "simulator.plot_panel_height" );
838 ret &= fromLegacy<int>( aCfg, "SimSignalPanelHeight", "simulator.signal_panel_height" );
839 ret &= fromLegacy<int>( aCfg, "SimCursorsPanelHeight", "simulator.cursors_panel_height" );
840 ret &= fromLegacy<bool>( aCfg, "SimPlotWhiteBg", "simulator.white_background" );
841
842 ret &= fromLegacy<int>( aCfg, "SymbolChooserHSashPosition", "symbol_chooser.sash_pos_h" );
843 ret &= fromLegacy<int>( aCfg, "SymbolChooserVSashPosition", "symbol_chooser.sash_pos_v" );
844 ret &= fromLegacy<int>( aCfg, "SymbolChooserWidth", "symbol_chooser.width" );
845 ret &= fromLegacy<int>( aCfg, "SymbolChooserHeight", "symbol_chooser.height" );
846
847 const std::string vlf = "ViewlibFrame";
848 ret &= fromLegacy<bool>( aCfg, vlf + "Maximized", "lib_view.window.maximized" );
849 ret &= fromLegacyString( aCfg, vlf + "MostRecentlyUsedPath", "lib_view.window.mru_path" );
850 ret &= fromLegacy<int>( aCfg, vlf + "Size_x", "lib_view.window.size_x" );
851 ret &= fromLegacy<int>( aCfg, vlf + "Size_y", "lib_view.window.size_y" );
852 ret &= fromLegacyString( aCfg, vlf + "Perspective", "lib_view.window.perspective" );
853 ret &= fromLegacy<int>( aCfg, vlf + "Pos_x", "lib_view.window.pos_x" );
854 ret &= fromLegacy<int>( aCfg, vlf + "Pos_y", "lib_view.window.pos_y" );
855 ret &= fromLegacy<int>( aCfg, "ViewLiblistWidth", "lib_view.lib_list_width" );
856 ret &= fromLegacy<int>( aCfg, "ViewCmplistWidth", "lib_view.cmp_list_width" );
857 ret &= fromLegacy<bool>( aCfg,
858 "ViewCmpShowPinElectricalType", "lib_view.show_pin_electrical_type" );
859 ret &= fromLegacy<bool>( aCfg, vlf + "ShowGrid", "lib_view.grid.show" );
860 ret &= fromLegacy<int>( aCfg, vlf + "_LastGridSize", "lib_view.grid.last_size" );
861
862 ret &= fromLegacy<bool>( aCfg, "RescueNeverShow", "system.never_show_rescue_dialog" );
863
864 // Legacy version stored this setting in eeschema, so move it to common if it exists
865 bool tmp;
866
867 if( aCfg->Read( "MoveWarpsCursor", &tmp ) )
868 Pgm().GetCommonSettings()->m_Input.warp_mouse_on_move = tmp;
869
872
873 auto migrateLegacyColor =
874 [&] ( const std::string& aKey, int aLayerId )
875 {
876 wxString str;
877
878 if( aCfg->Read( aKey, &str ) )
879 cs->SetColor( aLayerId, COLOR4D( str ) );
880 };
881
882 migrateLegacyColor( "Color4DBgCanvasEx", LAYER_SCHEMATIC_BACKGROUND );
883 migrateLegacyColor( "Color4DBodyBgEx", LAYER_DEVICE_BACKGROUND );
884 migrateLegacyColor( "Color4DBodyEx", LAYER_DEVICE );
885 migrateLegacyColor( "Color4DBrightenedEx", LAYER_BRIGHTENED );
886 migrateLegacyColor( "Color4DBusEx", LAYER_BUS );
887 migrateLegacyColor( "Color4DConnEx", LAYER_JUNCTION );
888 migrateLegacyColor( "Color4DCursorEx", LAYER_SCHEMATIC_CURSOR );
889 migrateLegacyColor( "Color4DErcEEx", LAYER_ERC_ERR );
890 migrateLegacyColor( "Color4DErcWEx", LAYER_ERC_WARN );
891 migrateLegacyColor( "Color4DFieldEx", LAYER_FIELDS );
892 migrateLegacyColor( "Color4DGLabelEx", LAYER_GLOBLABEL );
893 migrateLegacyColor( "Color4DGridEx", LAYER_SCHEMATIC_GRID );
894 migrateLegacyColor( "Color4DHLabelEx", LAYER_HIERLABEL );
895 migrateLegacyColor( "Color4DHiddenEx", LAYER_HIDDEN );
896 migrateLegacyColor( "Color4DLLabelEx", LAYER_LOCLABEL );
897 migrateLegacyColor( "Color4DNoConnectEx", LAYER_NOCONNECT );
898 migrateLegacyColor( "Color4DNoteEx", LAYER_NOTES );
899 migrateLegacyColor( "Color4DPinEx", LAYER_PIN );
900 migrateLegacyColor( "Color4DPinNameEx", LAYER_PINNAM );
901 migrateLegacyColor( "Color4DPinNumEx", LAYER_PINNUM );
902 migrateLegacyColor( "Color4DReferenceEx", LAYER_REFERENCEPART );
903 migrateLegacyColor( "Color4DShadowEx", LAYER_SELECTION_SHADOWS );
904 migrateLegacyColor( "Color4DSheetEx", LAYER_SHEET );
905 migrateLegacyColor( "Color4DSheetFileNameEx", LAYER_SHEETFILENAME );
906 migrateLegacyColor( "Color4DSheetLabelEx", LAYER_SHEETLABEL );
907 migrateLegacyColor( "Color4DSheetNameEx", LAYER_SHEETNAME );
908 migrateLegacyColor( "Color4DValueEx", LAYER_VALUEPART );
909 migrateLegacyColor( "Color4DWireEx", LAYER_WIRE );
910 migrateLegacyColor( "Color4DWorksheetEx", LAYER_SCHEMATIC_DRAWINGSHEET );
911
912 mgr.SaveColorSettings( cs, "schematic" );
913
914 Set( "appearance.color_theme", cs->GetFilename() );
915
916 // LibEdit settings were stored with eeschema. If eeschema is the first app to run,
917 // we need to migrate the LibEdit settings here
918
919 if( SYMBOL_EDITOR_SETTINGS* sym_edit_cfg = GetAppSettings<SYMBOL_EDITOR_SETTINGS>( "symbol_editor" ) )
920 {
921 sym_edit_cfg->MigrateFromLegacy( aCfg );
922 sym_edit_cfg->Load();
923 }
924
925 return ret;
926}
927
928
933class BOM_CFG_PARSER : public DIALOG_BOM_CFG_LEXER
934{
935 std::vector<EESCHEMA_SETTINGS::BOM_PLUGIN_SETTINGS>* m_pluginList;
936
937public:
938 BOM_CFG_PARSER( std::vector<EESCHEMA_SETTINGS::BOM_PLUGIN_SETTINGS>* aPluginList,
939 const char* aData, const wxString& aSource );
940
941 void Parse();
942
943private:
944 void parseGenerator();
945};
946
947
948std::vector<EESCHEMA_SETTINGS::BOM_PLUGIN_SETTINGS> EESCHEMA_SETTINGS::DefaultBomPlugins()
949{
951}
952
953
955{
956 if( !Contains( "bom.plugins" ) )
957 return false;
958
959 wxString list = *Get<wxString>( "bom.plugins" );
960
961 BOM_CFG_PARSER cfg_parser( &m_BomPanel.plugins, TO_UTF8( list ), wxT( "plugins" ) );
962
963 try
964 {
965 cfg_parser.Parse();
966 }
967 catch( const IO_ERROR& )
968 {
969 return false;
970 }
971
972 // Parser will have loaded up our array, let's dump it out to JSON
973 At( "bom.plugins" ) = bomSettingsToJson();
974
975 return true;
976}
977
978
980{
981 nlohmann::json js = nlohmann::json::array();
982
983 for( const BOM_PLUGIN_SETTINGS& plugin : m_BomPanel.plugins )
984 {
985 nlohmann::json pluginJson;
986
987 pluginJson["name"] = plugin.name.ToUTF8();
988 pluginJson["path"] = plugin.path.ToUTF8();
989 pluginJson["command"] = plugin.command.ToUTF8();
990
991 js.push_back( pluginJson );
992 }
993
994 return js;
995}
996
997
998std::vector<EESCHEMA_SETTINGS::BOM_PLUGIN_SETTINGS> EESCHEMA_SETTINGS::bomSettingsFromJson(
999 const nlohmann::json& aObj )
1000{
1001 std::vector<EESCHEMA_SETTINGS::BOM_PLUGIN_SETTINGS> ret;
1002
1003 wxASSERT( aObj.is_array() );
1004
1005 for( const nlohmann::json& entry : aObj )
1006 {
1007 if( entry.empty() || !entry.is_object() )
1008 continue;
1009
1010 if( !entry.contains( "name" ) || !entry.contains( "path" ) )
1011 continue;
1012
1013 BOM_PLUGIN_SETTINGS plugin( entry.at( "name" ).get<wxString>(),
1014 entry.at( "path" ).get<wxString>() );
1015
1016 if( entry.contains( "command" ) )
1017 plugin.command = entry.at( "command" ).get<wxString>();
1018
1019 ret.emplace_back( plugin );
1020 }
1021
1022 return ret;
1023}
1024
1025
1027{
1028 nlohmann::json js = nlohmann::json::array();
1029
1030 for( const NETLIST_PLUGIN_SETTINGS& plugin : m_NetlistPanel.plugins )
1031 {
1032 nlohmann::json pluginJson;
1033
1034 pluginJson["name"] = plugin.name.ToUTF8();
1035 pluginJson["path"] = plugin.path.ToUTF8();
1036 pluginJson["command"] = plugin.command.ToUTF8();
1037
1038 js.push_back( pluginJson );
1039 }
1040
1041 return js;
1042}
1043
1044
1045std::vector<EESCHEMA_SETTINGS::NETLIST_PLUGIN_SETTINGS> EESCHEMA_SETTINGS::netlistSettingsFromJson(
1046 const nlohmann::json& aObj )
1047{
1048 std::vector<EESCHEMA_SETTINGS::NETLIST_PLUGIN_SETTINGS> ret;
1049
1050 wxASSERT( aObj.is_array() );
1051
1052 for( const nlohmann::json& entry : aObj )
1053 {
1054 if( entry.empty() || !entry.is_object() )
1055 continue;
1056
1057 if( !entry.contains( "name" ) || !entry.contains( "path" ) )
1058 continue;
1059
1060 NETLIST_PLUGIN_SETTINGS plugin( entry.at( "name" ).get<wxString>(),
1061 entry.at( "path" ).get<wxString>() );
1062
1063 if( entry.contains( "command" ) )
1064 plugin.command = entry.at( "command" ).get<wxString>();
1065
1066 ret.emplace_back( plugin );
1067 }
1068
1069 return ret;
1070}
1071
1072
1073BOM_CFG_PARSER::BOM_CFG_PARSER( std::vector<EESCHEMA_SETTINGS::BOM_PLUGIN_SETTINGS>* aPluginList,
1074 const char* aLine, const wxString& aSource ) :
1075 DIALOG_BOM_CFG_LEXER( aLine, aSource )
1076{
1077 wxASSERT( aPluginList );
1078 m_pluginList = aPluginList;
1079}
1080
1081
1083{
1084 T token;
1085
1086 while( ( token = NextTok() ) != T_RIGHT )
1087 {
1088 if( token == T_EOF)
1089 break;
1090
1091 if( token == T_LEFT )
1092 token = NextTok();
1093
1094 if( token == T_plugins )
1095 continue;
1096
1097 switch( token )
1098 {
1099 case T_plugin: // Defines a new plugin
1101 break;
1102
1103 default:
1104// Unexpected( CurText() );
1105 break;
1106 }
1107 }
1108}
1109
1110
1112{
1113 wxString str;
1115
1116 NeedSYMBOLorNUMBER();
1117 settings.path = FromUTF8();
1118
1119 T token;
1120
1121 while( ( token = NextTok() ) != T_RIGHT )
1122 {
1123 if( token == T_EOF)
1124 break;
1125
1126 switch( token )
1127 {
1128 case T_LEFT:
1129 break;
1130
1131 case T_cmd:
1132 NeedSYMBOLorNUMBER();
1133
1134 settings.command = FromUTF8();
1135
1136 NeedRIGHT();
1137 break;
1138
1139 case T_opts:
1140 {
1141 NeedSYMBOLorNUMBER();
1142
1143 wxString option = FromUTF8();
1144
1145 if( option.StartsWith( wxS( "nickname=" ), &str ) )
1146 settings.name = str;
1147
1148 NeedRIGHT();
1149 break;
1150 }
1151
1152 default:
1153 Unexpected( CurText() );
1154 break;
1155 }
1156 }
1157
1158 m_pluginList->emplace_back( settings );
1159}
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
Definition: app_settings.h:108
void addParamsForWindow(WINDOW_SETTINGS *aWindow, const std::string &aJsonPath, int aDefaultWidth=0, int aDefaultHeight=0)
Add parameters for the given window object.
virtual bool MigrateFromLegacy(wxConfigBase *aCfg) override
Migrates from wxConfig to JSON-based configuration.
bool migrateLibTreeWidth()
Migrate the library tree width setting from a single column (Item) to multi-column.
Used for parsing legacy-format bom plugin configurations.
BOM_CFG_PARSER(std::vector< EESCHEMA_SETTINGS::BOM_PLUGIN_SETTINGS > *aPluginList, const char *aData, const wxString &aSource)
std::vector< EESCHEMA_SETTINGS::BOM_PLUGIN_SETTINGS > * m_pluginList
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)
static const wxString PropertiesPaneName()
static const wxString DesignBlocksPaneName()
PANEL_ANNOTATE m_AnnotatePanel
static std::vector< BOM_PLUGIN_SETTINGS > DefaultBomPlugins()
PANEL_NETLIST m_NetlistPanel
nlohmann::json bomSettingsToJson() const
virtual bool MigrateFromLegacy(wxConfigBase *aLegacyConfig) override
Migrates from wxConfig to JSON-based configuration.
nlohmann::json netlistSettingsToJson() const
PANEL_SYM_CHOOSER m_SymChooserPanel
PAGE_SETTINGS m_PageSettings
static std::vector< BOM_PLUGIN_SETTINGS > bomSettingsFromJson(const nlohmann::json &aObj)
FIND_REPLACE_EXTRA m_FindReplaceExtra
PANEL_LIB_VIEW m_LibViewPanel
AUTOPLACE_FIELDS m_AutoplaceFields
DIALOG_IMPORT_GRAPHICS m_ImportGraphics
static std::vector< NETLIST_PLUGIN_SETTINGS > netlistSettingsFromJson(const nlohmann::json &aObj)
PANEL_FIELD_EDITOR m_FieldEditorPanel
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
Definition: ki_exception.h:77
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...
bool Contains(const std::string &aPath) const
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:86
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:104
Stores an enum as an integer.
Definition: parameters.h:228
Like a normal param, but with custom getter and setter functions.
Definition: parameters.h:295
Represents a map of <std::string, Value>.
Definition: parameters.h:734
virtual COMMON_SETTINGS * GetCommonSettings() const
Definition: pgm_base.cpp:565
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.
COLOR_SETTINGS * GetMigratedColorSettings()
Return a color theme for storing colors migrated from legacy (5.x and earlier) settings,...
#define DEFAULT_BUS_WIDTH_MILS
The default noconnect size in mils.
#define DEFAULT_JUNCTION_DIAM
The default bus and wire entry size in mils.
#define DEFAULT_WIRE_WIDTH_MILS
The default bus width in mils. (can be changed in preference menu)
#define DEFAULT_LINE_WIDTH_MILS
The default wire width in mils. (can be changed in preference menu)
#define DEFAULT_TEXT_SIZE
Ratio of the font height to the baseline of the text above the wire.
#define _(s)
const nlohmann::json defaultBomPlugins
Default value for bom.plugins.
const wxAuiPaneInfo & defaultSchSelectionFilterPaneInfo(wxWindow *aWindow)
const wxAuiPaneInfo & defaultPropertiesPaneInfo(wxWindow *aWindow)
const wxAuiPaneInfo & defaultNetNavigatorPaneInfo()
const int eeschemaSchemaVersion
Update the schema version whenever a migration is required.
const wxAuiPaneInfo & defaultDesignBlocksPaneInfo(wxWindow *aWindow)
@ LAYER_SHEETNAME
Definition: layer_ids.h:462
@ LAYER_ERC_WARN
Definition: layer_ids.h:469
@ LAYER_SHEETLABEL
Definition: layer_ids.h:465
@ LAYER_PINNUM
Definition: layer_ids.h:448
@ LAYER_DEVICE
Definition: layer_ids.h:456
@ LAYER_BRIGHTENED
Definition: layer_ids.h:481
@ LAYER_HIDDEN
Definition: layer_ids.h:482
@ LAYER_HIERLABEL
Definition: layer_ids.h:447
@ LAYER_PINNAM
Definition: layer_ids.h:449
@ LAYER_GLOBLABEL
Definition: layer_ids.h:446
@ LAYER_WIRE
Definition: layer_ids.h:442
@ LAYER_NOTES
Definition: layer_ids.h:457
@ LAYER_ERC_ERR
Definition: layer_ids.h:470
@ LAYER_PIN
Definition: layer_ids.h:460
@ LAYER_VALUEPART
Definition: layer_ids.h:451
@ LAYER_BUS
Definition: layer_ids.h:443
@ LAYER_SCHEMATIC_CURSOR
Definition: layer_ids.h:479
@ LAYER_FIELDS
Definition: layer_ids.h:452
@ LAYER_DEVICE_BACKGROUND
Definition: layer_ids.h:474
@ LAYER_SCHEMATIC_DRAWINGSHEET
Definition: layer_ids.h:485
@ LAYER_LOCLABEL
Definition: layer_ids.h:445
@ LAYER_JUNCTION
Definition: layer_ids.h:444
@ LAYER_REFERENCEPART
Definition: layer_ids.h:450
@ LAYER_SHEET
Definition: layer_ids.h:461
@ LAYER_SELECTION_SHADOWS
Definition: layer_ids.h:484
@ LAYER_SCHEMATIC_BACKGROUND
Definition: layer_ids.h:478
@ LAYER_SHEETFILENAME
Definition: layer_ids.h:463
@ LAYER_NOCONNECT
Definition: layer_ids.h:466
@ LAYER_SCHEMATIC_GRID
Definition: layer_ids.h:476
PGM_BASE & Pgm()
The global program "get" accessor.
Definition: pgm_base.cpp:902
see class PGM_BASE
@ RPT_SEVERITY_WARNING
@ RPT_SEVERITY_ERROR
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
Definition: string_utils.h:429
std::vector< double > junction_size_mult_list
std::vector< BOM_PLUGIN_SETTINGS > plugins
std::map< std::string, int > field_widths
std::vector< NETLIST_PLUGIN_SETTINGS > plugins
SIM_MOUSE_WHEEL_ACTION vertical_unmodified
SIM_MOUSE_WHEEL_ACTION vertical_with_alt
SIM_MOUSE_WHEEL_ACTION horizontal
SIM_MOUSE_WHEEL_ACTION vertical_with_ctrl
SIM_MOUSE_WHEEL_ACTION vertical_with_shift
SIM_MOUSE_WHEEL_ACTION_SET mouse_wheel_actions
Functions to provide common constants and other functions to assist in making a consistent UI.