diff options
author | Bramastyo Harimukti Santoso <bram.santoso@qt.io> | 2021-01-19 16:23:52 +0100 |
---|---|---|
committer | Bramastyo Harimukti Santoso <bram.santoso@qt.io> | 2021-01-19 16:47:09 +0100 |
commit | df878f3935fe28dd3d7253b9fa59d65db331eed0 (patch) | |
tree | df27168c9196d4ff4458f86a9fefdd6ecee84d47 /src/neptune-cluster-app | |
parent | 88c1d70ca626be6420160c6218e07867541ae8e3 (diff) | |
parent | e5dcdea6750b7689feae69083f39f283cc79b9b1 (diff) |
Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I6f570e6c387b10e7c07e925429d275761bdf6cda
Diffstat (limited to 'src/neptune-cluster-app')
79 files changed, 2148 insertions, 0 deletions
diff --git a/src/neptune-cluster-app/ClusterRootStore.qml b/src/neptune-cluster-app/ClusterRootStore.qml new file mode 100644 index 00000000..5f5c5f94 --- /dev/null +++ b/src/neptune-cluster-app/ClusterRootStore.qml @@ -0,0 +1,163 @@ +/**************************************************************************** +** +** Copyright (C) 2019 Luxoft Sweden AB +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Neptune 3 UI. +** +** $QT_BEGIN_LICENSE:GPL-QTAS$ +** Commercial License Usage +** Licensees holding valid commercial Qt Automotive Suite licenses may use +** this file in accordance with the commercial license agreement provided +** with the Software or, alternatively, in accordance with the terms +** contained in a written agreement between you and The Qt Company. For +** licensing terms and conditions see https://www.qt.io/terms-conditions. +** For further information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** SPDX-License-Identifier: GPL-3.0 +** +****************************************************************************/ + +import QtQuick 2.8 +import shared.com.pelagicore.remotesettings 1.0 +import shared.com.pelagicore.drivedata 1.0 +import shared.utils 1.0 + +import "../apps/com.theqtcompany.cluster/stores" 1.0 + +RootStoreInterface { + id: root + + property bool devMode: false + onDevModeChanged: { Config.showCursorIndicator = root.devMode; } + + readonly property InstrumentCluster clusterDataSource: InstrumentCluster {} + /*! + \qmlproperty UISettings ClusterStore::uiSettings + Needed here to get twentyFourHourTimeFormat + */ + readonly property UISettings uiSettings: UISettings {} + // true if QtSafeRenderer is enabled + + vehicleInterface: VehicleInterface { + speed: clusterDataSource.speed + speedLimit: clusterDataSource.speedLimit + speedCruise: clusterDataSource.speedCruise + driveTrainState: clusterDataSource.driveTrainState + ePower: clusterDataSource.ePower + drivingMode: clusterDataSource.drivingMode + drivingModeRangeKm: clusterDataSource.drivingModeRangeKm + drivingModeECORangeKm: clusterDataSource.drivingModeECORangeKm + + mileage: localization.calculateDistanceValue(clusterDataSource.mileageKm) + + lowBeamHeadlight: clusterDataSource.lowBeamHeadlight + highBeamHeadlight: clusterDataSource.highBeamHeadlight + fogLight: clusterDataSource.fogLight + stabilityControl: clusterDataSource.stabilityControl + seatBeltFasten: clusterDataSource.seatBeltNotFastened + leftTurn: clusterDataSource.leftTurn + + rightTurn: clusterDataSource.rightTurn + absFailure: clusterDataSource.ABSFailure + parkBrake: clusterDataSource.parkBrake + tyrePressureLow: clusterDataSource.tyrePressureLow + brakeFailure: clusterDataSource.brakeFailure + airbagFailure: clusterDataSource.airbagFailure + } + + behaviourInterface: BehaviourInterface { + Loader { + visible: false + source: "../apps/com.theqtcompany.cluster/helpers/Qt3DStudioAvailable.qml" + onLoaded: { + root.behaviourInterface.qt3DStudioAvailable = true + source = "" + } + } + + threeDGauges: qt3DStudioAvailable && uiSettings.threeDGauges + hideGauges: uiSettings.hideGauges + navigationMode: uiSettings.navigationMode + } + + externalDataInterface: ExternalDataInterface { + outsideTemperature: QtObject { + readonly property real value: clusterDataSource.outsideTemperatureCelsius + + readonly property real minValue: -100 + readonly property real maxValue: 100 + readonly property real stepValue: 0.5 + readonly property real localizedValue: localization.calculateUnitValue(value) + readonly property string valueString: Number(localizedValue).toLocaleString(Qt.locale(), 'f', 1) + readonly property string localizedUnits: root.localization.temperature + } + + currentDate: new Date(); + readonly property QtObject d_timer: Timer { + interval: 1000 + repeat: true + running: true + onTriggered: parent.currentDate = new Date() + } + + readonly property real navigationProgressPercents: clusterDataSource.navigationProgressPercents + readonly property real navigationRouteDistanceKm: clusterDataSource.navigationRouteDistanceKm + } + + + readonly property QtObject localization: QtObject { + property string mileageUnits: { + if (Qt.locale().measurementSystem === Locale.MetricSystem) + return qsTr("km") + else + return qsTr("mi") + } + + readonly property string speedUnits: { + if (Qt.locale().measurementSystem === Locale.MetricSystem) + return qsTr("km/h") + else + return qsTr("mph") + } + + readonly property string temperature: { + if (Qt.locale().measurementSystem === Locale.MetricSystem) + return qsTr("°C") + else + return qsTr("°F") + } + + readonly property bool twentyFourHourTimeFormat: uiSettings.twentyFourHourTimeFormat + + /*! + Convert distance from km to mi + */ + function calculateDistanceValue(value) { + return Qt.locale().measurementSystem === Locale.MetricSystem + ? value + : value / 1.60934 + } + + /*! + Convert temperature from C to F + */ + function calculateUnitValue(value) { + // Default value is the celsius + return Qt.locale().measurementSystem === Locale.MetricSystem + ? value + : Math.round(value * 1.8 + 32.0) + } + } +} diff --git a/src/neptune-cluster-app/Launcher.qml b/src/neptune-cluster-app/Launcher.qml new file mode 100644 index 00000000..e31d3866 --- /dev/null +++ b/src/neptune-cluster-app/Launcher.qml @@ -0,0 +1,93 @@ +/**************************************************************************** +** +** Copyright (C) 2019 Luxoft Sweden AB +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Neptune 3 UI. +** +** $QT_BEGIN_LICENSE:GPL-QTAS$ +** Commercial License Usage +** Licensees holding valid commercial Qt Automotive Suite licenses may use +** this file in accordance with the commercial license agreement provided +** with the Software or, alternatively, in accordance with the terms +** contained in a written agreement between you and The Qt Company. For +** licensing terms and conditions see https://www.qt.io/terms-conditions. +** For further information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** SPDX-License-Identifier: GPL-3.0 +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls 2.5 +import Qt.labs.folderlistmodel 2.2 + +import shared.Sizes 1.0 + +import "../sysui/launcher" 1.0 + +Item { + id: root + + signal appClicked(var appUrl) + + ButtonGroup { + id: buttonGroup + } + + readonly property int buttonWidth: Sizes.dp(100) + + ListView { + id: appsLauncher + interactive: false + LayoutMirroring.enabled: false + orientation: Qt.Horizontal + height: buttonWidth + width: (buttonWidth + spacing) * flModel.count - spacing + spacing: buttonWidth / 4 + anchors.top: parent.top + anchors.topMargin: Sizes.dp(30) + anchors.horizontalCenter: parent.horizontalCenter + + model: FolderListModel { + id: flModel + showDirs: true + showDotAndDotDot: false + folder: "apps" + nameFilters: [ "*-ic" ] + } + + delegate: + Item { + id: delegateRoot + width: buttonWidth + height: width + + AppButton { + id: appButton + z: 40 + ButtonGroup.group: buttonGroup + anchors.fill: parent + editModeBgOpacity: 0.0 + + icon.name: Qt.resolvedUrl("apps/" + fileName + '/' + 'icon.png') + gridOpen: false + + onClicked: { + root.appClicked(Qt.resolvedUrl("apps/" + fileName + '/' + 'Main.qml')); + } + } + } + } +} diff --git a/src/neptune-cluster-app/MockedWindows.qml b/src/neptune-cluster-app/MockedWindows.qml new file mode 100644 index 00000000..0ae38109 --- /dev/null +++ b/src/neptune-cluster-app/MockedWindows.qml @@ -0,0 +1,78 @@ +/**************************************************************************** +** +** Copyright (C) 2019 Luxoft Sweden AB +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Neptune 3 UI. +** +** $QT_BEGIN_LICENSE:GPL-QTAS$ +** Commercial License Usage +** Licensees holding valid commercial Qt Automotive Suite licenses may use +** this file in accordance with the commercial license agreement provided +** with the Software or, alternatively, in accordance with the terms +** contained in a written agreement between you and The Qt Company. For +** licensing terms and conditions see https://www.qt.io/terms-conditions. +** For further information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** SPDX-License-Identifier: GPL-3.0 +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Controls 2.12 + +Item { + id: root + + QtObject { + id: d + property string currentApp: "" + } + + function runApp(appUrl) { + d.currentApp = appUrl; + for (var i = 0; i < runningApps.count; ++i) { + if (runningApps.get(i).appUrl === appUrl) { + return; + } + } + + runningApps.append({"appUrl": appUrl}); + } + + ListModel { + id: runningApps + } + + Repeater { + model: runningApps + delegate: Item { + width: root.width + height: root.height + opacity: Number(appUrl === d.currentApp) + + Behavior on opacity { + NumberAnimation { duration: 300 } + } + + Loader { + x: 0 + y: 0 + width: root.width + height: root.height + source: appUrl + } + } + } +} diff --git a/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/+lucee/icon.png b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/+lucee/icon.png new file mode 100644 index 00000000..8df8de22 --- /dev/null +++ b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/+lucee/icon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cff47f6c6ba5b27ceeb3fbe1a4aca8e04a572a802eaa9fc518c475c66121a726 +size 820 diff --git a/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/Main.qml b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/Main.qml new file mode 100644 index 00000000..6fd94bf9 --- /dev/null +++ b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/Main.qml @@ -0,0 +1,45 @@ +/**************************************************************************** +** +** Copyright (C) 2019 Luxoft Sweden AB +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Neptune 3 UI. +** +** $QT_BEGIN_LICENSE:GPL-QTAS$ +** Commercial License Usage +** Licensees holding valid commercial Qt Automotive Suite licenses may use +** this file in accordance with the commercial license agreement provided +** with the Software or, alternatively, in accordance with the terms +** contained in a written agreement between you and The Qt Company. For +** licensing terms and conditions see https://www.qt.io/terms-conditions. +** For further information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** SPDX-License-Identifier: GPL-3.0 +** +****************************************************************************/ + +import QtQuick 2.13 +import QtQuick.Controls 2.2 + +import "views" 1.0 +import "stores" 1.0 + +Item { + id: root + VehicleICView { + id: vehicleView + anchors.fill: parent + store: VehicleStore {} + } +} diff --git a/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/assets/images/ic_background.png b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/assets/images/ic_background.png new file mode 100644 index 00000000..688d76ac --- /dev/null +++ b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/assets/images/ic_background.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5dd6453804435baf851d413af4dbadcf7f66dfab2d27bbb76867b94235c9fdf9 +size 2152197 diff --git a/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/assets/images/ic_bodyVehicle.png b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/assets/images/ic_bodyVehicle.png new file mode 100644 index 00000000..e073a734 --- /dev/null +++ b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/assets/images/ic_bodyVehicle.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1a7bae1ace4bb0aadb90c5f49cdc4adbbbd84eaccdc65c808a1225c86bb45635 +size 512144 diff --git a/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/assets/images/ic_leftDoorAlarmVehicle.png b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/assets/images/ic_leftDoorAlarmVehicle.png new file mode 100644 index 00000000..f842d030 --- /dev/null +++ b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/assets/images/ic_leftDoorAlarmVehicle.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8a2a2d379b2c4b9b1f7d7a86a439d1903d6b34f98e0c3b67aa77b54a3d05ba80 +size 21785 diff --git a/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/assets/images/ic_leftDoorClosedVehicle.png b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/assets/images/ic_leftDoorClosedVehicle.png new file mode 100644 index 00000000..9ee2ee68 --- /dev/null +++ b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/assets/images/ic_leftDoorClosedVehicle.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d3503b3e5e819e81acbd911dcd2fc52a8c0e4ca1e630cfc53f1ab4aa314f5fb6 +size 17413 diff --git a/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/assets/images/ic_leftDoorOpenedVehicle.png b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/assets/images/ic_leftDoorOpenedVehicle.png new file mode 100644 index 00000000..38dbd90e --- /dev/null +++ b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/assets/images/ic_leftDoorOpenedVehicle.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b9c6465128a67ad4b3d5f824360ade07f2b2e2435ee29656d8d711bfec5db4e6 +size 28896 diff --git a/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/assets/images/ic_leftDoorOpenedVehicleCarPart.png b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/assets/images/ic_leftDoorOpenedVehicleCarPart.png new file mode 100644 index 00000000..78d39e32 --- /dev/null +++ b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/assets/images/ic_leftDoorOpenedVehicleCarPart.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3d644a0d270aeb8b714ec4817e0c548d5dd135d65d5ddffc65677821429fbc3e +size 16172 diff --git a/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/assets/images/ic_rightDoorAlarmVehicle.png b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/assets/images/ic_rightDoorAlarmVehicle.png new file mode 100644 index 00000000..cf7f3df6 --- /dev/null +++ b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/assets/images/ic_rightDoorAlarmVehicle.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e904cc9f549160e0b1e0776b3dfca656747b2f79f50d10c80881b2be475b8641 +size 22053 diff --git a/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/assets/images/ic_rightDoorClosedVehicle.png b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/assets/images/ic_rightDoorClosedVehicle.png new file mode 100644 index 00000000..395edf52 --- /dev/null +++ b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/assets/images/ic_rightDoorClosedVehicle.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d7f0e0601161026dc854e87468e2e1d8df59352e559c7bc3022de7d7aa7cb80f +size 17402 diff --git a/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/assets/images/ic_rightDoorOpenedVehicle.png b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/assets/images/ic_rightDoorOpenedVehicle.png new file mode 100644 index 00000000..61ab3378 --- /dev/null +++ b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/assets/images/ic_rightDoorOpenedVehicle.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:68e5a6494e414814a6df5ff4b7e12b66e111ebc50f76730637928a253e3badca +size 21292 diff --git a/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/assets/images/ic_rightDoorOpenedVehicleCarPart.png b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/assets/images/ic_rightDoorOpenedVehicleCarPart.png new file mode 100644 index 00000000..057baa0c --- /dev/null +++ b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/assets/images/ic_rightDoorOpenedVehicleCarPart.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4fef57fff1b565394e62f4cc2a546226823289c70ec7b25bb403d271b3b77513 +size 15670 diff --git a/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/assets/images/ic_roofAlarmVehicle.png b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/assets/images/ic_roofAlarmVehicle.png new file mode 100644 index 00000000..c64a9897 --- /dev/null +++ b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/assets/images/ic_roofAlarmVehicle.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b50192635b09c8a1f7e45436f0c7003e969a76bf9cda8a58e3d57822cb5da1ec +size 13721 diff --git a/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/assets/images/ic_roofClosedVehicle.png b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/assets/images/ic_roofClosedVehicle.png new file mode 100644 index 00000000..58f9ba0d --- /dev/null +++ b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/assets/images/ic_roofClosedVehicle.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7337bc5e8f9be8b0ce310a08d814c4c858f781f4f566f8d91bd312798d9f0527 +size 6878 diff --git a/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/assets/images/ic_roofOpenedVehicle.png b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/assets/images/ic_roofOpenedVehicle.png new file mode 100644 index 00000000..90cdef53 --- /dev/null +++ b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/assets/images/ic_roofOpenedVehicle.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:396d051cc3b93ac735b74d3809e1844dca2464e226e355fe4d4e4667d9de2295 +size 11458 diff --git a/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/assets/images/ic_trunkAlarmVehicle.png b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/assets/images/ic_trunkAlarmVehicle.png new file mode 100644 index 00000000..742c14e1 --- /dev/null +++ b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/assets/images/ic_trunkAlarmVehicle.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b91f424b814fa34ac49fd3b242e0a7fd99d83f0368c4f5cb9324bbd3898b16cc +size 14342 diff --git a/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/assets/images/ic_trunkClosedVehicle.png b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/assets/images/ic_trunkClosedVehicle.png new file mode 100644 index 00000000..740c87b8 --- /dev/null +++ b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/assets/images/ic_trunkClosedVehicle.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6d0051a37851f265c3e5b7584f23ea1fe64bc5a57ebc025e9e792ee52bd03fd6 +size 18389 diff --git a/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/assets/images/ic_trunkOpenedVehicle.png b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/assets/images/ic_trunkOpenedVehicle.png new file mode 100644 index 00000000..b9784cc7 --- /dev/null +++ b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/assets/images/ic_trunkOpenedVehicle.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5697d8ae7158616b3d2f37a9728ac6a107d6073471db29c42aae5a43c4243028 +size 17216 diff --git a/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/helpers/pathsProvider.js b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/helpers/pathsProvider.js new file mode 100644 index 00000000..6a5ecb73 --- /dev/null +++ b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/helpers/pathsProvider.js @@ -0,0 +1,36 @@ +/**************************************************************************** +** +** Copyright (C) 2019 Luxoft Sweden AB +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Neptune 3 UI. +** +** $QT_BEGIN_LICENSE:GPL-QTAS$ +** Commercial License Usage +** Licensees holding valid commercial Qt Automotive Suite licenses may use +** this file in accordance with the commercial license agreement provided +** with the Software or, alternatively, in accordance with the terms +** contained in a written agreement between you and The Qt Company. For +** licensing terms and conditions see https://www.qt.io/terms-conditions. +** For further information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** SPDX-License-Identifier: GPL-3.0 +** +****************************************************************************/ + +.pragma library + +function getImagePath(name) { + return Qt.resolvedUrl("../assets/images/" + name) +} diff --git a/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/helpers/qmldir b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/helpers/qmldir new file mode 100644 index 00000000..f091a4dc --- /dev/null +++ b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/helpers/qmldir @@ -0,0 +1,2 @@ +module helpers +Paths 1.0 pathsProvider.js diff --git a/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/icon.png b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/icon.png new file mode 100644 index 00000000..bb54ede0 --- /dev/null +++ b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/icon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fdf31c810a829c7e78728c82030a06c5bc2fd1f59bf12de8c89789a256a3187a +size 2387 diff --git a/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/panels/Vehicle2DPanel.qml b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/panels/Vehicle2DPanel.qml new file mode 100644 index 00000000..16c1ea27 --- /dev/null +++ b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/panels/Vehicle2DPanel.qml @@ -0,0 +1,266 @@ +/**************************************************************************** +** +** Copyright (C) 2019 Luxoft Sweden AB +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Neptune 3 UI. +** +** $QT_BEGIN_LICENSE:GPL-QTAS$ +** Commercial License Usage +** Licensees holding valid commercial Qt Automotive Suite licenses may use +** this file in accordance with the commercial license agreement provided +** with the Software or, alternatively, in accordance with the terms +** contained in a written agreement between you and The Qt Company. For +** licensing terms and conditions see https://www.qt.io/terms-conditions. +** For further information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** SPDX-License-Identifier: GPL-3.0 +** +****************************************************************************/ + +import QtQuick 2.9 +import QtGraphicalEffects 1.12 + +import shared.animations 1.0 +import shared.Sizes 1.0 + +import "../helpers" 1.0 + +Item { + id: root + + height: base.height + width: base.width + + property bool trunkOpen: false + property bool leftDoorOpen: false + property bool rightDoorOpen: false + property bool roofOpen: false + property real speed: 0.0 + + SequentialAnimation { + running: speed > 0.0 && (trunkOpened || leftDoorOpened || roofOpen || rightDoorOpened) + loops: Animation.Infinite + PropertyAnimation { + targets: [sunroofAlarm, trunkAlarm, leftDooralarm, rightDooralarm] + properties: "opacity" + from: 0.0 + to: 1.0 + duration: 1000 + } + PropertyAnimation { + targets: [sunroofAlarm, trunkAlarm, leftDooralarm, rightDooralarm] + properties: "opacity" + from: 1.0 + to: 0.0 + duration: 1000 + } + } + + Image { + anchors.topMargin: -Sizes.dp(68) + anchors.fill: parent + source: Paths.getImagePath("ic_background.png") + width: Sizes.dp(sourceSize.width) + height: Sizes.dp(sourceSize.height) + } + + Item { + anchors.top: parent.top + anchors.topMargin: -Sizes.dp(300) + anchors.left: parent.left + anchors.leftMargin: Sizes.dp(670) + width: Sizes.dp(400) + height: Sizes.dp(500) + RadialGradient { + anchors.fill: parent + horizontalRadius: parent.width * .8 + verticalRadius: parent.height * .8 + angle: -20 + gradient: Gradient { + GradientStop { position: 0.0; color: "white" } + GradientStop { position: 0.6; color: "transparent" } + } + } + } + + Item { + anchors.top: parent.top + anchors.topMargin: -Sizes.dp(300) + anchors.right: parent.right + anchors.rightMargin: Sizes.dp(670) + width: Sizes.dp(400) + height: Sizes.dp(500) + RadialGradient { + anchors.fill: parent + horizontalRadius: parent.width * .8 + verticalRadius: parent.height * .8 + angle: 20 + gradient: Gradient { + GradientStop { position: 0.0; color: "white" } + GradientStop { position: 0.6; color: "transparent" } + } + } + } + + Image { + id: base + anchors.fill: parent + source: Paths.getImagePath("ic_bodyVehicle.png") + width: Sizes.dp(sourceSize.width) + height: Sizes.dp(sourceSize.height) + } + + Image { + anchors.fill: parent + source: Paths.getImagePath("ic_roofClosedVehicle.png") + width: Sizes.dp(sourceSize.width) + height: Sizes.dp(sourceSize.height) + visible: sunroofOpened.opacity !== 1.0 + } + + Image { + id: sunroofOpened + + anchors.fill: parent + source: Paths.getImagePath("ic_roofOpenedVehicle.png") + width: Sizes.dp(sourceSize.width) + height: Sizes.dp(sourceSize.height) + opacity: root.roofOpen ? 1.0 : 0.0 + Behavior on opacity { DefaultNumberAnimation {} } + } + + Image { + id: sunroofAlarm + + anchors.fill: parent + source: Paths.getImagePath("ic_roofAlarmVehicle.png") + visible: roofOpen && root.speed > 0 + width: Sizes.dp(sourceSize.width) + height: Sizes.dp(sourceSize.height) + } + + Image { + id: leftDoor + + anchors.fill: parent + source: Paths.getImagePath("ic_leftDoorClosedVehicle.png") + width: Sizes.dp(sourceSize.width) + height: Sizes.dp(sourceSize.height) + visible: root.leftDoorOpen ? 0.0 : 1.0 + } + + Image { + id: leftDoorOpenedCarPart + + anchors.fill: parent + source: Paths.getImagePath("ic_leftDoorOpenedVehicleCarPart.png") + width: Sizes.dp(sourceSize.width) + height: Sizes.dp(sourceSize.height) + visible: root.leftDoorOpen ? 1.0 : 0.0 + } + + Image { + id: leftDoorOpened + + anchors.fill: parent + source: Paths.getImagePath("ic_leftDoorOpenedVehicle.png") + width: Sizes.dp(sourceSize.width) + height: Sizes.dp(sourceSize.height) + opacity: root.leftDoorOpen ? 1.0 : 0.0 + Behavior on opacity { DefaultNumberAnimation {} } + } + + Image { + id: leftDooralarm + + anchors.fill: parent + source: Paths.getImagePath("ic_leftDoorAlarmVehicle.png") + visible: leftDoorOpen && root.speed > 0 + width: Sizes.dp(sourceSize.width) + height: Sizes.dp(sourceSize.height) + } + + Image { + id: rightDoor + + anchors.fill: parent + source: Paths.getImagePath("ic_rightDoorClosedVehicle.png") + width: Sizes.dp(sourceSize.width) + height: Sizes.dp(sourceSize.height) + visible: root.rightDoorOpen ? 0.0 : 1.0 + } + + Image { + id: rightDoorOpenedCarPart + + anchors.fill: parent + source: Paths.getImagePath("ic_rightDoorOpenedVehicleCarPart.png") + width: Sizes.dp(sourceSize.width) + height: Sizes.dp(sourceSize.height) + visible: root.rightDoorOpen ? 1.0 : 0.0 + } + + Image { + id: rightDoorOpened + + anchors.fill: parent + source: Paths.getImagePath("ic_rightDoorOpenedVehicle.png") + width: Sizes.dp(sourceSize.width) + height: Sizes.dp(sourceSize.height) + opacity: root.rightDoorOpen ? 1.0 : 0.0 + Behavior on opacity { DefaultNumberAnimation {} } + } + + Image { + id: rightDooralarm + + anchors.fill: parent + source: Paths.getImagePath("ic_rightDoorAlarmVehicle.png") + visible: rightDoorOpen && root.speed > 0 + width: Sizes.dp(sourceSize.width) + height: Sizes.dp(sourceSize.height) + } + + Image { + id: trunk + + anchors.fill: parent + source: Paths.getImagePath("ic_trunkClosedVehicle.png") + width: Sizes.dp(sourceSize.width) + height: Sizes.dp(sourceSize.height) + visible: trunkOpened.opacity !== 1.0 + } + + Image { + id: trunkOpened + + anchors.fill: parent + source: Paths.getImagePath("ic_trunkOpenedVehicle.png") + width: Sizes.dp(sourceSize.width) + height: Sizes.dp(sourceSize.height) + opacity: root.trunkOpen ? 1.0 : 0.0 + Behavior on opacity { DefaultNumberAnimation {} } + } + + Image { + id: trunkAlarm + + anchors.fill: parent + source: Paths.getImagePath("ic_trunkAlarmVehicle.png") + visible: trunkOpen && root.speed > 0 + width: Sizes.dp(sourceSize.width) + height: Sizes.dp(sourceSize.height) + } +} diff --git a/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/panels/qmldir b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/panels/qmldir new file mode 100644 index 00000000..99a9629b --- /dev/null +++ b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/panels/qmldir @@ -0,0 +1 @@ +Vehicle2DPanel 1.0 Vehicle2DPanel.qml diff --git a/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/stores/VehicleStore.qml b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/stores/VehicleStore.qml new file mode 100644 index 00000000..b02850a2 --- /dev/null +++ b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/stores/VehicleStore.qml @@ -0,0 +1,63 @@ +/**************************************************************************** +** +** Copyright (C) 2019 Luxoft Sweden AB +** Copyright (C) 2018 Pelagicore AG +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Neptune 3 UI. +** +** $QT_BEGIN_LICENSE:GPL-QTAS$ +** Commercial License Usage +** Licensees holding valid commercial Qt Automotive Suite licenses may use +** this file in accordance with the commercial license agreement provided +** with the Software or, alternatively, in accordance with the terms +** contained in a written agreement between you and The Qt Company. For +** licensing terms and conditions see https://www.qt.io/terms-conditions. +** For further information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** SPDX-License-Identifier: GPL-3.0 +** +****************************************************************************/ + +import QtQuick 2.8 +import shared.com.pelagicore.remotesettings 1.0 +import shared.com.pelagicore.drivedata 1.0 + + +QtObject { + id: root + + property bool leftDoorOpened: false + property bool rightDoorOpened: false + property bool trunkOpened: false + property real roofOpenProgress: 0.0 + property real speed: clusterSettings.speed + + readonly property UISettings uiSettings: UISettings { + onDoor1OpenChanged: { + root.leftDoorOpened = uiSettings.door1Open + } + onDoor2OpenChanged: { + root.rightDoorOpened = uiSettings.door2Open + } + onTrunkOpenChanged: { + root.trunkOpened = uiSettings.trunkOpen + } + onRoofOpenProgressChanged: { + root.roofOpenProgress = uiSettings.roofOpenProgress + } + } + + readonly property InstrumentCluster clusterSettings: InstrumentCluster {} +} diff --git a/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/stores/qmldir b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/stores/qmldir new file mode 100644 index 00000000..213b520f --- /dev/null +++ b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/stores/qmldir @@ -0,0 +1 @@ +VehicleStore 1.0 VehicleStore.qml diff --git a/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/views/VehicleICView.qml b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/views/VehicleICView.qml new file mode 100644 index 00000000..0b58a503 --- /dev/null +++ b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/views/VehicleICView.qml @@ -0,0 +1,57 @@ +/**************************************************************************** +** +** Copyright (C) 2019 Luxoft Sweden AB +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Neptune 3 UI. +** +** $QT_BEGIN_LICENSE:GPL-QTAS$ +** Commercial License Usage +** Licensees holding valid commercial Qt Automotive Suite licenses may use +** this file in accordance with the commercial license agreement provided +** with the Software or, alternatively, in accordance with the terms +** contained in a written agreement between you and The Qt Company. For +** licensing terms and conditions see https://www.qt.io/terms-conditions. +** For further information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** SPDX-License-Identifier: GPL-3.0 +** +****************************************************************************/ + +import QtQuick 2.2 + +import shared.Sizes 1.0 + +import "../panels" 1.0 +import "../stores" 1.0 + +Item { + id: root + + property VehicleStore store + + Vehicle2DPanel { + anchors.top: root.top + anchors.topMargin: Sizes.dp(720 - 652) + anchors.left: root.left + anchors.right: root.right + height: Sizes.dp(652) + + leftDoorOpen: root.store.leftDoorOpened + rightDoorOpen: root.store.rightDoorOpened + trunkOpen: root.store.trunkOpened + roofOpen: root.store.roofOpenProgress == 1.0 + speed: store.speed + } +} diff --git a/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/views/qmldir b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/views/qmldir new file mode 100644 index 00000000..e5d545b0 --- /dev/null +++ b/src/neptune-cluster-app/apps/com.luxoft.vehicle-ic/views/qmldir @@ -0,0 +1 @@ +VehicleICView 1.0 VehicleICView.qml diff --git a/src/neptune-cluster-app/apps/com.pelagicore.map-ic/+lucee/icon.png b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/+lucee/icon.png new file mode 100644 index 00000000..9b4fe494 --- /dev/null +++ b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/+lucee/icon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4aba024d537ac6325b36c714b04bf71d54f65e731b831193c4a63eb71ba7ada1 +size 756 diff --git a/src/neptune-cluster-app/apps/com.pelagicore.map-ic/Main.qml b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/Main.qml new file mode 100644 index 00000000..ac56bd47 --- /dev/null +++ b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/Main.qml @@ -0,0 +1,93 @@ +/**************************************************************************** +** +** Copyright (C) 2019 Luxoft Sweden AB +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Neptune 3 UI. +** +** $QT_BEGIN_LICENSE:GPL-QTAS$ +** Commercial License Usage +** Licensees holding valid commercial Qt Automotive Suite licenses may use +** this file in accordance with the commercial license agreement provided +** with the Software or, alternatively, in accordance with the terms +** contained in a written agreement between you and The Qt Company. For +** licensing terms and conditions see https://www.qt.io/terms-conditions. +** For further information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** SPDX-License-Identifier: GPL-3.0 +** +****************************************************************************/ + +import QtQuick.Controls 2.2 + +import QtQuick 2.9 +import QtPositioning 5.9 + +import shared.com.pelagicore.map 1.0 +import shared.utils 1.0 +import shared.Style 1.0 +import shared.Sizes 1.0 + +import "views" 1.0 +import "stores" 1.0 + +Item { + MapStore { + id: store + } + + // used for copying the offline DB + readonly property var _mapsHelper: MapsHelper { + appPath: Qt.resolvedUrl("./") + + onAppPathChanged: { + if (appPath !== "") { + initMap("ic"); + } + } + } + + ICMapView { + id: icMapView + anchors.fill: parent + mapPlugin: store.mapPlugin + mapCenter: store.mapCenter + mapZoomLevel: store.mapZoomLevel + mapTilt: store.mapTilt + mapBearing: store.mapBearing + activeMapType: Style.theme === Style.Light ? + store.getMapType(icMapView.mapReady, store.defaultLightThemeId) + : store.getMapType(icMapView.mapReady, store.defaultDarkThemeId); + + nextTurnDistanceMeasuredIn: store.nextTurnDistanceMeasuredIn + nextTurnDistance: store.nextTurnDistance + naviGuideDirection: store.naviGuideDirection + + onMapReadyChanged: { + store.getAvailableMapsAndLocation(icMapView.mapReady, icMapView.supportedMapTypes); + } + + Connections { + target: store + function onNavigationDemoActiveChanged() { + if (store.navigationDemoActive) { + icMapView.path = store.routePoints; + icMapView.state = "demo_driving"; + } else { + icMapView.state = "initial"; + } + } + } + } +} diff --git a/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_bear_l-dark.png b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_bear_l-dark.png new file mode 100644 index 00000000..d5383c84 --- /dev/null +++ b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_bear_l-dark.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:da6621b5650fc38d61af05b7b5824d733403a6caed69012124a4c78a541907f0 +size 870 diff --git a/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_bear_l.png b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_bear_l.png new file mode 100644 index 00000000..788595fd --- /dev/null +++ b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_bear_l.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:445d12de0c8e036abc18343f1fa1e34cd2cff0f2f012a3c7256ddd7e2318431b +size 923 diff --git a/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_bear_r-dark.png b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_bear_r-dark.png new file mode 100644 index 00000000..3ded2531 --- /dev/null +++ b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_bear_r-dark.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ec067d873d75de30164b07de9d30e139220352754ba07507638300b04d838a02 +size 878 diff --git a/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_bear_r.png b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_bear_r.png new file mode 100644 index 00000000..11d61ceb --- /dev/null +++ b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_bear_r.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3fec1e3bb182bb8801b3f98d8adb18c3af250833de5098ed23b05f135c24830d +size 938 diff --git a/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_hard_l-dark.png b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_hard_l-dark.png new file mode 100644 index 00000000..2b90181e --- /dev/null +++ b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_hard_l-dark.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a226b2b445670415228fcd036121673aac79b0d04b903fe5f848a34d6948130b +size 1113 diff --git a/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_hard_l.png b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_hard_l.png new file mode 100644 index 00000000..e7a94997 --- /dev/null +++ b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_hard_l.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:03d245a4a5b2b9a3ed1e0203637163f10d8ee434338ef382c42904522b84994f +size 1167 diff --git a/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_hard_r-dark.png b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_hard_r-dark.png new file mode 100644 index 00000000..51f7365d --- /dev/null +++ b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_hard_r-dark.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1eb11f5af439d5ca8f3ac483d9dbeaa37e917ce90ebe789f130fc74df65fb84d +size 1057 diff --git a/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_hard_r.png b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_hard_r.png new file mode 100644 index 00000000..025190ac --- /dev/null +++ b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_hard_r.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bbeace26bdc407f07485650b939f256af549b65bf4d9779e87176085d0840a3c +size 1096 diff --git a/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_left-dark.png b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_left-dark.png new file mode 100644 index 00000000..ce132b37 --- /dev/null +++ b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_left-dark.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2b178943f15563fdcf9bb4c246308d7981ebff6450f5f8a4f4b8bbc285139348 +size 848 diff --git a/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_left.png b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_left.png new file mode 100644 index 00000000..642feb9f --- /dev/null +++ b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_left.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4c581d4e99b5a60f33519fbcd8ef9172a294e4628287fb3735427e61aa26dd5e +size 895 diff --git a/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_light_left-dark.png b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_light_left-dark.png new file mode 100644 index 00000000..6f30cddf --- /dev/null +++ b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_light_left-dark.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:85b7b65fc75cc448610ea57ab618cf4fdd1a36ddef7bb2108def83e27e4b7f9f +size 1090 diff --git a/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_light_left.png b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_light_left.png new file mode 100644 index 00000000..ac4d8bc8 --- /dev/null +++ b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_light_left.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fd9b7c13e6c5820fcef132f957a053a7d33aeb75f94754963aae8ddd77059d73 +size 1142 diff --git a/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_light_right-dark.png b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_light_right-dark.png new file mode 100644 index 00000000..ebc90038 --- /dev/null +++ b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_light_right-dark.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2be3e5a99c79af84addf4030838a6bfc1d9a141c316bce125f7b9cf2fdaf03da +size 1113 diff --git a/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_light_right.png b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_light_right.png new file mode 100644 index 00000000..70b9eaed --- /dev/null +++ b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_light_right.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1a26eb7dae93ff7ef4d320bb5d3f54e276ab45c0fb25f7af0f82e70689d5299c +size 1179 diff --git a/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_right-dark.png b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_right-dark.png new file mode 100644 index 00000000..8866c5b7 --- /dev/null +++ b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_right-dark.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c8eed602798517d3f439512bb3cc281deac2b5387e0573c2da9449727aee0056 +size 799 diff --git a/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_right.png b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_right.png new file mode 100644 index 00000000..564e8832 --- /dev/null +++ b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_right.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0578ca0818dce6e8c9a775a8c1f49cbd825d2eea9e1082b466006e3904a201bf +size 847 diff --git a/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_straight-dark.png b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_straight-dark.png new file mode 100644 index 00000000..218c6a76 --- /dev/null +++ b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_straight-dark.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:694337b302e02615c664884fa0021c448bb45d036df3d42a58b1b9bf947f6400 +size 379 diff --git a/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_straight.png b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_straight.png new file mode 100644 index 00000000..84946dc3 --- /dev/null +++ b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_straight.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a48d636e373e12d7de40535ff5743cfd8f36f37b374d6dd401b312b54e52090f +size 427 diff --git a/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_uturn_l-dark.png b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_uturn_l-dark.png new file mode 100644 index 00000000..1f83fe92 --- /dev/null +++ b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_uturn_l-dark.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0b6468cd07a8d8bc8cc3b3d0b7049bb8b97a3351eef1a872531702db81ff09e1 +size 1283 diff --git a/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_uturn_l.png b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_uturn_l.png new file mode 100644 index 00000000..2554bf45 --- /dev/null +++ b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_uturn_l.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0488de2c6e86dabdc7c4878863221730558b836eb9d5d0073a1c37e997797ef0 +size 1348 diff --git a/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_uturn_r-dark.png b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_uturn_r-dark.png new file mode 100644 index 00000000..110c55a4 --- /dev/null +++ b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_uturn_r-dark.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a86f2f40fbb40a701d7135e3a302d6464893d9c84ffee6ff97109f63c9dccf18 +size 1324 diff --git a/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_uturn_r.png b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_uturn_r.png new file mode 100644 index 00000000..2b58ba7e --- /dev/null +++ b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/nav_uturn_r.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b981cc2e4515117cf75b4429c617d8690240cd9084977bcea08c08862d006f11 +size 1352 diff --git a/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/pin-destination.png b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/pin-destination.png new file mode 100644 index 00000000..56795361 --- /dev/null +++ b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/pin-destination.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:965a2a35819e13e25364dc621b8228488861f367da7b37afe470422d991bbf9e +size 7558 diff --git a/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/pin-your-position.png b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/pin-your-position.png new file mode 100644 index 00000000..f17de750 --- /dev/null +++ b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/assets/pin-your-position.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:936b2c29a56aff78c225360aae06109ae7ac57a0ed2875873405b1be9d9d3ec1 +size 6154 diff --git a/src/neptune-cluster-app/apps/com.pelagicore.map-ic/helpers/helper.js b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/helpers/helper.js new file mode 100644 index 00000000..a45f4bdd --- /dev/null +++ b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/helpers/helper.js @@ -0,0 +1,37 @@ +/**************************************************************************** +** +** Copyright (C) 2019 Luxoft Sweden AB +** Copyright (C) 2018 Pelagicore AG +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Neptune 3 UI. +** +** $QT_BEGIN_LICENSE:GPL-QTAS$ +** Commercial License Usage +** Licensees holding valid commercial Qt Automotive Suite licenses may use +** this file in accordance with the commercial license agreement provided +** with the Software or, alternatively, in accordance with the terms +** contained in a written agreement between you and The Qt Company. For +** licensing terms and conditions see https://www.qt.io/terms-conditions. +** For further information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** SPDX-License-Identifier: GPL-3.0 +** +****************************************************************************/ +.import shared.Style 1.0 as Style + +function localAsset(asset, theme) { + var themeStr = theme === Style.Style.Dark ? "-dark" : ""; + return "../assets/" + asset + themeStr + '.png' +} diff --git a/src/neptune-cluster-app/apps/com.pelagicore.map-ic/helpers/qmldir b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/helpers/qmldir new file mode 100644 index 00000000..8671f1d9 --- /dev/null +++ b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/helpers/qmldir @@ -0,0 +1,2 @@ +module helpers +Helper 1.0 helper.js diff --git a/src/neptune-cluster-app/apps/com.pelagicore.map-ic/icon.png b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/icon.png new file mode 100644 index 00000000..807797da --- /dev/null +++ b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/icon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5be35d0a4dab322c2d3238ccf3dd74995042ed42fa309e4d85645ff1bc0e67a0 +size 857 diff --git a/src/neptune-cluster-app/apps/com.pelagicore.map-ic/maps/mapboxgl.db b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/maps/mapboxgl.db new file mode 100644 index 00000000..7291d76e --- /dev/null +++ b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/maps/mapboxgl.db @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:67d18923a064b1102451e864010b793a412b339d7d38682abd47a5641e4fa3ca +size 52367360 diff --git a/src/neptune-cluster-app/apps/com.pelagicore.map-ic/stores/MapStore.qml b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/stores/MapStore.qml new file mode 100644 index 00000000..54659583 --- /dev/null +++ b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/stores/MapStore.qml @@ -0,0 +1,140 @@ +/**************************************************************************** +** +** Copyright (C) 2019 Luxoft Sweden AB +** Copyright (C) 2018 Pelagicore AG +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Neptune 3 UI. +** +** $QT_BEGIN_LICENSE:GPL-QTAS$ +** Commercial License Usage +** Licensees holding valid commercial Qt Automotive Suite licenses may use +** this file in accordance with the commercial license agreement provided +** with the Software or, alternatively, in accordance with the terms +** contained in a written agreement between you and The Qt Company. For +** licensing terms and conditions see https://www.qt.io/terms-conditions. +** For further information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** SPDX-License-Identifier: GPL-3.0 +** +****************************************************************************/ + +import QtQuick 2.8 +import QtPositioning 5.9 +import QtLocation 5.9 +import Qt.labs.platform 1.0 +import shared.utils 1.0 + +import shared.com.pelagicore.remotesettings 1.0 +import shared.com.pelagicore.drivedata 1.0 + +QtObject { + id: root + + property var mapCenter: QtPositioning.coordinate(48.135771, 11.574052) // Munich + readonly property string defaultLightThemeId: "mapbox://styles/qtauto/cjcm1by3q12dk2sqnquu0gju9" + readonly property string defaultDarkThemeId: "mapbox://styles/qtauto/cjcm1czb812co2sno1ypmp1r8" + + function getAvailableMapsAndLocation(mapReady, supportedMapTypes) { + if (mapReady) { + mapTypeModel.clear(); + console.info("Supported map types:"); + for (var i = 0; i < supportedMapTypes.length; i++) { + var map = supportedMapTypes[i]; + mapTypeModel.append({"name": map.name, "data": map}) // fill the map type model + console.info("\t", map.name, ", description:", map.description + , ", style:", map.style, ", night mode:", map.night); + } + } + } + + function getMapType(mapBoxPanelReady, name) { + if (!mapBoxPanelReady || !mapTypeModel.count) { + return + } + for (var i = 0; i < mapTypeModel.count; i++) { + var map = mapTypeModel.get(i); + if (map && map.name === name) { + return map.data; + } + } + } + + function createRouteFromRaw(rawPoints) { + var routePath = []; + if (!!rawPoints) { + for (var i=0; i < rawPoints.length; ++i) { + routePath.push(QtPositioning.coordinate(rawPoints[i][0], rawPoints[i][1])); + } + } + + return routePath; + } + + // lists the various map styles (including the custom ones); filled in Map.onMapReadyChanged + readonly property ListModel mapTypeModel: ListModel { } + + readonly property Plugin mapPlugin: Plugin { + preferred: ["mapboxgl", "osm"] + locales: Config.languageLocale + + readonly property string cacheDirUrl: { + StandardPaths.writableLocation(StandardPaths.CacheLocation) + "/ic"; + } + + // OSM Plugin Parameters + PluginParameter { name: "osm.useragent"; value: "Neptune UI" } + + // Mapbox Plugin Parameters + PluginParameter { + name: "mapboxgl.access_token" + value: "pk.eyJ1IjoicXRhdXRvIiwiYSI6ImNqY20wbDZidzBvcTQyd3J3NDlkZ21jdjUifQ" + +".4KYDlP7UmQEVPYffr6VuVQ" + } + PluginParameter { + name: "mapboxgl.mapping.additional_style_urls" + value: [root.defaultLightThemeId, root.defaultDarkThemeId].join(",") + } + + // Offline maps support + PluginParameter { + name: "mapboxgl.mapping.cache.size"; + value: "50 MiB" + } + PluginParameter { + name: "mapboxgl.mapping.cache.directory"; + value: mapPlugin.cacheDirUrl.toString().substring(mapPlugin.cacheDirUrl.indexOf(':')+1) + } + } + + readonly property NavigationState naviState: NavigationState { + id: naviState + onMapCenterChanged: { + if (naviState.mapCenter) { + root.mapCenter = + QtPositioning.coordinate(naviState.mapCenter[0], naviState.mapCenter[1]); + } + } + onRoutePointsChanged: root.routePoints = createRouteFromRaw(naviState.routePoints); + } + + property var routePoints: []; + property bool navigationDemoActive: routePoints.length > 0; + property alias mapZoomLevel: naviState.mapZoomLevel; + property alias mapTilt: naviState.mapTilt; + property alias mapBearing: naviState.mapBearing; + property alias naviGuideDirection: naviState.nextTurn; + property alias nextTurnDistanceMeasuredIn: naviState.nextTurnDistanceMeasuredIn; + property alias nextTurnDistance: naviState.nextTurnDistance; +} diff --git a/src/neptune-cluster-app/apps/com.pelagicore.map-ic/stores/qmldir b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/stores/qmldir new file mode 100644 index 00000000..ff52f7a6 --- /dev/null +++ b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/stores/qmldir @@ -0,0 +1 @@ +MapStore 1.0 MapStore.qml diff --git a/src/neptune-cluster-app/apps/com.pelagicore.map-ic/views/ICMapView.qml b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/views/ICMapView.qml new file mode 100644 index 00000000..111259aa --- /dev/null +++ b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/views/ICMapView.qml @@ -0,0 +1,188 @@ +/**************************************************************************** +** +** Copyright (C) 2019 Luxoft Sweden AB +** Copyright (C) 2018 Pelagicore AG +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Neptune 3 UI. +** +** $QT_BEGIN_LICENSE:GPL-QTAS$ +** Commercial License Usage +** Licensees holding valid commercial Qt Automotive Suite licenses may use +** this file in accordance with the commercial license agreement provided +** with the Software or, alternatively, in accordance with the terms +** contained in a written agreement between you and The Qt Company. For +** licensing terms and conditions see https://www.qt.io/terms-conditions. +** For further information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** SPDX-License-Identifier: GPL-3.0 +** +****************************************************************************/ + +import QtQuick 2.10 +import QtLocation 5.9 +import QtPositioning 5.14 +import QtQuick.Controls 2.13 + +import shared.animations 1.0 +import shared.Style 1.0 +import shared.Sizes 1.0 + +import "../helpers" 1.0 + +Item { + id: root + + property alias mapCenter: mainMap.center + property alias mapZoomLevel: mainMap.zoomLevel + property alias mapTilt: mainMap.tilt + property alias mapBearing: mainMap.bearing + property alias mapReady: mainMap.mapReady + property alias activeMapType: mainMap.activeMapType + property alias supportedMapTypes: mainMap.supportedMapTypes + property var path + property var mapPlugin + + + property string nextTurnDistanceMeasuredIn + property real nextTurnDistance + property string naviGuideDirection + + state: "initial" + states: [ + State { + // just a map w/o any additional items in it + name: "initial" + PropertyChanges { + target: posMarker + coordinate: QtPositioning.coordinate() + rotation: 0.0 + visible: false + } + PropertyChanges { + target: destMarker + visible: false + coordinate: QtPositioning.coordinate() + } + PropertyChanges { + target: pathView + visible: false + path: [] + } + }, + State { + name: "demo_driving" + PropertyChanges { + target: posMarker + coordinate: root.mapCenter + rotation: 0.0 + visible: true + } + PropertyChanges { + target: destMarker + visible: true + coordinate: root.path[root.path.length - 1] + } + PropertyChanges { + target: pathView + visible: true + path: root.path + } + PropertyChanges { + target: instructions + visible: root.naviGuideDirection !== "" + } + } + ] + + Map { + id: mainMap + anchors.fill: parent + enabled: false + Behavior on tilt { DefaultSmoothedAnimation {} } + zoomLevel: 10 + plugin: root.mapPlugin + copyrightsVisible: false + + MapPolyline { + id: pathView + line.color: Style.accentColor + line.width: Sizes.dp(8) + smooth: true + opacity: Style.opacityHigh + } + + MapQuickItem { + id: destMarker + anchorPoint: Qt.point(markerImage.width * 0.5, markerImage.height * 0.8) + sourceItem: Image { + id: markerImage + source: Qt.resolvedUrl("../assets/pin-destination.png") + width: Sizes.dp(69.5) // half size of the source + height: Sizes.dp(80.5) + } + } + + Item { + id: instructions + visible: false + anchors.top: posMarker.bottom + anchors.topMargin: Sizes.dp(100) + anchors.horizontalCenter: posMarker.horizontalCenter + width: Sizes.dp(660) + height: Sizes.dp(100) + + Rectangle { + anchors.fill: parent + opacity: 0.5 + color: Style.theme === Style.Dark ? "black" : "white" + radius: 10 + } + + Label { + width: Sizes.dp(400) + height: Sizes.dp(100) + anchors.verticalCenter: parent.verticalCenter + anchors.left: parent.left + anchors.leftMargin: Sizes.dp(30) + opacity: 0.9 + font.pixelSize: Sizes.fontSizeXL + font.bold: true + verticalAlignment: Text.AlignVCenter + text: qsTr("Next turn: ") + root.nextTurnDistance + + " " + root.nextTurnDistanceMeasuredIn + } + + Image { + anchors.verticalCenter: parent.verticalCenter + anchors.right: parent.right + anchors.rightMargin: Sizes.dp(30) + source: root.naviGuideDirection !== "" + ? Helper.localAsset(root.naviGuideDirection, Style.theme) + : "" + } + } + + MapQuickItem { + id: posMarker + anchorPoint: Qt.point(posImage.width * 0.5, posImage.height * 0.5) + sourceItem: Image { + id: posImage + source: Qt.resolvedUrl("../assets/pin-your-position.png") + width: Sizes.dp(58) // half size of the source + height: Sizes.dp(67.5) + } + } + } +} diff --git a/src/neptune-cluster-app/apps/com.pelagicore.map-ic/views/qmldir b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/views/qmldir new file mode 100644 index 00000000..1f059387 --- /dev/null +++ b/src/neptune-cluster-app/apps/com.pelagicore.map-ic/views/qmldir @@ -0,0 +1 @@ +ICMapView 1.0 ICMapView.qml diff --git a/src/neptune-cluster-app/apps/com.pelagicore.music-ic/Main.qml b/src/neptune-cluster-app/apps/com.pelagicore.music-ic/Main.qml new file mode 100644 index 00000000..89acf5d7 --- /dev/null +++ b/src/neptune-cluster-app/apps/com.pelagicore.music-ic/Main.qml @@ -0,0 +1,47 @@ +/**************************************************************************** +** +** Copyright (C) 2019 Luxoft Sweden AB +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Neptune 3 UI. +** +** $QT_BEGIN_LICENSE:GPL-QTAS$ +** Commercial License Usage +** Licensees holding valid commercial Qt Automotive Suite licenses may use +** this file in accordance with the commercial license agreement provided +** with the Software or, alternatively, in accordance with the terms +** contained in a written agreement between you and The Qt Company. For +** licensing terms and conditions see https://www.qt.io/terms-conditions. +** For further information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** SPDX-License-Identifier: GPL-3.0 +** +****************************************************************************/ + +import QtQuick 2.8 +import QtQuick.Controls 2.2 + +import shared.Sizes 1.0 + +import "stores" 1.0 +import "views" 1.0 + +Item { + id: root + ICMusicView { + id: icMusicView + anchors.fill: parent + store: MusicStore {} + } +} diff --git a/src/neptune-cluster-app/apps/com.pelagicore.music-ic/controls/+lucee/TitleColumn.qml b/src/neptune-cluster-app/apps/com.pelagicore.music-ic/controls/+lucee/TitleColumn.qml new file mode 100644 index 00000000..6a177dfc --- /dev/null +++ b/src/neptune-cluster-app/apps/com.pelagicore.music-ic/controls/+lucee/TitleColumn.qml @@ -0,0 +1,88 @@ +/**************************************************************************** +** +** Copyright (C) 2019 Luxoft Sweden AB +** Copyright (C) 2018 Pelagicore AG +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Neptune 3 UI. +** +** $QT_BEGIN_LICENSE:GPL-QTAS$ +** Commercial License Usage +** Licensees holding valid commercial Qt Automotive Suite licenses may use +** this file in accordance with the commercial license agreement provided +** with the Software or, alternatively, in accordance with the terms +** contained in a written agreement between you and The Qt Company. For +** licensing terms and conditions see https://www.qt.io/terms-conditions. +** For further information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** SPDX-License-Identifier: GPL-3.0 +** +****************************************************************************/ + +import QtQuick 2.8 +import QtQuick.Controls 2.2 +import QtQuick.Layouts 1.2 + +import shared.utils 1.0 +import shared.Style 1.0 +import shared.Sizes 1.0 + +ColumnLayout { + id: root + spacing: Sizes.dp(15) + + property int preferredWidth: Sizes.dp(240) + property alias currentSongTitle: songTitle.text + property alias currentArtisName: artistName.text + property alias currentAlbumName: albumName.text + + property bool alignHorizontal: false + + Label { + id: songTitle + Layout.preferredWidth: root.width + wrapMode: Text.WordWrap + font.weight: Font.Normal + font.pixelSize: Sizes.dp(40) + maximumLineCount: 2 + horizontalAlignment: alignHorizontal ? Text.AlignHCenter : Text.AlignLeft + elide: Text.ElideRight + } + + Label { + id: artistName + Layout.preferredWidth: root.width + wrapMode: Text.WordWrap + font.pixelSize: Sizes.dp(26) + font.weight: Font.Normal + visible: text !== "" + maximumLineCount: 1 + horizontalAlignment: alignHorizontal ? Text.AlignHCenter : Text.AlignLeft + elide: Text.ElideRight + } + + Label { + id: albumName + Layout.preferredWidth: root.width + wrapMode: Text.WordWrap + font.pixelSize: Sizes.dp(20) + visible: text !== "" + opacity: Style.opacityMedium + maximumLineCount: 1 + horizontalAlignment: alignHorizontal ? Text.AlignHCenter : Text.AlignLeft + elide: Text.ElideRight + + } +} + diff --git a/src/neptune-cluster-app/apps/com.pelagicore.music-ic/controls/MusicProgress.qml b/src/neptune-cluster-app/apps/com.pelagicore.music-ic/controls/MusicProgress.qml new file mode 100644 index 00000000..93f4f4ea --- /dev/null +++ b/src/neptune-cluster-app/apps/com.pelagicore.music-ic/controls/MusicProgress.qml @@ -0,0 +1,87 @@ +/**************************************************************************** +** +** Copyright (C) 2019 Luxoft Sweden AB +** Copyright (C) 2018 Pelagicore AG +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Neptune 3 UI. +** +** $QT_BEGIN_LICENSE:GPL-QTAS$ +** Commercial License Usage +** Licensees holding valid commercial Qt Automotive Suite licenses may use +** this file in accordance with the commercial license agreement provided +** with the Software or, alternatively, in accordance with the terms +** contained in a written agreement between you and The Qt Company. For +** licensing terms and conditions see https://www.qt.io/terms-conditions. +** For further information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** SPDX-License-Identifier: GPL-3.0 +** +****************************************************************************/ + +import QtQuick 2.8 +import QtQuick.Controls 2.2 + +import shared.utils 1.0 +import shared.Style 1.0 +import shared.Sizes 1.0 + +Control { + id: root + + property bool clusterView: false + property bool labelOnTop: true + property string progressText: "0:0 / 0:0" + property real value // 0 <= value <=1 + property int progressBarLabelLeftMargin: Sizes.dp(10) + readonly property int progressBarWidth: root.width - (root.labelOnTop + ? Sizes.dp(6) : Sizes.dp(5)) + + signal updatePosition(var value) + + contentItem: Item { + anchors.fill: root + Label { + id: progressLabel + anchors.top: parent.top + anchors.topMargin: root.labelOnTop ? Sizes.dp(48) : 0 + anchors.left: parent.left + anchors.leftMargin: root.progressBarLabelLeftMargin + font.pixelSize: Sizes.fontSizeS + text: root.progressText + opacity: Style.opacityMedium + } + + ProgressBar { + id: progressBar + implicitWidth: root.progressBarWidth + implicitHeight: Sizes.dp(8) + anchors.centerIn: parent + anchors.verticalCenterOffset: Sizes.dp(-24) + anchors.horizontalCenterOffset: root.labelOnTop ? 0 : Sizes.dp(90) + value: root.value + } + + MouseArea { + width: parent.width + height: Sizes.dp(50) + anchors.centerIn: progressBar + enabled: !root.clusterView + onPressed: { + var newValue = LayoutMirroring.enabled ? ((1 - mouseX / root.width)) : (mouseX / root.width); + root.updatePosition(newValue); + } + } + } +} diff --git a/src/neptune-cluster-app/apps/com.pelagicore.music-ic/controls/TitleColumn.qml b/src/neptune-cluster-app/apps/com.pelagicore.music-ic/controls/TitleColumn.qml new file mode 100644 index 00000000..d16602aa --- /dev/null +++ b/src/neptune-cluster-app/apps/com.pelagicore.music-ic/controls/TitleColumn.qml @@ -0,0 +1,69 @@ +/**************************************************************************** +** +** Copyright (C) 2019 Luxoft Sweden AB +** Copyright (C) 2018 Pelagicore AG +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Neptune 3 UI. +** +** $QT_BEGIN_LICENSE:GPL-QTAS$ +** Commercial License Usage +** Licensees holding valid commercial Qt Automotive Suite licenses may use +** this file in accordance with the commercial license agreement provided +** with the Software or, alternatively, in accordance with the terms +** contained in a written agreement between you and The Qt Company. For +** licensing terms and conditions see https://www.qt.io/terms-conditions. +** For further information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** SPDX-License-Identifier: GPL-3.0 +** +****************************************************************************/ + +import QtQuick 2.8 +import QtQuick.Controls 2.2 +import QtQuick.Layouts 1.2 + +import shared.utils 1.0 +import shared.Style 1.0 +import shared.Sizes 1.0 + +ColumnLayout { + id: root + spacing: Sizes.dp(15) + + property int preferredWidth: Sizes.dp(240) + property alias currentSongTitle: songTitle.text + property alias currentArtisName: artistName.text + + Label { + id: songTitle + Layout.preferredWidth: root.width + wrapMode: Text.WordWrap + font.weight: Font.Light + maximumLineCount: 2 + elide: Text.ElideRight + } + + Label { + id: artistName + Layout.preferredWidth: root.width + wrapMode: Text.WordWrap + font.pixelSize: Sizes.fontSizeS + visible: text !== "" + opacity: Style.opacityMedium + maximumLineCount: 1 + elide: Text.ElideRight + } +} + diff --git a/src/neptune-cluster-app/apps/com.pelagicore.music-ic/controls/qmldir b/src/neptune-cluster-app/apps/com.pelagicore.music-ic/controls/qmldir new file mode 100644 index 00000000..09b47c0b --- /dev/null +++ b/src/neptune-cluster-app/apps/com.pelagicore.music-ic/controls/qmldir @@ -0,0 +1,2 @@ +MusicProgress 1.0 MusicProgress.qml +TitleColumn 1.0 TitleColumn.qml diff --git a/src/neptune-cluster-app/apps/com.pelagicore.music-ic/icon.png b/src/neptune-cluster-app/apps/com.pelagicore.music-ic/icon.png new file mode 100644 index 00000000..e0176b92 --- /dev/null +++ b/src/neptune-cluster-app/apps/com.pelagicore.music-ic/icon.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:98297ae069ab8ac243aeedc49fb5a0c90e7c156803e3e9ba75ee1ff1a0ea7abe +size 709 diff --git a/src/neptune-cluster-app/apps/com.pelagicore.music-ic/panels/ICAlbumArtPanel.qml b/src/neptune-cluster-app/apps/com.pelagicore.music-ic/panels/ICAlbumArtPanel.qml new file mode 100644 index 00000000..f525bd9a --- /dev/null +++ b/src/neptune-cluster-app/apps/com.pelagicore.music-ic/panels/ICAlbumArtPanel.qml @@ -0,0 +1,70 @@ +/**************************************************************************** +** +** Copyright (C) 2019 Luxoft Sweden AB +** Copyright (C) 2018 Pelagicore AG +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Neptune 3 UI. +** +** $QT_BEGIN_LICENSE:GPL-QTAS$ +** Commercial License Usage +** Licensees holding valid commercial Qt Automotive Suite licenses may use +** this file in accordance with the commercial license agreement provided +** with the Software or, alternatively, in accordance with the terms +** contained in a written agreement between you and The Qt Company. For +** licensing terms and conditions see https://www.qt.io/terms-conditions. +** For further information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** SPDX-License-Identifier: GPL-3.0 +** +****************************************************************************/ + +import QtQuick 2.8 + +import shared.utils 1.0 +import shared.Style 1.0 +import shared.Sizes 1.0 + +import "../controls" 1.0 + +Item { + id: root + + property bool musicPlaying: false + property real musicPosition: 0.0 + property alias currentSongTitle: titleColumn.currentSongTitle + property alias currentArtisName: titleColumn.currentArtisName + property alias currentProgressLabel: musicProgress.progressText + + TitleColumn { + id: titleColumn + anchors.left: parent.left + anchors.right: parent.right + anchors.top: parent.top + anchors.topMargin: Sizes.dp(140) + } + + MusicProgress { + id: musicProgress + width: root.width + height: Sizes.dp(100) + anchors.top: titleColumn.bottom + anchors.topMargin: Sizes.dp(10) + anchors.leftMargin: Sizes.dp(40) + anchors.rightMargin: Sizes.dp(40) + value: root.musicPosition + progressBarLabelLeftMargin: 3 + clusterView: true + } +} diff --git a/src/neptune-cluster-app/apps/com.pelagicore.music-ic/panels/qmldir b/src/neptune-cluster-app/apps/com.pelagicore.music-ic/panels/qmldir new file mode 100644 index 00000000..92edda7e --- /dev/null +++ b/src/neptune-cluster-app/apps/com.pelagicore.music-ic/panels/qmldir @@ -0,0 +1 @@ +ICAlbumArtPanel 1.0 ICAlbumArtPanel.qml diff --git a/src/neptune-cluster-app/apps/com.pelagicore.music-ic/stores/MusicStore.qml b/src/neptune-cluster-app/apps/com.pelagicore.music-ic/stores/MusicStore.qml new file mode 100644 index 00000000..50d0a64f --- /dev/null +++ b/src/neptune-cluster-app/apps/com.pelagicore.music-ic/stores/MusicStore.qml @@ -0,0 +1,53 @@ +/**************************************************************************** +** +** Copyright (C) 2019 Luxoft Sweden AB +** Copyright (C) 2018 Pelagicore AG +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Neptune 3 UI. +** +** $QT_BEGIN_LICENSE:GPL-QTAS$ +** Commercial License Usage +** Licensees holding valid commercial Qt Automotive Suite licenses may use +** this file in accordance with the commercial license agreement provided +** with the Software or, alternatively, in accordance with the terms +** contained in a written agreement between you and The Qt Company. For +** licensing terms and conditions see https://www.qt.io/terms-conditions. +** For further information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** SPDX-License-Identifier: GPL-3.0 +** +****************************************************************************/ + +import QtQuick 2.8 +import QtIvi 1.0 +import QtIvi.Media 1.0 + +import shared.utils 1.0 + +Store { + id: root + + property alias musicPlaylist: player.playQueue + property int musicCount: player.playQueue.count + + property MediaPlayer player: MediaPlayer { id: player } + property var currentEntry: player.currentTrack; + property bool playing: player.playState === MediaPlayer.Playing + property bool shuffleOn: player.playMode === MediaPlayer.Shuffle + property bool repeatOn: player.playMode === MediaPlayer.RepeatTrack + property string elapsedTime: Qt.formatTime(new Date(player.position), 'mm:ss') + property string totalTime: Qt.formatTime(new Date(player.duration), 'mm:ss') + property real currentTrackPosition : player.position / player.duration +} diff --git a/src/neptune-cluster-app/apps/com.pelagicore.music-ic/stores/qmldir b/src/neptune-cluster-app/apps/com.pelagicore.music-ic/stores/qmldir new file mode 100644 index 00000000..59cb9371 --- /dev/null +++ b/src/neptune-cluster-app/apps/com.pelagicore.music-ic/stores/qmldir @@ -0,0 +1 @@ +MusicStore 1.0 MusicStore.qml diff --git a/src/neptune-cluster-app/apps/com.pelagicore.music-ic/views/ICMusicView.qml b/src/neptune-cluster-app/apps/com.pelagicore.music-ic/views/ICMusicView.qml new file mode 100644 index 00000000..11dafa03 --- /dev/null +++ b/src/neptune-cluster-app/apps/com.pelagicore.music-ic/views/ICMusicView.qml @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2019 Luxoft Sweden AB +** Copyright (C) 2018 Pelagicore AG +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Neptune 3 UI. +** +** $QT_BEGIN_LICENSE:GPL-QTAS$ +** Commercial License Usage +** Licensees holding valid commercial Qt Automotive Suite licenses may use +** this file in accordance with the commercial license agreement provided +** with the Software or, alternatively, in accordance with the terms +** contained in a written agreement between you and The Qt Company. For +** licensing terms and conditions see https://www.qt.io/terms-conditions. +** For further information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** SPDX-License-Identifier: GPL-3.0 +** +****************************************************************************/ + +import QtQuick 2.8 + +import shared.utils 1.0 +import shared.Style 1.0 +import shared.Sizes 1.0 + +import "../stores" 1.0 +import "../panels" 1.0 + +Item { + id: root + + property MusicStore store + + Image { + anchors.fill: parent + source: Style.image("instrument-cluster-bg") + fillMode: Image.Stretch + } + + ICAlbumArtPanel { + id: albumArt + width: Sizes.dp(540) + height: Sizes.dp(464) + anchors.centerIn: parent + anchors.verticalCenterOffset: Sizes.dp(50) + musicPlaying: root.store.playing + musicPosition: root.store.currentTrackPosition + currentSongTitle: root.store.currentEntry + ? root.store.currentEntry.title + : qsTr("Track unavailable") + currentArtisName: root.store.currentEntry ? root.store.currentEntry.artist : "" + currentProgressLabel: root.store.elapsedTime + " / " + root.store.totalTime + } +} diff --git a/src/neptune-cluster-app/apps/com.pelagicore.music-ic/views/qmldir b/src/neptune-cluster-app/apps/com.pelagicore.music-ic/views/qmldir new file mode 100644 index 00000000..68ca7e17 --- /dev/null +++ b/src/neptune-cluster-app/apps/com.pelagicore.music-ic/views/qmldir @@ -0,0 +1 @@ +ICMusicView 1.0 ICMusicView.qml diff --git a/src/neptune-cluster-app/main.cpp b/src/neptune-cluster-app/main.cpp new file mode 100644 index 00000000..abc64db2 --- /dev/null +++ b/src/neptune-cluster-app/main.cpp @@ -0,0 +1,108 @@ +/**************************************************************************** +** +** Copyright (C) 2019-2020 Luxoft Sweden AB +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Neptune 3 UI. +** +** $QT_BEGIN_LICENSE:GPL-QTAS$ +** Commercial License Usage +** Licensees holding valid commercial Qt Automotive Suite licenses may use +** this file in accordance with the commercial license agreement provided +** with the Software or, alternatively, in accordance with the terms +** contained in a written agreement between you and The Qt Company. For +** licensing terms and conditions see https://www.qt.io/terms-conditions. +** For further information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** SPDX-License-Identifier: GPL-3.0 +** +****************************************************************************/ + +#include <QtGlobal> +#include <QtGui/QGuiApplication> +#include <QtGui/QIcon> +#include <QtGui/QOpenGLContext> +#include <QtQml/QQmlApplicationEngine> +#include <QtCore/QLoggingCategory> +#include <QtCore/QDir> +#include <QtCore/QString> +#include <QtCore/QCommandLineParser> + +#ifdef STUDIO3D_RUNTIME_INSTALLED + #include <qstudio3dglobal.h> +#endif + +int main(int argc, char *argv[]) +{ + QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + QCoreApplication::setApplicationName(QStringLiteral("Neptune Cluster")); + QCoreApplication::setOrganizationName(QStringLiteral("Luxoft Sweden AB")); + QCoreApplication::setOrganizationDomain(QStringLiteral("luxoft.com")); + QCoreApplication::setApplicationVersion("0.1"); + QGuiApplication app(argc, argv); + // force application path, it'll update @load_path and others + QDir::setCurrent(qApp->applicationDirPath()); + + // @todo: add -c config file option and config file for it (json, xml, etc) + QCommandLineParser cmdParser; + cmdParser.setApplicationDescription( + "Neptune Cluster\n\n" + "Logging is turned off by default, to control log output please check command line " + "options or Qt Help for QT_LOGGING_RULES environment variable.\n"); + cmdParser.addHelpOption(); + cmdParser.addVersionOption(); + const QCommandLineOption enableDefaultLoggingOption("verbose", + "Enables default Qt logging filter."); + cmdParser.addOption(enableDefaultLoggingOption); + cmdParser.process(app); + if (!cmdParser.isSet(enableDefaultLoggingOption)) { + QLoggingCategory::setFilterRules("*=false"); + } + + if (!qEnvironmentVariableIsSet("QT_QUICK_CONTROLS_STYLE_PATH")) { + qputenv("QT_QUICK_CONTROLS_STYLE_PATH" + , (QCoreApplication::applicationDirPath() + QStringLiteral("/styles")).toLocal8Bit()); + } + + if (!qEnvironmentVariableIsSet("QT_QUICK_CONTROLS_CONF")) { + qputenv("QT_QUICK_CONTROLS_CONF", (QCoreApplication::applicationDirPath() + + QStringLiteral("/styles/neptune/style.conf")).toLocal8Bit()); + } + + if (!qEnvironmentVariableIsSet("QT_QUICK_CONTROLS_ICON_PATH")) { + qputenv("QT_QUICK_CONTROLS_ICON_PATH", (QCoreApplication::applicationDirPath() + + QStringLiteral("/imports_shared/assets/icons")).toLocal8Bit()); + } + + if (!qEnvironmentVariableIsSet("SERVER_CONF_PATH")) { + qputenv("SERVER_CONF_PATH", (QCoreApplication::applicationDirPath() + + QStringLiteral("/server.conf")).toLocal8Bit()); + } + + if (!qEnvironmentVariableIsSet("QT_STYLE_OVERRIDE")) { + qputenv("QT_STYLE_OVERRIDE", QStringLiteral("neptune").toLocal8Bit()); + } + +#ifdef STUDIO3D_RUNTIME_INSTALLED + QSurfaceFormat::setDefaultFormat(Q3DS::surfaceFormat()); +#endif + + QQmlApplicationEngine engine; + engine.addImportPath(QDir::currentPath()+QStringLiteral("/imports_shared/")); + engine.load(QStringLiteral("neptune-cluster/main.qml")); + if (engine.rootObjects().isEmpty()) + return -1; + + return app.exec(); +} diff --git a/src/neptune-cluster-app/main.qml b/src/neptune-cluster-app/main.qml new file mode 100644 index 00000000..51cfd694 --- /dev/null +++ b/src/neptune-cluster-app/main.qml @@ -0,0 +1,100 @@ +/**************************************************************************** +** +** Copyright (C) 2019 Luxoft Sweden AB +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Neptune 3 UI. +** +** $QT_BEGIN_LICENSE:GPL-QTAS$ +** Commercial License Usage +** Licensees holding valid commercial Qt Automotive Suite licenses may use +** this file in accordance with the commercial license agreement provided +** with the Software or, alternatively, in accordance with the terms +** contained in a written agreement between you and The Qt Company. For +** licensing terms and conditions see https://www.qt.io/terms-conditions. +** For further information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** SPDX-License-Identifier: GPL-3.0 +** +****************************************************************************/ + +import QtQuick 2.12 +import QtQuick.Window 2.12 + +import shared.Style 1.0 +import shared.Sizes 1.0 +import "../apps/com.theqtcompany.cluster/stores" 1.0 +import "../apps/com.theqtcompany.cluster/views" 1.0 + +Window { + id: root + visible: true + width: 1920 + height: 1080 + title: qsTr("Cluster") + color: "black" + + readonly property real mockedWindowsAcpectRatio: 1920 / 720 + Component.onCompleted: { + root.Style.theme = Style.Dark; + } + + ClusterRootStore { + id:clrst + devMode: true + } + + Connections { + target: clrst.uiSettings + function onThemeChanged() { root.Style.theme = clrst.uiSettings.theme } + function onAccentColorChanged() { root.Style.accentColor = clrst.uiSettings.accentColor } + } + + MockedWindows { + id: mockedWindows + + clip: true + height: Math.floor(root.width / mockedWindowsAcpectRatio) <= root.height + ? root.width / mockedWindowsAcpectRatio + : root.height; + width: height * mockedWindowsAcpectRatio + + onWidthChanged: { + root.Sizes.scale = mockedWindows.width / 1920; + } + + anchors.centerIn: parent + + ClusterView { + rtlMode: clrst.uiSettings.rtlMode + anchors.fill: parent + store: clrst; + } + + Image { + z: -1 + anchors.fill: parent + source: Style.image("instrument-cluster-bg") + fillMode: Image.Stretch + } + } + + Launcher { + id:lnch + z: 2 + anchors.top: mockedWindows.top + anchors.horizontalCenter: mockedWindows.horizontalCenter + onAppClicked: mockedWindows.runApp(appUrl) + } +} diff --git a/src/neptune-cluster-app/neptune-cluster-app.pro b/src/neptune-cluster-app/neptune-cluster-app.pro new file mode 100644 index 00000000..154c5fe4 --- /dev/null +++ b/src/neptune-cluster-app/neptune-cluster-app.pro @@ -0,0 +1,48 @@ +requires(linux|macos) # @todo add win + +TEMPLATE = app +TARGET = neptune-cluster-app +QT *= quick gui core ivicore + +isEmpty(INSTALL_PREFIX) { + INSTALL_PREFIX=/opt +} + +# check ogl-runtime +qtHaveModule(studio3d) { + QT *= studio3d + DEFINES *= STUDIO3D_RUNTIME_INSTALLED +} + +CONFIG += c++11 +macos: CONFIG -= app_bundle + +DESTDIR = $$OUT_PWD/../../ + +QMAKE_RPATHDIR += $$QMAKE_REL_RPATH_BASE/$$relative_path($$INSTALL_PREFIX/neptune3/lib, $$INSTALL_PREFIX/neptune3/) +LIBS += -L$$LIB_DESTDIR -l$$qtLibraryTarget(remotesettings) -l$$qtLibraryTarget(drivedata) + +SOURCES += \ + main.cpp + +OTHER_FILES += $$files($$PWD/*.qml, true) + +target.path = $$INSTALL_PREFIX/neptune3 + +installFiles.files = $$files($$PWD/*.qml, false) apps +installFiles.path = $$INSTALL_PREFIX/neptune3/neptune-cluster/ +installFiles.CONFIG += no_check_exist + +INSTALLS += target installFiles + +# copy files in neptune-cluster-app build folder +FILES = main.qml ClusterRootStore.qml MockedWindows.qml Launcher.qml +do_copydata.commands += $(MKDIR) $$shell_path($$DESTDIR/neptune-cluster) $$escape_expand(\n\t) +for (f , FILES) { + do_copydata.commands += $(COPY) $$shell_path($$PWD/$${f}) $$shell_path($$DESTDIR/neptune-cluster/) $$escape_expand(\n\t) +} + +do_copydata.commands += $(COPY_DIR) $$shell_path($$PWD/apps) $$shell_path($$DESTDIR/neptune-cluster/) $$escape_expand(\n\t) + +first.depends = do_copydata +QMAKE_EXTRA_TARGETS += first do_copydata |