KiCad PCB EDA Suite
CADSTAR_ARCHIVE_PARSER::ATTRNAME Struct Reference

NOTE from CADSTAR help: To convert a Part Definition Attribute into a hyperlink, prefix the attribute name with "Link ". More...

#include <cadstar_archive_parser.h>

Inheritance diagram for CADSTAR_ARCHIVE_PARSER::ATTRNAME:
CADSTAR_ARCHIVE_PARSER::PARSER

Classes

struct  COLUMNORDER
 
struct  COLUMNWIDTH
 

Public Member Functions

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

Public Attributes

ATTRIBUTE_ID ID
 
wxString Name
 Parenthesis aren't permitted in user attributes in CADSTAR. More...
 
ATTROWNER AttributeOwner = ATTROWNER::ALL_ITEMS
 
ATTRUSAGE AttributeUsage = ATTRUSAGE::UNDEFINED
 
bool NoTransfer = false
 True="All Design Types", False="Current Design Type" "All Design Types" Description from CADSTAR Help: "The selected attribute name will be available when any design is displayed" "Current Design Type" From CADSTAR Help: This restricts the availability of the selected attribute name to the current design. More...
 
std::vector< COLUMNORDERColumnOrders
 
std::vector< COLUMNWIDTHColumnWidths
 
bool ColumnInvisible = false
 

Detailed Description

NOTE from CADSTAR help: To convert a Part Definition Attribute into a hyperlink, prefix the attribute name with "Link ".

Definition at line 727 of file cadstar_archive_parser.h.

Member Function Documentation

◆ Parse()

void CADSTAR_ARCHIVE_PARSER::ATTRNAME::Parse ( XNODE aNode,
PARSER_CONTEXT aContext 
)
overridevirtual

Implements CADSTAR_ARCHIVE_PARSER::PARSER.

Definition at line 1186 of file cadstar_archive_parser.cpp.

1187{
1188 wxASSERT( aNode->GetName() == wxT( "ATTRNAME" ) );
1189
1190 ID = GetXmlAttributeIDString( aNode, 0 );
1191 Name = GetXmlAttributeIDString( aNode, 1 );
1192
1193 XNODE* cNode = aNode->GetChildren();
1194 wxString location = wxString::Format( "ATTRNAME -> %s", Name );
1195
1196 for( ; cNode; cNode = cNode->GetNext() )
1197 {
1198 wxString cNodeName = cNode->GetName();
1199
1200 if( cNodeName == wxT( "ATTROWNER" ) )
1201 {
1202 wxString attOwnerVal = GetXmlAttributeIDString( cNode, 0 );
1203
1204 if( attOwnerVal == wxT( "ALL_ITEMS" ) )
1206 else if( attOwnerVal == wxT( "AREA" ) )
1208 else if( attOwnerVal == wxT( "BOARD" ) )
1210 else if( attOwnerVal == wxT( "COMPONENT" ) )
1212 else if( attOwnerVal == wxT( "CONNECTION" ) )
1214 else if( attOwnerVal == wxT( "COPPER" ) )
1216 else if( attOwnerVal == wxT( "DOCSYMBOL" ) )
1218 else if( attOwnerVal == wxT( "FIGURE" ) )
1220 else if( attOwnerVal == wxT( "NET" ) )
1222 else if( attOwnerVal == wxT( "NETCLASS" ) )
1224 else if( attOwnerVal == wxT( "PART" ) )
1226 else if( attOwnerVal == wxT( "PART_DEFINITION" ) )
1228 else if( attOwnerVal == wxT( "PIN" ) )
1230 else if( attOwnerVal == wxT( "SIGNALREF" ) )
1232 else if( attOwnerVal == wxT( "SYMBOL" ) )
1234 else if( attOwnerVal == wxT( "SYMDEF" ) )
1236 else if( attOwnerVal == wxT( "TEMPLATE" ) )
1238 else if( attOwnerVal == wxT( "TESTPOINT" ) )
1240 else
1241 THROW_UNKNOWN_PARAMETER_IO_ERROR( attOwnerVal, location );
1242 }
1243 else if( cNodeName == wxT( "ATTRUSAGE" ) )
1244 {
1245 wxString attUsageVal = GetXmlAttributeIDString( cNode, 0 );
1246
1247 if( attUsageVal == wxT( "BOTH" ) )
1249 else if( attUsageVal == wxT( "COMPONENT" ) )
1251 else if( attUsageVal == wxT( "PART_DEFINITION" ) )
1253 else if( attUsageVal == wxT( "PART_LIBRARY" ) )
1255 else if( attUsageVal == wxT( "SYMBOL" ) )
1257 else
1258 THROW_UNKNOWN_PARAMETER_IO_ERROR( attUsageVal, location );
1259 }
1260 else if( cNodeName == wxT( "NOTRANSFER" ) )
1261 {
1262 NoTransfer = true;
1263 }
1264 else if( cNodeName == wxT( "COLUMNORDER" ) )
1265 {
1266 COLUMNORDER cOrder;
1267 cOrder.Parse( cNode, aContext );
1268 ColumnOrders.push_back( cOrder );
1269 }
1270 else if( cNodeName == wxT( "COLUMNWIDTH" ) )
1271 {
1272 COLUMNWIDTH cWidth;
1273 cWidth.Parse( cNode, aContext );
1274 ColumnWidths.push_back( cWidth );
1275 }
1276 else if( cNodeName == wxT( "COLUMNINVISIBLE" ) )
1277 {
1278 ColumnInvisible = true;
1279 }
1280 else
1281 {
1282 THROW_UNKNOWN_NODE_IO_ERROR( cNodeName, location );
1283 }
1284 }
1285}
#define THROW_UNKNOWN_NODE_IO_ERROR(nodename, location)
#define THROW_UNKNOWN_PARAMETER_IO_ERROR(param, location)
@ PART_DEFINITION
From CADSTAR Help: Assigned to Parts library Definitions and displayed by the Library searcher.
@ BOTH
From CADSTAR Help: Assigned to both Schematic symbols and PCB components, and displayed on Schematic ...
@ COMPONENT
From CADSTAR Help: Assigned to PCB components and displayed on PCB designs.
@ SYMBOL
From CADSTAR Help: Assigned to Schematic Symbols and displayed on Schematic Designs.
@ PART_LIBRARY
From CADSTAR Help: Only used by non-Cadstar applications.
static wxString GetXmlAttributeIDString(XNODE *aNode, unsigned int aID, bool aIsRequired=true)
@ PART_DEFINITION
Only library Attributes.
@ PART
Only library Attributes.
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
std::vector< COLUMNWIDTH > ColumnWidths
bool NoTransfer
True="All Design Types", False="Current Design Type" "All Design Types" Description from CADSTAR Help...
std::vector< COLUMNORDER > ColumnOrders
wxString Name
Parenthesis aren't permitted in user attributes in CADSTAR.

References CADSTAR_ARCHIVE_PARSER::ALL_ITEMS, CADSTAR_ARCHIVE_PARSER::AREA, CADSTAR_ARCHIVE_PARSER::BOARD, CADSTAR_ARCHIVE_PARSER::BOTH, CADSTAR_ARCHIVE_PARSER::COMPONENT, CADSTAR_ARCHIVE_PARSER::CONNECTION, CADSTAR_ARCHIVE_PARSER::COPPER, CADSTAR_ARCHIVE_PARSER::DOCSYMBOL, CADSTAR_ARCHIVE_PARSER::FIGURE, Format(), XNODE::GetChildren(), XNODE::GetNext(), CADSTAR_ARCHIVE_PARSER::GetXmlAttributeIDString(), CADSTAR_ARCHIVE_PARSER::NET, CADSTAR_ARCHIVE_PARSER::NETCLASS, CADSTAR_ARCHIVE_PARSER::ATTRNAME::COLUMNORDER::Parse(), CADSTAR_ARCHIVE_PARSER::ATTRNAME::COLUMNWIDTH::Parse(), CADSTAR_ARCHIVE_PARSER::PART, CADSTAR_ARCHIVE_PARSER::PART_DEFINITION, CADSTAR_ARCHIVE_PARSER::PART_LIBRARY, CADSTAR_ARCHIVE_PARSER::PIN, CADSTAR_ARCHIVE_PARSER::SIGNALREF, CADSTAR_ARCHIVE_PARSER::SYMBOL, CADSTAR_ARCHIVE_PARSER::SYMDEF, CADSTAR_ARCHIVE_PARSER::TEMPLATE, CADSTAR_ARCHIVE_PARSER::TESTPOINT, THROW_UNKNOWN_NODE_IO_ERROR, and THROW_UNKNOWN_PARAMETER_IO_ERROR.

Referenced by CADSTAR_ARCHIVE_PARSER::CODEDEFS::ParseSubNode().

Member Data Documentation

◆ AttributeOwner

ATTROWNER CADSTAR_ARCHIVE_PARSER::ATTRNAME::AttributeOwner = ATTROWNER::ALL_ITEMS

Definition at line 751 of file cadstar_archive_parser.h.

◆ AttributeUsage

ATTRUSAGE CADSTAR_ARCHIVE_PARSER::ATTRNAME::AttributeUsage = ATTRUSAGE::UNDEFINED

Definition at line 752 of file cadstar_archive_parser.h.

◆ ColumnInvisible

bool CADSTAR_ARCHIVE_PARSER::ATTRNAME::ColumnInvisible = false

Definition at line 762 of file cadstar_archive_parser.h.

◆ ColumnOrders

std::vector<COLUMNORDER> CADSTAR_ARCHIVE_PARSER::ATTRNAME::ColumnOrders

Definition at line 760 of file cadstar_archive_parser.h.

◆ ColumnWidths

std::vector<COLUMNWIDTH> CADSTAR_ARCHIVE_PARSER::ATTRNAME::ColumnWidths

Definition at line 761 of file cadstar_archive_parser.h.

◆ ID

ATTRIBUTE_ID CADSTAR_ARCHIVE_PARSER::ATTRNAME::ID

◆ Name

wxString CADSTAR_ARCHIVE_PARSER::ATTRNAME::Name

Parenthesis aren't permitted in user attributes in CADSTAR.

Any Attributes in Parenthesis indicate an internal CADSTAR attribute Examples: "(PartDescription)" "(PartDefinitionNameStem)",etc. TODO: create a list of all CADSTAR internal attribute names.

Definition at line 747 of file cadstar_archive_parser.h.

◆ NoTransfer

bool CADSTAR_ARCHIVE_PARSER::ATTRNAME::NoTransfer = false

True="All Design Types", False="Current Design Type" "All Design Types" Description from CADSTAR Help: "The selected attribute name will be available when any design is displayed" "Current Design Type" From CADSTAR Help: This restricts the availability of the selected attribute name to the current design.

Definition at line 753 of file cadstar_archive_parser.h.


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