Skip to content

Commit

Permalink
Merge pull request #665 from OpenHD/consti-dev
Browse files Browse the repository at this point in the history
2 functional changes, refactoring otherwise
  • Loading branch information
Consti10 authored Feb 26, 2024
2 parents fcc8cbb + d8aede9 commit 1cf1255
Show file tree
Hide file tree
Showing 162 changed files with 219 additions and 3,737 deletions.
27 changes: 20 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
cmake_minimum_required(VERSION 3.16)

project(QOpenHDProject VERSION 0.1 LANGUAGES CXX)
project(QOpenHDProject VERSION 0.1 LANGUAGES C CXX)

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

Expand Down Expand Up @@ -64,6 +66,8 @@ qt_add_executable(QOpenHDApp
app/telemetry/settings/mavlinksettingsmodel.cpp
app/telemetry/settings/pollutionhelper.cpp
app/telemetry/settings/wblinksettingshelper.cpp
#
app/telemetry/tutil/geodesi_helper.cpp

###
#app/videostreaming/vscommon/custom/rawreceiver.cpp
Expand All @@ -90,13 +94,22 @@ target_include_directories(QOpenHDApp PUBLIC app/telemetry/util)

target_include_directories(QOpenHDApp PUBLIC app/videostreaming/vscommon)
target_include_directories(QOpenHDApp PUBLIC lib)
target_include_directories(QOpenHDApp PUBLIC lib/geographiclib-c-2.0/src)

qt_add_qml_module(QOpenHDApp
URI QOpenHD
VERSION 1.0
QML_FILES
qml/MainX.qml
)
#qt_add_qml_module(QOpenHDApp
# URI hello
# VERSION 1.0
# QML_FILES
# qml/main.qml
# qml/ui/AnyParamBusyIndicator.qml
# qml/ui/HUDOverlayGrid.qml
# qml/ui/elements/
# qml/ui/sidebar/
# qml/ui/widgets/
#)
#qt6_add_resources(qml_QRC
# PREFIX "/"
# qml/qml.qrc)


target_link_libraries(QOpenHDApp
Expand Down
8 changes: 6 additions & 2 deletions app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,12 @@ int main(int argc, char *argv[]) {
#endif
);

// TODO QT 6
engine.load(QUrl(QLatin1String("qrc:/main.qml")));
//engine.load(QUrl(QLatin1String("qrc:/main.qml")));
//const QUrl url("qrc:/qt/qml/hello/qml/main.qml");
//const QUrl url(QStringLiteral("qrc:/qt/qml/main.qml"));
//const QUrl url(QStringLiteral("qrc:/qml/main.qml"));
const QUrl url(QStringLiteral("qrc:/main.qml"));
engine.load(url);
//engine.loadFromModule("QOpenHD", "qrc:/main.qml");
//engine.loadFromModule("QOpenHDApp","qrc:/main.qml");
//engine.load("qml/main.qml");
Expand Down
1 change: 0 additions & 1 deletion app/telemetry/models/fcmavlinksystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ bool FCMavlinkSystem::process_message(const mavlink_message_t &msg)
mavlink_system_time_t sys_time;
mavlink_msg_system_time_decode(&msg, &sys_time);
set_sys_time_unix_usec(sys_time.time_unix_usec);
// TODO QT 6 doesn't have it
QDateTime time;
time.setMSecsSinceEpoch(sys_time.time_unix_usec/1000);
set_sys_time_unix_as_str(time.toString());
Expand Down
2 changes: 2 additions & 0 deletions app/telemetry/telemetry.pri
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ SOURCES += \
$$PWD/settings/pollutionhelper.cpp \
$$PWD/settings/wblinksettingshelper.cpp \
$$PWD/action/impl/xparam.cpp \
$$PWD/tutil/geodesi_helper.cpp \
app/telemetry/models/aohdsystem.cpp \
app/telemetry/models/camerastreammodel.cpp \
app/telemetry/models/rcchannelsmodel.cpp \
Expand All @@ -29,6 +30,7 @@ SOURCES += \
app/telemetry/models/fcmavlinksystem.cpp \
app/telemetry/models/fcmavlinkmissionitemsmodel.cpp \


HEADERS += \
$$PWD/action/impl/cmdsender.h \
$$PWD/action/create_cmd_helper.hpp \
Expand Down
19 changes: 19 additions & 0 deletions app/telemetry/tutil/geodesi_helper.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include "geodesi_helper.h"

extern "C" {
#include "lib/geographiclib-c-2.0/src/geodesic.h"
//#include "geodesic.h"
}

double distance_between(double lat1, double lon1, double lat2, double lon2){
double s12;
//double azi1;
//double azi2;

geod_geodesic geod{};
// from https://manpages.ubuntu.com/manpages/bionic/man3/geodesic.3.html
const double a = 6378137, f = 1/298.257223563; // WGS84
geod_init(&geod,a,f);
geod_inverse(&geod,lat1,lon1,lat2,lon2,&s12,0,0); //&azi1,&azi2
return s12;
}
21 changes: 1 addition & 20 deletions app/telemetry/tutil/geodesi_helper.h
Original file line number Diff line number Diff line change
@@ -1,25 +1,6 @@
#ifndef GEODESI_HELPER_H
#define GEODESI_HELPER_H

//#include <geographiclib-c-2.0/src/geodesic.h>
#include "lib/geographiclib-c-2.0/src/geodesic.h"

// return: distance in m between 2 points
static double distance_between(double lat1,double lon1,double lat2,double lon2){
double s12;
//double azi1;
//double azi2;

geod_geodesic geod{};
// from https://manpages.ubuntu.com/manpages/bionic/man3/geodesic.3.html
const double a = 6378137, f = 1/298.257223563; // WGS84
geod_init(&geod,a,f);
geod_inverse(&geod,lat1,lon1,lat2,lon2,&s12,0,0); //&azi1,&azi2
return s12;
}

/*static double distance_between(double lat1,double lon1,double lat2,double lon2){
return 0;
}*/
double distance_between(double lat1,double lon1,double lat2,double lon2);

#endif // GEODESI_HELPER_H
6 changes: 0 additions & 6 deletions app/vs_legacy/README.md

This file was deleted.

198 changes: 0 additions & 198 deletions app/vs_legacy/androidsurfacetexture.cpp

This file was deleted.

37 changes: 0 additions & 37 deletions app/vs_legacy/androidsurfacetexture.h

This file was deleted.

12 changes: 0 additions & 12 deletions app/vs_legacy/gst_ios_init.h

This file was deleted.

Loading

0 comments on commit 1cf1255

Please sign in to comment.