KiCad PCB EDA Suite
HYPERLYNX_EXPORTER Class Reference
Inheritance diagram for HYPERLYNX_EXPORTER:
BOARD_EXPORTER_BASE

Public Member Functions

 HYPERLYNX_EXPORTER ()
 
 ~HYPERLYNX_EXPORTER ()
 
virtual bool Run () override
 
void SetOutputFilename (const wxFileName &aPath)
 
void SetBoard (BOARD *aBoard)
 
void SetReporter (REPORTER *aReporter)
 
void SetProgressReporter (PROGRESS_REPORTER *aProgressReporter)
 
virtual wxDialog * CreateSettingsDialog (PROPERTIES *aProperties)
 
virtual bool HasSettingsDialog () const
 

Protected Attributes

PROPERTIES m_properties
 
BOARDm_board = nullptr
 
wxFileName m_outputFilePath
 
REPORTERm_reporter = nullptr
 
PROGRESS_REPORTERm_progressReporter = nullptr
 

Private Member Functions

HYPERLYNX_PAD_STACKaddPadStack (HYPERLYNX_PAD_STACK stack)
 
const std::string formatPadShape (HYPERLYNX_PAD_STACK &aStack)
 
bool generateHeaders ()
 
bool writeBoardInfo ()
 
bool writeStackupInfo ()
 
bool writeDevices ()
 
bool writePadStacks ()
 
bool writeNets ()
 
bool writeNetObjects (const std::vector< BOARD_ITEM * > &aObjects)
 
void writeSinglePadStack (HYPERLYNX_PAD_STACK &aStack)
 
const std::vector< BOARD_ITEM * > collectNetObjects (int netcode)
 

Private Attributes

std::vector< HYPERLYNX_PAD_STACK * > m_padStacks
 
std::map< BOARD_ITEM *, HYPERLYNX_PAD_STACK * > m_padMap
 
std::shared_ptr< FILE_OUTPUTFORMATTERm_out
 
int m_polyId
 

Detailed Description

Definition at line 148 of file export_hyperlynx.cpp.

Constructor & Destructor Documentation

◆ HYPERLYNX_EXPORTER()

HYPERLYNX_EXPORTER::HYPERLYNX_EXPORTER ( )
inline

Definition at line 151 of file export_hyperlynx.cpp.

151 {};

◆ ~HYPERLYNX_EXPORTER()

HYPERLYNX_EXPORTER::~HYPERLYNX_EXPORTER ( )
inline

Definition at line 152 of file export_hyperlynx.cpp.

152 {};

Member Function Documentation

◆ addPadStack()

HYPERLYNX_PAD_STACK* HYPERLYNX_EXPORTER::addPadStack ( HYPERLYNX_PAD_STACK  stack)
inlineprivate

Definition at line 157 of file export_hyperlynx.cpp.

158  {
159  for( auto p : m_padStacks )
160  {
161  if( *p == stack )
162  return p;
163  }
164 
165  stack.SetId( m_padStacks.size() );
166  m_padStacks.push_back( new HYPERLYNX_PAD_STACK( stack ) );
167 
168  return m_padStacks.back();
169  }
std::vector< HYPERLYNX_PAD_STACK * > m_padStacks

References m_padStacks, and HYPERLYNX_PAD_STACK::SetId().

Referenced by writePadStacks().

◆ collectNetObjects()

const std::vector< BOARD_ITEM * > HYPERLYNX_EXPORTER::collectNetObjects ( int  netcode)
private

Definition at line 494 of file export_hyperlynx.cpp.

