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 683 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 1073 of file cadstar_archive_parser.cpp.

1074 {
1075  wxASSERT( aNode->GetName() == wxT( "ATTRNAME" ) );
1076 
1077  ID = GetXmlAttributeIDString( aNode, 0 );
1078  Name = GetXmlAttributeIDString( aNode, 1 );
1079 
1080  XNODE* cNode = aNode->GetChildren();
1081  wxString location = wxString::Format( "ATTRNAME -> %s", Name );
1082 
1083  for( ; cNode; cNode = cNode->GetNext() )
1084  {
1085  wxString cNodeName = cNode->GetName();
1086 
1087  if( cNodeName == wxT( "ATTROWNER" ) )
1088  {
1089  wxString attOwnerVal = GetXmlAttributeIDString( cNode, 0 );
1090 
1091  if( attOwnerVal == wxT( "ALL_ITEMS" ) )
1093  else if( attOwnerVal == wxT( "AREA" ) )
1095  else if( attOwnerVal == wxT( "BOARD" ) )
1097  else if( attOwnerVal == wxT( "COMPONENT" ) )
1099  else if( attOwnerVal == wxT( "CONNECTION" ) )
1101  else if( attOwnerVal == wxT( "COPPER" ) )
1103  else if( attOwnerVal == wxT( "DOCSYMBOL" ) )
1105  else if( attOwnerVal == wxT( "FIGURE" ) )
1107  else if( attOwnerVal == wxT( "NET" ) )
1109  else if( attOwnerVal == wxT( "NETCLASS" ) )
1111  else if( attOwnerVal == wxT( "PART" ) )
1113  else if( attOwnerVal == wxT( "PART_DEFINITION" ) )
1115  else if( attOwnerVal == wxT( "PIN" ) )
1117  else if( attOwnerVal == wxT( "SIGNALREF" ) )
1119  else if( attOwnerVal == wxT( "SYMBOL" ) )
1121  else if( attOwnerVal == wxT( "SYMDEF" ) )
1123  else if( attOwnerVal == wxT( "TEMPLATE" ) )
1125  else if( attOwnerVal == wxT( "TESTPOINT" ) )
1127  else
1128  THROW_UNKNOWN_PARAMETER_IO_ERROR( attOwnerVal, location );
1129  }
1130  else if( cNodeName == wxT( "ATTRUSAGE" ) )
1131  {
1132  wxString attUsageVal = GetXmlAttributeIDString( cNode, 0 );
1133 
1134  if( attUsageVal == wxT( "BOTH" ) )
1136  else if( attUsageVal == wxT( "COMPONENT" ) )
1138  else if( attUsageVal == wxT( "PART_DEFINITION" ) )
1140  else if( attUsageVal == wxT( "PART_LIBRARY" ) )
1142  else if( attUsageVal == wxT( "SYMBOL" ) )
1144  else
1145  THROW_UNKNOWN_PARAMETER_IO_ERROR( attUsageVal, location );
1146  }
1147  else if( cNodeName == wxT( "NOTRANSFER" ) )
1148  {
1149  NoTransfer = true;
1150  }
1151  else if( cNodeName == wxT( "COLUMNORDER" ) )
1152  {
1153  COLUMNORDER cOrder;
1154  cOrder.Parse( cNode, aContext );
1155  ColumnOrders.push_back( cOrder );
1156  }
1157  else if( cNodeName == wxT( "COLUMNWIDTH" ) )
1158  {
1159  COLUMNWIDTH cWidth;
1160  cWidth.Parse( cNode, aContext );
1161  ColumnWidths.push_back( cWidth );
1162  }
1163  else if( cNodeName == wxT( "COLUMNINVISIBLE" ) )
1164  {
1165  ColumnInvisible = true;
1166  }
1167  else
1168  {
1169  THROW_UNKNOWN_NODE_IO_ERROR( cNodeName, location );
1170  }
1171  }
1172 }
From CADSTAR Help: Assigned to Parts library Definitions and displayed by the Library searcher.
From CADSTAR Help: Assigned to Schematic Symbols and displayed on Schematic Designs.
std::vector< COLUMNWIDTH > ColumnWidths
From CADSTAR Help: Only used by non-Cadstar applications.
bool NoTransfer
True="All Design Types", False="Current Design Type" "All Design Types" Description from CADSTAR Help...
XNODE * GetChildren() const
Definition: xnode.h:62
std::vector< COLUMNORDER > ColumnOrders
wxString Name
Parenthesis aren't permitted in user attributes in CADSTAR.
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
From CADSTAR Help: Assigned to PCB components and displayed on PCB designs.
#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)
From CADSTAR Help: Assigned to both Schematic symbols and PCB components, and displayed on Schematic ...

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 707 of file cadstar_archive_parser.h.

◆ AttributeUsage

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

Definition at line 708 of file cadstar_archive_parser.h.

◆ ColumnInvisible

bool CADSTAR_ARCHIVE_PARSER::ATTRNAME::ColumnInvisible = false

Definition at line 718 of file cadstar_archive_parser.h.

◆ ColumnOrders

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

Definition at line 716 of file cadstar_archive_parser.h.

◆ ColumnWidths

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

Definition at line 717 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 703 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 709 of file cadstar_archive_parser.h.


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