KiCad PCB EDA Suite
PCAD2KICAD::PCB_NET Class Reference

#include <pcb_net.h>

Inheritance diagram for PCAD2KICAD::PCB_NET:

Public Member Functions

 PCB_NET (int aNetCode)
 
 ~PCB_NET ()
 
void Parse (XNODE *aNode)
 

Public Attributes

wxString m_Name
 
int m_NetCode
 
PCB_NET_NODES_ARRAY m_NetNodes
 

Detailed Description

Definition at line 48 of file pcb_net.h.

Constructor & Destructor Documentation

◆ PCB_NET()

PCAD2KICAD::PCB_NET::PCB_NET ( int  aNetCode)

Definition at line 46 of file pcb_net.cpp.

46 : m_NetCode( aNetCode )
47{
48 m_Name = wxEmptyString;
49}
wxString m_Name
Definition: pcb_net.h:56

References m_Name.

◆ ~PCB_NET()

PCAD2KICAD::PCB_NET::~PCB_NET ( )

Definition at line 52 of file pcb_net.cpp.

53{
54 int i;
55
56 for( i = 0; i < (int) m_NetNodes.GetCount(); i++ )
57 {
58 delete m_NetNodes[i];
59 }
60}
PCB_NET_NODES_ARRAY m_NetNodes
Definition: pcb_net.h:58

References m_NetNodes.

Member Function Documentation

◆ Parse()

void PCAD2KICAD::PCB_NET::Parse ( XNODE aNode)

Definition at line 63 of file pcb_net.cpp.

64{
65 wxString propValue, s1, s2;
66 PCB_NET_NODE* netNode;
67 XNODE* lNode;
68
69 aNode->GetAttribute( wxT( "Name" ), &propValue );
70 propValue.Trim( false );
71 propValue.Trim( true );
72 m_Name = propValue;
73
74 lNode = FindNode( aNode, wxT( "node" ) );
75
76 while( lNode )
77 {
78 lNode->GetAttribute( wxT( "Name" ), &s2 );
79 s2.Trim( false );
80 s1 = wxEmptyString;
81
82 while( s2.Len() > 0 && s2[0] != wxT( ' ' ) )
83 {
84 s1 = s1 + s2[0];
85 s2 = s2.Mid( 1 );
86 }
87
88 netNode = new PCB_NET_NODE;
89 s1.Trim( false );
90 s1.Trim( true );
91 netNode->m_CompRef = s1;
92
93 s2.Trim( false );
94 s2.Trim( true );
95 netNode->m_PinRef = s2;
96 m_NetNodes.Add( netNode );
97 lNode = lNode->GetNext();
98 }
99}
Hold an XML or S-expression element.
Definition: xnode.h:44
XNODE * GetNext() const
Definition: xnode.h:67
XNODE * FindNode(XNODE *aChild, const wxString &aTag)

References PCAD2KICAD::FindNode(), XNODE::GetNext(), PCAD2KICAD::PCB_NET_NODE::m_CompRef, m_Name, m_NetNodes, and PCAD2KICAD::PCB_NET_NODE::m_PinRef.

Referenced by PCAD2KICAD::PCB::ParseBoard().

Member Data Documentation

◆ m_Name

wxString PCAD2KICAD::PCB_NET::m_Name

◆ m_NetCode

int PCAD2KICAD::PCB_NET::m_NetCode

Definition at line 57 of file pcb_net.h.

Referenced by PCAD2KICAD::PCB::AddToBoard(), and PCAD2KICAD::PCB::GetNetCode().

◆ m_NetNodes

PCB_NET_NODES_ARRAY PCAD2KICAD::PCB_NET::m_NetNodes

Definition at line 58 of file pcb_net.h.

Referenced by Parse(), PCAD2KICAD::PCB::ParseBoard(), and ~PCB_NET().


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