KiCad PCB EDA Suite
Loading...
Searching...
No Matches
tuning_profiles.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 The KiCad Developers, see AUTHORS.txt for contributors.
5 * @author Jon Evans <[email protected]>
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_TUNING_PROFILES_H
22#define KICAD_TUNING_PROFILES_H
23
25#include <layer_ids.h>
26
31{
37
54
56 {
58 return false;
59
60 if( m_SignalLayerTo != other.m_SignalLayerTo )
61 return false;
62
63 if( m_ViaLayerFrom != other.m_ViaLayerFrom )
64 return false;
65
66 if( m_ViaLayerTo != other.m_ViaLayerTo )
67 return false;
68
69 if( m_Delay != other.m_Delay )
70 return false;
71
72 return true;
73 }
74};
75
76class TUNING_PROFILES;
77
82{
83public:
84 friend class TUNING_PROFILES;
85
86 void SetSignalLayer( const PCB_LAYER_ID aLayer ) { m_signalLayer = aLayer; }
87 void SetTopReferenceLayer( const PCB_LAYER_ID aLayer ) { m_topReferenceLayer = aLayer; }
89
90 void SetWidth( const int aWidth ) { m_width = aWidth; }
91 void SetDiffPairGap( const int aDiffPairGap ) { m_diffPairGap = aDiffPairGap; }
92 void SetDelay( const int aDelay ) { m_delay = aDelay; }
93 void SetEnableTimeDomainTuning( bool aEnable ) { m_enableTimeDomainTuning = aEnable; }
94
98
99 int GetWidth() const { return m_width; }
100 int GetDiffPairGap() const { return m_diffPairGap; }
101 int GetDelay( const bool aForce = false ) const { return ( m_enableTimeDomainTuning || aForce ) ? m_delay : 0; }
102
104 {
105 if( m_signalLayer != other.m_signalLayer )
106 return false;
107
109 return false;
110
112 return false;
113
114 if( m_width != other.m_width )
115 return false;
116
117 if( m_diffPairGap != other.m_diffPairGap )
118 return false;
119
120 if( m_delay != other.m_delay )
121 return false;
122
124 return false;
125
126 return true;
127 }
128
129private:
133
134 int m_width{ 0 };
136 int m_delay{ 0 };
137
139};
140
141
146{
147 enum class PROFILE_TYPE
148 {
151 };
152
158 std::vector<DELAY_PROFILE_TRACK_PROPAGATION_ENTRY> m_TrackPropagationEntries;
160 std::vector<DELAY_PROFILE_VIA_OVERRIDE_ENTRY> m_ViaOverrides;
161
162 // This is not persisted - but is used for quick lookup for track statistics calculations
163 std::map<PCB_LAYER_ID, DELAY_PROFILE_TRACK_PROPAGATION_ENTRY> m_TrackPropagationEntriesMap;
164
165 bool operator==( const TUNING_PROFILE& aOther ) const
166 {
167 if( m_ProfileName != aOther.m_ProfileName )
168 return false;
169
170 if( m_Type != aOther.m_Type )
171 return false;
172
174 return false;
175
177 return false;
178
180 return false;
181
183 return false;
184
186 return false;
187
188 if( m_ViaOverrides != aOther.m_ViaOverrides )
189 return false;
190
191 return true;
192 }
193};
194
195
200{
201public:
202 TUNING_PROFILES( JSON_SETTINGS* aParent, const std::string& aPath );
203
204 virtual ~TUNING_PROFILES();
205
206 bool operator==( const TUNING_PROFILES& aOther ) const;
207
208 bool operator!=( const TUNING_PROFILES& aOther ) const { return !operator==( aOther ); }
209
211
212 void AddTuningProfile( TUNING_PROFILE&& aTraceEntry ) { m_tuningProfiles.emplace_back( std::move( aTraceEntry ) ); }
213
214 const std::vector<TUNING_PROFILE>& GetTuningProfiles() const { return m_tuningProfiles; }
215
216 TUNING_PROFILE& GetTuningProfile( wxString aProfileName );
217
218private:
219 std::vector<TUNING_PROFILE> m_tuningProfiles;
220
222};
223
224#endif // KICAD_TUNING_PROFILES_H
bool operator==(const wxAuiPaneInfo &aLhs, const wxAuiPaneInfo &aRhs)
Represents a single line in a time domain profile track propagation setup.
int GetDiffPairGap() const
void SetWidth(const int aWidth)
PCB_LAYER_ID m_bottomReferenceLayer
int m_delay
PCB_LAYER_ID GetTopReferenceLayer() const
int GetWidth() const
void SetEnableTimeDomainTuning(bool aEnable)
PCB_LAYER_ID m_topReferenceLayer
void SetDiffPairGap(const int aDiffPairGap)
void SetTopReferenceLayer(const PCB_LAYER_ID aLayer)
int GetDelay(const bool aForce=false) const
void SetSignalLayer(const PCB_LAYER_ID aLayer)
int m_diffPairGap
bool m_enableTimeDomainTuning
int m_width
void SetDelay(const int aDelay)
bool operator==(const DELAY_PROFILE_TRACK_PROPAGATION_ENTRY &other) const
void SetBottomReferenceLayer(const PCB_LAYER_ID aLayer)
PCB_LAYER_ID GetBottomReferenceLayer() const
friend class TUNING_PROFILES
PCB_LAYER_ID m_signalLayer
PCB_LAYER_ID GetSignalLayer() const
JSON_SETTINGS(const wxString &aFilename, SETTINGS_LOC aLocation, int aSchemaVersion)
NESTED_SETTINGS(const std::string &aName, int aSchemaVersion, JSON_SETTINGS *aParent, const std::string &aPath, bool aLoadFromFile=true)
TUNING_PROFILES stores the configuration for impedance / delay tuning profiles.
TUNING_PROFILE m_nullDelayProfile
void AddTuningProfile(TUNING_PROFILE &&aTraceEntry)
std::vector< TUNING_PROFILE > m_tuningProfiles
TUNING_PROFILES(JSON_SETTINGS *aParent, const std::string &aPath)
const std::vector< TUNING_PROFILE > & GetTuningProfiles() const
bool operator!=(const TUNING_PROFILES &aOther) const
#define KICOMMON_API
Definition kicommon.h:28
bool IsCopperLayerLowerThan(PCB_LAYER_ID aLayerA, PCB_LAYER_ID aLayerB)
Return true if copper aLayerA is placed lower than aLayerB, false otherwise.
Definition layer_ids.h:823
PCB_LAYER_ID
A quick note on layer IDs:
Definition layer_ids.h:60
@ UNDEFINED_LAYER
Definition layer_ids.h:61
Represents a single line in the time domain configuration via overrides configuration grid.
bool operator==(const DELAY_PROFILE_VIA_OVERRIDE_ENTRY &other) const
PCB_LAYER_ID m_SignalLayerFrom
bool operator<(const DELAY_PROFILE_VIA_OVERRIDE_ENTRY &other) const
PCB_LAYER_ID m_ViaLayerFrom
int m_Delay
PCB_LAYER_ID m_SignalLayerTo
PCB_LAYER_ID m_ViaLayerTo
Represents a single line in the tuning profile configuration grid.
bool m_GenerateNetClassDRCRules
std::map< PCB_LAYER_ID, DELAY_PROFILE_TRACK_PROPAGATION_ENTRY > m_TrackPropagationEntriesMap
std::vector< DELAY_PROFILE_VIA_OVERRIDE_ENTRY > m_ViaOverrides
PROFILE_TYPE m_Type
bool operator==(const TUNING_PROFILE &aOther) const
std::vector< DELAY_PROFILE_TRACK_PROPAGATION_ENTRY > m_TrackPropagationEntries