KiCad PCB EDA Suite
project_local_settings.h
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  * @author Jon Evans <jon@craftyjon.com>
6  *
7  * This program is free software: you can redistribute it and/or modify it
8  * under the terms of the GNU General Public License as published by the
9  * Free Software Foundation, either version 3 of the License, or (at your
10  * option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along
18  * with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef KICAD_PROJECT_LOCAL_SETTINGS_H
22 #define KICAD_PROJECT_LOCAL_SETTINGS_H
23 
26 #include <settings/json_settings.h>
28 #include <settings/app_settings.h>
29 
30 class PROJECT;
31 
33 {
34  wxString fileName;
35  bool open;
37 };
38 
39 
53 {
54 public:
55  PROJECT_LOCAL_SETTINGS( PROJECT* aProject, const wxString& aFilename );
56 
58 
59  bool MigrateFromLegacy( wxConfigBase* aLegacyConfig ) override;
60 
61  bool SaveToFile( const wxString& aDirectory = "", bool aForce = false ) override;
62 
63  void SetProject( PROJECT* aProject )
64  {
65  m_project = aProject;
66  }
67 
68 protected:
69 
70  wxString getFileExt() const override
71  {
73  }
74 
75  wxString getLegacyFileExt() const override
76  {
77  return wxT( "NO_SUCH_FILE_EXTENSION" );
78  }
79 
80 private:
81 
84 
85 public:
86 
91  std::vector<PROJECT_FILE_STATE> m_files;
93 
100 
103 
106 
109 
112 
115 
118 
121 
124 
125  double m_TrackOpacity;
126  double m_ViaOpacity;
127  double m_PadOpacity;
128  double m_ZoneOpacity;
129 
134  std::vector<wxString> m_HiddenNets;
135 
138 
139  void SaveFileState( const wxString& aFileName, const WINDOW_SETTINGS* aWindowCfg, bool aOpen );
140 
141  const PROJECT_FILE_STATE* GetFileState( const wxString& aFileName );
142 
143  void ClearFileState();
144 };
145 
146 #endif
LSET m_VisibleLayers
Board settings.
void SaveFileState(const wxString &aFileName, const WINDOW_SETTINGS *aWindowCfg, bool aOpen)
Container for project specific data.
Definition: project.h:62
double m_TrackOpacity
Opacity override for all tracks.
wxString getLegacyFileExt() const override
ZONE_DISPLAY_MODE m_ZoneDisplayMode
How zones are drawn.
bool MigrateFromLegacy(wxConfigBase *aLegacyConfig) override
Migrates from wxConfig to JSON-based configuration.
The project local settings are things that are attached to a particular project, but also might be pa...
double m_ViaOpacity
Opacity override for all types of via.
bool SaveToFile(const wxString &aDirectory="", bool aForce=false) override
NET_COLOR_MODE m_NetColorMode
The current net color mode.
PCB_LAYER_ID m_ActiveLayer
The current (active) board layer for editing.
wxString getFileExt() const override
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.
Definition: app_settings.h:81
PCB_LAYER_ID
A quick note on layer IDs:
LSET is a set of PCB_LAYER_IDs.
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)
struct WINDOW_STATE window
PROJECT * m_project
A link to the owning project.
HIGH_CONTRAST_MODE
Determine how inactive layers should be displayed.
Helper for storing and iterating over GAL_LAYER_IDs.
Definition of file extensions used in Kicad.
RATSNEST_MODE m_RatsnestMode
The current ratsnest draw mode.
bool m_AutoTrackWidth
The current setting for whether to automatically adjust track widths to match.
This file contains data structures that are saved in the project file or project local settings file ...
double m_ZoneOpacity
Opacity override for filled zones.
Stores the window positioning/state.
Definition: app_settings.h:68
const PROJECT_FILE_STATE * GetFileState(const wxString &aFileName)
HIGH_CONTRAST_MODE m_ContrastModeDisplay
The current contrast mode.
Board layer functions and definitions.
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.
PROJECT_LOCAL_SETTINGS(PROJECT *aProject, const wxString &aFilename)
std::vector< PROJECT_FILE_STATE > m_files
Project scope.
void SetProject(PROJECT *aProject)