Skip to content

Commit

Permalink
Merge pull request #602 from OpenHD/consti-dev
Browse files Browse the repository at this point in the history
Consti dev
  • Loading branch information
Consti10 authored Oct 27, 2023
2 parents d055b81 + 2bfce26 commit c2bccc2
Show file tree
Hide file tree
Showing 85 changed files with 3,386 additions and 3,404 deletions.
2 changes: 0 additions & 2 deletions QOpenHD.pro
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ SOURCES += \
app/osd/altitudeladder.cpp \
app/osd/flightpathvector.cpp \
app/osd/aoagauge.cpp \
app/osd/performancehorizonladder.cpp \

HEADERS += \
app/osd/headingladder.h \
Expand All @@ -144,7 +143,6 @@ HEADERS += \
app/osd/flightpathvector.h \
app/osd/debug_overdraw.hpp \
app/osd/aoagauge.h \
app/osd/performancehorizonladder.h \


RESOURCES += qml/qml.qrc
Expand Down
17 changes: 12 additions & 5 deletions app/logging/logmessagesmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,23 @@

#include "hudlogmessagesmodel.h"

LogMessagesModel &LogMessagesModel::instanceOHD()

LogMessagesModel &LogMessagesModel::instanceGround()
{
static LogMessagesModel instance;
return instance;
}

LogMessagesModel &LogMessagesModel::instanceOHDAir()
{
static LogMessagesModel* instance=new LogMessagesModel();
return *instance;
static LogMessagesModel instance;
return instance;
}

LogMessagesModel &LogMessagesModel::instanceFC()
{
static LogMessagesModel* instance_fc=new LogMessagesModel();
return *instance_fc;
static LogMessagesModel instance;
return instance;
}

LogMessagesModel::LogMessagesModel(QObject *parent) :
Expand Down
4 changes: 2 additions & 2 deletions app/logging/logmessagesmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ class LogMessagesModel : public QAbstractListModel
{
Q_OBJECT
public:
// Instance for all OpenHD air / ground messages
static LogMessagesModel& instanceOHD();
static LogMessagesModel& instanceGround();
static LogMessagesModel& instanceOHDAir();
// We have a seperate model for the FC log messages
static LogMessagesModel& instanceFC();

Expand Down
12 changes: 6 additions & 6 deletions app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ const QVector<QString> permissions({"android.permission.INTERNET",
#include "osd/horizonladder.h"
#include "osd/flightpathvector.h"
#include "osd/aoagauge.h"
#include "osd/performancehorizonladder.h"

// Video - annyoing ifdef crap is needed for all the different platforms / configurations
#include "decodingstatistcs.h"
Expand Down Expand Up @@ -256,8 +255,6 @@ int main(int argc, char *argv[]) {
qmlRegisterType<HorizonLadder>("OpenHD", 1, 0, "HorizonLadder");
qmlRegisterType<FlightPathVector>("OpenHD", 1, 0, "FlightPathVector");
qmlRegisterType<AoaGauge>("OpenHD", 1, 0, "AoaGauge");
qmlRegisterType<PerformanceHorizonLadder>("OpenHD", 1, 0, "PerformanceHorizonLadder");


QQmlApplicationEngine engine;
engine.rootContext()->setContextProperty("_qopenhd", &QOpenHD::instance());
Expand All @@ -272,8 +269,11 @@ int main(int argc, char *argv[]) {

engine.rootContext()->setContextProperty("_qrenderstats", &QRenderStats::instance());

engine.rootContext()->setContextProperty("_ohdlogMessagesModel", &LogMessagesModel::instanceOHD());
engine.rootContext()->setContextProperty("_fclogMessagesModel", &LogMessagesModel::instanceFC());
//engine.rootContext()->setContextProperty("_ohdlogMessagesModel", &LogMessagesModel::instanceOHD());
//engine.rootContext()->setContextProperty("_fclogMessagesModel", &LogMessagesModel::instanceFC());
engine.rootContext()->setContextProperty("_logGround", &LogMessagesModel::instanceGround());
engine.rootContext()->setContextProperty("_logOpenhdAir", &LogMessagesModel::instanceOHDAir());
engine.rootContext()->setContextProperty("_logFC", &LogMessagesModel::instanceFC());
engine.rootContext()->setContextProperty("_hudLogMessagesModel", &HUDLogMessagesModel::instance());

// Telemetry - first all the models
Expand Down Expand Up @@ -373,7 +373,7 @@ int main(int argc, char *argv[]) {

QRenderStats::instance().register_to_root_window(engine);

LogMessagesModel::instanceOHD().addLogMessage("QOpenHD","running");
LogMessagesModel::instanceGround().addLogMessage("QOpenHD","running");
const int retval = app.exec();

return retval;
Expand Down
4 changes: 1 addition & 3 deletions app/osd/altitudeladder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ void AltitudeLadder::paint(QPainter* painter) {
setFillColor(QColor::fromRgb(0,255,0,128));
}

QFont font("sans-serif", 10, QFont::Bold, false);

painter->setFont(m_font);

auto alt = m_altitude;
Expand Down Expand Up @@ -121,6 +119,6 @@ void AltitudeLadder::setAltitudeRange(int altitudeRange) {
void AltitudeLadder::setFontFamily(QString fontFamily) {
m_fontFamily = fontFamily;
emit fontFamilyChanged(m_fontFamily);
m_font = QFont(m_fontFamily, 11, QFont::Bold, false);
m_font = QFont(m_fontFamily, 13, QFont::Bold, false);
update();
}
220 changes: 0 additions & 220 deletions app/osd/performancehorizonladder.cpp

This file was deleted.

47 changes: 0 additions & 47 deletions app/osd/performancehorizonladder.h

This file was deleted.

Loading

0 comments on commit c2bccc2

Please sign in to comment.