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, 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_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,
SCH_SHEET_PATH aPath 
)

Definition at line 40 of file sheet_synchronization_model.cpp.

◆ ~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)

◆ 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 m_items.

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

◆ DoNotify()

void SHEET_SYNCHRONIZATION_MODEL::DoNotify ( )

Definition at line 212 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.

Referenced by PANEL_SYNC_SHEET_PINS::PANEL_SYNC_SHEET_PINS().

◆ GetSelectedIndex()

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

Definition at line 111 of file sheet_synchronization_model.h.

References m_selectedIndex.

◆ GetSynchronizationItem()

SHEET_SYNCHRONIZATION_ITE_PTR SHEET_SYNCHRONIZATION_MODEL::GetSynchronizationItem ( unsigned  aIndex) const

Definition at line 177 of file sheet_synchronization_model.cpp.

References m_items.

◆ 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 109 of file sheet_synchronization_model.h.

References m_selectedIndex.

◆ OnRowSelected()

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

◆ RemoveItems()

void SHEET_SYNCHRONIZATION_MODEL::RemoveItems ( wxDataViewItemArray const &  aItems)

◆ 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 m_items, and OnRowSelected().

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 198 of file sheet_synchronization_model.cpp.

References m_items, and Reset().

Referenced by TakeItems().

Member Data Documentation

◆ m_agent

SHEET_SYNCHRONIZATION_AGENT& SHEET_SYNCHRONIZATION_MODEL::m_agent
private

Definition at line 117 of file sheet_synchronization_model.h.

Referenced by RemoveItems().

◆ m_items

◆ m_notifiers

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

Definition at line 116 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 119 of file sheet_synchronization_model.h.

Referenced by RemoveItems().

◆ m_selectedIndex

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

◆ m_sheet

SCH_SHEET* SHEET_SYNCHRONIZATION_MODEL::m_sheet
private

Definition at line 118 of file sheet_synchronization_model.h.

Referenced by RemoveItems().


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