Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick José Pereira <[email protected]>
  • Loading branch information
patrickelectric committed Feb 14, 2022
1 parent 6a8fd65 commit 0debda1
Show file tree
Hide file tree
Showing 20 changed files with 43 additions and 32 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ find_package(Qt6 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS
Svg
Test
Widgets
Multimedia
)

message(STATUS "Qt Version: ${Qt5_VERSION}")
Expand Down
2 changes: 1 addition & 1 deletion qml/DisplaySettings.qml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import DeviceManager 1.0
import QtGraphicalEffects 1.0
import Qt5Compat.GraphicalEffects
import QtQml 2.2
import QtQuick 2.15
import QtQuick.Controls 2.2
Expand Down
4 changes: 2 additions & 2 deletions qml/FirmwareUpdate.qml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import DeviceManager 1.0
import Flasher 1.0
import QtGraphicalEffects 1.0
import Qt5Compat.GraphicalEffects
import QtQml 2.2
import QtQuick 2.15
import QtQuick.Controls 2.2
import QtQuick.Controls.Material 2.2
import QtQuick.Dialogs 1.2
import QtQuick.Dialogs
import QtQuick.Layouts 1.3
import SettingsManager 1.0

Expand Down
2 changes: 1 addition & 1 deletion qml/InfoPage.qml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Logger 1.0
import QtGraphicalEffects 1.0
import Qt5Compat.GraphicalEffects
import QtQuick 2.15
import QtQuick.Controls 2.2
import QtQuick.Controls.Material 2.2
Expand Down
7 changes: 4 additions & 3 deletions qml/MainPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import FileManager 1.0
import Ping 1.0
import PingEnumNamespace 1.0
import Qt.labs.settings 1.0
import QtGraphicalEffects 1.0
import Qt5Compat.GraphicalEffects
import QtMultimedia 5.12
import QtQuick 2.15
import QtQuick.Controls 2.2
import QtQuick.Controls.Material 2.2
import QtQuick.Dialogs 1.2
import QtQuick.Dialogs
import QtQuick.Layouts 1.3
import SettingsManager 1.0
import StyleManager 1.0
Expand Down Expand Up @@ -371,11 +371,12 @@ Item {
}

// Sound effect for screenshot
/*
SoundEffect {
id: cameraShutterSound
source: "qrc:/sounds/camera-shutter.wav"
}
}*/

// Flash effect for screenshot
Rectangle {
Expand Down
2 changes: 1 addition & 1 deletion qml/Ping1DControlPanel.qml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import DeviceManager 1.0
import QtGraphicalEffects 1.0
import Qt5Compat.GraphicalEffects
import QtQml 2.2
import QtQuick 2.15
import QtQuick.Controls 2.2
Expand Down
2 changes: 1 addition & 1 deletion qml/Ping1DVisualizer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import DeviceManager 1.0
import FileManager 1.0
import GradientScale 1.0
import Qt.labs.settings 1.0
import QtGraphicalEffects 1.0
import Qt5Compat.GraphicalEffects
import QtQuick 2.15
import QtQuick.Controls 2.2
import QtQuick.Controls 1.4 as QC1
Expand Down
2 changes: 1 addition & 1 deletion qml/Ping360Visualizer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import FileManager 1.0
import GradientScale 1.0
import PolarPlot 1.0
import Qt.labs.settings 1.0
import QtGraphicalEffects 1.0
import Qt5Compat.GraphicalEffects
import QtQuick 2.15
import QtQuick.Controls 2.2
import QtQuick.Controls 1.4 as QC1
Expand Down
2 changes: 1 addition & 1 deletion qml/PingImage.qml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import QtGraphicalEffects 1.12
import Qt5Compat.GraphicalEffects
import QtQuick 2.15
import QtQuick.Controls.Material 2.2

Expand Down
4 changes: 2 additions & 2 deletions qml/PingItem.qml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import QtGraphicalEffects 1.0
import Qt5Compat.GraphicalEffects
import QtQuick 2.15
import QtQuick.Controls 1.2
//import QtQuick.Controls 1.2
import QtQuick.Controls.Material 2.2
import StyleManager 1.0

Expand Down
2 changes: 1 addition & 1 deletion qml/PingNotificationArea.qml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import NotificationManager 1.0
import QtGraphicalEffects 1.0
import Qt5Compat.GraphicalEffects
import QtQuick 2.15
import QtQuick.Controls 2.4
import QtQuick.Controls.Material 2.2
Expand Down
2 changes: 1 addition & 1 deletion qml/main.qml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Qt.labs.settings 1.0
import QtGraphicalEffects 1.0
import Qt5Compat.GraphicalEffects
import QtQuick 2.15
import QtQuick.Controls 2.2
import QtQuick.Controls.Material 2.1
Expand Down
4 changes: 3 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,14 @@ PRIVATE
Qt6::Charts
Qt6::Svg
Qt6::Widgets # QApplication
Qt6::Multimedia
${INCLUDE_DIRS}
fmt::fmt
)

# Test target
if(NOT WIN32)

if(false)
enable_testing(true)
add_executable(test test.cpp)
add_test(NAME test COMMAND test)
Expand Down
5 changes: 4 additions & 1 deletion src/link/linkconfiguration.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <QUrl>
#include <QVariant>

#include "linkconfiguration.h"
#include "networkmanager.h"
Expand Down Expand Up @@ -189,7 +190,9 @@ QDataStream& operator<<(QDataStream& out, const LinkConfiguration linkConfigurat
QDataStream& operator>>(QDataStream& in, LinkConfiguration& linkConfiguration)
{
QString name;
QVariant variantArgs, variantType, variantDeviceType;
QVariant variantArgs;
QVariant variantType;
QVariant variantDeviceType;
in >> name;
in >> variantArgs;
in >> variantType;
Expand Down
5 changes: 2 additions & 3 deletions src/sensor/ping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ void Ping::loadLastPingConfigurationSettings()

// Load settings for device using device id
QVariant pingConfigurationVariant
= SettingsManager::self()->getMapValue({"Ping", "PingConfiguration", QString(_commonVariables.srcId)});
= SettingsManager::self()->getMapValue({"Ping", "PingConfiguration", QString::number(_commonVariables.srcId)});
if (pingConfigurationVariant.type() != QVariant::Map) {
qCWarning(PING_PROTOCOL_PING) << "No valid PingConfiguration in settings." << pingConfigurationVariant.type();
return;
Expand All @@ -133,8 +133,7 @@ void Ping::updatePingConfigurationSettings()
for (const auto& key : _pingConfiguration.keys()) {
auto& dataStruct = _pingConfiguration[key];
dataStruct.set(dataStruct.getClassValue());
SettingsManager::self()->setMapValue(
{"Ping", "PingConfiguration", QString(_commonVariables.srcId), key}, dataStruct.value);
SettingsManager::self()->setMapValue({"Ping", "PingConfiguration", QString::number(_commonVariables.srcId), key}, dataStruct.value);
}
}

Expand Down
13 changes: 8 additions & 5 deletions src/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
#include <QRegularExpression>

#include "abstractlink.h"
#include "filemanager.h"
//#include "filemanager.h"
#include "linkconfiguration.h"
#include "logger.h"
//#include "logger.h"
#include "ping.h"
#include "settingsmanager.h"
#include "util.h"
Expand All @@ -24,11 +24,12 @@

void Test::initTestCase()
{
FileManager::self();
Logger::self()->installHandler();
//FileManager::self();
//Logger::self()->installHandler();
SettingsManager::self();
}

/*
void Test::fileManager()
{
auto fileManager = FileManager::self();
Expand Down Expand Up @@ -70,8 +71,9 @@ void Test::fileManager()
}
// TODO: Populate gradients folder and test FileManager.getFilesFrom
}
}*/

/*
void Test::logger()
{
auto logger = Logger::self();
Expand All @@ -82,6 +84,7 @@ void Test::logger()
QVERIFY2(!logger->isEmpty(), qPrintable("Log file is empty."));
}
*/

void Test::ringVector()
{
Expand Down
4 changes: 3 additions & 1 deletion src/util/util.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include <QCoreApplication>
#include <QProcess>
#include <QQmlEngine>
#include <QSerialPortInfo>
#include <QtCharts/QXYSeries>
Expand All @@ -21,7 +23,7 @@ QStringList Util::serialPortList()
return portNameList;
}

void Util::update(QtCharts::QAbstractSeries* series, const QVector<double>& points, const float initPos,
void Util::update(QAbstractSeries* series, const QVector<double>& points, const float initPos,
const float finalPos, const float minPoint, const float maxPoint, const float multiplier)
{
// This value should be updated in Charts.qml to make it compatible
Expand Down
4 changes: 2 additions & 2 deletions src/util/util.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include <QLoggingCategory>
#include <QtCharts>
#include <QAbstractSeries>

class QJSEngine;
class QQmlEngine;
Expand Down Expand Up @@ -29,7 +29,7 @@ class Util : public QObject {
* @param maxPoint
* @param multiplier
*/
Q_INVOKABLE void update(QtCharts::QAbstractSeries* series, const QVector<double>& points, const float initPos,
Q_INVOKABLE void update(QAbstractSeries* series, const QVector<double>& points, const float initPos,
const float finalPos, const float minPoint, const float maxPoint, const float multiplier = 1);

/**
Expand Down
2 changes: 1 addition & 1 deletion src/waterfall/waterfall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ float Waterfall::RGBToValue(const QColor& color) { return _gradient.getValue(col
void Waterfall::hoverMoveEvent(QHoverEvent* event)
{
event->accept();
_mousePos = event->pos();
_mousePos = event->position();
_containsMouse = true;
emit mousePosChanged();
emit containsMouseChanged();
Expand Down
6 changes: 3 additions & 3 deletions src/waterfall/waterfall.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ class Waterfall : public QQuickPaintedItem {
*
* @return QPoint
*/
QPoint mousePos() { return _mousePos; }
Q_PROPERTY(QPoint mousePos READ mousePos NOTIFY mousePosChanged)
QPointF mousePos() { return _mousePos; }
Q_PROPERTY(QPointF mousePos READ mousePos NOTIFY mousePosChanged)

/**
* @brief Return true if the mouse is currently inside the waterfall area
Expand Down Expand Up @@ -170,7 +170,7 @@ class Waterfall : public QQuickPaintedItem {
bool _containsMouse;
WaterfallGradient _gradient;
static QList<WaterfallGradient> _gradients;
QPoint _mousePos;
QPointF _mousePos;
bool _smooth;
QString _theme;
QStringList _themes;
Expand Down

0 comments on commit 0debda1

Please sign in to comment.