100 wxCHECK( editor,
false );
126 if( dlg.ShowModal() == wxID_CANCEL )
142 got_unit[aPin->
GetUnit()] =
true;
144 for(
LIB_PIN* other : pinList )
152 if( got_unit[other->GetUnit()] )
155 if( other->GetPosition() == original_pin.
GetPosition()
157 && other->GetType() == original_pin.
GetType()
158 && other->IsVisible() == original_pin.
IsVisible()
159 && other->GetName() == original_pin.
GetName() )
166 else if( other->GetConvert() == aPin->
GetConvert() )
170 other->SetShape( aPin->
GetShape() );
180 other->SetType( aPin->
GetType() );
182 other->SetName( aPin->
GetName() );
186 other->SetModified();
187 got_unit[other->GetUnit()] =
true;
217 bool ask_for_pin =
true;
231 msg.Printf(
_(
"This position is already occupied by another pin, in unit %d." ),
234 KIDIALOG dlg(
m_frame, msg,
_(
"Confirmation" ), wxOK | wxCANCEL | wxICON_WARNING );
235 dlg.SetOKLabel(
_(
"Place Pin Anyway" ) );
238 bool status = dlg.
ShowModal() == wxID_OK;
270 if( ( pin->GetEditFlags() &
IS_LINKED ) == 0 )
299 pin->
MoveTo((wxPoint) aPosition );
349 unknownNum.Printf(
"%s-U%c", aPin->
GetNumber(), wxChar(
'A' + ii - 1 ) );
358 catch(
const boost::bad_pointer& e )
360 wxLogError(
"Cannot add new pin to symbol. Boost pointer error %s occurred.",
375 LIB_PIN* sourcePin = dynamic_cast<LIB_PIN*>( selection.
Front() );
384 if( pin == sourcePin )
390 pin->SetLength( sourcePin->
GetLength() );
422 case PIN_UP: step.x = Mils2iu(settings->m_Repeat.pin_step);
break;
423 case PIN_DOWN: step.x = Mils2iu(settings->m_Repeat.pin_step);
break;
424 case PIN_LEFT: step.y = Mils2iu(-settings->m_Repeat.pin_step);
break;
425 case PIN_RIGHT: step.y = Mils2iu(-settings->m_Repeat.pin_step);
break;
430 wxString nextName = pin->
GetName();
void OnModify() override
Must be called after a schematic change in order to set the "modify" flag of the current symbol.
void SetNumberTextSize(int aSize)
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.
void UpdateItem(EDA_ITEM *aItem, bool isAddOrDelete=false)
Mark an item for refresh.
void SetOrientation(int aOrientation)
Helper class to create more flexible dialogs, including 'do not show again' checkbox handling.
void MoveTo(const wxPoint &aNewPosition) override
Move a draw object to aPosition.
This file is part of the common library.
int GetOrientation() const
LIB_PART * GetParent() const
std::vector< LIB_PIN * > LIB_PINS
Helper for defining a list of pin object pointers.
void SetShape(GRAPHIC_PINSHAPE aShape)
GRAPHIC_PINSHAPE GetShape() const
void SetLength(int aLength)
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.
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
static TOOL_ACTION pushPinNameSize
void ClearTempFlags()
Clears the status flag all draw objects in this part.
void AddDrawItem(LIB_ITEM *aItem)
Add a new draw aItem to the draw object list.
void SetNumber(const wxString &aNumber)
void GetPins(LIB_PINS &aList, int aUnit=0, int aConvert=0)
Return a list of pin object pointers from the draw item list.
#define IS_LINKED
Used in calculation to mark linked items (temporary use)
void SetType(ELECTRICAL_PINTYPE aType)
void SetFlags(STATUS_FLAGS aMask)
int GetUnitCount() const override
For items with units, return the number of units.
bool IsSymbolAlias() const
Restore the empty editor screen, without any part or library selected.
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Clear the message panel and populates it with the contents of aList.
STATUS_FLAGS GetEditFlags() const
const wxString & GetName() const
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.
Define a library symbol object.
void SetVisible(bool aVisible)
virtual PICKED_ITEMS_LIST * PopCommandFromUndoList()
Return the last command to undo and remove it from list, nothing is deleted.
static TOOL_ACTION pushPinLength
int GetNameTextSize() const
Implementing DIALOG_LIB_EDIT_PIN_BASE.
LIB_PART * GetCurPart()
Return the current part being edited or NULL if none selected.
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 SetConvert(int aConvert)
wxPoint GetPosition() const override
LIB_PIN * GetNextPin(LIB_PIN *aItem=NULL)
Return the next pin object from the draw list.
#define IS_PASTED
Modifier on IS_NEW which indicates it came from clipboard.
const wxString & GetNumber() const
ELECTRICAL_PINTYPE GetType() const
int GetNumberTextSize() const
void SetName(const wxString &aName)
bool IsSymbolEditable() const
Test if a symbol is loaded and can be edited.
void SetNameTextSize(int aSize)
ELECTRICAL_PINTYPE
The component 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.
std::vector< MSG_PANEL_ITEM > MSG_PANEL_ITEMS
void ClearFlags(STATUS_FLAGS aMask=EDA_ITEM_ALL_FLAGS)
static TOOL_ACTION pushPinNumSize
void Offset(const wxPoint &aOffset) override
Set the drawing object by aOffset from the current position.
#define IS_NEW
New item, just created.
bool HasFlag(STATUS_FLAGS aFlag) const
void RemoveDrawItem(LIB_ITEM *aItem)
Remove draw aItem from list.
The symbol library editor main window.