KiCad PCB EDA Suite
Loading...
Searching...
No Matches
SHEET_SYNCHRONIZATION_MODEL Class Reference

#include <sheet_synchronization_model.h>

Inheritance diagram for SHEET_SYNCHRONIZATION_MODEL:

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, const 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
 
SHEET_SYNCHRONIZATION_ITE_PTR GetSynchronizationItem (wxDataViewItem const &aItem) 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
 
unsigned int GetCount () const override
 

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_AGENTm_agent
 
SCH_SHEETm_sheet
 
SCH_SHEET_PATH m_path
 

Detailed Description

Definition at line 44 of file sheet_synchronization_model.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
HIRE_LABEL 
SHEET_PIN 
ASSOCIATED 
MODEL_COUNT 

Definition at line 54 of file sheet_synchronization_model.h.

◆ SHEET_SYNCHRONIZATION_COL

Enumerator
NAME 
SHAPE 
COL_COUNT 

Definition at line 47 of file sheet_synchronization_model.h.

Constructor & Destructor Documentation

◆ SHEET_SYNCHRONIZATION_MODEL()

SHEET_SYNCHRONIZATION_MODEL::SHEET_SYNCHRONIZATION_MODEL ( SHEET_SYNCHRONIZATION_AGENT & aAgent,
SCH_SHEET * aSheet,
const SCH_SHEET_PATH & aPath )

Definition at line 40 of file sheet_synchronization_model.cpp.

References m_agent, m_path, m_selectedIndex, and m_sheet.

◆ ~SHEET_SYNCHRONIZATION_MODEL()

SHEET_SYNCHRONIZATION_MODEL::~SHEET_SYNCHRONIZATION_MODEL ( )
overridedefault

Member Function Documentation

◆ AddNotifier()

void SHEET_SYNCHRONIZATION_MODEL::AddNotifier ( std::shared_ptr< SHEET_SYNCHRONIZATION_NOTIFIER > aNotifier)

Definition at line 212 of file sheet_synchronization_model.cpp.

References m_notifiers.

◆ AppendItem()

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 GetCount(), m_items, and Reset().

◆ AppendNewItem()

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(), GetCount(), m_items, and Reset().

◆ DoNotify()

void SHEET_SYNCHRONIZATION_MODEL::DoNotify ( )

Definition at line 219 of file sheet_synchronization_model.cpp.

References m_notifiers.

Referenced by AppendNewItem(), and RemoveItems().

◆ GetAttrByRow()

bool SHEET_SYNCHRONIZATION_MODEL::GetAttrByRow ( unsigned row,
unsigned int col,
wxDataViewItemAttr & attr ) const
override

Definition at line 82 of file sheet_synchronization_model.cpp.

References m_selectedIndex.

◆ GetColName()

static wxString SHEET_SYNCHRONIZATION_MODEL::GetColName ( int col)
inlinestatic

Definition at line 62 of file sheet_synchronization_model.h.

References _, NAME, and SHAPE.

◆ GetCount()

unsigned int SHEET_SYNCHRONIZATION_MODEL::GetCount ( ) const
override

Definition at line 225 of file sheet_synchronization_model.cpp.

References m_items.

Referenced by AppendItem(), AppendNewItem(), TakeItem(), and UpdateItems().

◆ GetSelectedIndex()

std::optional< unsigned int > SHEET_SYNCHRONIZATION_MODEL::GetSelectedIndex ( ) const
inline

Definition at line 113 of file sheet_synchronization_model.h.

References m_selectedIndex.

◆ GetSynchronizationItem() [1/2]

SHEET_SYNCHRONIZATION_ITE_PTR SHEET_SYNCHRONIZATION_MODEL::GetSynchronizationItem ( unsigned aIndex) const

Definition at line 177 of file sheet_synchronization_model.cpp.

References m_items.

Referenced by GetSynchronizationItem().

◆ GetSynchronizationItem() [2/2]

SHEET_SYNCHRONIZATION_ITE_PTR SHEET_SYNCHRONIZATION_MODEL::GetSynchronizationItem ( wxDataViewItem const & aItem) const

Definition at line 187 of file sheet_synchronization_model.cpp.

References GetSynchronizationItem().

◆ GetValueByRow()

void SHEET_SYNCHRONIZATION_MODEL::GetValueByRow ( wxVariant & variant,
unsigned row,
unsigned col ) const
override

Definition at line 54 of file sheet_synchronization_model.cpp.

References getElectricalTypeLabel(), m_items, NAME, and SHAPE.

◆ HasSelectedIndex()

bool SHEET_SYNCHRONIZATION_MODEL::HasSelectedIndex ( ) const
inline

Definition at line 111 of file sheet_synchronization_model.h.

References m_selectedIndex.

◆ OnRowSelected()

void SHEET_SYNCHRONIZATION_MODEL::OnRowSelected ( std::optional< unsigned > aRow)

Definition at line 193 of file sheet_synchronization_model.cpp.

References m_items, and m_selectedIndex.

Referenced by TakeItem(), and TakeItems().

◆ RemoveItems()

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, and TakeItems().

◆ SetValueByRow()

bool SHEET_SYNCHRONIZATION_MODEL::SetValueByRow ( const wxVariant & variant,
unsigned row,
unsigned col )
override

Definition at line 71 of file sheet_synchronization_model.cpp.

◆ TakeItem()

SHEET_SYNCHRONIZATION_ITE_PTR SHEET_SYNCHRONIZATION_MODEL::TakeItem ( wxDataViewItem const & aItem)

Definition at line 161 of file sheet_synchronization_model.cpp.

References GetCount(), m_items, OnRowSelected(), and Reset().

Referenced by TakeItems().

◆ 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().

◆ UpdateItems()

void SHEET_SYNCHRONIZATION_MODEL::UpdateItems ( SHEET_SYNCHRONIZATION_ITEM_LIST aItems)

Definition at line 205 of file sheet_synchronization_model.cpp.

References GetCount(), m_items, and Reset().

Referenced by TakeItems().

Member Data Documentation

◆ m_agent

SHEET_SYNCHRONIZATION_AGENT& SHEET_SYNCHRONIZATION_MODEL::m_agent
private

Definition at line 122 of file sheet_synchronization_model.h.

Referenced by RemoveItems(), and SHEET_SYNCHRONIZATION_MODEL().

◆ m_items

◆ m_notifiers

std::list<std::shared_ptr<SHEET_SYNCHRONIZATION_NOTIFIER> > SHEET_SYNCHRONIZATION_MODEL::m_notifiers
private

Definition at line 121 of file sheet_synchronization_model.h.

Referenced by AddNotifier(), and DoNotify().

◆ m_path

SCH_SHEET_PATH SHEET_SYNCHRONIZATION_MODEL::m_path
private

Definition at line 124 of file sheet_synchronization_model.h.

Referenced by RemoveItems(), and SHEET_SYNCHRONIZATION_MODEL().

◆ m_selectedIndex

std::optional<unsigned> SHEET_SYNCHRONIZATION_MODEL::m_selectedIndex
private

◆ m_sheet

SCH_SHEET* SHEET_SYNCHRONIZATION_MODEL::m_sheet
private

Definition at line 123 of file sheet_synchronization_model.h.

Referenced by RemoveItems(), and SHEET_SYNCHRONIZATION_MODEL().


The documentation for this class was generated from the following files: