diff --git a/Serial-Studio.pro b/Serial-Studio.pro index 2147327c..59dc727a 100644 --- a/Serial-Studio.pro +++ b/Serial-Studio.pro @@ -293,7 +293,6 @@ DISTFILES += \ assets/qml/PlatformDependent/MenubarMacOS.qml \ assets/qml/Widgets/Icon.qml \ assets/qml/Widgets/JSONDropArea.qml \ - assets/qml/Widgets/LED.qml \ assets/qml/Widgets/Shadow.qml \ assets/qml/Widgets/Terminal.qml \ assets/qml/Widgets/Window.qml \ diff --git a/assets/Resources.qrc b/assets/Resources.qrc index 7e1994c8..e7edb9ee 100644 --- a/assets/Resources.qrc +++ b/assets/Resources.qrc @@ -122,7 +122,6 @@ qml/PlatformDependent/MenubarMacOS.qml qml/Widgets/Icon.qml qml/Widgets/JSONDropArea.qml - qml/Widgets/LED.qml qml/Widgets/Shadow.qml qml/Widgets/Terminal.qml qml/Widgets/Window.qml diff --git a/assets/qml/Widgets/LED.qml b/assets/qml/Widgets/LED.qml deleted file mode 100644 index 71046fe3..00000000 --- a/assets/qml/Widgets/LED.qml +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2020-2021 Alex Spataru - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -import QtQuick 2.12 -import QtQuick.Layouts 1.12 -import QtQuick.Controls 2.12 - -RowLayout { - id: root - spacing: app.spacing - - // - // Custom properties - // - property alias label: _label - property alias indicator: _dot - property alias text: _label.text - property alias font: _label.font - property alias flashDuration: _timer.interval - - // - // Turns on the LED for a short period of time - // - function flash() { - root.enabled = true - if (_timer.running) - _timer.restart() - else - _timer.start() - } - - // - // Used to allow the flash behavior - // - Timer { - id: _timer - interval: 50 - onTriggered: root.enabled = false - } - - // - // LED indicator - // - Rectangle { - id: _dot - width: 14 - height: 14 - radius: width / 2 - Layout.alignment: Qt.AlignVCenter - color: root.enabled ? Cpp_ThemeManager.ledEnabled : Cpp_ThemeManager.ledDisabled - } - - // - // LED text - // - Label { - id: _label - font.family: app.monoFont - Layout.alignment: Qt.AlignVCenter - color: root.enabled ? Cpp_ThemeManager.ledEnabled : Cpp_ThemeManager.ledDisabled - } -} diff --git a/assets/qml/Windows/MainWindow.qml b/assets/qml/Windows/MainWindow.qml index 1e48db26..11899f1d 100644 --- a/assets/qml/Windows/MainWindow.qml +++ b/assets/qml/Windows/MainWindow.qml @@ -263,72 +263,6 @@ FramelessWindow.CustomWindow { Item { Layout.fillWidth: true } - - // - // RX LED - // - LED { - id: _rx - enabled: false - Layout.alignment: Qt.AlignVCenter - - Connections { - target: Cpp_IO_Manager - function onRx() { - _rx.flash() - } - } - } - - // - // RX label - // - Label { - text: "RX" - font.bold: true - font.family: app.monoFont - Layout.alignment: Qt.AlignVCenter - color: _rx.enabled ? Cpp_ThemeManager.ledEnabled : Cpp_ThemeManager.ledDisabled - } - - // - // RX/TX middleman icon - // - Icon { - width: 24 - height: 24 - source: "qrc:/icons/ethernet.svg" - Layout.alignment: Qt.AlignVCenter - color: Cpp_ThemeManager.ledDisabled - } - - // - // TX Label - // - Label { - text: "TX" - font.bold: true - font.family: app.monoFont - Layout.alignment: Qt.AlignVCenter - color: _tx.enabled ? Cpp_ThemeManager.ledEnabled : Cpp_ThemeManager.ledDisabled - } - - // - // TX LED - // - LED { - id: _tx - enabled: false - layoutDirection: Qt.RightToLeft - Layout.alignment: Qt.AlignVCenter - - Connections { - target: Cpp_IO_Manager - function onTx() { - _tx.flash() - } - } - } } // diff --git a/src/IO/Manager.cpp b/src/IO/Manager.cpp index ecaa2c0e..f51e883a 100644 --- a/src/IO/Manager.cpp +++ b/src/IO/Manager.cpp @@ -275,8 +275,7 @@ StringList Manager::dataSourcesList() const } /** - * Tries to write the given @a data to the current device. Upon data write, the class - * emits the @a tx() signal for UI updating. + * Tries to write the given @a data to the current device. * * @returns the number of bytes written to the target device */ @@ -315,8 +314,6 @@ qint64 Manager::writeData(const QByteArray &data) { auto writtenData = data; writtenData.chop(data.length() - bytes); - - emit tx(); emit dataSent(writtenData); } @@ -434,7 +431,6 @@ void Manager::processPayload(const QByteArray &payload) m_receivedBytes = 0; // Notify user interface & application modules - emit rx(); emit dataReceived(payload); emit frameReceived(payload); emit receivedBytesChanged(); @@ -644,7 +640,6 @@ void Manager::onDataReceived() // Notify user interface emit receivedBytesChanged(); emit dataReceived(data); - emit rx(); } /** diff --git a/src/IO/Manager.h b/src/IO/Manager.h index f4d8c784..ca8f7b97 100644 --- a/src/IO/Manager.h +++ b/src/IO/Manager.h @@ -97,8 +97,6 @@ class Manager : public QObject // clang-format on signals: - void tx(); - void rx(); void deviceChanged(); void connectedChanged(); void watchdogTriggered();