KiCad PCB EDA Suite
CADSTAR_PCB_ARCHIVE_PARSER::AREA Struct Reference

From CADSTAR Help: "Area is for creating areas within which, and nowhere else, certain operations are carried out (e.g. More...

#include <cadstar_pcb_archive_parser.h>

Inheritance diagram for CADSTAR_PCB_ARCHIVE_PARSER::AREA:
CADSTAR_ARCHIVE_PARSER::PARSER

Public Member Functions

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

Public Attributes

AREA_ID ID
 
LINECODE_ID LineCodeID
 
wxString Name
 
LAYER_ID LayerID
 
SHAPE Shape
 
RULESET_ID RuleSetID = wxEmptyString
 
bool Fixed = false
 
bool Placement = false
 From CADSTAR Help: "Auto Placement can place components within this area. More...
 
bool Routing = false
 From CADSTAR Help: "Area can be used to place routes during Automatic Routing. More...
 
bool Keepout = false
 From CADSTAR Help: "Auto Placement cannot place components within this area. More...
 
bool NoTracks = false
 From CADSTAR Help: "Area cannot be used to place routes during automatic routing. More...
 
bool NoVias = false
 From CADSTAR Help: "No vias will be placed within this area by the automatic router. More...
 
long AreaHeight = UNDEFINED_VALUE
 From CADSTAR Help: "The Height value specified for the PCB component is checked against the Height value assigned to the Area in which the component is placed. More...
 
GROUP_ID GroupID = wxEmptyString
 If not empty, this AREA is part of a group. More...
 
REUSEBLOCKREF ReuseBlockRef
 
std::map< ATTRIBUTE_ID, ATTRIBUTE_VALUEAttributeValues
 

Detailed Description

From CADSTAR Help: "Area is for creating areas within which, and nowhere else, certain operations are carried out (e.g.

Placement.); and for creating 'keep out' areas, within which no operations are carried out and where no items are placed by operations such as Placement and Routing. [...] More than one function can be assigned to an area."

Definition at line 818 of file cadstar_pcb_archive_parser.h.

Member Function Documentation

◆ Parse()

void CADSTAR_PCB_ARCHIVE_PARSER::AREA::Parse ( XNODE aNode,
PARSER_CONTEXT aContext 
)
overridevirtual

Implements CADSTAR_ARCHIVE_PARSER::PARSER.

Definition at line 1651 of file cadstar_pcb_archive_parser.cpp.

