100 static const std::vector<KICAD_T> pinTypes = {
SCH_PIN_T };
120 std::vector<bool> got_unit( aSymbol->
GetUnitCount() + 1 );
123 [&got_unit](
int aUnit )
125 if( aUnit >= 0 &&
static_cast<size_t>( aUnit ) < got_unit.size() )
126 got_unit[
static_cast<size_t>( aUnit )] =
true;
130 [&got_unit](
int aUnit )
132 return aUnit >= 0 &&
static_cast<size_t>( aUnit ) < got_unit.size()
133 && got_unit[
static_cast<size_t>( aUnit )];
148 if( unitDone( other->GetUnit() ) )
151 if( other->GetPosition() != aOriginalPin.
GetPosition()
153 || other->GetType() != aOriginalPin.
GetType()
154 || other->IsVisible() != aOriginalPin.
IsVisible()
155 || other->GetName() != aOriginalPin.
GetName() )
162 other->ChangeLength( aPin->
GetLength() );
167 other->SetShape( aPin->
GetShape() );
171 other->SetType( aPin->
GetType() );
173 other->SetName( aPin->
GetName() );
177 markUnit( other->GetUnit() );
187 if( coversBodyStyles || coversUnits )
213 if( !aPin->
IsNew() &&
m_frame->SynchronizePins() && parentSymbol )
216 commit.
Push(
_(
"Edit Pin Properties" ) );
221 if( removedPins > 0 )
227 std::vector<MSG_PANEL_ITEM> items;
249 bool ask_for_pin =
true;
262 if( ask_for_pin &&
m_frame->SynchronizePins() )
265 msg.Printf(
_(
"This position is already occupied by another pin, in unit %d." ),
268 KIDIALOG dlg(
m_frame, msg,
_(
"Confirmation" ), wxOK | wxCANCEL | wxICON_WARNING );
269 dlg.SetExtendedMessage(
_(
"Disable the 'Synchronized Pins Mode' option to avoid this message." ) );
270 dlg.SetOKLabel(
_(
"Place Pin Anyway" ) );
273 bool status = dlg.
ShowModal() == wxID_OK;
295 if(
m_frame->SynchronizePins() )
331 if(
m_frame->SynchronizePins() )
334 pin->SetPosition( aPosition );
362 if( !
m_frame->SynchronizePins() )
386 unknownNum.Printf(
"%s-U%c", aPin->
GetNumber(), wxChar(
'A' + ii - 1 ) );
396 catch(
const boost::bad_pointer& e )
398 wxFAIL_MSG( wxString::Format( wxT(
"Boost pointer exception occurred: %s" ), e.what() ));
421 if(
pin == sourcePin )
463 switch(
pin->GetOrientation() )
474 wxString nextName =
pin->GetName();
476 pin->SetName( nextName );
478 wxString nextNumber =
pin->GetNumber();
480 pin->SetNumber( nextNumber );
483 if(
m_frame->SynchronizePins() )
488 commit.
Push(
_(
"Repeat Pin" ) );
constexpr EDA_IU_SCALE schIUScale
static TOOL_ACTION selectionClear
Clear the current selection.
COMMIT & Modify(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr, RECURSE_MODE aRecurse=RECURSE_MODE::NO_RECURSE)
Modify a given item in the model.
EDA_ITEM_FLAGS GetEditFlags() const
void ClearFlags(EDA_ITEM_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
bool HasFlag(EDA_ITEM_FLAGS aFlag) const
Helper class to create more flexible dialogs, including 'do not show again' checkbox handling.
void DoNotShowCheckbox(wxString file, int line)
Shows the 'do not show again' checkbox.
Define a library symbol object.
void ClearTempFlags() override
Clears the status flag all draw objects in this symbol.
void RemoveDrawItem(SCH_ITEM *aItem)
Remove draw aItem from list.
int GetUnitCount() const override
std::vector< SCH_PIN * > GetGraphicalPins(int aUnit=0, int aBodyStyle=0) const override
Graphical pins: Return schematic pin objects as drawn (unexpanded), filtered by unit/body.
void AddDrawItem(SCH_ITEM *aItem, bool aSort=true)
Add a new draw aItem to the draw object list and sort according to aSort.
static TOOL_ACTION pushPinLength
static TOOL_ACTION pushPinNameSize
static TOOL_ACTION pushPinNumSize
Commit for the schematic and symbol editors.
void Push(const wxString &aMessage=wxEmptyString, int aCommitFlags=0) override
Execute the changes.
SCH_ITEM * Duplicate(bool addToParentGroup, SCH_COMMIT *aCommit=nullptr, bool aDoClone=false) const
Routine to create a new copy of given item.
const SYMBOL * GetParentSymbol() const
virtual void SetUnit(int aUnit)
int GetNumberTextSize() const
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.
void SetNumber(const wxString &aNumber)
const wxString & GetName() const
PIN_ORIENTATION GetOrientation() const
VECTOR2I GetPosition() const override
int GetNameTextSize() const
const wxString & GetNumber() const
GRAPHIC_PINSHAPE GetShape() const
ELECTRICAL_PINTYPE GetType() const
static SELECTION_CONDITION Count(int aNumber)
Create a functor that tests if the number of selected items is equal to the value given as parameter.
static SELECTION_CONDITION OnlyTypes(std::vector< KICAD_T > aTypes)
Create a functor that tests if the selected items are only of given types.
The symbol library editor main window.
#define IS_PASTED
Modifier on IS_NEW which indicates it came from clipboard.
#define IS_NEW
New item, just created.
#define IS_LINKED
Used in calculation to mark linked items (temporary use)
KICOMMON_API bool IncrementString(wxString &name, int aIncrement)
Generic string incrementer.
ELECTRICAL_PINTYPE
The symbol library pin object electrical types used in ERC tests.
@ PT_INPUT
usual pin input: must be connected
PIN_ORIENTATION
The symbol library pin object orientations.
@ PIN_UP
The pin extends upwards from the connection point: Probably on the bottom side of the symbol.
@ PIN_RIGHT
The pin extends rightwards from the connection point.
@ PIN_LEFT
The pin extends leftwards from the connection point: Probably on the right side of the symbol.
@ PIN_DOWN
The pin extends downwards from the connection: Probably on the top side of the symbol.
T * GetAppSettings(const char *aFilename)
std::vector< FAB_LAYER_COLOR > dummy
VECTOR2< int32_t > VECTOR2I