From cd778c125e951186ab50e6eb427efa858eba22ce Mon Sep 17 00:00:00 2001 From: Vovanium Date: Fri, 24 Sep 2010 20:00:40 +0400 Subject: [PATCH] Added two pin shapes: * reverted clock ( --<| ) as it is commonly used for inverted clock in x-USSR * nonlogic ( ---X ) for non-logic pins of logic ICs (commonly used for power and timing RC pins). --- bitmaps/CMakeLists.txt | 2 ++ bitmaps/pinshape_clock_fall.xpm | 23 +++++++++++++++ bitmaps/pinshape_nonlogic.xpm | 23 +++++++++++++++ eeschema/class_pin.cpp | 50 +++++++++++++++++++++++++++++++-- eeschema/class_pin.h | 5 +++- include/bitmaps.h | 2 ++ 6 files changed, 102 insertions(+), 3 deletions(-) create mode 100644 bitmaps/pinshape_clock_fall.xpm create mode 100644 bitmaps/pinshape_nonlogic.xpm diff --git a/bitmaps/CMakeLists.txt b/bitmaps/CMakeLists.txt index 9b3ace8b1b..b01c08a64c 100644 --- a/bitmaps/CMakeLists.txt +++ b/bitmaps/CMakeLists.txt @@ -308,6 +308,8 @@ set(BITMAP_SRCS pinshape_active_low_input.xpm pinshape_clock_active_low.xpm pinshape_active_low_output.xpm + pinshape_clock_fall.xpm + pinshape_nonlogic.xpm pintype_input.xpm pintype_output.xpm pintype_bidi.xpm diff --git a/bitmaps/pinshape_clock_fall.xpm b/bitmaps/pinshape_clock_fall.xpm new file mode 100644 index 0000000000..f763865616 --- /dev/null +++ b/bitmaps/pinshape_clock_fall.xpm @@ -0,0 +1,23 @@ +/* XPM */ +const char *pinshape_clock_fall_xpm[] = { +/* columns rows colors chars-per-pixel */ +"15 15 2 1", +". c Black", +" c #FFFFFF", +/* pixels */ +" ", +" ", +" . ", +" . ", +" . ", +" .. ", +" . . ", +" . ....... ", +" . . ", +" .. ", +" . ", +" . ", +" . ", +" ", +" " +}; diff --git a/bitmaps/pinshape_nonlogic.xpm b/bitmaps/pinshape_nonlogic.xpm new file mode 100644 index 0000000000..fa0dc6893e --- /dev/null +++ b/bitmaps/pinshape_nonlogic.xpm @@ -0,0 +1,23 @@ +/* XPM */ +const char *pinshape_nonlogic_xpm[] = { +/* columns rows colors chars-per-pixel */ +"15 15 2 1", +". c Black", +" c #FFFFFF", +/* pixels */ +" ", +" ", +" . ", +" . ", +" . . . ", +" . . . ", +" ... ", +" .......... ", +" ... ", +" . . . ", +" . . . ", +" . ", +" . ", +" ", +" " +}; diff --git a/eeschema/class_pin.cpp b/eeschema/class_pin.cpp index 629abd6fa1..5e79c98ccf 100644 --- a/eeschema/class_pin.cpp +++ b/eeschema/class_pin.cpp @@ -63,7 +63,9 @@ static const wxString pin_style_names[] = _( "Inverted clock" ), _( "Input low" ), _( "Clock low" ), - _( "Output low" ) + _( "Output low" ), + _( "Falling edge clock" ), + _( "NonLogic" ) }; // bitmaps to show pins shapes in dialog editor @@ -77,6 +79,8 @@ static const char ** s_icons_Pins_Shapes[] = pinshape_active_low_input_xpm, pinshape_clock_active_low_xpm, pinshape_active_low_output_xpm, + pinshape_clock_fall_xpm, + pinshape_nonlogic_xpm }; @@ -91,7 +95,9 @@ static const int pin_style_codes[] = CLOCK | INVERT, LOWLEVEL_IN, LOWLEVEL_IN | CLOCK, - LOWLEVEL_OUT + LOWLEVEL_OUT, + CLOCK_FALL, + NONLOGIC }; @@ -885,6 +891,26 @@ void LIB_PIN::DrawPinSymbol( WinEDA_DrawPanel* aPanel, MapY1 * INVERT_PIN_RADIUS * 2 + y1 ); GRLineTo( &aPanel->m_ClipBox, aDC, posX, posY, width, color ); } + else if( m_PinShape & CLOCK_FALL ) /* an alternative for Inverted Clock */ + { + GRMoveTo( x1 + MapY1 * CLOCK_PIN_DIM, + y1 - MapX1 * CLOCK_PIN_DIM ); + GRLineTo( &aPanel->m_ClipBox, + aDC, + x1 + MapX1 * CLOCK_PIN_DIM, + y1 + MapY1 * CLOCK_PIN_DIM, + width, + color ); + GRLineTo( &aPanel->m_ClipBox, + aDC, + x1 - MapY1 * CLOCK_PIN_DIM, + y1 + MapX1 * CLOCK_PIN_DIM, + width, + color ); + GRMoveTo( MapX1 * CLOCK_PIN_DIM + x1, + MapY1 * CLOCK_PIN_DIM + y1 ); + GRLineTo( &aPanel->m_ClipBox, aDC, posX, posY, width, color ); + } else { GRMoveTo( x1, y1 ); @@ -974,6 +1000,26 @@ void LIB_PIN::DrawPinSymbol( WinEDA_DrawPanel* aPanel, } } + else if( m_PinShape & NONLOGIC ) /* NonLogic pin symbol */ + { + GRMoveTo( x1 - (MapX1 + MapY1) * NONLOGIC_PIN_DIM, + y1 - (MapY1 - MapX1) * NONLOGIC_PIN_DIM ); + GRLineTo( &aPanel->m_ClipBox, + aDC, + x1 + (MapX1 + MapY1) * NONLOGIC_PIN_DIM, + y1 + (MapY1 - MapX1) * NONLOGIC_PIN_DIM, + width, + color ); + GRMoveTo( x1 - (MapX1 - MapY1) * NONLOGIC_PIN_DIM, + y1 - (MapY1 + MapX1) * NONLOGIC_PIN_DIM ); + GRLineTo( &aPanel->m_ClipBox, + aDC, + x1 + (MapX1 - MapY1) * NONLOGIC_PIN_DIM, + y1 + (MapY1 + MapX1) * NONLOGIC_PIN_DIM, + width, + color ); + } + /* Draw the pin end target (active end of the pin) * Draw but do not print the pin end target 1 pixel width */ diff --git a/eeschema/class_pin.h b/eeschema/class_pin.h index 810eb96215..5972537013 100644 --- a/eeschema/class_pin.h +++ b/eeschema/class_pin.h @@ -26,6 +26,7 @@ #define CLOCK_PIN_DIM 40 /* Dim of clock pin symbol. */ #define IEEE_SYMBOL_PIN_DIM 40 /* Dim of special pin symbol. */ +#define NONLOGIC_PIN_DIM 30 /* Dim of nonlogic pin symbol (X). */ /** * The component library pin object electrical types used in ERC tests. @@ -60,7 +61,9 @@ enum DrawPinShape { INVERT = 1, CLOCK = 2, LOWLEVEL_IN = 4, - LOWLEVEL_OUT = 8 + LOWLEVEL_OUT = 8, + CLOCK_FALL = 0x10, /* this is common form for inverted clock in Eastern Block */ + NONLOGIC = 0x20, }; diff --git a/include/bitmaps.h b/include/bitmaps.h index 3b704edbb8..25351eaf29 100644 --- a/include/bitmaps.h +++ b/include/bitmaps.h @@ -294,8 +294,10 @@ extern const char* pinorient_right_xpm[]; extern const char* pinorient_left_xpm[]; extern const char* pinorient_up_xpm[]; extern const char* pinorient_down_xpm[]; +extern const char* pinshape_nonlogic_xpm[]; extern const char* pinshape_normal_xpm[]; extern const char* pinshape_invert_xpm[]; +extern const char* pinshape_clock_fall_xpm[]; extern const char* pinshape_clock_normal_xpm[]; extern const char* pinshape_clock_invert_xpm[]; extern const char* pinshape_active_low_input_xpm[];