-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflightdata.cpp
75 lines (62 loc) · 2.1 KB
/
flightdata.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#include "flightdata.h"
#include "ui_flightdata.h"
#include <QDebug>
FlightData::FlightData(QWidget *parent)
: QWidget(parent)
, ui(new Ui::FlightData)
{
ui->setupUi(this);
// setStyleSheet("font: 12pt '8514oem'\nbackground-color: qlineargradient(spread:pad, x1:1, y1:1, x2:1, y2:0, stop:0.0913462"
// "rgba(0, 0, 0, 255), stop:1 rgba(255, 255, 255, 255));");
initialize();
}
FlightData::~FlightData()
{
delete ui;
}
bool FlightData::initialize()
{
QPixmap logo_image{":/imgs/PSP-AC-1Color-white.png"};
int w = ui->logo->width();
int h = ui->logo->height();
ui->logo->setPixmap(logo_image.scaled(w, h, Qt::KeepAspectRatio));
QPixmap checkmark{":/imgs/checkmark.png"};
int w2 = ui->mark_1->width();
int h2 = ui->mark_1->height();
checkmark = checkmark.scaled(w2, h2, Qt::KeepAspectRatio);
ui->mark_1->setPixmap(checkmark);
ui->mark_2->setPixmap(checkmark);
ui->mark_3->setPixmap(checkmark);
ui->mark_4->setPixmap(checkmark);
return true;
}
void FlightData::on_launchButton_clicked()
{
// LAUNCH
qDebug() << "To Infinity and Beyond";
}
void FlightData::updateData(qreal alt, qreal amb_press, qreal batt, qreal climb,
qreal current, qreal imu, qreal pitch, qreal roll,
qreal yaw, qreal lat, qreal longit) {
ui->alt_data->setText(QString::number(alt));
ui->amb_press_data->setText(QString::number(amb_press));
ui->batt_data->setText(QString::number(batt));
ui->climb_data->setText(QString::number(climb));
ui->current_data->setText(QString::number(current));
ui->imu_temp_data->setText(QString::number(imu));
ui->pitch_data->setText(QString::number(pitch));
ui->roll_data->setText(QString::number(roll));
ui->yaw_data->setText(QString::number(yaw));
ui->lat_data->setText(QString::number(longit));
}
void FlightData::updateChecks(qreal battery) {
if (battery < 0) {
qDebug() << "Battery dead";
// ui->mark_1->setPixmap(checkmark);
}
else {
// ui->mark_1->setPixmap();
}
}
void FlightData::uploadTelem() {
}