|
|
|
@ -70,60 +70,10 @@ static const BITMAP_DEF iconsPinsOrientations[] = |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
// bitmaps to show pins shapes in dialog editor
|
|
|
|
// must have same order than pin_style_names
|
|
|
|
static BITMAP_DEF iconsPinsShapes[] = |
|
|
|
const wxString LIB_PIN::GetCanonicalElectricalTypeName( ELECTRICAL_PINTYPE aType ) |
|
|
|
{ |
|
|
|
pinshape_normal_xpm, |
|
|
|
pinshape_invert_xpm, |
|
|
|
pinshape_clock_normal_xpm, |
|
|
|
pinshape_clock_invert_xpm, |
|
|
|
pinshape_active_low_input_xpm, |
|
|
|
pinshape_clock_active_low_xpm, |
|
|
|
pinshape_active_low_output_xpm, |
|
|
|
pinshape_clock_fall_xpm, |
|
|
|
pinshape_nonlogic_xpm |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
assert( aType >= 0 && aType < (int) PINTYPE_COUNT ); |
|
|
|
|
|
|
|
static const int pin_style_codes[] = |
|
|
|
{ |
|
|
|
NONE, |
|
|
|
INVERT, |
|
|
|
CLOCK, |
|
|
|
CLOCK | INVERT, |
|
|
|
LOWLEVEL_IN, |
|
|
|
LOWLEVEL_IN | CLOCK, |
|
|
|
LOWLEVEL_OUT, |
|
|
|
CLOCK_FALL, |
|
|
|
NONLOGIC |
|
|
|
}; |
|
|
|
|
|
|
|
#define PIN_STYLE_CNT DIM( pin_style_codes )
|
|
|
|
|
|
|
|
// bitmaps to show pins electrical type in dialog editor
|
|
|
|
// must have same order than enum ELECTRICAL_PINTYPE (see lib_pin.h)
|
|
|
|
static const BITMAP_DEF iconsPinsElectricalType[] = |
|
|
|
{ |
|
|
|
pintype_input_xpm, |
|
|
|
pintype_output_xpm, |
|
|
|
pintype_bidi_xpm, |
|
|
|
pintype_3states_xpm, |
|
|
|
pintype_passive_xpm, |
|
|
|
pintype_notspecif_xpm, |
|
|
|
pintype_powerinput_xpm, |
|
|
|
pintype_poweroutput_xpm, |
|
|
|
pintype_opencoll_xpm, |
|
|
|
pintype_openemit_xpm, |
|
|
|
pintype_noconnect_xpm |
|
|
|
}; |
|
|
|
|
|
|
|
#define PIN_ELECTRICAL_TYPE_CNT DIM( iconsPinsElectricalType )
|
|
|
|
|
|
|
|
|
|
|
|
const wxString LIB_PIN::GetCanonicalElectricalTypeName( unsigned aType ) |
|
|
|
{ |
|
|
|
// These strings are the canonical name of the electrictal type
|
|
|
|
// Not translated, no space in name, only ASCII chars.
|
|
|
|
// to use when the string name must be known and well defined
|
|
|
|
@ -140,12 +90,11 @@ const wxString LIB_PIN::GetCanonicalElectricalTypeName( unsigned aType ) |
|
|
|
wxT( "power_out" ), |
|
|
|
wxT( "openCol" ), |
|
|
|
wxT( "openEm" ), |
|
|
|
wxT( "NotConnected" ), |
|
|
|
wxT( "???" ) |
|
|
|
wxT( "NotConnected" ) |
|
|
|
}; |
|
|
|
|
|
|
|
if( aType > PIN_NMAX ) |
|
|
|
aType = PIN_NMAX; |
|
|
|
if( aType > (int) PINTYPE_COUNT ) |
|
|
|
return wxT( "???" ); |
|
|
|
|
|
|
|
return msgPinElectricType[ aType ]; |
|
|
|
} |
|
|
|
@ -176,53 +125,6 @@ static const wxString getPinOrientationName( unsigned aPinOrientationCode ) |
|
|
|
return pin_orientation_names[ aPinOrientationCode ]; |
|
|
|
} |
|
|
|
|
|
|
|
const wxString LIB_PIN::GetElectricalTypeName( unsigned aPinsElectricalType ) |
|
|
|
{ |
|
|
|
const wxString pin_electrical_type_names[] = |
|
|
|
{ // Keep these translated strings not static
|
|
|
|
_( "Input" ), |
|
|
|
_( "Output" ), |
|
|
|
_( "Bidirectional" ), |
|
|
|
_( "Tri-state" ), |
|
|
|
_( "Passive" ), |
|
|
|
_( "Unspecified" ), |
|
|
|
_( "Power input" ), |
|
|
|
_( "Power output" ), |
|
|
|
_( "Open collector" ), |
|
|
|
_( "Open emitter" ), |
|
|
|
_( "Not connected" ), |
|
|
|
wxT( "???" ) |
|
|
|
}; |
|
|
|
|
|
|
|
if( aPinsElectricalType > PIN_ELECTRICAL_TYPE_CNT ) |
|
|
|
aPinsElectricalType = PIN_ELECTRICAL_TYPE_CNT; |
|
|
|
|
|
|
|
return pin_electrical_type_names[ aPinsElectricalType ]; |
|
|
|
} |
|
|
|
|
|
|
|
static const wxString getPinStyleName( unsigned aPinsStyle ) |
|
|
|
{ |
|
|
|
const wxString pin_style_names[] = |
|
|
|
{ // Keep these translated strings not static
|
|
|
|
_( "Line" ), |
|
|
|
_( "Inverted" ), |
|
|
|
_( "Clock" ), |
|
|
|
_( "Inverted clock" ), |
|
|
|
_( "Input low" ), |
|
|
|
_( "Clock low" ), |
|
|
|
_( "Output low" ), |
|
|
|
_( "Falling edge clock" ), |
|
|
|
_( "NonLogic" ), |
|
|
|
wxT( "???" ) |
|
|
|
}; |
|
|
|
|
|
|
|
if( aPinsStyle > PIN_STYLE_CNT ) |
|
|
|
aPinsStyle = PIN_STYLE_CNT; |
|
|
|
|
|
|
|
return pin_style_names[ aPinsStyle ]; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// Utility for getting the size of the 'internal' pin decorators (as a radius)
|
|
|
|
// i.e. the clock symbols (falling clock is actually external but is of
|
|
|
|
// the same kind)
|
|
|
|
@ -241,11 +143,11 @@ static int ExternalPinDecoSize( const LIB_PIN &aPin ) |
|
|
|
} |
|
|
|
|
|
|
|
LIB_PIN::LIB_PIN( LIB_PART* aParent ) : |
|
|
|
LIB_ITEM( LIB_PIN_T, aParent ) |
|
|
|
LIB_ITEM( LIB_PIN_T, aParent ), |
|
|
|
m_shape( PINSHAPE_LINE ) |
|
|
|
{ |
|
|
|
m_length = LIB_EDIT_FRAME::GetDefaultPinLength(); |
|
|
|
m_orientation = PIN_RIGHT; // Pin orient: Up, Down, Left, Right
|
|
|
|
m_shape = NONE; // Pin shape, bitwise.
|
|
|
|
m_type = PIN_UNSPECIFIED; // electrical type of pin
|
|
|
|
m_attributes = 0; // bit 0 != 0: pin invisible
|
|
|
|
m_number = 0; // pin number (i.e. 4 ASCII chars)
|
|
|
|
@ -378,8 +280,10 @@ void LIB_PIN::SetOrientation( int orientation ) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void LIB_PIN::SetShape( int aShape ) |
|
|
|
void LIB_PIN::SetShape( GRAPHIC_PINSHAPE aShape ) |
|
|
|
{ |
|
|
|
assert( aShape >= 0 && aShape < int( PINSHAPE_COUNT ) ); |
|
|
|
|
|
|
|
if( m_shape != aShape ) |
|
|
|
{ |
|
|
|
m_shape = aShape; |
|
|
|
@ -407,10 +311,12 @@ void LIB_PIN::SetShape( int aShape ) |
|
|
|
|
|
|
|
void LIB_PIN::SetType( ELECTRICAL_PINTYPE aType ) |
|
|
|
{ |
|
|
|
assert( aType >= 0 && aType < (int) PINTYPE_COUNT ); |
|
|
|
|
|
|
|
if( aType < PIN_INPUT ) |
|
|
|
aType = PIN_INPUT; |
|
|
|
|
|
|
|
if( aType >= PIN_NMAX ) |
|
|
|
if( aType >= PINTYPE_COUNT ) |
|
|
|
aType = PIN_NC; |
|
|
|
|
|
|
|
if( m_type != aType ) |
|
|
|
@ -691,23 +597,55 @@ bool LIB_PIN::Save( OUTPUTFORMATTER& aFormatter ) |
|
|
|
if( !IsVisible() && aFormatter.Print( 0, "N" ) < 0 ) |
|
|
|
return false; |
|
|
|
|
|
|
|
if( m_shape & INVERT && aFormatter.Print( 0, "I" ) < 0 ) |
|
|
|
return false; |
|
|
|
switch( m_shape ) |
|
|
|
{ |
|
|
|
case PINSHAPE_LINE: |
|
|
|
break; |
|
|
|
|
|
|
|
if( m_shape & CLOCK && aFormatter.Print( 0, "C" ) < 0 ) |
|
|
|
return false; |
|
|
|
case PINSHAPE_INVERTED: |
|
|
|
if( aFormatter.Print( 0, "I" ) < 0 ) |
|
|
|
return false; |
|
|
|
break; |
|
|
|
|
|
|
|
if( m_shape & LOWLEVEL_IN && aFormatter.Print( 0, "L" ) < 0 ) |
|
|
|
return false; |
|
|
|
case PINSHAPE_CLOCK: |
|
|
|
if( aFormatter.Print( 0, "C" ) < 0 ) |
|
|
|
return false; |
|
|
|
break; |
|
|
|
|
|
|
|
if( m_shape & LOWLEVEL_OUT && aFormatter.Print( 0, "V" ) < 0 ) |
|
|
|
return false; |
|
|
|
case PINSHAPE_INVERTED_CLOCK: |
|
|
|
if( aFormatter.Print( 0, "IC" ) < 0 ) |
|
|
|
return false; |
|
|
|
break; |
|
|
|
|
|
|
|
if( m_shape & CLOCK_FALL && aFormatter.Print( 0, "F" ) < 0 ) |
|
|
|
return false; |
|
|
|
case PINSHAPE_INPUT_LOW: |
|
|
|
if( aFormatter.Print( 0, "L" ) < 0 ) |
|
|
|
return false; |
|
|
|
break; |
|
|
|
|
|
|
|
case PINSHAPE_CLOCK_LOW: |
|
|
|
if( aFormatter.Print( 0, "CL" ) < 0 ) |
|
|
|
return false; |
|
|
|
break; |
|
|
|
|
|
|
|
if( m_shape & NONLOGIC && aFormatter.Print( 0, "X" ) < 0 ) |
|
|
|
case PINSHAPE_OUTPUT_LOW: |
|
|
|
if( aFormatter.Print( 0, "V" ) < 0 ) |
|
|
|
return false; |
|
|
|
break; |
|
|
|
|
|
|
|
case PINSHAPE_FALLING_EDGE_CLOCK: |
|
|
|
if( aFormatter.Print( 0, "F" ) < 0 ) |
|
|
|
return false; |
|
|
|
break; |
|
|
|
|
|
|
|
case PINSHAPE_NONLOGIC: |
|
|
|
if( aFormatter.Print( 0, "X" ) < 0 ) |
|
|
|
return false; |
|
|
|
break; |
|
|
|
|
|
|
|
default: |
|
|
|
assert( !"Invalid pin shape" ); |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
if( aFormatter.Print( 0, "\n" ) < 0 ) |
|
|
|
return false; |
|
|
|
@ -831,6 +769,18 @@ bool LIB_PIN::Load( LINE_READER& aLineReader, wxString& aErrorMsg ) |
|
|
|
|
|
|
|
if( prms_count >= 12 ) /* Special Symbol defined */ |
|
|
|
{ |
|
|
|
enum |
|
|
|
{ |
|
|
|
INVERTED = 1 << 0, |
|
|
|
CLOCK = 1 << 1, |
|
|
|
LOWLEVEL_IN = 1 << 2, |
|
|
|
LOWLEVEL_OUT = 1 << 3, |
|
|
|
FALLING_EDGE = 1 << 4, |
|
|
|
NONLOGIC = 1 << 5 |
|
|
|
}; |
|
|
|
|
|
|
|
int flags = 0; |
|
|
|
|
|
|
|
for( int j = strlen( pinAttrs ); j > 0; ) |
|
|
|
{ |
|
|
|
switch( pinAttrs[--j] ) |
|
|
|
@ -843,27 +793,27 @@ bool LIB_PIN::Load( LINE_READER& aLineReader, wxString& aErrorMsg ) |
|
|
|
break; |
|
|
|
|
|
|
|
case 'I': |
|
|
|
m_shape |= INVERT; |
|
|
|
flags |= INVERTED; |
|
|
|
break; |
|
|
|
|
|
|
|
case 'C': |
|
|
|
m_shape |= CLOCK; |
|
|
|
flags |= CLOCK; |
|
|
|
break; |
|
|
|
|
|
|
|
case 'L': |
|
|
|
m_shape |= LOWLEVEL_IN; |
|
|
|
flags |= LOWLEVEL_IN; |
|
|
|
break; |
|
|
|
|
|
|
|
case 'V': |
|
|
|
m_shape |= LOWLEVEL_OUT; |
|
|
|
flags |= LOWLEVEL_OUT; |
|
|
|
break; |
|
|
|
|
|
|
|
case 'F': |
|
|
|
m_shape |= CLOCK_FALL; |
|
|
|
flags |= FALLING_EDGE; |
|
|
|
break; |
|
|
|
|
|
|
|
case 'X': |
|
|
|
m_shape |= NONLOGIC; |
|
|
|
flags |= NONLOGIC; |
|
|
|
break; |
|
|
|
|
|
|
|
default: |
|
|
|
@ -871,6 +821,49 @@ bool LIB_PIN::Load( LINE_READER& aLineReader, wxString& aErrorMsg ) |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
switch( flags ) |
|
|
|
{ |
|
|
|
case 0: |
|
|
|
m_shape = PINSHAPE_LINE; |
|
|
|
break; |
|
|
|
|
|
|
|
case INVERTED: |
|
|
|
m_shape = PINSHAPE_INVERTED; |
|
|
|
break; |
|
|
|
|
|
|
|
case CLOCK: |
|
|
|
m_shape = PINSHAPE_CLOCK; |
|
|
|
break; |
|
|
|
|
|
|
|
case INVERTED | CLOCK: |
|
|
|
m_shape = PINSHAPE_INVERTED_CLOCK; |
|
|
|
break; |
|
|
|
|
|
|
|
case LOWLEVEL_IN: |
|
|
|
m_shape = PINSHAPE_INPUT_LOW; |
|
|
|
break; |
|
|
|
|
|
|
|
case LOWLEVEL_IN | CLOCK: |
|
|
|
m_shape = PINSHAPE_CLOCK_LOW; |
|
|
|
break; |
|
|
|
|
|
|
|
case LOWLEVEL_OUT: |
|
|
|
m_shape = PINSHAPE_OUTPUT_LOW; |
|
|
|
break; |
|
|
|
|
|
|
|
case FALLING_EDGE: |
|
|
|
m_shape = PINSHAPE_FALLING_EDGE_CLOCK; |
|
|
|
break; |
|
|
|
|
|
|
|
case NONLOGIC: |
|
|
|
m_shape = PINSHAPE_NONLOGIC; |
|
|
|
break; |
|
|
|
|
|
|
|
default: |
|
|
|
aErrorMsg.Printf( wxT( "pin attributes do not give a valid pin shape [%s]" ), pinAttrs ); |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return true; |
|
|
|
@ -1021,7 +1014,7 @@ void LIB_PIN::DrawPinSymbol( EDA_DRAW_PANEL* aPanel, |
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
if( m_shape & INVERT ) |
|
|
|
if( m_shape == PINSHAPE_INVERTED || m_shape == PINSHAPE_INVERTED_CLOCK ) |
|
|
|
{ |
|
|
|
const int radius = ExternalPinDecoSize( *this ); |
|
|
|
GRCircle( clipbox, aDC, MapX1 * radius + x1, |
|
|
|
@ -1032,7 +1025,7 @@ void LIB_PIN::DrawPinSymbol( EDA_DRAW_PANEL* aPanel, |
|
|
|
MapY1 * radius * 2 + y1 ); |
|
|
|
GRLineTo( clipbox, aDC, posX, posY, width, color ); |
|
|
|
} |
|
|
|
else if( m_shape & CLOCK_FALL ) /* an alternative for Inverted Clock */ |
|
|
|
else if( m_shape == PINSHAPE_FALLING_EDGE_CLOCK ) /* an alternative for Inverted Clock */ |
|
|
|
{ |
|
|
|
const int clock_size = InternalPinDecoSize( *this ); |
|
|
|
if( MapY1 == 0 ) /* MapX1 = +- 1 */ |
|
|
|
@ -1059,7 +1052,7 @@ void LIB_PIN::DrawPinSymbol( EDA_DRAW_PANEL* aPanel, |
|
|
|
GRLineTo( clipbox, aDC, posX, posY, width, color ); |
|
|
|
} |
|
|
|
|
|
|
|
if( m_shape & CLOCK ) |
|
|
|
if( m_shape == PINSHAPE_CLOCK || m_shape == PINSHAPE_INVERTED_CLOCK || m_shape == PINSHAPE_CLOCK_LOW ) |
|
|
|
{ |
|
|
|
const int clock_size = InternalPinDecoSize( *this ); |
|
|
|
if( MapY1 == 0 ) /* MapX1 = +- 1 */ |
|
|
|
@ -1080,7 +1073,7 @@ void LIB_PIN::DrawPinSymbol( EDA_DRAW_PANEL* aPanel, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if( m_shape & LOWLEVEL_IN ) /* IEEE symbol "Active Low Input" */ |
|
|
|
if( m_shape == PINSHAPE_INPUT_LOW || m_shape == PINSHAPE_CLOCK_LOW ) |
|
|
|
{ |
|
|
|
const int symbol_size = ExternalPinDecoSize( *this ); |
|
|
|
if( MapY1 == 0 ) /* MapX1 = +- 1 */ |
|
|
|
@ -1101,7 +1094,7 @@ void LIB_PIN::DrawPinSymbol( EDA_DRAW_PANEL* aPanel, |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if( m_shape & LOWLEVEL_OUT ) /* IEEE symbol "Active Low Output" */ |
|
|
|
if( m_shape == PINSHAPE_OUTPUT_LOW ) /* IEEE symbol "Active Low Output" */ |
|
|
|
{ |
|
|
|
const int symbol_size = ExternalPinDecoSize( *this ); |
|
|
|
if( MapY1 == 0 ) /* MapX1 = +- 1 */ |
|
|
|
@ -1121,7 +1114,7 @@ void LIB_PIN::DrawPinSymbol( EDA_DRAW_PANEL* aPanel, |
|
|
|
width, color ); |
|
|
|
} |
|
|
|
} |
|
|
|
else if( m_shape & NONLOGIC ) /* NonLogic pin symbol */ |
|
|
|
else if( m_shape == PINSHAPE_NONLOGIC ) /* NonLogic pin symbol */ |
|
|
|
{ |
|
|
|
const int symbol_size = ExternalPinDecoSize( *this ); |
|
|
|
GRMoveTo( x1 - (MapX1 + MapY1) * symbol_size, |
|
|
|
@ -1397,7 +1390,7 @@ void LIB_PIN::PlotSymbol( PLOTTER* aPlotter, const wxPoint& aPosition, int aOrie |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
|
if( m_shape & INVERT ) |
|
|
|
if( m_shape == PINSHAPE_INVERTED || m_shape == PINSHAPE_INVERTED_CLOCK ) |
|
|
|
{ |
|
|
|
const int radius = ExternalPinDecoSize( *this ); |
|
|
|
aPlotter->Circle( wxPoint( MapX1 * radius + x1, |
|
|
|
@ -1410,7 +1403,7 @@ void LIB_PIN::PlotSymbol( PLOTTER* aPlotter, const wxPoint& aPosition, int aOrie |
|
|
|
MapY1 * radius * 2 + y1 ) ); |
|
|
|
aPlotter->FinishTo( aPosition ); |
|
|
|
} |
|
|
|
else if( m_shape & CLOCK_FALL ) |
|
|
|
else if( m_shape == PINSHAPE_FALLING_EDGE_CLOCK ) |
|
|
|
{ |
|
|
|
const int clock_size = InternalPinDecoSize( *this ); |
|
|
|
if( MapY1 == 0 ) /* MapX1 = +- 1 */ |
|
|
|
@ -1436,7 +1429,8 @@ void LIB_PIN::PlotSymbol( PLOTTER* aPlotter, const wxPoint& aPosition, int aOrie |
|
|
|
aPlotter->FinishTo( aPosition ); |
|
|
|
} |
|
|
|
|
|
|
|
if( m_shape & CLOCK ) |
|
|
|
if( m_shape == PINSHAPE_CLOCK || m_shape == PINSHAPE_INVERTED_CLOCK || |
|
|
|
m_shape == PINSHAPE_CLOCK_LOW ) |
|
|
|
{ |
|
|
|
const int clock_size = InternalPinDecoSize( *this ); |
|
|
|
if( MapY1 == 0 ) /* MapX1 = +- 1 */ |
|
|
|
@ -1453,7 +1447,7 @@ void LIB_PIN::PlotSymbol( PLOTTER* aPlotter, const wxPoint& aPosition, int aOrie |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if( m_shape & LOWLEVEL_IN ) /* IEEE symbol "Active Low Input" */ |
|
|
|
if( m_shape == PINSHAPE_INPUT_LOW || m_shape == PINSHAPE_CLOCK_LOW ) /* IEEE symbol "Active Low Input" */ |
|
|
|
{ |
|
|
|
const int symbol_size = ExternalPinDecoSize( *this ); |
|
|
|
|
|
|
|
@ -1474,7 +1468,7 @@ void LIB_PIN::PlotSymbol( PLOTTER* aPlotter, const wxPoint& aPosition, int aOrie |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if( m_shape & LOWLEVEL_OUT ) /* IEEE symbol "Active Low Output" */ |
|
|
|
if( m_shape == PINSHAPE_OUTPUT_LOW ) /* IEEE symbol "Active Low Output" */ |
|
|
|
{ |
|
|
|
const int symbol_size = ExternalPinDecoSize( *this ); |
|
|
|
|
|
|
|
@ -1489,7 +1483,7 @@ void LIB_PIN::PlotSymbol( PLOTTER* aPlotter, const wxPoint& aPosition, int aOrie |
|
|
|
aPlotter->FinishTo( wxPoint( x1, y1 + MapY1 * symbol_size * 2 ) ); |
|
|
|
} |
|
|
|
} |
|
|
|
else if( m_shape & NONLOGIC ) /* NonLogic pin symbol */ |
|
|
|
else if( m_shape == PINSHAPE_NONLOGIC ) /* NonLogic pin symbol */ |
|
|
|
{ |
|
|
|
const int symbol_size = ExternalPinDecoSize( *this ); |
|
|
|
aPlotter->MoveTo( wxPoint( x1 - (MapX1 + MapY1) * symbol_size, |
|
|
|
@ -1984,15 +1978,10 @@ void LIB_PIN::GetMsgPanelInfo( MSG_PANEL_ITEMS& aList ) |
|
|
|
aList.push_back( MSG_PANEL_ITEM( _( "Number" ), text, DARKCYAN ) ); |
|
|
|
|
|
|
|
aList.push_back( MSG_PANEL_ITEM( _( "Type" ), |
|
|
|
LIB_PIN::GetElectricalTypeName( m_type ), |
|
|
|
GetText( m_type ), |
|
|
|
RED ) ); |
|
|
|
|
|
|
|
int styleCodeIndex = GetStyleCodeIndex( m_shape ); |
|
|
|
|
|
|
|
if( styleCodeIndex >= 0 ) |
|
|
|
text = getPinStyleName( styleCodeIndex ); |
|
|
|
else |
|
|
|
text = wxT( "?" ); |
|
|
|
text = GetText( m_shape ); |
|
|
|
|
|
|
|
aList.push_back( MSG_PANEL_ITEM( _( "Style" ), text, BLUE ) ); |
|
|
|
|
|
|
|
@ -2042,7 +2031,7 @@ const EDA_RECT LIB_PIN::GetBoundingBox( bool aIncludeInvisibles ) const |
|
|
|
// Actual text height is bigger than text size
|
|
|
|
int numberTextHeight = showNum ? KiROUND( m_numTextSize * 1.1 ) : 0; |
|
|
|
|
|
|
|
if( m_shape & INVERT ) |
|
|
|
if( m_shape == PINSHAPE_INVERTED || m_shape == PINSHAPE_INVERTED_CLOCK ) |
|
|
|
minsizeV = std::max( TARGET_PIN_RADIUS, ExternalPinDecoSize( *this ) ); |
|
|
|
|
|
|
|
// calculate top left corner position
|
|
|
|
@ -2187,72 +2176,15 @@ void LIB_PIN::Rotate() |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
wxArrayString LIB_PIN::GetStyleNames( void ) |
|
|
|
{ |
|
|
|
wxArrayString tmp; |
|
|
|
|
|
|
|
for( unsigned ii = 0; ii < PIN_STYLE_CNT; ii++ ) |
|
|
|
tmp.Add( getPinStyleName( ii ) ); |
|
|
|
|
|
|
|
return tmp; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int LIB_PIN::GetStyleCode( int index ) |
|
|
|
{ |
|
|
|
if( index >= 0 && index < (int) PIN_STYLE_CNT ) |
|
|
|
return pin_style_codes[ index ]; |
|
|
|
|
|
|
|
return NONE; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int LIB_PIN::GetStyleCodeIndex( int code ) |
|
|
|
{ |
|
|
|
size_t i; |
|
|
|
|
|
|
|
for( i = 0; i < PIN_STYLE_CNT; i++ ) |
|
|
|
{ |
|
|
|
if( pin_style_codes[i] == code ) |
|
|
|
return (int) i; |
|
|
|
} |
|
|
|
|
|
|
|
return wxNOT_FOUND; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
wxArrayString LIB_PIN::GetElectricalTypeNames( void ) |
|
|
|
{ |
|
|
|
wxArrayString tmp; |
|
|
|
|
|
|
|
for( unsigned ii = 0; ii < PIN_ELECTRICAL_TYPE_CNT; ii++ ) |
|
|
|
tmp.Add( LIB_PIN::GetElectricalTypeName( ii ) ); |
|
|
|
|
|
|
|
return tmp; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const BITMAP_DEF* LIB_PIN::GetElectricalTypeSymbols() |
|
|
|
{ |
|
|
|
return iconsPinsElectricalType; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const BITMAP_DEF* LIB_PIN::GetOrientationSymbols() |
|
|
|
{ |
|
|
|
return iconsPinsOrientations; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const BITMAP_DEF* LIB_PIN::GetStyleSymbols() |
|
|
|
{ |
|
|
|
return iconsPinsShapes; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
BITMAP_DEF LIB_PIN::GetMenuImage() const |
|
|
|
{ |
|
|
|
return iconsPinsElectricalType[m_type]; |
|
|
|
return GetBitmap( m_type ); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -2261,12 +2193,7 @@ wxString LIB_PIN::GetSelectMenuText() const |
|
|
|
wxString tmp; |
|
|
|
wxString style; |
|
|
|
|
|
|
|
int styleCode = GetStyleCodeIndex( m_shape ); |
|
|
|
|
|
|
|
if( styleCode >= 0 ) |
|
|
|
style = getPinStyleName( styleCode ); |
|
|
|
else |
|
|
|
style = wxT( "?" ); |
|
|
|
style = GetText( m_shape ); |
|
|
|
|
|
|
|
tmp.Printf( _( "Pin %s, %s, %s" ), |
|
|
|
GetChars( GetNumberString() ), |
|
|
|
|