37 m_AutoTrackWidth( true ),
39 m_TrackOpacity( 1.0 ),
43 m_ImageOpacity( 0.6 ),
44 m_PcbSelectionFilter(),
55 [&](
const std::string& aString )
62 [&]() -> nlohmann::json
64 nlohmann::json ret = nlohmann::json::array();
72 [&](
const nlohmann::json& aVal )
74 if( !aVal.is_array() || aVal.empty() )
82 for(
const nlohmann::json& entry : aVal )
86 int i = entry.get<
int>();
98 [&]() -> nlohmann::json
116 [&](
const nlohmann::json& aVal )
118 if( aVal.empty() || !aVal.is_object() )
134 {
"lockedItems",
false },
135 {
"footprints",
true },
140 {
"graphics",
true },
142 {
"keepouts",
true },
143 {
"dimensions",
true },
144 {
"otherItems",
true }
155 HIGH_CONTRAST_MODE::NORMAL, HIGH_CONTRAST_MODE::HIDDEN ) );
170 NET_COLOR_MODE::ALL ) );
177 ZONE_DISPLAY_MODE::SHOW_FILLED, ZONE_DISPLAY_MODE::SHOW_FILLED,
178 ZONE_DISPLAY_MODE::SHOW_TRIANGULATION ) );
205 m_params.emplace_back(
new PARAM<bool>(
"net_inspector_panel.show_zero_pad_nets",
206 &m_NetInspectorPanel.show_zero_pad_nets,
false ) );
207 m_params.emplace_back(
new PARAM<bool>(
"net_inspector_panel.show_unconnected_nets",
208 &m_NetInspectorPanel.show_unconnected_nets,
false ) );
209 m_params.emplace_back(
new PARAM<int>(
"net_inspector_panel.sorting_column",
210 &m_NetInspectorPanel.sorting_column, -1 ) );
211 m_params.emplace_back(
new PARAM<bool>(
"net_inspector_panel.sort_ascending",
212 &m_NetInspectorPanel.sort_order_asc,
true ) );
213 m_params.emplace_back(
new PARAM_LIST<int>(
"net_inspector_panel.col_order",
214 &m_NetInspectorPanel.col_order, {} ) );
215 m_params.emplace_back(
new PARAM_LIST<int>(
"net_inspector_panel.col_widths",
216 &m_NetInspectorPanel.col_widths, {} ) );
217 m_params.emplace_back(
new PARAM_LIST<bool>(
"net_inspector_panel.col_hidden",
218 &m_NetInspectorPanel.col_hidden, {} ) );
220 &m_NetInspectorPanel.expanded_rows, {} ) );
223 [&]() -> nlohmann::json
225 nlohmann::json ret = nlohmann::json::array();
230 file[
"name"] = fileState.fileName;
231 file[
"open"] = fileState.open;
233 nlohmann::json window;
234 window[
"maximized"] = fileState.window.maximized;
235 window[
"size_x"] = fileState.window.size_x;
236 window[
"size_y"] = fileState.window.size_y;
237 window[
"pos_x"] = fileState.window.pos_x;
238 window[
"pos_y"] = fileState.window.pos_y;
239 window[
"display"] = fileState.window.display;
241 file[
"window"] = window;
243 ret.push_back( file );
248 [&](
const nlohmann::json& aVal )
250 if( !aVal.is_array() || aVal.empty() )
257 for(
const nlohmann::json& file : aVal )
263 SetIfPresent( file,
"name", fileState.
fileName );
264 SetIfPresent( file,
"open", fileState.
open );
265 SetIfPresent( file,
"window.size_x", fileState.
window.
size_x );
266 SetIfPresent( file,
"window.size_y", fileState.
window.
size_y );
267 SetIfPresent( file,
"window.pos_x", fileState.
window.
pos_x );
268 SetIfPresent( file,
"window.pos_y", fileState.
window.
pos_y );
270 SetIfPresent( file,
"window.display", fileState.
window.
display );
272 m_files.push_back( fileState );
285 [&]() -> nlohmann::json
289 ret[
"lockedItems"] = m_SchSelectionFilter.lockedItems;
290 ret[
"symbols"] = m_SchSelectionFilter.symbols;
291 ret[
"text"] = m_SchSelectionFilter.text;
292 ret[
"wires"] = m_SchSelectionFilter.wires;
293 ret[
"labels"] = m_SchSelectionFilter.labels;
294 ret[
"pins"] = m_SchSelectionFilter.pins;
295 ret[
"graphics"] = m_SchSelectionFilter.graphics;
296 ret[
"images"] = m_SchSelectionFilter.images;
297 ret[
"otherItems"] = m_SchSelectionFilter.otherItems;
301 [&](
const nlohmann::json& aVal )
303 if( aVal.empty() || !aVal.is_object() )
306 SetIfPresent( aVal,
"lockedItems", m_SchSelectionFilter.lockedItems );
307 SetIfPresent( aVal,
"symbols", m_SchSelectionFilter.symbols );
308 SetIfPresent( aVal,
"text", m_SchSelectionFilter.text );
309 SetIfPresent( aVal,
"wires", m_SchSelectionFilter.wires );
310 SetIfPresent( aVal,
"labels", m_SchSelectionFilter.labels );
311 SetIfPresent( aVal,
"pins", m_SchSelectionFilter.pins );
312 SetIfPresent( aVal,
"graphics", m_SchSelectionFilter.graphics );
313 SetIfPresent( aVal,
"images", m_SchSelectionFilter.images );
314 SetIfPresent( aVal,
"otherItems", m_SchSelectionFilter.otherItems );
317 {
"lockedItems",
false },
323 {
"graphics",
true },
325 {
"otherItems",
true }
328 registerMigration( 1, 2,
336 std::string ptr(
"board.visible_items" );
338 if( Contains( ptr ) )
340 if( At( ptr ).is_array() )
347 At(
"board" ).erase(
"visible_items" );
354 registerMigration( 2, 3,
364 const std::map<int, int> offsets = {
383 std::string ptr(
"board.visible_items" );
385 if( Contains( ptr ) && At( ptr ).is_array() )
387 nlohmann::json visible = nlohmann::json::array();
389 for(
const nlohmann::json& val : At( ptr ) )
393 int layer = val.get<
int>();
395 if( offsets.count( layer ) )
396 visible.push_back( offsets.at( layer ) );
398 visible.push_back( layer );
406 At(
"board" )[
"visible_items"] = visible;
449 return a.fileName == aFileName;
467 return a.fileName == aFileName;
474 fileState.
open =
false;
482 m_files.push_back( fileState );
487 ( *it ).window = aWindowCfg->
state;
488 ( *it ).open = aOpen;
@ 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.
static GAL_SET DefaultVisible()
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)
virtual bool SaveToFile(const wxString &aDirectory="", bool aForce=false)
Calls Store() and then writes the contents of the JSON document to a file.
int ParseHex(const char *aStart, int aCount)
Convert the output of FmtHex() and replaces this set's values with those given in the input string.
static LSET AllLayersMask()
std::string FmtHex() const
Return a hex string showing contents of this LSEQ.
Stores an enum as an integer.
Like a normal param, but with custom getter and setter functions.
bool SaveAs(const wxString &aDirectory, const wxString &aFile)
LSET m_VisibleLayers
Board settings.
wxString m_GitRepoPassword
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.
wxString m_GitRepoUsername
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.
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.
virtual const wxString GetProjectName() const
Return the short name of the project.
static const std::string ProjectLocalSettingsFileExtension
constexpr PCB_LAYER_ID PCBNEW_LAYER_ID_START
@ LAYER_ZONES
Control for copper zone opacity/visibility (color ignored)
@ LAYER_PADS
Meta control for all pads opacity/visibility (color ignored)
const int projectLocalSettingsVersion
std::vector< wxString > custom_group_rules
bool otherItems
Anything not fitting one of the above categories.
bool vias
Vias (all types>
bool keepouts
Keepout zones.
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.
bool tracks
Copper tracks.
bool dimensions
Dimension items.
struct WINDOW_STATE window
Stores the common settings that are saved and loaded for each window / frame.