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 820 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 1679 of file cadstar_pcb_archive_parser.cpp.

1680{
1681 wxASSERT( aNode->GetName() == wxT( "AREA" ) );
1682
1683 ID = GetXmlAttributeIDString( aNode, 0 );
1684 LineCodeID = GetXmlAttributeIDString( aNode, 1 );
1685 Name = GetXmlAttributeIDString( aNode, 2 );
1686 LayerID = GetXmlAttributeIDString( aNode, 4 );
1687
1688 XNODE* cNode = aNode->GetChildren();
1689 bool shapeIsInitialised = false; // Stop more than one Shape Object
1690 wxString location = wxString::Format( wxT( "AREA %s" ), ID );
1691
1692 if( !cNode )
1693 THROW_MISSING_NODE_IO_ERROR( wxT( "Shape" ), location );
1694
1695 for( ; cNode; cNode = cNode->GetNext() )
1696 {
1697 wxString cNodeName = cNode->GetName();
1698
1699 if( !shapeIsInitialised && SHAPE::IsShape( cNode ) )
1700 {
1701 Shape.Parse( cNode, aContext );
1702 shapeIsInitialised = true;
1703 }
1704 else if( cNodeName == wxT( "FIX" ) )
1705 {
1706 Fixed = true;
1707 }
1708 else if( cNodeName == wxT( "USAGE" ) )
1709 {
1710 wxXmlAttribute* xmlAttribute = cNode->GetAttributes();
1711
1712 for( ; xmlAttribute; xmlAttribute = xmlAttribute->GetNext() )
1713 {
1714 if( !IsValidAttribute( xmlAttribute ) )
1715 continue;
1716
1717 if( xmlAttribute->GetValue() == wxT( "PLACEMENT" ) )
1718 Placement = true;
1719 else if( xmlAttribute->GetValue() == wxT( "ROUTING" ) )
1720 Routing = true;
1721 else if( xmlAttribute->GetValue() == wxT( "KEEPOUT" ) )
1722 Keepout = true;
1723 else if( xmlAttribute->GetValue() == wxT( "NO_TRACKS" ) )
1724 NoTracks = true;
1725 else if( xmlAttribute->GetValue() == wxT( "NO_VIAS" ) )
1726 NoVias = true;
1727 else
1728 THROW_UNKNOWN_PARAMETER_IO_ERROR( xmlAttribute->GetValue(), location );
1729 }
1730
1731 CheckNoChildNodes( cNode );
1732 }
1733 else if( cNodeName == wxT( "AREAHEIGHT" ) )
1734 {
1735 AreaHeight = GetXmlAttributeIDLong( cNode, 0 );
1736 }
1737 else if( cNodeName == wxT( "GROUPREF" ) )
1738 {
1739 GroupID = GetXmlAttributeIDString( cNode, 0 );
1740 }
1741 else if( cNodeName == wxT( "REUSEBLOCKREF" ) )
1742 {
1743 ReuseBlockRef.Parse( cNode, aContext );
1744 }
1745 else if( cNodeName == wxT( "ATTR" ) )
1746 {
1747 ATTRIBUTE_VALUE attr;
1748 attr.Parse( cNode, aContext );
1749 AttributeValues.insert( std::make_pair( attr.AttributeID, attr ) );
1750 }
1751 else
1752 {
1753 THROW_UNKNOWN_NODE_IO_ERROR( cNodeName, location );
1754 }
1755 }
1756}
#define THROW_MISSING_NODE_IO_ERROR(nodename, location)
#define THROW_UNKNOWN_NODE_IO_ERROR(nodename, location)
#define THROW_UNKNOWN_PARAMETER_IO_ERROR(param, location)
static wxString GetXmlAttributeIDString(XNODE *aNode, unsigned int aID, bool aIsRequired=true)
static bool IsValidAttribute(wxXmlAttribute *aAttribute)
static void CheckNoChildNodes(XNODE *aNode)
static long GetXmlAttributeIDLong(XNODE *aNode, unsigned int aID, bool aIsRequired=true)
Hold an XML or S-expression element.
Definition: xnode.h:44
XNODE * GetChildren() const
Definition: xnode.h:62
XNODE * GetNext() const
Definition: xnode.h:67
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
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
void Parse(XNODE *aNode, PARSER_CONTEXT *aContext) override
GROUP_ID GroupID
If not empty, this AREA is part of a group.
bool Keepout
From CADSTAR Help: "Auto Placement cannot place components within this area.
bool Placement
From CADSTAR Help: "Auto Placement can place components within this area.
bool NoVias
From CADSTAR Help: "No vias will be placed within this area by the automatic router.
long AreaHeight
From CADSTAR Help: "The Height value specified for the PCB component is checked against the Height va...
bool Routing
From CADSTAR Help: "Area can be used to place routes during Automatic Routing.
std::map< ATTRIBUTE_ID, ATTRIBUTE_VALUE > AttributeValues
bool NoTracks
From CADSTAR Help: "Area cannot be used to place routes during automatic routing.

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 844 of file cadstar_pcb_archive_parser.h.

◆ AttributeValues

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

Definition at line 852 of file cadstar_pcb_archive_parser.h.

◆ Fixed

bool CADSTAR_PCB_ARCHIVE_PARSER::AREA::Fixed = false

Definition at line 831 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 850 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 837 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 825 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 823 of file cadstar_pcb_archive_parser.h.

◆ Name

wxString CADSTAR_PCB_ARCHIVE_PARSER::AREA::Name

Definition at line 824 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 839 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 841 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 833 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 851 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 835 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 829 of file cadstar_pcb_archive_parser.h.

◆ Shape

SHAPE CADSTAR_PCB_ARCHIVE_PARSER::AREA::Shape

Definition at line 826 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: