KiCad PCB EDA Suite
CADSTAR_PCB_ARCHIVE_PARSER::LAYER Struct Reference

#include <cadstar_pcb_archive_parser.h>

Inheritance diagram for CADSTAR_PCB_ARCHIVE_PARSER::LAYER:

Public Member Functions

void Parse (XNODE *aNode, PARSER_CONTEXT *aContext) override
 

Public Attributes

LAYER_ID ID
 
wxString Name
 
wxString Description = wxEmptyString
 
LAYER_TYPE Type = LAYER_TYPE::UNDEFINED
 
LAYER_SUBTYPE SubType = LAYER_SUBTYPE::LAYERSUBTYPE_NONE
 
PHYSICAL_LAYER_ID PhysicalLayer
 If UNDEFINED, no physical layer is assigned (e.g. More...
 
LAYER_ID SwapLayerID = UNDEFINED_LAYER_ID
 If UNDEFINED_LAYER_ID, no swap layer. More...
 
ROUTING_BIAS RoutingBias = ROUTING_BIAS::UNBIASED
 
long Thickness = 0
 Note: Units of length are defined in file header. More...
 
MATERIAL_ID MaterialId = UNDEFINED_MATERIAL_ID
 
EMBEDDING Embedding = EMBEDDING::NONE
 
bool ReferencePlane = false
 
bool VariantLayer = false
 

Detailed Description

Definition at line 150 of file cadstar_pcb_archive_parser.h.

Member Function Documentation

◆ Parse()

void CADSTAR_PCB_ARCHIVE_PARSER::LAYER::Parse ( XNODE aNode,
PARSER_CONTEXT aContext 
)
override

Definition at line 371 of file cadstar_pcb_archive_parser.cpp.

372 {
373  wxASSERT( aNode->GetName() == wxT( "LAYER" ) );
374 
375  ID = GetXmlAttributeIDString( aNode, 0 );
376  Name = GetXmlAttributeIDString( aNode, 1 );
377 
378  XNODE* cNode = aNode->GetChildren();
379  auto processLayerMaterialDetails = [&]() {
380  XNODE* tempNode = cNode->GetChildren();
381  for( ; tempNode; tempNode = tempNode->GetNext() )
382  {
383  wxString tempNodeName = tempNode->GetName();
384 
385  if( tempNodeName == wxT( "MAKE" ) || tempNodeName == wxT( "LAYERHEIGHT" ) )
386  {
387  if( tempNodeName == wxT( "LAYERHEIGHT" ) )
388  {
389  Thickness = GetXmlAttributeIDLong( tempNode, 0 );
390  }
391  else
392  {
393  MaterialId = GetXmlAttributeIDString( tempNode, 0 );
394  Thickness = GetXmlAttributeIDLong( tempNode, 1 );
395  }
396 
397  XNODE* childOfTempNode = tempNode->GetChildren();
398 
399  if( childOfTempNode )
400  {
401  if( childOfTempNode->GetName() == wxT( "EMBEDS" ) )
402  {
403  wxString embedsValue = GetXmlAttributeIDString( childOfTempNode, 0 );
404 
405  if( embedsValue == wxT( "UPWARDS" ) )
406  {
408  }
409  else if( embedsValue == wxT( "DOWNWARDS" ) )
410  {
412  }
413  else
414  {
416  wxString::Format( wxT( "LAYER %s -> EMBEDS" ),
417  Name ) );
418  }
419  }
420  else
421  {
422  THROW_UNKNOWN_NODE_IO_ERROR( childOfTempNode->GetName(),
423  wxString::Format( wxT( "LAYER %s->MAKE" ),
424  Name ) );
425  }
426  }
427  }
428  else if( tempNodeName == wxT( "BIAS" ) )
429  {
430  wxString bias = GetXmlAttributeIDString( tempNode, 0 );
431 
432  if( bias == wxT( "X_BIASED" ) )
433  {
435  }
436  else if( bias == wxT( "Y_BIASED" ) )
437  {
439  }
440  else if( bias == wxT( "ANTITRACK" ) )
441  {
443  }
444  else if( bias == wxT( "OBSTACLE" ) )
445  {
447  }
448  else if( bias == wxT( "UNBIASED" ) )
449  {
451  }
452  else
453  {
455  wxString::Format( wxT( "LAYER %s -> BIAS" ),
456  Name ) );
457  }
458  }
459  else
460  {
461  THROW_UNKNOWN_NODE_IO_ERROR( tempNodeName, wxString::Format( wxT( "LAYER %s" ),
462  Name ) );
463  }
464  }
465  };
466 
467  for( ; cNode; cNode = cNode->GetNext() )
468  {
469  wxString cNodeName = cNode->GetName();
470 
471  if( cNodeName == wxT( "ALLDOC" ) )
472  {
474  }
475  else if( cNodeName == wxT( "ALLELEC" ) )
476  {
478  }
479  else if( cNodeName == wxT( "ALLLAYER" ) )
480  {
482  }
483  else if( cNodeName == wxT( "ASSCOMPCOPP" ) )
484  {
486  }
487  else if( cNodeName == wxT( "JUMPERLAYER" ) )
488  {
490  }
491  else if( cNodeName == wxT( "NOLAYER" ) )
492  {
494  }
495  else if( cNodeName == wxT( "POWER" ) )
496  {
498  PhysicalLayer = GetXmlAttributeIDLong( cNode, 0 );
499  processLayerMaterialDetails();
500  }
501  else if( cNodeName == wxT( "DOC" ) )
502  {
504  }
505  else if( cNodeName == wxT( "CONSTRUCTION" ) )
506  {
508  processLayerMaterialDetails();
509  }
510  else if( cNodeName == wxT( "ELEC" ) )
511  {
513  PhysicalLayer = GetXmlAttributeIDLong( cNode, 0 );
514  processLayerMaterialDetails();
515  }
516  else if( cNodeName == wxT( "NONELEC" ) )
517  {
519  PhysicalLayer = GetXmlAttributeIDLong( cNode, 0 );
520  processLayerMaterialDetails();
521  }
522  else if( cNodeName == wxT( "DESCRIPTION" ) )
523  {
524  Description = GetXmlAttributeIDString( cNode, 0 );
525  }
526  else if( cNodeName == wxT( "REFPLANE" ) )
527  {
528  ReferencePlane = true;
529  }
530  else if( cNodeName == wxT( "VLAYER" ) )
531  {
532  VariantLayer = true;
533  }
534  else if( cNodeName == wxT( "LASUBTYP" ) )
535  {
536  //Process subtype
537  wxString sSubType = GetXmlAttributeIDString( cNode, 0 );
538 
539  if( sSubType == wxT( "LAYERSUBTYPE_ASSEMBLY" ) )
540  {
542  }
543  else if( sSubType == wxT( "LAYERSUBTYPE_PASTE" ) )
544  {
546  }
547  else if( sSubType == wxT( "LAYERSUBTYPE_PLACEMENT" ) )
548  {
550  }
551  else if( sSubType == wxT( "LAYERSUBTYPE_SILKSCREEN" ) )
552  {
554  }
555  else if( sSubType == wxT( "LAYERSUBTYPE_SOLDERRESIST" ) )
556  {
558  }
559  else if( sSubType == wxT( "LAYERSUBTYPE_CLEARANCE" ) )
560  {
562  }
563  else if( sSubType == wxT( "LAYERSUBTYPE_ROUT" ) )
564  {
566  }
567  else
568  {
569  THROW_UNKNOWN_PARAMETER_IO_ERROR( sSubType, wxString::Format( wxT( "LAYER %s %s" ),
570  Name, cNodeName ) );
571  }
572  }
573  else
574  {
575  THROW_UNKNOWN_NODE_IO_ERROR( cNodeName, wxString::Format( wxT( "LAYER %s" ), Name ) );
576  }
577  }
578 }
Inbuilt layer type (cannot be assigned to user layers)
Inbuilt layer type (cannot be assigned to user layers)
Inbuilt layer type (cannot be assigned to user layers)
long Thickness
Note: Units of length are defined in file header.
XNODE * GetChildren() const
Definition: xnode.h:62
Inbuilt layer type (cannot be assigned to user layers)
static long GetXmlAttributeIDLong(XNODE *aNode, unsigned int aID, bool aIsRequired=true)
Hold an XML or S-expression element.
Definition: xnode.h:43
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
XNODE * GetNext() const
Definition: xnode.h:67
Inbuilt layer type (cannot be assigned to user layers)
PHYSICAL_LAYER_ID PhysicalLayer
If UNDEFINED, no physical layer is assigned (e.g.
Inbuilt layer type (cannot be assigned to user layers)
#define THROW_UNKNOWN_NODE_IO_ERROR(nodename, location)
static wxString GetXmlAttributeIDString(XNODE *aNode, unsigned int aID, bool aIsRequired=true)
#define THROW_UNKNOWN_PARAMETER_IO_ERROR(param, location)

References CADSTAR_PCB_ARCHIVE_PARSER::ABOVE, CADSTAR_PCB_ARCHIVE_PARSER::ALLDOC, CADSTAR_PCB_ARCHIVE_PARSER::ALLELEC, CADSTAR_PCB_ARCHIVE_PARSER::ALLLAYER, CADSTAR_PCB_ARCHIVE_PARSER::ANTI_ROUTE, CADSTAR_PCB_ARCHIVE_PARSER::ASSCOMPCOPP, CADSTAR_PCB_ARCHIVE_PARSER::BELOW, CADSTAR_PCB_ARCHIVE_PARSER::CONSTRUCTION, CADSTAR_PCB_ARCHIVE_PARSER::DOC, CADSTAR_PCB_ARCHIVE_PARSER::ELEC, Format(), XNODE::GetChildren(), XNODE::GetNext(), CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDLong(), CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDString(), CADSTAR_PCB_ARCHIVE_PARSER::JUMPERLAYER, CADSTAR_PCB_ARCHIVE_PARSER::LAYERSUBTYPE_ASSEMBLY, CADSTAR_PCB_ARCHIVE_PARSER::LAYERSUBTYPE_CLEARANCE, CADSTAR_PCB_ARCHIVE_PARSER::LAYERSUBTYPE_PASTE, CADSTAR_PCB_ARCHIVE_PARSER::LAYERSUBTYPE_PLACEMENT, CADSTAR_PCB_ARCHIVE_PARSER::LAYERSUBTYPE_ROUT, CADSTAR_PCB_ARCHIVE_PARSER::LAYERSUBTYPE_SILKSCREEN, CADSTAR_PCB_ARCHIVE_PARSER::LAYERSUBTYPE_SOLDERRESIST, CADSTAR_PCB_ARCHIVE_PARSER::NOLAYER, CADSTAR_PCB_ARCHIVE_PARSER::NONELEC, CADSTAR_PCB_ARCHIVE_PARSER::OBSTACLE, CADSTAR_PCB_ARCHIVE_PARSER::POWER, THROW_UNKNOWN_NODE_IO_ERROR, THROW_UNKNOWN_PARAMETER_IO_ERROR, CADSTAR_PCB_ARCHIVE_PARSER::UNBIASED, CADSTAR_PCB_ARCHIVE_PARSER::X, and CADSTAR_PCB_ARCHIVE_PARSER::Y.

Referenced by CADSTAR_PCB_ARCHIVE_PARSER::LAYERDEFS::Parse().

Member Data Documentation

◆ Description

wxString CADSTAR_PCB_ARCHIVE_PARSER::LAYER::Description = wxEmptyString

Definition at line 154 of file cadstar_pcb_archive_parser.h.

◆ Embedding

EMBEDDING CADSTAR_PCB_ARCHIVE_PARSER::LAYER::Embedding = EMBEDDING::NONE

◆ ID

◆ MaterialId

MATERIAL_ID CADSTAR_PCB_ARCHIVE_PARSER::LAYER::MaterialId = UNDEFINED_MATERIAL_ID

◆ Name

◆ PhysicalLayer

PHYSICAL_LAYER_ID CADSTAR_PCB_ARCHIVE_PARSER::LAYER::PhysicalLayer
Initial value:

If UNDEFINED, no physical layer is assigned (e.g.

documentation and construction layers)

Definition at line 157 of file cadstar_pcb_archive_parser.h.

◆ ReferencePlane

bool CADSTAR_PCB_ARCHIVE_PARSER::LAYER::ReferencePlane = false

Definition at line 166 of file cadstar_pcb_archive_parser.h.

◆ RoutingBias

ROUTING_BIAS CADSTAR_PCB_ARCHIVE_PARSER::LAYER::RoutingBias = ROUTING_BIAS::UNBIASED

Definition at line 162 of file cadstar_pcb_archive_parser.h.

◆ SubType

◆ SwapLayerID

LAYER_ID CADSTAR_PCB_ARCHIVE_PARSER::LAYER::SwapLayerID = UNDEFINED_LAYER_ID

If UNDEFINED_LAYER_ID, no swap layer.

Definition at line 161 of file cadstar_pcb_archive_parser.h.

◆ Thickness

long CADSTAR_PCB_ARCHIVE_PARSER::LAYER::Thickness = 0

Note: Units of length are defined in file header.

Definition at line 163 of file cadstar_pcb_archive_parser.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::initStackupItem().

◆ Type

◆ VariantLayer

bool CADSTAR_PCB_ARCHIVE_PARSER::LAYER::VariantLayer = false

Definition at line 167 of file cadstar_pcb_archive_parser.h.


The documentation for this struct was generated from the following files: