KiCad PCB EDA Suite
Loading...
Searching...
No Matches
project_local_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 CERN
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 * @author Jon Evans <[email protected]>
7 *
8 * This program is free software: you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation, either version 3 of the License, or (at your
11 * option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22#include <lset.h>
23#include <project.h>
27#include <settings/parameters.h>
28
30
31
32PROJECT_LOCAL_SETTINGS::PROJECT_LOCAL_SETTINGS( PROJECT* aProject, const wxString& aFilename ) :
34 /* aCreateIfMissing = */ true, /* aCreateIfDefault = */ false,
35 /* aWriteFile = */ true ),
36 // clang-format off: suggestion is less readable.
40 m_AutoTrackWidth( true ),
42 m_PrototypeZoneFill( false ),
43 m_TrackOpacity( 1.0 ),
44 m_ViaOpacity( 1.0 ),
45 m_PadOpacity( 1.0 ),
46 m_ZoneOpacity( 0.6 ),
47 m_ShapeOpacity( 1.0 ),
48 m_ImageOpacity( 0.6 ),
51 m_project( aProject ),
52 m_wasMigrated( false )
53// clang-format on: suggestion is less readable.
54{
55 // Keep old files around
57
58 m_params.emplace_back( new PARAM_LAMBDA<std::string>( "board.visible_layers",
59 [&]() -> std::string
60 {
61 return m_VisibleLayers.FmtHex();
62 },
63 [&]( const std::string& aString )
64 {
65 m_VisibleLayers.ParseHex( aString );
66 },
68
69 m_params.emplace_back( new PARAM_LAMBDA<nlohmann::json>( "board.visible_items",
70 [&]() -> nlohmann::json
71 {
72 nlohmann::json ret = nlohmann::json::array();
73
74 for( GAL_LAYER_ID l : m_VisibleItems.Seq() )
75 {
76 if( std::optional<VISIBILITY_LAYER> vl = VisibilityLayerFromRenderLayer( l ) )
77 ret.push_back( VisibilityLayerToString( *vl ) );
78 }
79
80 // Explicit marker to tell apart a wiped-out array from the user hiding everything
81 if( ret.empty() )
82 ret.push_back( "none" );
83
84 return ret;
85 },
86 [&]( const nlohmann::json& aVal )
87 {
88 if( !aVal.is_array() || aVal.empty() )
89 {
91 return;
92 }
93
95 GAL_SET visible;
96 bool none = false;
97
98 for( const nlohmann::json& entry : aVal )
99 {
100 try
101 {
102 std::string vs = entry.get<std::string>();
103
104 if( std::optional<GAL_LAYER_ID> l = RenderLayerFromVisbilityString( vs ) )
105 visible.set( *l );
106 else if( vs == "none" )
107 none = true;
108 }
109 catch( ... )
110 {
111 // Unknown entry (possibly the settings file was re-saved by an old version
112 // of kicad that used numeric entries, or is a future format)
113 }
114 }
115
116 // Restore corrupted state
117 if( !visible.any() && !none )
119 else
120 m_VisibleItems |= UserVisbilityLayers() & visible;
121 },
122 {} ) );
123
124 m_params.emplace_back( new PARAM_LAMBDA<nlohmann::json>( "board.selection_filter",
125 [&]() -> nlohmann::json
126 {
127 nlohmann::json ret;
128
129 ret["lockedItems"] = m_PcbSelectionFilter.lockedItems;
130 ret["footprints"] = m_PcbSelectionFilter.footprints;
131 ret["text"] = m_PcbSelectionFilter.text;
132 ret["tracks"] = m_PcbSelectionFilter.tracks;
133 ret["vias"] = m_PcbSelectionFilter.vias;
134 ret["pads"] = m_PcbSelectionFilter.pads;
135 ret["graphics"] = m_PcbSelectionFilter.graphics;
136 ret["zones"] = m_PcbSelectionFilter.zones;
137 ret["keepouts"] = m_PcbSelectionFilter.keepouts;
138 ret["dimensions"] = m_PcbSelectionFilter.dimensions;
139 ret["otherItems"] = m_PcbSelectionFilter.otherItems;
140
141 return ret;
142 },
143 [&]( const nlohmann::json& aVal )
144 {
145 if( aVal.empty() || !aVal.is_object() )
146 return;
147
148 SetIfPresent( aVal, "lockedItems", m_PcbSelectionFilter.lockedItems );
149 SetIfPresent( aVal, "footprints", m_PcbSelectionFilter.footprints );
150 SetIfPresent( aVal, "text", m_PcbSelectionFilter.text );
151 SetIfPresent( aVal, "tracks", m_PcbSelectionFilter.tracks );
152 SetIfPresent( aVal, "vias", m_PcbSelectionFilter.vias );
153 SetIfPresent( aVal, "pads", m_PcbSelectionFilter.pads );
154 SetIfPresent( aVal, "graphics", m_PcbSelectionFilter.graphics );
155 SetIfPresent( aVal, "zones", m_PcbSelectionFilter.zones );
156 SetIfPresent( aVal, "keepouts", m_PcbSelectionFilter.keepouts );
157 SetIfPresent( aVal, "dimensions", m_PcbSelectionFilter.dimensions );
158 SetIfPresent( aVal, "otherItems", m_PcbSelectionFilter.otherItems );
159 },
160 {
161 { "lockedItems", false },
162 { "footprints", true },
163 { "text", true },
164 { "tracks", true },
165 { "vias", true },
166 { "pads", true },
167 { "graphics", true },
168 { "zones", true },
169 { "keepouts", true },
170 { "dimensions", true },
171 { "otherItems", true }
172 } ) );
173
174 m_params.emplace_back( new PARAM_ENUM<PCB_LAYER_ID>( "board.active_layer",
176
177 m_params.emplace_back( new PARAM<wxString>( "board.active_layer_preset",
178 &m_ActiveLayerPreset, "" ) );
179
180 m_params.emplace_back( new PARAM_ENUM<HIGH_CONTRAST_MODE>( "board.high_contrast_mode",
183
184 m_params.emplace_back( new PARAM<double>( "board.opacity.tracks", &m_TrackOpacity, 1.0 ) );
185 m_params.emplace_back( new PARAM<double>( "board.opacity.vias", &m_ViaOpacity, 1.0 ) );
186 m_params.emplace_back( new PARAM<double>( "board.opacity.pads", &m_PadOpacity, 1.0 ) );
187 m_params.emplace_back( new PARAM<double>( "board.opacity.zones", &m_ZoneOpacity, 0.6 ) );
188 m_params.emplace_back( new PARAM<double>( "board.opacity.images", &m_ImageOpacity, 0.6 ) );
189 m_params.emplace_back( new PARAM<double>( "board.opacity.shapes", &m_ShapeOpacity, 1.0 ) );
190
191 m_params.emplace_back( new PARAM_LIST<wxString>( "board.hidden_nets", &m_HiddenNets, {} ) );
192
193 m_params.emplace_back( new PARAM_SET<wxString>( "board.hidden_netclasses",
194 &m_HiddenNetclasses, {} ) );
195
196 m_params.emplace_back( new PARAM_ENUM<NET_COLOR_MODE>( "board.net_color_mode",
199
200 m_params.emplace_back( new PARAM<bool>( "board.auto_track_width",
201 &m_AutoTrackWidth, true ) );
202
203 m_params.emplace_back( new PARAM_ENUM<ZONE_DISPLAY_MODE>( "board.zone_display_mode",
207
208 m_params.emplace_back( new PARAM<bool>( "board.prototype_zone_fills", &m_PrototypeZoneFill, false ) );
209
210 m_params.emplace_back( new PARAM<wxString>( "git.repo_username", &m_GitRepoUsername, "" ) );
211
212 m_params.emplace_back( new PARAM<wxString>( "git.repo_type", &m_GitRepoType, "" ) );
213
214 m_params.emplace_back( new PARAM<wxString>( "git.ssh_key", &m_GitSSHKey, "" ) );
215
216 m_params.emplace_back( new PARAM<bool>( "git.integration_disabled", &m_GitIntegrationDisabled, false ) );
217
218 m_params.emplace_back( new PARAM<wxString>( "net_inspector_panel.filter_text",
219 &m_NetInspectorPanel.filter_text, "" ) );
220 m_params.emplace_back( new PARAM<bool>( "net_inspector_panel.filter_by_net_name",
221 &m_NetInspectorPanel.filter_by_net_name, true ) );
222 m_params.emplace_back( new PARAM<bool>( "net_inspector_panel.filter_by_netclass",
223 &m_NetInspectorPanel.filter_by_netclass, true ) );
224 m_params.emplace_back( new PARAM<bool>( "net_inspector_panel.group_by_netclass",
225 &m_NetInspectorPanel.group_by_netclass, false ) );
226 m_params.emplace_back( new PARAM<bool>( "net_inspector_panel.group_by_net_chain",
227 &m_NetInspectorPanel.group_by_net_chain, false ) );
228 m_params.emplace_back( new PARAM<bool>( "net_inspector_panel.group_by_constraint",
229 &m_NetInspectorPanel.group_by_constraint, false ) );
230 m_params.emplace_back( new PARAM_LIST<wxString>( "net_inspector_panel.custom_group_rules",
231 &m_NetInspectorPanel.custom_group_rules,
232 {} ) );
233 m_params.emplace_back( new PARAM<bool>( "net_inspector_panel.show_zero_pad_nets",
234 &m_NetInspectorPanel.show_zero_pad_nets, false ) );
235 m_params.emplace_back( new PARAM<bool>( "net_inspector_panel.show_unconnected_nets",
236 &m_NetInspectorPanel.show_unconnected_nets, false ) );
237 m_params.emplace_back( new PARAM<bool>( "net_inspector_panel.show_time_domain_details",
238 &m_NetInspectorPanel.show_time_domain_details, false ) );
239 m_params.emplace_back( new PARAM<int>( "net_inspector_panel.sorting_column",
240 &m_NetInspectorPanel.sorting_column, -1 ) );
241 m_params.emplace_back( new PARAM<bool>( "net_inspector_panel.sort_ascending",
242 &m_NetInspectorPanel.sort_order_asc, true ) );
243 m_params.emplace_back( new PARAM_LIST<int>( "net_inspector_panel.col_order",
244 &m_NetInspectorPanel.col_order, {} ) );
245 m_params.emplace_back( new PARAM_LIST<int>( "net_inspector_panel.col_widths",
246 &m_NetInspectorPanel.col_widths, {} ) );
247 m_params.emplace_back( new PARAM_LIST<bool>( "net_inspector_panel.col_hidden",
248 &m_NetInspectorPanel.col_hidden, {} ) );
249 m_params.emplace_back( new PARAM_LIST<wxString>( "net_inspector_panel.expanded_rows",
250 &m_NetInspectorPanel.expanded_rows, {} ) );
251
252 m_params.emplace_back( new PARAM_LIST<wxString>( "open_jobsets", &m_OpenJobSets, {} ) );
253
254 m_params.emplace_back( new PARAM_LAMBDA<nlohmann::json>( "project.files",
255 [&]() -> nlohmann::json
256 {
257 nlohmann::json ret = nlohmann::json::array();
258
259 for( PROJECT_FILE_STATE& fileState : m_files )
260 {
261 nlohmann::json file;
262 file["name"] = fileState.fileName;
263 file["open"] = fileState.open;
264
265 nlohmann::json window;
266 window["maximized"] = fileState.window.maximized;
267 window["size_x"] = fileState.window.size_x;
268 window["size_y"] = fileState.window.size_y;
269 window["pos_x"] = fileState.window.pos_x;
270 window["pos_y"] = fileState.window.pos_y;
271 window["display"] = fileState.window.display;
272
273 file["window"] = window;
274
275 ret.push_back( file );
276 }
277
278 return ret;
279 },
280 [&]( const nlohmann::json& aVal )
281 {
282 if( !aVal.is_array() || aVal.empty() )
283 return;
284
285 m_files.clear();
286
287 for( const nlohmann::json& file : aVal )
288 {
289 PROJECT_FILE_STATE fileState;
290
291 try
292 {
293 SetIfPresent( file, "name", fileState.fileName );
294 SetIfPresent( file, "open", fileState.open );
295 SetIfPresent( file, "window.size_x", fileState.window.size_x );
296 SetIfPresent( file, "window.size_y", fileState.window.size_y );
297 SetIfPresent( file, "window.pos_x", fileState.window.pos_x );
298 SetIfPresent( file, "window.pos_y", fileState.window.pos_y );
299 SetIfPresent( file, "window.maximized", fileState.window.maximized );
300 SetIfPresent( file, "window.display", fileState.window.display );
301
302 m_files.push_back( fileState );
303 }
304 catch( ... )
305 {
306 // Non-integer or out of range entry in the array; ignore
307 }
308 }
309
310 },
311 {
312 } ) );
313
314 m_params.emplace_back( new PARAM_LAMBDA<nlohmann::json>( "schematic.selection_filter",
315 [&]() -> nlohmann::json
316 {
317 nlohmann::json ret;
318
319 ret["lockedItems"] = m_SchSelectionFilter.lockedItems;
320 ret["symbols"] = m_SchSelectionFilter.symbols;
321 ret["text"] = m_SchSelectionFilter.text;
322 ret["wires"] = m_SchSelectionFilter.wires;
323 ret["labels"] = m_SchSelectionFilter.labels;
324 ret["pins"] = m_SchSelectionFilter.pins;
325 ret["graphics"] = m_SchSelectionFilter.graphics;
326 ret["images"] = m_SchSelectionFilter.images;
327 ret["ruleAreas"] = m_SchSelectionFilter.ruleAreas;
328 ret["otherItems"] = m_SchSelectionFilter.otherItems;
329
330 return ret;
331 },
332 [&]( const nlohmann::json& aVal )
333 {
334 if( aVal.empty() || !aVal.is_object() )
335 return;
336
337 SetIfPresent( aVal, "lockedItems", m_SchSelectionFilter.lockedItems );
338 SetIfPresent( aVal, "symbols", m_SchSelectionFilter.symbols );
339 SetIfPresent( aVal, "text", m_SchSelectionFilter.text );
340 SetIfPresent( aVal, "wires", m_SchSelectionFilter.wires );
341 SetIfPresent( aVal, "labels", m_SchSelectionFilter.labels );
342 SetIfPresent( aVal, "pins", m_SchSelectionFilter.pins );
343 SetIfPresent( aVal, "graphics", m_SchSelectionFilter.graphics );
344 SetIfPresent( aVal, "images", m_SchSelectionFilter.images );
345 SetIfPresent( aVal, "ruleAreas", m_SchSelectionFilter.ruleAreas );
346 SetIfPresent( aVal, "otherItems", m_SchSelectionFilter.otherItems );
347 },
348 {
349 { "lockedItems", false },
350 { "symbols", true },
351 { "text", true },
352 { "wires", true },
353 { "labels", true },
354 { "pins", true },
355 { "graphics", true },
356 { "images", true },
357 { "ruleAreas", true },
358 { "otherItems", true }
359 } ) );
360
361 m_params.emplace_back( new PARAM_LIST<wxString>( "schematic.hierarchy_collapsed",
362 &m_SchHierarchyCollapsed, {} ) );
363
364 registerMigration( 1, 2,
365 [&]()
366 {
371
372 std::string ptr( "board.visible_items" );
373
374 if( Contains( ptr ) )
375 {
376 if( At( ptr ).is_array() )
377 {
378 At( ptr ).push_back( LAYER_PADS - GAL_LAYER_ID_START );
379 At( ptr ).push_back( LAYER_ZONES - GAL_LAYER_ID_START );
380 }
381 else
382 {
383 At( "board" ).erase( "visible_items" );
384 }
385
386 m_wasMigrated = true;
387 }
388
389 return true;
390 } );
391
392 registerMigration( 2, 3,
393 [&]()
394 {
400
402 const std::map<int, int> offsets = {
403 { 22, 34 }, // LAYER_PAD_HOLEWALLS
404 { 23, 22 }, // LAYER_VIA_HOLES
405 { 24, 35 }, // LAYER_VIA_HOLEWALLS
406 { 25, 23 }, // LAYER_DRC_ERROR
407 { 26, 36 }, // LAYER_DRC_WARNING
408 { 27, 37 }, // LAYER_DRC_EXCLUSION
409 { 28, 38 }, // LAYER_MARKER_SHADOWS
410 { 29, 24 }, // LAYER_DRAWINGSHEET
411 { 30, 25 }, // LAYER_GP_OVERLAY
412 { 31, 26 }, // LAYER_SELECT_OVERLAY
413 { 32, 27 }, // LAYER_PCB_BACKGROUND
414 { 33, 28 }, // LAYER_CURSOR
415 { 34, 29 }, // LAYER_AUX_ITEM
416 { 35, 30 }, // LAYER_DRAW_BITMAPS
417 { 39, 32 }, // LAYER_PADS
418 { 40, 33 }, // LAYER_ZONES
419 };
420
421 std::string ptr( "board.visible_items" );
422
423 if( Contains( ptr ) && At( ptr ).is_array() )
424 {
425 nlohmann::json visible = nlohmann::json::array();
426
427 for( const nlohmann::json& val : At( ptr ) )
428 {
429 try
430 {
431 int layer = val.get<int>();
432
433 if( offsets.count( layer ) )
434 visible.push_back( offsets.at( layer ) );
435 else
436 visible.push_back( layer );
437 }
438 catch( ... )
439 {
440 // skip invalid value
441 }
442 }
443
444 At( "board" )["visible_items"] = visible;
445 m_wasMigrated = true;
446 }
447
448 return true;
449 } );
450
451 registerMigration( 3, 4,
452 [&]()
453 {
454 // Schema version 3 to 4: LAYER_FILLED_SHAPES added to visibility controls
455
456 std::string ptr( "board.visible_items" );
457
458 if( Contains( ptr ) )
459 {
460 if( At( ptr ).is_array() && !At( ptr ).empty() )
461 At( ptr ).push_back( LAYER_FILLED_SHAPES - GAL_LAYER_ID_START );
462 else
463 At( "board" ).erase( "visible_items" );
464
465 m_wasMigrated = true;
466 }
467
468 return true;
469 } );
470
471 registerMigration( 4, 5,
472 [&]()
473 {
474 // Schema version 5: use named render layers
475
476 std::string ptr( "board.visible_items" );
477
478 if( Contains( ptr ) && At( ptr ).is_array() )
479 {
480 std::vector<std::string> newLayers;
481
482 for( nlohmann::json& entry : At( ptr ) )
483 {
484 if( !entry.is_number_integer() )
485 continue;
486
487 if( std::optional<VISIBILITY_LAYER> vl =
489 {
490 newLayers.emplace_back( VisibilityLayerToString( *vl ) );
491 }
492 }
493
494 At( ptr ) = newLayers;
495 m_wasMigrated = true;
496 }
497
498 return true;
499 } );
500}
501
502
503bool PROJECT_LOCAL_SETTINGS::MigrateFromLegacy( wxConfigBase* aLegacyConfig )
504{
510 return true;
511}
512
513
514bool PROJECT_LOCAL_SETTINGS::SaveToFile( const wxString& aDirectory, bool aForce )
515{
516 wxASSERT( m_project );
517
518 Set( "meta.filename",
519 m_project->GetProjectName() + "." + FILEEXT::ProjectLocalSettingsFileExtension );
520
521 // Even if parameters were not modified, we should resave after migration
522 bool force = aForce || m_wasMigrated;
523
524 // If we're actually going ahead and doing the save, the flag that keeps code from doing the
525 // save should be cleared at this point.
526 m_wasMigrated = false;
527
528 return JSON_SETTINGS::SaveToFile( aDirectory, force );
529}
530
531
532bool PROJECT_LOCAL_SETTINGS::SaveAs( const wxString& aDirectory, const wxString& aFile )
533{
534 Set( "meta.filename", aFile + "." + FILEEXT::ProjectLocalSettingsFileExtension );
535 SetFilename( aFile );
536
537 // If we're actually going ahead and doing the save, the flag that keeps code from doing the
538 // save should be cleared at this point.
539 m_wasMigrated = false;
540
541 return JSON_SETTINGS::SaveToFile( aDirectory, true );
542}
543
544
546{
547 auto it = std::find_if( m_files.begin(), m_files.end(),
548 [&aFileName]( const PROJECT_FILE_STATE &a )
549 {
550 return a.fileName == aFileName;
551 } );
552
553 if( it != m_files.end() )
554 {
555 return &( *it );
556 }
557
558 return nullptr;
559}
560
561
562void PROJECT_LOCAL_SETTINGS::SaveFileState( const wxString& aFileName,
563 const WINDOW_SETTINGS* aWindowCfg, bool aOpen )
564{
565 auto it = std::find_if( m_files.begin(), m_files.end(),
566 [&aFileName]( const PROJECT_FILE_STATE& a )
567 {
568 return a.fileName == aFileName;
569 } );
570
571 if( it == m_files.end() )
572 {
573 PROJECT_FILE_STATE fileState;
574 fileState.fileName = aFileName;
575 fileState.open = false;
576 fileState.window.maximized = false;
577 fileState.window.size_x = -1;
578 fileState.window.size_y = -1;
579 fileState.window.pos_x = -1;
580 fileState.window.pos_y = -1;
581 fileState.window.display = 0;
582
583 m_files.push_back( fileState );
584
585 it = m_files.end() - 1;
586 }
587
588 ( *it ).window = aWindowCfg->state;
589 ( *it ).open = aOpen;
590}
591
592
HIGH_CONTRAST_MODE
Determine how inactive layers should be displayed.
@ NORMAL
Inactive layers are shown normally (no high-contrast mode)
@ HIDDEN
Inactive layers are hidden.
@ RATSNEST
Net/netclass colors are shown on ratsnest lines only.
@ ALL
Net/netclass colors are shown on all net copper.
@ OFF
Net (and netclass) colors are not shown.
std::string FmtHex() const
Return a hex string showing contents of this set.
Definition base_set.h:302
Helper for storing and iterating over GAL_LAYER_IDs.
Definition layer_ids.h:405
GAL_SET & set()
Definition layer_ids.h:421
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...
static bool SetIfPresent(const nlohmann::json &aObj, const std::string &aPath, wxString &aTarget)
Sets the given string if the given key/path is present.
std::vector< PARAM_BASE * > m_params
The list of parameters (owned by this object)
JSON_SETTINGS(const wxString &aFilename, SETTINGS_LOC aLocation, int aSchemaVersion)
bool m_deleteLegacyAfterMigration
Whether or not to delete legacy file after migration.
void SetFilename(const wxString &aFilename)
virtual bool SaveToFile(const wxString &aDirectory="", bool aForce=false)
Calls Store() and then writes the contents of the JSON document to a file.
static const LSET & AllLayersMask()
Definition lset.cpp:641
Stores an enum as an integer.
Definition parameters.h:230
Like a normal param, but with custom getter and setter functions.
Definition parameters.h:297
bool SaveAs(const wxString &aDirectory, const wxString &aFile)
bool m_PrototypeZoneFill
Whether Zone fill should always be solid for performance with large boards.
LSET m_VisibleLayers
Board settings.
bool m_GitIntegrationDisabled
If true, KiCad will not use Git integration for this project even if a .git directory exists.
double m_PadOpacity
Opacity override for SMD pads and PTH.
bool SaveToFile(const wxString &aDirectory="", bool aForce=false) override
Calls Store() and then writes the contents of the JSON document to a file.
std::vector< PROJECT_FILE_STATE > m_files
Project scope.
double m_ViaOpacity
Opacity override for all types of via.
PANEL_NET_INSPECTOR_SETTINGS m_NetInspectorPanel
The state of the net inspector panel.
PCB_SELECTION_FILTER_OPTIONS m_PcbSelectionFilter
State of the selection filter widgets.
wxString m_ActiveLayerPreset
The name of a LAYER_PRESET that is currently activated (or blank if none)
double m_TrackOpacity
Opacity override for all tracks.
PROJECT * m_project
A link to the owning project.
double m_ZoneOpacity
Opacity override for filled zones.
bool m_AutoTrackWidth
The current setting for whether to automatically adjust track widths to match.
ZONE_DISPLAY_MODE m_ZoneDisplayMode
How zones are drawn.
double m_ShapeOpacity
Opacity override for graphic shapes.
PCB_LAYER_ID m_ActiveLayer
The current (active) board layer for editing.
HIGH_CONTRAST_MODE m_ContrastModeDisplay
The current contrast mode.
NET_COLOR_MODE m_NetColorMode
The current net color mode.
std::vector< wxString > m_OpenJobSets
bool MigrateFromLegacy(wxConfigBase *aLegacyConfig) override
Migrates from wxConfig to JSON-based configuration.
GAL_SET m_VisibleItems
The GAL layers (aka items) that are turned on for viewing (.
std::vector< wxString > m_HiddenNets
A list of netnames that have been manually hidden in the board editor.
PROJECT_LOCAL_SETTINGS(PROJECT *aProject, const wxString &aFilename)
std::set< wxString > m_HiddenNetclasses
void SaveFileState(const wxString &aFileName, const WINDOW_SETTINGS *aWindowCfg, bool aOpen)
double m_ImageOpacity
Opacity override for user images.
const PROJECT_FILE_STATE * GetFileState(const wxString &aFileName)
Container for project specific data.
Definition project.h:66
static bool empty(const wxTextEntryBase *aCtrl)
static const std::string ProjectLocalSettingsFileExtension
SETTINGS_LOC
NORMAL
Follows standard pretty-printing rules.
constexpr PCB_LAYER_ID PCBNEW_LAYER_ID_START
Definition layer_ids.h:174
GAL_LAYER_ID
GAL layers are "virtual" layers, i.e.
Definition layer_ids.h:228
@ GAL_LAYER_ID_START
Definition layer_ids.h:229
@ LAYER_FILLED_SHAPES
Copper graphic shape opacity/visibility (color ignored).
Definition layer_ids.h:313
@ LAYER_ZONES
Control for copper zone opacity/visibility (color ignored).
Definition layer_ids.h:295
@ LAYER_PADS
Meta control for all pads opacity/visibility (color ignored).
Definition layer_ids.h:292
@ F_Fab
Definition layer_ids.h:119
@ UNDEFINED_LAYER
Definition layer_ids.h:61
@ F_Cu
Definition layer_ids.h:64
std::optional< VISIBILITY_LAYER > VisibilityLayerFromRenderLayer(GAL_LAYER_ID aLayerId)
GAL_SET UserVisbilityLayers()
The set of GAL_LAYER_IDs that correspond to VISIBILITY_LAYERS.
std::string VisibilityLayerToString(VISIBILITY_LAYER aLayerId)
std::optional< GAL_LAYER_ID > RenderLayerFromVisbilityString(const std::string &aLayer)
const int projectLocalSettingsVersion
struct WINDOW_STATE window
Store the common settings that are saved and loaded for each window / frame.
WINDOW_STATE state
unsigned int display