50 std::vector<PICKED_SYMBOL>& aHistoryList,
51 std::vector<PICKED_SYMBOL>& aAlreadyPlaced,
52 bool aShowFootprints,
const LIB_ID* aHighlight,
58 if( !dialogLock.try_lock() )
62 aAllowFields, aShowFootprints );
64 if( dlg.ShowModal() == wxID_CANCEL )
86 aHistoryList.insert( aHistoryList.begin(), sel );
103 if( unitCount <= 1 || aSymbol->GetUnit() == aUnit )
106 if( aUnit > unitCount )
116 if( !commit.
Empty() )
118 if(
eeconfig()->m_AutoplaceFields.enable )
121 commit.
Push(
_(
"Change Unit" ) );
138 msg.Printf(
_(
"No alternate body style found for symbol '%s' in library '%s'." ),
139 id.GetLibItemName().wx_str(),
140 id.GetLibNickname().wx_str() );
161 commit.
Push(
_(
"Change Body Style" ) );
173 if( aFunction == aPin->
GetName() )
174 aPin->
SetAlt( wxEmptyString );
176 aPin->
SetAlt( aFunction );
178 commit.
Push(
_(
"Set Pin Function" ) );
COMMIT & Modify(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Create an undo entry for an item that has been already modified.
bool Empty() const
Returns status of an item.
std::vector< std::pair< int, wxString > > GetFields() const
Get a list of fields edited by the user.
static std::mutex g_Mutex
LIB_ID GetSelectedLibId(int *aUnit=nullptr) const
To be called after this dialog returns from ShowModal().
A base class for most all the KiCad significant classes used in schematics and boards.
EDA_ITEM_FLAGS GetEditFlags() const
static TOOL_ACTION addItemToSel
Selects an item (specified as the event parameter).
A logical library item identifier and consists of various portions much like a URI.
bool IsValid() const
Check if this LID_ID is valid.
Define a library symbol object.
int GetUnitCount() const override
PICKED_SYMBOL PickSymbolFromLibrary(const SYMBOL_LIBRARY_FILTER *aFilter, std::vector< PICKED_SYMBOL > &aHistoryList, std::vector< PICKED_SYMBOL > &aAlreadyPlaced, bool aShowFootprints, const LIB_ID *aHighlight=nullptr, bool aAllowFields=true)
Call the library viewer to select symbol to import into schematic.
EESCHEMA_SETTINGS * eeconfig() const
LIB_SYMBOL * GetLibSymbol(const LIB_ID &aLibId, bool aUseCacheLib=false, bool aShowErrorMsg=false)
Load symbol from symbol library table.
virtual void Push(const wxString &aMessage=wxT("A commit"), int aCommitFlags=0) override
Revert the commit by restoring the modified items state.
SCH_SCREEN * GetScreen() const override
Return a pointer to a BASE_SCREEN or one of its derivatives.
void SetAltPinFunction(SCH_PIN *aPin, const wxString &aFunction)
SCH_SHEET_PATH & GetCurrentSheet() const
void FlipBodyStyle(SCH_SYMBOL *aSymbol)
void SelectUnit(SCH_SYMBOL *aSymbol, int aUnit)
virtual void SetUnit(int aUnit)
void AutoAutoplaceFields(SCH_SCREEN *aScreen)
Autoplace fields only if correct to do so automatically.
void SetAlt(const wxString &aAlt)
const wxString & GetName() const
void SetBodyStyle(int aBodyStyle) override
const LIB_ID & GetLibId() const override
void SetUnitSelection(const SCH_SHEET_PATH *aSheet, int aUnitSelection)
Set the selected unit of this symbol on one sheet.
std::unique_ptr< LIB_SYMBOL > & GetLibSymbolRef()
Helper object to filter a list of libraries.
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
This file is part of the common library.
void delete_if(_Container &__c, _Function &&__f)
Deletes all values from __c for which __f returns true.
std::vector< std::pair< int, wxString > > Fields
Definition for symbol library class.