CFLinker.h 1.22 KB
Newer Older
1
2
3
4
5
6
#ifndef CFLINKER_H
#define CFLINKER_H

#include "globalDefinitions.h"
#include "crazyFly.h"
#include "crazyFlyZone.h"
7
8
9
#include "ui_mainguiwindow.h"

#include "rosNodeThread.h"
10

11
#include <QObject>
12

13
14

class CFLinker : public QObject
15
{
16
    Q_OBJECT
17
public:
18
19
20
21
22
23

    struct link {
        int student_id;
        int cf_zone_index;
        std::string cf_name;
    };
24

25
    explicit CFLinker(Ui::MainGUIWindow* ui, std::vector<crazyFly*> *crazyflies_vector, std::vector<crazyFlyZone*> *crazyfly_zones);
26
27
    ~CFLinker();

28
    void link(int student_id, int cf_zone_index, std::string cf_name);
29
30
    void unlink_selection();
    void unlink_cf_zone(int cf_zone_index);
31
32

    std::vector<struct link> links;
33

34
35
36
    bool isStudentIDLinked(int student_id);
    bool isCFZoneLinked(int cf_zone_index);
    bool isCFLinked(std::string cf_name);
37
38
    int getCFZoneIndexFromName(QString name);
    int getCFIndexFromName(std::string name);
39

40
41
    void clear_all_links();

42
43
44
signals:
    void updateComboBoxes();

45
46
private:

47
48
49
    // QTableWidget m_p_table;

    Ui::MainGUIWindow* m_ui;
50
51
52
53
    std::vector<crazyFly*>* m_crazyflies_vector;
    std::vector<crazyFlyZone*>* m_crazyfly_zones;

    void addNewRow(int student_id, std::string crazyfly_name, int cf_zone_index);
54
55
56
57
};


#endif