KiCad PCB EDA Suite
specctra_import.cpp
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) 2007-2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
5  * Copyright (C) 2007 KiCad Developers, see change_log.txt for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
25 
26 /* This source is a complement to specctra.cpp and implements the import of
27  a specctra session file (*.ses), and import of a specctra design file
28  (*.dsn) file. The specification for the grammar of the specctra dsn file
29  used to develop this code is given here:
30  http://tech.groups.yahoo.com/group/kicad-users/files/ then file "specctra.pdf"
31  Also see the comments at the top of the specctra.cpp file itself.
32 */
33 
34 
35 #include <confirm.h> // DisplayError()
36 #include <gestfich.h> // EDA_FileSelector()
37 #include <pcb_edit_frame.h>
38 #include <locale_io.h>
39 #include <macros.h>
40 #include <board.h>
41 #include <footprint.h>
42 #include <track.h>
44 #include <view/view.h>
45 #include "specctra.h"
46 #include <math/util.h> // for KiROUND
47 #include <pcbnew_settings.h>
48 
49 using namespace DSN;
50 
51 
52 bool PCB_EDIT_FRAME::ImportSpecctraSession( const wxString& fullFileName )
53 {
54  // To avoid issues with undo/redo lists (dangling pointers)
55  // clear the lists
56  // todo: use undo/redo feature
57  ClearUndoRedoList();
58 
59  SPECCTRA_DB db;
60  LOCALE_IO toggle;
61 
62  try
63  {
64  db.LoadSESSION( fullFileName );
65  db.FromSESSION( GetBoard() );
66  }
67  catch( const IO_ERROR& ioe )
68  {
69  wxString msg = _( "Board may be corrupted, do not save it.\n Fix problem and try again" );
70 
71  wxString extra = ioe.What();
72 
73  DisplayErrorMessage( this, msg, extra);
74  return false;
75  }
76 
77  OnModify();
78 
79  GetBoard()->GetConnectivity()->Clear();
80  GetBoard()->GetConnectivity()->Build( GetBoard() );
81 
82  if( GetCanvas() ) // Update view:
83  {
84  // Update footprint positions
85  GetCanvas()->GetView()->RecacheAllItems();
86 
87  // add imported tracks (previous tracks are removed, therfore all are new)
88  for( auto track : GetBoard()->Tracks() )
89  GetCanvas()->GetView()->Add( track );
90  }
91 
92  SetStatusText( wxString( _( "Session file imported and merged OK." ) ) );
93 
94  Refresh();
95 
96  return true;
97 }
98 
99 
100 namespace DSN {
101 
102 
111 static int scale( double distance, UNIT_RES* aResolution )
112 {
113  double resValue = aResolution->GetValue();
114  double factor;
115 
116  switch( aResolution->GetEngUnits() )
117  {
118  default:
119  case T_inch:
120  factor = 25.4e6; // nanometers per inch
121  break;
122  case T_mil:
123  factor = 25.4e3; // nanometers per mil
124  break;
125  case T_cm:
126  factor = 1e7; // nanometers per cm
127  break;
128  case T_mm:
129  factor = 1e6; // nanometers per mm
130  break;
131  case T_um:
132  factor = 1e3; // nanometers per um
133  break;
134  }
135 
136  int ret = KiROUND( factor * distance / resValue );
137 
138  return ret;
139 }
140 
141 
150 static wxPoint mapPt( const POINT& aPoint, UNIT_RES* aResolution )
151 {
152  wxPoint ret( scale( aPoint.x, aResolution ),
153  -scale( aPoint.y, aResolution ) ); // negate y
154 
155  return ret;
156 }
157 
158 
159 TRACK* SPECCTRA_DB::makeTRACK( PATH* aPath, int aPointIndex, int aNetcode )
160 {
161  int layerNdx = findLayerName( aPath->layer_id );
162 
163  if( layerNdx == -1 )
164  {
165  wxString layerName = FROM_UTF8( aPath->layer_id.c_str() );
167  wxString::Format( _( "Session file uses invalid layer id \"%s\"" ), layerName ) );
168  }
169 
170  TRACK* track = new TRACK( m_sessionBoard );
171 
172  track->SetStart( mapPt( aPath->points[aPointIndex+0], m_routeResolution ) );
173  track->SetEnd( mapPt( aPath->points[aPointIndex+1], m_routeResolution ) );
174  track->SetLayer( m_pcbLayer2kicad[layerNdx] );
175  track->SetWidth( scale( aPath->aperture_width, m_routeResolution ) );
176  track->SetNetCode( aNetcode );
177 
178  return track;
179 }
180 
181 
182 ::VIA* SPECCTRA_DB::makeVIA( PADSTACK* aPadstack, const POINT& aPoint,
183  int aNetCode, int aViaDrillDefault )
184 {
185  ::VIA* via = 0;
186  SHAPE* shape;
187 
188  int shapeCount = aPadstack->Length();
189  int drill_diam_iu = -1;
190  int copperLayerCount = m_sessionBoard->GetCopperLayerCount();
191 
192 
193  // The drill diameter is encoded in the padstack name if Pcbnew did the DSN export.
194  // It is after the colon and before the last '_'
195  int drillStartNdx = aPadstack->padstack_id.find( ':' );
196 
197  if( drillStartNdx != -1 )
198  {
199  ++drillStartNdx; // skip over the ':'
200 
201  int drillEndNdx = aPadstack->padstack_id.rfind( '_' );
202  if( drillEndNdx != -1 )
203  {
204  std::string diam_txt( aPadstack->padstack_id,
205  drillStartNdx, drillEndNdx-drillStartNdx );
206 
207  double drill_um = strtod( diam_txt.c_str(), 0 );
208 
209  drill_diam_iu = int( drill_um * (IU_PER_MM / 1000.0) );
210 
211  if( drill_diam_iu == aViaDrillDefault )
212  drill_diam_iu = UNDEFINED_DRILL_DIAMETER;
213  }
214  }
215 
216  if( shapeCount == 0 )
217  {
218  THROW_IO_ERROR( _( "Session via padstack has no shapes" ) );
219  }
220  else if( shapeCount == 1 )
221  {
222  shape = (SHAPE*) (*aPadstack)[0];
223  DSN_T type = shape->shape->Type();
224  if( type != T_circle )
226  wxString::Format( _( "Unsupported via shape: %s" ), GetTokenString( type ) ) );
227 
228  CIRCLE* circle = (CIRCLE*) shape->shape;
229  int viaDiam = scale( circle->diameter, m_routeResolution );
230 
231  via = new ::VIA( m_sessionBoard );
232  via->SetPosition( mapPt( aPoint, m_routeResolution ) );
233  via->SetDrill( drill_diam_iu );
234  via->SetViaType( VIATYPE::THROUGH );
235  via->SetWidth( viaDiam );
236  via->SetLayerPair( F_Cu, B_Cu );
237  }
238  else if( shapeCount == copperLayerCount )
239  {
240  shape = (SHAPE*) (*aPadstack)[0];
241  DSN_T type = shape->shape->Type();
242  if( type != T_circle )
244  wxString::Format( _( "Unsupported via shape: %s" ), GetTokenString( type ) ) );
245 
246  CIRCLE* circle = (CIRCLE*) shape->shape;
247  int viaDiam = scale( circle->diameter, m_routeResolution );
248 
249  via = new ::VIA( m_sessionBoard );
250  via->SetPosition( mapPt( aPoint, m_routeResolution ) );
251  via->SetDrill( drill_diam_iu );
252  via->SetViaType( VIATYPE::THROUGH );
253  via->SetWidth( viaDiam );
254  via->SetLayerPair( F_Cu, B_Cu );
255  }
256  else // VIA_MICROVIA or VIA_BLIND_BURIED
257  {
258  int topLayerNdx = -1; // session layer detectors
259  int botLayerNdx = INT_MAX;
260 
261  int viaDiam = -1;
262 
263  for( int i=0; i<shapeCount; ++i )
264  {
265  shape = (SHAPE*) (*aPadstack)[i];
266  DSN_T type = shape->shape->Type();
267  if( type != T_circle )
269  _( "Unsupported via shape: %s" ), GetTokenString( type ) ) );
270 
271  CIRCLE* circle = (CIRCLE*) shape->shape;
272 
273  int layerNdx = findLayerName( circle->layer_id );
274  if( layerNdx == -1 )
275  {
276  wxString layerName = FROM_UTF8( circle->layer_id.c_str() );
278  _( "Session file uses invalid layer id \"%s\"" ), layerName ) );
279  }
280 
281  if( layerNdx > topLayerNdx )
282  topLayerNdx = layerNdx;
283 
284  if( layerNdx < botLayerNdx )
285  botLayerNdx = layerNdx;
286 
287  if( viaDiam == -1 )
288  viaDiam = scale( circle->diameter, m_routeResolution );
289  }
290 
291  via = new ::VIA( m_sessionBoard );
292  via->SetPosition( mapPt( aPoint, m_routeResolution ) );
293  via->SetDrill( drill_diam_iu );
294 
295  if( (topLayerNdx==0 && botLayerNdx==1)
296  || (topLayerNdx==copperLayerCount-2 && botLayerNdx==copperLayerCount-1))
297  via->SetViaType( VIATYPE::MICROVIA );
298  else
299  via->SetViaType( VIATYPE::BLIND_BURIED );
300 
301  via->SetWidth( viaDiam );
302 
303  PCB_LAYER_ID topLayer = m_pcbLayer2kicad[topLayerNdx];
304  PCB_LAYER_ID botLayer = m_pcbLayer2kicad[botLayerNdx];
305 
306  via->SetLayerPair( topLayer, botLayer );
307  }
308 
309  wxASSERT( via );
310 
311  via->SetNetCode( aNetCode );
312  return via;
313 }
314 
315 
316 // no UI code in this function, throw exception to report problems to the
317 // UI handler: void PCB_EDIT_FRAME::ImportSpecctraSession( wxCommandEvent& event )
318 
320 {
321  m_sessionBoard = aBoard; // not owned here
322 
323  if( !m_session )
324  THROW_IO_ERROR( _("Session file is missing the \"session\" section") );
325 
326  if( !m_session->route )
327  THROW_IO_ERROR( _("Session file is missing the \"routes\" section") );
328 
329  if( !m_session->route->library )
330  THROW_IO_ERROR( _("Session file is missing the \"library_out\" section") );
331 
332  // delete all the old tracks and vias
333  aBoard->Tracks().clear();
334 
335  aBoard->DeleteMARKERs();
336 
337  buildLayerMaps( aBoard );
338 
339  if( m_session->placement )
340  {
341  // Walk the PLACEMENT object's COMPONENTs list, and for each PLACE within
342  // each COMPONENT, reposition and re-orient each component and put on
343  // correct side of the board.
344  COMPONENTS& components = m_session->placement->components;
345  for( COMPONENTS::iterator comp=components.begin(); comp!=components.end(); ++comp )
346  {
347  PLACES& places = comp->places;
348  for( unsigned i=0; i<places.size(); ++i )
349  {
350  PLACE* place = &places[i]; // '&' even though places[] holds a pointer!
351 
352  wxString reference = FROM_UTF8( place->component_id.c_str() );
353  FOOTPRINT* footprint = aBoard->FindFootprintByReference( reference );
354 
355  if( !footprint )
356  {
357  THROW_IO_ERROR( wxString::Format( _( "Reference '%s' not found." ),
358  reference ) );
359  }
360 
361  if( !place->hasVertex )
362  continue;
363 
364  UNIT_RES* resolution = place->GetUnits();
365  wxASSERT( resolution );
366 
367  wxPoint newPos = mapPt( place->vertex, resolution );
368  footprint->SetPosition( newPos );
369 
370  if( place->side == T_front )
371  {
372  // convert from degrees to tenths of degrees used in KiCad.
373  int orientation = KiROUND( place->rotation * 10.0 );
374 
375  if( footprint->GetLayer() != F_Cu )
376  {
377  // footprint is on copper layer (back)
378  footprint->Flip( footprint->GetPosition(), false );
379  }
380 
381  footprint->SetOrientation( orientation );
382  }
383  else if( place->side == T_back )
384  {
385  int orientation = KiROUND( (place->rotation + 180.0) * 10.0 );
386 
387  if( footprint->GetLayer() != B_Cu )
388  {
389  // footprint is on component layer (front)
390  footprint->Flip( footprint->GetPosition(), false );
391  }
392 
393  footprint->SetOrientation( orientation );
394  }
395  else
396  {
397  // as I write this, the PARSER *is* catching this, so we should never see below:
398  wxFAIL_MSG( wxT("DSN::PARSER did not catch an illegal side := 'back|front'") );
399  }
400  }
401  }
402  }
403 
405 
406  // Walk the NET_OUTs and create tracks and vias anew.
407  NET_OUTS& net_outs = m_session->route->net_outs;
408  for( NET_OUTS::iterator net = net_outs.begin(); net!=net_outs.end(); ++net )
409  {
410  int netoutCode = 0;
411 
412  // page 143 of spec says wire's net_id is optional
413  if( net->net_id.size() )
414  {
415  wxString netName = FROM_UTF8( net->net_id.c_str() );
416  NETINFO_ITEM* netinfo = aBoard->FindNet( netName );
417 
418  if( netinfo )
419  {
420  netoutCode = netinfo->GetNetCode();
421  }
422  else // else netCode remains 0
423  {
424  // int breakhere = 1;
425  }
426  }
427 
428  WIRES& wires = net->wires;
429  for( unsigned i = 0; i<wires.size(); ++i )
430  {
431  WIRE* wire = &wires[i];
432  DSN_T shape = wire->shape->Type();
433 
434  if( shape != T_path )
435  {
436  /* shape == T_polygon is expected from freerouter if you have
437  a zone on a non "power" type layer, i.e. a T_signal layer
438  and the design does a round trip back in as session here.
439  We kept our own zones in the BOARD, so ignore this so called
440  'wire'.
441 
442  wxString netId = FROM_UTF8( wire->net_id.c_str() );
443  THROW_IO_ERROR( wxString::Format( _("Unsupported wire shape: \"%s\" for net: \"%s\""),
444  DLEX::GetTokenString(shape).GetData(),
445  netId.GetData()
446  ) );
447  */
448  }
449  else
450  {
451  PATH* path = (PATH*) wire->shape;
452  for( unsigned pt=0; pt<path->points.size()-1; ++pt )
453  {
454  TRACK* track = makeTRACK( path, pt, netoutCode );
455  aBoard->Add( track );
456  }
457  }
458  }
459 
460  WIRE_VIAS& wire_vias = net->wire_vias;
461  LIBRARY& library = *m_session->route->library;
462  for( unsigned i=0; i<wire_vias.size(); ++i )
463  {
464  int netCode = 0;
465 
466  // page 144 of spec says wire_via's net_id is optional
467  if( net->net_id.size() )
468  {
469  wxString netName = FROM_UTF8( net->net_id.c_str() );
470  NETINFO_ITEM* netvia = aBoard->FindNet( netName );
471 
472  if( netvia )
473  netCode = netvia->GetNetCode();
474 
475  // else netCode remains 0
476  }
477 
478  WIRE_VIA* wire_via = &wire_vias[i];
479 
480  // example: (via Via_15:8_mil 149000 -71000 )
481 
482  PADSTACK* padstack = library.FindPADSTACK( wire_via->GetPadstackId() );
483  if( !padstack )
484  {
485  // Dick Feb 29, 2008:
486  // Freerouter has a bug where it will not round trip all vias.
487  // Vias which have a (use_via) element will be round tripped.
488  // Vias which do not, don't come back in in the session library,
489  // even though they may be actually used in the pre-routed,
490  // protected wire_vias. So until that is fixed, create the
491  // padstack from its name as a work around.
492 
493 
494  // Could use a STRING_FORMATTER here and convert the entire
495  // wire_via to text and put that text into the exception.
496  wxString psid( FROM_UTF8( wire_via->GetPadstackId().c_str() ) );
497 
499  _( "A wire_via references a missing padstack \"%s\"" ), psid ) );
500  }
501 
502  NETCLASSPTR netclass = aBoard->GetDesignSettings().GetNetClasses().GetDefault();
503 
504  int via_drill_default = netclass->GetViaDrill();
505 
506  for( unsigned v=0; v<wire_via->vertexes.size(); ++v )
507  {
508  ::VIA* via = makeVIA( padstack, wire_via->vertexes[v], netCode, via_drill_default );
509  aBoard->Add( via );
510  }
511  }
512  }
513 }
514 
515 
516 } // namespace DSN
void LoadSESSION(const wxString &aFilename)
Function LoadSESSION is a recursive descent parser for a SPECCTRA DSN "session" file.
Definition: specctra.cpp:262
VIA corresponds to the <via_descriptor> in the specctra dsn spec.
Definition: specctra.h:1024
NETINFO_ITEM * FindNet(int aNetcode) const
Search for a net with the given netcode.
Definition: board.cpp:1268
TRACK * makeTRACK(PATH *aPath, int aPointIndex, int aNetcode)
Function makeTRACK creates a TRACK form the PATH and BOARD info.
void buildLayerMaps(BOARD *aBoard)
Function buildLayerMaps creates a few data translation structures for layer name and number mapping b...
Definition: specctra.cpp:74
BOARD * m_sessionBoard
a copy to avoid passing as an argument, memory for it is not owned here.
Definition: specctra.h:3655
DSN::T DSN_T
Definition: specctra.h:46
static wxString FROM_UTF8(const char *cstring)
Convert a UTF8 encoded C string to a wxString for all wxWidgets build modes.
Definition: macros.h:110
This source file implements export and import capabilities to the specctra dsn file format.
Definition: specctra.cpp:62
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
Definition: confirm.cpp:266
This file is part of the common library TODO brief description.
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
Definition: locale_io.h:40
double y
Definition: specctra.h:96
virtual void SetLayer(PCB_LAYER_ID aLayer)
Set the layer this item is on.
Definition: board_item.h:194
This file is part of the common library.
void SetEnd(const wxPoint &aEnd)
Definition: track.h:112
boost::ptr_vector< WIRE_VIA > WIRE_VIAS
Definition: specctra.h:3112
static constexpr double IU_PER_MM
Mock up a conversion function.
NET_OUTS net_outs
Definition: specctra.h:3448
static POINT mapPt(const wxPoint &pt)
Function mapPt converts a KiCad point into a DSN file point.
POINTS vertexes
Definition: specctra.h:2988
UNIT_RES is a holder for either a T_unit or T_resolution object which are usually mutually exclusive ...
Definition: specctra.h:400
bool SetNetCode(int aNetCode, bool aNoAssert)
Set net using a net code.
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.h:591
double x
Definition: specctra.h:95
boost::ptr_vector< NET_OUT > NET_OUTS
Definition: specctra.h:3437
DSN_T GetEngUnits() const
Definition: specctra.h:422
std::string layer_id
Definition: specctra.h:582
int GetValue() const
Definition: specctra.h:423
This file contains miscellaneous commonly used macros and functions.
void SetWidth(int aWidth)
Definition: track.h:109
POINT vertex
Definition: specctra.h:1685
int findLayerName(const std::string &aLayerName) const
Function findLayerName returns the PCB layer index for a given layer name, within the specctra sessio...
Definition: specctra.cpp:124
#define UNDEFINED_DRILL_DIAMETER
Definition: track.h:77
PATH supports both the <path_descriptor> and the <polygon_descriptor> per the specctra dsn spec.
Definition: specctra.h:578
double rotation
Definition: specctra.h:1682
bool hasVertex
Definition: specctra.h:1684
ELEM * shape
Definition: specctra.h:2884
UNIT_RES * GetUnits() const override
Function GetUnits returns the units for this section.
Definition: specctra.h:3470
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT) override
Adds an item to the container.
Definition: board.cpp:563
PCB_LAYER_ID
A quick note on layer IDs:
PADSTACK * FindPADSTACK(const std::string &aPadstackId)
Function FindPADSTACK searches the padstack container by name.
Definition: specctra.h:2408
Normal via.
Definition: router_tool.cpp:67
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:29
void Refresh()
Update the board display after modifying it by a python script (note: it is automatically called by a...
void DeleteMARKERs()
Delete all MARKERS from the board.
Definition: board.cpp:760
boost::ptr_vector< COMPONENT > COMPONENTS
Definition: specctra.h:1799
DSN_T side
Definition: specctra.h:1680
PLACE implements the <placement_reference> in the specctra dsn spec.
Definition: specctra.h:1674
LIBRARY * library
Definition: specctra.h:3447
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Return a list of missing connections between components/tracks.
Definition: board.h:414
::VIA * makeVIA(PADSTACK *aPadstack, const POINT &aPoint, int aNetCode, int aViaDrillDefault)
Function makeVIA instantiates a KiCad VIA on the heap and initializes it with internal values consist...
std::string component_id
reference designator
Definition: specctra.h:1678
PADSTACK holds either a via or a pad definition.
Definition: specctra.h:2114
NETCLASSES & GetNetClasses() const
SPECCTRA_DB holds a DSN data tree, usually coming from a DSN file.
Definition: specctra.h:3632
static float distance(const SFVEC2UI &a, const SFVEC2UI &b)
std::string layer_id
Definition: specctra.h:732
BOARD * GetBoard()
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
UNIT_RES * m_routeResolution
used during FromSESSION() only, memory for it is not owned here.
Definition: specctra.h:3652
SHAPE corresponds to the "(shape ..)" element in the specctra dsn spec.
Definition: specctra.h:1878
PLACEMENT * placement
Definition: specctra.h:3568
const std::string & GetPadstackId()
Definition: specctra.h:3008
Handle the data for a net.
Definition: netinfo.h:64
bool ImportSpecctraSession(const wxString &aFullFilename)
Import a specctra *.ses file and use it to relocate MODULEs and to replace all vias and tracks in an ...
LIBRARY corresponds to the <library_descriptor> in the specctra dsn specification.
Definition: specctra.h:2251
std::vector< PCB_LAYER_ID > m_pcbLayer2kicad
maps PCB layer number to BOARD layer numbers
Definition: specctra.h:3649
Struct POINT is a holder for a point in the SPECCTRA DSN coordinate system.
Definition: specctra.h:93
WIRE corresponds to <wire_shape_descriptor> in the specctra dsn spec.
Definition: specctra.h:2873
boost::ptr_vector< PLACE > PLACES
Definition: specctra.h:1747
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:190
DSN_T Type() const
Definition: specctra.h:230
POINTS points
Definition: specctra.h:585
#define _(s)
Definition: 3d_actions.cpp:33
int GetCopperLayerCount() const
Definition: board.cpp:435
SESSION * m_session
Definition: specctra.h:3638
static double scale(int kicadDist)
Function scale converts a distance from PCBNEW internal units to the reported specctra dsn units in f...
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: util.h:68
double aperture_width
Definition: specctra.h:583
std::string padstack_id
Definition: specctra.h:2120
ROUTE * route
Definition: specctra.h:3570
virtual UNIT_RES * GetUnits() const
Function GetUnits returns the units for this section.
Definition: specctra.cpp:3510
ELEM * shape
Definition: specctra.h:846
NETCLASSPTR GetDefault() const
Definition: netclass.h:253
boost::ptr_vector< WIRE > WIRES
Definition: specctra.h:2976
void SetStart(const wxPoint &aStart)
Definition: track.h:115
WIRE_VIA corresponds to <wire_via_descriptor> in the specctra dsn spec.
Definition: specctra.h:2983
void FromSESSION(BOARD *aBoard)
Function FromSESSION adds the entire SESSION info to a BOARD but does not write it out.
int Length() const
Function Length returns the number of ELEMs in this ELEM.
Definition: specctra.h:315
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
Definition: ki_exception.h:75
#define THROW_IO_ERROR(msg)
Definition: ki_exception.h:38
COMPONENTS components
Definition: specctra.h:1810
TRACKS & Tracks()
Definition: board.h:300
Definition: track.h:83
FOOTPRINT * FindFootprintByReference(const wxString &aReference) const
Search for a FOOTPRINT within this board with the given reference designator.
Definition: board.cpp:1289
double diameter
Definition: specctra.h:734
int GetNetCode() const
Definition: netinfo.h:113