37 m_AutoTrackWidth( true ),
39 m_TrackOpacity( 1.0 ),
43 m_ImageOpacity( 0.6 ),
55 [&](
const std::string& aString )
74 if( !aVal.is_array() || aVal.empty() )
86 int i = entry.get<
int>();
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 }
188 file[
"name"] = fileState.fileName;
189 file[
"open"] = fileState.open;
192 window[
"maximized"] = fileState.window.maximized;
193 window[
"size_x"] = fileState.window.size_x;
194 window[
"size_y"] = fileState.window.size_y;
195 window[
"pos_x"] = fileState.window.pos_x;
196 window[
"pos_y"] = fileState.window.pos_y;
197 window[
"display"] = fileState.window.display;
199 file[
"window"] = window;
201 ret.push_back( file );
208 if( !aVal.is_array() || aVal.empty() )
228 m_files.push_back( fileState );
248 std::string ptr(
"board.visible_items" );
252 if(
At( ptr ).is_array() )
259 At(
"board" ).erase(
"visible_items" );
276 const std::map<int, int> offsets = {
295 std::string ptr(
"board.visible_items" );
305 int layer = val.get<
int>();
307 if( offsets.count( layer ) )
308 visible.push_back( offsets.at( layer ) );
310 visible.push_back( layer );
318 At(
"board" )[
"visible_items"] = visible;
361 return a.fileName == aFileName;
379 return a.fileName == aFileName;
386 fileState.
open =
false;
394 m_files.push_back( fileState );
399 ( *it ).window = aWindowCfg->
state;
400 ( *it ).open = aOpen;
@ NORMAL
Use all material properties from model file.
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.
static GAL_SET DefaultVisible()
bool Contains(const std::string &aPath) const
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)
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...
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)
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...
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.
SELECTION_FILTER_OPTIONS m_SelectionFilter
State of the selection filter widget.
double m_PadOpacity
Opacity override for SMD pads and PTH.
bool SaveToFile(const wxString &aDirectory="", bool aForce=false) override
std::vector< PROJECT_FILE_STATE > m_files
Project scope.
double m_ViaOpacity
Opacity override for all types of via.
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.
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.
const std::string ProjectLocalSettingsFileExtension
@ LAYER_ZONES
Control for copper zone opacity/visibility (color ignored)
@ LAYER_PADS
Meta control for all pads opacity/visibility (color ignored)
const int projectLocalSettingsVersion
struct WINDOW_STATE window
bool graphics
Graphic lines, shapes, polygons.
bool text
Text (free or attached to a footprint)
bool vias
Vias (all types>
bool lockedItems
Allow selecting locked items.
bool tracks
Copper tracks.
bool footprints
Allow selecting entire footprints.
bool keepouts
Keepout zones.
bool dimensions
Dimension items.
bool otherItems
Anything not fitting one of the above categories.
Stores the common settings that are saved and loaded for each window / frame.