00001 #ifndef _RQT_MRTA_APPLICATION_CONFIG_ROBOTS_H_ 00002 #define _RQT_MRTA_APPLICATION_CONFIG_ROBOTS_H_ 00003 00004 #include <QVector> 00005 #include "utilities/abstract_config.h" 00006 #include "rqt_mrta/config/application/robot.h" 00007 00008 namespace rqt_mrta 00009 { 00010 namespace config 00011 { 00012 namespace application 00013 { 00014 class Robot; 00015 00016 class Robots : public utilities::AbstractConfig 00017 { 00018 Q_OBJECT 00019 public: 00020 Robots(QObject* parent = NULL); 00021 virtual ~Robots(); 00022 size_t count() const; 00023 Robot* getRobot(size_t index) const; 00024 Robot* addRobot(); 00025 void removeRobot(Robot* robot); 00026 void removeRobot(size_t index); 00027 void clearRobots(); 00028 bool contains(const QString& id) const; 00029 bool isEmpty() const; 00030 void save(QSettings& settings) const; 00031 void load(QSettings& settings); 00032 void reset(); 00033 void write(QDataStream& stream) const; 00034 void read(QDataStream& stream); 00035 Robots& operator=(const Robots& config); 00036 QString validate() const; 00037 00038 signals: 00039 void added(size_t robot_index); 00040 void removed(const QString& robot_id); 00041 void cleared(); 00042 void robotIdChanged(size_t index, const QString& robot_id); 00043 void taskIdChanged(size_t robot_index, size_t task_index, 00044 const QString& task_id); 00045 void taskAdded(size_t robot_index, size_t task_index); 00046 void taskRemoved(size_t robot_index, const QString& task_id); 00047 void tasksCleared(size_t robot_index); 00048 00049 private: 00050 QVector<Robot*> robots_; 00051 00052 private slots: 00053 void robotIdChanged(const QString& robot_id); 00054 void taskIdChanged(size_t task_index, const QString& task_id); 00055 void taskAdded(size_t task_index); 00056 void taskRemoved(const QString& task_id); 00057 void tasksCleared(); 00058 void robotDestroyed(); 00059 }; 00060 } 00061 } 00062 } 00063 00064 #endif // _RQT_MRTA_APPLICATION_CONFIG_ROBOTS_H_