Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion QGCCommon.pri
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,12 @@ linux {
CONFIG += Androidx86Build
DEFINES += __androidx86__
message("Android x86 build")
} else {
} else:equals(ANDROID_TARGET_ARCH, x86_64) {
CONFIG += Androidx64Build
DEFINES += __androidx64__
message("Android x64 build")
}
else {
error("Unsupported Android architecture: $${ANDROID_TARGET_ARCH}")
}
} else {
Expand Down
21 changes: 11 additions & 10 deletions android.pri
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@ ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android
exists($$PWD/custom/android) {
message("Merging $$PWD/custom/android/ -> $$PWD/android/")

ANDROID_PACKAGE_SOURCE_DIR = $$OUT_PWD/ANDROID_PACKAGE_SOURCE_DIR
android_source_dir_target.target = android_source_dir
PRE_TARGETDEPS += $$android_source_dir_target.target
QMAKE_EXTRA_TARGETS += android_source_dir_target

android_source_dir_target.commands = $$QMAKE_MKDIR $$ANDROID_PACKAGE_SOURCE_DIR && \
$$QMAKE_COPY_DIR $$PWD/android/* $$OUT_PWD/ANDROID_PACKAGE_SOURCE_DIR && \
$$QMAKE_COPY_DIR $$PWD/custom/android/* $$OUT_PWD/ANDROID_PACKAGE_SOURCE_DIR && \
$$QMAKE_STREAM_EDITOR -i \"s/package=\\\"org.mavlink.qgroundcontrol\\\"/package=\\\"$$QGC_ANDROID_PACKAGE\\\"/\" $$ANDROID_PACKAGE_SOURCE_DIR/AndroidManifest.xml
android_source_dir_target.depends = FORCE
# Commented out to allow for custom android build
# ANDROID_PACKAGE_SOURCE_DIR = $$OUT_PWD/ANDROID_PACKAGE_SOURCE_DIR
# android_source_dir_target.target = android_source_dir
# PRE_TARGETDEPS += $$android_source_dir_target.target
# QMAKE_EXTRA_TARGETS += android_source_dir_target

# android_source_dir_target.commands = $$QMAKE_MKDIR $$ANDROID_PACKAGE_SOURCE_DIR && \
# $$QMAKE_COPY_DIR $$PWD/android/* $$OUT_PWD/ANDROID_PACKAGE_SOURCE_DIR && \
# $$QMAKE_COPY_DIR $$PWD/custom/android/* $$OUT_PWD/ANDROID_PACKAGE_SOURCE_DIR && \
# $$QMAKE_STREAM_EDITOR -i \"s/package=\\\"org.mavlink.qgroundcontrol\\\"/package=\\\"$$QGC_ANDROID_PACKAGE\\\"/\" $$ANDROID_PACKAGE_SOURCE_DIR/AndroidManifest.xml
# android_source_dir_target.depends = FORCE
}

exists($$PWD/custom/android/AndroidManifest.xml) {
Expand Down
301 changes: 301 additions & 0 deletions custom/InstrumentValueIcons.qrc

Large diffs are not rendered by default.

Binary file added custom/README.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions custom/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# QGroundControl Ground Control Station

## Custom Build Example

To build this sample custom version:

* Clean you build directory of any previous build
* Rename the directory from `custom-example` to `custom`
* Change to the `custom` directory
* Run `python updateqrc.py`
* Build QGC

![Custom Build Screenshot](README.jpg)

More details on what a custom build is and how to create your own can be found in the [QGC Dev Guide](https://dev.qgroundcontrol.com/en/custom_build/custom_build.html).

The main features of this example:

* Assumes an "Off The Shelf" purchased commercial vehicle. This means most vehicle setup is hidden from the user since they should mostly never need to adjust those things. They would be set up correctly by the vehicle producing company prior to sale.
* The above assumption cause the QGC UI to adjust and not show various things. Providing an even simpler experience to the user.
* The full experience continues to be available in "Advanced Mode".
* Brands the build with various custom images and custom color palette which matches corporate branding of the theoretical commercial company this build is for.
* Customizes portions of the interface such as you can see in the above screenshot which shows a custom instrument widget replacing the standard QGC ui.
* It also overrides various QGC Application settings to hide some settings the users shouldn't modify as well as adjusting defaults for others.
* The source code is fully commented to explain what and why it is doing things.

> Important Note: This custom build is not automatically built each time regular QGC code changes. This can mean that it may fall out of date with the latest changes in QGC code. This can show up as the `python updateqrc.py` steps failing due to upstream resource changes. Or possibly fail to compile because the plugin mechanism for custom builds has changed. If this happens please notify the QGC devs and they will bring it up to date. Or even better, submit a pull for the fix yourself!
Binary file added custom/android/res/drawable-hdpi/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added custom/android/res/drawable-ldpi/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added custom/android/res/drawable-mdpi/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added custom/android/res/drawable-xhdpi/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added custom/android/res/drawable-xxhdpi/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added custom/android/res/drawable-xxxhdpi/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
60 changes: 60 additions & 0 deletions custom/custom.pri
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
message("Adding Custom Plugin")

#-- Version control
# Major and minor versions are defined here (manually)

CUSTOM_QGC_VER_MAJOR = 1
CUSTOM_QGC_VER_MINOR = 0
CUSTOM_QGC_VER_FIRST_BUILD = 0

# Build number is automatic
# Uses the current branch. This way it works on any branch including build-server's PR branches
CUSTOM_QGC_VER_BUILD = $$system(git --git-dir ../.git rev-list $$GIT_BRANCH --first-parent --count)
win32 {
CUSTOM_QGC_VER_BUILD = $$system("set /a $$CUSTOM_QGC_VER_BUILD - $$CUSTOM_QGC_VER_FIRST_BUILD")
} else {
CUSTOM_QGC_VER_BUILD = $$system("echo $(($$CUSTOM_QGC_VER_BUILD - $$CUSTOM_QGC_VER_FIRST_BUILD))")
}
CUSTOM_QGC_VERSION = $${CUSTOM_QGC_VER_MAJOR}.$${CUSTOM_QGC_VER_MINOR}.$${CUSTOM_QGC_VER_BUILD}

DEFINES -= APP_VERSION_STR=\"\\\"$$APP_VERSION_STR\\\"\"
DEFINES += APP_VERSION_STR=\"\\\"$$CUSTOM_QGC_VERSION\\\"\"

message(Custom QGC Version: $${CUSTOM_QGC_VERSION})

# Branding

DEFINES += CUSTOMHEADER=\"\\\"CustomPlugin.h\\\"\"
DEFINES += CUSTOMCLASS=CustomPlugin

TARGET = CustomQGroundControl
DEFINES += QGC_APPLICATION_NAME='"\\\"Custom QGroundControl\\\""'

DEFINES += QGC_ORG_NAME=\"\\\"qgroundcontrol.org\\\"\"
DEFINES += QGC_ORG_DOMAIN=\"\\\"org.qgroundcontrol\\\"\"

# TODO: Figure out why this can't be our own custom information
QGC_APP_NAME = "Custom QGroundControl"
QGC_BINARY_NAME = "CustomQGroundControl"
QGC_ORG_NAME = "Custom"
QGC_ORG_DOMAIN = "org.custom"
QGC_ANDROID_PACKAGE = "org.custom.qgroundcontrol"
QGC_APP_DESCRIPTION = "Custom QGroundControl"QGC_APP_COPYRIGHT = "Copyright (C) 2023 QGroundControl Development Team. All rights reserved."

# Our own, custom resources
RESOURCES += \
$$PWD/custom.qrc

QML_IMPORT_PATH += \
$$PWD/res

# Our own, custom sources
SOURCES += \
$$PWD/src/CustomPlugin.cc \

HEADERS += \
$$PWD/src/CustomPlugin.h \

INCLUDEPATH += \
$$PWD/src \

11 changes: 11 additions & 0 deletions custom/custom.qrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<RCC>
<qresource prefix="custom/img">
<file alias="CustomAppIcon.png">res/Images/CustomAppIcon.png</file>
</qresource>
<qresource prefix="/qml">
<file alias="QGroundControl/FlightDisplay/FlyView.qml">res/CustomFlyView.qml</file>
<file alias="QGroundControl/FlightDisplay/FlyViewWidgetLayer.qml">res/CustomFlyViewWidgetLayer.qml</file>
<file alias="QGroundControl/Controls/QGCPipState.qml">res/CustomQGCPipState.qml</file>
<file alias="QGroundControl/Controls/QGCPipOverlay.qml">res/CustomQGCPipOverlay.qml</file>
</qresource>
</RCC>
3 changes: 3 additions & 0 deletions custom/custom_deploy.pri
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
QMAKE_POST_LINK += && $$QMAKE_COPY $$PWD/deploy/qgroundcontrol-start.sh $$DESTDIR
QMAKE_POST_LINK += && $$QMAKE_COPY $$PWD/deploy/qgroundcontrol.desktop $$DESTDIR
QMAKE_POST_LINK += && $$QMAKE_COPY $$PWD/res/Images/CustomAppIcon.png $$DESTDIR
11 changes: 11 additions & 0 deletions custom/deploy/qgroundcontrol-start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh
HERE="$(dirname "$(readlink -f "${0}")")"
export LD_LIBRARY_PATH="${HERE}/usr/lib/x86_64-linux-gnu":"${HERE}/Qt/libs":$LD_LIBRARY_PATH
export QML2_IMPORT_PATH="${HERE}/Qt/qml"
export QT_PLUGIN_PATH="${HERE}/Qt/plugins"
export QT_IM_MODULE=qtvirtualkeyboard

# hack until icon issue with AppImage is resolved
mkdir -p ~/.icons && \cp -f ${HERE}/qgroundcontrol.png ~/.icons

"${HERE}/CustomQGroundControl" "$@"
9 changes: 9 additions & 0 deletions custom/deploy/qgroundcontrol.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[Desktop Entry]
Type=Application
Name=CustomQGroundControl
GenericName=Ground Control Station
Comment=UAS ground control station
Icon=CustomAppIcon
Exec=qgroundcontrol-start.sh
Terminal=false
Categories=Utility;
4 changes: 4 additions & 0 deletions custom/qgroundcontrol.exclusion
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<file alias="QGroundControl/FlightDisplay/FlyView.qml">src/FlightDisplay/FlyView.qml</file>
<file alias="QGroundControl/Controls/QGCPipState.qml">src/QmlControls/QGCPipState.qml</file>
<file alias="QGroundControl/Controls/QGCPipOverlay.qml">src/QmlControls/QGCPipOverlay.qml</file>

Loading