495 {
496  std::vector<BOARD_ITEM*> rv;
497 
498  auto check = [&]( BOARD_CONNECTED_ITEM* item ) -> bool {
499  if( ( item->GetLayerSet() & LSET::AllCuMask() ).none() )
500  return false;
501  if( item->GetNetCode() == netcode || ( netcode < 0 && item->GetNetCode() <= 0 ) )
502  return true;
503  return false;
504  };
505 
506  for( auto mod : m_board->Modules() )
507  {
508  for( auto pad : mod->Pads() )
509  {
510  if( check( pad ) )
511  rv.push_back( pad );
512  }
513  }
514 
515  for( auto item : m_board->Tracks() )
516  if( check( item ) )
517  rv.push_back( item );
518 
519  for( int i = 0; i < m_board->GetAreaCount(); i++ )
520  {
521  auto zone = m_board->GetArea( i );
522  if( check( zone ) )
523  rv.push_back( zone );
524  }
525  return rv;
526 }
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Function AllCuMask returns a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:676
Class BOARD_CONNECTED_ITEM is a base class derived from BOARD_ITEM for items that can be connected an...
static list_size_check check
int GetAreaCount() const
Function GetAreaCount.
Definition: class_board.h:981
DLIST_ITERATOR_WRAPPER< MODULE > Modules()
Definition: class_board.h:252
size_t i
Definition: json11.cpp:597
DLIST_ITERATOR_WRAPPER< TRACK > Tracks()
Definition: class_board.h:251
ZONE_CONTAINER * GetArea(int index) const
Function GetArea returns the Area (Zone Container) at a given index.
Definition: class_board.h:952
#define mod(a, n)
Definition: greymap.cpp:24

References LSET::AllCuMask(), check, BOARD::GetArea(), BOARD::GetAreaCount(), i, BOARD_EXPORTER_BASE::m_board, mod, BOARD::Modules(), and BOARD::Tracks().

Referenced by writeNets().

◆ CreateSettingsDialog()

virtual wxDialog* BOARD_EXPORTER_BASE::CreateSettingsDialog ( PROPERTIES aProperties)
inlinevirtualinherited

Definition at line 70 of file board_exporter_base.h.

71  {
72  return nullptr;
73  }

◆ formatPadShape()

const std::string HYPERLYNX_EXPORTER::formatPadShape ( HYPERLYNX_PAD_STACK aStack)
inlineprivate

Definition at line 171 of file export_hyperlynx.cpp.

172  {
173  int shapeId = 0;
174  char buf[1024];
175 
176  switch( aStack.m_shape )
177  {
178  case PAD_SHAPE_CIRCLE:
179  case PAD_SHAPE_OVAL: shapeId = 0; break;
180  case PAD_SHAPE_ROUNDRECT: shapeId = 2; break;
181  case PAD_SHAPE_RECT: shapeId = 1; break;
182  default:
183  shapeId = 0;
184 
185  if( m_reporter )
186  {
188  _( "File contains pad shapes that are not supported by the Hyperlynx exporter\n"
189  "(Supported shapes are oval, rectangle, circle.)\n"
190  "They have been exported as oval pads." ),
192  }
193  break;
194  }
195 
196  snprintf( buf, sizeof( buf ), "%d, %.9f, %.9f, %.1f, M", shapeId,
197  iu2hyp( aStack.m_sx ),
198  iu2hyp( aStack.m_sy ),
199  aStack.m_angle );
200 
201  return buf;
202  }
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_UNDEFINED)=0
Function Report is a pure virtual function to override in the derived object.
static double iu2hyp(double iu)

References iu2hyp(), HYPERLYNX_PAD_STACK::m_angle, BOARD_EXPORTER_BASE::m_reporter, HYPERLYNX_PAD_STACK::m_shape, HYPERLYNX_PAD_STACK::m_sx, HYPERLYNX_PAD_STACK::m_sy, PAD_SHAPE_CIRCLE, PAD_SHAPE_OVAL, PAD_SHAPE_RECT, PAD_SHAPE_ROUNDRECT, REPORTER::Report(), and REPORTER::RPT_WARNING.

Referenced by writeSinglePadStack().

◆ generateHeaders()

bool HYPERLYNX_EXPORTER::generateHeaders ( )
private

Definition at line 257 of file export_hyperlynx.cpp.

258 {
259  m_out->Print( 0, "{VERSION=2.14}\n" );
260  m_out->Print( 0, "{UNITS=ENGLISH LENGTH}\n\n" );
261  return true;
262 }
std::shared_ptr< FILE_OUTPUTFORMATTER > m_out

References m_out.

Referenced by Run().

◆ HasSettingsDialog()

virtual bool BOARD_EXPORTER_BASE::HasSettingsDialog ( ) const
inlinevirtualinherited

Definition at line 75 of file board_exporter_base.h.

76  {
77  return false;
78  }

◆ Run()

bool HYPERLYNX_EXPORTER::Run ( )
overridevirtual

Implements BOARD_EXPORTER_BASE.

Definition at line 567 of file export_hyperlynx.cpp.

568 {
569  LOCALE_IO toggle; // toggles on, then off, the C locale.
570 
571  try
572  {
573  m_out.reset( new FILE_OUTPUTFORMATTER( m_outputFilePath.GetFullPath() ) );
574 
575  generateHeaders();
576  writeBoardInfo();
578  writeDevices();
579  writePadStacks();
580  writeNets();
581  }
582  catch( IO_ERROR& err )
583  {
584  return false;
585  }
586 
587  return true;
588 }
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
Definition: common.h:177
string & err
Definition: json11.cpp:598
std::shared_ptr< FILE_OUTPUTFORMATTER > m_out
Class FILE_OUTPUTFORMATTER may be used for text file output.
Definition: richio.h:492
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

References err, generateHeaders(), m_out, BOARD_EXPORTER_BASE::m_outputFilePath, writeBoardInfo(), writeDevices(), writeNets(), writePadStacks(), and writeStackupInfo().

Referenced by ExportBoardToHyperlynx().

◆ SetBoard()

void BOARD_EXPORTER_BASE::SetBoard ( BOARD aBoard)
inlineinherited

Definition at line 52 of file board_exporter_base.h.

53  {
54  m_board = aBoard;
55  }

References BOARD_EXPORTER_BASE::m_board.

Referenced by ExportBoardToHyperlynx().

◆ SetOutputFilename()

void BOARD_EXPORTER_BASE::SetOutputFilename ( const wxFileName &  aPath)
inlineinherited

Definition at line 47 of file board_exporter_base.h.

48  {
49  m_outputFilePath = aPath;
50  }

References BOARD_EXPORTER_BASE::m_outputFilePath.

Referenced by ExportBoardToHyperlynx().

◆ SetProgressReporter()

void BOARD_EXPORTER_BASE::SetProgressReporter ( PROGRESS_REPORTER aProgressReporter)
inlineinherited

Definition at line 62 of file board_exporter_base.h.

63  {
64  m_progressReporter = aProgressReporter;
65  }
PROGRESS_REPORTER * m_progressReporter

References BOARD_EXPORTER_BASE::m_progressReporter.

◆ SetReporter()

void BOARD_EXPORTER_BASE::SetReporter ( REPORTER aReporter)
inlineinherited

Definition at line 57 of file board_exporter_base.h.

58  {
59  m_reporter = aReporter;
60  }

References BOARD_EXPORTER_BASE::m_reporter.

◆ writeBoardInfo()

bool HYPERLYNX_EXPORTER::writeBoardInfo ( )
private

Definition at line 292 of file export_hyperlynx.cpp.

293 {
294  SHAPE_POLY_SET outlines;
295  wxString errText;
296  wxPoint errLoc;
297 
298  m_out->Print( 0, "{BOARD \"%s\"\n", (const char*) m_board->GetFileName().c_str() );
299 
300  if( !m_board->GetBoardPolygonOutlines( outlines, &errText, &errLoc ) )
301  {
302  return false;
303  }
304 
305  for( int o = 0; o < outlines.OutlineCount(); o++ )
306  {
307  const auto& outl = outlines.COutline( o );
308 
309  for( int i = 0; i < outl.SegmentCount(); i++ )
310  {
311  const auto& s = outl.CSegment( i );
312  m_out->Print( 1, "(PERIMETER_SEGMENT X1=%.9f Y1=%.9f X2=%.9f Y2=%.9f)\n",
313  iu2hyp( s.A.x ), iu2hyp( s.A.y ), iu2hyp( s.B.x ), iu2hyp( s.B.y ) );
314  }
315  }
316 
317  m_out->Print( 0, "}\n\n" );
318 
319  return true;
320 }
int OutlineCount() const
Returns the number of outlines in the set
const wxString & GetFileName() const
Definition: class_board.h:237
Class SHAPE_POLY_SET.
bool GetBoardPolygonOutlines(SHAPE_POLY_SET &aOutlines, wxString *aErrorText=nullptr, wxPoint *aErrorLocation=nullptr)
Function GetBoardPolygonOutlines Extracts the board outlines and build a closed polygon from lines,...
const SEG CSegment(int aIndex) const
Function CSegment()
const SHAPE_LINE_CHAIN & COutline(int aIndex) const
size_t i
Definition: json11.cpp:597
std::shared_ptr< FILE_OUTPUTFORMATTER > m_out
static double iu2hyp(double iu)

