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 <macros.h>
39 #include <class_board.h>
40 #include <class_module.h>
41 #include <class_edge_mod.h>
42 #include <class_track.h>
43 #include <class_zone.h>
44 #include <class_drawsegment.h>
46 #include <view/view.h>
47 #include "specctra.h"
48 #include <math/util.h> // for KiROUND
49 #include <pcbnew_settings.h>
50 
51 using namespace DSN;
52 
53 
54 bool PCB_EDIT_FRAME::ImportSpecctraSession( const wxString& fullFileName )
55 {
56  // To avoid issues with undo/redo lists (dangling pointers)
57  // clear the lists
58  // todo: use undo/redo feature
59  ClearUndoRedoList();
60 
61  SPECCTRA_DB db;
62  LOCALE_IO toggle;
63 
64  try
65  {
66  db.LoadSESSION( fullFileName );
67  db.FromSESSION( GetBoard() );
68  }
69  catch( const IO_ERROR& ioe )
70  {
71  wxString msg = _( "Board may be corrupted, do not save it.\n Fix problem and try again" );
72 
73  wxString extra = ioe.What();
74 
75  DisplayErrorMessage( this, msg, extra);
76  return false;
77  }
78 
79  OnModify();
80 
81  GetBoard()->GetConnectivity()->Clear();
82  GetBoard()->GetConnectivity()->Build( GetBoard() );
83 
84  if( GetCanvas() ) // Update view:
85  {
86  // Update footprint positions
87  GetCanvas()->GetView()->RecacheAllItems();
88 
89  // add imported tracks (previous tracks are removed, therfore all are new)
90  for( auto track : GetBoard()->Tracks() )
91  GetCanvas()->GetView()->Add( track );
92  }
93 
94  SetStatusText( wxString( _( "Session file imported and merged OK." ) ) );
95 
96  Refresh();
97 
98  return true;
99 }
100 
101 
102 namespace DSN {
103 
104 
113 static int scale( double distance, UNIT_RES* aResolution )
114 {
115  double resValue = aResolution->GetValue();
116  double factor;
117 
118  switch( aResolution->GetEngUnits() )
119  {
120  default:
121  case T_inch:
122  factor = 25.4e6; // nanometers per inch
123  break;
124  case T_mil:
125  factor = 25.4e3; // nanometers per mil
126  break;
127  case T_cm:
128  factor = 1e7; // nanometers per cm
129  break;
130  case T_mm:
131  factor = 1e6; // nanometers per mm
132  break;
133  case T_um:
134  factor = 1e3; // nanometers per um
135  break;
136  }
137 
138  int ret = KiROUND( factor * distance / resValue );
139 
140  return ret;
141 }
142 
143 
152 static wxPoint mapPt( const POINT& aPoint, UNIT_RES* aResolution )
153 {
154  wxPoint ret( scale( aPoint.x, aResolution ),
155  -scale( aPoint.y, aResolution ) ); // negate y
156 
157  return ret;
158 }
159 
160 
161 TRACK* SPECCTRA_DB::makeTRACK( PATH* aPath, int aPointIndex, int aNetcode )
162 {
163  int layerNdx = findLayerName( aPath->layer_id );
164 
165  if( layerNdx == -1 )
166  {
167  wxString layerName = FROM_UTF8( aPath->layer_id.c_str() );
168  THROW_IO_ERROR( wxString::Format( _("Session file uses invalid layer id \"%s\""),
169  GetChars( layerName ) ) );
170  }
171 
172  TRACK* track = new TRACK( sessionBoard );
173 
174  track->SetStart( mapPt( aPath->points[aPointIndex+0], routeResolution ) );
175  track->SetEnd( mapPt( aPath->points[aPointIndex+1], routeResolution ) );
176  track->SetLayer( pcbLayer2kicad[layerNdx] );
177  track->SetWidth( scale( aPath->aperture_width, routeResolution ) );
178  track->SetNetCode( aNetcode );
179 
180  return track;
181 }
182 
183 
184 ::VIA* SPECCTRA_DB::makeVIA( PADSTACK* aPadstack, const POINT& aPoint,
185  int aNetCode, int aViaDrillDefault )
186 {
187  ::VIA* via = 0;
188  SHAPE* shape;
189 
190  int shapeCount = aPadstack->Length();
191  int drill_diam_iu = -1;
192  int copperLayerCount = sessionBoard->GetCopperLayerCount();
193 
194 
195  // The drill diameter is encoded in the padstack name if Pcbnew did the DSN export.
196  // It is after the colon and before the last '_'
197  int drillStartNdx = aPadstack->padstack_id.find( ':' );
198 
199  if( drillStartNdx != -1 )
200  {
201  ++drillStartNdx; // skip over the ':'
202 
203  int drillEndNdx = aPadstack->padstack_id.rfind( '_' );
204  if( drillEndNdx != -1 )
205  {
206  std::string diam_txt( aPadstack->padstack_id,
207  drillStartNdx, drillEndNdx-drillStartNdx );
208 
209  double drill_um = strtod( diam_txt.c_str(), 0 );
210 
211  drill_diam_iu = int( drill_um * (IU_PER_MM / 1000.0) );
212 
213  if( drill_diam_iu == aViaDrillDefault )
214  drill_diam_iu = UNDEFINED_DRILL_DIAMETER;
215  }
216  }
217 
218  if( shapeCount == 0 )
219  {
220  THROW_IO_ERROR( _( "Session via padstack has no shapes" ) );
221  }
222  else if( shapeCount == 1 )
223  {
224  shape = (SHAPE*) (*aPadstack)[0];
225  DSN_T type = shape->shape->Type();
226  if( type != T_circle )
227  THROW_IO_ERROR( wxString::Format( _( "Unsupported via shape: %s"),
228  GetChars( GetTokenString( type ) ) ) );
229 
230  CIRCLE* circle = (CIRCLE*) shape->shape;
231  int viaDiam = scale( circle->diameter, routeResolution );
232 
233  via = new ::VIA( sessionBoard );
234  via->SetPosition( mapPt( aPoint, routeResolution ) );
235  via->SetDrill( drill_diam_iu );
236  via->SetViaType( VIATYPE::THROUGH );
237  via->SetWidth( viaDiam );
238  via->SetLayerPair( F_Cu, B_Cu );
239  }
240  else if( shapeCount == copperLayerCount )
241  {
242  shape = (SHAPE*) (*aPadstack)[0];
243  DSN_T type = shape->shape->Type();
244  if( type != T_circle )
245  THROW_IO_ERROR( wxString::Format( _( "Unsupported via shape: %s"),
246  GetChars( GetTokenString( type ) ) ) );
247 
248  CIRCLE* circle = (CIRCLE*) shape->shape;
249  int viaDiam = scale( circle->diameter, routeResolution );
250 
251  via = new ::VIA( sessionBoard );
252  via->SetPosition( mapPt( aPoint, routeResolution ) );
253  via->SetDrill( drill_diam_iu );
254  via->SetViaType( VIATYPE::THROUGH );
255  via->SetWidth( viaDiam );
256  via->SetLayerPair( F_Cu, B_Cu );
257  }
258  else // VIA_MICROVIA or VIA_BLIND_BURIED
259  {
260  int topLayerNdx = -1; // session layer detectors
261  int botLayerNdx = INT_MAX;
262 
263  int viaDiam = -1;
264 
265  for( int i=0; i<shapeCount; ++i )
266  {
267  shape = (SHAPE*) (*aPadstack)[i];
268  DSN_T type = shape->shape->Type();
269  if( type != T_circle )
270  THROW_IO_ERROR( wxString::Format( _( "Unsupported via shape: %s"),
271  GetChars( GetTokenString( type ) ) ) );
272 
273  CIRCLE* circle = (CIRCLE*) shape->shape;
274 
275  int layerNdx = findLayerName( circle->layer_id );
276  if( layerNdx == -1 )
277  {
278  wxString layerName = FROM_UTF8( circle->layer_id.c_str() );
279  THROW_IO_ERROR( wxString::Format( _("Session file uses invalid layer id \"%s\""),
280  GetChars( layerName ) ) );
281  }
282 
283  if( layerNdx > topLayerNdx )
284  topLayerNdx = layerNdx;
285 
286  if( layerNdx < botLayerNdx )
287  botLayerNdx = layerNdx;
288 
289  if( viaDiam == -1 )
290  viaDiam = scale( circle->diameter, routeResolution );
291  }
292 
293  via = new ::VIA( sessionBoard );
294  via->SetPosition( mapPt( aPoint, routeResolution ) );
295  via->SetDrill( drill_diam_iu );
296 
297  if( (topLayerNdx==0 && botLayerNdx==1)
298  || (topLayerNdx==copperLayerCount-2 && botLayerNdx==copperLayerCount-1))
299  via->SetViaType( VIATYPE::MICROVIA );
300  else
301  via->SetViaType( VIATYPE::BLIND_BURIED );
302 
303  via->SetWidth( viaDiam );
304 
305  PCB_LAYER_ID topLayer = pcbLayer2kicad[topLayerNdx];
306  PCB_LAYER_ID botLayer = pcbLayer2kicad[botLayerNdx];
307 
308  via->SetLayerPair( topLayer, botLayer );
309  }
310 
311  wxASSERT( via );
312 
313  via->SetNetCode( aNetCode );
314  return via;
315 }
316 
317 
318 // no UI code in this function, throw exception to report problems to the
319 // UI handler: void PCB_EDIT_FRAME::ImportSpecctraSession( wxCommandEvent& event )
320 
322 {
323  sessionBoard = aBoard; // not owned here
324 
325  if( !session )
326  THROW_IO_ERROR( _("Session file is missing the \"session\" section") );
327 
328  if( !session->route )
329  THROW_IO_ERROR( _("Session file is missing the \"routes\" section") );
330 
331  if( !session->route->library )
332  THROW_IO_ERROR( _("Session file is missing the \"library_out\" section") );
333 
334  // delete all the old tracks and vias
335  aBoard->Tracks().clear();
336 
337  aBoard->DeleteMARKERs();
338 
339  buildLayerMaps( aBoard );
340 
341  if( session->placement )
342  {
343  // Walk the PLACEMENT object's COMPONENTs list, and for each PLACE within
344  // each COMPONENT, reposition and re-orient each component and put on
345  // correct side of the board.
346  COMPONENTS& components = session->placement->components;
347  for( COMPONENTS::iterator comp=components.begin(); comp!=components.end(); ++comp )
348  {
349  PLACES& places = comp->places;
350  for( unsigned i=0; i<places.size(); ++i )
351  {
352  PLACE* place = &places[i]; // '&' even though places[] holds a pointer!
353 
354  wxString reference = FROM_UTF8( place->component_id.c_str() );
355  MODULE* module = aBoard->FindModuleByReference( reference );
356 
357  if( !module )
358  {
359  THROW_IO_ERROR( wxString::Format( _( "Reference '%s' not found." ),
360  reference ) );
361  }
362 
363  if( !place->hasVertex )
364  continue;
365 
366  UNIT_RES* resolution = place->GetUnits();
367  wxASSERT( resolution );
368 
369  wxPoint newPos = mapPt( place->vertex, resolution );
370  module->SetPosition( newPos );
371 
372  if( place->side == T_front )
373  {
374  // convert from degrees to tenths of degrees used in KiCad.
375  int orientation = KiROUND( place->rotation * 10.0 );
376 
377  if( module->GetLayer() != F_Cu )
378  {
379  // module is on copper layer (back)
380  module->Flip( module->GetPosition(), false );
381  }
382 
383  module->SetOrientation( orientation );
384  }
385  else if( place->side == T_back )
386  {
387  int orientation = KiROUND( (place->rotation + 180.0) * 10.0 );
388 
389  if( module->GetLayer() != B_Cu )
390  {
391  // module is on component layer (front)
392  module->Flip( module->GetPosition(), false );
393  }
394 
395  module->SetOrientation( orientation );
396  }
397  else
398  {
399  // as I write this, the PARSER *is* catching this, so we should never see below:
400  wxFAIL_MSG( wxT("DSN::PARSER did not catch an illegal side := 'back|front'") );
401  }
402  }
403  }
404  }
405 
407 
408  // Walk the NET_OUTs and create tracks and vias anew.
409  NET_OUTS& net_outs = session->route->net_outs;
410  for( NET_OUTS::iterator net = net_outs.begin(); net!=net_outs.end(); ++net )
411  {
412  int netoutCode = 0;
413 
414  // page 143 of spec says wire's net_id is optional
415  if( net->net_id.size() )
416  {
417  wxString netName = FROM_UTF8( net->net_id.c_str() );
418  NETINFO_ITEM* netinfo = aBoard->FindNet( netName );
419 
420  if( netinfo )
421  netoutCode = netinfo->GetNet();
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 = *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->GetNet();
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 
498  THROW_IO_ERROR( wxString::Format( _("A wire_via references a missing padstack \"%s\""),
499  GetChars( 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:1011
NETINFO_ITEM * FindNet(int aNetcode) const
Search for a net with the given netcode.
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
DSN::T DSN_T
Definition: specctra.h:47
static wxString FROM_UTF8(const char *cstring)
function FROM_UTF8 converts a UTF8 encoded C string to a wxString for all wxWidgets build modes.
Definition: macros.h:114
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:252
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: common.h:216
double y
Definition: specctra.h:97
virtual void SetLayer(PCB_LAYER_ID aLayer)
Function SetLayer sets the layer this item is on.
This file is part of the common library.
void SetEnd(const wxPoint &aEnd)
Definition: class_track.h:112
boost::ptr_vector< WIRE_VIA > WIRE_VIAS
Definition: specctra.h:3086
static constexpr double IU_PER_MM
Mock up a conversion function.
NET_OUTS net_outs
Definition: specctra.h:3422
static POINT mapPt(const wxPoint &pt)
Function mapPt converts a KiCad point into a DSN file point.
POINTS vertexes
Definition: specctra.h:2962
UNIT_RES is a holder for either a T_unit or T_resolution object which are usually mutually exclusive ...
Definition: specctra.h:401
bool SetNetCode(int aNetCode, bool aNoAssert)
Sets net using a net code.
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: class_board.h:514
double x
Definition: specctra.h:96
boost::ptr_vector< NET_OUT > NET_OUTS
Definition: specctra.h:3411
DSN_T GetEngUnits() const
Definition: specctra.h:423
std::string layer_id
Definition: specctra.h:580
int GetValue() const
Definition: specctra.h:424
A single base class (TRACK) represents both tracks and vias, with subclasses for curved tracks (ARC) ...
This file contains miscellaneous commonly used macros and functions.
void SetWidth(int aWidth)
Definition: class_track.h:109
POINT vertex
Definition: specctra.h:1670
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
PATH supports both the <path_descriptor> and the <polygon_descriptor> per the specctra dsn spec.
Definition: specctra.h:576
double rotation
Definition: specctra.h:1667
bool hasVertex
Definition: specctra.h:1669
ELEM * shape
Definition: specctra.h:2858
UNIT_RES * GetUnits() const override
Function GetUnits returns the units for this section.
Definition: specctra.h:3444
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT) override
Adds an item to the container.
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:2388
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.
boost::ptr_vector< COMPONENT > COMPONENTS
Definition: specctra.h:1784
DSN_T side
Definition: specctra.h:1665
PLACE implements the <placement_reference> in the specctra dsn spec.
Definition: specctra.h:1659
LIBRARY * library
Definition: specctra.h:3421
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Return a list of missing connections between components/tracks.
Definition: class_board.h:342
::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:1663
PADSTACK holds either a via or a pad definition.
Definition: specctra.h:2098
NETCLASSES & GetNetClasses() const
SPECCTRA_DB holds a DSN data tree, usually coming from a DSN file.
Definition: specctra.h:3607
#define UNDEFINED_DRILL_DIAMETER
Definition: class_track.h:77
std::string layer_id
Definition: specctra.h:726
SESSION * session
Definition: specctra.h:3614
BOARD * GetBoard()
SHAPE corresponds to the "(shape ..)" element in the specctra dsn spec.
Definition: specctra.h:1863
PLACEMENT * placement
Definition: specctra.h:3542
const std::string & GetPadstackId()
Definition: specctra.h:2982
NETINFO_ITEM handles the data for a net.
Definition: netinfo.h:65
bool ImportSpecctraSession(const wxString &aFullFilename)
Function ImportSpecctraSession will import a specctra *.ses file and use it to relocate MODULEs and t...
LIBRARY corresponds to the <library_descriptor> in the specctra dsn specification.
Definition: specctra.h:2231
static const wxChar * GetChars(const wxString &s)
Function GetChars returns a wxChar* to the actual wxChar* data within a wxString, and is helpful for ...
Definition: macros.h:153
Struct POINT is a holder for a point in the SPECCTRA DSN coordinate system.
Definition: specctra.h:94
WIRE corresponds to <wire_shape_descriptor> in the specctra dsn spec.
Definition: specctra.h:2847
Class to handle a graphic segment.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:201
int GetNet() const
Function GetNet.
Definition: netinfo.h:223
boost::ptr_vector< PLACE > PLACES
Definition: specctra.h:1732
Information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:176
DSN_T Type() const
Definition: specctra.h:231
POINTS points
Definition: specctra.h:583
#define _(s)
Definition: 3d_actions.cpp:33
int GetCopperLayerCount() const
static float distance(const SFVEC2UI &a, const SFVEC2UI &b)
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:581
MODULE * FindModuleByReference(const wxString &aReference) const
Search for a MODULE within this board with the given reference designator.
std::string padstack_id
Definition: specctra.h:2104
ROUTE * route
Definition: specctra.h:3544
virtual UNIT_RES * GetUnits() const
Function GetUnits returns the units for this section.
Definition: specctra.cpp:3510
ELEM * shape
Definition: specctra.h:837
NETCLASSPTR GetDefault() const
Function GetDefault.
Definition: netclass.h:264
BOARD * sessionBoard
a copy to avoid passing as an argument, memory for it is not owned here.
Definition: specctra.h:3634
boost::ptr_vector< WIRE > WIRES
Definition: specctra.h:2950
void SetStart(const wxPoint &aStart)
Definition: class_track.h:115
WIRE_VIA corresponds to <wire_via_descriptor> in the specctra dsn spec.
Definition: specctra.h:2957
void FromSESSION(BOARD *aBoard)
Function FromSESSION adds the entire SESSION info to a BOARD but does not write it out.
std::vector< PCB_LAYER_ID > pcbLayer2kicad
maps PCB layer number to BOARD layer numbers
Definition: specctra.h:3628
EDGE_MODULE class definition.
int Length() const
Function Length returns the number of ELEMs in this ELEM.
Definition: specctra.h:316
Struct IO_ERROR is a class used to hold an error message and may be used when throwing exceptions con...
Definition: ki_exception.h:76
#define THROW_IO_ERROR(msg)
Definition: ki_exception.h:38
UNIT_RES * routeResolution
used during FromSESSION() only, memory for it is not owned here.
Definition: specctra.h:3631
COMPONENTS components
Definition: specctra.h:1795
TRACKS & Tracks()
Definition: class_board.h:244
double diameter
Definition: specctra.h:728