37 m_AutoTrackWidth( true ),
39 m_TrackOpacity( 1.0 ),
43 m_ImageOpacity( 0.6 ),
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 ) );
181 [&]() -> nlohmann::json
183 nlohmann::json ret = nlohmann::json::array();
188 file[
"name"] = fileState.fileName;
189 file[
"open"] = fileState.open;
191 nlohmann::json window;
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 );
206 [&](
const nlohmann::json& aVal )
208 if( !aVal.is_array() || aVal.empty() )
215 for(
const nlohmann::json& file : aVal )
230 m_files.push_back( fileState );
250 std::string ptr(
"board.visible_items" );
254 if(
At( ptr ).is_array() )
261 At(
"board" ).erase(
"visible_items" );
278 const std::map<int, int> offsets = {
297 std::string ptr(
"board.visible_items" );
301 nlohmann::json visible = nlohmann::json::array();
303 for(
const nlohmann::json& val :
At( ptr ) )
307 int layer = val.get<
int>();
309 if( offsets.count( layer ) )
310 visible.push_back( offsets.at( layer ) );
312 visible.push_back( layer );
320 At(
"board" )[
"visible_items"] = visible;
363 return a.fileName == aFileName;
381 return a.fileName == aFileName;
388 fileState.
open =
false;
396 m_files.push_back( fileState );
401 ( *it ).window = aWindowCfg->
state;
402 ( *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()
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...
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 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)
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.