References SHAPE_POLY_SET::COutline(), SHAPE_LINE_CHAIN::CSegment(), BOARD::GetBoardPolygonOutlines(), BOARD::GetFileName(), i, iu2hyp(), BOARD_EXPORTER_BASE::m_board, m_out, and SHAPE_POLY_SET::OutlineCount().

Referenced by Run().

◆ writeDevices()

bool HYPERLYNX_EXPORTER::writeDevices ( )
private

Definition at line 348 of file export_hyperlynx.cpp.

349 {
350  m_out->Print( 0, "{DEVICES\n" );
351 
352  for( auto mod : m_board->Modules() )
353  {
354  wxString ref = mod->GetReference();
355  auto layerName = m_board->GetLayerName( mod->GetLayer() );
356 
357  if( ref.IsEmpty() )
358  ref = "EMPTY";
359 
360  m_out->Print( 1, "(? REF=\"%s\" L=\"%s\")\n", (const char*) ref.c_str(),
361  (const char*) layerName.c_str() );
362  }
363  m_out->Print( 0, "}\n\n" );
364 
365  return true;
366 }
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Function GetLayerName returns the name of a layer given by aLayer.
DLIST_ITERATOR_WRAPPER< MODULE > Modules()
Definition: class_board.h:252
std::shared_ptr< FILE_OUTPUTFORMATTER > m_out
#define mod(a, n)
Definition: greymap.cpp:24

References BOARD::GetLayerName(), BOARD_EXPORTER_BASE::m_board, m_out, mod, and BOARD::Modules().

Referenced by Run().

◆ writeNetObjects()

bool HYPERLYNX_EXPORTER::writeNetObjects ( const std::vector< BOARD_ITEM * > &  aObjects)
private

Definition at line 396 of file export_hyperlynx.cpp.

