00001 #ifndef _RQT_MRTA_ARCHITECTURE_COMBO_BOX_H_ 00002 #define _RQT_MRTA_ARCHITECTURE_COMBO_BOX_H_ 00003 00004 #include <QComboBox> 00005 #include <QList> 00006 #include "mrta/taxonomy.h" 00007 00008 namespace rqt_mrta 00009 { 00010 class ArchitectureComboBox : public QComboBox 00011 { 00012 Q_OBJECT 00013 public: 00014 ArchitectureComboBox(QWidget* parent); 00015 virtual ~ArchitectureComboBox(); 00016 mrta::Architecture* getCurrentArchitecture() const; 00017 void setFilterAllocationType(const mrta::Taxonomy::AllocationType& allocation_type); 00018 void setFilterRobotType(const mrta::Taxonomy::RobotType& robot_type); 00019 void setFilterTaskType(const mrta::Taxonomy::TaskType& task_type); 00020 00021 signals: 00022 void changed(); 00023 void unknownAchitecture(); 00024 void currentArchitectureChanged(mrta::Architecture* architecture); 00025 void filterChanged(); 00026 void filtered(); 00027 void loaded(); 00028 00029 private: 00030 typedef QList<mrta::Architecture*>::iterator iterator; 00031 typedef QList<mrta::Architecture*>::const_iterator const_iterator; 00032 QList<mrta::Architecture*> architectures_; 00033 QList<int> indexes_; 00034 mrta::Architecture* current_architecture_; 00035 mrta::Taxonomy::AllocationType allocation_type_; 00036 mrta::Taxonomy::RobotType robot_type_; 00037 mrta::Taxonomy::TaskType task_type_; 00038 void filter(); 00039 void load(); 00040 00041 private slots: 00042 void currentArchitectureChanged(int index); 00043 }; 00044 } 00045 00046 #endif // _RQT_MRTA_ARCHITECTURE_COMBO_BOX_H_