Merge remote-tracking branch 'origin/comr'
This commit is contained in:
@@ -9,14 +9,16 @@ HEADERS += \
|
|||||||
deviceinfo.h \
|
deviceinfo.h \
|
||||||
devicefinder.h \
|
devicefinder.h \
|
||||||
devicehandler.h \
|
devicehandler.h \
|
||||||
bluetoothbaseclass.h
|
bluetoothbaseclass.h \
|
||||||
|
settings.h
|
||||||
|
|
||||||
SOURCES += main.cpp \
|
SOURCES += main.cpp \
|
||||||
connectionhandler.cpp \
|
connectionhandler.cpp \
|
||||||
deviceinfo.cpp \
|
deviceinfo.cpp \
|
||||||
devicefinder.cpp \
|
devicefinder.cpp \
|
||||||
devicehandler.cpp \
|
devicehandler.cpp \
|
||||||
bluetoothbaseclass.cpp
|
bluetoothbaseclass.cpp \
|
||||||
|
settings.cpp
|
||||||
|
|
||||||
RESOURCES += qml.qrc \
|
RESOURCES += qml.qrc \
|
||||||
images.qrc
|
images.qrc
|
||||||
|
@@ -51,8 +51,8 @@ void DeviceFinder::addDevice(const QBluetoothDeviceInfo &device)
|
|||||||
auto info = new DeviceInfo(device);
|
auto info = new DeviceInfo(device);
|
||||||
if(info->getName().contains("bobby")) { // Only add devices with "bobby" in device name to list; (filter)
|
if(info->getName().contains("bobby")) { // Only add devices with "bobby" in device name to list; (filter)
|
||||||
m_devices.append(info);
|
m_devices.append(info);
|
||||||
|
setInfo(tr("Low Energy device found. Scanning more..."));
|
||||||
}
|
}
|
||||||
setInfo(tr("Low Energy device found. Scanning more..."));
|
|
||||||
//! [devicediscovery-3]
|
//! [devicediscovery-3]
|
||||||
emit devicesChanged();
|
emit devicesChanged();
|
||||||
//! [devicediscovery-4]
|
//! [devicediscovery-4]
|
||||||
|
@@ -16,6 +16,9 @@ const QBluetoothUuid bobbycarServiceUuid{QUuid::fromString(QStringLiteral("0335e
|
|||||||
|
|
||||||
const QBluetoothUuid livestatsCharacUuid{QUuid::fromString(QStringLiteral("a48321ea-329f-4eab-a401-30e247211524"))};
|
const QBluetoothUuid livestatsCharacUuid{QUuid::fromString(QStringLiteral("a48321ea-329f-4eab-a401-30e247211524"))};
|
||||||
const QBluetoothUuid remotecontrolCharacUuid{QUuid::fromString(QStringLiteral("4201def0-a264-43e6-946b-6b2d9612dfed"))};
|
const QBluetoothUuid remotecontrolCharacUuid{QUuid::fromString(QStringLiteral("4201def0-a264-43e6-946b-6b2d9612dfed"))};
|
||||||
|
|
||||||
|
const QBluetoothUuid settingsSetterUuid{QUuid::fromString(QStringLiteral("4201def1-a264-43e6-946b-6b2d9612dfed"))};
|
||||||
|
const QBluetoothUuid wifiListUuid{QUuid::fromString(QStringLiteral("4201def2-a264-43e6-946b-6b2d9612dfed"))};
|
||||||
}
|
}
|
||||||
|
|
||||||
DeviceHandler::DeviceHandler(QObject *parent) :
|
DeviceHandler::DeviceHandler(QObject *parent) :
|
||||||
|
1
qml.qrc
1
qml.qrc
@@ -15,5 +15,6 @@
|
|||||||
<file>qml/BottomLine.qml</file>
|
<file>qml/BottomLine.qml</file>
|
||||||
<file>qml/StatsLabel.qml</file>
|
<file>qml/StatsLabel.qml</file>
|
||||||
<file>qml/qmldir</file>
|
<file>qml/qmldir</file>
|
||||||
|
<file>qml/settings.qml</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
@@ -23,11 +23,13 @@ Item {
|
|||||||
__currentIndex = lastPages.length-1;
|
__currentIndex = lastPages.length-1;
|
||||||
}
|
}
|
||||||
|
|
||||||
function showPage(name)
|
function showPage(name, index = -1)
|
||||||
{
|
{
|
||||||
lastPages.push(name)
|
lastPages.push(name)
|
||||||
pageLoader.setSource(name)
|
pageLoader.setSource(name)
|
||||||
__currentIndex = lastPages.length-1;
|
if(index === -1)
|
||||||
|
__currentIndex = lastPages.length-1
|
||||||
|
else __currentIndex = index
|
||||||
}
|
}
|
||||||
|
|
||||||
TitleBar {
|
TitleBar {
|
||||||
|
@@ -1,8 +1,13 @@
|
|||||||
import QtQuick 2.15
|
import QtQuick 2.15
|
||||||
import Shared 1.0
|
import Shared 1.0
|
||||||
|
|
||||||
|
|
||||||
GamePage {
|
GamePage {
|
||||||
|
|
||||||
|
function init() {
|
||||||
|
deviceFinder.startSearch()
|
||||||
|
}
|
||||||
|
|
||||||
errorMessage: deviceFinder.error
|
errorMessage: deviceFinder.error
|
||||||
infoMessage: deviceFinder.info
|
infoMessage: deviceFinder.info
|
||||||
|
|
||||||
|
@@ -37,6 +37,7 @@ GamePage {
|
|||||||
contentHeight: contentColumn.height
|
contentHeight: contentColumn.height
|
||||||
flickableDirection: Flickable.VerticalFlick
|
flickableDirection: Flickable.VerticalFlick
|
||||||
clip: true
|
clip: true
|
||||||
|
anchors.margins: 5
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
id: contentColumn
|
id: contentColumn
|
||||||
@@ -68,7 +69,7 @@ GamePage {
|
|||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
text: "Front: " + Number(deviceHandler.frontVoltage).toLocaleString(Qt.locale()) + "V / " + Number(deviceHandler.frontTemperature).toLocaleString(Qt.locale()) + "°C"
|
text: "Front: " + Number(deviceHandler.frontVoltage).toLocaleString(Qt.locale()) + "V / " + Number(deviceHandler.frontTemperature).toLocaleString(Qt.locale()) + "°C"
|
||||||
color: GameSettings.textColor
|
color: GameSettings.textColor
|
||||||
minimumPixelSize: 10
|
//minimumPixelSize: 10
|
||||||
font.pixelSize: GameSettings.mediumFontSize
|
font.pixelSize: GameSettings.mediumFontSize
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -120,11 +121,13 @@ GamePage {
|
|||||||
text: "Back: " + Number(deviceHandler.backVoltage).toLocaleString(Qt.locale()) + "V / " + Number(deviceHandler.backTemperature).toLocaleString(Qt.locale()) + "°C"
|
text: "Back: " + Number(deviceHandler.backVoltage).toLocaleString(Qt.locale()) + "V / " + Number(deviceHandler.backTemperature).toLocaleString(Qt.locale()) + "°C"
|
||||||
//visible: deviceHandler.alive
|
//visible: deviceHandler.alive
|
||||||
color: GameSettings.textColor
|
color: GameSettings.textColor
|
||||||
minimumPixelSize: 10
|
//minimumPixelSize: 10
|
||||||
font.pixelSize: GameSettings.mediumFontSize
|
font.pixelSize: GameSettings.mediumFontSize
|
||||||
}
|
}
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
|
anchors.bottomMargin: 30
|
||||||
|
spacing: 10
|
||||||
Label {
|
Label {
|
||||||
text: 'iMotMax:'
|
text: 'iMotMax:'
|
||||||
color: GameSettings.textColor
|
color: GameSettings.textColor
|
||||||
@@ -138,6 +141,7 @@ GamePage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
|
spacing: 10
|
||||||
Label {
|
Label {
|
||||||
text: 'iDcMax:'
|
text: 'iDcMax:'
|
||||||
color: GameSettings.textColor
|
color: GameSettings.textColor
|
||||||
@@ -153,22 +157,45 @@ GamePage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GameButton {
|
Row {
|
||||||
id: startButton
|
id: buttonRow
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
anchors.bottomMargin: GameSettings.fieldMargin
|
anchors.bottomMargin: GameSettings.fieldMargin
|
||||||
width: container.width
|
spacing: 5
|
||||||
height: GameSettings.fieldHeight
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
radius: GameSettings.buttonRadius
|
|
||||||
|
|
||||||
onClicked: app.showPage("RemoteControl.qml")
|
width: childrenRect.width
|
||||||
|
|
||||||
Text {
|
GameButton {
|
||||||
anchors.centerIn: parent
|
id: startButton
|
||||||
font.pixelSize: GameSettings.tinyFontSize
|
width: container.width / 2
|
||||||
text: qsTr("REMOTE")
|
height: GameSettings.fieldHeight
|
||||||
color: startButton.enabled ? GameSettings.textColor : GameSettings.disabledTextColor
|
radius: GameSettings.buttonRadius
|
||||||
|
|
||||||
|
onClicked: app.showPage("RemoteControl.qml")
|
||||||
|
|
||||||
|
Text {
|
||||||
|
anchors.centerIn: parent
|
||||||
|
font.pixelSize: GameSettings.tinyFontSize
|
||||||
|
text: qsTr("REMOTE")
|
||||||
|
color: startButton.enabled ? GameSettings.textColor : GameSettings.disabledTextColor
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
GameButton {
|
||||||
|
id: settingsButton
|
||||||
|
width: container.width / 2
|
||||||
|
height: GameSettings.fieldHeight
|
||||||
|
radius: GameSettings.buttonRadius
|
||||||
|
|
||||||
|
onClicked: app.showPage("settings.qml", 3)
|
||||||
|
|
||||||
|
Text {
|
||||||
|
anchors.centerIn: parent
|
||||||
|
font.pixelSize: GameSettings.tinyFontSize
|
||||||
|
text: qsTr("SETTINGS")
|
||||||
|
color: settingsButton.enabled ? GameSettings.textColor : GameSettings.disabledTextColor
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -8,21 +8,23 @@ Rectangle {
|
|||||||
height: GameSettings.fieldHeight
|
height: GameSettings.fieldHeight
|
||||||
color: GameSettings.viewColor
|
color: GameSettings.viewColor
|
||||||
|
|
||||||
property var __titles: ["CONNECT", "LIVEDATA", "REMOTECONTROL"]
|
property var __titles: ["CONNECT", "LIVEDATA", "REMOTECONTROL", "SETTINGS"]
|
||||||
property int currentIndex: 0
|
property int currentIndex: 0
|
||||||
|
|
||||||
signal titleClicked(int index)
|
signal titleClicked(int index)
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
model: 3
|
model: 4
|
||||||
Text {
|
Text {
|
||||||
width: titleBar.width / 3
|
width: titleBar.width / 4
|
||||||
height: titleBar.height
|
height: titleBar.height
|
||||||
x: index * width
|
x: index * width
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
//text: GameSettings.hugeFontSize * 0.4
|
||||||
|
//text: currentIndex
|
||||||
text: __titles[index]
|
text: __titles[index]
|
||||||
font.pixelSize: GameSettings.tinyFontSize
|
font.pixelSize: GameSettings.hugeFontSize * 0.3
|
||||||
color: titleBar.currentIndex === index ? GameSettings.textColor : GameSettings.disabledTextColor
|
color: titleBar.currentIndex === index ? GameSettings.textColor : GameSettings.disabledTextColor
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
@@ -35,7 +37,7 @@ Rectangle {
|
|||||||
|
|
||||||
Item {
|
Item {
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
width: parent.width / 3
|
width: parent.width / 4
|
||||||
height: parent.height
|
height: parent.height
|
||||||
x: currentIndex * width
|
x: currentIndex * width
|
||||||
|
|
||||||
|
92
qml/settings.qml
Normal file
92
qml/settings.qml
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
import QtQuick 2.15
|
||||||
|
import QtQuick.Controls 2.15
|
||||||
|
import Shared 1.0
|
||||||
|
|
||||||
|
GamePage {
|
||||||
|
id: livedatePage
|
||||||
|
|
||||||
|
errorMessage: deviceHandler.error
|
||||||
|
infoMessage: deviceHandler.info
|
||||||
|
|
||||||
|
function close()
|
||||||
|
{
|
||||||
|
deviceHandler.disconnectService();
|
||||||
|
app.prevPage();
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: viewContainer
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.topMargin: GameSettings.fieldMargin + messageHeight
|
||||||
|
anchors.bottomMargin: GameSettings.fieldMargin
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
width: parent.width - GameSettings.fieldMargin*2
|
||||||
|
color: GameSettings.viewColor
|
||||||
|
radius: GameSettings.buttonRadius
|
||||||
|
|
||||||
|
|
||||||
|
Text {
|
||||||
|
id: title
|
||||||
|
width: parent.width
|
||||||
|
height: GameSettings.fieldHeight
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
color: GameSettings.textColor
|
||||||
|
font.pixelSize: GameSettings.mediumFontSize
|
||||||
|
text: qsTr("WIFIS")
|
||||||
|
|
||||||
|
BottomLine {
|
||||||
|
height: 1;
|
||||||
|
width: parent.width
|
||||||
|
color: "#898989"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ListView {
|
||||||
|
id: wifis
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
anchors.top: title.bottom
|
||||||
|
//model: deviceFinder.devices // Needs to be changed
|
||||||
|
clip: true
|
||||||
|
|
||||||
|
delegate: Rectangle {
|
||||||
|
id: box
|
||||||
|
height:GameSettings.fieldHeight * 1.2
|
||||||
|
width: parent.width
|
||||||
|
color: index % 2 === 0 ? GameSettings.delegate1Color : GameSettings.delegate2Color
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
onClicked: {
|
||||||
|
//Handle editor
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Text {
|
||||||
|
id: device
|
||||||
|
font.pixelSize: GameSettings.smallFontSize
|
||||||
|
text: modelData.ssid
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.topMargin: parent.height * 0.1
|
||||||
|
anchors.leftMargin: parent.height * 0.1
|
||||||
|
anchors.left: parent.left
|
||||||
|
color: GameSettings.textColor
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
Text {
|
||||||
|
id: deviceAddress
|
||||||
|
font.pixelSize: GameSettings.smallFontSize
|
||||||
|
text: modelData.deviceAddress
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
anchors.bottomMargin: parent.height * 0.1
|
||||||
|
anchors.rightMargin: parent.height * 0.1
|
||||||
|
anchors.right: parent.right
|
||||||
|
color: Qt.darker(GameSettings.textColor)
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
6
settings.cpp
Normal file
6
settings.cpp
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#include "settings.h"
|
||||||
|
|
||||||
|
settings::settings()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
11
settings.h
Normal file
11
settings.h
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
#ifndef SETTINGS_H
|
||||||
|
#define SETTINGS_H
|
||||||
|
|
||||||
|
|
||||||
|
class settings
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
settings();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // SETTINGS_H
|
Reference in New Issue
Block a user