397 {
398  for( auto item : aObjects )
399  {
400  if( D_PAD* pad = dyn_cast<D_PAD*>( item ) )
401  {
402  auto pstackIter = m_padMap.find( pad );
403 
404  if( pstackIter != m_padMap.end() )
405  {
406  wxString ref = pad->GetParent()->GetReference();
407 
408  if( ref.IsEmpty() )
409  ref = "EMPTY";
410 
411  auto padName = pad->GetName();
412 
413  if( padName.IsEmpty() )
414  padName = "1";
415 
416 
417  m_out->Print( 1, "(PIN X=%.10f Y=%.10f R=\"%s.%s\" P=%d)\n",
418  iu2hyp( pad->GetPosition().x ), iu2hyp( pad->GetPosition().y ),
419  (const char*) ref.c_str(), (const char*) padName.c_str(),
420  pstackIter->second->GetId() );
421  }
422  }
423  else if( VIA* via = dyn_cast<VIA*>( item ) )
424  {
425  auto pstackIter = m_padMap.find( via );
426 
427  if( pstackIter != m_padMap.end() )
428  {
429  m_out->Print( 1, "(VIA X=%.10f Y=%.10f P=%d)\n", iu2hyp( via->GetPosition().x ),
430  iu2hyp( via->GetPosition().y ), pstackIter->second->GetId() );
431  }
432  }
433  else if( TRACK* track = dyn_cast<TRACK*>( item ) )
434  {
435  const auto layerName = m_board->GetLayerName( track->GetLayer() );
436 
437  m_out->Print( 1, "(SEG X1=%.10f Y1=%.10f X2=%.10f Y2=%.10f W=%.10f L=\"%s\")\n",
438  iu2hyp( track->GetStart().x ), iu2hyp( track->GetStart().y ),
439  iu2hyp( track->GetEnd().x ), iu2hyp( track->GetEnd().y ),
440  iu2hyp( track->GetWidth() ), (const char*) layerName.c_str() );
441  }
442  else if( ZONE_CONTAINER* zone = dyn_cast<ZONE_CONTAINER*>( item ) )
443  {
444  const auto layerName = m_board->GetLayerName( zone->GetLayer() );
445  SHAPE_POLY_SET filledShape = zone->GetFilledPolysList();
446 
447  filledShape.Simplify( SHAPE_POLY_SET::PM_FAST );
448 
449  for( int i = 0; i < filledShape.OutlineCount(); i++ )
450  {
451  const auto& outl = filledShape.COutline( i );
452 
453  auto p0 = outl.CPoint( 0 );
454  m_out->Print( 1, "{POLYGON T=POUR L=\"%s\" ID=%d X=%.10f Y=%.10f\n",
455  (const char*) layerName.c_str(), m_polyId, iu2hyp( p0.x ), iu2hyp( p0.y ) );
456 
457  for( int v = 0; v < outl.PointCount(); v++ )
458  {
459  m_out->Print( 2, "(LINE X=%.10f Y=%.10f)\n", iu2hyp( outl.CPoint( v ).x ),
460  iu2hyp( outl.CPoint( v ).y ) );
461  }
462 
463  m_out->Print( 2, "(LINE X=%.10f Y=%.10f)\n", iu2hyp( p0.x ), iu2hyp( p0.y ) );
464  m_out->Print( 1, "}\n" );
465 
466  for( int h = 0; h < filledShape.HoleCount( i ); h++ )
467  {
468  const auto& holeShape = filledShape.CHole( i, h );
469  auto ph0 = holeShape.CPoint( 0 );
470 
471  m_out->Print( 1, "{POLYVOID ID=%d X=%.10f Y=%.10f\n", m_polyId, iu2hyp( ph0.x ),
472  iu2hyp( ph0.y ) );
473 
474  for( int v = 0; v < holeShape.PointCount(); v++ )
475  {
476  m_out->Print( 2, "(LINE X=%.10f Y=%.10f)\n",
477  iu2hyp( holeShape.CPoint( v ).x ),
478  iu2hyp( holeShape.CPoint( v ).y ) );
479  }
480 
481  m_out->Print( 2, "(LINE X=%.10f Y=%.10f)\n", iu2hyp( ph0.x ), iu2hyp( ph0.y ) );
482  m_out->Print( 1, "}\n" );
483  }
484 
485  m_polyId++;
486  }
487  }
488  }
489 
490  return true;
491 }
Class ZONE_CONTAINER handles a list of polygons defining a copper zone.
Definition: class_zone.h:59
int OutlineCount() const
Returns the number of outlines in the set
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Function GetLayerName returns the name of a layer given by aLayer.
const SHAPE_LINE_CHAIN & CHole(int aOutline, int aHole) const
const VECTOR2I & CPoint(int aIndex) const
Function CPoint()
Class SHAPE_POLY_SET.
std::map< BOARD_ITEM *, HYPERLYNX_PAD_STACK * > m_padMap
void Simplify(POLYGON_MODE aFastMode)
Simplifies the polyset (merges overlapping polys, eliminates degeneracy/self-intersections) For aFast...
int HoleCount(int aOutline) const
Returns the number of holes in a given outline
const SHAPE_LINE_CHAIN & COutline(int aIndex) const
size_t i
Definition: json11.cpp:597
std::shared_ptr< FILE_OUTPUTFORMATTER > m_out
static double iu2hyp(double iu)

References SHAPE_POLY_SET::CHole(), SHAPE_POLY_SET::COutline(), SHAPE_LINE_CHAIN::CPoint(), BOARD::GetLayerName(), SHAPE_POLY_SET::HoleCount(), i, iu2hyp(), BOARD_EXPORTER_BASE::m_board, m_out, m_padMap, m_polyId, SHAPE_POLY_SET::OutlineCount(), SHAPE_POLY_SET::PM_FAST, and SHAPE_POLY_SET::Simplify().

Referenced by writeNets().

◆ writeNets()

bool HYPERLYNX_EXPORTER::writeNets ( )
private

Definition at line 529 of file export_hyperlynx.cpp.

530 {
531  m_polyId = 1;
532 
533  for( const auto netInfo : m_board->GetNetInfo() )
534  {
535  int netcode = netInfo->GetNet();
536  bool isNullNet = netInfo->GetNet() <= 0 || netInfo->GetNetname().IsEmpty();
537 
538  if( isNullNet )
539  continue;
540 
541  auto netObjects = collectNetObjects( netcode );
542 
543  if( netObjects.size() )
544  {
545  m_out->Print( 0, "{NET=\"%s\"\n", (const char*) netInfo->GetNetname().c_str() );
546  writeNetObjects( netObjects );
547  m_out->Print( 0, "}\n\n" );
548  }
549  }
550 
551  auto nullNetObjects = collectNetObjects( -1 );
552 
553  int idx = 0;
554 
555  for( auto item : nullNetObjects )
556  {
557  m_out->Print( 0, "{NET=\"EmptyNet%d\"\n", idx );
558  writeNetObjects( { item } );
559  m_out->Print( 0, "}\n\n" );
560  idx++;
561  }
562 
563  return true;
564 }
bool writeNetObjects(const std::vector< BOARD_ITEM * > &aObjects)
NETINFO_LIST & GetNetInfo()
Definition: class_board.h:748
const std::vector< BOARD_ITEM * > collectNetObjects(int netcode)
std::shared_ptr< FILE_OUTPUTFORMATTER > m_out