1652 {
1653  wxASSERT( aNode->GetName() == wxT( "AREA" ) );
1654 
1655  ID = GetXmlAttributeIDString( aNode, 0 );
1656  LineCodeID = GetXmlAttributeIDString( aNode, 1 );
1657  Name = GetXmlAttributeIDString( aNode, 2 );
1658  LayerID = GetXmlAttributeIDString( aNode, 4 );
1659 
1660  XNODE* cNode = aNode->GetChildren();
1661  bool shapeIsInitialised = false; // Stop more than one Shape Object
1662  wxString location = wxString::Format( "AREA %s", ID );
1663 
1664  if( !cNode )
1665  THROW_MISSING_NODE_IO_ERROR( wxT( "Shape" ), location );
1666 
1667  for( ; cNode; cNode = cNode->GetNext() )
1668  {
1669  wxString cNodeName = cNode->GetName();
1670 
1671  if( !shapeIsInitialised && SHAPE::IsShape( cNode ) )
1672  {
1673  Shape.Parse( cNode, aContext );
1674  shapeIsInitialised = true;
1675  }
1676  else if( cNodeName == wxT( "FIX" ) )
1677  {
1678  Fixed = true;
1679  }
1680  else if( cNodeName == wxT( "USAGE" ) )
1681  {
1682  wxXmlAttribute* xmlAttribute = cNode->GetAttributes();
1683 
1684  for( ; xmlAttribute; xmlAttribute = xmlAttribute->GetNext() )
1685  {
1686  if( !IsValidAttribute( xmlAttribute ) )
1687  continue;
1688 
1689  if( xmlAttribute->GetValue() == wxT( "PLACEMENT" ) )
1690  Placement = true;
1691  else if( xmlAttribute->GetValue() == wxT( "ROUTING" ) )
1692  Routing = true;
1693  else if( xmlAttribute->GetValue() == wxT( "KEEPOUT" ) )
1694  Keepout = true;
1695  else if( xmlAttribute->GetValue() == wxT( "NO_TRACKS" ) )
1696  NoTracks = true;
1697  else if( xmlAttribute->GetValue() == wxT( "NO_VIAS" ) )
1698  NoVias = true;
1699  else
1700  THROW_UNKNOWN_PARAMETER_IO_ERROR( xmlAttribute->GetValue(), location );
1701  }
1702 
1703  CheckNoChildNodes( cNode );
1704  }
1705  else if( cNodeName == wxT( "AREAHEIGHT" ) )
1706  {
1707  AreaHeight = GetXmlAttributeIDLong( cNode, 0 );
1708  }
1709  else if( cNodeName == wxT( "GROUPREF" ) )
1710  {
1711  GroupID = GetXmlAttributeIDString( cNode, 0 );
1712  }
1713  else if( cNodeName == wxT( "REUSEBLOCKREF" ) )
1714  {
1715  ReuseBlockRef.Parse( cNode, aContext );
1716  }
1717  else if( cNodeName == wxT( "ATTR" ) )
1718  {
1719  ATTRIBUTE_VALUE attr;
1720  attr.Parse( cNode, aContext );
1721  AttributeValues.insert( std::make_pair( attr.AttributeID, attr ) );
1722  }
1723  else
1724  {
1725  THROW_UNKNOWN_NODE_IO_ERROR( cNodeName, location );
1726  }
1727  }
1728 }
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
std::map< ATTRIBUTE_ID, ATTRIBUTE_VALUE > AttributeValues
static bool IsValidAttribute(wxXmlAttribute *aAttribute)
bool Routing
From CADSTAR Help: "Area can be used to place routes during Automatic Routing.
static void CheckNoChildNodes(XNODE *aNode)
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
GROUP_ID GroupID
If not empty, this AREA is part of a group.
XNODE * GetChildren() const
Definition: xnode.h:62
bool Placement
From CADSTAR Help: "Auto Placement can place components within this area.
long AreaHeight
From CADSTAR Help: "The Height value specified for the PCB component is checked against the Height va...
#define THROW_MISSING_NODE_IO_ERROR(nodename, location)
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
bool Keepout
From CADSTAR Help: "Auto Placement cannot place components within this area.
XNODE * GetNext() const
Definition: xnode.h:67
bool NoTracks
From CADSTAR Help: "Area cannot be used to place routes during automatic routing.
#define THROW_UNKNOWN_NODE_IO_ERROR(nodename, location)
bool NoVias
From CADSTAR Help: "No vias will be placed within this area by the automatic router.
static wxString GetXmlAttributeIDString(XNODE *aNode, unsigned int aID, bool aIsRequired=true)
#define THROW_UNKNOWN_PARAMETER_IO_ERROR(param, location)

References CADSTAR_ARCHIVE_PARSER::ATTRIBUTE_VALUE::AttributeID, CADSTAR_ARCHIVE_PARSER::CheckNoChildNodes(), Format(), XNODE::GetChildren(), XNODE::GetNext(), CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDLong(), CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDString(), CADSTAR_ARCHIVE_PARSER::SHAPE::IsShape(), CADSTAR_ARCHIVE_PARSER::IsValidAttribute(), CADSTAR_ARCHIVE_PARSER::ATTRIBUTE_VALUE::Parse(), THROW_MISSING_NODE_IO_ERROR, THROW_UNKNOWN_NODE_IO_ERROR, and THROW_UNKNOWN_PARAMETER_IO_ERROR.

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

