39 std::function<
void(
int,
int,
40 const wxString& )> aProgressCallback )
54 std::unique_ptr<LIB_SYMBOL> new_symbol = std::make_unique<LIB_SYMBOL>( aProps.
name );
58 new_symbol->GetReferenceField().SetText( aProps.
reference );
59 new_symbol->SetUnitCount( aProps.
unitCount,
true );
65 if( new_symbol->GetPinNameOffset() == 0 )
66 new_symbol->SetPinNameOffset( 1 );
70 new_symbol->SetPinNameOffset( 0 );
73 ( aProps.
powerSymbol ) ? new_symbol->SetGlobalPower() : new_symbol->SetNormal();
81 new_symbol->LockUnits(
false );
84 new_symbol->SetBodyStyleCount( 2,
false,
true );
88 new_symbol->SetParent( aParent );
92 SCH_FIELD* field = new_symbol->GetField( fieldId );
95 *field = *parentField;
109 field->
SetText( wxEmptyString );
114 field->
SetText( wxEmptyString );
126 std::vector<SCH_FIELD*> listFields;
136 new_field->
SetText( wxEmptyString );
138 new_field->
SetParent( new_symbol.get() );
139 new_symbol->AddField( new_field );
157 std::unique_ptr<LIB_SYMBOL> new_symbol =
CreateSymbol( aProps, parent );
virtual void SetParent(EDA_ITEM *aParent)
bool CreateNewSymbol(const wxString &aLibrary, const NEW_SYMBOL_PROPERTIES &aProps)
wxObjectDataPtr< LIB_TREE_MODEL_ADAPTER > m_adapter
static std::unique_ptr< LIB_SYMBOL > CreateSymbol(const NEW_SYMBOL_PROPERTIES &aProps, LIB_SYMBOL *aParent)
void OnDataChanged() const override
void Sync(const wxString &aForceRefresh, std::function< void(int, int, const wxString &)> aProgressCallback)
Updates the SYMBOL_LIBRARY_MANAGER data to synchronize with Symbol Library Table.
int m_syncHash
Symbol lib table hash value from last synchronization.
LIB_SYMBOL_LIBRARY_MANAGER(SYMBOL_EDIT_FRAME &aFrame)
SYMBOL_TREE_SYNCHRONIZING_ADAPTER * getAdapter()
Define a library symbol object.
void GetFields(std::vector< SCH_FIELD * > &aList, bool aVisibleOnly=false) const override
Populate a std::vector with SCH_FIELDs, sorted in ordinal order.
bool IsPower() const override
SCH_FIELD * GetField(const wxString &aFieldName)
Find a field within this symbol matching aFieldName; return nullptr if not found.
void SetText(const wxString &aText) override
The symbol library editor main window.
LIB_SYMBOL * GetSymbol(const wxString &aSymbolName, const wxString &aLibrary) const
Return either an alias of a working LIB_SYMBOL copy, or alias of the original symbol if there is no w...
SYMBOL_LIB_TABLE * symTable() const
Return the current symbol library table.
SYMBOL_LIBRARY_MANAGER(SCH_BASE_FRAME &aFrame)
SCH_BASE_FRAME & m_frame
Parent frame.
bool UpdateSymbol(LIB_SYMBOL *aSymbol, const wxString &aLibrary)
Update the symbol buffer with a new version of the symbol.
static wxObjectDataPtr< LIB_TREE_MODEL_ADAPTER > Create(SYMBOL_EDIT_FRAME *aParent, SYMBOL_LIBRARY_MANAGER *aLibs)
void Sync(const wxString &aForceRefresh, std::function< void(int, int, const wxString &)> aProgressCallback)
wxString parentSymbolName
bool keepContentUserFields
bool unitsInterchangeable
FIELD_T
The set of all field indices assuming an array like sequence that a SCH_COMPONENT or LIB_PART can hol...
@ USER
The field ID hasn't been set yet; field is invalid.
@ FOOTPRINT
Field Name Module PCB, i.e. "16DIP300".
@ DATASHEET
name of datasheet
@ REFERENCE
Field Reference of part, i.e. "IC21".
@ VALUE
Field Value of part, i.e. "3.3K".