References collectNetObjects(), BOARD::GetNetInfo(), BOARD_EXPORTER_BASE::m_board, m_out, m_polyId, and writeNetObjects().

Referenced by Run().

◆ writePadStacks()

bool HYPERLYNX_EXPORTER::writePadStacks ( )
private

Definition at line 369 of file export_hyperlynx.cpp.

370 {
371  for( auto mod : m_board->Modules() )
372  {
373  for( auto pad : mod->Pads() )
374  {
375  auto ps = addPadStack( HYPERLYNX_PAD_STACK( m_board, pad ) );
376  m_padMap[pad] = ps;
377  }
378  }
379 
380  for( auto trk : m_board->Tracks() )
381  {
382  if( VIA* via = dyn_cast<VIA*>( trk ) )
383  {
384  auto ps = addPadStack( HYPERLYNX_PAD_STACK( m_board, via ) );
385  m_padMap[via] = ps;
386  }
387  }
388 
389  for( auto pstack : m_padStacks )
390  writeSinglePadStack( *pstack );
391 
392  return true;
393 }
std::vector< HYPERLYNX_PAD_STACK * > m_padStacks
HYPERLYNX_PAD_STACK * addPadStack(HYPERLYNX_PAD_STACK stack)
DLIST_ITERATOR_WRAPPER< MODULE > Modules()
Definition: class_board.h:252
std::map< BOARD_ITEM *, HYPERLYNX_PAD_STACK * > m_padMap
void writeSinglePadStack(HYPERLYNX_PAD_STACK &aStack)
DLIST_ITERATOR_WRAPPER< TRACK > Tracks()
Definition: class_board.h:251
#define mod(a, n)
Definition: greymap.cpp:24

References addPadStack(), BOARD_EXPORTER_BASE::m_board, m_padMap, m_padStacks, mod, BOARD::Modules(), BOARD::Tracks(), and writeSinglePadStack().

Referenced by Run().

◆ writeSinglePadStack()

void HYPERLYNX_EXPORTER::writeSinglePadStack ( HYPERLYNX_PAD_STACK aStack)
private

Definition at line 265 of file export_hyperlynx.cpp.

266 {
267  LSET layerMask = LSET::AllCuMask() & m_board->GetEnabledLayers();
268  LSET outLayers = aStack.m_layers & layerMask;
269 
270  if( outLayers.none() )
271  return;
272 
273  m_out->Print( 0, "{PADSTACK=%d, %.9f\n", aStack.m_id, iu2hyp( aStack.m_drill ) );
274 
275  if( outLayers == layerMask )
276  {
277  m_out->Print( 1, "(\"%s\", %s)\n", "MDEF", formatPadShape( aStack ).c_str() );
278  }
279  else
280  {
281  for( auto l : outLayers.Seq() )
282  {
283  m_out->Print( 1, "(\"%s\", %s)\n", (const char*) m_board->GetLayerName( l ).c_str(),
284  formatPadShape( aStack ).c_str() );
285  }
286  }
287 
288  m_out->Print( 0, "}\n\n" );
289 }
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Function AllCuMask returns a mask holding the requested number of Cu PCB_LAYER_IDs.
Definition: lset.cpp:676
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Function GetLayerName returns the name of a layer given by aLayer.
LSET GetEnabledLayers() const
Function GetEnabledLayers is a proxy function that calls the corresponding function in m_BoardSetting...
LSEQ Seq(const PCB_LAYER_ID *aWishListSequence, unsigned aCount) const
Function Seq returns an LSEQ from the union of this LSET and a desired sequence.
Definition: lset.cpp:367
Class LSET is a set of PCB_LAYER_IDs.
const std::string formatPadShape(HYPERLYNX_PAD_STACK &aStack)
std::shared_ptr< FILE_OUTPUTFORMATTER > m_out
static double iu2hyp(double iu)

References LSET::AllCuMask(), formatPadShape(), BOARD::GetEnabledLayers(), BOARD::GetLayerName(), iu2hyp(), BOARD_EXPORTER_BASE::m_board, HYPERLYNX_PAD_STACK::m_drill, HYPERLYNX_PAD_STACK::m_id, HYPERLYNX_PAD_STACK::m_layers, m_out, and LSET::Seq().

Referenced by writePadStacks().

◆ writeStackupInfo()

bool HYPERLYNX_EXPORTER::writeStackupInfo ( )
private

Definition at line 323 of file export_hyperlynx.cpp.

324 {
325  auto layers = m_board->GetDesignSettings().GetEnabledLayers().CuStack();
326 
327  m_out->Print( 0, "{STACKUP\n" );
328 
329  for( auto l : layers )
330  {
331  const auto name = m_board->GetLayerName( l );
332 
333  m_out->Print( 1, "(SIGNAL T=0.002284 P=0.000000 C=1.724e-8 L=\"%s\" M=COPPER)\n",
334  (const char*) name.c_str() );
335 
336  if( l != B_Cu )
337  {
338  m_out->Print( 1, "(DIELECTRIC T=0.007087 C=3.660000 L=\"DE_%s\" M=FR4)\n",
339  (const char*) name.c_str() );
340  }
341  }
342  m_out->Print( 0, "}\n\n" );
343 
344  return true;
345 }
LSEQ CuStack() const
Function CuStack returns a sequence of copper layers in starting from the front/top and extending to ...
Definition: lset.cpp:150
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Function GetLayerName returns the name of a layer given by aLayer.
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:534
const char * name
Definition: DXF_plotter.cpp:61
LSET GetEnabledLayers() const
Function GetEnabledLayers returns a bit-mask of all the layers that are enabled.
std::shared_ptr< FILE_OUTPUTFORMATTER > m_out

References B_Cu, LSET::CuStack(), BOARD::GetDesignSettings(), BOARD_DESIGN_SETTINGS::GetEnabledLayers(), BOARD::GetLayerName(), BOARD_EXPORTER_BASE::m_board, m_out, and name.

Referenced by Run().

Member Data Documentation

◆ m_board

◆ m_out

std::shared_ptr<FILE_OUTPUTFORMATTER> HYPERLYNX_EXPORTER::m_out
private

◆ m_outputFilePath

wxFileName BOARD_EXPORTER_BASE::m_outputFilePath
protectedinherited

Definition at line 85 of file board_exporter_base.h.

Referenced by Run(), and BOARD_EXPORTER_BASE::SetOutputFilename().

◆ m_padMap

std::map<BOARD_ITEM*, HYPERLYNX_PAD_STACK*> HYPERLYNX_EXPORTER::m_padMap
private

Definition at line 218 of file export_hyperlynx.cpp.

Referenced by writeNetObjects(), and writePadStacks().

◆ m_padStacks

std::vector<HYPERLYNX_PAD_STACK*> HYPERLYNX_EXPORTER::m_padStacks
private

Definition at line 217 of file export_hyperlynx.cpp.

Referenced by addPadStack(), and writePadStacks().

◆ m_polyId

int HYPERLYNX_EXPORTER::m_polyId
private

Definition at line 222 of file export_hyperlynx.cpp.

Referenced by writeNetObjects(), and writeNets().

◆ m_progressReporter

PROGRESS_REPORTER* BOARD_EXPORTER_BASE::m_progressReporter = nullptr
protectedinherited

Definition at line 87 of file board_exporter_base.h.

Referenced by BOARD_EXPORTER_BASE::SetProgressReporter().

◆ m_properties

PROPERTIES BOARD_EXPORTER_BASE::m_properties
protectedinherited

Definition at line 83 of file board_exporter_base.h.

◆ m_reporter

REPORTER* BOARD_EXPORTER_BASE::m_reporter = nullptr
protectedinherited

Definition at line 86 of file board_exporter_base.h.

Referenced by formatPadShape(), and BOARD_EXPORTER_BASE::SetReporter().


The documentation for this class was generated from the following file: