From 96acc7b68ccc8e23423b421f40bd029208ee2c00 Mon Sep 17 00:00:00 2001
From: Raphael <68374617+raphaelscholle@users.noreply.github.com>
Date: Tue, 9 Jan 2024 12:53:12 +0100
Subject: [PATCH 01/28] debug
---
.github/workflows/Windows.yml | 13 +-
.github/workflows/macos.yml | 7 +-
.github/workflows/ubuntu20.04.yml | 36 +-
.github/workflows/ubuntu22.04.yml | 57 ++
.github/workflows/ubuntu23.04.yml | 12 +-
debian/changelog | 23 +
debian/control | 2 +-
src/CMakeLists.txt | 6 +-
src/MsgPopup.qml | 32 +-
src/OpenHD-download-index.json | 343 ++++++++++++
src/OptionsPopup.qml | 579 +++++++++++---------
src/cli.cpp | 6 +-
src/config.h | 2 +-
src/downloadthread.cpp | 327 +++++------
src/downloadthread.h | 9 +-
src/imagewriter.cpp | 26 +-
src/imagewriter.h | 4 +-
src/linux/openhdimagewriter.metainfo.xml.in | 6 +-
src/main.qml | 343 ++++++++++--
src/windows/openhdimagewriter.manifest | 2 +-
src/windows/openhdimagewriter.nsi.in | 25 +-
src/windows/openhdimagewriter.nsi.in.bak | 20 +-
22 files changed, 1261 insertions(+), 619 deletions(-)
create mode 100644 .github/workflows/ubuntu22.04.yml
create mode 100644 src/OpenHD-download-index.json
diff --git a/.github/workflows/Windows.yml b/.github/workflows/Windows.yml
index 283f20f5c..34a2a1b64 100644
--- a/.github/workflows/Windows.yml
+++ b/.github/workflows/Windows.yml
@@ -2,9 +2,16 @@ name: OpenHD Image Writer Windows
on:
push:
- branches: [ master ]
- pull_request:
- branches: [ master ]
+ branches:
+ - "2.5-evo"
+ - "dev-release"
+ - "release"
+ paths-ignore:
+ - '**.md'
+ - '**.asciidoc'
+ - '**.adoc'
+ - '.gitignore'
+ - 'LICENSE'
env:
BUILD_TYPE: Release
diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml
index 5e2ce9af6..9d00b48ac 100644
--- a/.github/workflows/macos.yml
+++ b/.github/workflows/macos.yml
@@ -2,7 +2,11 @@ name: Build MacOS
on:
push:
-
+ branches:
+ - "2.5-evo"
+ - "dev-release"
+ - "release"
+
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
@@ -33,6 +37,7 @@ jobs:
- name: Build
# Build your program with the given configuration
run: |
+ cmake --version
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
cd ../build/
ls -a
diff --git a/.github/workflows/ubuntu20.04.yml b/.github/workflows/ubuntu20.04.yml
index dd01ca4cc..329ac30ae 100644
--- a/.github/workflows/ubuntu20.04.yml
+++ b/.github/workflows/ubuntu20.04.yml
@@ -4,13 +4,11 @@ name: OpenHD Image Writer
# Controls when the workflow will run
on:
- # Triggers the workflow on push or pull request events but only for the "qml" branch
push:
- branches: [ "master" ]
- paths-ignore:
- - '**/Windows.yml'
- pull_request:
- branches: [ "master" ]
+ branches:
+ - "2.5-evo"
+ - "dev-release"
+ - "release"
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
@@ -43,16 +41,16 @@ jobs:
*.deb
if-no-files-found: error
- - name: Push
- id: push
- uses: cloudsmith-io/action@master
- with:
- api-key: ${{ secrets.CLOUDSMITH_API_KEY }}
- command: "push"
- format: "deb"
- owner: "openhd"
- repo: "openhd-2-3-evo"
- distro: "ubuntu"
- release: "focal"
- republish: "true" # needed ONLY if version is not changing
- file: "*.deb"
+ # - name: Push
+ # id: push
+ # uses: cloudsmith-io/action@master
+ # with:
+ # api-key: ${{ secrets.CLOUDSMITH_API_KEY }}
+ # command: "push"
+ # format: "deb"
+ # owner: "openhd"
+ # repo: "openhd-2-3-evo"
+ # distro: "ubuntu"
+ # release: "focal"
+ # republish: "true" # needed ONLY if version is not changing
+ # file: "*.deb"
diff --git a/.github/workflows/ubuntu22.04.yml b/.github/workflows/ubuntu22.04.yml
new file mode 100644
index 000000000..f693e4b03
--- /dev/null
+++ b/.github/workflows/ubuntu22.04.yml
@@ -0,0 +1,57 @@
+# This is a basic workflow to help you get started with Actions
+
+name: OpenHD Image Writer
+
+on:
+ push:
+ branches:
+ - "2.5-evo"
+ - "dev-release"
+ - "release"
+ - "2.0"
+
+# A workflow run is made up of one or more jobs that can run sequentially or in parallel
+jobs:
+ # This workflow contains a single job called "build"
+ build:
+ # The type of runner that the job will run on
+ runs-on: ubuntu-22.04
+
+ # Steps represent a sequence of tasks that will be executed as part of the job
+ steps:
+ # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
+ - uses: actions/checkout@v2
+
+ # Runs a set of commands using the runners shell
+ - name: Build
+ run: |
+ sudo apt update
+ sudo apt upgrade -y
+ sudo apt install -y --no-install-recommends libgnutls28-dev build-essential devscripts debhelper cmake git libarchive-dev libcurl4-openssl-dev qtbase5-dev qtbase5-dev-tools qtdeclarative5-dev libqt5svg5-dev qttools5-dev libssl-dev qml-module-qtquick2 qml-module-qtquick-controls2 qml-module-qtquick-layouts qml-module-qtquick-templates2 qml-module-qtquick-window2 qml-module-qtgraphicaleffects
+ mkdir build
+ mv `ls -A | grep -v "build"` build
+ cd build
+ debuild -uc -us
+ cd ..
+
+ - name: Upload to Github
+ uses: 'actions/upload-artifact@v2'
+ with:
+ name: "OpenHD Image Writer"
+ path: |
+ *.deb
+ if-no-files-found: error
+
+ - name: Push
+ id: push
+ uses: cloudsmith-io/action@master
+ with:
+ api-key: ${{ secrets.CLOUDSMITH_API_KEY }}
+ command: "push"
+ format: "deb"
+ owner: "openhd"
+ repo: ${{ github.ref_name }}
+ distro: "ubuntu"
+ release: "jammy"
+ republish: "true" # needed ONLY if version is not changing
+ file: "*.deb"
diff --git a/.github/workflows/ubuntu23.04.yml b/.github/workflows/ubuntu23.04.yml
index 3e5a21648..cf8c041e5 100644
--- a/.github/workflows/ubuntu23.04.yml
+++ b/.github/workflows/ubuntu23.04.yml
@@ -4,13 +4,11 @@ name: OpenHD Image Writer lunar
# Controls when the workflow will run
on:
- # Triggers the workflow on push or pull request events but only for the "qml" branch
push:
- branches: [ "master" ]
- paths-ignore:
- - '**/Windows.yml'
- pull_request:
- branches: [ "master" ]
+ branches:
+ - "2.5-evo"
+ - "dev-release"
+ - "release"
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
@@ -61,7 +59,7 @@ jobs:
command: "push"
format: "deb"
owner: "openhd"
- repo: "openhd-x86-evo"
+ repo: ${{ github.ref_name }}
distro: "ubuntu"
release: "lunar"
republish: "true" # needed ONLY if version is not changing
diff --git a/debian/changelog b/debian/changelog
index 97f53f418..3170392cd 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,26 @@
+openhdimagewriter (2.0.1) stable; urgency=high
+
+ * TODO
+
+ -- Raphael Scholle Sat, 02 Sep 2023 02:06:52 +0100
+openhdimagewriter (1.9.2) stable; urgency=high
+
+ * refactor a lot of settings to QSettings
+ * refactor all settings
+ * remove a few bugs with it
+
+ -- Raphael Scholle Sat, 02 Sep 2023 02:06:52 +0100
+openhdimagewriter (1.9.1) stable; urgency=high
+
+ * refactor a lot of settings to QSettings
+ * add wifi-hotspot
+ * add details page
+ * add camera-selection
+ * add wifi-hotspot
+ * add debug mode
+
+ -- Raphael Scholle Sat, 02 Sep 2023 02:06:52 +0100
+
openhdimagewriter (1.9.0) stable; urgency=high
* add bindphrase
diff --git a/debian/control b/debian/control
index 5945a7239..d0d6038b9 100644
--- a/debian/control
+++ b/debian/control
@@ -12,7 +12,7 @@ Package: openhdimagewriter
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends},
qml-module-qtquick2, qml-module-qtquick-controls2, qml-module-qtquick-layouts, qml-module-qtquick-templates2, qml-module-qtquick-window2, qml-module-qtgraphicaleffects,
- dosfstools, fdisk
+ dosfstools, fdisk, qml-module-qt-labs-settings
Recommends: udisks2
Description: OpenHD Image Writer
Graphical user-interface to write disk images and format SD cards.
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index f6b21ea7f..a8fd143a0 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -10,9 +10,9 @@ OPTION (ENABLE_CHECK_VERSION "Check for version updates" ON)
OPTION (ENABLE_TELEMETRY "Enable sending telemetry" ON)
project(OpenHDImageWriter LANGUAGES CXX C)
-set(IMAGER_VERSION_MAJOR 1)
-set(IMAGER_VERSION_MINOR 9)
-set(IMAGER_VERSION_STR "${IMAGER_VERSION_MAJOR}.${IMAGER_VERSION_MINOR}.0")
+set(IMAGER_VERSION_MAJOR 2)
+set(IMAGER_VERSION_MINOR 0)
+set(IMAGER_VERSION_STR "${IMAGER_VERSION_MAJOR}.${IMAGER_VERSION_MINOR}.1")
set(IMAGER_VERSION_CSV "${IMAGER_VERSION_MAJOR},${IMAGER_VERSION_MINOR},0,0")
add_definitions(-DIMAGER_VERSION_STR="${IMAGER_VERSION_STR}")
add_definitions(-DIMAGER_VERSION_CSV=${IMAGER_VERSION_CSV})
diff --git a/src/MsgPopup.qml b/src/MsgPopup.qml
index 8772482f8..a39348c68 100644
--- a/src/MsgPopup.qml
+++ b/src/MsgPopup.qml
@@ -21,6 +21,7 @@ Popup {
property alias title: msgpopupheader.text
property alias text: msgpopupbody.text
property bool continueButton: true
+ property bool detailsButton: false
property bool quitButton: false
property bool yesButton: false
property bool noButton: false
@@ -93,6 +94,19 @@ Popup {
Layout.alignment: Qt.AlignCenter | Qt.AlignBottom
spacing: 20
+
+ ImButton {
+ visible: msgpopup.detailsButton
+ text: qsTr("Details")
+ onClicked:{
+ onClicked: {
+ detailsPopup.visible = !detailsPopup.visible;
+ }
+ }
+ Material.foreground: activeFocus ? "#d1dcfb" : "#ffffff"
+ Material.background: "#2C3E50"
+ }
+
ImButton {
text: qsTr("NO")
onClicked: {
@@ -124,7 +138,6 @@ Popup {
Material.foreground: activeFocus ? "#d1dcfb" : "#ffffff"
Material.background: "#2C3E50"
}
-
ImButton {
text: qsTr("QUIT")
onClicked: {
@@ -138,22 +151,6 @@ Popup {
Text { text: " " }
}
- RowLayout {
- Layout.alignment: Qt.AlignLeft | Qt.AlignBottom
- Layout.leftMargin: 20
- Layout.bottomMargin: 10
- Text {
- id: changelog
- text: "changelogs FIRST BOOT MAY TAKE UP TO 5 MINUTES! "
- font.family: roboto.name
- font.pointSize: 10
- visible: msgpopup.continueButton
- MouseArea {
- anchors.fill: parent
- onClicked: Qt.openUrlExternally("https://openhdfpv.org/changelogs")
- }
- }
- }
}
function openPopup() {
@@ -162,3 +159,4 @@ Popup {
msgpopupbody.forceActiveFocus()
}
}
+
diff --git a/src/OpenHD-download-index.json b/src/OpenHD-download-index.json
new file mode 100644
index 000000000..7fbd20cf2
--- /dev/null
+++ b/src/OpenHD-download-index.json
@@ -0,0 +1,343 @@
+{
+ "imager": {
+ "latest_version": "2.0.1-OpenHD",
+ "url": "https://openhdfpv.org/#downloads"
+ },
+ "os_list": [
+ {
+ "name": "OpenHD Evo Raspberry",
+ "description": "Images for Raspberry-Pi SBC's",
+ "icon": "https://upload.wikimedia.org/wikipedia/de/thumb/c/cb/Raspberry_Pi_Logo.svg/570px-Raspberry_Pi_Logo.svg.png",
+ "subitems": [
+ {
+ "name": "OpenHD-2.5.3",
+ "description": "Improved OS, frequencies,...",
+ "icon": "https://fra1.digitaloceanspaces.com/openhd-images/Downloader/release/ImageWriter/rpi-ohd.png",
+ "url": "https://fra1.digitaloceanspaces.com/openhd-images/Downloader/release/OpenHD-image-pi-bullseye-configurable-release-2024-01-08_1550.img.xz",
+ "extract_size": 2866950656,
+ "extract_sha256": "b6dafb8cf2c3e3c9e4f3e3ad427a2f25a02b55b45334863b6bd595c71b37bda5",
+ "image_download_size": 754596864,
+ "release_date": "2024-01-08",
+ "init_format": "systemd"
+ },
+ {
+ "name": "OpenHD-2.4.1-evo",
+ "description": "Expose more camera setting, enable Gpio switching, performance and bugfixes",
+ "icon": "https://fra1.digitaloceanspaces.com/openhd-images/Downloader/release/ImageWriter/rpi-ohd.png",
+ "url": "https://fra1.digitaloceanspaces.com/openhd-images/Downloader/release/OpenHD-image-pi-bullseye-configurable-2.4-evo-2023-06-30_2230.img.xz",
+ "extract_size": 3452678656,
+ "extract_sha256": "7c24543a3b075e773ae51fcb53c768efea4a740d1c6e3eef30463e9140c1d247",
+ "image_download_size": 928471500,
+ "release_date": "2023-06-30",
+ "init_format": "systemd"
+ },
+ {
+ "name": "OpenHD-2.4-evo-beta ",
+ "description": "Adds 6.x Kernel, IMX708 support, more Camera settings, MCS via RC,...",
+ "icon": "https://fra1.digitaloceanspaces.com/openhd-images/Downloader/release/ImageWriter/rpi-ohd.png",
+ "url": "https://fra1.digitaloceanspaces.com/openhd-images/Downloader/release/OpenHD-image-pi-bullseye-configurable-2.4-evo-2023-06-23_1731.img.xz",
+ "extract_size": 3452572160,
+ "extract_sha256": "2dcfcc440ce6f4ae6c81afe7124b743b6df4aba060c35d1329533abc3c513d1c",
+ "image_download_size": 946835456,
+ "release_date": "2023-06-23",
+ "init_format": "systemd"
+ },
+ {
+ "name": "OpenHD-2.3.6-evo ",
+ "description": "OpenHD Evo for Raspberry",
+ "icon": "https://fra1.digitaloceanspaces.com/openhd-images/Downloader/release/ImageWriter/rpi-ohd.png",
+ "url": "https://fra1.digitaloceanspaces.com/openhd-images/Downloader/release/OpenHD-image-pi-bullseye-release--2.3-evo-2023-06-04_2201-configurable.img.xz",
+ "extract_size": 3473338880,
+ "extract_sha256": "711b71b461e3d1f245b04737bfabd53bf89569b523d06f23f03144753b8c69b6",
+ "image_download_size": 908356600,
+ "release_date": "2023-06-04",
+ "init_format": "systemd"
+ },
+ {
+
+ "name": "OpenHD-2.3.5-evo-beta ",
+ "description": "OpenHD Evo for Raspberry",
+ "icon": "https://fra1.digitaloceanspaces.com/openhd-images/Downloader/release/ImageWriter/rpi-ohd.png",
+ "url": "https://fra1.digitaloceanspaces.com/openhd-images/Downloader/OpenHD-image-pi-bullseye-configurable-2.3-evo-2023-05-18_1031.zip",
+ "extract_size": 3416003072,
+ "extract_sha256": "d2018a810260a47c9c98bdc2f0ab28eb21dd0a4e261210d49d68268cfa0eace0",
+ "image_download_size": 1181022536,
+ "release_date": "2023-05-18",
+ "init_format": "systemd"
+ },
+ {
+
+ "name": "OpenHD-2.3.3-evo-beta ",
+ "description": "OpenHD Evo for Raspberry",
+ "icon": "https://fra1.digitaloceanspaces.com/openhd-images/Downloader/release/ImageWriter/rpi-ohd.png",
+ "url": "https://openhd-images.fra1.cdn.digitaloceanspaces.com/Downloader/OpenHD-image-pi-bullseye-release--2.3-evo-2023-03-10_2127-configurable.img.xz",
+ "extract_size": 3416003072,
+ "extract_sha256": "7e4cc3adfccb982471bac209b80c6fa0634026d37a766093ce77775c81f79d0a",
+ "image_download_size": 1181022536,
+ "release_date": "2023-03-10",
+ "init_format": "systemd"
+ }
+ ]
+ },
+ {
+ "name": "OpenHD Evo Radxa",
+ "description": "Images for Radxa SBC's",
+ "icon": "https://forum.radxa.com/uploads/default/original/1X/afb83a5d13f03ccc5f26a0c5800a02e320b06468.png",
+ "subitems": [
+ {
+ "name": "OpenHD-2.5.2-beta",
+ "description": "Radxa Zero 3W EMMC",
+ "icon": "https://fra1.digitaloceanspaces.com/openhd-images/Downloader/OpenHD-advanced.png",
+ "url": "https://fra1.digitaloceanspaces.com/openhd-images/Downloader/release/2.5/OpenHD-EMMC-radxa-zero3w--release.img.xz",
+ "extract_size": 9500000256,
+ "extract_sha256": "1e6b37af103ee90868bcbd8e4cb0dab92c26a9768d092b9b42d3eb57e46a9efa",
+ "image_download_size": 3579883260,
+ "release_date": "2023-12-12",
+ "init_format": "systemd"
+ },
+ {
+ "name": "OpenHD-2.5.2-beta",
+ "description": "Radxa CM3",
+ "icon": "https://fra1.digitaloceanspaces.com/openhd-images/Downloader/OpenHD-advanced.png",
+ "url": "https://fra1.digitaloceanspaces.com/openhd-images/Downloader/release/2.5/OpenHD-image-radxa-cm3--release-2023-12-12_1737.img.xz",
+ "extract_size": 5999997952,
+ "extract_sha256": "436585538dd0a0095f682c7f7e1d5e141349b2b16ad0ffdb182e9ffb96cc4052",
+ "image_download_size": 1458197624,
+ "release_date": "2023-12-12",
+ "init_format": "systemd"
+ },
+ {
+ "name": "OpenHD-2.5.2-beta",
+ "description": "Radxa Rock5 A",
+ "icon": "https://fra1.digitaloceanspaces.com/openhd-images/Downloader/OpenHD-advanced.png",
+ "url": "https://fra1.digitaloceanspaces.com/openhd-images/Downloader/release/2.5/OpenHD-image-rock5a--release-2023-12-12_1736.img.xz",
+ "extract_size": 6800000000,
+ "extract_sha256": "1add63e53aa418bffa2dbe3ae1d84cdbb6fa7a1747002b54d99ffa370532232d",
+ "image_download_size": 1525008004,
+ "release_date": "2023-12-12",
+ "init_format": "systemd"
+ },
+ {
+ "name": "OpenHD-2.5.2-beta",
+ "description": "Radxa Rock5 B",
+ "icon": "https://fra1.digitaloceanspaces.com/openhd-images/Downloader/OpenHD-advanced.png",
+ "url": "https://fra1.digitaloceanspaces.com/openhd-images/Downloader/release/2.5/OpenHD-image-rock5b--release-2023-12-12_1736.img.xz",
+ "extract_size": 6800000000,
+ "extract_sha256": "c43ad90e6bc6dfade597849b8e9f37174c90de99fcc376372af38f907f513aa4",
+ "image_download_size": 1621560708,
+ "release_date": "2023-12-12",
+ "init_format": "systemd"
+ },
+ {
+ "name": "OpenHD-2.4.1-evo Rock5B",
+ "description": "Added custom kernel and 8812bu support, only Ground",
+ "icon": "https://fra1.digitaloceanspaces.com/openhd-images/Downloader/OpenHD-advanced.png",
+ "url": "https://fra1.digitaloceanspaces.com/openhd-images/Downloader/release/OpenHD-image-rock5b--2.4-evo-2023-06-30_2230.img.xz",
+ "extract_size": 14500000256,
+ "extract_sha256": "399ba04a68a7f0872a9239f096fc0da8c2aacb56b5d0d028fe3e8822f971fa2d",
+ "image_download_size": 1698576940,
+ "release_date": "2023-30-06",
+ "init_format": "systemd"
+ },
+ {
+ "name": "OpenHD-2.4.1-evo Rock5A",
+ "description": "Added custom kernel and 8812bu support, only Ground",
+ "icon": "https://fra1.digitaloceanspaces.com/openhd-images/Downloader/OpenHD-advanced.png",
+ "url": "https://fra1.digitaloceanspaces.com/openhd-images/Downloader/release/OpenHD-image-rock5a--2.4-evo-2023-06-30_2231.img.xz",
+ "extract_size": 14500000256,
+ "extract_sha256": "628d2af56d11a27058401089a02979e1b5932a2d452c88e922d21db588d565cd",
+ "image_download_size": 1647829508,
+ "release_date": "2023-30-06",
+ "init_format": "systemd"
+ },
+ {
+ "name": "OpenHD-2.4-evo-beta Rock5B",
+ "description": "Initial Radxa Rock5B support, only Ground",
+ "icon": "https://fra1.digitaloceanspaces.com/openhd-images/Downloader/OpenHD-advanced.png",
+ "url": "https://fra1.digitaloceanspaces.com/openhd-images/Downloader/release/OpenHD-ground-rock5b--2.4-evo-2023-06-23_1731.img.xz",
+ "extract_size": 14500000256,
+ "extract_sha256": "edffe76325aa19c4a11fa462599f9d84487df1376e3a24d716299bcb720dd621",
+ "image_download_size": 1410447972,
+ "release_date": "2023-23-06",
+ "init_format": "systemd"
+ },
+ {
+ "name": "OpenHD-2.4-evo-beta Rock5A",
+ "description": "Initial Radxa Rock5A support, only Ground",
+ "icon": "https://fra1.digitaloceanspaces.com/openhd-images/Downloader/OpenHD-advanced.png",
+ "url": "https://fra1.digitaloceanspaces.com/openhd-images/Downloader/release/OpenHD-ground-rock5a--2.4-evo-2023-06-23_1731.img.xz",
+ "extract_size": 14500000256,
+ "extract_sha256": "dcbc281452122a3046a0631a6d80e5fe2ddbe0976138933345fa5dec8fbdd393",
+ "image_download_size": 1404092244,
+ "release_date": "2023-23-06",
+ "init_format": "systemd"
+ }
+ ]
+ },
+ {
+ "name": "OpenHD Evo X86",
+ "description": "Images for normal Computers",
+ "icon": "https://fra1.digitaloceanspaces.com/openhd-images/Downloader/release/ImageWriter/x86.png",
+ "subitems": [
+ {
+ "name": "OpenHD-2.4.1-evo",
+ "description": "updated to latest OpenHD/QOpenHD",
+ "icon": "https://fra1.digitaloceanspaces.com/openhd-images/Downloader/release/ImageWriter/x86-ohd.png",
+ "url": "https://fra1.digitaloceanspaces.com/openhd-images/Downloader/release/OpenHD-image-x86-jammy--2.4-evo-2023-06-30_2230.img.xz",
+ "extract_size": 16500000256,
+ "extract_sha256": "8cecff8366272328694382dc5f644b5c962e9876a11428090256379170396253",
+ "image_download_size": 5616280016,
+ "release_date": "2023-30-06",
+ "init_format": "systemd"
+ },
+ {
+ "name": "OpenHD-2.4-evo-beta ",
+ "description": "updated to latest OpenHD/QOpenHD",
+ "icon": "https://fra1.digitaloceanspaces.com/openhd-images/Downloader/release/ImageWriter/x86-ohd.png",
+ "url": "https://fra1.digitaloceanspaces.com/openhd-images/Downloader/release/OpenHD-image-x86-jammy--2.4-evo-2023-06-23_1731.img.xz",
+ "extract_size": 16500000256,
+ "extract_sha256": "aa65dbbe24308d318df977710bcc70620fe988f9499d83fe6b1d2e2547032b31",
+ "image_download_size": 5691925560,
+ "release_date": "2023-23-06",
+ "init_format": "systemd"
+ },
+ {
+ "name": "OpenHD-2.3.6-evo ",
+ "description": "OpenHD Evo for x86",
+ "icon": "https://fra1.digitaloceanspaces.com/openhd-images/Downloader/release/ImageWriter/x86-ohd.png",
+ "url": "https://fra1.digitaloceanspaces.com/openhd-images/Downloader/release/OpenHD-image-x86-jammy-testing--2.3-evo-2023-06-04_2201.img.xz",
+ "extract_size": 16500000256,
+ "extract_sha256": "98097d16c15a02f9025b4baee3416421a3e20c8112dfc76b51c295409f91a064",
+ "image_download_size": 6143738016,
+ "release_date": "2023-06-04"
+ },
+ {
+ "name": "OpenHD-2.3.5-evo-beta ",
+ "description": "OpenHD Evo for x86",
+ "icon": "https://fra1.digitaloceanspaces.com/openhd-images/Downloader/release/ImageWriter/x86-ohd.png",
+ "url": "https://fra1.digitaloceanspaces.com/openhd-images/Downloader/OpenHD-image-x86-jammy--2.3-evo-2023-05-18_1030.img.xz",
+ "extract_size": 16500000256,
+ "extract_sha256": "fb722a0b3f25576c96cfb0e514e6128b01ee48b90163d29cbcad32f77adc1797",
+ "image_download_size": 5769245024,
+ "release_date": "2023-03-10"
+ },
+ {
+ "name": "OpenHD-2.3.3-evo-beta ",
+ "description": "OpenHD Evo for x86",
+ "icon": "https://fra1.digitaloceanspaces.com/openhd-images/Downloader/release/ImageWriter/x86-ohd.png",
+ "url": "https://openhd-images.fra1.cdn.digitaloceanspaces.com/Downloader/OpenHD-image-x86-jammy-testing--2.3-evo-2023-03-10_2126.img.xz",
+ "extract_size": 15728640000,
+ "extract_sha256": "da0495dfd3a6f2e662a65207ee8f84695869cb4137e6059d133e681cd9d12045",
+ "image_download_size": 6194596280,
+ "release_date": "2023-03-10"
+ }
+ ]
+ },
+ {
+ "name": "OpenHD 2.0",
+ "description": "OpenHD 2.0 Images",
+ "icon": "https://openhd-images.fra1.cdn.digitaloceanspaces.com/Downloader/OpenHD-old.png",
+ "subitems": [
+ {
+ "name": "OpenHD 2.0.12 Raspberry Pi",
+ "description": "Raspberry Pi Buster",
+ "icon": "https://fra1.digitaloceanspaces.com/openhd-images/Downloader/release/ImageWriter/rpi-ohd.png",
+ "url": "https://openhd-images.fra1.cdn.digitaloceanspaces.com/Downloader/Open.HD-2.0.12b-buster.zip",
+ "extract_size": 4001370112,
+ "extract_sha256": "3d0e3cea1972ad99cc5aa33c549ec0c7a3f1747e65eb8c853fb12a880f00c511",
+ "image_download_size": 1596698624,
+ "release_date": "2021-23-09"
+ },
+ {
+ "name": "OpenHD 2.0.8 B",
+ "description": "Raspberry Pi Buster",
+ "icon": "https://fra1.digitaloceanspaces.com/openhd-images/Downloader/release/ImageWriter/rpi-ohd.png",
+ "url": "https://openhd-images.fra1.cdn.digitaloceanspaces.com/Downloader/Open.HD-2.0.8-buster.img.gz",
+ "extract_size": 4001370112,
+ "extract_sha256": "3fc94dc9871a3fda65900c40dfc7a3fbaabf25204023be8b6da07cb47fbb8151",
+ "image_download_size": 1569824768,
+ "release_date": "2020-17-12"
+ },
+ {
+ "name": "OpenHD 2.0.8 S",
+ "description": "Raspberry Pi Stretch",
+ "icon": "https://fra1.digitaloceanspaces.com/openhd-images/Downloader/release/ImageWriter/rpi-ohd.png",
+ "url": "https://openhd-images.fra1.cdn.digitaloceanspaces.com/Downloader/Open.HD-2.0.8-stretch.img.gz",
+ "extract_size": 4013953024,
+ "extract_sha256": "7b59470ef660d10ae2928ad3b86a08eb69f978ddeeab6d66ef79cb5b9ce645ef",
+ "image_download_size": 1351294976,
+ "release_date": "2020-17-12"
+ }
+ ]
+ },
+ {
+
+ "name": "Mirrors in case of Downtime",
+ "description": "Emergency backups of the latest Images",
+ "icon": "https://www.nicepng.com/png/detail/58-589511_emergency-alert-icon.png",
+ "subitems": [
+ {
+ "name": "OpenHD-2.4.1-evo",
+ "description": "OpenHD Evo for Raspberry",
+ "icon": "https://fra1.digitaloceanspaces.com/openhd-images/Downloader/release/ImageWriter/rpi-ohd.png",
+ "url": "https://github.com/OpenHD/OpenHD-ImageBuilder/releases/download/2.4.1/OpenHD-image-pi-bullseye-configurable-2.4-evo-2023-06-30_2230.img.xz",
+ "extract_size": 3473338880,
+ "extract_sha256": "7c24543a3b075e773ae51fcb53c768efea4a740d1c6e3eef30463e9140c1d247",
+ "image_download_size": 908356600,
+ "release_date": "2023-06-04",
+ "init_format": "systemd"
+ }
+ ]
+ },
+ {
+ "name": "OpenHD Evo Depricated",
+ "description": "OpenHD Images for depricated SBC's",
+ "icon": "https://fra1.digitaloceanspaces.com/openhd-images/Downloader/OpenHD-advanced.png",
+ "subitems": [
+ {
+ "name": "OpenHD-2.3.3-evo-beta ",
+ "description": "OpenHD Evo for Jetson 2GB",
+ "icon": "https://fra1.digitaloceanspaces.com/openhd-images/Downloader/OpenHD-advanced.png",
+ "url": "https://openhd-images.fra1.cdn.digitaloceanspaces.com/Downloader/OpenHD-image-jetson-nano-2gb-bionic-testing--2.3-evo-2023-03-10_2145.img.xz",
+ "extract_size": 15732310016,
+ "extract_sha256": "eb124811b86c72d56db26738fc73c5fdec9ab361e6f387c4e02fe668f8cca127",
+ "image_download_size": 6617753600,
+ "release_date": "2023-03-10"
+ },
+ {
+ "name": "OpenHD-2.3.3-evo-beta ",
+ "description": "OpenHD Evo for Jetson 4GB",
+ "icon": "https://fra1.digitaloceanspaces.com/openhd-images/Downloader/OpenHD-advanced.png",
+ "url": "https://openhd-images.fra1.cdn.digitaloceanspaces.com/Downloader/OpenHD-image-jetson-nano-4gb-bionic-testing--2.3-evo-2023-03-10_2145.img.xz",
+ "extract_size": 15367929856,
+ "extract_sha256": "6e74f071fa078810c1acf06917124e0e9b0314697e3d2782dc1982653bacc5da",
+ "image_download_size": 6434877512,
+ "release_date": "2023-03-10"
+ },
+ {
+ "name": "OpenHD-2.3.2-beta ",
+ "description": "OpenHD Evo for Jetson 2GB",
+ "icon": "https://fra1.digitaloceanspaces.com/openhd-images/Downloader/OpenHD-advanced.png",
+ "url": "https://openhd-images.fra1.cdn.digitaloceanspaces.com/Downloader/OpenHD-image-jetson-nano-2gb-bionic-testing--2.3-evo-2023-03-06_2007.img.xz",
+ "extract_size": 14838903296,
+ "extract_sha256": "a4795fede6412f22e31f234b381ea378798d4f62d01346b39108f66f61ec8f7f",
+ "image_download_size": 6389115840,
+ "release_date": "2023-03-06",
+ "init_format": "systemd"
+ },
+ {
+ "name": "OpenHD-2.3.2-beta ",
+ "description": "OpenHD Evo for Jetson 4GB",
+ "icon": "https://fra1.digitaloceanspaces.com/openhd-images/Downloader/OpenHD-advanced.png",
+ "url": "https://openhd-images.fra1.cdn.digitaloceanspaces.com/Downloader/OpenHD-image-jetson-nano-4gb-bionic-testing--2.3-evo-2023-03-06_2007.img.xz",
+ "extract_size": 14885933568,
+ "extract_sha256": "cb3fa7aceda4de2b9159dbfbb8226f186b75d5ca3aa7cec378f59398fc8bba40",
+ "image_download_size": 6346920140,
+ "release_date": "2023-03-06",
+ "init_format": "systemd"
+ }
+
+ ]
+ }
+ ]
+}
diff --git a/src/OptionsPopup.qml b/src/OptionsPopup.qml
index 945c136c2..68dd11e13 100644
--- a/src/OptionsPopup.qml
+++ b/src/OptionsPopup.qml
@@ -21,16 +21,24 @@ Popup {
padding: 0
closePolicy: Popup.CloseOnEscape
property bool initialized: false
- property bool hasSavedSettings: false
- property string config
- property string cmdline
- property string openHDAir
- property string openHDIp
- property string openHDGround
- property string cloudinit
- property string cloudinitrun
- property string cloudinitwrite
- property string cloudinitnetwork
+
+ // refactored settings
+ property string bootType
+ property string fileName
+ property string sbc
+ property string camera
+ property string bindPhrase
+ property bool bindPhrase_used
+ property string mode
+ property string hotSpot
+ property string beep
+ property string eject
+ property bool rock
+ property bool rpi
+ property bool useSettings:true
+
+
+
// background of title
Rectangle {
@@ -74,179 +82,237 @@ Popup {
clip: true
ScrollBar.vertical.policy: ScrollBar.AlwaysOn
- ColumnLayout {
- GroupBox {
- title: qsTr(" Necessary Settings")
+ ColumnLayout {
+ GroupBox {
+ label: RowLayout {
+ Label {
+ text: parent.parent.title
+ }
+ }
- label: RowLayout {
- Label {
- text: parent.parent.title
- }
+ Layout.fillWidth: true
+
+ ColumnLayout {
+ spacing: -10
+
+ ImCheckBox {
+ id: setAir
+ text: qsTr("Set SBC to AIR")
+ onCheckedChanged: {
+ if (checked) {
+ setGround.checked = false
+ bootType="Air";
+ }
+ }
+ }
+ ImCheckBox {
+ id: setGround
+ text: qsTr("Set SBC to GROUND")
+ onCheckedChanged: {
+ if (checked) {
+ setAir.checked = false
+ bootType = "Ground";
+ }
+ }
+ }
+ }
+ }
+ GroupBox {
+ title: qsTr("Camera Settings")
+ id: cameraSettingsRock5
+ Layout.fillWidth: true
+ visible: rock && (bootType === "Air")
+
+
+ ColumnLayout {
+ spacing: -10
+ // Add a ComboBox to select between cameras
+ ComboBox {
+ id: cameraSelectorRock
+ textRole: "displayText"
+ model: ListModel {
+ ListElement { displayText: "NONE" }
+ ListElement { displayText: "IMX415" }
+ ListElement { displayText: "IMX462" }
+ ListElement { displayText: "HDMI" }
+ }
+ onCurrentIndexChanged: {
+ var selectedCamera = model.get(currentIndex).displayText;
+ if (selectedCamera !== "NONE") {
+ camera = selectedCamera;
+ }
+ }
+ }
+ }
+ }
+ GroupBox {
+ title: qsTr("Camera Settings")
+ id: cameraSettingsRpi
+ Layout.fillWidth: true
+ visible: rpi && (bootType === "Air")
+ ColumnLayout {
+ // Add a ComboBox to select between cameras
+ ComboBox {
+ id: cameraVendorSelectorRpi
+ textRole: "displayText"
+ model: ListModel {
+ ListElement { displayText: "Original" }
+ ListElement { displayText: "Arducam" }
+ ListElement { displayText: "Veye" }
+ }
+ Layout.minimumWidth: 200
+ Layout.maximumHeight: 40
+ onCurrentIndexChanged: {
+ var selectedCameraVendor = model.get(currentIndex).displayText;
+ if (selectedCameraVendor !== "Original" && selectedCameraVendor !== "Veye") {
+ cameraSelectorArducam.visible=true
+ cameraSelectorVeye.visible=false
+ }
+ else if (selectedCameraVendor !== "Original" && selectedCameraVendor !== "Arducam") {
+ cameraSelectorVeye.visible=true
+ cameraSelectorArducam.visible=false
+ }
+
+ }
+ }
+ ComboBox {
+
+ id: cameraSelectorArducam
+ visible:false
+ textRole: "displayText"
+ model: ListModel {
+ ListElement { displayText: "None" }
+ ListElement { displayText: "SkyMaster HDR 708" }
+ ListElement { displayText: "IMX462 Mini" }
+ ListElement { displayText: "SkyVision Pro 519" }
+ ListElement { displayText: "IMX462" }
+ ListElement { displayText: "IMX477" }
+ ListElement { displayText: "IMX519" }
+ ListElement { displayText: "IMX327" }
+ ListElement { displayText: "IMX290" }
+ ListElement { displayText: "CUSTOM" }
+ }
+ Layout.minimumWidth: 200
+ Layout.maximumHeight: 40
+ onCurrentIndexChanged: {
+ var selectedCamera = model.get(currentIndex).displayText;
+ if (selectedCamera !== "None") {
+ // Check if it's one of the specified values
+ if (["SkyMaster HDR 708", "IMX462 Mini", "SkyVision Pro 519"].indexOf(selectedCamera) === -1) {
+ camera = selectedCamera;
+ } else {
+ // Handle the specified values differently
+ if (selectedCamera === "SkyMaster HDR 708") {
+ camera = "IMX708";
+ } else if (selectedCamera === "IMX462 Mini") {
+ camera = "ARDUCAM";
+ } else if (selectedCamera === "SkyVision Pro 519") {
+ camera = "IMX519";
+ }
}
+ }
+ }
+ }
+ ComboBox {
+
+ id: cameraSelectorVeye
+ visible:false
+ textRole: "displayText"
+ model: ListModel {
+ ListElement { displayText: "None" }
+ ListElement { displayText: "CAM2M" }
+ ListElement { displayText: "CSIMX307" }
+ ListElement { displayText: "CSSC137" }
+ ListElement { displayText: "MVCAM" }
+ }
+ Layout.minimumWidth: 200
+ Layout.maximumHeight: 40
+ onCurrentIndexChanged: {
+ var selectedCamera = model.get(currentIndex).displayText;
+ if (selectedCamera !== "None") {
+ console.debug(selectedCamera)
+ }
+ }
+ }
+
+ }
+ }
+ GroupBox {
+ title: qsTr("Bind Settings")
+ Layout.fillWidth: true
+ visible: true
+
+ ColumnLayout {
+ spacing: 0
+
+ Text {
+ text: qsTr(" Must match on Air and Ground!")
+ font.pixelSize: 12
+ color: "gray"
+ Layout.alignment: Qt.AlignHCenter
+ }
+
+ ImCheckBox {
+ id: bndKey
+ text: qsTr("Set binding phrase")
+ checkable: true
+ onCheckedChanged: {
+ if (!checked) {
+ bindPhrase=""
+ bndPhrase.visible=false;
+ }
+ bndPhrase.visible=true;
+ }
+ }
+ TextField {
+ id: bndPhrase
+ visible: bindPhrase_used
+ maximumLength:10
+ width:10
+ color: bndPhrase.text.length >= 4 ? "green" : "red"
+ text: bindPhrase
+ selectByMouse: true
+ placeholderTextColor: "blue"
+ placeholderText: "openhd"
+ onTextChanged: {
+ bindPhrase = bndPhrase.text;
+ }
+
+ }
+ }
+ }
- Layout.fillWidth: true
-
- ColumnLayout {
- spacing: -10
-
- ImCheckBox {
- id: setAir
- text: qsTr("Set SBC to AIR")
- onCheckedChanged: {
- if (checked) {
- setGround.checked = false
- bootAsAir();
- var fileName = imageWriter.srcFileName();
- if (fileName.includes("pi")) {
- imageWriter.setSetting("SBC", "rpi");
- cameraSettingsRpi.visible=false
- cameraSettingsRock5.visible=false
- }
- if (fileName.includes("rock")) {
- cameraSettingsRock5.visible=true
- cameraSettingsRpi.visible=false
- }
- if (fileName.includes("rock5a")) {
- imageWriter.setSetting("SBC", "rock-5a");
- }
- if (fileName.includes("rock5b")) {
- imageWriter.setSetting("SBC", "rock-5b");
- }
- }
- }
- }
- ImCheckBox {
- id: setGround
- text: qsTr("Set SBC to GROUND")
- onCheckedChanged: {
- if (checked) {
- setAir.checked = false
- bootAsGround();
- cameraSettingsRpi.visible=false
- cameraSettingsRock5.visible=false
- }
- }
- }
- ImCheckBox {
- id: setIp
- visible: false
- text: qsTr("DUMMY setting")
- onCheckedChanged: {
- if (checked) {
- //setGround.checked = false
- //bootAsIp();
- }
- }
- }
- }
- }
- GroupBox {
- title: qsTr("Camera Settings")
- id: cameraSettingsRock5
- Layout.fillWidth: true
- visible: false
-
- ColumnLayout {
- spacing: -10
- // Add a ComboBox to select between cameras
- ComboBox {
- id: cameraSelectorRock
- textRole: "displayText"
- model: ListModel {
- ListElement { displayText: "NONE" }
- ListElement { displayText: "IMX415" }
- ListElement { displayText: "IMX462" }
- ListElement { displayText: "HDMI" }
- }
- onCurrentIndexChanged: {
- var selectedCamera = model.get(currentIndex).displayText;
- if (selectedCamera !== "NONE") {
- imageWriter.setSetting("camera", selectedCamera);
- }
- }
- }
- }
- }
- GroupBox {
- title: qsTr("Camera Settings")
- id: cameraSettingsRpi
- Layout.fillWidth: true
- visible:false
- ColumnLayout {
- spacing: -10
- // Add a ComboBox to select between cameras
- ComboBox {
- id: cameraSelectorRpi
- textRole: "displayText"
- width:300
- model: ListModel {
- ListElement { displayText: "NONE" }
- ListElement { displayText: "IMX708" }
- ListElement { displayText: "IMX462" }
- ListElement { displayText: "IMX519" }
- ListElement { displayText: "IMX477" }
- ListElement { displayText: "IMX219" }
- }
- onCurrentIndexChanged: {
- var selectedCamera = model.get(currentIndex).displayText;
- if (selectedCamera !== "NONE") {
- imageWriter.setSetting("camera", selectedCamera);
- }
- }
- }
- }
- }
- GroupBox {
- title: qsTr("Bind Settings")
- Layout.fillWidth: true
- visible: true
-
- ColumnLayout {
- spacing: -10
-
- ImCheckBox {
- id: bndKey
- text: qsTr("Set binding phrase")
- checkable: false
- onCheckedChanged: {
- cloudinit=(bndPhrase.text)
- }
- }
- TextField {
- id: bndPhrase
- maximumLength:10
- width:10
- color: bndPhrase.text.length >= 4 ? "green" : "red"
- text: imageWriter.getValue("bindPhrase")
- selectByMouse: true
- placeholderTextColor: "blue"
- placeholderText: "OpenHD"
- onTextChanged: {
- bndKey.checkable = bndPhrase.text.length >= 4
- }
-
- }
- }
- }
-
- GroupBox {
- title: qsTr("Imager settings")
- Layout.fillWidth: true
-
- ColumnLayout {
- spacing: -10
-
- ImCheckBox {
- id: chkBeep
- text: qsTr("Play sound when finished")
+ GroupBox {
+ title: qsTr("Misc Settings")
+ id: miscSettings
+ Layout.fillWidth: true
+ ColumnLayout {
+ spacing: -10
+
+ ImCheckBox {
+ id: setDebug
+ visible: true
+ text: qsTr("Debug Mode")
+ onCheckedChanged: {
+ if (checked) {
+ mode = "debug";
+ }
+ }
}
- ImCheckBox {
- id: chkEject
- text: qsTr("Do not flash config files")
+
+ ImCheckBox {
+ id: setWifiHotspot
+ visible: false
+ text: qsTr("WifiHotspot")
+ onCheckedChanged: {
+ if (checked) {
+ hotSpot = "wifi";
+ }
+ }
+ }
}
}
}
- }
}
RowLayout {
@@ -258,7 +324,6 @@ Popup {
text: qsTr("SAVE")
onClicked: {
applySettings()
- saveSettings()
popup.close()
}
Material.foreground: activeFocus ? "#d1dcfb" : "#ffffff"
@@ -270,42 +335,73 @@ Popup {
}
function initialize() {
- chkBeep.checked = imageWriter.getBoolSetting("beep")
- chkEject.checked = false
var settings = imageWriter.getSavedCustomizationSettings()
- if (Object.keys(settings).length) {
- comboSaveSettings.currentIndex = 1
- hasSavedSettings = true
- }
- var tz;
- if (imageWriter.isEmbeddedMode()) {
- /* For some reason there is no password mask character set by default on Embedded edition */
- var bulletCharacter = String.fromCharCode(0x2022);
- fieldUserPassword.passwordCharacter = bulletCharacter;
- fieldWifiPassword.passwordCharacter = bulletCharacter;
+ // initialise settings
+ bootType = imageWriter.getValue("bootType")
+ fileName = imageWriter.srcFileName();
+ sbc = imageWriter.getValue("sbc")
+ camera= imageWriter.getValue("camera")
+ bindPhrase = imageWriter.getValue("bindPhrase")
+ mode = imageWriter.getValue("mode")
+ hotSpot = imageWriter.getValue("hotSpot")
+ beep = imageWriter.getBoolSetting("beep")
+ eject = imageWriter.getBoolSetting("eject")
+
+ // set session settings
+ if (bootType==="Air") {
+ setAir.checked=true
+ setGround.checked=false
+ }
+ else if (bootType==="Ground") {
+ setAir.checked=false
+ setGround.checked=true
+ }
+ if (bindPhrase) {
+ bndKey.checked=true
+ }
+ else{
+ bndKey.checked=false
+ }
+ if (mode) {
+ setDebug.checked=true
+ }
+ else{
+ setDebug.checked=false
+ }
+ if (hotSpot) {
+ setWifiHotspot.checked=true
+ }
+ else{
+ setWifiHotspot.checked=false
}
- initialized = true
- }
-
- //Consti10
- function check_air_or_ground_set_by_user(){
- console.log("check_air_or_ground_set_by_user,current: ground:"+openHDGround+" air:"+openHDAir);
- //return openHDGround.length>=1;
- return openHDAir.length>=1;
- }
- function check_air(){
- if (openHDAir == "air") {
- console.log("Image type:"+openHDAir);
- return openHDAir.length>=1;
- }
- }
- function check_ground(){
- if (openHDAir == "ground") {
- console.log("Image type:"+openHDAir);
- return openHDAir.length>=1;
- }
+ //get SBC
+ imageWriter.setSetting("fileName", fileName)
+ console.log(fileName)
+ if (fileName.includes("pi")) {
+ imageWriter.setSetting("sbc", "rpi");
+ rpi=true;
+ rock=false;
+ }
+ else if (fileName.includes("rock5a")) {
+ imageWriter.setSetting("sbc", "rock-5a");
+ rpi=false;
+ rock=true;
+ }
+ else if (fileName.includes("rock5b")) {
+ imageWriter.setSetting("sbc", "rock-5b");
+ rpi=false;
+ rock=true;
+ }
+ else if (fileName.includes("zero3w")) {
+ imageWriter.setSetting("sbc", "Radxa-Zero-3W");
+ rpi=false;
+ rock=true;
+ }
+ else{
+ imageWriter.setSetting("sbc", "unknown");
+ }
}
function openPopup() {
@@ -317,66 +413,17 @@ Popup {
popupbody.forceActiveFocus()
}
- function addCmdline(s) {
- cmdline += " "+s
- }
- function addConfig(s) {
- config += s+""
- }
- function bootAsGround(s) {
- openHDGround += s+""
- }
- function bootAsAir(s) {
- openHDAir += s+""
- }
- function bootAsIp(s) {
- openHDIp += s+""
- }
- //
- function escapeshellarg(arg) {
- return "'"+arg.replace(/'/g, "\\'")+"'"
- }
-
function applySettings()
{
- openHDGround = ""
- openHDAir = ""
- openHDIp = ""
-
+ imageWriter.setSetting("bootType", bootType)
+ imageWriter.setSetting("camera", camera)
+ imageWriter.setSetting("bindPhrase" , bindPhrase)
+ imageWriter.setSetting("mode", mode)
+ imageWriter.setSetting("hotSpot" , hotSpot)
+ imageWriter.setSetting("beep", beep)
+ imageWriter.setSetting("eject", eject)
+ imageWriter.setSetting("useSettings", useSettings)
- if (setAir.checked) {
- bootAsAir("air")
- }
- if (setIp.checked) {
- bootAsAir("IP")
- }
- if (setGround.checked) {
- bootAsAir("ground")
- }
-
- if (openHDGround.length) {
- openHDGround = ""+openHDGround
- }
-
- if (openHDAir.length) {
- openHDAir = ""+openHDAir
- }
-
- if (cloudinitwrite !== "") {
- addCloudInit("write_files:\n"+cloudinitwrite+"\n")
- }
-
- if (cloudinitrun !== "") {
- addCloudInit("runcmd:\n"+cloudinitrun+"\n")
- }
-
- imageWriter.setImageCustomization(config, cmdline, openHDAir, openHDGround, cloudinit, cloudinitnetwork)
- }
-
- function saveSettings()
- {
- imageWriter.setSetting("beep", chkBeep.checked)
- imageWriter.setSetting("eject", chkEject.checked)
}
}
diff --git a/src/cli.cpp b/src/cli.cpp
index 7a26f834a..2ff8c1ad4 100644
--- a/src/cli.cpp
+++ b/src/cli.cpp
@@ -29,9 +29,9 @@ Cli::Cli(int &argc, char *argv[]) : QObject(nullptr)
}
#endif
_app = new QCoreApplication(argc, argv);
- _app->setOrganizationName("Raspberry Pi");
- _app->setOrganizationDomain("raspberrypi.org");
- _app->setApplicationName("Imager");
+ _app->setOrganizationName("OpenHD");
+ _app->setOrganizationDomain("openhdfpv.org");
+ _app->setApplicationName("ImageWriter");
_imageWriter = new ImageWriter;
connect(_imageWriter, &ImageWriter::success, this, &Cli::onSuccess);
connect(_imageWriter, &ImageWriter::error, this, &Cli::onError);
diff --git a/src/config.h b/src/config.h
index 5d44da651..a635e4c44 100644
--- a/src/config.h
+++ b/src/config.h
@@ -8,7 +8,7 @@
/* Repository URL */
-#define OSLIST_URL "https://github.com/OpenHD/OpenHD-ImageWriter/releases/download/Json/OpenHD-Images.json"
+#define OSLIST_URL "https://github.com/OpenHD/OpenHD-ImageWriter/releases/download/Json/OpenHD-download-index.json"
/* Time synchronization URL (only used on eglfs QPA platform, URL must be HTTP) */
#define TIME_URL "https://github.com/OpenHD/OpenHD-ImageWriter/releases/download/Json/OpenHD-Images.json?time_synchronization"
diff --git a/src/downloadthread.cpp b/src/downloadthread.cpp
index 7ee17feb3..03b45f08f 100644
--- a/src/downloadthread.cpp
+++ b/src/downloadthread.cpp
@@ -33,6 +33,8 @@ using namespace std;
QByteArray DownloadThread::_proxy;
int DownloadThread::_curlCount = 0;
+QSettings settings;
+
DownloadThread::DownloadThread(const QByteArray &url, const QByteArray &localfilename, const QByteArray &expectedHash, QObject *parent) :
QThread(parent), _startOffset(0), _lastDlTotal(0), _lastDlNow(0), _verifyTotal(0), _lastVerifyNow(0), _bytesWritten(0), _lastFailureOffset(0), _sectorsStart(-1), _url(url), _filename(localfilename), _expectedHash(expectedHash),
_firstBlock(nullptr), _cancelled(false), _successful(false), _verifyEnabled(false), _cacheEnabled(false), _lastModified(0), _serverTime(0), _lastFailureTime(0),
@@ -41,9 +43,7 @@ DownloadThread::DownloadThread(const QByteArray &url, const QByteArray &localfil
if (!_curlCount)
curl_global_init(CURL_GLOBAL_DEFAULT);
_curlCount++;
-
- QSettings settings;
- _ejectEnabled = settings.value("eject", true).toBool();
+ //_ejectEnabled = settings.value("eject", true).toBool();
}
DownloadThread::~DownloadThread()
@@ -111,8 +111,16 @@ QByteArray DownloadThread::_fileGetContentsTrimmed(const QString &filename)
bool DownloadThread::_openAndPrepareDevice()
{
+ QSettings settings_;
+ std::cout << "_____________________________-DEBUG-_______________________________________" << std::endl;
+
emit preparationStatusUpdate(tr("opening drive"));
+ if (_filename.startsWith("/dev/update-"))
+ {
+ std::cout << "running update procedure without modifying the image" << std::endl;
+ }
+
if (_filename.startsWith("/dev/"))
{
unmount_disk(_filename.constData());
@@ -128,6 +136,7 @@ bool DownloadThread::_openAndPrepareDevice()
if (std::regex_match(_filename.constData(), m, windriveregex))
{
+
_nr = QByteArray::fromStdString(m[1]);
if (!_nr.isEmpty()) {
@@ -137,8 +146,8 @@ bool DownloadThread::_openAndPrepareDevice()
proc.start("diskpart");
proc.waitForStarted();
proc.write("select disk "+_nr+"\r\n"
- "clean\r\n"
- "rescan\r\n");
+ "clean\r\n"
+ "rescan\r\n");
proc.closeWriteChannel();
proc.waitForFinished();
@@ -293,9 +302,9 @@ bool DownloadThread::_openAndPrepareDevice()
if (knownsize > emptyMB.size())
{
if (!_file.seek(knownsize-emptyMB.size())
- || !_file.write(emptyMB.data(), emptyMB.size())
- || !_file.flush()
- || !::fsync(_file.handle()))
+ || !_file.write(emptyMB.data(), emptyMB.size())
+ || !_file.flush()
+ || !::fsync(_file.handle()))
{
emit error(tr("Write error while trying to zero out last part of card.
"
"Card could be advertising wrong capacity (possible counterfeit)."));
@@ -418,49 +427,49 @@ void DownloadThread::run()
switch (ret)
{
- case CURLE_OK:
- _successful = true;
- qDebug() << "Download done in" << _timer.elapsed() / 1000 << "seconds";
- _onDownloadSuccess();
- break;
- case CURLE_WRITE_ERROR:
- deleteDownloadedFile();
+ case CURLE_OK:
+ _successful = true;
+ qDebug() << "Download done in" << _timer.elapsed() / 1000 << "seconds";
+ _onDownloadSuccess();
+ break;
+ case CURLE_WRITE_ERROR:
+ deleteDownloadedFile();
#ifdef Q_OS_WIN
- if (_file.errorCode() == ERROR_ACCESS_DENIED)
+ if (_file.errorCode() == ERROR_ACCESS_DENIED)
+ {
+ QString msg = tr("Access denied error while writing file to disk.");
+ QSettings registry("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows Defender\\Windows Defender Exploit Guard\\Controlled Folder Access",
+ QSettings::Registry64Format);
+ if (registry.value("EnableControlledFolderAccess").toInt() == 1)
{
- QString msg = tr("Access denied error while writing file to disk.");
- QSettings registry("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows Defender\\Windows Defender Exploit Guard\\Controlled Folder Access",
- QSettings::Registry64Format);
- if (registry.value("EnableControlledFolderAccess").toInt() == 1)
- {
- msg += "
"+tr("Controlled Folder Access seems to be enabled. Please add both openhdimagewriter.exe and fat32format.exe to the list of allowed apps and try again.");
- }
- _onDownloadError(msg);
+ msg += "
"+tr("Controlled Folder Access seems to be enabled. Please add both openhdimagewriter.exe and fat32format.exe to the list of allowed apps and try again.");
}
- else
+ _onDownloadError(msg);
+ }
+ else
#endif
if (!_cancelled)
_onDownloadError(tr("Error writing file to disk"));
- break;
- case CURLE_ABORTED_BY_CALLBACK:
- deleteDownloadedFile();
- break;
- default:
- deleteDownloadedFile();
- QString errorMsg;
-
- if (!errorBuf[0])
- /* No detailed error message text provided, use standard text for libcurl result code */
- errorMsg += curl_easy_strerror(ret);
- else
- errorMsg += errorBuf;
+ break;
+ case CURLE_ABORTED_BY_CALLBACK:
+ deleteDownloadedFile();
+ break;
+ default:
+ deleteDownloadedFile();
+ QString errorMsg;
+
+ if (!errorBuf[0])
+ /* No detailed error message text provided, use standard text for libcurl result code */
+ errorMsg += curl_easy_strerror(ret);
+ else
+ errorMsg += errorBuf;
- char *ipstr;
- if (curl_easy_getinfo(_c, CURLINFO_PRIMARY_IP, &ipstr) == CURLE_OK && ipstr && ipstr[0])
- errorMsg += QString(" - Server IP: ")+ipstr;
+ char *ipstr;
+ if (curl_easy_getinfo(_c, CURLINFO_PRIMARY_IP, &ipstr) == CURLE_OK && ipstr && ipstr[0])
+ errorMsg += QString(" - Server IP: ")+ipstr;
- _onDownloadError(tr("Error downloading: %1").arg(errorMsg));
+ _onDownloadError(tr("Error downloading: %1").arg(errorMsg));
}
}
@@ -730,11 +739,12 @@ void DownloadThread::_writeComplete()
QThread::sleep(1);
_filename.replace("/dev/rdisk", "/dev/disk");
#endif
+ bool useSettings = settings.value("useSettings", true).toBool();
- if (_ejectEnabled && _config.isEmpty() && _cmdline.isEmpty() && !_openHDGround.isEmpty() && _openHDAir.isEmpty())
+ if (!useSettings)
eject_disk(_filename.constData());
- if (!_config.isEmpty() || !_cmdline.isEmpty()|| !_openHDGround.isEmpty() || !_openHDAir.isEmpty())
+ if (useSettings)
{
if (!_customizeImage())
return;
@@ -836,17 +846,6 @@ qint64 DownloadThread::_sectorsWritten()
return -1;
}
-void DownloadThread::setImageCustomization(const QByteArray &config, const QByteArray &cmdline, const QByteArray &openHDGround, const QByteArray &openHDAir, const QByteArray &cloudinit, const QByteArray &cloudInitNetwork, const QByteArray &initFormat)
-{
- _config = config;
- _cmdline = cmdline;
- _openHDAir = openHDAir;
- _openHDGround = openHDGround;
- _cloudinit = cloudinit;
- _cloudinitNetwork = cloudInitNetwork;
- _initFormat = initFormat;
-}
-
bool DownloadThread::_customizeImage()
{
QString folder;
@@ -888,8 +887,8 @@ bool DownloadThread::_customizeImage()
proc.start("diskpart");
proc.waitForStarted();
proc.write("select disk "+_nr+"\r\n"
- "select partition 1\r\n"
- "assign\r\n");
+ "select partition 1\r\n"
+ "assign\r\n");
proc.closeWriteChannel();
proc.waitForFinished();
qDebug() << proc.readAll();
@@ -922,12 +921,12 @@ bool DownloadThread::_customizeImage()
if (::access(devlower.constData(), W_OK) != 0)
{
/* Not running as root, try to outsource mounting to udisks2 */
- #ifndef QT_NO_DBUS
+#ifndef QT_NO_DBUS
UDisks2Api udisks2;
QString mp = udisks2.mountDevice(fatpartition);
if (!mp.isEmpty())
mountpoints.push_back(mp.toStdString());
- #endif
+#endif
}
else
{
@@ -1074,151 +1073,115 @@ bool DownloadThread::_customizeImage()
}
}
- if (!_cloudinit.isEmpty() && _initFormat == "systemd")
- {
- QFile key(folder+"/openhd"+"/password.txt");
- if (key.open(key.WriteOnly) && key.write(_cloudinit) == _cloudinit.length())
- {
- qDebug() << "Key:" << key;
- QSettings settings;
- settings.setValue("bindPhrase", _cloudinit);
- settings.sync();
- qDebug() << "SavedSettings" << settings.value("bindPhrase").toString();
- }
- else
- {
- emit error(tr("Error creating key.txt on FAT partition"));
- return false;
- }
- }
-
- if (!_openHDAir.isEmpty() && _initFormat == "systemd")
- {
-
- /* Something is horibly wrong here .. I'll hack it right now, but this should be fixed in later releases
+ /* Here is the start of the OpenHD settings routine
*/
-
- qDebug() << "isAir";
- QFile d(folder+"/openhd"+"/ground.txt");
- d.remove();
- QFile f(folder+"/openhd"+"/air.txt");
- if (f.open(f.WriteOnly) && f.write(_openHDAir) == _openHDAir.length())
- {
- qDebug() << "folder:" << f;
- }
- else
- {
- emit error(tr("Error creating air.txt on FAT partition"));
- return false;
- }
-
- }
-
- if (!_openHDGround.isEmpty() && _initFormat == "systemd")
- {
- QSettings settings;
- QString cameraValue = settings.value("camera").toString();
- QString sbcValue = settings.value("SBC").toString();
-
-
- qDebug() << "_openHDGround" << _openHDGround ;
- if (_openHDGround == "IP")
- {
- QFile Ip(folder+"/openhd"+"/force_ip_camera.txt");
- if (Ip.open(Ip.WriteOnly) && Ip.write(_openHDGround) == _openHDGround.length())
+ if (settings.value("useSettings", true).toBool()) {
+ qDebug() << "Writing OpenHD-Settings";
+ QSettings settings_;
+
+
+ QString cameraValue = settings_.value("camera").toString();
+ QString sbcValue = settings_.value("sbc").toString();
+ QString modeValue = settings_.value("mode").toString();
+ QString bindPhraseSaved = settings_.value("bindPhrase").toString();
+ QString hotspot = settings_.value("hotspot").toString();
+ QString bootType = settings_.value("bootType").toString();
+
+ if (!bindPhraseSaved.isEmpty()){
+ qDebug() << "BindPhrase found" << bindPhraseSaved;
+ QFile Bp(folder+"/openhd"+"/password.txt");
+ if (Bp.open(QIODevice::WriteOnly))
{
- Ip.close();
+ // Convert bindPhrase to UTF-8 bytes and write to the file
+ QByteArray bindPhraseBytes = bindPhraseSaved.toUtf8();
+ qint64 bytesWritten = Bp.write(bindPhraseBytes);
+ Bp.close();
+
+ if (bytesWritten == bindPhraseBytes.length())
+ {
+ // Successfully wrote the password to the file
+ }
+ else
+ {
+ emit error(tr("Error writing password to password.txt on FAT partition"));
+ return false;
+ }
}
else
{
- emit error(tr("Error creating force_ip_camera.txt on FAT partition"));
+ emit error(tr("Error creating password.txt on FAT partition"));
return false;
}
- if (!sbcValue.isEmpty()) {
- QFile sbc(folder+"/openhd"+"/"+sbcValue+".txt");
- if (sbc.open(sbc.WriteOnly) && sbc.write(_openHDGround) == _openHDGround.length())
- {
+ }
+ if (!sbcValue.isEmpty()){
+ QFile sbc(folder + "/openhd" + "/" + sbcValue + ".txt");
+ if (sbc.open(QIODevice::WriteOnly)) {
+ QTextStream stream(&sbc);
sbc.close();
- }
- else
- {
- emit error(tr("Error creating sbc file on FAT partition"));
+ } else {
+ emit error(tr("This Image does not support settings, yet !"));
return false;
}
- }
}
- if (_openHDGround == "air")
- {
- QFile Air(folder+"/openhd"+"/air.txt");
- if (Air.open(Air.WriteOnly) && Air.write(_openHDGround) == _openHDGround.length())
- {
- Air.close();
- }
- else
- {
- emit error(tr("Error creating air.txt on FAT partition"));
+ if (!hotspot.isEmpty()){
+ QFile Hs(folder+"/openhd"+"/wifi_hotspot.txt");
+ if (Hs.open(QIODevice::WriteOnly)) {
+ QTextStream stream(&Hs);
+ Hs.close();
+ } else {
+ emit error(tr("Error creating hotspot.txt file on FAT partition"));
return false;
}
- if (!cameraValue.isEmpty()) {
- QFile Camera(folder+"/openhd"+"/"+cameraValue+".txt");
- if (Camera.open(Camera.WriteOnly) && Camera.write(_openHDGround) == _openHDGround.length())
- {
- Camera.close();
- }
- else
- {
- emit error(tr("Error creating Camera file on FAT partition"));
+ }
+ if (modeValue == "debug"){
+ QFile Db(folder+"/openhd"+"/debug.txt");
+ if (Db.open(QIODevice::WriteOnly)) {
+ QTextStream stream(&Db);
+ Db.close();
+ } else {
+ emit error(tr("Error creating debug.txt file on FAT partition"));
return false;
}
- }
- if (!sbcValue.isEmpty()) {
+ }
+ if (!sbcValue.isEmpty()) {
QFile sbc(folder+"/openhd"+"/"+sbcValue+".txt");
- if (sbc.open(sbc.WriteOnly) && sbc.write(_openHDGround) == _openHDGround.length())
- {
+ if (sbc.open(QIODevice::WriteOnly)) {
+ QTextStream stream(&sbc);
sbc.close();
- }
- else
- {
- emit error(tr("Error creating sbc file on FAT partition"));
+ } else {
+ emit error(tr("This Image does not support settings, yet !"));
return false;
}
- }
}
- if (_openHDGround == "ground")
- {
- QFile Ground(folder+"/openhd"+"/ground.txt");
- if (Ground.open(Ground.WriteOnly) && Ground.write(_openHDGround) == _openHDGround.length())
- {
- Ground.close();
- }
- else
- {
- emit error(tr("Error creating ground.txt on FAT partition"));
+ if (bootType == "Air"){
+ QFile air(folder+"/openhd"+"/air.txt");
+ if (air.open(QIODevice::WriteOnly)) {
+ QTextStream stream(&air);
+ air.close();
+ } else {
+ emit error(tr("Error creating air.txt file on FAT partition"));
return false;
}
}
- }
-
- if (!_cmdline.isEmpty())
- {
- QByteArray cmdline;
-
- QFile f(folder+"/cmdline.txt");
- if (f.exists() && f.open(f.ReadOnly))
- {
- cmdline = f.readAll().trimmed();
- f.close();
- }
-
- cmdline += _cmdline;
- if (f.open(f.WriteOnly) && f.write(cmdline) == cmdline.length())
- {
- f.close();
+ else if(bootType == "Ground"){
+ QFile ground(folder+"/openhd"+"/ground.txt");
+ if (ground.open(QIODevice::WriteOnly)) {
+ QTextStream stream(&ground);
+ ground.close();
+ } else {
+ emit error(tr("Error creating air.txt file on FAT partition"));
+ return false;
+ }
}
- else
- {
- emit error(tr("Error writing to cmdline.txt on FAT partition"));
- return false;
+ if (!cameraValue.isEmpty()) {
+ QFile cam(folder+"/openhd"+"/"+cameraValue+".txt");
+ if (cam.open(QIODevice::WriteOnly)) {
+ QTextStream stream(&cam);
+ cam.close();
+ } else {
+ emit error(tr("Error creating Camera file on FAT partition"));
+ return false;
+ }
}
}
@@ -1229,10 +1192,10 @@ bool DownloadThread::_customizeImage()
{
if (::access(devlower.constData(), W_OK) != 0)
{
- #ifndef QT_NO_DBUS
+#ifndef QT_NO_DBUS
UDisks2Api udisks2;
udisks2.unmountDrive(devlower);
- #endif
+#endif
}
else
{
diff --git a/src/downloadthread.h b/src/downloadthread.h
index a7eb0a77b..c6ae624b5 100644
--- a/src/downloadthread.h
+++ b/src/downloadthread.h
@@ -109,12 +109,7 @@ class DownloadThread : public QThread
*/
void setInputBufferSize(int len);
- /*
- * Enable image customization
- */
- void setImageCustomization(const QByteArray &config, const QByteArray &cmdline, const QByteArray &openHDAir, const QByteArray &openHDGround, const QByteArray &cloudinit, const QByteArray &cloudinitNetwork, const QByteArray &initFormat);
-
- /*
+ /*
* Thread safe download progress query functions
*/
uint64_t dlNow();
@@ -165,7 +160,7 @@ class DownloadThread : public QThread
std::atomic _lastDlTotal, _lastDlNow, _verifyTotal, _lastVerifyNow, _bytesWritten;
std::uint64_t _lastFailureOffset;
qint64 _sectorsStart;
- QByteArray _url, _useragent, _buf, _filename, _lastError, _expectedHash, _config, _cmdline, _openHDAir, _openHDGround, _cloudinit, _cloudinitNetwork, _initFormat;
+ QByteArray _url, _useragent, _buf, _filename, _lastError, _expectedHash, _config, _cmdline, _initFormat;
char *_firstBlock;
size_t _firstBlockSize;
static QByteArray _proxy;
diff --git a/src/imagewriter.cpp b/src/imagewriter.cpp
index 55e57df2d..36cc6cfce 100644
--- a/src/imagewriter.cpp
+++ b/src/imagewriter.cpp
@@ -61,6 +61,7 @@
#endif
#include
+#include
ImageWriter::ImageWriter(QObject *parent)
@@ -299,7 +300,6 @@ void ImageWriter::startWrite()
connect(_thread, SIGNAL(preparationStatusUpdate(QString)), SLOT(onPreparationStatusUpdate(QString)));
_thread->setVerifyEnabled(_verifyEnabled);
_thread->setUserAgent(QString("Mozilla/5.0 rpi-imager/%1").arg(constantVersion()).toUtf8());
- _thread->setImageCustomization(_config, _cmdline, _openHDAir, _openHDGround, _cloudinit, _cloudinitNetwork, _initFormat);
if (!_expectedHash.isEmpty() && _cachedFileHash != _expectedHash && _cachingEnabled)
{
@@ -1029,19 +1029,6 @@ void ImageWriter::setSetting(const QString &key, const QVariant &value)
}
-void ImageWriter::setImageCustomization(const QByteArray &config, const QByteArray &cmdline, const QByteArray &openHDAir, const QByteArray &openHDGround, const QByteArray &cloudinit, const QByteArray &cloudinitNetwork)
-{
- _config = config;
- _cmdline = cmdline;
- _openHDAir = openHDAir;
- _openHDGround = openHDGround;
- _cloudinit = cloudinit;
- _cloudinitNetwork = cloudinitNetwork;
-
- qDebug() << "boot as:" << openHDAir;
- qDebug() << "binding phrase:" << cloudinit;
-}
-
QString ImageWriter::crypt(const QByteArray &password)
{
QByteArray salt = "$5$";
@@ -1062,17 +1049,6 @@ QString ImageWriter::pbkdf2(const QByteArray &psk, const QByteArray &ssid)
return QPasswordDigestor::deriveKeyPbkdf2(QCryptographicHash::Sha1, psk, ssid, 4096, 32).toHex();
}
-void ImageWriter::setSavedCustomizationSettings(const QVariantMap &map)
-{
- _settings.beginGroup("imagecustomization");
- _settings.remove("");
- const QStringList keys = map.keys();
- for (const QString &key : keys) {
- _settings.setValue(key, map.value(key));
- }
- _settings.endGroup();
-}
-
QVariantMap ImageWriter::getSavedCustomizationSettings()
{
QVariantMap result;
diff --git a/src/imagewriter.h b/src/imagewriter.h
index b2da74b78..ef5a0697f 100644
--- a/src/imagewriter.h
+++ b/src/imagewriter.h
@@ -105,8 +105,6 @@ class ImageWriter : public QObject
Q_INVOKABLE bool getBoolSetting(const QString &key);
Q_INVOKABLE QString getValue(const QString &key);
Q_INVOKABLE void setSetting(const QString &key, const QVariant &value);
- Q_INVOKABLE void setImageCustomization(const QByteArray &config, const QByteArray &cmdline, const QByteArray &openHDAir, const QByteArray &openHDGround, const QByteArray &cloudinit, const QByteArray &cloudinitNetwork);
- Q_INVOKABLE void setSavedCustomizationSettings(const QVariantMap &map);
Q_INVOKABLE QVariantMap getSavedCustomizationSettings();
Q_INVOKABLE void clearSavedCustomizationSettings();
Q_INVOKABLE bool hasSavedCustomizationSettings();
@@ -158,7 +156,7 @@ protected slots:
protected:
QUrl _src, _repo;
QString _dst, _cacheFileName, _parentCategory, _osName, _currentLang, _currentLangcode, _currentKeyboard;
- QByteArray _expectedHash, _cachedFileHash, _cmdline, _config, _openHDAir, _openHDGround, _cloudinit, _cloudinitNetwork, _initFormat;
+ QByteArray _expectedHash, _cachedFileHash, _cmdline, _config, _initFormat;
quint64 _downloadLen, _extrLen, _devLen, _dlnow, _verifynow;
DriveListModel _drivelist;
QQmlApplicationEngine *_engine;
diff --git a/src/linux/openhdimagewriter.metainfo.xml.in b/src/linux/openhdimagewriter.metainfo.xml.in
index 7fea97b14..06214660a 100644
--- a/src/linux/openhdimagewriter.metainfo.xml.in
+++ b/src/linux/openhdimagewriter.metainfo.xml.in
@@ -3,11 +3,11 @@
org.raspberrypi.openhdimagewriter
CC0-1.0
Apache-2.0
- OpenHD Pi Imager
+ OpenHD Pi ImageWriter
OpenHD imaging utility
- OpenHD Imager downloads a .JSON file from the OpenHD
+ OpenHD ImageWriter downloads a .JSON file from the OpenHD
website with a list of all current download options, ensuring you are
always installing the most up-to-date version.
@@ -21,7 +21,7 @@
to the SD card.
- During this process, OpenHD Imager also caches the downloaded
+ During this process, OpenHD ImageWriter also caches the downloaded
operating system image – that is to say, it saves a local copy on your
computer, so you can program additional SD cards without having to
download the file again and includes OpenHD settings into the image.
diff --git a/src/main.qml b/src/main.qml
index d68ec2886..86364b55b 100644
--- a/src/main.qml
+++ b/src/main.qml
@@ -8,6 +8,7 @@ import QtQuick.Window 2.2
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.0
import QtQuick.Controls.Material 2.2
+import Qt.labs.settings 1.0
import "qmlcomponents"
@@ -24,7 +25,7 @@ ApplicationWindow {
minimumHeight: imageWriter.isEmbeddedMode() ? -1 : 420
//maximumHeight: imageWriter.isEmbeddedMode() ? -1 : 420
- title: qsTr("OpenHD Imager v%1").arg(imageWriter.constantVersion())
+ title: qsTr("OpenHD ImageWriter v%1").arg(imageWriter.constantVersion())
FontLoader {id: roboto; source: "fonts/Roboto-Regular.ttf"}
FontLoader {id: robotoLight; source: "fonts/Roboto-Light.ttf"}
@@ -55,6 +56,172 @@ ApplicationWindow {
}
}
+ Popup {
+ id: detailsPopup
+ x: 75
+ y: (parent.height - height) / 2
+ width: parent.width - 150
+ height: parent.implicitHeight + 275
+ padding: 0
+ modal: true
+ property bool objectVisible: false
+ visible: objectVisible
+
+ Rectangle {
+ color: "#f5f5f5"
+ anchors.right: parent.right
+ anchors.top: parent.top
+ height: 35
+ width: parent.width
+ }
+ Rectangle {
+ color: "#afafaf"
+ width: parent.width
+ y: 35
+ implicitHeight: 1
+ }
+ Settings {
+ id: appSettings
+ }
+ Text {
+ id: msgx
+ text: "X"
+ anchors.right: parent.right
+ anchors.top: parent.top
+ anchors.rightMargin: 25
+ anchors.topMargin: 10
+ font.family: roboto.name
+ font.bold: true
+
+ MouseArea {
+ anchors.fill: parent
+ cursorShape: Qt.PointingHandCursor
+ onClicked: {
+ detailsPopup.close()
+ }
+ }
+ }
+
+ ColumnLayout {
+ spacing: 20
+ anchors.fill: parent
+
+ Text {
+ id: detailsPopupHeader
+ text: "List of applied settings and variables"
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ Layout.fillWidth: true
+ font.family: roboto.name
+ font.bold: true
+ }
+ Button{
+ id:refresh
+ visible:false
+ text: "button"
+ onClicked: {
+ console.log(imageWriter.getValue("fileName"))
+ }
+ }
+
+ ColumnLayout {
+ id: detailsArea
+ spacing: 10
+ Layout.alignment: Qt.AlignVCenter
+ Layout.topMargin: -30
+ Layout.leftMargin: 20
+
+ RowLayout {
+ Text {
+ text: "Image Name:"
+ font.bold: true
+ }
+
+ Text {
+ text: {
+ if (typeof optionspopup.fileName !== "undefined" && optionspopup.fileName.length > 45) {
+ return optionspopup.fileName.substring(0, optionspopup.fileName.length - 7);
+ }else if (typeof optionspopup.fileName !== "undefined" && optionspopup.fileName.length > 1){
+ return optionspopup.fileName.substring(0, optionspopup.fileName.length);
+ }else {
+ return "Error";
+ }
+ }
+ font.bold: false
+ color: "grey"
+ }
+ }
+
+
+ RowLayout {
+ Text {
+ text: "sbc:"
+ font.bold: true
+ }
+
+ Text {
+ text: optionspopup.sbc
+ font.bold: false
+ color: "grey"
+
+ }
+ }
+
+ RowLayout {
+ Text {
+ text: "Boot Type:"
+ font.bold: true
+ }
+ Text {
+ text: optionspopup.bootType + " " + optionspopup.mode
+ font.bold: false
+ color: "grey"
+ }
+ }
+
+ RowLayout {
+ Text {
+ text: "Camera:"
+ font.bold: true
+ }
+ Text {
+ text: optionspopup.camera
+ font.bold: false
+ color: "grey"
+ }
+ }
+
+ RowLayout {
+ Text {
+ text: "Bind Phrase:"
+ font.bold: true
+ }
+ Text {
+ text: optionspopup.bindPhrase
+ font.bold: false
+ color: "grey"
+ }
+ }
+ RowLayout {
+ Text {
+ text: "Changelog:"
+ font.bold: true
+ }
+ Text {
+ text: "changelogs"
+ MouseArea {
+ anchors.fill: parent
+ onClicked: Qt.openUrlExternally("https://openhdfpv.org/2.5-evo.html")
+ }
+ font.bold:false
+ color: "grey"
+ }
+ }
+ }
+ }
+ }
+
+
ColumnLayout {
id: bg
spacing: 0
@@ -62,13 +229,24 @@ ApplicationWindow {
Rectangle {
+ Component.onCompleted: {
+ // Reset all saved settings but the bindPhrase
+ imageWriter.setSetting("sbc", "")
+ imageWriter.setSetting("bootType", "")
+ imageWriter.setSetting("fileName", "")
+ imageWriter.setSetting("camera", "")
+ imageWriter.setSetting("mode", "")
+ imageWriter.setSetting("hotSpot" , "")
+ imageWriter.setSetting("beep", "")
+ imageWriter.setSetting("eject", "")
+ }
implicitHeight: window.height/2
ImButton {
padding: 5
id: donatebutton
onClicked: {
- Qt.openUrlExternally("https://opencollective.com/openhd");
+ Qt.openUrlExternally("https://opencollective.com/openhd");
}
visible: true
Accessible.description: qsTr("Donate")
@@ -137,6 +315,16 @@ ApplicationWindow {
onClicked: {
ospopup.open()
osswipeview.currentItem.forceActiveFocus()
+ customizebutton.visible=true
+ // reset all saved settings but the bindPhrase
+ imageWriter.setSetting("sbc", "")
+ imageWriter.setSetting("bootType", "")
+ imageWriter.setSetting("fileName", "")
+ imageWriter.setSetting("camera", "")
+ imageWriter.setSetting("mode", "")
+ imageWriter.setSetting("hotSpot" , "")
+ imageWriter.setSetting("beep", "")
+ imageWriter.setSetting("eject", "")
}
Accessible.ignored: ospopup.visible || dstpopup.visible
Accessible.description: qsTr("Select this button to change the operating system")
@@ -189,7 +377,11 @@ ApplicationWindow {
ImButton {
id: writebutton
+ visible: !updateButton.visible
property var image_name
+ property var use_settings
+ property var bootType
+ property string camera:""
text: qsTr("WRITE")
Layout.minimumHeight: 40
Layout.fillWidth: true
@@ -201,16 +393,52 @@ ApplicationWindow {
return
}
image_name=imageWriter.srcFileName();
- console.log("Image name:"+image_name);
- //Consti10
+ bootType=imageWriter.getValue("bootType");
+ camera=imageWriter.getValue("camera");
if(image_name.includes("configurable")){
- if(!optionspopup.check_air_or_ground_set_by_user()){
+ if(bootType!=="Air" && bootType!=="Ground" ){
console.log("Cannot write yet, air or ground not set yet");
onError("Cannot write yet, air or ground not set yet - please open settings and select air or ground")
return;
- }
- }
+ }
+ }
+ use_settings=imageWriter.getValue("useSettings")
+ if (!optionspopup.initialized && imageWriter.imageSupportsCustomization() && imageWriter.hasSavedCustomizationSettings()) {
+ usesavedsettingspopup.openPopup()
+ } else {
+ confirmwritepopup.askForConfirmation()
+ }
+ }
+ }
+ ImButton {
+ id: updateButton
+ visible:ospopup.visible
+ property var image_name
+ property var use_settings
+ property var bootType
+ property string camera:""
+ text: qsTr("UPDATE")
+ Layout.minimumHeight: 40
+ Layout.fillWidth: true
+ Accessible.ignored: ospopup.visible || dstpopup.visible
+ Accessible.description: qsTr("Select this button to start writing the image")
+ enabled: false
+ onClicked: {
+ if (!imageWriter.readyToWrite()) {
+ return
+ }
+ image_name=imageWriter.srcFileName();
+ bootType=imageWriter.getValue("bootType");
+ camera=imageWriter.getValue("camera");
+ if(image_name.includes("configurable")){
+ if(bootType!=="Air" && bootType!=="Ground" ){
+ console.log("Cannot write yet, air or ground not set yet");
+ onError("Cannot write yet, air or ground not set yet - please open settings and select air or ground")
+ return;
+ }
+ }
+ use_settings=imageWriter.getValue("useSettings")
if (!optionspopup.initialized && imageWriter.imageSupportsCustomization() && imageWriter.hasSavedCustomizationSettings()) {
usesavedsettingspopup.openPopup()
} else {
@@ -218,6 +446,7 @@ ApplicationWindow {
}
}
}
+
}
ColumnLayout {
@@ -272,7 +501,7 @@ ApplicationWindow {
onClicked: {
optionspopup.openPopup()
}
- visible: true
+ visible: false
Accessible.description: qsTr("Select this button to configure Settings")
contentItem: Image {
source: "icons/ic_cog_red.svg"
@@ -384,7 +613,7 @@ ApplicationWindow {
width: parent.width-100
height: parent.height-50
padding: 0
- closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
+ closePolicy: Popup.NoAutoClose
property string categorySelected : ""
// background of title
@@ -580,18 +809,18 @@ ApplicationWindow {
}
Rectangle {
- id: bgrect
- anchors.fill: parent
- color: "#f5f5f5"
- visible: mouseOver && parent.ListView.view.currentIndex !== index
- property bool mouseOver: false
+ id: bgrect
+ anchors.fill: parent
+ color: "#f5f5f5"
+ visible: mouseOver && parent.ListView.view.currentIndex !== index
+ property bool mouseOver: false
}
Rectangle {
- id: borderrect
- implicitHeight: 1
- implicitWidth: parent.width
- color: "#dcdcdc"
- y: parent.height
+ id: borderrect
+ implicitHeight: 1
+ implicitWidth: parent.width
+ color: "#dcdcdc"
+ y: parent.height
}
RowLayout {
@@ -663,11 +892,11 @@ ApplicationWindow {
font.weight: Font.Light
visible: typeof(url) == "string" && url != "" && url != "internal://format"
text: !url ? "" :
- typeof(extract_sha256) != "undefined" && imageWriter.isCached(url,extract_sha256)
- ? qsTr("Cached on your computer")
- : url.startsWith("file://")
- ? qsTr("Local file")
- : qsTr("Online - %1 GB download").arg((image_download_size/1073741824).toFixed(1))
+ typeof(extract_sha256) != "undefined" && imageWriter.isCached(url,extract_sha256)
+ ? qsTr("Cached on your computer")
+ : url.startsWith("file://")
+ ? qsTr("Local file")
+ : qsTr("Online - %1 GB download").arg((image_download_size/1073741824).toFixed(1))
}
ToolTip {
@@ -779,7 +1008,7 @@ ApplicationWindow {
Keys.onReturnPressed: Keys.onSpacePressed(event)
}
- }
+ }
}
}
@@ -800,20 +1029,20 @@ ApplicationWindow {
property string size: model.size
Rectangle {
- id: dstbgrect
- anchors.fill: parent
- color: "#f5f5f5"
- visible: mouseOver && parent.ListView.view.currentIndex !== index
- property bool mouseOver: false
+ id: dstbgrect
+ anchors.fill: parent
+ color: "#f5f5f5"
+ visible: mouseOver && parent.ListView.view.currentIndex !== index
+ property bool mouseOver: false
}
Rectangle {
- id: dstborderrect
- implicitHeight: 1
- implicitWidth: parent.width
- color: "#dcdcdc"
- y: parent.height
+ id: dstborderrect
+ implicitHeight: 1
+ implicitWidth: parent.width
+ color: "#dcdcdc"
+ y: parent.height
}
Row {
@@ -884,14 +1113,13 @@ ApplicationWindow {
MsgPopup {
id: msgpopup
}
-
MsgPopup {
id: quitpopup
continueButton: false
yesButton: true
noButton: true
title: qsTr("Are you sure you want to quit?")
- text: qsTr("OpenHD Imager is still busy.
Are you sure you want to quit?")
+ text: qsTr("OpenHD ImageWriter is still busy.
Are you sure you want to quit?")
onYes: {
Qt.quit()
}
@@ -923,8 +1151,19 @@ ApplicationWindow {
function askForConfirmation()
{
- text = qsTr("All existing data on '%1' will be erased.
Are you sure you want to continue?").arg(dstbutton.text)
+ var bootType=imageWriter.getValue("bootType");
+ if(bootType==="Ground"){
+ text = qsTr("All existing data on %1 will be erased.
This Device will boot as Groundstation!
Are you sure you want to continue?").arg(dstbutton.text)
openPopup()
+ }
+ else if(bootType==="Air"){
+ text = qsTr("All existing data on %1 will be erased.
This Device will boot as Air!
Are you sure you want to continue?").arg(dstbutton.text)
+ openPopup()
+ }
+ else{
+ text = qsTr("All existing data on %1 will be erased.
Are you sure you want to continue?").arg(dstbutton.text)
+ openPopup()
+ }
}
}
@@ -935,7 +1174,7 @@ ApplicationWindow {
noButton: true
property url url
title: qsTr("Update available")
- text: qsTr("There is a newer version of Imager available.
Would you like to visit the website to download it?")
+ text: qsTr("There is a newer version of the ImageWriter is available.
Would you like to visit the website to download it?")
onYes: {
Qt.openUrlExternally(url)
}
@@ -1050,23 +1289,17 @@ ApplicationWindow {
function onSuccess() {
msgpopup.title = qsTr("Image was written successfully!")
- if (osbutton.text === qsTr("Erase"))
- msgpopup.text = qsTr("%1 has been erased
You can now remove the SD card from the reader").arg(dstbutton.text)
+ if (osbutton.text === qsTr("Erase"))
+ msgpopup.text = qsTr("%1 has been erased
You can now remove the SD card from the reader").arg(dstbutton.text)
else if (imageWriter.isEmbeddedMode()) {
//msgpopup.text = qsTr("%1 has been written to %2").arg(osbutton.text).arg(dstbutton.text)
/* Just reboot to the installed OS */
Qt.quit()
}
else
- if(optionspopup.check_air())
- msgpopup.text = qsTr("%1 has been written to %2 It was flashed as AIR!
You can now remove the SD card from the reader").arg(osbutton.text).arg(dstbutton.text)
- else if(optionspopup.check_ground())
- msgpopup.text = qsTr("%1 has been written to %2 It was flashed as GROUND!
You can now remove the SD card from the reader").arg(osbutton.text).arg(dstbutton.text)
- else if(writebutton.image_name.includes("configurable"))
- msgpopup.text = qsTr("%1 has been written to %2 Air/Ground wasn't selected !
You can now remove the SD card from the reader").arg(osbutton.text).arg(dstbutton.text)
- else
- msgpopup.text = qsTr("%1 has been written to %2!
You can now remove the SD card from the reader").arg(osbutton.text).arg(dstbutton.text)
-
+ msgpopup.text = qsTr("%1 has been written to %2! You can now remove the SD card from the reader").arg(osbutton.text).arg(dstbutton.text)
+ msgpopup.continueButton = false
+ msgpopup.detailsButton = true
if (imageWriter.isEmbeddedMode()) {
msgpopup.continueButton = false
msgpopup.quitButton = true
@@ -1217,11 +1450,11 @@ ApplicationWindow {
fetch data by numeric role number */
if (driveListModel.data(driveListModel.index(i,0), 0x101) === drive) {
selectDstItem({
- device: drive,
- description: driveListModel.data(driveListModel.index(i,0), 0x102),
- size: driveListModel.data(driveListModel.index(i,0), 0x103),
- readonly: false
- })
+ device: drive,
+ description: driveListModel.data(driveListModel.index(i,0), 0x102),
+ size: driveListModel.data(driveListModel.index(i,0), 0x103),
+ readonly: false
+ })
break
}
}
diff --git a/src/windows/openhdimagewriter.manifest b/src/windows/openhdimagewriter.manifest
index 439fefc8f..4cb2077d1 100644
--- a/src/windows/openhdimagewriter.manifest
+++ b/src/windows/openhdimagewriter.manifest
@@ -1,7 +1,7 @@
- Raspberry Pi Imager
+ OpenHD ImageWriter
diff --git a/src/windows/openhdimagewriter.nsi.in b/src/windows/openhdimagewriter.nsi.in
index fdf0c0b9a..7183bf160 100644
--- a/src/windows/openhdimagewriter.nsi.in
+++ b/src/windows/openhdimagewriter.nsi.in
@@ -4,12 +4,13 @@
# by Vlasis K. Barkas aka Red Wine red_wine@freemail.gr Sep 2006
############################################################################################
-!define APP_NAME "OpenHD Imager"
+!define APP_NAME "OpenHD ImageWriter"
+!define OLD_APP_NAME "OpenHD imager"
!define COMP_NAME "OpenHD"
!define VERSION "@IMAGER_VERSION_STR@"
-!define INSTALLER_NAME "imager-${VERSION}.exe"
+!define INSTALLER_NAME "OpenHD-ImageWriter-${VERSION}.exe"
!define COPYRIGHT "OpenHD"
-!define DESCRIPTION "OpenHD Imager"
+!define DESCRIPTION "OpenHD ImageWriter"
!define MAIN_APP_EXE "openhdimagewriter.exe"
!define INSTALL_TYPE "SetShellVarContext current"
!define REG_ROOT "HKCU"
@@ -37,7 +38,7 @@ OutFile "${INSTALLER_NAME}"
BrandingText "${APP_NAME}"
XPStyle on
InstallDirRegKey "${REG_ROOT}" "${REG_APP_PATH}" ""
-InstallDir "$PROGRAMFILES\OpenHD Imager"
+InstallDir "$PROGRAMFILES\OpenHD ImageWriter"
######################################################################
@@ -84,14 +85,14 @@ InstallDir "$PROGRAMFILES\OpenHD Imager"
!insertmacro MUI_LANGUAGE "Dutch"
!insertmacro MUI_LANGUAGE "Italian"
-LangString termMsg ${LANG_ENGLISH} "OpenHD Imager seems to be running and busy.$\nDo you want to terminate process?"
-LangString stopMsg ${LANG_ENGLISH} "Stopping OpenHD Imager"
+LangString termMsg ${LANG_ENGLISH} "OpenHD ImageWriter seems to be running and busy.$\nDo you want to terminate process?"
+LangString stopMsg ${LANG_ENGLISH} "Stopping OpenHD ImageWriter"
LangString win7Msg ${LANG_ENGLISH} "Windows 7 or above required"
-LangString termMsg ${LANG_DUTCH} "OpenHD Imager is momenteel actief.$\nWilt u het programma afsluiten?"
-LangString stopMsg ${LANG_DUTCH} "Bezig met afsluiten OpenHD Imager"
+LangString termMsg ${LANG_DUTCH} "OpenHD ImageWriter is momenteel actief.$\nWilt u het programma afsluiten?"
+LangString stopMsg ${LANG_DUTCH} "Bezig met afsluiten OpenHD ImageWriter"
LangString win7Msg ${LANG_DUTCH} "Minimaal Windows 7 is vereist"
-LangString termMsg ${LANG_ITALIAN} "OpenHD Imager sembra essere in esecuzione e occupato.$\nVuoi terminare il processo OpenHD Imager?"
-LangString stopMsg ${LANG_ITALIAN} "Chiusura processo OpenHD Imager"
+LangString termMsg ${LANG_ITALIAN} "OpenHD ImageWriter sembra essere in esecuzione e occupato.$\nVuoi terminare il processo OpenHD ImageWriter?"
+LangString stopMsg ${LANG_ITALIAN} "Chiusura processo OpenHD ImageWriter"
LangString win7Msg ${LANG_ITALIAN} "Per l'esecuzione del programma è richiesto Windows 7 o versioni successive"
######################################################################
@@ -590,12 +591,12 @@ SetOutPath "$INSTDIR\iconengines"
File "deploy\iconengines\qsvgicon.dll"
SetOutPath "$INSTDIR\bearer"
File "deploy\bearer\qgenericbearer.dll"
+Delete "$SMPROGRAMS\OpenHD\${OLD_APP_NAME}.lnk"
SectionEnd
######################################################################
Section -Icons_Reg
-
!ifndef INNER
SetOutPath "$INSTDIR"
!endif
@@ -637,7 +638,7 @@ WriteRegStr SHCTX "Software\Classes\.gz\OpenWithProgIds" "RPI_IMAGINGUTILITY" ""
WriteRegStr SHCTX "Software\Classes\.xz\OpenWithProgIds" "RPI_IMAGINGUTILITY" ""
WriteRegStr SHCTX "Software\Classes\.img\OpenWithProgIds" "RPI_IMAGINGUTILITY" ""
WriteRegStr SHCTX "Software\Classes\.zstd\OpenWithProgIds" "RPI_IMAGINGUTILITY" ""
-WriteRegStr SHCTX "Software\Classes\RPI_IMAGINGUTILITY\shell\open" "FriendlyAppName" "OpenHD Imager"
+WriteRegStr SHCTX "Software\Classes\RPI_IMAGINGUTILITY\shell\open" "FriendlyAppName" "OpenHD ImageWriter"
WriteRegStr SHCTX "Software\Classes\RPI_IMAGINGUTILITY\shell\open\command" "" '"$INSTDIR\openhdimagewriter.exe" "%1"'
SectionEnd
diff --git a/src/windows/openhdimagewriter.nsi.in.bak b/src/windows/openhdimagewriter.nsi.in.bak
index 15c898952..43af1274f 100644
--- a/src/windows/openhdimagewriter.nsi.in.bak
+++ b/src/windows/openhdimagewriter.nsi.in.bak
@@ -4,12 +4,12 @@
# by Vlasis K. Barkas aka Red Wine red_wine@freemail.gr Sep 2006
############################################################################################
-!define APP_NAME "OpenHD Imager"
+!define APP_NAME "OpenHD ImageWriter"
!define COMP_NAME "OpenHD"
!define VERSION "@IMAGER_VERSION_STR@"
!define INSTALLER_NAME "imager-${VERSION}.exe"
!define COPYRIGHT "OpenHD"
-!define DESCRIPTION "OpenHD Imager"
+!define DESCRIPTION "OpenHD ImageWriter"
!define MAIN_APP_EXE "openhdimagewriter.exe"
!define INSTALL_TYPE "SetShellVarContext current"
!define REG_ROOT "HKCU"
@@ -37,7 +37,7 @@ OutFile "${INSTALLER_NAME}"
BrandingText "${APP_NAME}"
XPStyle on
InstallDirRegKey "${REG_ROOT}" "${REG_APP_PATH}" ""
-InstallDir "$PROGRAMFILES\OpenHD Imager"
+InstallDir "$PROGRAMFILES\OpenHD ImageWriter"
######################################################################
@@ -84,14 +84,14 @@ InstallDir "$PROGRAMFILES\OpenHD Imager"
!insertmacro MUI_LANGUAGE "Dutch"
!insertmacro MUI_LANGUAGE "Italian"
-LangString termMsg ${LANG_ENGLISH} "OpenHD Imager seems to be running and busy.$\nDo you want to terminate process?"
-LangString stopMsg ${LANG_ENGLISH} "Stopping OpenHD Imager"
+LangString termMsg ${LANG_ENGLISH} "OpenHD ImageWriter seems to be running and busy.$\nDo you want to terminate process?"
+LangString stopMsg ${LANG_ENGLISH} "Stopping OpenHD ImageWriter"
LangString win7Msg ${LANG_ENGLISH} "Windows 7 or above required"
-LangString termMsg ${LANG_DUTCH} "OpenHD Imager is momenteel actief.$\nWilt u het programma afsluiten?"
-LangString stopMsg ${LANG_DUTCH} "Bezig met afsluiten OpenHD Imager"
+LangString termMsg ${LANG_DUTCH} "OpenHD ImageWriter is momenteel actief.$\nWilt u het programma afsluiten?"
+LangString stopMsg ${LANG_DUTCH} "Bezig met afsluiten OpenHD ImageWriter"
LangString win7Msg ${LANG_DUTCH} "Minimaal Windows 7 is vereist"
-LangString termMsg ${LANG_ITALIAN} "OpenHD Imager sembra essere in esecuzione e occupato.$\nVuoi terminare il processo OpenHD Imager?"
-LangString stopMsg ${LANG_ITALIAN} "Chiusura processo OpenHD Imager"
+LangString termMsg ${LANG_ITALIAN} "OpenHD ImageWriter sembra essere in esecuzione e occupato.$\nVuoi terminare il processo OpenHD ImageWriter?"
+LangString stopMsg ${LANG_ITALIAN} "Chiusura processo OpenHD ImageWriter"
LangString win7Msg ${LANG_ITALIAN} "Per l'esecuzione del programma è richiesto Windows 7 o versioni successive"
######################################################################
@@ -635,7 +635,7 @@ WriteRegStr SHCTX "Software\Classes\.gz\OpenWithProgIds" "RPI_IMAGINGUTILITY" ""
WriteRegStr SHCTX "Software\Classes\.xz\OpenWithProgIds" "RPI_IMAGINGUTILITY" ""
WriteRegStr SHCTX "Software\Classes\.img\OpenWithProgIds" "RPI_IMAGINGUTILITY" ""
WriteRegStr SHCTX "Software\Classes\.zstd\OpenWithProgIds" "RPI_IMAGINGUTILITY" ""
-WriteRegStr SHCTX "Software\Classes\RPI_IMAGINGUTILITY\shell\open" "FriendlyAppName" "OpenHD Imager"
+WriteRegStr SHCTX "Software\Classes\RPI_IMAGINGUTILITY\shell\open" "FriendlyAppName" "OpenHD ImageWriter"
WriteRegStr SHCTX "Software\Classes\RPI_IMAGINGUTILITY\shell\open\command" "" '"$INSTDIR\rpi-imager.exe" "%1"'
SectionEnd
From 30499291204bcbd8ccf9dec31d592f6f82673f11 Mon Sep 17 00:00:00 2001
From: Raphael <68374617+raphaelscholle@users.noreply.github.com>
Date: Tue, 9 Jan 2024 12:54:23 +0100
Subject: [PATCH 02/28] Update macos.yml
---
.github/workflows/macos.yml | 1 +
1 file changed, 1 insertion(+)
diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml
index 9d00b48ac..655a0cc63 100644
--- a/.github/workflows/macos.yml
+++ b/.github/workflows/macos.yml
@@ -6,6 +6,7 @@ on:
- "2.5-evo"
- "dev-release"
- "release"
+ - "oldVersion"
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
From 0aa8630d4a36e7dc44c30ae7103a5bf772f286e4 Mon Sep 17 00:00:00 2001
From: Raphael <68374617+raphaelscholle@users.noreply.github.com>
Date: Tue, 9 Jan 2024 13:02:06 +0100
Subject: [PATCH 03/28] Update Info.plist.in
---
src/mac/Info.plist.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/mac/Info.plist.in b/src/mac/Info.plist.in
index fb2ec96cc..665ecf39d 100644
--- a/src/mac/Info.plist.in
+++ b/src/mac/Info.plist.in
@@ -17,7 +17,7 @@
CFBundleLongVersionString
CFBundleName
- Raspberry Pi Imager
+ OpenHD ImageWriter
CFBundlePackageType
APPL
CFBundleShortVersionString
From f4a51b2ffa299980fcbf53c05cb7745cc05e4a5f Mon Sep 17 00:00:00 2001
From: Raphael <68374617+raphaelscholle@users.noreply.github.com>
Date: Tue, 9 Jan 2024 13:16:07 +0100
Subject: [PATCH 04/28] Update macos.yml
---
.github/workflows/macos.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml
index 655a0cc63..28da0201d 100644
--- a/.github/workflows/macos.yml
+++ b/.github/workflows/macos.yml
@@ -6,7 +6,7 @@ on:
- "2.5-evo"
- "dev-release"
- "release"
- - "oldVersion"
+ - "macosx"
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
From 0c5d9e676aa86c12eb277dd4034ba34fd14aa3be Mon Sep 17 00:00:00 2001
From: Raphael <68374617+raphaelscholle@users.noreply.github.com>
Date: Sat, 20 Jan 2024 22:32:30 +0100
Subject: [PATCH 05/28] testing
---
src/config.h | 2 +-
src/imagewriter.cpp | 14 ++++++++++++++
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/src/config.h b/src/config.h
index a635e4c44..25b15beb5 100644
--- a/src/config.h
+++ b/src/config.h
@@ -8,7 +8,7 @@
/* Repository URL */
-#define OSLIST_URL "https://github.com/OpenHD/OpenHD-ImageWriter/releases/download/Json/OpenHD-download-index.json"
+#define OSLIST_URL "https://github.com/OpenHD/OpenHD-ImageWriter/releases/download/Json/OpenHD-dev-download-index.json"
/* Time synchronization URL (only used on eglfs QPA platform, URL must be HTTP) */
#define TIME_URL "https://github.com/OpenHD/OpenHD-ImageWriter/releases/download/Json/OpenHD-Images.json?time_synchronization"
diff --git a/src/imagewriter.cpp b/src/imagewriter.cpp
index 36cc6cfce..bc9ee761f 100644
--- a/src/imagewriter.cpp
+++ b/src/imagewriter.cpp
@@ -233,6 +233,7 @@ bool ImageWriter::readyToWrite()
/* Start writing */
void ImageWriter::startWrite()
{
+ qDebug() << "Write function executed.";
if (!readyToWrite())
return;
@@ -248,6 +249,19 @@ void ImageWriter::startWrite()
QByteArray urlstr = _src.toString(_src.FullyEncoded).toLatin1();
QString lowercaseurl = urlstr.toLower();
bool compressed = lowercaseurl.endsWith(".zip") || lowercaseurl.endsWith(".xz") || lowercaseurl.endsWith(".bz2") || lowercaseurl.endsWith(".gz") || lowercaseurl.endsWith(".7z") || lowercaseurl.endsWith(".zst") || lowercaseurl.endsWith(".cache");
+ qDebug() << "this is the lowercaseurl:" << lowercaseurl;
+
+
+ if (lowercaseurl.endsWith(".zip"))
+ {
+ if (lowercaseurl.contains("update")) {
+ qDebug() << "This is an OpenHD UpdateFile";
+ }
+ else {
+ emit error(tr("Please extract your Image before flashing"));
+ }
+ }
+
if (!_extrLen && _src.isLocalFile())
{
if (!compressed)
From 650410dd9d8e343db83ec4a949ee723229f70503 Mon Sep 17 00:00:00 2001
From: Raphael <68374617+raphaelscholle@users.noreply.github.com>
Date: Sun, 21 Jan 2024 00:53:04 +0100
Subject: [PATCH 06/28] Update downloadthread.cpp
---
src/downloadthread.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/downloadthread.cpp b/src/downloadthread.cpp
index 03b45f08f..b4045d149 100644
--- a/src/downloadthread.cpp
+++ b/src/downloadthread.cpp
@@ -43,7 +43,7 @@ DownloadThread::DownloadThread(const QByteArray &url, const QByteArray &localfil
if (!_curlCount)
curl_global_init(CURL_GLOBAL_DEFAULT);
_curlCount++;
- //_ejectEnabled = settings.value("eject", true).toBool();
+ _ejectEnabled = false;
}
DownloadThread::~DownloadThread()
From 38a3f847694d83a0c9f49aa881ad116dbd600fb7 Mon Sep 17 00:00:00 2001
From: Raphael <68374617+raphaelscholle@users.noreply.github.com>
Date: Sun, 21 Jan 2024 01:12:05 +0100
Subject: [PATCH 07/28] Update downloadthread.cpp
---
src/downloadthread.cpp | 5 +++++
src/imagewriter.cpp | 4 ++++
2 files changed, 9 insertions(+)
diff --git a/src/downloadthread.cpp b/src/downloadthread.cpp
index b4045d149..fbda6f43a 100644
--- a/src/downloadthread.cpp
+++ b/src/downloadthread.cpp
@@ -740,6 +740,7 @@ void DownloadThread::_writeComplete()
_filename.replace("/dev/rdisk", "/dev/disk");
#endif
bool useSettings = settings.value("useSettings", true).toBool();
+ qDebug() << "This is the Debug Filename" << _filename;
if (!useSettings)
eject_disk(_filename.constData());
@@ -1075,6 +1076,10 @@ bool DownloadThread::_customizeImage()
/* Here is the start of the OpenHD settings routine
*/
+ if (settings.value("justUpdate", true).toBool()) {
+ qDebug() << "Writing OpenHD-Update";
+ }
+
if (settings.value("useSettings", true).toBool()) {
qDebug() << "Writing OpenHD-Settings";
QSettings settings_;
diff --git a/src/imagewriter.cpp b/src/imagewriter.cpp
index bc9ee761f..bd797d93f 100644
--- a/src/imagewriter.cpp
+++ b/src/imagewriter.cpp
@@ -626,6 +626,10 @@ void ImageWriter::onFileSelected(QString filename)
settings.setValue("lastpath", path);
settings.sync();
}
+
+ qDebug() << "Selected filename: " << filename;
+ settings.setValue("justUpdate", filename);
+ settings.sync();
emit fileSelected(QUrl::fromLocalFile(filename));
}
From d626c5ad5fafec144f02c1baa17ed46b6d25d867 Mon Sep 17 00:00:00 2001
From: Raphael <68374617+raphaelscholle@users.noreply.github.com>
Date: Sun, 21 Jan 2024 02:58:21 +0100
Subject: [PATCH 08/28] update stuff, not ready ...
---
src/downloadthread.cpp | 5 ++++-
src/imagewriter.cpp | 35 +++++++++++++++++++++--------------
2 files changed, 25 insertions(+), 15 deletions(-)
diff --git a/src/downloadthread.cpp b/src/downloadthread.cpp
index fbda6f43a..39034b36e 100644
--- a/src/downloadthread.cpp
+++ b/src/downloadthread.cpp
@@ -740,6 +740,7 @@ void DownloadThread::_writeComplete()
_filename.replace("/dev/rdisk", "/dev/disk");
#endif
bool useSettings = settings.value("useSettings", true).toBool();
+ bool justUpdate = settings.value("justUpdate", false).toBool();
qDebug() << "This is the Debug Filename" << _filename;
if (!useSettings)
@@ -1076,10 +1077,12 @@ bool DownloadThread::_customizeImage()
/* Here is the start of the OpenHD settings routine
*/
+
if (settings.value("justUpdate", true).toBool()) {
qDebug() << "Writing OpenHD-Update";
+ qDebug() << settings.value("justUpdate");
}
-
+
if (settings.value("useSettings", true).toBool()) {
qDebug() << "Writing OpenHD-Settings";
QSettings settings_;
diff --git a/src/imagewriter.cpp b/src/imagewriter.cpp
index bd797d93f..6e59becc9 100644
--- a/src/imagewriter.cpp
+++ b/src/imagewriter.cpp
@@ -234,6 +234,7 @@ bool ImageWriter::readyToWrite()
void ImageWriter::startWrite()
{
qDebug() << "Write function executed.";
+
if (!readyToWrite())
return;
@@ -246,21 +247,31 @@ void ImageWriter::startWrite()
return;
}
- QByteArray urlstr = _src.toString(_src.FullyEncoded).toLatin1();
- QString lowercaseurl = urlstr.toLower();
- bool compressed = lowercaseurl.endsWith(".zip") || lowercaseurl.endsWith(".xz") || lowercaseurl.endsWith(".bz2") || lowercaseurl.endsWith(".gz") || lowercaseurl.endsWith(".7z") || lowercaseurl.endsWith(".zst") || lowercaseurl.endsWith(".cache");
- qDebug() << "this is the lowercaseurl:" << lowercaseurl;
+ QByteArray urlstr = _src.toString(_src.FullyEncoded).toLatin1();
+ QString lowercaseurl = urlstr.toLower();
+ bool containsUpdate = lowercaseurl.contains("update");
+ bool compressed = lowercaseurl.endsWith(".zip") || lowercaseurl.endsWith(".xz") || lowercaseurl.endsWith(".bz2") || lowercaseurl.endsWith(".gz") || lowercaseurl.endsWith(".7z") || lowercaseurl.endsWith(".zst") || lowercaseurl.endsWith(".cache");
+ _settings.setValue("justUpdate", containsUpdate);
+ _settings.sync();
- if (lowercaseurl.endsWith(".zip"))
+if (lowercaseurl.endsWith(".zip"))
+{
+ if (containsUpdate == true)
{
- if (lowercaseurl.contains("update")) {
qDebug() << "This is an OpenHD UpdateFile";
- }
- else {
+ }
+ else
+ {
emit error(tr("Please extract your Image before flashing"));
- }
}
+}
+
+ if (containsUpdate == true)
+ {
+ qDebug() << "This is an OpenHD UpdateFile";
+ }
+
if (!_extrLen && _src.isLocalFile())
{
@@ -410,6 +421,7 @@ QString ImageWriter::fileNameFromUrl(const QUrl &url)
{
//return QFileInfo(url.toLocalFile()).fileName();
return url.fileName();
+
}
QString ImageWriter::srcFileName()
@@ -626,11 +638,6 @@ void ImageWriter::onFileSelected(QString filename)
settings.setValue("lastpath", path);
settings.sync();
}
-
- qDebug() << "Selected filename: " << filename;
- settings.setValue("justUpdate", filename);
- settings.sync();
-
emit fileSelected(QUrl::fromLocalFile(filename));
}
else
From 309a2a83489ece05747d4e144b1325f25c18479b Mon Sep 17 00:00:00 2001
From: Raphael <68374617+raphaelscholle@users.noreply.github.com>
Date: Sun, 21 Jan 2024 03:54:25 +0100
Subject: [PATCH 09/28] fixing update settings bug
---
src/OptionsPopup.qml | 1 -
src/downloadthread.cpp | 18 +++++++++++++-----
src/imagewriter.cpp | 7 -------
src/main.qml | 1 +
4 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/src/OptionsPopup.qml b/src/OptionsPopup.qml
index 68dd11e13..62877896b 100644
--- a/src/OptionsPopup.qml
+++ b/src/OptionsPopup.qml
@@ -424,6 +424,5 @@ Popup {
imageWriter.setSetting("beep", beep)
imageWriter.setSetting("eject", eject)
imageWriter.setSetting("useSettings", useSettings)
-
}
}
diff --git a/src/downloadthread.cpp b/src/downloadthread.cpp
index 39034b36e..7c97fedd1 100644
--- a/src/downloadthread.cpp
+++ b/src/downloadthread.cpp
@@ -30,6 +30,9 @@
using namespace std;
+bool useSettings;
+bool justUpdate;
+
QByteArray DownloadThread::_proxy;
int DownloadThread::_curlCount = 0;
@@ -739,9 +742,13 @@ void DownloadThread::_writeComplete()
QThread::sleep(1);
_filename.replace("/dev/rdisk", "/dev/disk");
#endif
- bool useSettings = settings.value("useSettings", true).toBool();
- bool justUpdate = settings.value("justUpdate", false).toBool();
+ QSettings settings_;
+
+ useSettings = settings_.value("useSettings").toBool();
+ justUpdate = settings_.value("justUpdate").toBool();
qDebug() << "This is the Debug Filename" << _filename;
+ qDebug() << "This is the Debug Settings" << useSettings;
+ qDebug() << "This is the Debug Update" << justUpdate;
if (!useSettings)
eject_disk(_filename.constData());
@@ -1078,12 +1085,13 @@ bool DownloadThread::_customizeImage()
/* Here is the start of the OpenHD settings routine
*/
- if (settings.value("justUpdate", true).toBool()) {
+ if (justUpdate) {
qDebug() << "Writing OpenHD-Update";
- qDebug() << settings.value("justUpdate");
+ qDebug() << justUpdate;
}
- if (settings.value("useSettings", true).toBool()) {
+
+ if (useSettings) {
qDebug() << "Writing OpenHD-Settings";
QSettings settings_;
diff --git a/src/imagewriter.cpp b/src/imagewriter.cpp
index 6e59becc9..e784a5cb3 100644
--- a/src/imagewriter.cpp
+++ b/src/imagewriter.cpp
@@ -266,13 +266,6 @@ if (lowercaseurl.endsWith(".zip"))
emit error(tr("Please extract your Image before flashing"));
}
}
-
- if (containsUpdate == true)
- {
- qDebug() << "This is an OpenHD UpdateFile";
- }
-
-
if (!_extrLen && _src.isLocalFile())
{
if (!compressed)
diff --git a/src/main.qml b/src/main.qml
index 86364b55b..bf2b17bbc 100644
--- a/src/main.qml
+++ b/src/main.qml
@@ -239,6 +239,7 @@ ApplicationWindow {
imageWriter.setSetting("hotSpot" , "")
imageWriter.setSetting("beep", "")
imageWriter.setSetting("eject", "")
+ imageWriter.setSetting("justUpdate", "")
}
implicitHeight: window.height/2
From 11d46c450d6de9563ae72aa58637cdcf376374e4 Mon Sep 17 00:00:00 2001
From: Raphael <68374617+raphaelscholle@users.noreply.github.com>
Date: Sun, 21 Jan 2024 04:00:00 +0100
Subject: [PATCH 10/28] Update downloadthread.cpp
---
src/downloadthread.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/downloadthread.cpp b/src/downloadthread.cpp
index 7c97fedd1..63c19577a 100644
--- a/src/downloadthread.cpp
+++ b/src/downloadthread.cpp
@@ -746,9 +746,9 @@ void DownloadThread::_writeComplete()
useSettings = settings_.value("useSettings").toBool();
justUpdate = settings_.value("justUpdate").toBool();
- qDebug() << "This is the Debug Filename" << _filename;
- qDebug() << "This is the Debug Settings" << useSettings;
- qDebug() << "This is the Debug Update" << justUpdate;
+ // qDebug() << "This is the Debug Filename" << _filename;
+ // qDebug() << "This is the Debug Settings" << useSettings;
+ // qDebug() << "This is the Debug Update" << justUpdate;
if (!useSettings)
eject_disk(_filename.constData());
From 85c5e90e2e63b021faa9684626bdc0bf9c38e9e5 Mon Sep 17 00:00:00 2001
From: Raphael <68374617+raphaelscholle@users.noreply.github.com>
Date: Sun, 21 Jan 2024 15:33:30 +0100
Subject: [PATCH 11/28] Update downloadthread.cpp
---
src/downloadthread.cpp | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/downloadthread.cpp b/src/downloadthread.cpp
index 63c19577a..6ad74decc 100644
--- a/src/downloadthread.cpp
+++ b/src/downloadthread.cpp
@@ -116,6 +116,12 @@ bool DownloadThread::_openAndPrepareDevice()
{
QSettings settings_;
std::cout << "_____________________________-DEBUG-_______________________________________" << std::endl;
+
+ if (settings_.value("justUpdate").toBool())
+ {
+ std::cout << "running update procedure without modifying the image" << std::endl;
+ return true;
+ }
emit preparationStatusUpdate(tr("opening drive"));
From 3a2b126e4a3f1190ebb9ee2a0da67509f49f1fde Mon Sep 17 00:00:00 2001
From: Raphael <68374617+raphaelscholle@users.noreply.github.com>
Date: Thu, 15 Feb 2024 20:02:36 +0100
Subject: [PATCH 12/28] add rockzero3w
---
src/OptionsPopup.qml | 121 ++++++++++++++++++++++++++++++++-----------
1 file changed, 90 insertions(+), 31 deletions(-)
diff --git a/src/OptionsPopup.qml b/src/OptionsPopup.qml
index 62877896b..d887e668c 100644
--- a/src/OptionsPopup.qml
+++ b/src/OptionsPopup.qml
@@ -33,7 +33,8 @@ Popup {
property string hotSpot
property string beep
property string eject
- property bool rock
+ property bool rock3
+ property bool rock5
property bool rpi
property bool useSettings:true
@@ -121,14 +122,13 @@ Popup {
title: qsTr("Camera Settings")
id: cameraSettingsRock5
Layout.fillWidth: true
- visible: rock && (bootType === "Air")
-
+ visible: rock5 && (bootType === "Air")
ColumnLayout {
spacing: -10
// Add a ComboBox to select between cameras
ComboBox {
- id: cameraSelectorRock
+ id: cameraSelectorRock5
textRole: "displayText"
model: ListModel {
ListElement { displayText: "NONE" }
@@ -145,6 +145,34 @@ Popup {
}
}
}
+ GroupBox {
+ title: qsTr("Camera Settings")
+ id: cameraSettingsRock3
+ Layout.fillWidth: true
+ visible: rock3 && (bootType === "Air")
+
+
+ ColumnLayout {
+ spacing: -10
+ ComboBox {
+ id: cameraSelectorRock3
+ textRole: "displayText"
+ model: ListModel {
+ ListElement { displayText: "NONE" }
+ ListElement { displayText: "IMX219" }
+ ListElement { displayText: "OV5647" }
+ ListElement { displayText: "IMX708" }
+ ListElement { displayText: "OHD-Jaguar" }
+ }
+ onCurrentIndexChanged: {
+ var selectedCamera = model.get(currentIndex).displayText;
+ if (selectedCamera !== "NONE") {
+ camera = selectedCamera;
+ }
+ }
+ }
+ }
+ }
GroupBox {
title: qsTr("Camera Settings")
id: cameraSettingsRpi
@@ -156,7 +184,7 @@ Popup {
id: cameraVendorSelectorRpi
textRole: "displayText"
model: ListModel {
- ListElement { displayText: "Original" }
+ ListElement { displayText: "Raspberry" }
ListElement { displayText: "Arducam" }
ListElement { displayText: "Veye" }
}
@@ -175,6 +203,48 @@ Popup {
}
}
+ ComboBox {
+ id: Advanced
+ visible:false
+ textRole: "displayText"
+ model: ListModel {
+ ListElement { displayText: "None" }
+ ListElement { displayText: "FILESRC" }
+ ListElement { displayText: "IP-Camera" }
+ ListElement { displayText: "EXTERNAL" }
+ }
+ Layout.minimumWidth: 200
+ Layout.maximumHeight: 40
+ onCurrentIndexChanged: {
+ var selectedCamera = model.get(currentIndex).displayText;
+ if (selectedCamera !== "None") {
+ //TODO
+ }
+ }
+ }
+ ComboBox {
+
+ id: cameraSelectorRpiOriginal
+ visible:false
+ textRole: "displayText"
+ model: ListModel {
+ ListElement { displayText: "None" }
+ ListElement { displayText: "HDMI" }
+ ListElement { displayText: "OV5647" }
+ ListElement { displayText: "IMX219" }
+ ListElement { displayText: "IMX477" }
+ ListElement { displayText: "IMX708" }
+
+ }
+ Layout.minimumWidth: 200
+ Layout.maximumHeight: 40
+ onCurrentIndexChanged: {
+ var selectedCamera = model.get(currentIndex).displayText;
+ if (selectedCamera !== "None") {
+ console.debug(selectedCamera)
+ }
+ }
+ }
ComboBox {
id: cameraSelectorArducam
@@ -183,33 +253,20 @@ Popup {
model: ListModel {
ListElement { displayText: "None" }
ListElement { displayText: "SkyMaster HDR 708" }
- ListElement { displayText: "IMX462 Mini" }
ListElement { displayText: "SkyVision Pro 519" }
- ListElement { displayText: "IMX462" }
+ ListElement { displayText: "IMX462 Mini" }
ListElement { displayText: "IMX477" }
- ListElement { displayText: "IMX519" }
+ ListElement { displayText: "IMX477m" }
+ ListElement { displayText: "IMX462" }
ListElement { displayText: "IMX327" }
ListElement { displayText: "IMX290" }
- ListElement { displayText: "CUSTOM" }
}
Layout.minimumWidth: 200
Layout.maximumHeight: 40
onCurrentIndexChanged: {
var selectedCamera = model.get(currentIndex).displayText;
if (selectedCamera !== "None") {
- // Check if it's one of the specified values
- if (["SkyMaster HDR 708", "IMX462 Mini", "SkyVision Pro 519"].indexOf(selectedCamera) === -1) {
- camera = selectedCamera;
- } else {
- // Handle the specified values differently
- if (selectedCamera === "SkyMaster HDR 708") {
- camera = "IMX708";
- } else if (selectedCamera === "IMX462 Mini") {
- camera = "ARDUCAM";
- } else if (selectedCamera === "SkyVision Pro 519") {
- camera = "IMX519";
- }
- }
+ console.debug(selectedCamera)
}
}
}
@@ -220,7 +277,7 @@ Popup {
textRole: "displayText"
model: ListModel {
ListElement { displayText: "None" }
- ListElement { displayText: "CAM2M" }
+ ListElement { displayText: "2MP Cameras" }
ListElement { displayText: "CSIMX307" }
ListElement { displayText: "CSSC137" }
ListElement { displayText: "MVCAM" }
@@ -382,25 +439,26 @@ Popup {
if (fileName.includes("pi")) {
imageWriter.setSetting("sbc", "rpi");
rpi=true;
- rock=false;
+ rock5=false;
+ rock3=true
}
else if (fileName.includes("rock5a")) {
imageWriter.setSetting("sbc", "rock-5a");
rpi=false;
- rock=true;
+ rock5=true;
+ rock3=false;
}
else if (fileName.includes("rock5b")) {
imageWriter.setSetting("sbc", "rock-5b");
rpi=false;
- rock=true;
+ rock5=true;
+ rock3=false;
}
else if (fileName.includes("zero3w")) {
- imageWriter.setSetting("sbc", "Radxa-Zero-3W");
+ imageWriter.setSetting("sbc", "zero3w");
rpi=false;
- rock=true;
- }
- else{
- imageWriter.setSetting("sbc", "unknown");
+ rock5=false;
+ rock3=true;
}
}
@@ -424,5 +482,6 @@ Popup {
imageWriter.setSetting("beep", beep)
imageWriter.setSetting("eject", eject)
imageWriter.setSetting("useSettings", useSettings)
+
}
}
From 0b11a40ac037a92fb16bc1762133b3fb386d27d9 Mon Sep 17 00:00:00 2001
From: Raphael <68374617+raphaelscholle@users.noreply.github.com>
Date: Thu, 15 Feb 2024 20:18:01 +0100
Subject: [PATCH 13/28] Update OptionsPopup.qml
---
src/OptionsPopup.qml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/OptionsPopup.qml b/src/OptionsPopup.qml
index d887e668c..e7714045b 100644
--- a/src/OptionsPopup.qml
+++ b/src/OptionsPopup.qml
@@ -204,7 +204,7 @@ Popup {
}
}
ComboBox {
- id: Advanced
+ id: advanced
visible:false
textRole: "displayText"
model: ListModel {
From a2daf3e4a7905508425406dbe11bc78f712dcfa0 Mon Sep 17 00:00:00 2001
From: Raphael <68374617+raphaelscholle@users.noreply.github.com>
Date: Fri, 16 Feb 2024 00:35:39 +0100
Subject: [PATCH 14/28] Update downloadthread.cpp
---
src/downloadthread.cpp | 102 ++++++++++++++++++++++++++++++++---------
1 file changed, 81 insertions(+), 21 deletions(-)
diff --git a/src/downloadthread.cpp b/src/downloadthread.cpp
index 6ad74decc..e7e113c2e 100644
--- a/src/downloadthread.cpp
+++ b/src/downloadthread.cpp
@@ -1102,7 +1102,7 @@ bool DownloadThread::_customizeImage()
QSettings settings_;
- QString cameraValue = settings_.value("camera").toString();
+ QString cameraName = settings_.value("camera").toString();
QString sbcValue = settings_.value("sbc").toString();
QString modeValue = settings_.value("mode").toString();
QString bindPhraseSaved = settings_.value("bindPhrase").toString();
@@ -1135,6 +1135,66 @@ bool DownloadThread::_customizeImage()
return false;
}
}
+ if (!cameraName.isEmpty()){
+ QString cameraValue;
+ qDebug() << "Camera found" << cameraName;
+ QFile cam(folder+"/openhd/camera1.txt");
+ //Encode camera name to Cam-int
+ if (cam.open(QIODevice::WriteOnly))
+ {
+ if (sbcValue == "rpi"){
+ if (cameraName == "OV5647"){
+ cameraValue="30";
+ }
+ else if (cameraName == "IMX219"){
+ cameraValue="31";
+ }
+ else if (cameraName == "IMX708"){
+ cameraValue="32";
+ }
+ else if (cameraName == "IMX477"){
+ cameraValue="33";
+ }
+ else if (cameraName == "HDMI"){
+ cameraValue="30";
+ }
+
+ qDebug() << cameraValue;
+ }
+ else if (sbcValue == "zero3w"){
+ cameraValue="4";
+ qDebug() << cameraValue;
+ }
+ else if ((sbcValue == "rock-5b") || (sbcValue == "rock-5a")) {
+ cameraValue="5";
+ qDebug() << cameraValue;
+ }
+
+ QByteArray camBytes = cameraValue.toUtf8();
+ qint64 bytesWritten = cam.write(camBytes);
+ cam.close();
+
+
+
+
+
+
+ if (bytesWritten == camBytes.length())
+ {
+ // Successfully wrote the camera to the file
+ }
+ else
+ {
+ emit error(tr("Error writing camera to camera1.txt on FAT partition"));
+ return false;
+ }
+ }
+ else
+ {
+ emit error(tr("Error creating camera1.txt on FAT partition"));
+ return false;
+ }
+ }
if (!sbcValue.isEmpty()){
QFile sbc(folder + "/openhd" + "/" + sbcValue + ".txt");
if (sbc.open(QIODevice::WriteOnly)) {
@@ -1145,16 +1205,16 @@ bool DownloadThread::_customizeImage()
return false;
}
}
- if (!hotspot.isEmpty()){
- QFile Hs(folder+"/openhd"+"/wifi_hotspot.txt");
- if (Hs.open(QIODevice::WriteOnly)) {
- QTextStream stream(&Hs);
- Hs.close();
- } else {
- emit error(tr("Error creating hotspot.txt file on FAT partition"));
- return false;
- }
- }
+ // if (!hotspot.isEmpty()){
+ // QFile Hs(folder+"/openhd"+"/wifi_hotspot.txt");
+ // if (Hs.open(QIODevice::WriteOnly)) {
+ // QTextStream stream(&Hs);
+ // Hs.close();
+ // } else {
+ // emit error(tr("Error creating hotspot.txt file on FAT partition"));
+ // return false;
+ // }
+ // }
if (modeValue == "debug"){
QFile Db(folder+"/openhd"+"/debug.txt");
if (Db.open(QIODevice::WriteOnly)) {
@@ -1195,16 +1255,16 @@ bool DownloadThread::_customizeImage()
return false;
}
}
- if (!cameraValue.isEmpty()) {
- QFile cam(folder+"/openhd"+"/"+cameraValue+".txt");
- if (cam.open(QIODevice::WriteOnly)) {
- QTextStream stream(&cam);
- cam.close();
- } else {
- emit error(tr("Error creating Camera file on FAT partition"));
- return false;
- }
- }
+ // if (!cameraName.isEmpty()) {
+ // QFile cam(folder+"/openhd"+"/+camera1+.txt");
+ // if (cam.open(QIODevice::WriteOnly)) {
+ // QTextStream stream(&cam);
+ // cam.close();
+ // } else {
+ // emit error(tr("Error creating Camera file on FAT partition"));
+ // return false;
+ // }
+ // }
}
emit finalizing();
From e7c0c3755c329f153aceecb57872f96bc7642b34 Mon Sep 17 00:00:00 2001
From: Raphael <68374617+raphaelscholle@users.noreply.github.com>
Date: Fri, 16 Feb 2024 00:42:01 +0100
Subject: [PATCH 15/28] Update downloadthread.cpp
---
src/downloadthread.cpp | 32 ++++++++++++++------------------
1 file changed, 14 insertions(+), 18 deletions(-)
diff --git a/src/downloadthread.cpp b/src/downloadthread.cpp
index e7e113c2e..f8bba6012 100644
--- a/src/downloadthread.cpp
+++ b/src/downloadthread.cpp
@@ -1142,24 +1142,15 @@ bool DownloadThread::_customizeImage()
//Encode camera name to Cam-int
if (cam.open(QIODevice::WriteOnly))
{
- if (sbcValue == "rpi"){
- if (cameraName == "OV5647"){
- cameraValue="30";
- }
- else if (cameraName == "IMX219"){
- cameraValue="31";
- }
- else if (cameraName == "IMX708"){
- cameraValue="32";
- }
- else if (cameraName == "IMX477"){
- cameraValue="33";
- }
- else if (cameraName == "HDMI"){
- cameraValue="30";
- }
-
- qDebug() << cameraValue;
+ if (sbcValue == "rpi") {
+ std::unordered_map cameraValues = {
+ {"OV5647", "30"},
+ {"IMX219", "31"},
+ {"IMX708", "32"},
+ {"IMX477", "33"},
+ {"HDMI", "20"}
+ };
+
}
else if (sbcValue == "zero3w"){
cameraValue="4";
@@ -1170,6 +1161,11 @@ bool DownloadThread::_customizeImage()
qDebug() << cameraValue;
}
+ auto it = cameraValues.find(cameraName);
+ if (it != cameraValues.end()) {
+ cameraValue = it->second;
+ }
+
QByteArray camBytes = cameraValue.toUtf8();
qint64 bytesWritten = cam.write(camBytes);
cam.close();
From 4852266e7f264c98e9b46815c0e9280509c74749 Mon Sep 17 00:00:00 2001
From: Raphael <68374617+raphaelscholle@users.noreply.github.com>
Date: Fri, 16 Feb 2024 00:49:05 +0100
Subject: [PATCH 16/28] Update downloadthread.cpp
---
src/downloadthread.cpp | 32 ++++++++++++++++++--------------
1 file changed, 18 insertions(+), 14 deletions(-)
diff --git a/src/downloadthread.cpp b/src/downloadthread.cpp
index f8bba6012..80348d4cb 100644
--- a/src/downloadthread.cpp
+++ b/src/downloadthread.cpp
@@ -116,7 +116,7 @@ bool DownloadThread::_openAndPrepareDevice()
{
QSettings settings_;
std::cout << "_____________________________-DEBUG-_______________________________________" << std::endl;
-
+
if (settings_.value("justUpdate").toBool())
{
std::cout << "running update procedure without modifying the image" << std::endl;
@@ -1142,15 +1142,24 @@ bool DownloadThread::_customizeImage()
//Encode camera name to Cam-int
if (cam.open(QIODevice::WriteOnly))
{
- if (sbcValue == "rpi") {
- std::unordered_map cameraValues = {
- {"OV5647", "30"},
- {"IMX219", "31"},
- {"IMX708", "32"},
- {"IMX477", "33"},
- {"HDMI", "20"}
- };
+ if (sbcValue == "rpi"){
+ if (cameraName == "OV5647"){
+ cameraValue="30";
+ }
+ else if (cameraName == "IMX219"){
+ cameraValue="31";
+ }
+ else if (cameraName == "IMX708"){
+ cameraValue="32";
+ }
+ else if (cameraName == "IMX477"){
+ cameraValue="33";
+ }
+ else if (cameraName == "HDMI"){
+ cameraValue="30";
+ }
+ qDebug() << cameraValue;
}
else if (sbcValue == "zero3w"){
cameraValue="4";
@@ -1161,11 +1170,6 @@ bool DownloadThread::_customizeImage()
qDebug() << cameraValue;
}
- auto it = cameraValues.find(cameraName);
- if (it != cameraValues.end()) {
- cameraValue = it->second;
- }
-
QByteArray camBytes = cameraValue.toUtf8();
qint64 bytesWritten = cam.write(camBytes);
cam.close();
From d21a967559dc95e5e5ab4a0fc63fffc268f5eb54 Mon Sep 17 00:00:00 2001
From: Raphael <68374617+raphaelscholle@users.noreply.github.com>
Date: Fri, 16 Feb 2024 01:27:03 +0100
Subject: [PATCH 17/28] step2
---
src/OptionsPopup.qml | 19 ++++++++++++-------
src/downloadthread.cpp | 30 +++++++++++++++++++++++++++---
2 files changed, 39 insertions(+), 10 deletions(-)
diff --git a/src/OptionsPopup.qml b/src/OptionsPopup.qml
index e7714045b..fb6910940 100644
--- a/src/OptionsPopup.qml
+++ b/src/OptionsPopup.qml
@@ -177,7 +177,7 @@ Popup {
title: qsTr("Camera Settings")
id: cameraSettingsRpi
Layout.fillWidth: true
- visible: rpi && (bootType === "Air")
+ visible: rpi && (bootType === "Air")
ColumnLayout {
// Add a ComboBox to select between cameras
ComboBox {
@@ -218,7 +218,6 @@ Popup {
onCurrentIndexChanged: {
var selectedCamera = model.get(currentIndex).displayText;
if (selectedCamera !== "None") {
- //TODO
}
}
}
@@ -252,9 +251,9 @@ Popup {
textRole: "displayText"
model: ListModel {
ListElement { displayText: "None" }
- ListElement { displayText: "SkyMaster HDR 708" }
- ListElement { displayText: "SkyVision Pro 519" }
- ListElement { displayText: "IMX462 Mini" }
+ ListElement { displayText: "SkyMasterHDR708" }
+ ListElement { displayText: "SkyVisionPro519" }
+ ListElement { displayText: "IMX462Mini" }
ListElement { displayText: "IMX477" }
ListElement { displayText: "IMX477m" }
ListElement { displayText: "IMX462" }
@@ -277,7 +276,7 @@ Popup {
textRole: "displayText"
model: ListModel {
ListElement { displayText: "None" }
- ListElement { displayText: "2MP Cameras" }
+ ListElement { displayText: "2MpCameras" }
ListElement { displayText: "CSIMX307" }
ListElement { displayText: "CSSC137" }
ListElement { displayText: "MVCAM" }
@@ -440,7 +439,7 @@ Popup {
imageWriter.setSetting("sbc", "rpi");
rpi=true;
rock5=false;
- rock3=true
+ rock3=false;
}
else if (fileName.includes("rock5a")) {
imageWriter.setSetting("sbc", "rock-5a");
@@ -460,6 +459,12 @@ Popup {
rock5=false;
rock3=true;
}
+ else{
+ imageWriter.setSetting("sbc", "unknown");
+ rpi=false;
+ rock5=false;
+ rock3=false;
+ }
}
function openPopup() {
diff --git a/src/downloadthread.cpp b/src/downloadthread.cpp
index 80348d4cb..b5b2c3a6e 100644
--- a/src/downloadthread.cpp
+++ b/src/downloadthread.cpp
@@ -1143,6 +1143,7 @@ bool DownloadThread::_customizeImage()
if (cam.open(QIODevice::WriteOnly))
{
if (sbcValue == "rpi"){
+ //Original Pi
if (cameraName == "OV5647"){
cameraValue="30";
}
@@ -1156,10 +1157,33 @@ bool DownloadThread::_customizeImage()
cameraValue="33";
}
else if (cameraName == "HDMI"){
- cameraValue="30";
+ cameraValue="20";
+ }
+ //Arducam Pi
+ else if (cameraName == "IMX708"){
+ cameraValue="40";
+ }
+ else if (cameraName == "IMX519"){
+ cameraValue="41";
+ }
+ else if (cameraName == "IMX477"){
+ cameraValue="42";
+ }
+ else if (cameraName == "IMX462"){
+ cameraValue="43";
+ }
+ else if (cameraName == "IMX327"){
+ cameraValue="44";
+ }
+ else if (cameraName == "IMX290"){
+ cameraValue="45";
+ }
+ else if (cameraName == "IMX462MINI"){
+ cameraValue="46";
+ }
+ else{
+ cameraValue="00";
}
-
- qDebug() << cameraValue;
}
else if (sbcValue == "zero3w"){
cameraValue="4";
From 0aa31de2d9c2c8a62714755db90dbde64adf299d Mon Sep 17 00:00:00 2001
From: Raphael <68374617+raphaelscholle@users.noreply.github.com>
Date: Fri, 16 Feb 2024 01:31:25 +0100
Subject: [PATCH 18/28] fix rpi cameras
---
src/OptionsPopup.qml | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/OptionsPopup.qml b/src/OptionsPopup.qml
index fb6910940..e56d88bcd 100644
--- a/src/OptionsPopup.qml
+++ b/src/OptionsPopup.qml
@@ -240,7 +240,7 @@ Popup {
onCurrentIndexChanged: {
var selectedCamera = model.get(currentIndex).displayText;
if (selectedCamera !== "None") {
- console.debug(selectedCamera)
+ camera = selectedCamera;
}
}
}
@@ -265,7 +265,7 @@ Popup {
onCurrentIndexChanged: {
var selectedCamera = model.get(currentIndex).displayText;
if (selectedCamera !== "None") {
- console.debug(selectedCamera)
+ camera = selectedCamera;
}
}
}
@@ -286,7 +286,7 @@ Popup {
onCurrentIndexChanged: {
var selectedCamera = model.get(currentIndex).displayText;
if (selectedCamera !== "None") {
- console.debug(selectedCamera)
+ camera = selectedCamera;
}
}
}
From 1b304d2ac40175530c9a7adc0d81e2daccd168e6 Mon Sep 17 00:00:00 2001
From: Raphael <68374617+raphaelscholle@users.noreply.github.com>
Date: Fri, 16 Feb 2024 01:43:13 +0100
Subject: [PATCH 19/28] add advanced
---
src/OptionsPopup.qml | 16 ++++++++++------
src/downloadthread.cpp | 8 ++++----
2 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/src/OptionsPopup.qml b/src/OptionsPopup.qml
index e56d88bcd..31b2e2fbc 100644
--- a/src/OptionsPopup.qml
+++ b/src/OptionsPopup.qml
@@ -187,24 +187,28 @@ Popup {
ListElement { displayText: "Raspberry" }
ListElement { displayText: "Arducam" }
ListElement { displayText: "Veye" }
+ ListElement { displayText: "Advanced" }
}
Layout.minimumWidth: 200
Layout.maximumHeight: 40
onCurrentIndexChanged: {
var selectedCameraVendor = model.get(currentIndex).displayText;
- if (selectedCameraVendor !== "Original" && selectedCameraVendor !== "Veye") {
+ if (selectedCameraVendor !== "Raspberry" && selectedCameraVendor !== "Veye" && selectedCameraVendor !== "Advanced") {
cameraSelectorArducam.visible=true
cameraSelectorVeye.visible=false
}
- else if (selectedCameraVendor !== "Original" && selectedCameraVendor !== "Arducam") {
+ else if (selectedCameraVendor !== "Raspberry" && selectedCameraVendor !== "Arducam" && selectedCameraVendor !== "Advanced") {
+ cameraSelectorVeye.visible=true
+ cameraSelectorArducam.visible=false
+ }
+ else if (selectedCameraVendor !== "Raspberry" && selectedCameraVendor !== "Arducam"&& selectedCameraVendor !== "Veye") {
cameraSelectorVeye.visible=true
cameraSelectorArducam.visible=false
}
-
}
}
ComboBox {
- id: advanced
+ id: cameraSelectorRpiAdvanced
visible:false
textRole: "displayText"
model: ListModel {
@@ -253,7 +257,7 @@ Popup {
ListElement { displayText: "None" }
ListElement { displayText: "SkyMasterHDR708" }
ListElement { displayText: "SkyVisionPro519" }
- ListElement { displayText: "IMX462Mini" }
+ ListElement { displayText: "IMX462MINI" }
ListElement { displayText: "IMX477" }
ListElement { displayText: "IMX477m" }
ListElement { displayText: "IMX462" }
@@ -276,7 +280,7 @@ Popup {
textRole: "displayText"
model: ListModel {
ListElement { displayText: "None" }
- ListElement { displayText: "2MpCameras" }
+ ListElement { displayText: "2MPCAMERAS" }
ListElement { displayText: "CSIMX307" }
ListElement { displayText: "CSSC137" }
ListElement { displayText: "MVCAM" }
diff --git a/src/downloadthread.cpp b/src/downloadthread.cpp
index b5b2c3a6e..ea8528001 100644
--- a/src/downloadthread.cpp
+++ b/src/downloadthread.cpp
@@ -1160,13 +1160,13 @@ bool DownloadThread::_customizeImage()
cameraValue="20";
}
//Arducam Pi
- else if (cameraName == "IMX708"){
+ else if (cameraName == "SkyMasterHDR708"){
cameraValue="40";
}
- else if (cameraName == "IMX519"){
+ else if (cameraName == "SkyVisionPro519"){
cameraValue="41";
}
- else if (cameraName == "IMX477"){
+ else if (cameraName == "IMX477m"){
cameraValue="42";
}
else if (cameraName == "IMX462"){
@@ -1182,7 +1182,7 @@ bool DownloadThread::_customizeImage()
cameraValue="46";
}
else{
- cameraValue="00";
+ cameraValue="0";
}
}
else if (sbcValue == "zero3w"){
From 365e00bb79c931eedd4e222db7a99539f6986bb6 Mon Sep 17 00:00:00 2001
From: Raphael <68374617+raphaelscholle@users.noreply.github.com>
Date: Fri, 16 Feb 2024 01:44:46 +0100
Subject: [PATCH 20/28] Update OptionsPopup.qml
---
src/OptionsPopup.qml | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/OptionsPopup.qml b/src/OptionsPopup.qml
index 31b2e2fbc..25d497147 100644
--- a/src/OptionsPopup.qml
+++ b/src/OptionsPopup.qml
@@ -196,14 +196,17 @@ Popup {
if (selectedCameraVendor !== "Raspberry" && selectedCameraVendor !== "Veye" && selectedCameraVendor !== "Advanced") {
cameraSelectorArducam.visible=true
cameraSelectorVeye.visible=false
+ cameraSelectorRpiAdvanced=false
}
else if (selectedCameraVendor !== "Raspberry" && selectedCameraVendor !== "Arducam" && selectedCameraVendor !== "Advanced") {
cameraSelectorVeye.visible=true
cameraSelectorArducam.visible=false
+ cameraSelectorRpiAdvanced=false
}
else if (selectedCameraVendor !== "Raspberry" && selectedCameraVendor !== "Arducam"&& selectedCameraVendor !== "Veye") {
- cameraSelectorVeye.visible=true
+ cameraSelectorVeye.visible=false
cameraSelectorArducam.visible=false
+ cameraSelectorRpiAdvanced.visible=true
}
}
}
From d393775cb2bde45f04308582666e6cd450f38249 Mon Sep 17 00:00:00 2001
From: Raphael <68374617+raphaelscholle@users.noreply.github.com>
Date: Fri, 16 Feb 2024 01:46:04 +0100
Subject: [PATCH 21/28] Update OptionsPopup.qml
---
src/OptionsPopup.qml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/OptionsPopup.qml b/src/OptionsPopup.qml
index 25d497147..19f25ca1c 100644
--- a/src/OptionsPopup.qml
+++ b/src/OptionsPopup.qml
@@ -217,7 +217,7 @@ Popup {
model: ListModel {
ListElement { displayText: "None" }
ListElement { displayText: "FILESRC" }
- ListElement { displayText: "IP-Camera" }
+ ListElement { displayText: "IP-CAMERA" }
ListElement { displayText: "EXTERNAL" }
}
Layout.minimumWidth: 200
@@ -225,6 +225,7 @@ Popup {
onCurrentIndexChanged: {
var selectedCamera = model.get(currentIndex).displayText;
if (selectedCamera !== "None") {
+ camera = selectedCamera;
}
}
}
From 5165b0f646dd6ae9663f8e4444caf627cdda3773 Mon Sep 17 00:00:00 2001
From: Raphael <68374617+raphaelscholle@users.noreply.github.com>
Date: Fri, 16 Feb 2024 02:11:33 +0100
Subject: [PATCH 22/28] rock-stuff
---
src/OptionsPopup.qml | 18 ++++++----
src/downloadthread.cpp | 78 +++++++++++++++++++++++++++++++++++-------
2 files changed, 78 insertions(+), 18 deletions(-)
diff --git a/src/OptionsPopup.qml b/src/OptionsPopup.qml
index 19f25ca1c..f2dc7b92a 100644
--- a/src/OptionsPopup.qml
+++ b/src/OptionsPopup.qml
@@ -132,9 +132,13 @@ Popup {
textRole: "displayText"
model: ListModel {
ListElement { displayText: "NONE" }
+ ListElement { displayText: "HDMI" }
+ ListElement { displayText: "OV5647" }
+ ListElement { displayText: "IMX219" }
ListElement { displayText: "IMX415" }
ListElement { displayText: "IMX462" }
- ListElement { displayText: "HDMI" }
+ ListElement { displayText: "IMX708" }
+ // ListElement { displayText: "OHD-JAGUAR" }
}
onCurrentIndexChanged: {
var selectedCamera = model.get(currentIndex).displayText;
@@ -162,7 +166,7 @@ Popup {
ListElement { displayText: "IMX219" }
ListElement { displayText: "OV5647" }
ListElement { displayText: "IMX708" }
- ListElement { displayText: "OHD-Jaguar" }
+ // ListElement { displayText: "OHD-JAGUAR" }
}
onCurrentIndexChanged: {
var selectedCamera = model.get(currentIndex).displayText;
@@ -196,29 +200,31 @@ Popup {
if (selectedCameraVendor !== "Raspberry" && selectedCameraVendor !== "Veye" && selectedCameraVendor !== "Advanced") {
cameraSelectorArducam.visible=true
cameraSelectorVeye.visible=false
- cameraSelectorRpiAdvanced=false
+ cameraSelectorAdvanced=false
}
else if (selectedCameraVendor !== "Raspberry" && selectedCameraVendor !== "Arducam" && selectedCameraVendor !== "Advanced") {
cameraSelectorVeye.visible=true
cameraSelectorArducam.visible=false
- cameraSelectorRpiAdvanced=false
+ cameraSelectorAdvanced=false
}
else if (selectedCameraVendor !== "Raspberry" && selectedCameraVendor !== "Arducam"&& selectedCameraVendor !== "Veye") {
cameraSelectorVeye.visible=false
cameraSelectorArducam.visible=false
- cameraSelectorRpiAdvanced.visible=true
+ cameraSelectorAdvanced.visible=true
}
}
}
ComboBox {
- id: cameraSelectorRpiAdvanced
+ id: cameraSelectorAdvanced
visible:false
textRole: "displayText"
model: ListModel {
ListElement { displayText: "None" }
+ ListElement { displayText: "USB" }
ListElement { displayText: "FILESRC" }
ListElement { displayText: "IP-CAMERA" }
ListElement { displayText: "EXTERNAL" }
+ ListElement { displayText: "TESTPATTERN" }
}
Layout.minimumWidth: 200
Layout.maximumHeight: 40
diff --git a/src/downloadthread.cpp b/src/downloadthread.cpp
index ea8528001..62d246f7c 100644
--- a/src/downloadthread.cpp
+++ b/src/downloadthread.cpp
@@ -1143,7 +1143,7 @@ bool DownloadThread::_customizeImage()
if (cam.open(QIODevice::WriteOnly))
{
if (sbcValue == "rpi"){
- //Original Pi
+ //RaspberryPi
if (cameraName == "OV5647"){
cameraValue="30";
}
@@ -1159,7 +1159,7 @@ bool DownloadThread::_customizeImage()
else if (cameraName == "HDMI"){
cameraValue="20";
}
- //Arducam Pi
+ //Arducam
else if (cameraName == "SkyMasterHDR708"){
cameraValue="40";
}
@@ -1181,28 +1181,82 @@ bool DownloadThread::_customizeImage()
else if (cameraName == "IMX462MINI"){
cameraValue="46";
}
- else{
- cameraValue="0";
+ //Veye
+ else if (cameraName == "2MPCAMERAS"){
+ cameraValue="60";
+ }
+ else if (cameraName == "CSIMX307"){
+ cameraValue="61";
}
+ else if (cameraName == "CSSC137"){
+ cameraValue="62";
+ }
+ else if (cameraName == "MVCAM"){
+ cameraValue="63";
+ }
}
else if (sbcValue == "zero3w"){
- cameraValue="4";
- qDebug() << cameraValue;
+ if (cameraName == "HDMI"){
+ cameraValue="90";
+ }
+ if (cameraName == "IMX219"){
+ cameraValue="92";
+ }
+ else if (cameraName == "OV5647"){
+ cameraValue="91";
+ }
+ else if (cameraName == "IMX708"){
+ cameraValue="93";
+ }
+ else if (cameraName == "OHD-JAGUAR"){
+ cameraValue="94";
+ }
}
else if ((sbcValue == "rock-5b") || (sbcValue == "rock-5a")) {
- cameraValue="5";
- qDebug() << cameraValue;
+ if (cameraName == "HDMI"){
+ cameraValue="80";
+ }
+ if (cameraName == "IMX219"){
+ cameraValue="82";
+ }
+ else if (cameraName == "OV5647"){
+ cameraValue="81";
+ }
+ else if (cameraName == "IMX708"){
+ cameraValue="83";
+ }
+ else if (cameraName == "IMX462"){
+ cameraValue="84";
+ }
+ else if (cameraName == "IMX415"){
+ cameraValue="85";
+ }
+ else if (cameraName == "OHD-JAGUAR"){
+ cameraValue="86";
+ }
}
+ if (cameraName == "FILESRC"){
+ cameraValue="4";
+ }
+ else if (cameraName == "IP-CAMERA"){
+ cameraValue="3";
+ }
+ else if (cameraName == "EXTERNAL"){
+ cameraValue="2";
+ }
+ else if (cameraName == "USB"){
+ cameraValue="1";
+ }
+ else if (cameraName == "TESTPATTERN"){
+ cameraValue="0";
+ }
+
QByteArray camBytes = cameraValue.toUtf8();
qint64 bytesWritten = cam.write(camBytes);
cam.close();
-
-
-
-
if (bytesWritten == camBytes.length())
{
// Successfully wrote the camera to the file
From ec85dc6d32433ff3d335b5fbeca450279c80b0b1 Mon Sep 17 00:00:00 2001
From: Raphael <68374617+raphaelscholle@users.noreply.github.com>
Date: Fri, 16 Feb 2024 02:15:52 +0100
Subject: [PATCH 23/28] Update OptionsPopup.qml
---
src/OptionsPopup.qml | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/OptionsPopup.qml b/src/OptionsPopup.qml
index f2dc7b92a..46506a68e 100644
--- a/src/OptionsPopup.qml
+++ b/src/OptionsPopup.qml
@@ -201,16 +201,25 @@ Popup {
cameraSelectorArducam.visible=true
cameraSelectorVeye.visible=false
cameraSelectorAdvanced=false
+ cameraSelectorRpiOriginal.visible=false
}
else if (selectedCameraVendor !== "Raspberry" && selectedCameraVendor !== "Arducam" && selectedCameraVendor !== "Advanced") {
cameraSelectorVeye.visible=true
cameraSelectorArducam.visible=false
cameraSelectorAdvanced=false
+ cameraSelectorRpiOriginal.visible=false
}
else if (selectedCameraVendor !== "Raspberry" && selectedCameraVendor !== "Arducam"&& selectedCameraVendor !== "Veye") {
cameraSelectorVeye.visible=false
cameraSelectorArducam.visible=false
cameraSelectorAdvanced.visible=true
+ cameraSelectorRpiOriginal.visible=false
+ }
+ else if (selectedCameraVendor !== "Advanced" && selectedCameraVendor !== "Arducam"&& selectedCameraVendor !== "Veye") {
+ cameraSelectorVeye.visible=false
+ cameraSelectorArducam.visible=false
+ cameraSelectorAdvanced.visible=false
+ cameraSelectorRpiOriginal.visible=true
}
}
}
From ce83eb4273925f1900d9f2eaf0c629a1c696dd6d Mon Sep 17 00:00:00 2001
From: Raphael <68374617+raphaelscholle@users.noreply.github.com>
Date: Fri, 16 Feb 2024 02:24:03 +0100
Subject: [PATCH 24/28] increase version and improve details
---
debian/changelog | 5 +++++
src/CMakeLists.txt | 4 ++--
src/main.qml | 26 +++++++++++++-------------
3 files changed, 20 insertions(+), 15 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 3170392cd..b3e0a1451 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,8 @@
+openhdimagewriter (2.0.2) stable; urgency=high
+
+ * add camera selection for about all boards
+
+ -- Raphael Scholle Sat, 02 Sep 2023 02:06:52 +0100
openhdimagewriter (2.0.1) stable; urgency=high
* TODO
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index a8fd143a0..a0e3e8def 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -12,8 +12,8 @@ OPTION (ENABLE_TELEMETRY "Enable sending telemetry" ON)
project(OpenHDImageWriter LANGUAGES CXX C)
set(IMAGER_VERSION_MAJOR 2)
set(IMAGER_VERSION_MINOR 0)
-set(IMAGER_VERSION_STR "${IMAGER_VERSION_MAJOR}.${IMAGER_VERSION_MINOR}.1")
-set(IMAGER_VERSION_CSV "${IMAGER_VERSION_MAJOR},${IMAGER_VERSION_MINOR},0,0")
+set(IMAGER_VERSION_STR "${IMAGER_VERSION_MAJOR}.${IMAGER_VERSION_MINOR}.2")
+set(IMAGER_VERSION_CSV "${IMAGER_VERSION_MAJOR},${IMAGER_VERSION_MINOR},2,0")
add_definitions(-DIMAGER_VERSION_STR="${IMAGER_VERSION_STR}")
add_definitions(-DIMAGER_VERSION_CSV=${IMAGER_VERSION_CSV})
diff --git a/src/main.qml b/src/main.qml
index bf2b17bbc..cfb84d56d 100644
--- a/src/main.qml
+++ b/src/main.qml
@@ -153,19 +153,19 @@ ApplicationWindow {
}
- RowLayout {
- Text {
- text: "sbc:"
- font.bold: true
- }
-
- Text {
- text: optionspopup.sbc
- font.bold: false
- color: "grey"
-
- }
- }
+ // RowLayout {
+ // Text {
+ // text: "sbc:"
+ // font.bold: true
+ // }
+
+ // Text {
+ // text: optionspopup.sbc
+ // font.bold: false
+ // color: "grey"
+
+ // }
+ // }
RowLayout {
Text {
From 00bae5dc46e2b31f8582e7f2ab4ba4bb6e15ae2d Mon Sep 17 00:00:00 2001
From: Raphael <68374617+raphaelscholle@users.noreply.github.com>
Date: Fri, 16 Feb 2024 02:31:16 +0100
Subject: [PATCH 25/28] Update OptionsPopup.qml
---
src/OptionsPopup.qml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/OptionsPopup.qml b/src/OptionsPopup.qml
index 46506a68e..16a3af748 100644
--- a/src/OptionsPopup.qml
+++ b/src/OptionsPopup.qml
@@ -200,13 +200,13 @@ Popup {
if (selectedCameraVendor !== "Raspberry" && selectedCameraVendor !== "Veye" && selectedCameraVendor !== "Advanced") {
cameraSelectorArducam.visible=true
cameraSelectorVeye.visible=false
- cameraSelectorAdvanced=false
+ cameraSelectorAdvanced.visible=false
cameraSelectorRpiOriginal.visible=false
}
else if (selectedCameraVendor !== "Raspberry" && selectedCameraVendor !== "Arducam" && selectedCameraVendor !== "Advanced") {
cameraSelectorVeye.visible=true
cameraSelectorArducam.visible=false
- cameraSelectorAdvanced=false
+ cameraSelectorAdvanced.visible=false
cameraSelectorRpiOriginal.visible=false
}
else if (selectedCameraVendor !== "Raspberry" && selectedCameraVendor !== "Arducam"&& selectedCameraVendor !== "Veye") {
From 29940273264cef4d780d3844ba939040895f892a Mon Sep 17 00:00:00 2001
From: Raphael <68374617+raphaelscholle@users.noreply.github.com>
Date: Tue, 5 Mar 2024 16:07:19 +0100
Subject: [PATCH 26/28] readd ignore paths
---
.github/workflows/macos.yml | 7 ++++++-
.github/workflows/ubuntu20.04.yml | 7 ++++++-
.github/workflows/ubuntu22.04.yml | 7 ++++++-
.github/workflows/ubuntu23.04.yml | 6 ++++++
4 files changed, 24 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml
index 28da0201d..8f3388ea9 100644
--- a/.github/workflows/macos.yml
+++ b/.github/workflows/macos.yml
@@ -7,7 +7,12 @@ on:
- "dev-release"
- "release"
- "macosx"
-
+ paths-ignore:
+ - '**.md'
+ - '**.asciidoc'
+ - '**.adoc'
+ - '.gitignore'
+ - 'LICENSE'
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
diff --git a/.github/workflows/ubuntu20.04.yml b/.github/workflows/ubuntu20.04.yml
index 329ac30ae..6249f78e2 100644
--- a/.github/workflows/ubuntu20.04.yml
+++ b/.github/workflows/ubuntu20.04.yml
@@ -9,7 +9,12 @@ on:
- "2.5-evo"
- "dev-release"
- "release"
-
+ paths-ignore:
+ - '**.md'
+ - '**.asciidoc'
+ - '**.adoc'
+ - '.gitignore'
+ - 'LICENSE'
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
diff --git a/.github/workflows/ubuntu22.04.yml b/.github/workflows/ubuntu22.04.yml
index f693e4b03..15302dadf 100644
--- a/.github/workflows/ubuntu22.04.yml
+++ b/.github/workflows/ubuntu22.04.yml
@@ -9,7 +9,12 @@ on:
- "dev-release"
- "release"
- "2.0"
-
+ paths-ignore:
+ - '**.md'
+ - '**.asciidoc'
+ - '**.adoc'
+ - '.gitignore'
+ - 'LICENSE'
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
diff --git a/.github/workflows/ubuntu23.04.yml b/.github/workflows/ubuntu23.04.yml
index cf8c041e5..e8aad584d 100644
--- a/.github/workflows/ubuntu23.04.yml
+++ b/.github/workflows/ubuntu23.04.yml
@@ -9,6 +9,12 @@ on:
- "2.5-evo"
- "dev-release"
- "release"
+ paths-ignore:
+ - '**.md'
+ - '**.asciidoc'
+ - '**.adoc'
+ - '.gitignore'
+ - 'LICENSE'
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
From c8ba205e7ff32d092a3da155926cfeae2c9924b1 Mon Sep 17 00:00:00 2001
From: Raphael <68374617+raphaelscholle@users.noreply.github.com>
Date: Tue, 5 Mar 2024 16:09:01 +0100
Subject: [PATCH 27/28] spacing
---
.github/workflows/macos.yml | 2 +-
.github/workflows/ubuntu20.04.yml | 1 +
.github/workflows/ubuntu22.04.yml | 3 ++-
3 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml
index 8f3388ea9..9609cea12 100644
--- a/.github/workflows/macos.yml
+++ b/.github/workflows/macos.yml
@@ -7,7 +7,7 @@ on:
- "dev-release"
- "release"
- "macosx"
- paths-ignore:
+ paths-ignore:
- '**.md'
- '**.asciidoc'
- '**.adoc'
diff --git a/.github/workflows/ubuntu20.04.yml b/.github/workflows/ubuntu20.04.yml
index 6249f78e2..641d65668 100644
--- a/.github/workflows/ubuntu20.04.yml
+++ b/.github/workflows/ubuntu20.04.yml
@@ -15,6 +15,7 @@ on:
- '**.adoc'
- '.gitignore'
- 'LICENSE'
+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
diff --git a/.github/workflows/ubuntu22.04.yml b/.github/workflows/ubuntu22.04.yml
index 15302dadf..513722c95 100644
--- a/.github/workflows/ubuntu22.04.yml
+++ b/.github/workflows/ubuntu22.04.yml
@@ -9,12 +9,13 @@ on:
- "dev-release"
- "release"
- "2.0"
- paths-ignore:
+ paths-ignore:
- '**.md'
- '**.asciidoc'
- '**.adoc'
- '.gitignore'
- 'LICENSE'
+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
From 76326a223dadfd4681a58bca25b82f304d4b334a Mon Sep 17 00:00:00 2001
From: Raphael <68374617+raphaelscholle@users.noreply.github.com>
Date: Tue, 5 Mar 2024 16:11:42 +0100
Subject: [PATCH 28/28] testing
---
.github/workflows/macos.yml | 4 ++--
.github/workflows/ubuntu20.04.yml | 2 +-
.github/workflows/ubuntu22.04.yml | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml
index 9609cea12..6ae32bd90 100644
--- a/.github/workflows/macos.yml
+++ b/.github/workflows/macos.yml
@@ -6,13 +6,13 @@ on:
- "2.5-evo"
- "dev-release"
- "release"
- - "macosx"
paths-ignore:
- '**.md'
- '**.asciidoc'
- '**.adoc'
- '.gitignore'
- - 'LICENSE'
+ - 'LICENSE'
+
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
diff --git a/.github/workflows/ubuntu20.04.yml b/.github/workflows/ubuntu20.04.yml
index 641d65668..8f7b03267 100644
--- a/.github/workflows/ubuntu20.04.yml
+++ b/.github/workflows/ubuntu20.04.yml
@@ -15,7 +15,7 @@ on:
- '**.adoc'
- '.gitignore'
- 'LICENSE'
-
+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
diff --git a/.github/workflows/ubuntu22.04.yml b/.github/workflows/ubuntu22.04.yml
index 513722c95..57c4532db 100644
--- a/.github/workflows/ubuntu22.04.yml
+++ b/.github/workflows/ubuntu22.04.yml
@@ -15,7 +15,7 @@ on:
- '**.adoc'
- '.gitignore'
- 'LICENSE'
-
+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"