Member Data Documentation

◆ AreaHeight

long CADSTAR_PCB_ARCHIVE_PARSER::AREA::AreaHeight = UNDEFINED_VALUE

From CADSTAR Help: "The Height value specified for the PCB component is checked against the Height value assigned to the Area in which the component is placed.

If the component height exceeds the area height, an error is output"

Definition at line 842 of file cadstar_pcb_archive_parser.h.

◆ AttributeValues

std::map<ATTRIBUTE_ID, ATTRIBUTE_VALUE> CADSTAR_PCB_ARCHIVE_PARSER::AREA::AttributeValues

Definition at line 850 of file cadstar_pcb_archive_parser.h.

◆ Fixed

bool CADSTAR_PCB_ARCHIVE_PARSER::AREA::Fixed = false

Definition at line 829 of file cadstar_pcb_archive_parser.h.

◆ GroupID

GROUP_ID CADSTAR_PCB_ARCHIVE_PARSER::AREA::GroupID = wxEmptyString

If not empty, this AREA is part of a group.

Definition at line 848 of file cadstar_pcb_archive_parser.h.

◆ ID

AREA_ID CADSTAR_PCB_ARCHIVE_PARSER::AREA::ID

◆ Keepout

bool CADSTAR_PCB_ARCHIVE_PARSER::AREA::Keepout = false

From CADSTAR Help: "Auto Placement cannot place components within this area.

"

Definition at line 835 of file cadstar_pcb_archive_parser.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::loadAreas().

◆ LayerID

LAYER_ID CADSTAR_PCB_ARCHIVE_PARSER::AREA::LayerID

Definition at line 823 of file cadstar_pcb_archive_parser.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::loadAreas().

◆ LineCodeID

LINECODE_ID CADSTAR_PCB_ARCHIVE_PARSER::AREA::LineCodeID

Definition at line 821 of file cadstar_pcb_archive_parser.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::loadAreas().

◆ Name

wxString CADSTAR_PCB_ARCHIVE_PARSER::AREA::Name

Definition at line 822 of file cadstar_pcb_archive_parser.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::loadAreas().

◆ NoTracks

bool CADSTAR_PCB_ARCHIVE_PARSER::AREA::NoTracks = false

From CADSTAR Help: "Area cannot be used to place routes during automatic routing.

"

Definition at line 837 of file cadstar_pcb_archive_parser.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::loadAreas().

◆ NoVias

bool CADSTAR_PCB_ARCHIVE_PARSER::AREA::NoVias = false

From CADSTAR Help: "No vias will be placed within this area by the automatic router.

"

Definition at line 839 of file cadstar_pcb_archive_parser.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::loadAreas().

◆ Placement

bool CADSTAR_PCB_ARCHIVE_PARSER::AREA::Placement = false

From CADSTAR Help: "Auto Placement can place components within this area.

"

Definition at line 831 of file cadstar_pcb_archive_parser.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::loadAreas().

◆ ReuseBlockRef

REUSEBLOCKREF CADSTAR_PCB_ARCHIVE_PARSER::AREA::ReuseBlockRef

Definition at line 849 of file cadstar_pcb_archive_parser.h.

◆ Routing

bool CADSTAR_PCB_ARCHIVE_PARSER::AREA::Routing = false

From CADSTAR Help: "Area can be used to place routes during Automatic Routing.

"

Definition at line 833 of file cadstar_pcb_archive_parser.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::loadAreas().

◆ RuleSetID

RULESET_ID CADSTAR_PCB_ARCHIVE_PARSER::AREA::RuleSetID = wxEmptyString

Definition at line 827 of file cadstar_pcb_archive_parser.h.

◆ Shape

SHAPE CADSTAR_PCB_ARCHIVE_PARSER::AREA::Shape

Definition at line 824 of file cadstar_pcb_archive_parser.h.

Referenced by CADSTAR_PCB_ARCHIVE_LOADER::loadAreas().


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