103 return editor->IsSymbolEditable() && !
editor->IsSymbolAlias();
127 if( dlg.ShowModal() == wxID_CANCEL )
147 got_unit[static_cast<size_t>(aPin->
GetUnit())] =
true;
149 for(
LIB_PIN* other : pinList )
157 if( got_unit[static_cast<size_t>( other->GetUnit() )] )
160 if( other->GetPosition() == original_pin.
GetPosition()
162 && other->GetType() == original_pin.
GetType()
163 && other->IsVisible() == original_pin.
IsVisible()
164 && other->GetName() == original_pin.
GetName() )
171 else if( other->GetConvert() == aPin->
GetConvert() )
175 other->SetShape( aPin->
GetShape() );
185 other->SetType( aPin->
GetType() );
187 other->SetName( aPin->
GetName() );
191 other->SetModified();
192 got_unit[static_cast<size_t>( other->GetUnit() )] =
true;
200 std::vector<MSG_PANEL_ITEM> items;
222 bool ask_for_pin =
true;
236 msg.Printf(
_(
"This position is already occupied by another pin, in unit %d." ),
239 KIDIALOG dlg(
m_frame, msg,
_(
"Confirmation" ), wxOK | wxCANCEL | wxICON_WARNING );
240 dlg.SetOKLabel(
_(
"Place Pin Anyway" ) );
243 bool status = dlg.
ShowModal() == wxID_OK;
304 pin->MoveTo((wxPoint) aPosition );
354 unknownNum.Printf( wxT(
"%s-U%c" ), aPin->
GetNumber(), wxChar(
'A' + ii - 1 ) );
363 catch(
const boost::bad_pointer& e )
365 wxLogError( wxT(
"Cannot add new pin to symbol. Boost pointer error %s occurred." ),
380 LIB_PIN* sourcePin = dynamic_cast<LIB_PIN*>( selection.
Front() );
389 if(
pin == sourcePin )
425 switch(
pin->GetOrientation() )
427 case PIN_UP: step.x = Mils2iu(settings->m_Repeat.pin_step);
break;
428 case PIN_DOWN: step.x = Mils2iu(settings->m_Repeat.pin_step);
break;
429 case PIN_LEFT: step.y = Mils2iu(-settings->m_Repeat.pin_step);
break;
430 case PIN_RIGHT: step.y = Mils2iu(-settings->m_Repeat.pin_step);
break;
435 wxString nextName =
pin->GetName();
437 pin->SetName( nextName );
439 wxString nextNumber =
pin->GetNumber();
441 pin->SetNumber( nextNumber );
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current symbol.
void GetPins(LIB_PINS &aList, int aUnit=0, int aConvert=0) const
Return a list of pin object pointers from the draw item list.
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
void DoNotShowCheckbox(wxString file, int line)
Checks the 'do not show again' setting for the dialog.
Helper class to create more flexible dialogs, including 'do not show again' checkbox handling.
#define IS_NEW
New item, just created.
This file is part of the common library.
int GetOrientation() const
std::vector< LIB_PIN * > LIB_PINS
Helper for defining a list of pin object pointers.
GRAPHIC_PINSHAPE GetShape() const
bool HasFlag(EDA_ITEM_FLAGS aFlag) const
void RemoveDrawItem(LIB_ITEM *aItem)
Remove draw aItem from list.
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.
Define a library symbol object.
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
static TOOL_ACTION pushPinNameSize
#define IS_LINKED
Used in calculation to mark linked items (temporary use)
void SetNumber(const wxString &aNumber)
LIB_SYMBOL * GetCurSymbol() const
Return the current symbol being edited or NULL if none selected.
#define IS_PASTED
Modifier on IS_NEW which indicates it came from clipboard.
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Clear the message panel and populates it with the contents of aList.
const wxString & GetName() const
int GetUnitCount() const override
For items with units, return the number of units.
void SaveCopyInUndoList(EDA_ITEM *aItem, UNDO_REDO aUndoType=UNDO_REDO::LIBEDIT, bool aAppend=false)
Create a copy of the current symbol, and save it in the undo list.
virtual PICKED_ITEMS_LIST * PopCommandFromUndoList()
Return the last command to undo and remove it from list, nothing is deleted.
static TOOL_ACTION pushPinLength
void UpdateItem(EDA_ITEM *aItem, bool isAddOrDelete=false, bool aUpdateRtree=false)
Mark an item for refresh.
void ClearFlags(EDA_ITEM_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
void AddDrawItem(LIB_ITEM *aItem, bool aSort=true)
Add a new draw aItem to the draw object list and sort according to aSort.
EDA_ITEM_FLAGS GetEditFlags() const
int GetNameTextSize() const
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Display basic info (type, part and convert) about the current item in message panel.
void ClearTempFlags()
Clears the status flag all draw objects in this symbol.
wxPoint GetPosition() const override
const wxString & GetNumber() const
ELECTRICAL_PINTYPE GetType() const
LIB_SYMBOL * GetParent() const
int GetNumberTextSize() const
ELECTRICAL_PINTYPE
The symbol library pin object electrical types used in ERC tests.
usual pin input: must be connected
static SELECTION_CONDITION OnlyType(KICAD_T aType)
Create a functor that tests if the selected items are only of given type.
LIB_PIN * GetNextPin(LIB_PIN *aItem=nullptr)
Return the next pin object from the draw list.
static TOOL_ACTION pushPinNumSize
The symbol library editor main window.