class_cvpcb.cpp 1.34 KB
Newer Older
1 2 3 4
/*******************/
/* class_cvpcb.cpp */
/*******************/

5 6
#include "fctsys.h"
#include "kicad_string.h"
7

8
#include "cvpcb.h"
9 10


11
PIN::PIN()
12
{
13 14
    m_Index = 0;         /* Variable used by types of netlists. */
    m_Type = 0;          /* Electrical type. */
15 16 17 18 19 20
}

bool operator<( const PIN& item1, const PIN& item2 )
{
    return ( StrLenNumICmp( item1.m_Number.GetData(),
                            item2.m_Number.GetData(), 4 ) < 0 );
21 22
}

23
bool operator==( const PIN& item1, const PIN& item2 )
24
{
25
    return ( item1.m_Number == item2.m_Number );
26 27
}

28 29 30
bool same_pin_number( const PIN* item1, const PIN* item2 )
{
    wxASSERT( item1 != NULL && item2 != NULL );
31

32
    return ( item1->m_Number == item2->m_Number );
33
}
34

35
bool same_pin_net( const PIN* item1, const PIN* item2 )
36
{
37 38
    wxASSERT( item1 != NULL && item2 != NULL );

39
    return ( item1->m_Net == item2->m_Net );
40 41 42
}


43 44 45 46 47 48 49
COMPONENT::COMPONENT()
{
    m_Num = 0;
    m_Multi = 0;
}

COMPONENT::~COMPONENT()
50 51 52
{
}

53
bool operator<( const COMPONENT& item1, const COMPONENT& item2 )
54
{
55 56
    return ( StrNumICmp( item1.m_Reference.GetData(),
                         item2.m_Reference.GetData() ) < 0 );
57 58 59 60 61 62 63 64
}


FOOTPRINT::FOOTPRINT()
{
    m_Num = 0;
}

65
bool operator<( const FOOTPRINT& item1, const FOOTPRINT& item2 )
66
{
67 68
    return ( StrNumICmp( item1.m_Module.GetData(),
                         item2.m_Module.GetData() ) < 0 );
69
}