diff --git a/CMakeLists.txt b/CMakeLists.txt index 28b57754..3c070233 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,11 +38,11 @@ file(GLOB_RECURSE X_TOOLS_TOOLS_SOURCE_CPP "${CMAKE_SOURCE_DIR}/Source/Tools/*.c file(GLOB_RECURSE X_TOOLS_TOOLBOX_SOURCE_H "${CMAKE_SOURCE_DIR}/Source/ToolBox/*.h") file(GLOB_RECURSE X_TOOLS_TOOLBOX_SOURCE_UI "${CMAKE_SOURCE_DIR}/Source/ToolBox/*.ui") -file(GLOB_RECURSE X_TOOLS_TOOLBOX_SOURCE_CPP "${CMAKE_SOURCE_DIR}/Source/ToolBox/*.cc") +file(GLOB_RECURSE X_TOOLS_TOOLBOX_SOURCE_CPP "${CMAKE_SOURCE_DIR}/Source/ToolBox/*.cpp") file(GLOB X_TOOLS_SOURCE_H "${CMAKE_SOURCE_DIR}/Source/*.h") file(GLOB X_TOOLS_SOURCE_UI "${CMAKE_SOURCE_DIR}/Source/*.ui") -file(GLOB X_TOOLS_SOURCE_CPP "${CMAKE_SOURCE_DIR}/Source/*.cc") +file(GLOB X_TOOLS_SOURCE_CPP "${CMAKE_SOURCE_DIR}/Source/*.cpp") file(GLOB X_TOOLS_ASSISTANT_SOURCE_H "${CMAKE_SOURCE_DIR}/Source/Assistants/*/Source/*.h") file(GLOB X_TOOLS_ASSISTANT_SOURCE_UI "${CMAKE_SOURCE_DIR}/Source/Assistants/*/Source/*.ui") @@ -86,10 +86,10 @@ set(BUILD_TESTING OFF) set(BUILD_SHARED_LIBS OFF) sak_add_subdirectory("glog-0.7.0") -sak_add_subdirectory("Qt-AES-master") -sak_add_subdirectory("nodeeditor-3.0.10") sak_add_subdirectory("qmdnsengine-master") +#add_subdirectory(${CMAKE_SOURCE_DIR}/Source/Assistants) + qt_add_executable(xTools ${X_TOOLS_SOURCE}) sak_git_get_last_commit(${CMAKE_SOURCE_DIR} "SAK") sak_git_get_last_commit_time(${CMAKE_SOURCE_DIR} "SAK") @@ -104,5 +104,3 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL "iOS") endif() target_link_libraries(xTools PRIVATE qmdnsengine) target_link_libraries(xTools PRIVATE glog::glog) -target_link_libraries(xTools PRIVATE QtAES::QtAES) -target_link_libraries(xTools PRIVATE QtNodes::QtNodes) diff --git a/Source/Application.cpp b/Source/Application.cpp index 324825ce..9437754f 100644 --- a/Source/Application.cpp +++ b/Source/Application.cpp @@ -6,7 +6,7 @@ * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * code directory. **************************************************************************************************/ -#include "application.h" +#include "Application.h" #include #include @@ -17,12 +17,12 @@ #include #include "sakdatastructure.h" -#include "mainwindow.h" +#include "MainWindow.h" #include "saksettings.h" #include "saktranslator.h" #ifdef Q_OS_WIN -#include "systemtrayicon.h" +#include "SystemTrayIcon.h" #endif Application::Application(int argc, char** argv) diff --git a/Source/Application.h b/Source/Application.h index 050c5dee..d9b85435 100644 --- a/Source/Application.h +++ b/Source/Application.h @@ -6,8 +6,7 @@ * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * code directory. **************************************************************************************************/ -#ifndef APPLICATION_H -#define APPLICATION_H +#pragma once #include #include @@ -30,5 +29,3 @@ private: private: static void setupPalette(const QString &fileName); }; - -#endif diff --git a/Source/Assistants/ASCII/Source/xToolsAsciiAssistant.h b/Source/Assistants/ASCII/Source/xToolsAsciiAssistant.h index e2677d89..b459f1c9 100644 --- a/Source/Assistants/ASCII/Source/xToolsAsciiAssistant.h +++ b/Source/Assistants/ASCII/Source/xToolsAsciiAssistant.h @@ -6,7 +6,7 @@ * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * code directory. **************************************************************************************************/ -#pragma onece +#pragma once #include #include diff --git a/Source/Assistants/Base64/Source/xToolsBase64Assisatnt.h b/Source/Assistants/Base64/Source/xToolsBase64Assisatnt.h index cb61d51f..797830c8 100644 --- a/Source/Assistants/Base64/Source/xToolsBase64Assisatnt.h +++ b/Source/Assistants/Base64/Source/xToolsBase64Assisatnt.h @@ -6,7 +6,7 @@ * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * code directory. **************************************************************************************************/ -#pragma onece +#pragma once #include diff --git a/Source/Assistants/Broadcast/Source/xToolsBroadcastAssistant.h b/Source/Assistants/Broadcast/Source/xToolsBroadcastAssistant.h index c47ad5ef..dd5f8d1c 100644 --- a/Source/Assistants/Broadcast/Source/xToolsBroadcastAssistant.h +++ b/Source/Assistants/Broadcast/Source/xToolsBroadcastAssistant.h @@ -6,7 +6,7 @@ * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * code directory. **************************************************************************************************/ -#pragma onece +#pragma once #include diff --git a/Source/Assistants/Broadcast/Source/xToolsBroadcastThread.h b/Source/Assistants/Broadcast/Source/xToolsBroadcastThread.h index e00879a9..2a992cf8 100644 --- a/Source/Assistants/Broadcast/Source/xToolsBroadcastThread.h +++ b/Source/Assistants/Broadcast/Source/xToolsBroadcastThread.h @@ -6,7 +6,7 @@ * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * code directory. **************************************************************************************************/ -#pragma onece +#pragma once #include #include diff --git a/Source/Assistants/CMakeLists.txt b/Source/Assistants/CMakeLists.txt index d40589f5..b6fdc54d 100644 --- a/Source/Assistants/CMakeLists.txt +++ b/Source/Assistants/CMakeLists.txt @@ -1,4 +1,4 @@ -macro(sak_add_assistant dir_name app_name) +macro(x_tools_add_assistant dir_name app_name) string(TOUPPER ${app_name} upper_app_name) option(SAK_ENABLE_APP_${upper_app_name} "" ON) if(SAK_ENABLE_APP_${upper_app_name}) @@ -33,16 +33,12 @@ macro(sak_add_assistant dir_name app_name) endif() endmacro() -add_subdirectory(crc) -add_subdirectory(mdns) -add_subdirectory(ping) -add_subdirectory(ascii) -add_subdirectory(base64) -add_subdirectory(number) -add_subdirectory(string) -add_subdirectory(broadcast) -add_subdirectory(filecheck) - -if(SAK_ENABLE_MODULE_FONTAWESOMEASSISTANT) - add_subdirectory(fontawesome) -endif() +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/mDNS) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/Ping) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/ASCII) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/Base64) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/Number) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/String) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/Broadcast) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/Filechecker) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/CRCCalculator) diff --git a/Source/Assistants/CRCCalculator/Source/xToolsCRCCalculatorAssistant.h b/Source/Assistants/CRCCalculator/Source/xToolsCRCCalculatorAssistant.h index da3581d8..855f3944 100644 --- a/Source/Assistants/CRCCalculator/Source/xToolsCRCCalculatorAssistant.h +++ b/Source/Assistants/CRCCalculator/Source/xToolsCRCCalculatorAssistant.h @@ -6,7 +6,7 @@ * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * code directory. **************************************************************************************************/ -#pragma onece +#pragma once #include #include diff --git a/Source/Assistants/FileChecker/Source/xToolsCryptographicHashCalculator.h b/Source/Assistants/FileChecker/Source/xToolsCryptographicHashCalculator.h index 92c89f1a..35345f03 100644 --- a/Source/Assistants/FileChecker/Source/xToolsCryptographicHashCalculator.h +++ b/Source/Assistants/FileChecker/Source/xToolsCryptographicHashCalculator.h @@ -6,7 +6,7 @@ * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * code directory. **************************************************************************************************/ -#pragma onece +#pragma once #include diff --git a/Source/Assistants/FileChecker/Source/xToolsFileCheckerAssistant.h b/Source/Assistants/FileChecker/Source/xToolsFileCheckerAssistant.h index 6935fcd9..46ffda36 100644 --- a/Source/Assistants/FileChecker/Source/xToolsFileCheckerAssistant.h +++ b/Source/Assistants/FileChecker/Source/xToolsFileCheckerAssistant.h @@ -6,7 +6,7 @@ * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * code directory. **************************************************************************************************/ -#pragma onece +#pragma once #include #include diff --git a/Source/Assistants/Number/Source/xToolsNumberAssistant.h b/Source/Assistants/Number/Source/xToolsNumberAssistant.h index a9c999df..3ed6a9b8 100644 --- a/Source/Assistants/Number/Source/xToolsNumberAssistant.h +++ b/Source/Assistants/Number/Source/xToolsNumberAssistant.h @@ -6,7 +6,7 @@ * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * code directory. **************************************************************************************************/ -#pragma onece +#pragma once #include diff --git a/Source/Assistants/Ping/Source/xToolsPingAssistant.h b/Source/Assistants/Ping/Source/xToolsPingAssistant.h index 8cf9d822..436e24aa 100644 --- a/Source/Assistants/Ping/Source/xToolsPingAssistant.h +++ b/Source/Assistants/Ping/Source/xToolsPingAssistant.h @@ -6,7 +6,7 @@ * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * code directory. **************************************************************************************************/ -#pragma onece +#pragma once #include #include diff --git a/Source/Assistants/String/Source/xToolsStringAssistant.h b/Source/Assistants/String/Source/xToolsStringAssistant.h index 55384a43..4b198a24 100644 --- a/Source/Assistants/String/Source/xToolsStringAssistant.h +++ b/Source/Assistants/String/Source/xToolsStringAssistant.h @@ -6,7 +6,7 @@ * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * code directory. **************************************************************************************************/ -#pragma onece +#pragma once #include diff --git a/Source/Assistants/mDNS/Source/xToolsMdnsAssistant.h b/Source/Assistants/mDNS/Source/xToolsMdnsAssistant.h index d8e2e7f8..7f0fd294 100644 --- a/Source/Assistants/mDNS/Source/xToolsMdnsAssistant.h +++ b/Source/Assistants/mDNS/Source/xToolsMdnsAssistant.h @@ -6,7 +6,7 @@ * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * code directory. **************************************************************************************************/ -#pragma onece +#pragma once #include #include diff --git a/Source/Assistants/mDNS/Source/xToolsMdnsServer.h b/Source/Assistants/mDNS/Source/xToolsMdnsServer.h index 1f757095..43a6d2cf 100644 --- a/Source/Assistants/mDNS/Source/xToolsMdnsServer.h +++ b/Source/Assistants/mDNS/Source/xToolsMdnsServer.h @@ -6,7 +6,7 @@ * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * code directory. **************************************************************************************************/ -#pragma onece +#pragma once #include #include diff --git a/Source/Assistants/xToolsAssistantFactory.h b/Source/Assistants/xToolsAssistantFactory.h index c10bce49..0b61648c 100644 --- a/Source/Assistants/xToolsAssistantFactory.h +++ b/Source/Assistants/xToolsAssistantFactory.h @@ -6,7 +6,7 @@ * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * code directory. **************************************************************************************************/ -#pragma onece +#pragma once #include #include diff --git a/Source/MainWindow.cpp b/Source/MainWindow.cpp index ee79ef0a..55856443 100644 --- a/Source/MainWindow.cpp +++ b/Source/MainWindow.cpp @@ -6,8 +6,8 @@ * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * code directory. **************************************************************************************************/ -#include "mainwindow.h" -#include "ui_mainwindow.h" +#include "MainWindow.h" +#include "ui_MainWindow.h" #include #include @@ -38,7 +38,7 @@ #include "sakdatastructure.h" #include "sakinterface.h" #include "saksettings.h" -#include "saktoolboxui.h" +#include "xToolsToolBoxUi.h" #include "saktranslator.h" #include "sakuiinterface.h" #include "xToolsAssistantFactory.h" @@ -151,13 +151,13 @@ void MainWindow::initFileMenu() // Tool box QMenu* windowMenu = new QMenu(tr("New Window"), this); fileMenu->addMenu(windowMenu); - QList toolTypeList = SAKToolBoxUi::supportedCommunicationTools(); + QList toolTypeList = xToolsToolBoxUi::supportedCommunicationTools(); for (auto& toolType : toolTypeList) { - const QString name = SAKToolBoxUi::communicationToolName(toolType); + const QString name = xToolsToolBoxUi::communicationToolName(toolType); QAction* action = new QAction(name, this); windowMenu->addAction(action); connect(action, &QAction::triggered, this, [=]() { - SAKToolBoxUi* w = new SAKToolBoxUi(); + xToolsToolBoxUi* w = new xToolsToolBoxUi(); w->setContentsMargins(9, 9, 9, 9); w->setAttribute(Qt::WA_DeleteOnClose, true); w->initialize(toolType); @@ -635,10 +635,10 @@ void MainWindow::initNav() tb->setAllowedAreas(Qt::LeftToolBarArea); static QButtonGroup navButtonGroup; - QList types = SAKToolBoxUi::supportedCommunicationTools(); + QList types = xToolsToolBoxUi::supportedCommunicationTools(); for (int i = 0; i < types.count(); i++) { int type = types.at(i); - SAKToolBoxUi* toolBoxUi = new SAKToolBoxUi(this); + xToolsToolBoxUi* toolBoxUi = new xToolsToolBoxUi(this); toolBoxUi->initialize(type); initNav({&navButtonGroup, diff --git a/Source/MainWindow.h b/Source/MainWindow.h index 470ad3fb..1711aad3 100644 --- a/Source/MainWindow.h +++ b/Source/MainWindow.h @@ -6,8 +6,7 @@ * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * code directory. **************************************************************************************************/ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H +#pragma once #include #include @@ -89,5 +88,3 @@ private slots: void onImportActionTriggered(); void onExportActionTriggered(); }; - -#endif // MAINWINDOW_H diff --git a/Source/SystemTrayIcon.cpp b/Source/SystemTrayIcon.cpp index 234b38eb..b10f2363 100644 --- a/Source/SystemTrayIcon.cpp +++ b/Source/SystemTrayIcon.cpp @@ -6,7 +6,8 @@ * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * code directory. **************************************************************************************************/ -#include "systemtrayicon.h" +#include "SystemTrayIcon.h" + #include #include #include diff --git a/Source/SystemTrayIcon.h b/Source/SystemTrayIcon.h index 0884016d..ee7e74a9 100644 --- a/Source/SystemTrayIcon.h +++ b/Source/SystemTrayIcon.h @@ -6,8 +6,7 @@ * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * code directory. **************************************************************************************************/ -#ifndef SYSTEMTRAYICON_H -#define SYSTEMTRAYICON_H +#pragma once #include @@ -21,5 +20,3 @@ signals: void invokeExit(); void invokeShowMainWindow(); }; - -#endif // SYSTEMTRAYICON_H diff --git a/Source/ToolBox/ToolBox/xToolsToolBox.cpp b/Source/ToolBox/ToolBox/xToolsToolBox.cpp index f0a7d397..c965cc25 100644 --- a/Source/ToolBox/ToolBox/xToolsToolBox.cpp +++ b/Source/ToolBox/ToolBox/xToolsToolBox.cpp @@ -6,11 +6,11 @@ * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * code directory. **************************************************************************************************/ -#include "saktoolbox.h" +#include "xToolsToolBox.h" #include "saktoolfactory.h" -SAKToolBox::SAKToolBox(QObject* parent) +xToolsToolBox::xToolsToolBox(QObject* parent) : QObject{parent} { auto createTool = [](int type) -> SAKBaseTool* { @@ -43,14 +43,14 @@ SAKToolBox::SAKToolBox(QObject* parent) connect(tool, &SAKBaseTool::errorOccurred, this, - &SAKToolBox::errorOccurred, + &xToolsToolBox::errorOccurred, Qt::ConnectionType(flag)); } - connect(this, &SAKToolBox::errorOccurred, this, [=]() { this->close(); }); + connect(this, &xToolsToolBox::errorOccurred, this, [=]() { this->close(); }); } -SAKToolBox::~SAKToolBox() +xToolsToolBox::~xToolsToolBox() { if (m_comunicator) { m_comunicator->exit(); @@ -65,7 +65,7 @@ SAKToolBox::~SAKToolBox() } } -void SAKToolBox::initialize(int type) +void xToolsToolBox::initialize(int type) { if (m_comunicator) { m_comunicator->exit(); @@ -83,8 +83,8 @@ void SAKToolBox::initialize(int type) } // clang-format off - connect(m_comunicator, &SAKCommunicationTool::bytesWritten, this, &SAKToolBox::onCommunicatorBytesWritten); - connect(m_comunicator, &SAKCommunicationTool::bytesRead, this, &SAKToolBox::onCommunicatorBytesRead); + connect(m_comunicator, &SAKCommunicationTool::bytesWritten, this, &xToolsToolBox::onCommunicatorBytesWritten); + connect(m_comunicator, &SAKCommunicationTool::bytesRead, this, &xToolsToolBox::onCommunicatorBytesRead); // emiiter,responser,prestorer->tx connect(m_emitter, &SAKBaseTool::outputBytes, m_comunicator, &SAKBaseTool::inputBytes); connect(m_responser, &SAKBaseTool::outputBytes, m_comunicator, &SAKBaseTool::inputBytes); @@ -96,13 +96,13 @@ void SAKToolBox::initialize(int type) connect(m_tcpTransmitter, &SAKBaseTool::outputBytes, m_comunicator, &SAKBaseTool::inputBytes); connect(m_webSocketTransmitter, &SAKBaseTool::outputBytes, m_comunicator, &SAKBaseTool::inputBytes); - connect(m_comunicator, &SAKCommunicationTool::errorOccurred, this, &SAKToolBox::errorOccurred); + connect(m_comunicator, &SAKCommunicationTool::errorOccurred, this, &xToolsToolBox::errorOccurred); // clang-format on emit communicatorChanged(); } -void SAKToolBox::open() +void xToolsToolBox::open() { if (m_comunicator) { for (auto tool : m_tools) { @@ -117,7 +117,7 @@ void SAKToolBox::open() } } -void SAKToolBox::close() +void xToolsToolBox::close() { if (m_comunicator) { m_comunicator->exit(); @@ -135,82 +135,82 @@ void SAKToolBox::close() } } -void SAKToolBox::send(const QByteArray& bytes) +void xToolsToolBox::send(const QByteArray& bytes) { m_comunicator->inputBytes(bytes); } -bool SAKToolBox::isWorking() +bool xToolsToolBox::isWorking() { return m_isWorking; } -SAKCommunicationTool* SAKToolBox::getCommunicationTool() +SAKCommunicationTool* xToolsToolBox::getCommunicationTool() { return m_comunicator; } -SAKEmitterTool* SAKToolBox::getEmitterTool() +SAKEmitterTool* xToolsToolBox::getEmitterTool() { return m_emitter; } -SAKResponserTool* SAKToolBox::getResponserTool() +SAKResponserTool* xToolsToolBox::getResponserTool() { return m_responser; } -SAKStorerTool* SAKToolBox::getStorerTool() +SAKStorerTool* xToolsToolBox::getStorerTool() { return m_storer; } -SAKPrestorerTool* SAKToolBox::getPrestorerTool() +SAKPrestorerTool* xToolsToolBox::getPrestorerTool() { return m_prestorer; } -SAKVelometerTool* SAKToolBox::getRxVelometerTool() +SAKVelometerTool* xToolsToolBox::getRxVelometerTool() { return m_rxVelometer; } -SAKVelometerTool* SAKToolBox::getTxVelometerTool() +SAKVelometerTool* xToolsToolBox::getTxVelometerTool() { return m_txVelometer; } -SAKStatisticianTool* SAKToolBox::getRxStatisticianTool() +SAKStatisticianTool* xToolsToolBox::getRxStatisticianTool() { return m_rxCounter; } -SAKStatisticianTool* SAKToolBox::getTxStatisticianTool() +SAKStatisticianTool* xToolsToolBox::getTxStatisticianTool() { return m_txCounter; } -SAKUdpTransmitterTool* SAKToolBox::getUdpTransmitterTool() +SAKUdpTransmitterTool* xToolsToolBox::getUdpTransmitterTool() { return m_udpTransmitter; } -SAKTcpTransmitterTool* SAKToolBox::getTcpTransmitterTool() +SAKTcpTransmitterTool* xToolsToolBox::getTcpTransmitterTool() { return m_tcpTransmitter; } -SAKWebSocketTransmitterTool* SAKToolBox::getWebSocketTransmitterTool() +SAKWebSocketTransmitterTool* xToolsToolBox::getWebSocketTransmitterTool() { return m_webSocketTransmitter; } -SAKSerialPortTransmitterTool* SAKToolBox::getSerialPortTransmitterTool() +SAKSerialPortTransmitterTool* xToolsToolBox::getSerialPortTransmitterTool() { return m_serialPortTransmitter; } -void SAKToolBox::uninitializedTips() +void xToolsToolBox::uninitializedTips() { static QByteArray tips("You must call the interface name initialize()" " before using the object."); @@ -219,72 +219,72 @@ void SAKToolBox::uninitializedTips() emit errorOccurred(QString::fromLatin1(tips)); } -QVariant SAKToolBox::communicator() +QVariant xToolsToolBox::communicator() { return QVariant::fromValue(m_comunicator); } -QVariant SAKToolBox::emitter() +QVariant xToolsToolBox::emitter() { return QVariant::fromValue(m_emitter); } -QVariant SAKToolBox::responser() +QVariant xToolsToolBox::responser() { return QVariant::fromValue(m_responser); } -QVariant SAKToolBox::storer() +QVariant xToolsToolBox::storer() { return QVariant::fromValue(m_storer); } -QVariant SAKToolBox::prestorer() +QVariant xToolsToolBox::prestorer() { return QVariant::fromValue(m_prestorer); } -QVariant SAKToolBox::rxVelometer() +QVariant xToolsToolBox::rxVelometer() { return QVariant::fromValue(m_rxVelometer); } -QVariant SAKToolBox::txVelometer() +QVariant xToolsToolBox::txVelometer() { return QVariant::fromValue(m_txVelometer); } -QVariant SAKToolBox::rxStatistician() +QVariant xToolsToolBox::rxStatistician() { return QVariant::fromValue(m_rxCounter); } -QVariant SAKToolBox::txStatistician() +QVariant xToolsToolBox::txStatistician() { return QVariant::fromValue(m_txCounter); } -QVariant SAKToolBox::udpTransmitter() +QVariant xToolsToolBox::udpTransmitter() { return QVariant::fromValue(m_udpTransmitter); } -QVariant SAKToolBox::tcpTransmitter() +QVariant xToolsToolBox::tcpTransmitter() { return QVariant::fromValue(m_tcpTransmitter); } -QVariant SAKToolBox::webSocketTransmitter() +QVariant xToolsToolBox::webSocketTransmitter() { return QVariant::fromValue(m_webSocketTransmitter); } -QVariant SAKToolBox::serialPortTransmitter() +QVariant xToolsToolBox::serialPortTransmitter() { return QVariant::fromValue(m_serialPortTransmitter); } -void SAKToolBox::onCommunicatorBytesWritten(const QByteArray& bytes, const QString& to) +void xToolsToolBox::onCommunicatorBytesWritten(const QByteArray& bytes, const QString& to) { Q_UNUSED(to) m_txVelometer->inputBytes(bytes); @@ -292,7 +292,7 @@ void SAKToolBox::onCommunicatorBytesWritten(const QByteArray& bytes, const QStri m_storer->inputBytes(bytes); } -void SAKToolBox::onCommunicatorBytesRead(const QByteArray& bytes, const QString& to) +void xToolsToolBox::onCommunicatorBytesRead(const QByteArray& bytes, const QString& to) { Q_UNUSED(to) m_rxVelometer->inputBytes(bytes); diff --git a/Source/ToolBox/ToolBox/xToolsToolBox.h b/Source/ToolBox/ToolBox/xToolsToolBox.h index 099f8b10..a9005e04 100644 --- a/Source/ToolBox/ToolBox/xToolsToolBox.h +++ b/Source/ToolBox/ToolBox/xToolsToolBox.h @@ -6,8 +6,7 @@ * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * code directory. **************************************************************************************************/ -#ifndef SAKTOOLBOX_H -#define SAKTOOLBOX_H +#pragma once #include #include @@ -25,7 +24,7 @@ #include "sakvelometertool.h" #include "sakwebsockettransmittertool.h" -class SAKToolBox : public QObject +class xToolsToolBox : public QObject { Q_OBJECT Q_PROPERTY(QVariant communicator READ communicator NOTIFY communicatorChanged) @@ -45,8 +44,8 @@ class SAKToolBox : public QObject Q_PROPERTY(bool isWorking READ isWorking NOTIFY isWorkingChanged) public: - explicit SAKToolBox(QObject* parent = nullptr); - ~SAKToolBox(); + explicit xToolsToolBox(QObject* parent = nullptr); + ~xToolsToolBox(); /// You must call the interface before useing. Q_INVOKABLE void initialize(int type); @@ -115,5 +114,3 @@ private: void onCommunicatorBytesWritten(const QByteArray& bytes, const QString& to); void onCommunicatorBytesRead(const QByteArray& bytes, const QString& to); }; - -#endif // SAKTOOLBOX_H diff --git a/Source/ToolBox/ToolBoxUI/xToolsToolBoxUi.cpp b/Source/ToolBox/ToolBoxUI/xToolsToolBoxUi.cpp index ea4e20d9..e9813e83 100644 --- a/Source/ToolBox/ToolBoxUI/xToolsToolBoxUi.cpp +++ b/Source/ToolBox/ToolBoxUI/xToolsToolBoxUi.cpp @@ -6,7 +6,8 @@ * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * code directory. **************************************************************************************************/ -#include "saktoolboxui.h" +#include "xToolsToolBoxUi.h" +#include "ui_xToolsToolBoxUi.h" #include #include @@ -30,25 +31,24 @@ #include "saksocketclienttoolui.h" #include "saksocketservertoolui.h" #include "saktcptransmittertoolti.h" -#include "saktoolboxuicommunicationmenu.h" -#include "saktoolboxuiinputmenu.h" -#include "saktoolboxuioutputmenu.h" +#include "xToolsToolBoxUiCommunicationMenu.h" +#include "xToolsToolBoxUiInputMenu.h" +#include "xToolsToolBoxUiOutputMenu.h" #include "saktoolfactory.h" #include "sakudptransmittertoolui.h" #include "sakuiinterface.h" #include "sakwebsockettransmittertoolui.h" -#include "ui_saktoolboxui.h" #ifdef SAK_IMPORT_MODULE_BLUETOOTH #include "sakblecentraltoolui.h" #endif -SAKToolBoxUi::SAKToolBoxUi(QWidget* parent) +xToolsToolBoxUi::xToolsToolBoxUi(QWidget* parent) : QWidget{parent} - , ui(new Ui::SAKToolBoxUi) + , ui(new Ui::xToolsToolBoxUi) { ui->setupUi(this); - m_toolBox = new SAKToolBox(this); + m_toolBox = new xToolsToolBox(this); m_cycleSendingTimer = new QTimer(this); connect(m_cycleSendingTimer, &QTimer::timeout, this, [=]() { @@ -60,12 +60,12 @@ SAKToolBoxUi::SAKToolBoxUi(QWidget* parent) }); } -SAKToolBoxUi::~SAKToolBoxUi() +xToolsToolBoxUi::~xToolsToolBoxUi() { delete ui; } -QList SAKToolBoxUi::supportedCommunicationTools() +QList xToolsToolBoxUi::supportedCommunicationTools() { QList list; list << SAKToolFactory::SerialportTool @@ -78,7 +78,7 @@ QList SAKToolBoxUi::supportedCommunicationTools() return list; } -QString SAKToolBoxUi::communicationToolName(int type) +QString xToolsToolBoxUi::communicationToolName(int type) { if (type == SAKToolFactory::SerialportTool) { return tr("SerialPort"); @@ -101,7 +101,7 @@ QString SAKToolBoxUi::communicationToolName(int type) } } -QIcon SAKToolBoxUi::communicationToolIcon(int type) +QIcon xToolsToolBoxUi::communicationToolIcon(int type) { QString fileName; if (type == SAKToolFactory::SerialportTool) { @@ -126,7 +126,7 @@ QIcon SAKToolBoxUi::communicationToolIcon(int type) return icon; } -void SAKToolBoxUi::initialize(int type) +void xToolsToolBoxUi::initialize(int type) { if (m_communication) { m_communication->deleteLater(); @@ -151,7 +151,7 @@ void SAKToolBoxUi::initialize(int type) init(); } -SAKCommunicationToolUi* SAKToolBoxUi::communicationToolUi(int type) +SAKCommunicationToolUi* xToolsToolBoxUi::communicationToolUi(int type) { SAKCommunicationToolUi* w = nullptr; if (type == SAKToolFactory::SerialportTool) { @@ -181,7 +181,7 @@ SAKCommunicationToolUi* SAKToolBoxUi::communicationToolUi(int type) return w; } -void SAKToolBoxUi::try2send() +void xToolsToolBoxUi::try2send() { auto ctx = m_inputMenu->parameters(); int prefix = ctx.prefix; @@ -205,7 +205,7 @@ void SAKToolBoxUi::try2send() m_toolBox->getCommunicationTool()->inputBytes(bytes); } -QString SAKToolBoxUi::dateTimeFormat() +QString xToolsToolBoxUi::dateTimeFormat() { static QString dateFormat = QLocale::system().dateFormat(); @@ -237,7 +237,7 @@ QString SAKToolBoxUi::dateTimeFormat() return QDateTime::currentDateTime().toString(dateTimeFormat); } -void SAKToolBoxUi::output2ui(const QByteArray& bytes, const QString& flag, bool isRx) +void xToolsToolBoxUi::output2ui(const QByteArray& bytes, const QString& flag, bool isRx) { int format = ui->comboBoxOutputFormat->currentData().toInt(); QString str = SAKInterface::arrayToString(bytes, format); @@ -264,7 +264,7 @@ void SAKToolBoxUi::output2ui(const QByteArray& bytes, const QString& flag, bool ui->textBrowserOutput->append(info + " " + str); } -QString SAKToolBoxUi::settingsGroup() +QString xToolsToolBoxUi::settingsGroup() { if (m_communicationType == SAKToolFactory::SerialportTool) { return "SerialportToolBox"; @@ -288,7 +288,7 @@ QString SAKToolBoxUi::settingsGroup() } } -QByteArray SAKToolBoxUi::calculateCrc(const QByteArray& bytes, bool fixedOriginOrder) +QByteArray xToolsToolBoxUi::calculateCrc(const QByteArray& bytes, bool fixedOriginOrder) { auto ctx = m_inputMenu->parameters(); QByteArray inputBytes = bytes; @@ -310,7 +310,7 @@ QByteArray SAKToolBoxUi::calculateCrc(const QByteArray& bytes, bool fixedOriginO return crc; } -void SAKToolBoxUi::setDefaultText() +void xToolsToolBoxUi::setDefaultText() { QByteArray ba("(null)"); int format = ui->comboBoxInputFormat->currentData().toInt(); @@ -318,7 +318,7 @@ void SAKToolBoxUi::setDefaultText() ui->comboBoxInputText->setCurrentText(str); } -void SAKToolBoxUi::onIsWorkingChanged() +void xToolsToolBoxUi::onIsWorkingChanged() { bool isWorking = m_toolBox->isWorking(); ui->pushButtonInputSend->setEnabled(isWorking); @@ -336,7 +336,7 @@ void SAKToolBoxUi::onIsWorkingChanged() } } -void SAKToolBoxUi::onBytesWritten(const QByteArray& bytes, const QString& from) +void xToolsToolBoxUi::onBytesWritten(const QByteArray& bytes, const QString& from) { if (!ui->checkBoxOutputTx->isChecked()) { return; @@ -345,7 +345,7 @@ void SAKToolBoxUi::onBytesWritten(const QByteArray& bytes, const QString& from) output2ui(bytes, from, false); } -void SAKToolBoxUi::onBytesRead(const QByteArray& bytes, const QString& to) +void xToolsToolBoxUi::onBytesRead(const QByteArray& bytes, const QString& to) { if (!ui->checkBoxOutputRx->isChecked()) { return; @@ -354,7 +354,7 @@ void SAKToolBoxUi::onBytesRead(const QByteArray& bytes, const QString& to) output2ui(bytes, to, true); } -void SAKToolBoxUi::onInputTextChanged() +void xToolsToolBoxUi::onInputTextChanged() { QByteArray b = calculateCrc(QByteArray(), true); QString crc = QString::fromLatin1(b.toHex()); @@ -363,7 +363,7 @@ void SAKToolBoxUi::onInputTextChanged() ui->labelAlgorithm->setText(m_inputMenu->parameters().algorithmName); } -void SAKToolBoxUi::init() +void xToolsToolBoxUi::init() { m_settingsKey.tabIndex = settingsGroup() + "/tabIndex"; m_settingsKey.items = settingsGroup() + "/items"; @@ -379,7 +379,7 @@ void SAKToolBoxUi::init() onComboBoxInputFormatActivated(); } -void SAKToolBoxUi::initUi() +void xToolsToolBoxUi::initUi() { initUiCommunication(); initUiInput(); @@ -392,7 +392,7 @@ void SAKToolBoxUi::initUi() } } -void SAKToolBoxUi::initUiCommunication() +void xToolsToolBoxUi::initUiCommunication() { // Setup communication tool. m_communicationUi = communicationToolUi(m_communicationType); @@ -417,7 +417,7 @@ void SAKToolBoxUi::initUiCommunication() ui->widgetCommunicationToolUi->layout()->addWidget(m_communicationUi); } -void SAKToolBoxUi::initUiInput() +void xToolsToolBoxUi::initUiInput() { ui->comboBoxInputIntervel->addItem(tr("Disable"), -1); for (int i = 10; i <= 100; i += 10) { @@ -443,47 +443,47 @@ void SAKToolBoxUi::initUiInput() } } - m_inputMenu = new SAKToolBoxUiInputMenu(settingsGroup(), this); + m_inputMenu = new xToolsToolBoxUiInputMenu(settingsGroup(), this); connect(m_inputMenu, - &SAKToolBoxUiInputMenu::parametersChanged, + &xToolsToolBoxUiInputMenu::parametersChanged, this, - &SAKToolBoxUi::onInputTextChanged); + &xToolsToolBoxUi::onInputTextChanged); ui->pushButtonInputSettings->setMenu(m_inputMenu); } -void SAKToolBoxUi::initUiOutput() +void xToolsToolBoxUi::initUiOutput() { ui->checkBoxOutputRx->setChecked(true); ui->checkBoxOutputTx->setChecked(true); ui->textBrowserOutput->document()->setMaximumBlockCount(2000); - m_outputMenu = new SAKToolBoxUiOutputMenu(settingsGroup(), + m_outputMenu = new xToolsToolBoxUiOutputMenu(settingsGroup(), ui->textBrowserOutput->document(), this); ui->pushButtonOutputSettings->setMenu(m_outputMenu); } -void SAKToolBoxUi::initSettings() +void xToolsToolBoxUi::initSettings() { initSettingsCommunication(); initSettingsInput(); initSettingsOutput(); } -void SAKToolBoxUi::initSettingsCommunication() +void xToolsToolBoxUi::initSettingsCommunication() { const QString key = settingsGroup() + "/communication"; m_communicationUi->initialize(m_communication, key); } -void SAKToolBoxUi::initSettingsInput() +void xToolsToolBoxUi::initSettingsInput() { QString group = settingsGroup(); ui->comboBoxInputFormat->setGroupKey(group + "/input", "fromat"); ui->comboBoxInputText->setGroupKey(group + "/input", "text", false); } -void SAKToolBoxUi::initSettingsOutput() +void xToolsToolBoxUi::initSettingsOutput() { QString group = settingsGroup(); ui->comboBoxOutputFormat->setGroupKey(group + "/output", "outputFormat"); @@ -501,7 +501,7 @@ void SAKToolBoxUi::initSettingsOutput() #endif } -void SAKToolBoxUi::initSignals() +void xToolsToolBoxUi::initSignals() { initSignalsCommunication(); initSignalsInput(); @@ -510,52 +510,52 @@ void SAKToolBoxUi::initSignals() connect(ui->tabWidget, &QTabWidget::currentChanged, this, - &SAKToolBoxUi::onTabWidgetCurrentChanged); + &xToolsToolBoxUi::onTabWidgetCurrentChanged); } -void SAKToolBoxUi::initSignalsCommunication() +void xToolsToolBoxUi::initSignalsCommunication() { connect(ui->pushButtonCommunicationOpen, &QPushButton::clicked, this, - &SAKToolBoxUi::onPushButtonCommunicationOpenClicked); + &xToolsToolBoxUi::onPushButtonCommunicationOpenClicked); } -void SAKToolBoxUi::initSignalsInput() +void xToolsToolBoxUi::initSignalsInput() { connect(ui->comboBoxInputIntervel, static_cast(&QComboBox::activated), this, - &SAKToolBoxUi::onComboBoxInputIntervalActivated); + &xToolsToolBoxUi::onComboBoxInputIntervalActivated); connect(ui->pushButtonInputSend, &QPushButton::clicked, this, - &SAKToolBoxUi::onPushButtonInputSendClicked); + &xToolsToolBoxUi::onPushButtonInputSendClicked); connect(ui->comboBoxInputFormat, static_cast(&QComboBox::activated), this, - &SAKToolBoxUi::onComboBoxInputFormatActivated); + &xToolsToolBoxUi::onComboBoxInputFormatActivated); connect(ui->comboBoxInputText, static_cast(&QComboBox::activated), this, - &SAKToolBoxUi::onComboBoxInputTextActivated); + &xToolsToolBoxUi::onComboBoxInputTextActivated); connect(ui->comboBoxInputText, &QComboBox::currentTextChanged, this, - &SAKToolBoxUi::onInputTextChanged); + &xToolsToolBoxUi::onInputTextChanged); } -void SAKToolBoxUi::initSignalsOutput() +void xToolsToolBoxUi::initSignalsOutput() { connect(ui->checkBoxOutputWrap, &QCheckBox::clicked, this, - &SAKToolBoxUi::onCheckBoxOutputWrapClicked); + &xToolsToolBoxUi::onCheckBoxOutputWrapClicked); } -void SAKToolBoxUi::initTools() +void xToolsToolBoxUi::initTools() { - m_communicationMenu = new SAKToolBoxUiCommunicationMenu(this); + m_communicationMenu = new xToolsToolBoxUiCommunicationMenu(this); m_communicationMenu->initialize(m_toolBox, settingsGroup()); ui->pushButtonCommunicationSettings->setMenu(m_communicationMenu); @@ -622,21 +622,21 @@ void SAKToolBoxUi::initTools() SAKSettings::instance()->setValue(key, index); }); - connect(m_toolBox, &SAKToolBox::isWorkingChanged, this, &SAKToolBoxUi::onIsWorkingChanged); - connect(m_toolBox, &SAKToolBox::errorOccurred, this, [=](const QString& err) { + connect(m_toolBox, &xToolsToolBox::isWorkingChanged, this, &xToolsToolBoxUi::onIsWorkingChanged); + connect(m_toolBox, &xToolsToolBox::errorOccurred, this, [=](const QString& err) { QMessageBox::warning(this, tr("Error Occured"), err); }); connect(m_communication, &SAKCommunicationTool::bytesWritten, this, - &SAKToolBoxUi::onBytesWritten); - connect(m_communication, &SAKCommunicationTool::bytesRead, this, &SAKToolBoxUi::onBytesRead); + &xToolsToolBoxUi::onBytesWritten); + connect(m_communication, &SAKCommunicationTool::bytesRead, this, &xToolsToolBoxUi::onBytesRead); ui->pushButtonPrestorer->setMenu(m_prestorerUi->menu()); } -void SAKToolBoxUi::onTabWidgetCurrentChanged(int index) +void xToolsToolBoxUi::onTabWidgetCurrentChanged(int index) { if (m_settingsKey.tabIndex.isEmpty()) { return; @@ -645,7 +645,7 @@ void SAKToolBoxUi::onTabWidgetCurrentChanged(int index) SAKSettings::instance()->setValue(m_settingsKey.tabIndex, index); } -void SAKToolBoxUi::onPushButtonCommunicationOpenClicked() +void xToolsToolBoxUi::onPushButtonCommunicationOpenClicked() { ui->pushButtonCommunicationOpen->setEnabled(false); if (m_toolBox->isWorking()) { @@ -655,7 +655,7 @@ void SAKToolBoxUi::onPushButtonCommunicationOpenClicked() } } -void SAKToolBoxUi::onCheckBoxOutputWrapClicked() +void xToolsToolBoxUi::onCheckBoxOutputWrapClicked() { if (ui->checkBoxOutputWrap->isChecked()) { ui->textBrowserOutput->setWordWrapMode(QTextOption::WrapAnywhere); @@ -664,7 +664,7 @@ void SAKToolBoxUi::onCheckBoxOutputWrapClicked() } } -void SAKToolBoxUi::onPushButtonInputSendClicked() +void xToolsToolBoxUi::onPushButtonInputSendClicked() { if (ui->comboBoxInputText->currentText().isEmpty()) { qInfo() << "input text is empty," @@ -713,7 +713,7 @@ void SAKToolBoxUi::onPushButtonInputSendClicked() try2send(); } -void SAKToolBoxUi::onComboBoxInputIntervalActivated() +void xToolsToolBoxUi::onComboBoxInputIntervalActivated() { int interval = ui->comboBoxInputIntervel->currentText().toInt(); interval = interval < 10 ? 10 : interval; @@ -726,7 +726,7 @@ void SAKToolBoxUi::onComboBoxInputIntervalActivated() } } -void SAKToolBoxUi::onComboBoxInputFormatActivated() +void xToolsToolBoxUi::onComboBoxInputFormatActivated() { int format = ui->comboBoxInputFormat->currentData().toInt(); auto lineEdit = ui->comboBoxInputText->lineEdit(); @@ -734,7 +734,7 @@ void SAKToolBoxUi::onComboBoxInputFormatActivated() SAKUiInterface::setValidator(lineEdit, format); } -void SAKToolBoxUi::onComboBoxInputTextActivated() +void xToolsToolBoxUi::onComboBoxInputTextActivated() { int format = ui->comboBoxInputText->currentData().toInt(); ui->comboBoxInputFormat->setCurrentIndexFromData(format); diff --git a/Source/ToolBox/ToolBoxUI/xToolsToolBoxUi.h b/Source/ToolBox/ToolBoxUI/xToolsToolBoxUi.h index 99336f2d..72efd455 100644 --- a/Source/ToolBox/ToolBoxUI/xToolsToolBoxUi.h +++ b/Source/ToolBox/ToolBoxUI/xToolsToolBoxUi.h @@ -6,8 +6,7 @@ * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * code directory. **************************************************************************************************/ -#ifndef SAKTOOLBOXUI_H -#define SAKTOOLBOXUI_H +#pragma once #include #include @@ -16,30 +15,30 @@ #include #include "sakcommunicationtoolui.h" -#include "saktoolbox.h" +#include "xToolsToolBox.h" namespace Ui { -class SAKToolBoxUi; +class xToolsToolBoxUi; } class SAKEmitterToolUi; class SAKResponserToolUi; class SAKPrestorerToolUi; class SAKCommunicationTool; -class SAKToolBoxUiInputMenu; -class SAKToolBoxUiOutputMenu; +class xToolsToolBoxUiInputMenu; +class xToolsToolBoxUiOutputMenu; class SAKCommunicationToolUi; class SAKTcpTransmitterToolUi; class SAKUdpTransmitterToolUi; -class SAKToolBoxUiCommunicationMenu; +class xToolsToolBoxUiCommunicationMenu; class SAKWebSocketTransmitterToolUi; class SAKSerialPortTransmitterToolUi; -class SAKToolBoxUi : public QWidget +class xToolsToolBoxUi : public QWidget { Q_OBJECT public: - explicit SAKToolBoxUi(QWidget *parent = nullptr); - ~SAKToolBoxUi() override; + explicit xToolsToolBoxUi(QWidget *parent = nullptr); + ~xToolsToolBoxUi() override; static QList supportedCommunicationTools(); static QString communicationToolName(int type); @@ -48,7 +47,7 @@ public: void initialize(int type); private: - SAKToolBox *m_toolBox{nullptr}; + xToolsToolBox *m_toolBox{nullptr}; SAKCommunicationTool *m_communication{nullptr}; SAKCommunicationToolUi *m_communicationUi{nullptr}; SAKEmitterToolUi *m_emitterUi{nullptr}; @@ -60,9 +59,9 @@ private: SAKSerialPortTransmitterToolUi *m_serialPortTransmitterUi{nullptr}; QTimer *m_cycleSendingTimer{nullptr}; int m_communicationType; - SAKToolBoxUiCommunicationMenu *m_communicationMenu{nullptr}; - SAKToolBoxUiInputMenu *m_inputMenu{nullptr}; - SAKToolBoxUiOutputMenu *m_outputMenu{nullptr}; + xToolsToolBoxUiCommunicationMenu *m_communicationMenu{nullptr}; + xToolsToolBoxUiInputMenu *m_inputMenu{nullptr}; + xToolsToolBoxUiOutputMenu *m_outputMenu{nullptr}; struct { @@ -107,7 +106,7 @@ private: void initTools(); private: - Ui::SAKToolBoxUi *ui; + Ui::xToolsToolBoxUi *ui; void onTabWidgetCurrentChanged(int index); // communication @@ -122,5 +121,3 @@ private: // output void onCheckBoxOutputWrapClicked(); }; - -#endif // SAKTOOLBOXUI_H diff --git a/Source/ToolBox/ToolBoxUI/xToolsToolBoxUi.ui b/Source/ToolBox/ToolBoxUI/xToolsToolBoxUi.ui index a399ad04..68954b4a 100644 --- a/Source/ToolBox/ToolBoxUI/xToolsToolBoxUi.ui +++ b/Source/ToolBox/ToolBoxUI/xToolsToolBoxUi.ui @@ -1,7 +1,7 @@ - SAKToolBoxUi - + xToolsToolBoxUi + 0 diff --git a/Source/ToolBox/ToolBoxUI/xToolsToolBoxUiCommunicationMenu.cpp b/Source/ToolBox/ToolBoxUI/xToolsToolBoxUiCommunicationMenu.cpp index 6af09285..616a6de5 100644 --- a/Source/ToolBox/ToolBoxUI/xToolsToolBoxUiCommunicationMenu.cpp +++ b/Source/ToolBox/ToolBoxUI/xToolsToolBoxUiCommunicationMenu.cpp @@ -6,16 +6,16 @@ * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * code directory. **************************************************************************************************/ -#include "saktoolboxuicommunicationmenu.h" +#include "xToolsToolBoxUiCommunicationMenu.h" +#include "ui_xToolsToolBoxUiCommunicationMenu.h" #include -#include "saktoolbox.h" -#include "ui_saktoolboxuicommunicationmenu.h" +#include "xToolsToolBox.h" -SAKToolBoxUiCommunicationMenu::SAKToolBoxUiCommunicationMenu(QWidget* parent) +xToolsToolBoxUiCommunicationMenu::xToolsToolBoxUiCommunicationMenu(QWidget* parent) : QMenu(parent) - , ui(new Ui::SAKToolBoxUiCommunicationMenu) + , ui(new Ui::xToolsToolBoxUiCommunicationMenu) { QWidget* w = new QWidget(this); ui->setupUi(w); @@ -24,12 +24,12 @@ SAKToolBoxUiCommunicationMenu::SAKToolBoxUiCommunicationMenu(QWidget* parent) addAction(action); } -SAKToolBoxUiCommunicationMenu::~SAKToolBoxUiCommunicationMenu() +xToolsToolBoxUiCommunicationMenu::~xToolsToolBoxUiCommunicationMenu() { delete ui; } -void SAKToolBoxUiCommunicationMenu::initialize(SAKToolBox* toolBox, const QString& settingsGroup) +void xToolsToolBoxUiCommunicationMenu::initialize(xToolsToolBox* toolBox, const QString& settingsGroup) { auto storer = toolBox->getStorerTool(); auto storerGroup = settingsGroup + "/storer"; diff --git a/Source/ToolBox/ToolBoxUI/xToolsToolBoxUiCommunicationMenu.h b/Source/ToolBox/ToolBoxUI/xToolsToolBoxUiCommunicationMenu.h index f225d800..d3297edb 100644 --- a/Source/ToolBox/ToolBoxUI/xToolsToolBoxUiCommunicationMenu.h +++ b/Source/ToolBox/ToolBoxUI/xToolsToolBoxUiCommunicationMenu.h @@ -6,33 +6,30 @@ * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * code directory. **************************************************************************************************/ -#ifndef SAKTOOLBOXUICOMMUNICATIONMENU_H -#define SAKTOOLBOXUICOMMUNICATIONMENU_H +#pragma once #include #include #include namespace Ui { -class SAKToolBoxUiCommunicationMenu; +class xToolsToolBoxUiCommunicationMenu; } -class SAKToolBox; +class xToolsToolBox; class SAKHighlighter; -class SAKToolBoxUiCommunicationMenu : public QMenu +class xToolsToolBoxUiCommunicationMenu : public QMenu { Q_OBJECT public: - SAKToolBoxUiCommunicationMenu(QWidget *parent = nullptr); - ~SAKToolBoxUiCommunicationMenu(); + xToolsToolBoxUiCommunicationMenu(QWidget *parent = nullptr); + ~xToolsToolBoxUiCommunicationMenu(); - void initialize(SAKToolBox *toolBox, const QString &settingsGroup); + void initialize(xToolsToolBox *toolBox, const QString &settingsGroup); private: const QLoggingCategory mLoggingCategory{"SAK.CustomBoxUiParameters"}; private: - Ui::SAKToolBoxUiCommunicationMenu *ui; + Ui::xToolsToolBoxUiCommunicationMenu *ui; }; - -#endif // SAKTOOLBOXUICOMMUNICATIONMENU_H diff --git a/Source/ToolBox/ToolBoxUI/xToolsToolBoxUiCommunicationMenu.ui b/Source/ToolBox/ToolBoxUI/xToolsToolBoxUiCommunicationMenu.ui index 696933ef..ec097fc0 100644 --- a/Source/ToolBox/ToolBoxUI/xToolsToolBoxUiCommunicationMenu.ui +++ b/Source/ToolBox/ToolBoxUI/xToolsToolBoxUiCommunicationMenu.ui @@ -1,7 +1,7 @@ - SAKToolBoxUiCommunicationMenu - + xToolsToolBoxUiCommunicationMenu + 0 diff --git a/Source/ToolBox/ToolBoxUI/xToolsToolBoxUiFactory.cpp b/Source/ToolBox/ToolBoxUI/xToolsToolBoxUiFactory.cpp index 150227b3..b3b80f18 100644 --- a/Source/ToolBox/ToolBoxUI/xToolsToolBoxUiFactory.cpp +++ b/Source/ToolBox/ToolBoxUI/xToolsToolBoxUiFactory.cpp @@ -1,12 +1,12 @@ /*************************************************************************************************** - * Copyright 2023 x-tools-author(x-tools@outlook.com). All rights reserved. + * Copyright 2023-2024 x-tools-author(x-tools@outlook.com). All rights reserved. * * The file is encoded using "utf8 with bom", it is a part of xTools project. * * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * code directory. **************************************************************************************************/ -#include "saktoolboxuifactory.h" +#include "xToolsToolBoxUiFactory.h" #include "saktoolfactory.h" #if 0 @@ -21,17 +21,17 @@ #include "SAKWebSocketServerToolBoxUi.h" #endif -SAKToolBoxUiFactory::SAKToolBoxUiFactory(QObject* parent) +xToolsToolBoxUiFactory::xToolsToolBoxUiFactory(QObject* parent) : QObject{parent} {} -SAKToolBoxUiFactory* SAKToolBoxUiFactory::instance() +xToolsToolBoxUiFactory* xToolsToolBoxUiFactory::instance() { - static SAKToolBoxUiFactory factory; + static xToolsToolBoxUiFactory factory; return &factory; } -QList SAKToolBoxUiFactory::supportedTools() +QList xToolsToolBoxUiFactory::supportedTools() { QList list; list << SAKToolFactory::SerialportTool << SAKToolFactory::UdpClientTool @@ -42,7 +42,7 @@ QList SAKToolBoxUiFactory::supportedTools() return list; } -SAKToolBoxUi* SAKToolBoxUiFactory::createToolBoxUi(int type) +xToolsToolBoxUi* xToolsToolBoxUiFactory::createToolBoxUi(int type) { #if 0 if (type == SAKToolFactory::SerialportTool) { diff --git a/Source/ToolBox/ToolBoxUI/xToolsToolBoxUiFactory.h b/Source/ToolBox/ToolBoxUI/xToolsToolBoxUiFactory.h index a5bb3d7e..d10e5865 100644 --- a/Source/ToolBox/ToolBoxUI/xToolsToolBoxUiFactory.h +++ b/Source/ToolBox/ToolBoxUI/xToolsToolBoxUiFactory.h @@ -1,29 +1,26 @@ /*************************************************************************************************** - * Copyright 2023 x-tools-author(x-tools@outlook.com). All rights reserved. + * Copyright 2023-2024 x-tools-author(x-tools@outlook.com). All rights reserved. * * The file is encoded using "utf8 with bom", it is a part of xTools project. * * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * code directory. **************************************************************************************************/ -#ifndef SAKTOOLBOXUIFACTORY_H -#define SAKTOOLBOXUIFACTORY_H +#pragma once #include -class SAKToolBoxUi; -class SAKToolBoxUiFactory : public QObject +class xToolsToolBoxUi; +class xToolsToolBoxUiFactory : public QObject { Q_OBJECT private: - explicit SAKToolBoxUiFactory(QObject *parent = nullptr); + explicit xToolsToolBoxUiFactory(QObject *parent = nullptr); public: - static SAKToolBoxUiFactory *instance(); + static xToolsToolBoxUiFactory *instance(); QList supportedTools(); - SAKToolBoxUi *createToolBoxUi(int type); + xToolsToolBoxUi *createToolBoxUi(int type); private: }; - -#endif // SAKTOOLBOXUIFACTORY_H diff --git a/Source/ToolBox/ToolBoxUI/xToolsToolBoxUiInputMenu.cpp b/Source/ToolBox/ToolBoxUI/xToolsToolBoxUiInputMenu.cpp index 072a0dca..73273441 100644 --- a/Source/ToolBox/ToolBoxUI/xToolsToolBoxUiInputMenu.cpp +++ b/Source/ToolBox/ToolBoxUI/xToolsToolBoxUiInputMenu.cpp @@ -6,17 +6,16 @@ * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * code directory. **************************************************************************************************/ -#include "saktoolboxuiinputmenu.h" +#include "xToolsToolBoxUiInputMenu.h" +#include "ui_xToolsToolBoxUiInputMenu.h" #include -#include "ui_saktoolboxuiinputmenu.h" - #define SAK_CB_ACTIVATED static_cast(&QComboBox::activated) -SAKToolBoxUiInputMenu::SAKToolBoxUiInputMenu(const QString& settingsGroup, QWidget* parent) +xToolsToolBoxUiInputMenu::xToolsToolBoxUiInputMenu(const QString& settingsGroup, QWidget* parent) : QMenu{parent} - , ui(new Ui::SAKToolBoxUiInputMenu) + , ui(new Ui::xToolsToolBoxUiInputMenu) { QWidget* w = new QWidget(this); ui->setupUi(w); @@ -88,12 +87,12 @@ SAKToolBoxUiInputMenu::SAKToolBoxUiInputMenu(const QString& settingsGroup, QWidg }); } -SAKToolBoxUiInputMenu::~SAKToolBoxUiInputMenu() +xToolsToolBoxUiInputMenu::~xToolsToolBoxUiInputMenu() { delete ui; } -SAKToolBoxUiInputMenu::Parameters SAKToolBoxUiInputMenu::parameters() +xToolsToolBoxUiInputMenu::Parameters xToolsToolBoxUiInputMenu::parameters() { return mParameters; } diff --git a/Source/ToolBox/ToolBoxUI/xToolsToolBoxUiInputMenu.h b/Source/ToolBox/ToolBoxUI/xToolsToolBoxUiInputMenu.h index e7778ef6..63f565f0 100644 --- a/Source/ToolBox/ToolBoxUI/xToolsToolBoxUiInputMenu.h +++ b/Source/ToolBox/ToolBoxUI/xToolsToolBoxUiInputMenu.h @@ -6,21 +6,20 @@ * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * code directory. **************************************************************************************************/ -#ifndef SAKTOOLBOXUIINPUTMENU_H -#define SAKTOOLBOXUIINPUTMENU_H +#pragma once #include namespace Ui { -class SAKToolBoxUiInputMenu; +class xToolsToolBoxUiInputMenu; } -class SAKToolBoxUiInputMenu : public QMenu +class xToolsToolBoxUiInputMenu : public QMenu { Q_OBJECT public: - explicit SAKToolBoxUiInputMenu(const QString &settingsGroup, QWidget *parent = nullptr); - ~SAKToolBoxUiInputMenu(); + explicit xToolsToolBoxUiInputMenu(const QString &settingsGroup, QWidget *parent = nullptr); + ~xToolsToolBoxUiInputMenu(); struct Parameters { @@ -46,7 +45,5 @@ private: Parameters mParameters; private: - Ui::SAKToolBoxUiInputMenu *ui; + Ui::xToolsToolBoxUiInputMenu *ui; }; - -#endif // SAKTOOLBOXUIINPUTMENU_H diff --git a/Source/ToolBox/ToolBoxUI/xToolsToolBoxUiInputMenu.ui b/Source/ToolBox/ToolBoxUI/xToolsToolBoxUiInputMenu.ui index c641a051..f196bacf 100644 --- a/Source/ToolBox/ToolBoxUI/xToolsToolBoxUiInputMenu.ui +++ b/Source/ToolBox/ToolBoxUI/xToolsToolBoxUiInputMenu.ui @@ -1,12 +1,12 @@ - SAKToolBoxUiInputMenu - + xToolsToolBoxUiInputMenu + 0 0 - 232 + 244 240 diff --git a/Source/ToolBox/ToolBoxUI/xToolsToolBoxUiOutputMenu.cpp b/Source/ToolBox/ToolBoxUI/xToolsToolBoxUiOutputMenu.cpp index b6c93b25..06239fde 100644 --- a/Source/ToolBox/ToolBoxUI/xToolsToolBoxUiOutputMenu.cpp +++ b/Source/ToolBox/ToolBoxUI/xToolsToolBoxUiOutputMenu.cpp @@ -6,19 +6,20 @@ * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * code directory. **************************************************************************************************/ -#include "saktoolboxuioutputmenu.h" +#include "xToolsToolBoxUiOutputMenu.h" +#include "ui_xToolsToolBoxUiOutputMenu.h" #include #include "sakhighlighter.h" #include "saksettings.h" -#include "ui_saktoolboxuioutputmenu.h" -SAKToolBoxUiOutputMenu::SAKToolBoxUiOutputMenu(const QString& settingsGroup, + +xToolsToolBoxUiOutputMenu::xToolsToolBoxUiOutputMenu(const QString& settingsGroup, QTextDocument* doc, QWidget* parent) : QMenu(parent) - , ui(new Ui::SAKToolBoxUiOutputMenu) + , ui(new Ui::xToolsToolBoxUiOutputMenu) { QWidget* w = new QWidget(this); ui->setupUi(w); @@ -62,12 +63,12 @@ SAKToolBoxUiOutputMenu::SAKToolBoxUiOutputMenu(const QString& settingsGroup, }); } -SAKToolBoxUiOutputMenu::~SAKToolBoxUiOutputMenu() +xToolsToolBoxUiOutputMenu::~xToolsToolBoxUiOutputMenu() { delete ui; } -QString SAKToolBoxUiOutputMenu::filter() +QString xToolsToolBoxUiOutputMenu::filter() { return ui->filter->text().trimmed(); } diff --git a/Source/ToolBox/ToolBoxUI/xToolsToolBoxUiOutputMenu.h b/Source/ToolBox/ToolBoxUI/xToolsToolBoxUiOutputMenu.h index fbc93454..0a0c1d9e 100644 --- a/Source/ToolBox/ToolBoxUI/xToolsToolBoxUiOutputMenu.h +++ b/Source/ToolBox/ToolBoxUI/xToolsToolBoxUiOutputMenu.h @@ -6,30 +6,27 @@ * xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source * code directory. **************************************************************************************************/ -#ifndef SAKTOOLBOXUIOUTPUTMENU_H -#define SAKTOOLBOXUIOUTPUTMENU_H +#pragma once #include #include #include namespace Ui { -class SAKToolBoxUiOutputMenu; +class xToolsToolBoxUiOutputMenu; } -class SAKToolBoxUiOutputMenu : public QMenu +class xToolsToolBoxUiOutputMenu : public QMenu { Q_OBJECT public: - explicit SAKToolBoxUiOutputMenu(const QString &settingsGroup, + explicit xToolsToolBoxUiOutputMenu(const QString &settingsGroup, QTextDocument *doc, QWidget *parent = nullptr); - ~SAKToolBoxUiOutputMenu(); + ~xToolsToolBoxUiOutputMenu(); QString filter(); private: - Ui::SAKToolBoxUiOutputMenu *ui; + Ui::xToolsToolBoxUiOutputMenu *ui; }; - -#endif // SAKTOOLBOXUIOUTPUTMENU_H diff --git a/Source/ToolBox/ToolBoxUI/xToolsToolBoxUiOutputMenu.ui b/Source/ToolBox/ToolBoxUI/xToolsToolBoxUiOutputMenu.ui index a21c0af0..649d9592 100644 --- a/Source/ToolBox/ToolBoxUI/xToolsToolBoxUiOutputMenu.ui +++ b/Source/ToolBox/ToolBoxUI/xToolsToolBoxUiOutputMenu.ui @@ -1,12 +1,12 @@ - SAKToolBoxUiOutputMenu - + xToolsToolBoxUiOutputMenu + 0 0 - 224 + 236 114 diff --git a/Source/main.cpp b/Source/main.cpp index bb98779b..1e78f7f9 100644 --- a/Source/main.cpp +++ b/Source/main.cpp @@ -7,7 +7,7 @@ * code directory. **************************************************************************************************/ #include "sak.h" -#include "application.h" +#include "Application.h" int main(const int argc, char *argv[]) {