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.
37 m_ActiveLayer( UNDEFINED_LAYER ),
38 m_ContrastModeDisplay( HIGH_CONTRAST_MODE::NORMAL ),
39 m_NetColorMode( NET_COLOR_MODE::RATSNEST ),
40 m_AutoTrackWidth( true ),
41 m_ZoneDisplayMode( ZONE_DISPLAY_MODE::SHOW_FILLED ),
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 ),
49 m_PcbSelectionFilter(),
50 m_project( aProject ),
51 m_wasMigrated( false )
52// clang-format on: suggestion is less readable.
53{
54 // Keep old files around
56
57 m_params.emplace_back( new PARAM_LAMBDA<std::string>( "board.visible_layers",
58 [&]() -> std::string
59 {
60 return m_VisibleLayers.FmtHex();
61 },
62 [&]( const std::string& aString )
63 {
64 m_VisibleLayers.ParseHex( aString );
65 },
67
68 m_params.emplace_back( new PARAM_LAMBDA<nlohmann::json>( "board.visible_items",
69 [&]() -> nlohmann::json
70 {
71 nlohmann::json ret = nlohmann::json::array();
72
74 {
75 if( std::optional<VISIBILITY_LAYER> vl = VisibilityLayerFromRenderLayer( l ) )
76 ret.push_back( VisibilityLayerToString( *vl ) );
77 }
78
79 // Explicit marker to tell apart a wiped-out array from the user hiding everything
80 if( ret.empty() )
81 ret.push_back( "none" );
82
83 return ret;
84 },
85 [&]( const nlohmann::json& aVal )
86 {
87 if( !aVal.is_array() || aVal.empty() )
88 {
90 return;
91 }
92
93 m_VisibleItems &= ~UserVisbilityLayers();
94 GAL_SET visible;
95 bool none = false;
96
97 for( const nlohmann::json& entry : aVal )
98 {
99 try
100 {
101 std::string vs = entry.get<std::string>();
102
103 if( std::optional<GAL_LAYER_ID> l = RenderLayerFromVisbilityString( vs ) )
104 visible.set( *l );
105 else if( vs == "none" )
106 none = true;
107 }
108 catch( ... )
109 {
110 // Unknown entry (possibly the settings file was re-saved by an old version
111 // of kicad that used numeric entries, or is a future format)
112 }
113 }
114
115 // Restore corrupted state
116 if( !visible.any() && !none )
118 else
119 m_VisibleItems |= UserVisbilityLayers() & visible;
120 },
121 {} ) );
122
123 m_params.emplace_back( new PARAM_LAMBDA<nlohmann::json>( "board.selection_filter",
124 [&]() -> nlohmann::json
125 {
126 nlohmann::json ret;
127
128 ret["lockedItems"] = m_PcbSelectionFilter.lockedItems;
129 ret["footprints"] = m_PcbSelectionFilter.footprints;
130 ret["text"] = m_PcbSelectionFilter.text;
131 ret["tracks"] = m_PcbSelectionFilter.tracks;
132 ret["vias"] = m_PcbSelectionFilter.vias;
133 ret["pads"] = m_PcbSelectionFilter.pads;
134 ret["graphics"] = m_PcbSelectionFilter.graphics;
135 ret["zones"] = m_PcbSelectionFilter.zones;
136 ret["keepouts"] = m_PcbSelectionFilter.keepouts;
137 ret["dimensions"] = m_PcbSelectionFilter.dimensions;
138 ret["otherItems"] = m_PcbSelectionFilter.otherItems;
139
140 return ret;
141 },
142 [&]( const nlohmann::json& aVal )
143 {
144 if( aVal.empty() || !aVal.is_object() )
145 return;
146
147 SetIfPresent( aVal, "lockedItems", m_PcbSelectionFilter.lockedItems );
148 SetIfPresent( aVal, "footprints", m_PcbSelectionFilter.footprints );
149 SetIfPresent( aVal, "text", m_PcbSelectionFilter.text );
150 SetIfPresent( aVal, "tracks", m_PcbSelectionFilter.tracks );
151 SetIfPresent( aVal, "vias", m_PcbSelectionFilter.vias );
152 SetIfPresent( aVal, "pads", m_PcbSelectionFilter.pads );
153 SetIfPresent( aVal, "graphics", m_PcbSelectionFilter.graphics );
154 SetIfPresent( aVal, "zones", m_PcbSelectionFilter.zones );
155 SetIfPresent( aVal, "keepouts", m_PcbSelectionFilter.keepouts );
156 SetIfPresent( aVal, "dimensions", m_PcbSelectionFilter.dimensions );
157 SetIfPresent( aVal, "otherItems", m_PcbSelectionFilter.otherItems );
158 },
159 {
160 { "lockedItems", false },
161 { "footprints", true },
162 { "text", true },
163 { "tracks", true },
164 { "vias", true },
165 { "pads", true },
166 { "graphics", true },
167 { "zones", true },
168 { "keepouts", true },
169 { "dimensions", true },
170 { "otherItems", true }
171 } ) );
172
173 m_params.emplace_back( new PARAM_ENUM<PCB_LAYER_ID>( "board.active_layer",
175
176 m_params.emplace_back( new PARAM<wxString>( "board.active_layer_preset",
177 &m_ActiveLayerPreset, "" ) );
178
179 m_params.emplace_back( new PARAM_ENUM<HIGH_CONTRAST_MODE>( "board.high_contrast_mode",
180 &m_ContrastModeDisplay, HIGH_CONTRAST_MODE::NORMAL,
181 HIGH_CONTRAST_MODE::NORMAL, HIGH_CONTRAST_MODE::HIDDEN ) );
182
183 m_params.emplace_back( new PARAM<double>( "board.opacity.tracks", &m_TrackOpacity, 1.0 ) );
184 m_params.emplace_back( new PARAM<double>( "board.opacity.vias", &m_ViaOpacity, 1.0 ) );
185 m_params.emplace_back( new PARAM<double>( "board.opacity.pads", &m_PadOpacity, 1.0 ) );
186 m_params.emplace_back( new PARAM<double>( "board.opacity.zones", &m_ZoneOpacity, 0.6 ) );
187 m_params.emplace_back( new PARAM<double>( "board.opacity.images", &m_ImageOpacity, 0.6 ) );
188 m_params.emplace_back( new PARAM<double>( "board.opacity.shapes", &m_ShapeOpacity, 1.0 ) );
189
190 m_params.emplace_back( new PARAM_LIST<wxString>( "board.hidden_nets", &m_HiddenNets, {} ) );
191
192 m_params.emplace_back( new PARAM_SET<wxString>( "board.hidden_netclasses",
193 &m_HiddenNetclasses, {} ) );
194
195 m_params.emplace_back( new PARAM_ENUM<NET_COLOR_MODE>( "board.net_color_mode",
196 &m_NetColorMode, NET_COLOR_MODE::RATSNEST, NET_COLOR_MODE::OFF,
197 NET_COLOR_MODE::ALL ) );
198
199 m_params.emplace_back( new PARAM<bool>( "board.auto_track_width",
200 &m_AutoTrackWidth, true ) );
201
202 m_params.emplace_back( new PARAM_ENUM<ZONE_DISPLAY_MODE>( "board.zone_display_mode",
204 ZONE_DISPLAY_MODE::SHOW_FILLED, ZONE_DISPLAY_MODE::SHOW_FILLED,
205 ZONE_DISPLAY_MODE::SHOW_TRIANGULATION ) );
206
207 m_params.emplace_back(
208 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<wxString>( "net_inspector_panel.filter_text",
218 m_params.emplace_back( new PARAM<bool>( "net_inspector_panel.filter_by_net_name",
220 m_params.emplace_back( new PARAM<bool>( "net_inspector_panel.filter_by_netclass",
222 m_params.emplace_back( new PARAM<bool>( "net_inspector_panel.group_by_netclass",
224 m_params.emplace_back( new PARAM<bool>( "net_inspector_panel.group_by_constraint",
226 m_params.emplace_back( new PARAM_LIST<wxString>( "net_inspector_panel.custom_group_rules",
228 {} ) );
229 m_params.emplace_back( new PARAM<bool>( "net_inspector_panel.show_zero_pad_nets",
230 &m_NetInspectorPanel.show_zero_pad_nets, false ) );
231 m_params.emplace_back( new PARAM<bool>( "net_inspector_panel.show_unconnected_nets",
232 &m_NetInspectorPanel.show_unconnected_nets, false ) );
233 m_params.emplace_back( new PARAM<bool>( "net_inspector_panel.show_time_domain_details",
234 &m_NetInspectorPanel.show_time_domain_details, false ) );
235 m_params.emplace_back( new PARAM<int>( "net_inspector_panel.sorting_column",
236 &m_NetInspectorPanel.sorting_column, -1 ) );
237 m_params.emplace_back( new PARAM<bool>( "net_inspector_panel.sort_ascending",
238 &m_NetInspectorPanel.sort_order_asc, true ) );
239 m_params.emplace_back( new PARAM_LIST<int>( "net_inspector_panel.col_order",
240 &m_NetInspectorPanel.col_order, {} ) );
241 m_params.emplace_back( new PARAM_LIST<int>( "net_inspector_panel.col_widths",
242 &m_NetInspectorPanel.col_widths, {} ) );
243 m_params.emplace_back( new PARAM_LIST<bool>( "net_inspector_panel.col_hidden",
244 &m_NetInspectorPanel.col_hidden, {} ) );
245 m_params.emplace_back( new PARAM_LIST<wxString>( "net_inspector_panel.expanded_rows",
246 &m_NetInspectorPanel.expanded_rows, {} ) );
247
248 m_params.emplace_back( new PARAM_LIST<wxString>( "open_jobsets", &m_OpenJobSets, {} ) );
249
250 m_params.emplace_back( new PARAM_LAMBDA<nlohmann::json>( "project.files",
251 [&]() -> nlohmann::json
252 {
253 nlohmann::json ret = nlohmann::json::array();
254
255 for( PROJECT_FILE_STATE& fileState : m_files )
256 {
257 nlohmann::json file;
258 file["name"] = fileState.fileName;
259 file["open"] = fileState.open;
260
261 nlohmann::json window;
262 window["maximized"] = fileState.window.maximized;
263 window["size_x"] = fileState.window.size_x;
264 window["size_y"] = fileState.window.size_y;
265 window["pos_x"] = fileState.window.pos_x;
266 window["pos_y"] = fileState.window.pos_y;
267 window["display"] = fileState.window.display;
268
269 file["window"] = window;
270
271 ret.push_back( file );
272 }
273
274 return ret;
275 },
276 [&]( const nlohmann::json& aVal )
277 {
278 if( !aVal.is_array() || aVal.empty() )
279 return;
280
281 m_files.clear();
282
283 for( const nlohmann::json& file : aVal )
284 {
285 PROJECT_FILE_STATE fileState;
286
287 try
288 {
289 SetIfPresent( file, "name", fileState.fileName );
290 SetIfPresent( file, "open", fileState.open );
291 SetIfPresent( file, "window.size_x", fileState.window.size_x );
292 SetIfPresent( file, "window.size_y", fileState.window.size_y );
293 SetIfPresent( file, "window.pos_x", fileState.window.pos_x );
294 SetIfPresent( file, "window.pos_y", fileState.window.pos_y );
295 SetIfPresent( file, "window.maximized", fileState.window.maximized );
296 SetIfPresent( file, "window.display", fileState.window.display );
297
298 m_files.push_back( fileState );
299 }
300 catch( ... )
301 {
302 // Non-integer or out of range entry in the array; ignore
303 }
304 }
305
306 },
307 {
308 } ) );
309
310 m_params.emplace_back( new PARAM_LAMBDA<nlohmann::json>( "schematic.selection_filter",
311 [&]() -> nlohmann::json
312 {
313 nlohmann::json ret;
314
315 ret["lockedItems"] = m_SchSelectionFilter.lockedItems;
316 ret["symbols"] = m_SchSelectionFilter.symbols;
317 ret["text"] = m_SchSelectionFilter.text;
318 ret["wires"] = m_SchSelectionFilter.wires;
319 ret["labels"] = m_SchSelectionFilter.labels;
320 ret["pins"] = m_SchSelectionFilter.pins;
321 ret["graphics"] = m_SchSelectionFilter.graphics;
322 ret["images"] = m_SchSelectionFilter.images;
323 ret["otherItems"] = m_SchSelectionFilter.otherItems;
324
325 return ret;
326 },
327 [&]( const nlohmann::json& aVal )
328 {
329 if( aVal.empty() || !aVal.is_object() )
330 return;
331
332 SetIfPresent( aVal, "lockedItems", m_SchSelectionFilter.lockedItems );
333 SetIfPresent( aVal, "symbols", m_SchSelectionFilter.symbols );
334 SetIfPresent( aVal, "text", m_SchSelectionFilter.text );
335 SetIfPresent( aVal, "wires", m_SchSelectionFilter.wires );
336 SetIfPresent( aVal, "labels", m_SchSelectionFilter.labels );
337 SetIfPresent( aVal, "pins", m_SchSelectionFilter.pins );
338 SetIfPresent( aVal, "graphics", m_SchSelectionFilter.graphics );
339 SetIfPresent( aVal, "images", m_SchSelectionFilter.images );
340 SetIfPresent( aVal, "otherItems", m_SchSelectionFilter.otherItems );
341 },
342 {
343 { "lockedItems", false },
344 { "symbols", true },
345 { "text", true },
346 { "wires", true },
347 { "labels", true },
348 { "pins", true },
349 { "graphics", true },
350 { "images", true },
351 { "otherItems", true }
352 } ) );
353
354 registerMigration( 1, 2,
355 [&]()
356 {
362 std::string ptr( "board.visible_items" );
363
364 if( Contains( ptr ) )
365 {
366 if( At( ptr ).is_array() )
367 {
368 At( ptr ).push_back( LAYER_PADS - GAL_LAYER_ID_START );
369 At( ptr ).push_back( LAYER_ZONES - GAL_LAYER_ID_START );
370 }
371 else
372 {
373 At( "board" ).erase( "visible_items" );
374 }
375
376 m_wasMigrated = true;
377 }
378
379 return true;
380 } );
381
382 registerMigration( 2, 3,
383 [&]()
384 {
392 const std::map<int, int> offsets = {
393 { 22, 34 }, // LAYER_PAD_HOLEWALLS
394 { 23, 22 }, // LAYER_VIA_HOLES
395 { 24, 35 }, // LAYER_VIA_HOLEWALLS
396 { 25, 23 }, // LAYER_DRC_ERROR
397 { 26, 36 }, // LAYER_DRC_WARNING
398 { 27, 37 }, // LAYER_DRC_EXCLUSION
399 { 28, 38 }, // LAYER_MARKER_SHADOWS
400 { 29, 24 }, // LAYER_DRAWINGSHEET
401 { 30, 25 }, // LAYER_GP_OVERLAY
402 { 31, 26 }, // LAYER_SELECT_OVERLAY
403 { 32, 27 }, // LAYER_PCB_BACKGROUND
404 { 33, 28 }, // LAYER_CURSOR
405 { 34, 29 }, // LAYER_AUX_ITEM
406 { 35, 30 }, // LAYER_DRAW_BITMAPS
407 { 39, 32 }, // LAYER_PADS
408 { 40, 33 }, // LAYER_ZONES
409 };
410
411 std::string ptr( "board.visible_items" );
412
413 if( Contains( ptr ) && At( ptr ).is_array() )
414 {
415 nlohmann::json visible = nlohmann::json::array();
416
417 for( const nlohmann::json& val : At( ptr ) )
418 {
419 try
420 {
421 int layer = val.get<int>();
422
423 if( offsets.count( layer ) )
424 visible.push_back( offsets.at( layer ) );
425 else
426 visible.push_back( layer );
427 }
428 catch( ... )
429 {
430 // skip invalid value
431 }
432 }
433
434 At( "board" )["visible_items"] = visible;
435 m_wasMigrated = true;
436 }
437
438 return true;
439 } );
440
441 registerMigration( 3, 4,
442 [&]()
443 {
444 // Schema version 3 to 4: LAYER_FILLED_SHAPES added to visibility controls
445
446 std::string ptr( "board.visible_items" );
447
448 if( Contains( ptr ) )
449 {
450 if( At( ptr ).is_array() && !At( ptr ).empty() )
451 At( ptr ).push_back( LAYER_FILLED_SHAPES - GAL_LAYER_ID_START );
452 else
453 At( "board" ).erase( "visible_items" );
454
455 m_wasMigrated = true;
456 }
457
458 return true;
459 } );
460
461 registerMigration( 4, 5,
462 [&]()
463 {
464 // Schema version 5: use named render layers
465
466 std::string ptr( "board.visible_items" );
467
468 if( Contains( ptr ) && At( ptr ).is_array() )
469 {
470 std::vector<std::string> newLayers;
471
472 for( nlohmann::json& entry : At( ptr ) )
473 {
474 if( !entry.is_number_integer() )
475 continue;
476
477 if( std::optional<VISIBILITY_LAYER> vl =
479 {
480 newLayers.emplace_back( VisibilityLayerToString( *vl ) );
481 }
482 }
483
484 At( ptr ) = newLayers;
485 m_wasMigrated = true;
486 }
487
488 return true;
489 } );
490}
491
492
493bool PROJECT_LOCAL_SETTINGS::MigrateFromLegacy( wxConfigBase* aLegacyConfig )
494{
500 return true;
501}
502
503
504bool PROJECT_LOCAL_SETTINGS::SaveToFile( const wxString& aDirectory, bool aForce )
505{
506 wxASSERT( m_project );
507
508 Set( "meta.filename",
510
511 // Even if parameters were not modified, we should resave after migration
512 bool force = aForce || m_wasMigrated;
513
514 // If we're actually going ahead and doing the save, the flag that keeps code from doing the
515 // save should be cleared at this point.
516 m_wasMigrated = false;
517
518 return JSON_SETTINGS::SaveToFile( aDirectory, force );
519}
520
521
522bool PROJECT_LOCAL_SETTINGS::SaveAs( const wxString& aDirectory, const wxString& aFile )
523{
524 Set( "meta.filename", aFile + "." + FILEEXT::ProjectLocalSettingsFileExtension );
525 SetFilename( aFile );
526
527 // If we're actually going ahead and doing the save, the flag that keeps code from doing the
528 // save should be cleared at this point.
529 m_wasMigrated = false;
530
531 return JSON_SETTINGS::SaveToFile( aDirectory, true );
532}
533
534
536{
537 auto it = std::find_if( m_files.begin(), m_files.end(),
538 [&aFileName]( const PROJECT_FILE_STATE &a )
539 {
540 return a.fileName == aFileName;
541 } );
542
543 if( it != m_files.end() )
544 {
545 return &( *it );
546 }
547
548 return nullptr;
549}
550
551
552void PROJECT_LOCAL_SETTINGS::SaveFileState( const wxString& aFileName,
553 const WINDOW_SETTINGS* aWindowCfg, bool aOpen )
554{
555 auto it = std::find_if( m_files.begin(), m_files.end(),
556 [&aFileName]( const PROJECT_FILE_STATE& a )
557 {
558 return a.fileName == aFileName;
559 } );
560
561 if( it == m_files.end() )
562 {
563 PROJECT_FILE_STATE fileState;
564 fileState.fileName = aFileName;
565 fileState.open = false;
566 fileState.window.maximized = false;
567 fileState.window.size_x = -1;
568 fileState.window.size_y = -1;
569 fileState.window.pos_x = -1;
570 fileState.window.pos_y = -1;
571 fileState.window.display = 0;
572
573 m_files.push_back( fileState );
574
575 it = m_files.end() - 1;
576 }
577
578 ( *it ).window = aWindowCfg->state;
579 ( *it ).open = aOpen;
580}
581
582
584{
585 m_files.clear();
586}
@ NORMAL
Use all material properties from model file.
HIGH_CONTRAST_MODE
Determine how inactive layers should be displayed.
@ RATSNEST
Net/netclass colors are shown on ratsnest lines only.
int ParseHex(const std::string &str)
Convert the output of FmtHex() and replaces this set's values with those given in the input string.
Definition: base_set.h:348
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:393
GAL_SET & set()
Definition: layer_ids.h:409
std::vector< GAL_LAYER_ID > Seq() const
Definition: lset.cpp:762
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)
bool m_deleteLegacyAfterMigration
Whether or not to delete legacy file after migration.
void SetFilename(const wxString &aFilename)
Definition: json_settings.h:85
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:624
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
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.
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.
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:65
virtual const wxString GetProjectName() const
Return the short name of the project.
Definition: project.cpp:160
static bool empty(const wxTextEntryBase *aCtrl)
static const std::string ProjectLocalSettingsFileExtension
SETTINGS_LOC
Definition: json_settings.h:54
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:312
@ LAYER_ZONES
Control for copper zone opacity/visibility (color ignored).
Definition: layer_ids.h:294
@ LAYER_PADS
Meta control for all pads opacity/visibility (color ignored).
Definition: layer_ids.h:291
@ 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
std::vector< wxString > custom_group_rules
bool otherItems
Anything not fitting one of the above categories.
bool graphics
Graphic lines, shapes, polygons.
bool footprints
Allow selecting entire footprints.
bool text
Text (free or attached to a footprint)
bool lockedItems
Allow selecting locked items.
struct WINDOW_STATE window
Store the common settings that are saved and loaded for each window / frame.
Definition: app_settings.h:90
WINDOW_STATE state
Definition: app_settings.h:91
unsigned int display
Definition: app_settings.h:83