CFLinker.h 1023 Bytes
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

12
13
14
class CFLinker
{
public:
15
16
17
18
19
20

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

22
    explicit CFLinker(Ui::MainGUIWindow* ui, std::vector<crazyFly*> *crazyflies_vector, std::vector<crazyFlyZone*> *crazyfly_zones);
23
24
    ~CFLinker();

25
26
    void link();
    void unlink();
27
28

    std::vector<struct link> links;
29

30
31
32
33
    bool isStudentIDLinked(int student_id);
    bool isCFZoneLinked(int cf_zone_index);
    bool isCFLinked(std::string cf_name);

34
35
private:

36
37
38
    // QTableWidget m_p_table;

    Ui::MainGUIWindow* m_ui;
39
40
41
42
43
44
    std::vector<crazyFly*>* m_crazyflies_vector;
    std::vector<crazyFlyZone*>* m_crazyfly_zones;

    int getCFZoneIndexFromName(QString name);
    int getCFIndexFromName(std::string name);
    void addNewRow(int student_id, std::string crazyfly_name, int cf_zone_index);
45
46
47
48
};


#endif