55
57
// Default values used to init a NETCLASS
56
static int DEFAULT_CLEARANCE;
57
static int DEFAULT_VIA_DRILL;
58
static int DEFAULT_UVIA_DRILL;
58
static const int DEFAULT_CLEARANCE;
59
static const int DEFAULT_VIA_DRILL;
60
static const int DEFAULT_UVIA_DRILL;
63
63
wxString m_Name; ///< Name of the net class
64
64
wxString m_Description; ///< what this NETCLASS is for.
66
typedef std::set<wxString> STRINGSET;
66
typedef std::set<wxString> STRINGSET;
68
68
STRINGSET m_Members; ///< names of NET members of this class
83
static const wxString Default; ///< the name of the default NETCLASS
83
static const wxChar Default[]; ///< the name of the default NETCLASS
87
87
* stuffs a NETCLASS instance with aParent, aName, and optionally the initialParameters
88
* @param aParent = the parent board
89
88
* @param aName = the name of this new netclass
90
* @param initialParameters is a NETCLASS to copy parameters from, or if
91
* NULL tells me to copy default settings from BOARD::m_designSettings.
93
NETCLASS( BOARD* aParent, const wxString& aName, const NETCLASS* initialParameters = NULL );
90
NETCLASS( const wxString& aName );
169
164
void SetClearance( int aClearance ) { m_Clearance = aClearance; }
171
166
int GetTrackWidth() const { return m_TrackWidth; }
172
int GetTrackMinWidth() const;
173
167
void SetTrackWidth( int aWidth ) { m_TrackWidth = aWidth; }
175
169
int GetViaDiameter() const { return m_ViaDia; }
176
int GetViaMinDiameter() const;
177
170
void SetViaDiameter( int aDia ) { m_ViaDia = aDia; }
179
172
int GetViaDrill() const { return m_ViaDrill; }
180
int GetViaMinDrill() const;
181
173
void SetViaDrill( int aSize ) { m_ViaDrill = aSize; }
183
175
int GetuViaDiameter() const { return m_uViaDia; }
184
int GetuViaMinDiameter() const;
185
176
void SetuViaDiameter( int aSize ) { m_uViaDia = aSize; }
187
178
int GetuViaDrill() const { return m_uViaDrill; }
188
int GetuViaMinDrill() const;
189
179
void SetuViaDrill( int aSize ) { m_uViaDrill = aSize; }
193
182
* Function SetParams
194
183
* will set all the parameters by copying them from \a defaults.
195
184
* Parameters are the values like m_ViaSize, etc, but do not include m_Description.
196
* @param defaults is another NETCLASS to copy from. If NULL, then copy
197
* from global preferences instead.
199
void SetParams( const NETCLASS* defaults = NULL );
185
* @param aDefaults is another NETCLASS object to copy from.
187
void SetParams( const NETCLASS& aDefaults );
191
* will set all the parameters by copying them from board design settings.
192
* @param aSettings is a BOARD_DESIGN_SETTINGS object to copy from. Clearance, via drill and
193
* microvia drill values are taken from the defaults.
195
void SetParams( const BOARD_DESIGN_SETTINGS& aSettings );
202
198
* Function Format
230
typedef std::map<wxString, NETCLASS*> NETCLASSMAP;
225
typedef std::map<wxString, NETCLASSPTR> NETCLASSMAP;
232
227
/// all the NETCLASSes except the default one.
233
228
NETCLASSMAP m_NetClasses;
235
230
/// the default NETCLASS.
231
NETCLASSPTR m_Default;
239
NETCLASSES( BOARD* aParent = NULL );
244
239
* destroys any contained NETCLASS instances except the Default one.
243
m_NetClasses.clear();
248
typedef NETCLASSMAP::iterator iterator;
246
typedef NETCLASSMAP::iterator iterator;
249
247
iterator begin() { return m_NetClasses.begin(); }
250
248
iterator end() { return m_NetClasses.end(); }
263
260
return m_NetClasses.size();
266
NETCLASS* GetDefault() const
264
* Function GetDefault
265
* @return the default net class.
267
NETCLASSPTR GetDefault() const
268
return (NETCLASS*) &m_Default;
275
276
* @return true if the name within aNetclass is unique and it could be inserted OK,
276
277
* else false because the name was not unique and caller still owns aNetclass.
278
bool Add( NETCLASS* aNetclass );
279
bool Add( NETCLASSPTR aNetclass );
281
282
* Function Remove
282
283
* removes a NETCLASS from this container but does not destroy/delete it.
283
284
* @param aNetName is the name of the net to delete, and it may not be NETCLASS::Default.
284
* @return NETCLASS* - the NETCLASS associated with aNetName if found and removed, else NULL.
285
* You have to delete the returned value if you intend to destroy the NETCLASS.
285
* @return NETCLASSPTR - the NETCLASS associated with aNetName if found and removed, else NULL.
287
NETCLASS* Remove( const wxString& aNetName );
287
NETCLASSPTR Remove( const wxString& aNetName );
291
291
* searches this container for a NETCLASS given by \a aName.
292
292
* @param aName is the name of the NETCLASS to search for.
293
* @return NETCLASS* - if found, else NULL.
293
* @return NETCLASSPTR - if found, else NULL.
295
NETCLASS* Find( const wxString& aName ) const;
295
NETCLASSPTR Find( const wxString& aName ) const;