38 m_AutoTrackWidth( true ),
40 m_TrackOpacity( 1.0 ),
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",
true },
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" );
275 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;
LSET m_VisibleLayers
Board settings.
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 otherItems
Anything not fitting one of the above categories.
std::vector< PARAM_BASE * > m_params
The list of parameters (owned by this object)
void SaveFileState(const wxString &aFileName, const WINDOW_SETTINGS *aWindowCfg, bool aOpen)
Container for project specific data.
const int projectLocalSettingsVersion
Like a normal param, but with custom getter and setter functions.
Ratsnest lines are drawn to items on visible layers only.
double m_TrackOpacity
Opacity override for all tracks.
Meta control for all pads opacity/visibility (color ignored)
ZONE_DISPLAY_MODE m_ZoneDisplayMode
How zones are drawn.
bool MigrateFromLegacy(wxConfigBase *aLegacyConfig) override
Migrates from wxConfig to JSON-based configuration.
Net/netclass colors are shown on all net copper.
Net/netclass colors are shown on ratsnest lines only.
double m_ViaOpacity
Opacity override for all types of via.
bool SaveToFile(const wxString &aDirectory="", bool aForce=false) override
Stores an enum as an integer.
NET_COLOR_MODE m_NetColorMode
The current net color mode.
PCB_LAYER_ID m_ActiveLayer
The current (active) board layer for editing.
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...
Control for copper zone opacity/visibility (color ignored)
Ratsnest lines are drawn to items on all layers (default)
bool m_deleteLegacyAfterMigration
Whether or not to delete legacy file after migration.
const std::string ProjectLocalSettingsFileExtension
double m_PadOpacity
Opacity override for SMD pads and PTH.
Stores the common settings that are saved and loaded for each window / frame.
virtual bool SaveToFile(const wxString &aDirectory="", bool aForce=false)
bool text
Text (free or attached to a footprint)
GAL_SET m_VisibleItems
The GAL layers (aka items) that are turned on for viewing (.
wxString m_ActiveLayerPreset
The name of a LAYER_PRESET that is currently activated (or blank if none)
bool dimensions
Dimension items.
bool keepouts
Keepout zones.
bool graphics
Graphic lines, shapes, polygons.
Use all material properties from model file.
static bool SetIfPresent(const nlohmann::json &aObj, const std::string &aPath, wxString &aTarget)
Sets the given string if the given key/path is present.
struct WINDOW_STATE window
PROJECT * m_project
A link to the owning project.
Inactive layers are shown normally (no high-contrast mode)
HIGH_CONTRAST_MODE
Determine how inactive layers should be displayed.
static GAL_SET DefaultVisible()
RATSNEST_MODE m_RatsnestMode
The current ratsnest draw mode.
static LSET AllLayersMask()
bool m_AutoTrackWidth
The current setting for whether to automatically adjust track widths to match.
bool tracks
Copper tracks.
double m_ZoneOpacity
Opacity override for filled zones.
bool footprints
Allow selecting entire footprints.
bool vias
Vias (all types>
const PROJECT_FILE_STATE * GetFileState(const wxString &aFileName)
bool lockedItems
Allow selecting locked items.
HIGH_CONTRAST_MODE m_ContrastModeDisplay
The current contrast mode.
void registerMigration(int aOldSchemaVersion, int aNewSchemaVersion, std::function< bool(void)> aMigrator)
Registers a migration from one schema version to another.
Net (and netclass) colors are not shown.
std::string FmtHex() const
Return a hex string showing contents of this LSEQ.
std::vector< wxString > m_HiddenNets
A list of netnames that have been manually hidden in the board editor.
SELECTION_FILTER_OPTIONS m_SelectionFilter
State of the selection filter widget.
virtual const wxString GetProjectName() const
Return the short name of the project.
bool SaveAs(const wxString &aDirectory, const wxString &aFile)
bool Contains(const std::string &aPath) const
PROJECT_LOCAL_SETTINGS(PROJECT *aProject, const wxString &aFilename)
Inactive layers are hidden.
void SetFilename(const wxString &aFilename)
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.
std::vector< PROJECT_FILE_STATE > m_files
Project scope.