-
Notifications
You must be signed in to change notification settings - Fork 0
/
diginavis.cpp
36 lines (28 loc) · 1.69 KB
/
diginavis.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include "diginavis.h"
#include "Vehicles/Vehicles.h"
#include "Mission/VehicleMission.h"
Diginavis::Diginavis(Fact *parent):
Fact(parent, "diginavis", "Diginavis"),
m_vehicle(Vehicles::instance()->current())
{
setIcon("cloud");
f_authorization = new Authorization(this);
f_myDrones = new Fact(this, "my_drones", "My drones", "", Fact::Group, "airplane");
f_droneCreator = new DroneCreator(f_myDrones);
f_drones = new Drones(f_myDrones);
f_myRequests = new Fact(this, "my_requests", "My requests", "", Fact::Group, "airplane-takeoff");
f_requestCreator = new FlightRequestCreator(f_myRequests);
f_requests = new FlightRequests(f_myRequests);
f_telemetry = new Telemetry(this);
connect(f_authorization, &Authorization::bearerTokenReceived, f_droneCreator, &DroneCreator::setBearerToken);
connect(f_authorization, &Authorization::bearerTokenReceived, f_drones, &Drones::setBearerToken);
connect(f_authorization, &Authorization::bearerTokenReceived, f_requestCreator, &FlightRequestCreator::setBearerToken);
connect(f_authorization, &Authorization::bearerTokenReceived, f_requests, &FlightRequests::setBearerToken);
connect(f_authorization, &Authorization::bearerTokenReceived, f_telemetry, &Telemetry::setBearerToken);
f_droneCreator->setBearerToken(f_authorization->getBearerToken());
f_drones->setBearerToken(f_authorization->getBearerToken());
f_requests->setBearerToken(f_authorization->getBearerToken());
f_requestCreator->setBearerToken(f_authorization->getBearerToken());
f_telemetry->setBearerToken(f_authorization->getBearerToken());
connect(f_requests, &FlightRequests::workStarted, f_telemetry, &Telemetry::startWork);
}