RoboDK Plug-In Interface
Loading...
Searching...
No Matches
StationTreeEventMonitor Class Reference
Inheritance diagram for StationTreeEventMonitor:

Classes

struct  QStringHash
 

Public Types

enum  Filter : uint32_t {
  NoFilter = 0x00000000 , IgnoreInactiveStations = 0x00000001 , IgnoreNameChange = 0x00000002 , IgnoreIconChange = 0x00000004 ,
  IgnoreAdd = 0x00000008 , IgnoreRemove = 0x00000010 , IgnoreChildren = 0x00000020
}
 
enum  SubmitPolicy { AutoSubmit , ManualSubmit }
 

Public Slots

void refresh ()
 
void submit ()
 

Signals

void itemNameChanged (IItem *item, const QString &name)
 
void itemIconChanged (IItem *item, const QIcon &icon)
 
void itemAdded (IItem *item)
 
void itemRemoved (IItem *item)
 

Public Member Functions

 StationTreeEventMonitor (IRoboDK *rdk, QObject *parent=nullptr)
 
uint32_t filter () const
 
uint32_t setFilter (uint32_t filter)
 
uint32_t setFilterFlag (uint32_t flag, bool on=true)
 
void setSubmitPolicy (SubmitPolicy policy)
 

Private Types

using TreeCallback = std::function<void(const QModelIndex&)>
 

Private Slots

void onModelDataChanged (const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector< int > &roles=QVector< int >())
 
void onModelRowsInserted (const QModelIndex &parent, int first, int last)
 
void onModelRowsRemoved (const QModelIndex &parent, int first, int last)
 

Private Member Functions

void iterateOverTree (const QModelIndex &parent, const TreeCallback &callback, bool reverse=false)
 
IItemitemFromIndex (const QModelIndex &index) const
 
bool isActiveStationItem (const QModelIndex &index) const
 

Private Attributes

IRoboDK_rdk = nullptr
 
QTreeWidget * _tree = nullptr
 
uint32_t _filter = IgnoreInactiveStations
 
SubmitPolicy _policy = AutoSubmit
 
std::unordered_multimap< QString, IItem *, QStringHash_nameTable
 
std::unordered_map< IItem *, QString > _nameCache
 
std::list< QModelIndex > _addedIndices
 

Detailed Description

Definition at line 54 of file stationtreeeventmonitor.h.

Member Typedef Documentation

◆ TreeCallback

using TreeCallback = std::function<void(const QModelIndex&)>
private

Definition at line 109 of file stationtreeeventmonitor.h.

Member Enumeration Documentation

◆ Filter

enum Filter : uint32_t

Definition at line 59 of file stationtreeeventmonitor.h.

◆ SubmitPolicy

enum SubmitPolicy

Definition at line 70 of file stationtreeeventmonitor.h.

Constructor & Destructor Documentation

◆ StationTreeEventMonitor()

StationTreeEventMonitor ( IRoboDK * rdk,
QObject * parent = nullptr )
explicit

Definition at line 45 of file stationtreeeventmonitor.cpp.

Member Function Documentation

◆ filter()

uint32_t filter ( ) const
inline

Definition at line 133 of file stationtreeeventmonitor.h.

◆ isActiveStationItem()

bool isActiveStationItem ( const QModelIndex & index) const
private

Definition at line 343 of file stationtreeeventmonitor.cpp.

◆ itemFromIndex()

IItem * itemFromIndex ( const QModelIndex & index) const
private

Definition at line 337 of file stationtreeeventmonitor.cpp.

◆ iterateOverTree()

void iterateOverTree ( const QModelIndex & parent,
const TreeCallback & callback,
bool reverse = false )
private

Definition at line 282 of file stationtreeeventmonitor.cpp.

◆ onModelDataChanged

void onModelDataChanged ( const QModelIndex & topLeft,
const QModelIndex & bottomRight,
const QVector< int > & roles = QVector<int>() )
privateslot

Definition at line 137 of file stationtreeeventmonitor.cpp.

◆ onModelRowsInserted

void onModelRowsInserted ( const QModelIndex & parent,
int first,
int last )
privateslot

Definition at line 215 of file stationtreeeventmonitor.cpp.

◆ onModelRowsRemoved

void onModelRowsRemoved ( const QModelIndex & parent,
int first,
int last )
privateslot

Definition at line 235 of file stationtreeeventmonitor.cpp.

◆ refresh

void refresh ( )
slot

Definition at line 78 of file stationtreeeventmonitor.cpp.

◆ setFilter()

uint32_t setFilter ( uint32_t filter)
inline

Definition at line 138 of file stationtreeeventmonitor.h.

◆ setFilterFlag()

uint32_t setFilterFlag ( uint32_t flag,
bool on = true )
inline

Definition at line 145 of file stationtreeeventmonitor.h.

◆ setSubmitPolicy()

void setSubmitPolicy ( SubmitPolicy policy)
inline

Definition at line 159 of file stationtreeeventmonitor.h.

◆ submit

void submit ( )
slot

Definition at line 99 of file stationtreeeventmonitor.cpp.

Member Data Documentation

◆ _addedIndices

std::list<QModelIndex> _addedIndices
private

Definition at line 129 of file stationtreeeventmonitor.h.

◆ _filter

uint32_t _filter = IgnoreInactiveStations
private

Definition at line 123 of file stationtreeeventmonitor.h.

◆ _nameCache

std::unordered_map<IItem*, QString> _nameCache
private

Definition at line 127 of file stationtreeeventmonitor.h.

◆ _nameTable

std::unordered_multimap<QString, IItem*, QStringHash> _nameTable
private

Definition at line 126 of file stationtreeeventmonitor.h.

◆ _policy

SubmitPolicy _policy = AutoSubmit
private

Definition at line 124 of file stationtreeeventmonitor.h.

◆ _rdk

IRoboDK* _rdk = nullptr
private

Definition at line 120 of file stationtreeeventmonitor.h.

◆ _tree

QTreeWidget* _tree = nullptr
private

Definition at line 121 of file stationtreeeventmonitor.h.


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