2011-10-31 20:49:48 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2015-02-28 16:56:09 +00:00
|
|
|
* Copyright (C) 2015 Jean-Pierre Charras, jaen-pierre.charras at wanadoo.fr
|
|
|
|
* Copyright (C) 2015 Wayne Stambaugh <stambaughw@verizon.net>
|
|
|
|
* Copyright (C) 2004-2015 KiCad Developers, see change_log.txt for contributors.
|
2011-10-31 20:49:48 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
2010-03-04 09:32:51 +00:00
|
|
|
|
2011-10-31 20:49:48 +00:00
|
|
|
/**
|
|
|
|
* @file class_libentry.h
|
|
|
|
* @brief Class LIB_PIN definition.
|
2010-03-04 09:32:51 +00:00
|
|
|
*/
|
|
|
|
#ifndef CLASS_PIN_H
|
|
|
|
#define CLASS_PIN_H
|
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <lib_draw_item.h>
|
2010-03-04 09:32:51 +00:00
|
|
|
|
2013-01-12 17:32:24 +00:00
|
|
|
|
2013-05-19 19:35:49 +00:00
|
|
|
#define TARGET_PIN_RADIUS 12 // Circle diameter drawn at the active end of pins
|
2010-03-04 09:32:51 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The component library pin object electrical types used in ERC tests.
|
|
|
|
*/
|
|
|
|
enum ElectricPinType {
|
|
|
|
PIN_INPUT,
|
|
|
|
PIN_OUTPUT,
|
|
|
|
PIN_BIDI,
|
|
|
|
PIN_TRISTATE,
|
|
|
|
PIN_PASSIVE,
|
|
|
|
PIN_UNSPECIFIED,
|
|
|
|
PIN_POWER_IN,
|
|
|
|
PIN_POWER_OUT,
|
|
|
|
PIN_OPENCOLLECTOR,
|
|
|
|
PIN_OPENEMITTER,
|
|
|
|
PIN_NC, /* No connect */
|
|
|
|
PIN_NMAX /* End of List (no used as pin type) */
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/* Pin visibility flag bit. */
|
2011-05-06 13:56:26 +00:00
|
|
|
#define PIN_INVISIBLE 1 /* Set makes pin invisible */
|
2010-03-04 09:32:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The component library pin object drawing shapes.
|
|
|
|
*/
|
|
|
|
enum DrawPinShape {
|
|
|
|
NONE = 0,
|
|
|
|
INVERT = 1,
|
|
|
|
CLOCK = 2,
|
|
|
|
LOWLEVEL_IN = 4,
|
2010-09-24 16:00:40 +00:00
|
|
|
LOWLEVEL_OUT = 8,
|
|
|
|
CLOCK_FALL = 0x10, /* this is common form for inverted clock in Eastern Block */
|
2010-10-04 12:58:07 +00:00
|
|
|
NONLOGIC = 0x20
|
2010-03-04 09:32:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The component library pin object orientations.
|
|
|
|
*/
|
|
|
|
enum DrawPinOrient {
|
|
|
|
PIN_RIGHT = 'R',
|
|
|
|
PIN_LEFT = 'L',
|
|
|
|
PIN_UP = 'U',
|
2010-10-04 12:58:07 +00:00
|
|
|
PIN_DOWN = 'D'
|
2010-03-04 09:32:51 +00:00
|
|
|
};
|
|
|
|
|
2015-06-08 00:07:42 +00:00
|
|
|
enum LibPinDrawFlags {
|
|
|
|
PIN_DRAW_TEXTS = 1,
|
2015-07-21 14:07:52 +00:00
|
|
|
PIN_DRAW_DANGLING = 2, // Draw this pin with a 'dangling' indicator
|
|
|
|
PIN_DANGLING_HIDDEN = 4, // Draw (only!) the dangling indicator if the pin is hidden
|
2015-06-08 00:07:42 +00:00
|
|
|
};
|
|
|
|
|
2010-03-04 09:32:51 +00:00
|
|
|
|
2011-04-27 19:44:32 +00:00
|
|
|
class LIB_PIN : public LIB_ITEM
|
2010-03-04 09:32:51 +00:00
|
|
|
{
|
2010-12-07 16:10:42 +00:00
|
|
|
wxPoint m_position; ///< Position of the pin.
|
|
|
|
int m_length; ///< Length of the pin.
|
|
|
|
int m_orientation; ///< Pin orientation (Up, Down, Left, Right)
|
|
|
|
int m_shape; ///< Bitwise ORed of pin shapes (see enum DrawPinShape)
|
|
|
|
int m_width; ///< Line width of the pin.
|
|
|
|
int m_type; ///< Electrical type of the pin. See enum ElectricPinType.
|
|
|
|
int m_attributes; ///< Set bit 0 to indicate pin is invisible.
|
|
|
|
wxString m_name;
|
|
|
|
long m_number; ///< Pin number defined as 4 ASCII characters like "12", "anod",
|
|
|
|
///< "G6", or "12". It is stored as "12\0\0" and does not
|
|
|
|
///< depend on endian type.
|
2011-12-08 21:05:43 +00:00
|
|
|
int m_numTextSize;
|
2015-02-28 16:56:09 +00:00
|
|
|
int m_nameTextSize; ///< Pin num and Pin name sizes
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Draw a pin, with or without the pin texts
|
|
|
|
*
|
|
|
|
* @param aPanel DrawPanel to use (can be null) mainly used for clipping purposes.
|
|
|
|
* @param aDC Device Context (can be null)
|
|
|
|
* @param aOffset Offset to draw
|
|
|
|
* @param aColor -1 to use the normal body item color, or use this color if >= 0
|
|
|
|
* @param aDrawMode GR_OR, GR_XOR, ...
|
2015-06-08 00:07:42 +00:00
|
|
|
* @param aData = used here as uintptr_t containing bitwise OR'd flags:
|
|
|
|
* PIN_DRAW_TEXTS, -- false to draw only pin shape, useful for fast mode
|
2015-07-21 14:07:52 +00:00
|
|
|
* PIN_DRAW_DANGLING, -- true to draw the pin with its target
|
|
|
|
* PIN_DANGLING_HIDDEN -- draw the target even if the pin is hidden
|
2015-02-28 16:56:09 +00:00
|
|
|
* @param aTransform Transform Matrix (rotation, mirror ..)
|
|
|
|
*/
|
2011-01-21 19:30:59 +00:00
|
|
|
void drawGraphic( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset,
|
2012-09-02 12:06:47 +00:00
|
|
|
EDA_COLOR_T aColor, GR_DRAWMODE aDrawMode, void* aData,
|
2012-09-01 13:38:27 +00:00
|
|
|
const TRANSFORM& aTransform );
|
2010-10-20 20:24:26 +00:00
|
|
|
|
2010-03-04 09:32:51 +00:00
|
|
|
public:
|
Modular KiCad Blueprint Milestone B), major portions:
*) When kicad.exe closes a project, close any open KIFACEs so that they cannot
get disassociated from their true PROJECT.
*) Allow loading eeschema library editor from kicad.exe
*) Allow loading pcbnew library editor from kicad.exe
*) Rename LIB_COMPONENT to LIB_PART.
*) Add class PART_LIBS, and PART_LIB.
*) Make PART_LIBS non-global, i.e. PROJECT specific.
*) Implement "data on demand" for PART_LIBS
*) Implement "data on demand" for schematic SEARCH_STACK.
*) Use RSTRINGs to retain eeschema editor's notion of last library and part being edited.
*) Get rid of library search on every SCH_COMPONENT::Draw() call, instead use
a weak pointer.
*) Remove all chdir() calls so projects don't need to be CWD.
*) Romove APPEND support from OpenProjectFiles().
*) Make OpenProjectFiles() robust, even for creating new projects.
*) Load EESCHEMA colors in the KIWAY::OnKiwayStart() rather in window open,
and save them in the .eeschema config file, not in the project file.
*) Fix bug with wxDir() while accessing protected dirs in kicad.exe
*) Consolidate template copying into PROJECT class, not in kicad.exe source.
*) Generally untangle eeschema, making its libraries not global but rather
held in the PROJECT.
2014-08-13 20:28:54 +00:00
|
|
|
LIB_PIN( LIB_PART* aParent );
|
2012-01-09 20:26:55 +00:00
|
|
|
|
|
|
|
// Do not create a copy constructor. The one generated by the compiler is adequate.
|
|
|
|
|
2010-03-04 09:32:51 +00:00
|
|
|
~LIB_PIN() { }
|
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
wxString GetClass() const
|
2010-03-04 09:32:51 +00:00
|
|
|
{
|
|
|
|
return wxT( "LIB_PIN" );
|
|
|
|
}
|
|
|
|
|
2010-08-03 05:11:05 +00:00
|
|
|
#if defined(DEBUG)
|
2011-12-14 17:25:42 +00:00
|
|
|
void Show( int nestLevel, std::ostream& os ) const; // virtual override
|
2010-08-03 05:11:05 +00:00
|
|
|
#endif
|
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
bool Save( OUTPUTFORMATTER& aFormatter );
|
2011-10-31 20:49:48 +00:00
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
bool Load( LINE_READER& aLineReader, wxString& aErrorMsg );
|
2010-03-04 09:32:51 +00:00
|
|
|
|
2014-05-04 17:08:36 +00:00
|
|
|
bool HitTest( const wxPoint& aPosition ) const;
|
2010-03-04 09:32:51 +00:00
|
|
|
|
2014-05-04 17:08:36 +00:00
|
|
|
bool HitTest( const wxPoint &aPosRef, int aThreshold, const TRANSFORM& aTransform ) const;
|
2010-03-04 09:32:51 +00:00
|
|
|
|
2013-01-12 17:32:24 +00:00
|
|
|
void GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList );
|
2010-12-10 19:47:44 +00:00
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
bool Matches( wxFindReplaceData& aSearchData, void* aAuxData, wxPoint* aFindLocation );
|
2011-12-01 16:49:28 +00:00
|
|
|
|
2013-11-24 17:48:14 +00:00
|
|
|
const EDA_RECT GetBoundingBox() const; // Virtual
|
2010-12-10 19:47:44 +00:00
|
|
|
|
2011-10-31 20:49:48 +00:00
|
|
|
/**
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
* Function PinEndPoint
|
2011-10-31 20:49:48 +00:00
|
|
|
*
|
|
|
|
* @return The pin end position for a component in the normal orientation.
|
|
|
|
*/
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
wxPoint PinEndPoint() const;
|
2010-03-04 09:32:51 +00:00
|
|
|
|
2011-02-28 13:53:49 +00:00
|
|
|
/**
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
* Function PinDrawOrient
|
2011-02-28 13:53:49 +00:00
|
|
|
* returns the pin real orientation (PIN_UP, PIN_DOWN, PIN_RIGHT, PIN_LEFT),
|
|
|
|
* according to its orientation and the matrix transform (rot, mirror) \a aTransform
|
2012-03-26 23:47:08 +00:00
|
|
|
*
|
|
|
|
* @param aTransform Transform matrix
|
2011-02-28 13:53:49 +00:00
|
|
|
*/
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
int PinDrawOrient( const TRANSFORM& aTransform ) const;
|
2010-03-04 09:32:51 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Fill a string buffer with pin number.
|
|
|
|
*
|
|
|
|
* Pin numbers are coded as a long or 4 ASCII characters. Used to print
|
|
|
|
* or draw the pin number.
|
|
|
|
*
|
2010-12-07 16:10:42 +00:00
|
|
|
* @param aStringBuffer - the wxString to store the pin num as an unicode string
|
2010-03-04 09:32:51 +00:00
|
|
|
*/
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
void PinStringNum( wxString& aStringBuffer ) const;
|
2010-08-03 02:13:33 +00:00
|
|
|
|
2010-12-07 16:10:42 +00:00
|
|
|
long GetNumber() const { return m_number; }
|
2010-08-03 02:13:33 +00:00
|
|
|
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
wxString GetNumberString() const { return PinStringNum( m_number ); }
|
2010-03-04 09:32:51 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
* Function PinStringNum (static function)
|
2010-03-04 09:32:51 +00:00
|
|
|
* Pin num is coded as a long or 4 ascii chars
|
|
|
|
* @param aPinNum = a long containing a pin num
|
|
|
|
* @return aStringBuffer = the wxString to store the pin num as an
|
|
|
|
* unicode string
|
|
|
|
*/
|
* KIWAY Milestone A): Make major modules into DLL/DSOs.
! The initial testing of this commit should be done using a Debug build so that
all the wxASSERT()s are enabled. Also, be sure and keep enabled the
USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it
off is senseless anyways. If you want stable code, go back to a prior version,
the one tagged with "stable".
* Relocate all functionality out of the wxApp derivative into more finely
targeted purposes:
a) DLL/DSO specific
b) PROJECT specific
c) EXE or process specific
d) configuration file specific data
e) configuration file manipulations functions.
All of this functionality was blended into an extremely large wxApp derivative
and that was incompatible with the desire to support multiple concurrently
loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects.
An amazing amount of organization come from simply sorting each bit of
functionality into the proper box.
* Switch to wxConfigBase from wxConfig everywhere except instantiation.
* Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD,
PGM_SINGLE_TOP,
* Remove "Return" prefix on many function names.
* Remove obvious comments from CMakeLists.txt files, and from else() and endif()s.
* Fix building boost for use in a DSO on linux.
* Remove some of the assumptions in the CMakeLists.txt files that windows had
to be the host platform when building windows binaries.
* Reduce the number of wxStrings being constructed at program load time via
static construction.
* Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that
these functions are useful even when the wxConfigBase comes from another
source, as is the case in the KICAD_MANAGER_FRAME.
* Move the setting of the KIPRJMOD environment variable into class PROJECT,
so that it can be moved into a project variable soon, and out of FP_LIB_TABLE.
* Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all
its child wxFrames and wxDialogs now have a Kiway() member function which
returns a KIWAY& that that window tree branch is in support of. This is like
wxWindows DNA in that child windows get this member with proper value at time
of construction.
* Anticipate some of the needs for milestones B) and C) and make code
adjustments now in an effort to reduce work in those milestones.
* No testing has been done for python scripting, since milestone C) has that
being largely reworked and re-thought-out.
2014-03-20 00:42:08 +00:00
|
|
|
static wxString PinStringNum( long aPinNum );
|
2010-03-04 09:32:51 +00:00
|
|
|
|
2011-10-31 20:49:48 +00:00
|
|
|
/**
|
|
|
|
* Function SetPinNumFromString
|
|
|
|
* fill the pin number buffer with \a aBuffer.
|
|
|
|
*/
|
2011-02-28 13:53:49 +00:00
|
|
|
void SetPinNumFromString( wxString& aBuffer );
|
2010-03-04 09:32:51 +00:00
|
|
|
|
2010-12-07 16:10:42 +00:00
|
|
|
wxString GetName() const { return m_name; }
|
|
|
|
|
2010-03-04 09:32:51 +00:00
|
|
|
/**
|
|
|
|
* Set the pin name.
|
|
|
|
*
|
|
|
|
* This will also all of the pin names marked by EnableEditMode().
|
|
|
|
*
|
2012-03-26 23:47:08 +00:00
|
|
|
* @param aName New pin name.
|
2010-03-04 09:32:51 +00:00
|
|
|
*/
|
|
|
|
void SetName( const wxString& aName );
|
|
|
|
|
|
|
|
/**
|
2010-10-20 20:24:26 +00:00
|
|
|
* Set the \a aSize of the pin name text.
|
2010-03-04 09:32:51 +00:00
|
|
|
*
|
|
|
|
* This will also update the text size of the name of the pins marked
|
|
|
|
* by EnableEditMode().
|
|
|
|
*
|
2012-03-26 23:47:08 +00:00
|
|
|
* @param aSize The text size of the pin name in schematic units ( mils ).
|
2010-03-04 09:32:51 +00:00
|
|
|
*/
|
|
|
|
void SetNameTextSize( int aSize );
|
|
|
|
|
2011-12-08 21:05:43 +00:00
|
|
|
int GetNameTextSize() const { return m_nameTextSize; }
|
|
|
|
|
2010-03-04 09:32:51 +00:00
|
|
|
/**
|
|
|
|
* Set the pin number.
|
|
|
|
*
|
|
|
|
* Others pin numbers marked by EnableEditMode() are not modified
|
|
|
|
* because each pin has its own number
|
2012-03-26 23:47:08 +00:00
|
|
|
* @param aNumber New pin number.
|
2010-03-04 09:32:51 +00:00
|
|
|
*/
|
|
|
|
void SetNumber( const wxString& aNumber );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the size of the pin number text.
|
|
|
|
*
|
|
|
|
* This will also update the text size of the number of the pins marked
|
|
|
|
* by EnableEditMode().
|
|
|
|
*
|
2012-03-26 23:47:08 +00:00
|
|
|
* @param aSize The text size of the pin number in schematic units ( mils ).
|
2010-03-04 09:32:51 +00:00
|
|
|
*/
|
|
|
|
void SetNumberTextSize( int aSize );
|
|
|
|
|
2011-12-08 21:05:43 +00:00
|
|
|
int GetNumberTextSize() const { return m_numTextSize; }
|
|
|
|
|
2010-12-07 16:10:42 +00:00
|
|
|
int GetOrientation() const { return m_orientation; }
|
|
|
|
|
2010-03-04 09:32:51 +00:00
|
|
|
/**
|
|
|
|
* Set orientation on the pin.
|
|
|
|
*
|
2010-12-07 16:10:42 +00:00
|
|
|
* This will also update the orientation of the pins marked by EnableEditMode().
|
2010-03-04 09:32:51 +00:00
|
|
|
*
|
|
|
|
* @param aOrientation - The orientation of the pin.
|
|
|
|
*/
|
|
|
|
void SetOrientation( int aOrientation );
|
|
|
|
|
2011-02-28 13:53:49 +00:00
|
|
|
void Rotate();
|
|
|
|
|
2010-12-07 16:10:42 +00:00
|
|
|
int GetShape() const { return m_shape; }
|
|
|
|
|
2010-03-04 09:32:51 +00:00
|
|
|
/**
|
2010-12-07 16:10:42 +00:00
|
|
|
* Set the shape of the pin to \a aShape.
|
2010-03-04 09:32:51 +00:00
|
|
|
*
|
2010-12-07 16:10:42 +00:00
|
|
|
* This will also update the draw style of the pins marked by EnableEditMode().
|
2010-03-04 09:32:51 +00:00
|
|
|
*
|
2010-12-07 16:10:42 +00:00
|
|
|
* @param aShape - The draw shape of the pin. See enum DrawPinShape.
|
2010-03-04 09:32:51 +00:00
|
|
|
*/
|
2010-12-07 16:10:42 +00:00
|
|
|
void SetShape( int aShape );
|
|
|
|
|
2011-02-08 12:01:14 +00:00
|
|
|
/**
|
|
|
|
* Get the electrical type of the pin.
|
|
|
|
*
|
|
|
|
* @return The electrical type of the pin (see enun ElectricPinType for values).
|
|
|
|
*/
|
2010-12-07 16:10:42 +00:00
|
|
|
int GetType() const { return m_type; }
|
2010-03-04 09:32:51 +00:00
|
|
|
|
2015-04-02 18:51:47 +00:00
|
|
|
/**
|
|
|
|
* return a string giving the electrical type of a pin.
|
|
|
|
* Can be used when a known, not translated name is needed (for instance in net lists)
|
|
|
|
* @param aType is the electrical type (see enum ElectricPinType )
|
|
|
|
* @return The electrical name for a pin type (see enun MsgPinElectricType for names).
|
|
|
|
*/
|
2015-04-07 13:19:30 +00:00
|
|
|
static const wxString GetCanonicalElectricalTypeName( unsigned aType );
|
2015-04-02 18:51:47 +00:00
|
|
|
|
2011-02-08 12:01:14 +00:00
|
|
|
/**
|
|
|
|
* return a string giving the electrical type of the pin.
|
2015-04-02 18:51:47 +00:00
|
|
|
* Can be used when a known, not translated name is needed (for instance in net lists)
|
|
|
|
* @return The canonical electrical name of the pin.
|
|
|
|
*/
|
|
|
|
wxString const GetCanonicalElectricalTypeName() const
|
|
|
|
{
|
|
|
|
return GetCanonicalElectricalTypeName( m_type );
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* return a translated string for messages giving the electrical type of a pin.
|
|
|
|
* @param aType is the electrical type (see enum ElectricPinType )
|
2011-02-08 12:01:14 +00:00
|
|
|
* @return The electrical name of the pin (see enun MsgPinElectricType for names).
|
|
|
|
*/
|
2015-04-07 13:19:30 +00:00
|
|
|
static const wxString GetElectricalTypeName( unsigned aType );
|
2015-04-02 18:51:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* return a translated string for messages giving the electrical type of the pin.
|
|
|
|
* @return The electrical name of the pin.
|
|
|
|
*/
|
|
|
|
wxString const GetElectricalTypeName() const
|
|
|
|
{
|
|
|
|
return GetElectricalTypeName( m_type );
|
|
|
|
}
|
2011-02-08 12:01:14 +00:00
|
|
|
|
2010-03-04 09:32:51 +00:00
|
|
|
/**
|
|
|
|
* Set the electrical type of the pin.
|
|
|
|
*
|
|
|
|
* This will also update the electrical type of the pins marked by
|
|
|
|
* EnableEditMode().
|
|
|
|
*
|
2011-02-08 12:01:14 +00:00
|
|
|
* @param aType - The electrical type of the pin(see enun ElectricPinType for values).
|
2010-03-04 09:32:51 +00:00
|
|
|
*/
|
2010-12-07 16:10:42 +00:00
|
|
|
void SetType( int aType );
|
2010-03-04 09:32:51 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the pin length.
|
|
|
|
*
|
|
|
|
* This will also update the length of the pins marked by EnableEditMode().
|
|
|
|
*
|
|
|
|
* @param aLength - The length of the pin in mils.
|
|
|
|
*/
|
|
|
|
void SetLength( int aLength );
|
|
|
|
|
2010-12-07 16:10:42 +00:00
|
|
|
int GetLength() { return m_length; }
|
|
|
|
|
2010-03-04 09:32:51 +00:00
|
|
|
/**
|
|
|
|
* Set the pin part number.
|
|
|
|
*
|
|
|
|
* If the pin is changed from not common to common to all parts, any
|
|
|
|
* linked pins will be removed from the parent component.
|
|
|
|
*
|
|
|
|
* @param aPart - Number of the part the pin belongs to. Set to zero to
|
|
|
|
* make pin common to all parts in a multi-part component.
|
|
|
|
*/
|
|
|
|
void SetPartNumber( int aPart );
|
|
|
|
|
2015-03-27 10:26:07 +00:00
|
|
|
/** Get the pin part number. */
|
|
|
|
int GetPartNumber() const { return m_Unit; }
|
|
|
|
|
2010-03-04 09:32:51 +00:00
|
|
|
/**
|
|
|
|
* Set the body style (conversion) of the pin.
|
|
|
|
*
|
|
|
|
* If the pin is changed from not common to common to all body styles, any
|
|
|
|
* linked pins will be removed from the parent component.
|
|
|
|
*
|
2010-12-14 15:56:30 +00:00
|
|
|
* @param aConversion - Body style of the pin. Set to zero to make pin
|
|
|
|
* common to all body styles.
|
2010-03-04 09:32:51 +00:00
|
|
|
*/
|
|
|
|
void SetConversion( int aConversion );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set or clear the visibility flag for the pin.
|
|
|
|
*
|
|
|
|
* This will also update the visibility of the pins marked by
|
|
|
|
* EnableEditMode().
|
|
|
|
*
|
|
|
|
* @param aVisible - True to make the pin visible or false to hide the pin.
|
|
|
|
*/
|
|
|
|
void SetVisible( bool aVisible );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Enable or clear pin editing mode.
|
|
|
|
*
|
|
|
|
* The pin editing mode marks or unmarks all pins common to this
|
2011-10-31 20:49:48 +00:00
|
|
|
* pin object for further editing. If any of the pin modification
|
2010-03-04 09:32:51 +00:00
|
|
|
* methods are called after enabling the editing mode, all pins
|
|
|
|
* marked for editing will have the same attribute changed. The
|
|
|
|
* only case were this is not true making this pin common to all
|
|
|
|
* parts or body styles in the component. See SetCommonToAllParts()
|
|
|
|
* and SetCommonToAllBodyStyles() for more information.
|
|
|
|
*
|
2012-03-26 23:47:08 +00:00
|
|
|
* @param aEnable True marks all common pins for editing mode. False
|
|
|
|
* clears the editing mode.
|
|
|
|
* @param aEditPinByPin Enables the edit pin by pin mode.
|
2010-03-04 09:32:51 +00:00
|
|
|
*/
|
|
|
|
void EnableEditMode( bool aEnable, bool aEditPinByPin = false );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return the visibility status of the draw object.
|
|
|
|
*
|
|
|
|
* @return True if draw object is visible otherwise false.
|
|
|
|
*/
|
2015-07-20 19:49:32 +00:00
|
|
|
bool IsVisible() const { return ( m_attributes & PIN_INVISIBLE ) == 0; }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return whether this pin forms an implicit power connection: i.e., is hidden
|
|
|
|
* and of type POWER_IN.
|
|
|
|
*/
|
|
|
|
bool IsPowerConnection() const { return !IsVisible() && GetType() == PIN_POWER_IN; }
|
2010-03-04 09:32:51 +00:00
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
int GetPenSize() const;
|
2010-03-04 09:32:51 +00:00
|
|
|
|
2011-10-31 20:49:48 +00:00
|
|
|
/**
|
|
|
|
* Function DrawPinSymbol
|
|
|
|
* Draw the pin symbol without text.
|
|
|
|
* If \a aColor != 0, draw with \a aColor, else with the normal pin color.
|
|
|
|
*/
|
2011-01-21 19:30:59 +00:00
|
|
|
void DrawPinSymbol( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aPosition,
|
2012-09-01 13:38:27 +00:00
|
|
|
int aOrientation, GR_DRAWMODE aDrawMode,
|
2015-06-08 00:07:42 +00:00
|
|
|
EDA_COLOR_T aColor = UNSPECIFIED_COLOR,
|
2015-07-21 14:07:52 +00:00
|
|
|
bool aDrawDangling = true,
|
|
|
|
bool aOnlyTarget = false );
|
2010-03-04 09:32:51 +00:00
|
|
|
|
2011-10-31 20:49:48 +00:00
|
|
|
/**
|
|
|
|
* Function DrawPinTexts
|
|
|
|
* puts the pin number and pin text info, given the pin line coordinates.
|
2013-02-20 11:46:38 +00:00
|
|
|
* The line must be vertical or horizontal.
|
|
|
|
* If DrawPinName == false the pin name is not printed.
|
|
|
|
* If DrawPinNum = false the pin number is not printed.
|
2011-10-31 20:49:48 +00:00
|
|
|
* If TextInside then the text is been put inside,otherwise all is drawn outside.
|
|
|
|
* Pin Name: substring between '~' is negated
|
|
|
|
* DrawMode = GR_OR, XOR ...
|
|
|
|
*/
|
2011-01-21 19:30:59 +00:00
|
|
|
void DrawPinTexts( EDA_DRAW_PANEL* aPanel, wxDC* aDC, wxPoint& aPosition,
|
2010-03-04 09:32:51 +00:00
|
|
|
int aOrientation, int TextInside, bool DrawPinNum, bool DrawPinName,
|
2012-09-02 12:06:47 +00:00
|
|
|
EDA_COLOR_T aColor, GR_DRAWMODE aDrawMode );
|
2010-03-04 09:32:51 +00:00
|
|
|
|
2011-10-31 20:49:48 +00:00
|
|
|
/**
|
|
|
|
* Function PlotPinTexts
|
|
|
|
* plots the pin number and pin text info, given the pin line coordinates.
|
|
|
|
* Same as DrawPinTexts((), but output is the plotter
|
|
|
|
* The line must be vertical or horizontal.
|
|
|
|
* If TextInside then the text is been put inside (moving from x1, y1 in
|
|
|
|
* the opposite direction to x2,y2), otherwise all is drawn outside.
|
|
|
|
*/
|
2010-03-04 09:32:51 +00:00
|
|
|
void PlotPinTexts( PLOTTER *aPlotter,
|
|
|
|
wxPoint& aPosition,
|
|
|
|
int aOrientation,
|
|
|
|
int aTextInside,
|
|
|
|
bool aDrawPinNum,
|
|
|
|
bool aDrawPinName,
|
|
|
|
int aWidth );
|
|
|
|
|
2011-06-17 13:24:22 +00:00
|
|
|
void PlotSymbol( PLOTTER* aPlotter, const wxPoint& aPosition, int aOrientation );
|
|
|
|
|
2010-03-04 09:32:51 +00:00
|
|
|
/**
|
|
|
|
* Get a list of pin orientation names.
|
|
|
|
*
|
|
|
|
* @return List of valid pin orientation names.
|
|
|
|
*/
|
|
|
|
static wxArrayString GetOrientationNames();
|
|
|
|
|
|
|
|
/**
|
2011-01-05 19:16:55 +00:00
|
|
|
* Get a list of pin orientation bitmaps for menus and dialogs.
|
2010-03-04 09:32:51 +00:00
|
|
|
*
|
|
|
|
* @return List of valid pin orientation bitmaps symbols in .xpm format
|
|
|
|
*/
|
2011-08-29 03:04:59 +00:00
|
|
|
static const BITMAP_DEF* GetOrientationSymbols();
|
2010-03-04 09:32:51 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the orientation code by index used to set the pin orientation.
|
|
|
|
*
|
|
|
|
* @param aIndex - The index of the orientation code to look up.
|
|
|
|
* @return Orientation code if index is valid. Returns right
|
|
|
|
* orientation on index error.
|
|
|
|
*/
|
|
|
|
static int GetOrientationCode( int aIndex );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the index of the orientation code.
|
|
|
|
*
|
|
|
|
* @param aCode - The orientation code to look up.
|
|
|
|
* @return The index of the orientation code if found. Otherwise,
|
|
|
|
* return wxNOT_FOUND.
|
|
|
|
*/
|
|
|
|
static int GetOrientationCodeIndex( int aCode );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get a list of pin draw style names.
|
|
|
|
*
|
|
|
|
* @return List of valid pin draw style names.
|
|
|
|
*/
|
|
|
|
static wxArrayString GetStyleNames();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get a list of pin styles bitmaps for menus and dialogs.
|
|
|
|
*
|
|
|
|
* @return List of valid pin electrical type bitmaps symbols in .xpm format.
|
|
|
|
*/
|
2011-08-29 03:04:59 +00:00
|
|
|
static const BITMAP_DEF* GetStyleSymbols();
|
2010-03-04 09:32:51 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the pin draw style code by index used to set the pin draw style.
|
|
|
|
*
|
|
|
|
* @param aIndex - The index of the pin draw style code to look up.
|
|
|
|
* @return Pin draw style code if index is valid. Returns NONE
|
|
|
|
* style on index error.
|
|
|
|
*/
|
|
|
|
static int GetStyleCode( int aIndex );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the index of the pin draw style code.
|
|
|
|
*
|
|
|
|
* @param aCode - The pin draw style code to look up.
|
|
|
|
* @return The index of the pin draw style code if found. Otherwise,
|
|
|
|
* return wxNOT_FOUND.
|
|
|
|
*/
|
|
|
|
static int GetStyleCodeIndex( int aCode );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get a list of pin electrical type names.
|
|
|
|
*
|
|
|
|
* @return List of valid pin electrical type names.
|
|
|
|
*/
|
|
|
|
static wxArrayString GetElectricalTypeNames();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get a list of pin electrical bitmaps for menus and dialogs.
|
|
|
|
*
|
|
|
|
* @return List of valid pin electrical type bitmaps symbols in .xpm format
|
|
|
|
*/
|
2011-08-29 03:04:59 +00:00
|
|
|
static const BITMAP_DEF* GetElectricalTypeSymbols();
|
2010-03-04 09:32:51 +00:00
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
void SetOffset( const wxPoint& aOffset );
|
2012-02-27 23:02:08 +00:00
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
bool Inside( EDA_RECT& aRect ) const;
|
2012-02-27 23:02:08 +00:00
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
void Move( const wxPoint& aPosition );
|
2012-02-27 23:02:08 +00:00
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
wxPoint GetPosition() const { return m_position; }
|
2012-02-27 23:02:08 +00:00
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
void MirrorHorizontal( const wxPoint& aCenter );
|
2012-02-27 23:02:08 +00:00
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
void MirrorVertical( const wxPoint& aCenter );
|
2012-02-27 23:02:08 +00:00
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
void Rotate( const wxPoint& aCenter, bool aRotateCCW = true );
|
2012-02-27 23:02:08 +00:00
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
void Plot( PLOTTER* aPlotter, const wxPoint& aOffset, bool aFill,
|
|
|
|
const TRANSFORM& aTransform );
|
2012-02-27 23:02:08 +00:00
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
int GetWidth() const { return m_width; }
|
2012-02-27 23:02:08 +00:00
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
void SetWidth( int aWidth );
|
2012-02-27 23:02:08 +00:00
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
BITMAP_DEF GetMenuImage() const;
|
2011-03-25 19:16:05 +00:00
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
wxString GetSelectMenuText() const;
|
2011-03-25 19:16:05 +00:00
|
|
|
|
2012-03-26 23:47:08 +00:00
|
|
|
EDA_ITEM* Clone() const;
|
2012-03-17 14:39:27 +00:00
|
|
|
|
2012-02-27 23:02:08 +00:00
|
|
|
private:
|
2010-03-04 09:32:51 +00:00
|
|
|
|
|
|
|
/**
|
2012-03-26 23:47:08 +00:00
|
|
|
* @copydoc LIB_ITEM::compare()
|
2010-03-04 09:32:51 +00:00
|
|
|
*
|
2012-03-26 23:47:08 +00:00
|
|
|
* The pin specific sort order is as follows:
|
2010-03-04 09:32:51 +00:00
|
|
|
* - Pin number.
|
|
|
|
* - Pin name, case insensitive compare.
|
|
|
|
* - Pin horizontal (X) position.
|
|
|
|
* - Pin vertical (Y) position.
|
|
|
|
*/
|
2012-03-26 23:47:08 +00:00
|
|
|
int compare( const LIB_ITEM& aOther ) const;
|
2010-03-04 09:32:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // CLASS_PIN_H
|