KiCad PCB EDA Suite
DIALOG_LIB_EDIT_PIN_TABLE::DataViewModel::Pin Class Reference
Inheritance diagram for DIALOG_LIB_EDIT_PIN_TABLE::DataViewModel::Pin:
DIALOG_LIB_EDIT_PIN_TABLE::DataViewModel::Item

Public Member Functions

 Pin (DataViewModel &aModel, LIB_PIN *aBacking)
 
virtual void GetValue (wxVariant &aValue, unsigned int aCol) const override
 
virtual wxString GetString (unsigned int aCol) const override
 
virtual wxDataViewItem GetParent () const override
 
virtual bool IsContainer () const override
 
virtual unsigned int GetChildren (wxDataViewItemArray &) const override
 
void SetGroup (Group *aGroup)
 

Private Attributes

DataViewModelm_Model
 
LIB_PINm_Backing
 
Groupm_Group
 

Detailed Description

Definition at line 142 of file dialog_lib_edit_pin_table.cpp.

Constructor & Destructor Documentation

DIALOG_LIB_EDIT_PIN_TABLE::DataViewModel::Pin::Pin ( DataViewModel aModel,
LIB_PIN aBacking 
)
inline

Member Function Documentation

virtual unsigned int DIALOG_LIB_EDIT_PIN_TABLE::DataViewModel::Pin::GetChildren ( wxDataViewItemArray &  ) const
inlineoverridevirtual

Implements DIALOG_LIB_EDIT_PIN_TABLE::DataViewModel::Item.

Definition at line 153 of file dialog_lib_edit_pin_table.cpp.

153 { return 0; }
virtual wxDataViewItem DIALOG_LIB_EDIT_PIN_TABLE::DataViewModel::Pin::GetParent ( ) const
inlineoverridevirtual

Implements DIALOG_LIB_EDIT_PIN_TABLE::DataViewModel::Item.

Definition at line 151 of file dialog_lib_edit_pin_table.cpp.

References m_Group.

151 { return wxDataViewItem( m_Group ); }
wxString DIALOG_LIB_EDIT_PIN_TABLE::DataViewModel::Pin::GetString ( unsigned int  aCol) const
overridevirtual

Implements DIALOG_LIB_EDIT_PIN_TABLE::DataViewModel::Item.

Definition at line 528 of file dialog_lib_edit_pin_table.cpp.

References DIALOG_LIB_EDIT_PIN_TABLE::m_Model, name, wxPoint::x, and wxPoint::y.

529 {
530  switch( aCol )
531  {
532  case PIN_NUMBER:
533  return m_Backing->GetNumber();
534 
535  case PIN_NAME:
536  if( m_Model.m_UnitCount > 1 )
537  {
538  wxString name;
539  int unit = m_Backing->GetPartNumber();
540 
541  if( unit )
542  name << unit;
543  else
544  name << "com";
545 
546  name << ':';
547  name << m_Backing->GetName();
548  return name;
549  }
550  else
551  {
552  return m_Backing->GetName();
553  }
554 
555  case PIN_TYPE:
557 
558  case PIN_POSITION:
559  {
560  wxPoint position = m_Backing->GetPosition();
561  wxString value;
562  value << "(" << position.x << "," << position.y << ")";
563  return value;
564  }
565  }
566 
567  return wxEmptyString;
568 }
wxString const GetElectricalTypeName() const
return a translated string for messages giving the electrical type of the pin.
Definition: lib_pin.h:270
int GetPartNumber() const
Get the pin part number.
Definition: lib_pin.h:308
const wxString & GetNumber() const
Definition: lib_pin.h:188
const wxString & GetName() const
Definition: lib_pin.h:162
wxPoint GetPosition() const override
Function GetPosition returns the current draw object position.
Definition: lib_pin.h:452
const char * name
void DIALOG_LIB_EDIT_PIN_TABLE::DataViewModel::Pin::GetValue ( wxVariant &  aValue,
unsigned int  aCol 
) const
overridevirtual

Implements DIALOG_LIB_EDIT_PIN_TABLE::DataViewModel::Item.

Definition at line 506 of file dialog_lib_edit_pin_table.cpp.

References GetBitmap(), and KiBitmap().

508 {
509  switch( aCol )
510  {
511  case PIN_NUMBER:
512  case PIN_NAME:
513  case PIN_POSITION:
514  aValue = GetString( aCol );
515  break;
516 
517  case PIN_TYPE:
518  {
519  wxIcon icon;
520  icon.CopyFromBitmap( KiBitmap ( GetBitmap( m_Backing->GetType() ) ) );
521  aValue << wxDataViewIconText( m_Backing->GetElectricalTypeName(), icon );
522  }
523  break;
524  }
525 }
wxString const GetElectricalTypeName() const
return a translated string for messages giving the electrical type of the pin.
Definition: lib_pin.h:270
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:36
ELECTRICAL_PINTYPE GetType() const
Get the electrical type of the pin.
Definition: lib_pin.h:246
virtual wxString GetString(unsigned int aCol) const override
BITMAP_DEF GetBitmap(GRAPHIC_PINSHAPE shape)
Definition: pin_shape.cpp:70
virtual bool DIALOG_LIB_EDIT_PIN_TABLE::DataViewModel::Pin::IsContainer ( ) const
inlineoverridevirtual

Implements DIALOG_LIB_EDIT_PIN_TABLE::DataViewModel::Item.

Definition at line 152 of file dialog_lib_edit_pin_table.cpp.

152 { return false; }
void DIALOG_LIB_EDIT_PIN_TABLE::DataViewModel::Pin::SetGroup ( Group aGroup)
inline

Member Data Documentation

LIB_PIN* DIALOG_LIB_EDIT_PIN_TABLE::DataViewModel::Pin::m_Backing
private

Definition at line 159 of file dialog_lib_edit_pin_table.cpp.

Group* DIALOG_LIB_EDIT_PIN_TABLE::DataViewModel::Pin::m_Group
private

Definition at line 160 of file dialog_lib_edit_pin_table.cpp.

Referenced by GetParent(), and SetGroup().

DataViewModel& DIALOG_LIB_EDIT_PIN_TABLE::DataViewModel::Pin::m_Model
private

Definition at line 158 of file dialog_lib_edit_pin_table.cpp.


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