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 <class_drawpanel.h> // m_canvas
36 #include <confirm.h> // DisplayError()
37 #include <gestfich.h> // EDA_FileSelector()
38 #include <wxPcbStruct.h>
39 #include <macros.h>
40 
41 #include <class_board.h>
42 #include <class_module.h>
43 #include <class_edge_mod.h>
44 #include <class_track.h>
45 #include <class_zone.h>
46 #include <class_drawsegment.h>
47 #include <ratsnest_data.h>
48 #include <view/view.h>
49 
50 #include <specctra.h>
51 
52 
53 using namespace DSN;
54 
55 void PCB_EDIT_FRAME::ImportSpecctraDesign( wxCommandEvent& event )
56 {
57  /* @todo write this someday
58 
59  if( !Clear_Pcb( true ) )
60  return;
61  */
62 }
63 
64 
65 void PCB_EDIT_FRAME::ImportSpecctraSession( wxCommandEvent& event )
66 {
67  wxString fullFileName = GetBoard()->GetFileName();
68  wxString path;
69  wxString name;
70  wxString ext;
71 
72  wxString sessionExt( wxT( ".ses" ) );
73  wxString mask = wxT( "*" ) + sessionExt;
74 
75  wxFileName::SplitPath( fullFileName, &path, &name, &ext );
76  name += sessionExt;
77 
78  fullFileName = EDA_FILE_SELECTOR( _( "Merge Specctra Session file:" ),
79  path,
80  name,
81  sessionExt,
82  mask,
83  this,
84  wxFD_OPEN,
85  false );
86 
87  if( fullFileName == wxEmptyString )
88  return;
89 
90  SetCurItem( NULL );
91 
92  // To avoid issues with undo/redo lists (dangling pointers)
93  // clear the lists
94  // todo: use undo/redo feature
95  GetScreen()->ClearUndoRedoList();
96 
97  SPECCTRA_DB db;
98  LOCALE_IO toggle;
99 
100  try
101  {
102  db.LoadSESSION( fullFileName );
103  db.FromSESSION( GetBoard() );
104  }
105  catch( const IO_ERROR& ioe )
106  {
107  wxString msg = ioe.What();
108  msg += '\n';
109  msg += _("BOARD may be corrupted, do not save it.");
110  msg += '\n';
111  msg += _("Fix problem and try again.");
112 
113  DisplayError( this, msg );
114  return;
115  }
116 
117  OnModify();
118  GetBoard()->m_Status_Pcb = 0;
119 
120  Compile_Ratsnest( NULL, true );
122 
123  if( GetGalCanvas() ) // Update view:
124  {
125  auto view = GetGalCanvas()->GetView();
126 
127  // Update footprint positions
128  view->RecacheAllItems();
129 
130  // add imported tracks (previous tracks are removed, therfore all are new)
131  for( TRACK* track = GetBoard()->m_Track; track; track = track->Next() )
132  view->Add( track );
133  }
134 
135  SetStatusText( wxString( _( "Session file imported and merged OK." ) ) );
136 
137  Refresh();
138 }
139 
140 
141 namespace DSN {
142 
143 
152 static int scale( double distance, UNIT_RES* aResolution )
153 {
154  double resValue = aResolution->GetValue();
155  double factor;
156 
157  switch( aResolution->GetEngUnits() )
158  {
159  default:
160  case T_inch:
161  factor = 25.4e6; // nanometers per inch
162  break;
163  case T_mil:
164  factor = 25.4e3; // nanometers per mil
165  break;
166  case T_cm:
167  factor = 1e7; // nanometers per cm
168  break;
169  case T_mm:
170  factor = 1e6; // nanometers per mm
171  break;
172  case T_um:
173  factor = 1e3; // nanometers per um
174  break;
175  }
176 
177  int ret = KiROUND( factor * distance / resValue );
178 
179  return ret;
180 }
181 
182 
191 static wxPoint mapPt( const POINT& aPoint, UNIT_RES* aResolution )
192 {
193  wxPoint ret( scale( aPoint.x, aResolution ),
194  -scale( aPoint.y, aResolution ) ); // negate y
195 
196  return ret;
197 }
198 
199 
200 TRACK* SPECCTRA_DB::makeTRACK( PATH* aPath, int aPointIndex, int aNetcode ) throw( IO_ERROR )
201 {
202  int layerNdx = findLayerName( aPath->layer_id );
203 
204  if( layerNdx == -1 )
205  {
206  wxString layerName = FROM_UTF8( aPath->layer_id.c_str() );
207  THROW_IO_ERROR( wxString::Format( _("Session file uses invalid layer id \"%s\""),
208  GetChars( layerName ) ) );
209  }
210 
211  TRACK* track = new TRACK( sessionBoard );
212 
213  track->SetStart( mapPt( aPath->points[aPointIndex+0], routeResolution ) );
214  track->SetEnd( mapPt( aPath->points[aPointIndex+1], routeResolution ) );
215  track->SetLayer( pcbLayer2kicad[layerNdx] );
216  track->SetWidth( scale( aPath->aperture_width, routeResolution ) );
217  track->SetNetCode( aNetcode );
218 
219  return track;
220 }
221 
222 
223 ::VIA* SPECCTRA_DB::makeVIA( PADSTACK* aPadstack, const POINT& aPoint,
224  int aNetCode, int aViaDrillDefault )
225  throw( IO_ERROR )
226 {
227  ::VIA* via = 0;
228  SHAPE* shape;
229 
230  int shapeCount = aPadstack->Length();
231  int drill_diam_iu = -1;
232  int copperLayerCount = sessionBoard->GetCopperLayerCount();
233 
234 
235  // The drill diameter is encoded in the padstack name if Pcbnew did the DSN export.
236  // It is after the colon and before the last '_'
237  int drillStartNdx = aPadstack->padstack_id.find( ':' );
238 
239  if( drillStartNdx != -1 )
240  {
241  ++drillStartNdx; // skip over the ':'
242 
243  int drillEndNdx = aPadstack->padstack_id.rfind( '_' );
244  if( drillEndNdx != -1 )
245  {
246  std::string diam_txt( aPadstack->padstack_id,
247  drillStartNdx, drillEndNdx-drillStartNdx );
248 
249  double drill_um = strtod( diam_txt.c_str(), 0 );
250 
251  drill_diam_iu = int( drill_um * (IU_PER_MM / 1000.0) );
252 
253  if( drill_diam_iu == aViaDrillDefault )
254  drill_diam_iu = UNDEFINED_DRILL_DIAMETER;
255  }
256  }
257 
258  if( shapeCount == 0 )
259  {
260  THROW_IO_ERROR( _( "Session via padstack has no shapes" ) );
261  }
262  else if( shapeCount == 1 )
263  {
264  shape = (SHAPE*) (*aPadstack)[0];
265  DSN_T type = shape->shape->Type();
266  if( type != T_circle )
267  THROW_IO_ERROR( wxString::Format( _( "Unsupported via shape: %s"),
268  GetChars( GetTokenString( type ) ) ) );
269 
270  CIRCLE* circle = (CIRCLE*) shape->shape;
271  int viaDiam = scale( circle->diameter, routeResolution );
272 
273  via = new ::VIA( sessionBoard );
274  via->SetPosition( mapPt( aPoint, routeResolution ) );
275  via->SetDrill( drill_diam_iu );
276  via->SetViaType( VIA_THROUGH );
277  via->SetWidth( viaDiam );
278  via->SetLayerPair( F_Cu, B_Cu );
279  }
280  else if( shapeCount == copperLayerCount )
281  {
282  shape = (SHAPE*) (*aPadstack)[0];
283  DSN_T type = shape->shape->Type();
284  if( type != T_circle )
285  THROW_IO_ERROR( wxString::Format( _( "Unsupported via shape: %s"),
286  GetChars( GetTokenString( type ) ) ) );
287 
288  CIRCLE* circle = (CIRCLE*) shape->shape;
289  int viaDiam = scale( circle->diameter, routeResolution );
290 
291  via = new ::VIA( sessionBoard );
292  via->SetPosition( mapPt( aPoint, routeResolution ) );
293  via->SetDrill( drill_diam_iu );
294  via->SetViaType( VIA_THROUGH );
295  via->SetWidth( viaDiam );
296  via->SetLayerPair( F_Cu, B_Cu );
297  }
298  else // VIA_MICROVIA or VIA_BLIND_BURIED
299  {
300  int topLayerNdx = -1; // session layer detectors
301  int botLayerNdx = INT_MAX;
302 
303  int viaDiam = -1;
304 
305  for( int i=0; i<shapeCount; ++i )
306  {
307  shape = (SHAPE*) (*aPadstack)[i];
308  DSN_T type = shape->shape->Type();
309  if( type != T_circle )
310  THROW_IO_ERROR( wxString::Format( _( "Unsupported via shape: %s"),
311  GetChars( GetTokenString( type ) ) ) );
312 
313  CIRCLE* circle = (CIRCLE*) shape->shape;
314 
315  int layerNdx = findLayerName( circle->layer_id );
316  if( layerNdx == -1 )
317  {
318  wxString layerName = FROM_UTF8( circle->layer_id.c_str() );
319  THROW_IO_ERROR( wxString::Format( _("Session file uses invalid layer id \"%s\""),
320  GetChars( layerName ) ) );
321  }
322 
323  if( layerNdx > topLayerNdx )
324  topLayerNdx = layerNdx;
325 
326  if( layerNdx < botLayerNdx )
327  botLayerNdx = layerNdx;
328 
329  if( viaDiam == -1 )
330  viaDiam = scale( circle->diameter, routeResolution );
331  }
332 
333  via = new ::VIA( sessionBoard );
334  via->SetPosition( mapPt( aPoint, routeResolution ) );
335  via->SetDrill( drill_diam_iu );
336 
337  if( (topLayerNdx==0 && botLayerNdx==1)
338  || (topLayerNdx==copperLayerCount-2 && botLayerNdx==copperLayerCount-1))
339  via->SetViaType( VIA_MICROVIA );
340  else
341  via->SetViaType( VIA_BLIND_BURIED );
342 
343  via->SetWidth( viaDiam );
344 
345  LAYER_ID topLayer = pcbLayer2kicad[topLayerNdx];
346  LAYER_ID botLayer = pcbLayer2kicad[botLayerNdx];
347 
348  via->SetLayerPair( topLayer, botLayer );
349  }
350 
351  wxASSERT( via );
352 
353  via->SetNetCode( aNetCode );
354  return via;
355 }
356 
357 
358 // no UI code in this function, throw exception to report problems to the
359 // UI handler: void PCB_EDIT_FRAME::ImportSpecctraSession( wxCommandEvent& event )
360 
361 void SPECCTRA_DB::FromSESSION( BOARD* aBoard ) throw( IO_ERROR )
362 {
363  sessionBoard = aBoard; // not owned here
364 
365  if( !session )
366  THROW_IO_ERROR( _("Session file is missing the \"session\" section") );
367 
368  /* Dick 16-Jan-2012: session need not have a placement section.
369  if( !session->placement )
370  THROW_IO_ERROR( _("Session file is missing the \"placement\" section") );
371  */
372 
373  if( !session->route )
374  THROW_IO_ERROR( _("Session file is missing the \"routes\" section") );
375 
376  if( !session->route->library )
377  THROW_IO_ERROR( _("Session file is missing the \"library_out\" section") );
378 
379  // delete all the old tracks and vias
380  aBoard->m_Track.DeleteAll();
381 
382  aBoard->DeleteMARKERs();
383 
384  buildLayerMaps( aBoard );
385 
386  if( session->placement )
387  {
388  // Walk the PLACEMENT object's COMPONENTs list, and for each PLACE within
389  // each COMPONENT, reposition and re-orient each component and put on
390  // correct side of the board.
391  COMPONENTS& components = session->placement->components;
392  for( COMPONENTS::iterator comp=components.begin(); comp!=components.end(); ++comp )
393  {
394  PLACES& places = comp->places;
395  for( unsigned i=0; i<places.size(); ++i )
396  {
397  PLACE* place = &places[i]; // '&' even though places[] holds a pointer!
398 
399  wxString reference = FROM_UTF8( place->component_id.c_str() );
400  MODULE* module = aBoard->FindModuleByReference( reference );
401  if( !module )
402  {
403  THROW_IO_ERROR( wxString::Format( _("Session file has 'reference' to non-existent component \"%s\""),
404  GetChars( reference ) ) );
405  }
406 
407  if( !place->hasVertex )
408  continue;
409 
410  UNIT_RES* resolution = place->GetUnits();
411  wxASSERT( resolution );
412 
413  wxPoint newPos = mapPt( place->vertex, resolution );
414  module->SetPosition( newPos );
415 
416  if( place->side == T_front )
417  {
418  // convert from degrees to tenths of degrees used in KiCad.
419  int orientation = KiROUND( place->rotation * 10.0 );
420 
421  if( module->GetLayer() != F_Cu )
422  {
423  // module is on copper layer (back)
424  module->Flip( module->GetPosition() );
425  }
426 
427  module->SetOrientation( orientation );
428  }
429  else if( place->side == T_back )
430  {
431  int orientation = KiROUND( (place->rotation + 180.0) * 10.0 );
432 
433  if( module->GetLayer() != B_Cu )
434  {
435  // module is on component layer (front)
436  module->Flip( module->GetPosition() );
437  }
438 
439  module->SetOrientation( orientation );
440  }
441  else
442  {
443  // as I write this, the PARSER *is* catching this, so we should never see below:
444  wxFAIL_MSG( wxT("DSN::PARSER did not catch an illegal side := 'back|front'") );
445  }
446  }
447  }
448  }
449 
450  routeResolution = session->route->GetUnits();
451 
452  // Walk the NET_OUTs and create tracks and vias anew.
453  NET_OUTS& net_outs = session->route->net_outs;
454  for( NET_OUTS::iterator net = net_outs.begin(); net!=net_outs.end(); ++net )
455  {
456  int netoutCode = 0;
457 
458  // page 143 of spec says wire's net_id is optional
459  if( net->net_id.size() )
460  {
461  wxString netName = FROM_UTF8( net->net_id.c_str() );
462  NETINFO_ITEM* netinfo = aBoard->FindNet( netName );
463 
464  if( netinfo )
465  netoutCode = netinfo->GetNet();
466  else // else netCode remains 0
467  {
468  // int breakhere = 1;
469  }
470  }
471 
472  WIRES& wires = net->wires;
473  for( unsigned i = 0; i<wires.size(); ++i )
474  {
475  WIRE* wire = &wires[i];
476  DSN_T shape = wire->shape->Type();
477 
478  if( shape != T_path )
479  {
480  /* shape == T_polygon is expected from freerouter if you have
481  a zone on a non "power" type layer, i.e. a T_signal layer
482  and the design does a round trip back in as session here.
483  We kept our own zones in the BOARD, so ignore this so called
484  'wire'.
485 
486  wxString netId = FROM_UTF8( wire->net_id.c_str() );
487  THROW_IO_ERROR( wxString::Format( _("Unsupported wire shape: \"%s\" for net: \"%s\""),
488  DLEX::GetTokenString(shape).GetData(),
489  netId.GetData()
490  ) );
491  */
492  }
493  else
494  {
495  PATH* path = (PATH*) wire->shape;
496  for( unsigned pt=0; pt<path->points.size()-1; ++pt )
497  {
498  TRACK* track = makeTRACK( path, pt, netoutCode );
499  aBoard->Add( track );
500  }
501  }
502  }
503 
504  WIRE_VIAS& wire_vias = net->wire_vias;
505  LIBRARY& library = *session->route->library;
506  for( unsigned i=0; i<wire_vias.size(); ++i )
507  {
508  int netCode = 0;
509 
510  // page 144 of spec says wire_via's net_id is optional
511  if( net->net_id.size() )
512  {
513  wxString netName = FROM_UTF8( net->net_id.c_str() );
514  NETINFO_ITEM* netvia = aBoard->FindNet( netName );
515 
516  if( netvia )
517  netCode = netvia->GetNet();
518 
519  // else netCode remains 0
520  }
521 
522  WIRE_VIA* wire_via = &wire_vias[i];
523 
524  // example: (via Via_15:8_mil 149000 -71000 )
525 
526  PADSTACK* padstack = library.FindPADSTACK( wire_via->GetPadstackId() );
527  if( !padstack )
528  {
529  // Dick Feb 29, 2008:
530  // Freerouter has a bug where it will not round trip all vias.
531  // Vias which have a (use_via) element will be round tripped.
532  // Vias which do not, don't come back in in the session library,
533  // even though they may be actually used in the pre-routed,
534  // protected wire_vias. So until that is fixed, create the
535  // padstack from its name as a work around.
536 
537 
538  // Could use a STRING_FORMATTER here and convert the entire
539  // wire_via to text and put that text into the exception.
540  wxString psid( FROM_UTF8( wire_via->GetPadstackId().c_str() ) );
541 
542  THROW_IO_ERROR( wxString::Format( _("A wire_via references a missing padstack \"%s\""),
543  GetChars( psid ) ) );
544  }
545 
546  NETCLASSPTR netclass = aBoard->GetDesignSettings().m_NetClasses.GetDefault();
547 
548  int via_drill_default = netclass->GetViaDrill();
549 
550  for( unsigned v=0; v<wire_via->vertexes.size(); ++v )
551  {
552  ::VIA* via = makeVIA( padstack, wire_via->vertexes[v], netCode, via_drill_default );
553  aBoard->Add( via );
554  }
555  }
556  }
557 }
558 
559 
560 } // namespace DSN
void LoadSESSION(const wxString &aFilename)
Function LoadSESSION is a recursive descent parser for a SPECCTRA DSN "session" file.
Definition: specctra.cpp:262
Class VIA corresponds to the in the specctra dsn spec.
Definition: specctra.h:1008
TRACK * makeTRACK(PATH *aPath, int aPointIndex, int aNetcode)
Function makeTRACK creates a TRACK form the PATH and BOARD info.
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:53
This source file implements export and import capabilities to the specctra dsn file format...
Definition: specctra.cpp:62
This file is part of the common library TODO brief description.
static int KiROUND(double v)
KiROUND rounds a floating point number to an int using "round halfway cases away from zero"...
Definition: common.h:128
Class LOCALE_IO is a class that can be instantiated within a scope in which you are expecting excepti...
Definition: common.h:195
double y
Definition: specctra.h:97
This file is part of the common library.
void SetEnd(const wxPoint &aEnd)
Definition: class_track.h:116
boost::ptr_vector< WIRE_VIA > WIRE_VIAS
Definition: specctra.h:3083
T
enum T contains all this lexer's tokens.
virtual UNIT_RES * GetUnits() const
Function GetUnits returns the units for this section.
Definition: specctra.cpp:3502
Class BOARD to handle a board.
Class that computes missing connections on a PCB.
static POINT mapPt(const wxPoint &pt)
Function mapPt converts a KiCad point into a DSN file point.
virtual void SetLayer(LAYER_ID aLayer)
Function SetLayer sets the layer this item is on.
POINTS vertexes
Definition: specctra.h:2959
Class UNIT_RES is a holder for either a T_unit or T_resolution object which are usually mutually excl...
Definition: specctra.h:401
Classes to handle copper zones.
double x
Definition: specctra.h:96
boost::ptr_vector< NET_OUT > NET_OUTS
Definition: specctra.h:3408
Functions relatives to tracks, vias and segments used to fill zones.
This file contains miscellaneous commonly used macros and functions.
void SetWidth(int aWidth)
Definition: class_track.h:113
POINT vertex
Definition: specctra.h:1667
Class PATH supports both the and the per the specctra dsn spec...
Definition: specctra.h:576
BOARD_ITEM * Next() const
double rotation
Definition: specctra.h:1664
bool hasVertex
Definition: specctra.h:1666
ELEM * shape
Definition: specctra.h:2855
DSN_T GetEngUnits() const
Definition: specctra.h:423
PADSTACK * FindPADSTACK(const std::string &aPadstackId)
Function FindPADSTACK searches the padstack container by name.
Definition: specctra.h:2385
void Refresh()
boost::ptr_vector< COMPONENT > COMPONENTS
Definition: specctra.h:1781
const wxString & GetFileName() const
Definition: class_board.h:237
DSN_T side
Definition: specctra.h:1662
Class PLACE implements the in the specctra dsn spec.
Definition: specctra.h:1656
wxString EDA_FILE_SELECTOR(const wxString &aTitle, const wxString &aPath, const wxString &aFileName, const wxString &aExtension, const wxString &aWildcard, wxWindow *aParent, int aStyle, const bool aKeepWorkingDirectory, const wxPoint &aPosition, wxString *aMruPath)
Function EDA_FILE_SELECTOR.
Definition: gestfich.cpp:82
void ProcessBoard()
Function ProcessBoard() Prepares data for computing (computes a list of current nodes and connections...
::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...
bool SetNetCode(int aNetCode, bool aNoAssert=false)
Function SetNetCode sets net using a net code.
std::string component_id
reference designator
Definition: specctra.h:1660
Class PADSTACK holds either a via or a pad definition.
Definition: specctra.h:2095
#define THROW_IO_ERROR(x)
Definition: utf8.cpp:60
Class SPECCTRA_DB holds a DSN data tree, usually coming from a DSN file.
Definition: specctra.h:3604
#define UNDEFINED_DRILL_DIAMETER
Definition: class_track.h:57
int GetNet() const
Function GetNet.
std::string layer_id
Definition: specctra.h:726
RN_DATA * GetRatsnest() const
Function GetRatsnest() returns list of missing connections between components/tracks.
Definition: class_board.h:287
BOARD * GetBoard()
Class SHAPE corresponds to the "(shape ..)" element in the specctra dsn spec.
Definition: specctra.h:1860
const std::string & GetPadstackId()
Definition: specctra.h:2979
Class NETINFO_ITEM handles the data for a net.
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:33
Class LIBRARY corresponds to the in the specctra dsn specification.
Definition: specctra.h:2228
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:92
Struct POINT is a holder for a point in the SPECCTRA DSN coordinate system.
Definition: specctra.h:94
void ImportSpecctraSession(wxCommandEvent &event)
Function ImportSpecctraSession will import a specctra *.ses file and use it to relocate MODULEs and t...
Class WIRE corresponds to in the specctra dsn spec.
Definition: specctra.h:2844
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:205
int GetValue() const
Definition: specctra.h:424
boost::ptr_vector< PLACE > PLACES
Definition: specctra.h:1729
Class BOARD holds information pertinent to a Pcbnew printed circuit board.
Definition: class_board.h:166
LAYER_ID
Enum LAYER_ID is the set of PCB layers.
static double scale(int kicadDist)
Function scale converts a distance from PCBNEW internal units to the reported specctra dsn units in f...
ELEM * shape
Definition: specctra.h:837
boost::ptr_vector< WIRE > WIRES
Definition: specctra.h:2947
void SetStart(const wxPoint &aStart)
Definition: class_track.h:119
Class WIRE_VIA corresponds to in the specctra dsn spec.
Definition: specctra.h:2954
void FromSESSION(BOARD *aBoard)
Function FromSESSION adds the entire SESSION info to a BOARD but does not write it out...
Module description (excepted pads)
DSN_T Type() const
Definition: specctra.h:231
EDGE_MODULE class definition.
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayError displays an error or warning message box with aMessage.
Definition: confirm.cpp:69
Struct IO_ERROR is a class used to hold an error message and may be used when throwing exceptions con...
Definition: ki_exception.h:47
void ImportSpecctraDesign(wxCommandEvent &event)
Function ImportSpecctraDesign will import a specctra *.dsn file and use it to replace an entire BOARD...
double diameter
Definition: specctra.h:728
int m_Status_Pcb
Flags used in ratsnest calculation and update.
Definition: class_board.h:240