KiCad PCB EDA Suite
|
#include <sheet_synchronization_model.h>
Public Types | |
enum | SHEET_SYNCHRONIZATION_COL { NAME , SHAPE , COL_COUNT } |
enum | { HIRE_LABEL , SHEET_PIN , ASSOCIATED , MODEL_COUNT } |
Public Member Functions | |
SHEET_SYNCHRONIZATION_MODEL (SHEET_SYNCHRONIZATION_AGENT &aAgent, SCH_SHEET *aSheet, SCH_SHEET_PATH &aPath) | |
~SHEET_SYNCHRONIZATION_MODEL () override | |
void | GetValueByRow (wxVariant &variant, unsigned row, unsigned col) const override |
bool | SetValueByRow (const wxVariant &variant, unsigned row, unsigned col) override |
bool | GetAttrByRow (unsigned row, unsigned int col, wxDataViewItemAttr &attr) const override |
void | RemoveItems (wxDataViewItemArray const &aItems) |
bool | AppendNewItem (std::shared_ptr< SHEET_SYNCHRONIZATION_ITEM > aItem) |
Add a new item, the notifiers are notified. | |
bool | AppendItem (std::shared_ptr< SHEET_SYNCHRONIZATION_ITEM > aItem) |
Just append item to the list, the notifiers are not notified. | |
SHEET_SYNCHRONIZATION_ITEM_LIST | TakeItems (wxDataViewItemArray const &aItems) |
SHEET_SYNCHRONIZATION_ITE_PTR | TakeItem (wxDataViewItem const &aItem) |
SHEET_SYNCHRONIZATION_ITE_PTR | GetSynchronizationItem (unsigned aIndex) const |
void | OnRowSelected (std::optional< unsigned > aRow) |
void | UpdateItems (SHEET_SYNCHRONIZATION_ITEM_LIST aItems) |
void | AddNotifier (std::shared_ptr< SHEET_SYNCHRONIZATION_NOTIFIER > aNotifier) |
void | DoNotify () |
bool | HasSelectedIndex () const |
std::optional< unsigned int > | GetSelectedIndex () const |
Static Public Member Functions | |
static wxString | GetColName (int col) |
Private Attributes | |
SHEET_SYNCHRONIZATION_ITEM_LIST | m_items |
std::optional< unsigned > | m_selectedIndex |
std::list< std::shared_ptr< SHEET_SYNCHRONIZATION_NOTIFIER > > | m_notifiers |
SHEET_SYNCHRONIZATION_AGENT & | m_agent |
SCH_SHEET * | m_sheet |
SCH_SHEET_PATH | m_path |
Definition at line 44 of file sheet_synchronization_model.h.
anonymous enum |
Enumerator | |
---|---|
HIRE_LABEL | |
SHEET_PIN | |
ASSOCIATED | |
MODEL_COUNT |
Definition at line 54 of file sheet_synchronization_model.h.
Enumerator | |
---|---|
NAME | |
SHAPE | |
COL_COUNT |
Definition at line 47 of file sheet_synchronization_model.h.
SHEET_SYNCHRONIZATION_MODEL::SHEET_SYNCHRONIZATION_MODEL | ( | SHEET_SYNCHRONIZATION_AGENT & | aAgent, |
SCH_SHEET * | aSheet, | ||
SCH_SHEET_PATH & | aPath | ||
) |
Definition at line 40 of file sheet_synchronization_model.cpp.
|
overridedefault |
void SHEET_SYNCHRONIZATION_MODEL::AddNotifier | ( | std::shared_ptr< SHEET_SYNCHRONIZATION_NOTIFIER > | aNotifier | ) |
Definition at line 205 of file sheet_synchronization_model.cpp.
References m_notifiers.
Referenced by DIALOG_SYNC_SHEET_PINS::DIALOG_SYNC_SHEET_PINS().
bool SHEET_SYNCHRONIZATION_MODEL::AppendItem | ( | std::shared_ptr< SHEET_SYNCHRONIZATION_ITEM > | aItem | ) |
Just append item to the list, the notifiers are not notified.
Definition at line 116 of file sheet_synchronization_model.cpp.
References m_items.
bool SHEET_SYNCHRONIZATION_MODEL::AppendNewItem | ( | std::shared_ptr< SHEET_SYNCHRONIZATION_ITEM > | aItem | ) |
Add a new item, the notifiers are notified.
Definition at line 107 of file sheet_synchronization_model.cpp.
References DoNotify(), and m_items.
void SHEET_SYNCHRONIZATION_MODEL::DoNotify | ( | ) |
Definition at line 212 of file sheet_synchronization_model.cpp.
References m_notifiers.
Referenced by AppendNewItem(), and RemoveItems().
|
override |
Definition at line 82 of file sheet_synchronization_model.cpp.
References m_selectedIndex.
|
inlinestatic |
Definition at line 62 of file sheet_synchronization_model.h.
References _, NAME, and SHAPE.
Referenced by PANEL_SYNC_SHEET_PINS::PANEL_SYNC_SHEET_PINS().
|
inline |
Definition at line 111 of file sheet_synchronization_model.h.
References m_selectedIndex.
SHEET_SYNCHRONIZATION_ITE_PTR SHEET_SYNCHRONIZATION_MODEL::GetSynchronizationItem | ( | unsigned | aIndex | ) | const |
Definition at line 177 of file sheet_synchronization_model.cpp.
References m_items.
|
override |
Definition at line 54 of file sheet_synchronization_model.cpp.
References getElectricalTypeLabel(), m_items, NAME, and SHAPE.
|
inline |
Definition at line 109 of file sheet_synchronization_model.h.
References m_selectedIndex.
void SHEET_SYNCHRONIZATION_MODEL::OnRowSelected | ( | std::optional< unsigned > | aRow | ) |
Definition at line 186 of file sheet_synchronization_model.cpp.
References m_items, and m_selectedIndex.
Referenced by TakeItem(), and TakeItems().
void SHEET_SYNCHRONIZATION_MODEL::RemoveItems | ( | wxDataViewItemArray const & | aItems | ) |
Definition at line 95 of file sheet_synchronization_model.cpp.
References DoNotify(), m_agent, m_path, m_sheet, SHEET_SYNCHRONIZATION_AGENT::RemoveItem(), and TakeItems().
|
override |
Definition at line 71 of file sheet_synchronization_model.cpp.
SHEET_SYNCHRONIZATION_ITE_PTR SHEET_SYNCHRONIZATION_MODEL::TakeItem | ( | wxDataViewItem const & | aItem | ) |
Definition at line 161 of file sheet_synchronization_model.cpp.
References m_items, and OnRowSelected().
Referenced by TakeItems().
SHEET_SYNCHRONIZATION_ITEM_LIST SHEET_SYNCHRONIZATION_MODEL::TakeItems | ( | wxDataViewItemArray const & | aItems | ) |
Definition at line 125 of file sheet_synchronization_model.cpp.
References m_items, OnRowSelected(), TakeItem(), and UpdateItems().
Referenced by RemoveItems().
void SHEET_SYNCHRONIZATION_MODEL::UpdateItems | ( | SHEET_SYNCHRONIZATION_ITEM_LIST | aItems | ) |
Definition at line 198 of file sheet_synchronization_model.cpp.
References m_items, and Reset().
Referenced by TakeItems().
|
private |
Definition at line 117 of file sheet_synchronization_model.h.
Referenced by RemoveItems().
|
private |
Definition at line 114 of file sheet_synchronization_model.h.
Referenced by AppendItem(), AppendNewItem(), GetSynchronizationItem(), GetValueByRow(), OnRowSelected(), TakeItem(), TakeItems(), and UpdateItems().
|
private |
Definition at line 116 of file sheet_synchronization_model.h.
Referenced by AddNotifier(), and DoNotify().
|
private |
Definition at line 119 of file sheet_synchronization_model.h.
Referenced by RemoveItems().
|
private |
Definition at line 115 of file sheet_synchronization_model.h.
Referenced by GetAttrByRow(), GetSelectedIndex(), HasSelectedIndex(), and OnRowSelected().
|
private |
Definition at line 118 of file sheet_synchronization_model.h.
Referenced by RemoveItems().