chore: update files of project

This commit is contained in:
x-tools-author 2024-03-20 20:01:09 +08:00
parent a01e2478e3
commit 76a877f1a7
39 changed files with 247 additions and 217 deletions

View File

@ -13,12 +13,17 @@ set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
option(X_TOOLS_BUILD_FOR_STORE "Build for Microsoft Store or Apple Store" OFF)
if(X_TOOLS_BUILD_FOR_STORE)
add_compile_definitions(X_TOOLS_BUILD_FOR_STORE)
endif()
set(X_TOOLS_QT_COMPONENTS Core Gui Widgets WebSockets Network)
if(NOT CMAKE_SYSTEM_NAME STREQUAL "iOS")
list(APPEND X_TOOLS_QT_COMPONENTS SerialPort)
list(APPEND X_TOOLS_QT_COMPONENTS SerialBus)
add_compile_definitions(X_TOOLS_IMPORT_MODULE_SERIALPORT)
# add_compile_definitions(X_TOOLS_IMPORT_MODULE_SERIALPORT)
add_compile_definitions(X_TOOLS_IMPORT_MODULE_SERIALBUS)
endif()
@ -50,8 +55,6 @@ file(GLOB X_TOOLS_ASSISTANT_SOURCE_H "${CMAKE_SOURCE_DIR}/Source/Assistants/*/So
file(GLOB X_TOOLS_ASSISTANT_SOURCE_UI "${CMAKE_SOURCE_DIR}/Source/Assistants/*/Source/*.ui")
file(GLOB X_TOOLS_ASSISTANT_SOURCE_CPP "${CMAKE_SOURCE_DIR}/Source/Assistants/*/Source/*.cpp")
file(GLOB X_TOOLS_CMAKE_FILES "${CMAKE_SOURCE_DIR}/CMake/*.cmake")
list(APPEND X_TOOLS_SOURCE ${X_TOOLS_COMMOM_SOURCE_H})
list(APPEND X_TOOLS_SOURCE ${X_TOOLS_COMMOM_SOURCE_UI})
list(APPEND X_TOOLS_SOURCE ${X_TOOLS_COMMOM_SOURCE_CPP})
@ -93,6 +96,47 @@ include_directories(${CMAKE_SOURCE_DIR}/Source/Assistants/String/Source)
include_directories(${CMAKE_SOURCE_DIR}/Source/Assistants/Broadcast/Source)
include_directories(${CMAKE_SOURCE_DIR}/Source/Assistants/FileCheck/Source)
option(X_TOOLS_IMPORT_MODULE_MODBUS_STUDIO "Enable Modbus Studio module" ON)
if(X_TOOLS_IMPORT_MODULE_MODBUS_STUDIO)
file(GLOB_RECURSE X_TOOLS_MODBUS_STUDIO_H "${CMAKE_SOURCE_DIR}/Source/ModbusStudio/*.h")
file(GLOB_RECURSE X_TOOLS_MODBUS_STUDIO_UI "${CMAKE_SOURCE_DIR}/Source/ModbusStudio/*.ui")
file(GLOB_RECURSE X_TOOLS_MODBUS_STUDIO_CPP "${CMAKE_SOURCE_DIR}/Source/ModbusStudio/*.cc")
add_compile_definitions(X_TOOLS_IMPORT_MODULE_MODBUS_STUDIO)
list(APPEND X_TOOLS_SOURCE ${X_TOOLS_MODBUS_STUDIO_H})
list(APPEND X_TOOLS_SOURCE ${X_TOOLS_MODBUS_STUDIO_UI})
list(APPEND X_TOOLS_SOURCE ${X_TOOLS_MODBUS_STUDIO_CPP})
list(REMOVE_ITEM X_TOOLS_SOURCE ${CMAKE_SOURCE_DIR}/Source/ModbusStudio/main.cc)
include_directories(${CMAKE_SOURCE_DIR}/Source/ModbusStudio/modbusstudio)
include_directories(${CMAKE_SOURCE_DIR}/Source/ModbusStudio/modbusstudioui)
endif()
option(X_TOOLS_IMPORT_MODULE_CANBUS_STUDIO "Enable CAN Bus module" ON)
if(X_TOOLS_IMPORT_MODULE_CANBUS_STUDIO)
file(GLOB_RECURSE X_TOOLS_CANBUS_STUDIO_H "${CMAKE_SOURCE_DIR}/Source/CANBusStudio/*.h")
file(GLOB_RECURSE X_TOOLS_CANBUS_STUDIO_UI "${CMAKE_SOURCE_DIR}/Source/CANBusStudio/*.ui")
file(GLOB_RECURSE X_TOOLS_CANBUS_STUDIO_CPP "${CMAKE_SOURCE_DIR}/Source/CANBusStudio/*.cc")
add_compile_definitions(X_TOOLS_IMPORT_MODULE_CANBUS_STUDIO)
list(APPEND X_TOOLS_SOURCE ${X_TOOLS_CANBUS_STUDIO_H})
list(APPEND X_TOOLS_SOURCE ${X_TOOLS_CANBUS_STUDIO_UI})
list(APPEND X_TOOLS_SOURCE ${X_TOOLS_CANBUS_STUDIO_CPP})
list(REMOVE_ITEM X_TOOLS_SOURCE ${CMAKE_SOURCE_DIR}/Source/CANBusStudio/main.cc)
include_directories(${CMAKE_SOURCE_DIR}/Source/CANBusStudio/canbusstudio)
include_directories(${CMAKE_SOURCE_DIR}/Source/CANBusStudio/canbusstudioui)
endif()
option(X_TOOLS_IMPORT_MODULE_BLUETOOTH "Enable Bluetooth modbule" ON)
if(X_TOOLS_IMPORT_MODULE_BLUETOOTH)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Bluetooth)
file(GLOB X_TOOLS_BLUETOOTH_H "${CMAKE_SOURCE_DIR}/Source/Optional/bluetooth/*.h")
file(GLOB X_TOOLS_BLUETOOTH_UI "${CMAKE_SOURCE_DIR}/Source/Optional/bluetooth/*.ui")
file(GLOB X_TOOLS_BLUETOOTH_CPP "${CMAKE_SOURCE_DIR}/Source/Optional/bluetooth/*.cc")
add_compile_definitions(X_TOOLS_IMPORT_MODULE_BLUETOOTH)
list(APPEND X_TOOLS_SOURCE ${X_TOOLS_BLUETOOTH_H})
list(APPEND X_TOOLS_SOURCE ${X_TOOLS_BLUETOOTH_UI})
list(APPEND X_TOOLS_SOURCE ${X_TOOLS_BLUETOOTH_CPP})
include_directories(${CMAKE_SOURCE_DIR}/Source/Optional/bluetooth)
endif()
set(WITH_GFLAGS OFF)
set(BUILD_TESTING OFF)
set(BUILD_SHARED_LIBS OFF)
@ -114,7 +158,12 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL "iOS")
endif()
target_link_libraries(xTools PRIVATE qmdnsengine)
target_link_libraries(xTools PRIVATE glog::glog)
if(X_TOOLS_IMPORT_MODULE_BLUETOOTH)
target_link_libraries(xTools PRIVATE Qt${QT_VERSION_MAJOR}::Bluetooth)
endif()
# -------------------------------------------------------------------------------------------------
# Assistants
add_subdirectory(${CMAKE_SOURCE_DIR}/Source/Assistants)
add_subdirectory(${CMAKE_SOURCE_DIR}/Source/ModbusStudio)
add_subdirectory(${CMAKE_SOURCE_DIR}/Source/CANBusStudio)

View File

@ -1,9 +1,9 @@
/***************************************************************************************************
* Copyright 2023-2024 Qsaker(qsaker@foxmail.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 QtSwissArmyKnife project.
* The file is encoded using "utf8 with bom", it is a part of xTools project.
*
* QtSwissArmyKnife is licensed according to the terms in the file LICENCE in the root of the source
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory.
**************************************************************************************************/
#include "xToolsAsciiAssistant.h"

View File

@ -1,9 +1,9 @@
/***************************************************************************************************
* Copyright 2023-2024 Qsaker(qsaker@foxmail.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 QtSwissArmyKnife project.
* The file is encoded using "utf8 with bom", it is a part of xTools project.
*
* QtSwissArmyKnife is licensed according to the terms in the file LICENCE in the root of the source
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory.
**************************************************************************************************/
#include "xToolsBase64Assisatnt.h"

View File

@ -1,9 +1,9 @@
/***************************************************************************************************
* Copyright 2023-2024 Qsaker(qsaker@foxmail.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 QtSwissArmyKnife project.
* The file is encoded using "utf8 with bom", it is a part of xTools project.
*
* QtSwissArmyKnife is licensed according to the terms in the file LICENCE in the root of the source
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory.
**************************************************************************************************/
#include "xToolsBroadcastAssistant.h"

View File

@ -1,9 +1,9 @@
/***************************************************************************************************
* Copyright 2023-2024 Qsaker(qsaker@foxmail.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 QtSwissArmyKnife project.
* The file is encoded using "utf8 with bom", it is a part of xTools project.
*
* QtSwissArmyKnife is licensed according to the terms in the file LICENCE in the root of the source
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory.
**************************************************************************************************/
#include "xToolsCRCAssistant.h"

View File

@ -1,9 +1,9 @@
/***************************************************************************************************
* Copyright 2023-2024 Qsaker(qsaker@foxmail.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 QtSwissArmyKnife project.
* The file is encoded using "utf8 with bom", it is a part of xTools project.
*
* QtSwissArmyKnife is licensed according to the terms in the file LICENCE in the root of the source
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory.
**************************************************************************************************/
#include "xToolsFileCheckAssistant.h"

View File

@ -1,9 +1,9 @@
/***************************************************************************************************
* Copyright 2023-2024 Qsaker(qsaker@foxmail.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 QtSwissArmyKnife project.
* The file is encoded using "utf8 with bom", it is a part of xTools project.
*
* QtSwissArmyKnife is licensed according to the terms in the file LICENCE in the root of the source
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory.
**************************************************************************************************/
#include "xToolsNumberAssistant.h"

View File

@ -1,9 +1,9 @@
/***************************************************************************************************
* Copyright 2024 Qsaker(qsaker@foxmail.com). All rights reserved.
* Copyright 2024 x-tools-author(x-tools@outlook.com). All rights reserved.
*
* The file is encoded using "utf8 with bom", it is a part of QtSwissArmyKnife project.
* The file is encoded using "utf8 with bom", it is a part of xTools project.
*
* QtSwissArmyKnife is licensed according to the terms in the file LICENCE in the root of the source
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory.
**************************************************************************************************/
#include "xToolsPingAssistant.h"

View File

@ -1,9 +1,9 @@
/***************************************************************************************************
* Copyright 2023-2024 Qsaker(qsaker@foxmail.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 QtSwissArmyKnife project.
* The file is encoded using "utf8 with bom", it is a part of xTools project.
*
* QtSwissArmyKnife is licensed according to the terms in the file LICENCE in the root of the source
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory.
**************************************************************************************************/
#include "xToolsStringAssistant.h"

View File

@ -1,9 +1,9 @@
/***************************************************************************************************
* Copyright 2023-2024 Qsaker(qsaker@foxmail.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 QtSwissArmyKnife project.
* The file is encoded using "utf8 with bom", it is a part of xTools project.
*
* QtSwissArmyKnife is licensed according to the terms in the file LICENCE in the root of the source
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory.
**************************************************************************************************/
#include "xToolsMdnsAssistant.h"

View File

@ -1,25 +1,25 @@
file(GLOB_RECURSE SAK_CANBUSSTUDIO_SOURCES "${CMAKE_SOURCE_DIR}/src/canbusstudio/*.h"
"${CMAKE_SOURCE_DIR}/src/canbusstudio/*.cc" "${CMAKE_SOURCE_DIR}/src/canbusstudio/*.ui")
file(GLOB_RECURSE SAK_CANBUSSTUDIO_SOURCES "${CMAKE_SOURCE_DIR}/Source/CANBusStudio/*.h"
"${CMAKE_SOURCE_DIR}/Source/CANBusStudio/*.cc" "${CMAKE_SOURCE_DIR}/Source/CANBusStudio/*.ui")
set(SAK_COMMON_SOURCES
${STUDIO_SOURCES}
${CMAKE_SOURCE_DIR}/src/common/common/saksettings.h
${CMAKE_SOURCE_DIR}/src/common/common/saksettings.cc
${CMAKE_SOURCE_DIR}/src/common/common/sakinterface.h
${CMAKE_SOURCE_DIR}/src/common/common/sakinterface.cc
${CMAKE_SOURCE_DIR}/src/common/common/saktranslator.h
${CMAKE_SOURCE_DIR}/src/common/common/saktranslator.cc
${CMAKE_SOURCE_DIR}/src/common/commonui/sakui.h
${CMAKE_SOURCE_DIR}/src/common/commonui/sakcommonmainwindow.h
${CMAKE_SOURCE_DIR}/src/common/commonui/sakcommonmainwindow.cc
${CMAKE_SOURCE_DIR}/qtswissarmyknife.qrc)
${CMAKE_SOURCE_DIR}/Source/Common/Common/xToolsSettings.h
${CMAKE_SOURCE_DIR}/Source/Common/Common/xToolsSettings.cpp
${CMAKE_SOURCE_DIR}/Source/Common/Common/xToolsInterface.h
${CMAKE_SOURCE_DIR}/Source/Common/Common/xToolsInterface.cpp
${CMAKE_SOURCE_DIR}/Source/Common/Common/xToolsTranslator.h
${CMAKE_SOURCE_DIR}/Source/Common/Common/xToolsTranslator.cpp
${CMAKE_SOURCE_DIR}/Source/Common/Commonui/xToolsUi.h
${CMAKE_SOURCE_DIR}/Source/Common/Commonui/xToolsMainWindow.h
${CMAKE_SOURCE_DIR}/Source/Common/Commonui/xToolsMainWindow.cpp
${CMAKE_SOURCE_DIR}/xTools.qrc)
set(SAK_CANBUSSTUDIO_SOURCES ${SAK_CANBUSSTUDIO_SOURCES} ${SAK_COMMON_SOURCES})
sak_add_executable("CANBusStudio" ${SAK_CANBUSSTUDIO_SOURCES})
sak_set_target_properties(CANBusStudio)
sak_auto_execute_windeployqt(CANBusStudio)
sak_3rd_setup_glog(CANBusStudio)
x_tools_3rd_setup_glog(CANBusStudio)
target_link_libraries(CANBusStudio PRIVATE Qt${QT_VERSION_MAJOR}::Widgets
Qt${QT_VERSION_MAJOR}::SerialBus)

View File

@ -1,9 +1,9 @@
/***************************************************************************************************
* Copyright 2023 Qsaker(qsaker@foxmail.com). All rights reserved.
* Copyright 2023 x-tools-author(x-tools@outlook.com). All rights reserved.
*
* The file is encoded using "utf8 with bom", it is a part of QtSwissArmyKnife project.
* The file is encoded using "utf8 with bom", it is a part of xTools project.
*
* QtSwissArmyKnife is licensed according to the terms in the file LICENCE in the root of the source
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory.
**************************************************************************************************/
#include "sakcanbus.h"

View File

@ -1,9 +1,9 @@
/***************************************************************************************************
* Copyright 2023 Qsaker(qsaker@foxmail.com). All rights reserved.
* Copyright 2023 x-tools-author(x-tools@outlook.com). All rights reserved.
*
* The file is encoded using "utf8 with bom", it is a part of QtSwissArmyKnife project.
* The file is encoded using "utf8 with bom", it is a part of xTools project.
*
* QtSwissArmyKnife is licensed according to the terms in the file LICENCE in the root of the source
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory.
**************************************************************************************************/
#ifndef SAKCANBUS_H

View File

@ -1,12 +1,13 @@
/***************************************************************************************************
* Copyright 2023-2024 Qsaker(qsaker@foxmail.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 QtSwissArmyKnife project.
* The file is encoded using "utf8 with bom", it is a part of xTools project.
*
* QtSwissArmyKnife is licensed according to the terms in the file LICENCE in the root of the source
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory.
**************************************************************************************************/
#include "sakcanbusstudioui.h"
#include "ui_sakcanbusstudioui.h"
#include <QCanBus>
#include <QCheckBox>
@ -16,8 +17,7 @@
#include <QMessageBox>
#include <QVector>
#include "saksettings.h"
#include "ui_sakcanbusstudioui.h"
#include "xToolsSettings.h"
const QLoggingCategory gLC("sak.canstudio");
@ -27,7 +27,7 @@ SAKCanBusUi::SAKCanBusUi(QWidget* parent)
, mDevice(Q_NULLPTR)
{
if (!mSettings) {
mSettings = SAKSettings::instance();
mSettings = xToolsSettings::instance();
}
ui->setupUi(this);

View File

@ -1,9 +1,9 @@
/***************************************************************************************************
* Copyright 2023 Qsaker(qsaker@foxmail.com). All rights reserved.
* Copyright 2023 x-tools-author(x-tools@outlook.com). All rights reserved.
*
* The file is encoded using "utf8 with bom", it is a part of QtSwissArmyKnife project.
* The file is encoded using "utf8 with bom", it is a part of xTools project.
*
* QtSwissArmyKnife is licensed according to the terms in the file LICENCE in the root of the source
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory.
**************************************************************************************************/
#ifndef SAKCANBUSSTUDIOUI_H

View File

@ -1,16 +1,16 @@
/***************************************************************************************************
* Copyright 2023-2024 Qsaker(qsaker@foxmail.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 QtSwissArmyKnife project.
* The file is encoded using "utf8 with bom", it is a part of xTools project.
*
* QtSwissArmyKnife is licensed according to the terms in the file LICENCE in the root of the source
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory.
**************************************************************************************************/
#include "sakcanbusstudioui.h"
#include "sakui.h"
#include "xToolsUi.h"
int main(int argc, char* argv[])
{
const QString appName = QObject::tr("CAN Bus Studio");
return sakExec<SAKCanBusUi>(argc, argv, appName);
return xToolsExec<SAKCanBusUi>(argc, argv, appName);
}

View File

@ -13,12 +13,13 @@
#include <QObject>
#include <QTextEdit>
#ifdef SAK_IMPORT_MODULE_SERIALPORT
#ifdef X_TOOLS_IMPORT_MODULE_SERIALPORT
#include <QSerialPort>
#include <QSerialPortInfo>
#endif
#ifdef SAK_IMPORT_MODULE_BLE
#ifdef SAK_IMPORT_MODULE_BLE_CENTRAL
#ifdef X_TOOLS_IMPORT_MODULE_BLE
#ifdef X_TOOLS_IMPORT_MODULE_BLE_CENTRAL
#include <QBluetoothDeviceInfo>
#endif
#endif
@ -145,7 +146,7 @@ public:
enum SAKEnumPrefixType { PrefixTypeNone, PrefixTypeR, PrefixTypeN, PrefixTypeRN, PrefixTypeNR };
Q_ENUM(SAKEnumPrefixType);
#ifdef SAK_IMPORT_MODULE_TEST
#ifdef X_TOOLS_IMPORT_MODULE_TEST
struct SAKStructTestParametersContext
{
bool openFailed;
@ -159,7 +160,7 @@ public:
};
#endif
#ifdef SAK_IMPORT_MODULE_SERIALPORT
#ifdef X_TOOLS_IMPORT_MODULE_SERIALPORT
struct SAKStructSerialPortParametersContext
{
QString portName;
@ -173,8 +174,8 @@ public:
};
#endif
#ifdef SAK_IMPORT_MODULE_UDP
#ifdef SAK_IMPORT_MODULE_UDP_CLIENT
#ifdef X_TOOLS_IMPORT_MODULE_UDP
#ifdef X_TOOLS_IMPORT_MODULE_UDP_CLIENT
struct SAKStructUdpClientParametersContext
{
QString peerHost;
@ -196,8 +197,8 @@ public:
#endif
#endif
#ifdef SAK_IMPORT_MODULE_TCP
#ifdef SAK_IMPORT_MODULE_TCP_CLIENT
#ifdef X_TOOLS_IMPORT_MODULE_TCP
#ifdef X_TOOLS_IMPORT_MODULE_TCP_CLIENT
struct SAKStructTcpClientParametersContext
{
QString localHost;
@ -208,7 +209,7 @@ public:
bool allowAutomaticConnection;
};
#endif
#ifdef SAK_IMPORT_MODULE_TCP_SERVER
#ifdef X_TOOLS_IMPORT_MODULE_TCP_SERVER
struct SAKStructTcpServerParametersContext
{
QString serverHost;
@ -218,15 +219,15 @@ public:
};
#endif
#endif
#ifdef SAK_IMPORT_MODULE_WEBSOCKET
#ifdef SAK_IMPORT_MODULE_WEBSOCKET_CLIENT
#ifdef X_TOOLS_IMPORT_MODULE_WEBSOCKET
#ifdef X_TOOLS_IMPORT_MODULE_WEBSOCKET_CLIENT
struct SAKStructWSClientParametersContext
{
QString serverAddress;
quint32 sendingType;
};
#endif
#ifdef SAK_IMPORT_MODULE_WEBSOCKET_SERVER
#ifdef X_TOOLS_IMPORT_MODULE_WEBSOCKET_SERVER
struct SAKStructWSServerParametersContext
{
QString serverHost;
@ -237,8 +238,8 @@ public:
};
#endif
#endif
#ifdef SAK_IMPORT_MODULE_BLE
#ifdef SAK_IMPORT_MODULE_BLE_CENTRAL
#ifdef X_TOOLS_IMPORT_MODULE_BLE
#ifdef X_TOOLS_IMPORT_MODULE_BLE_CENTRAL
struct SAKStructBleCentralParametersContext
{
QBluetoothDeviceInfo info;

View File

@ -18,7 +18,7 @@
#include <QJsonObject>
#include <QLocale>
#include <QTextDocument>
#ifdef SAK_IMPORT_MODULE_QML
#ifdef X_TOOLS_IMPORT_MODULE_QML
#if QT_VERSION >= QT_VERSION_CHECK(6, 4, 0)
#include <QQuickTextDocument>
#endif
@ -41,7 +41,7 @@ void xToolsInterface::setMaximumBlockCount(QVariant doc, int maximum)
auto obj = doc.value<QObject *>();
if (obj) {
#if QT_VERSION >= QT_VERSION_CHECK(6, 4, 0)
#ifdef SAK_IMPORT_MODULE_QML
#ifdef X_TOOLS_IMPORT_MODULE_QML
auto quickTextDoc = qobject_cast<QQuickTextDocument *>(obj);
if (quickTextDoc) {
auto textDoc = quickTextDoc->textDocument();
@ -263,8 +263,8 @@ void xToolsInterface::setLineEditValidator(QLineEdit *lineEdit,
}
}
#ifdef SAK_IMPORT_MODULE_SERIALPORT
void SAKInterface::addSerialPortNametItemsToComboBox(QComboBox *comboBox)
#ifdef X_TOOLS_IMPORT_MODULE_SERIALPORT
void xToolsInterface::addSerialPortNametItemsToComboBox(QComboBox *comboBox)
{
if (comboBox) {
comboBox->clear();
@ -281,8 +281,8 @@ void SAKInterface::addSerialPortNametItemsToComboBox(QComboBox *comboBox)
}
#endif
#ifdef SAK_IMPORT_MODULE_SERIALPORT
void SAKInterface::addSerialPortBaudRateItemsToComboBox(QComboBox *comboBox)
#ifdef X_TOOLS_IMPORT_MODULE_SERIALPORT
void xToolsInterface::addSerialPortBaudRateItemsToComboBox(QComboBox *comboBox)
{
if (comboBox) {
comboBox->clear();
@ -296,8 +296,8 @@ void SAKInterface::addSerialPortBaudRateItemsToComboBox(QComboBox *comboBox)
}
#endif
#ifdef SAK_IMPORT_MODULE_SERIALPORT
void SAKInterface::addSerialPortDataBitItemsToComboBox(QComboBox *comboBox)
#ifdef X_TOOLS_IMPORT_MODULE_SERIALPORT
void xToolsInterface::addSerialPortDataBitItemsToComboBox(QComboBox *comboBox)
{
if (comboBox) {
comboBox->clear();
@ -309,8 +309,8 @@ void SAKInterface::addSerialPortDataBitItemsToComboBox(QComboBox *comboBox)
}
#endif
#ifdef SAK_IMPORT_MODULE_SERIALPORT
void SAKInterface::addSerialPortStopBitItemsToComboBox(QComboBox *comboBox)
#ifdef X_TOOLS_IMPORT_MODULE_SERIALPORT
void xToolsInterface::addSerialPortStopBitItemsToComboBox(QComboBox *comboBox)
{
if (comboBox) {
comboBox->clear();
@ -323,8 +323,8 @@ void SAKInterface::addSerialPortStopBitItemsToComboBox(QComboBox *comboBox)
}
#endif
#ifdef SAK_IMPORT_MODULE_SERIALPORT
void SAKInterface::addSerialPortParityItemsToComboBox(QComboBox *comboBox)
#ifdef X_TOOLS_IMPORT_MODULE_SERIALPORT
void xToolsInterface::addSerialPortParityItemsToComboBox(QComboBox *comboBox)
{
if (comboBox) {
comboBox->clear();
@ -337,8 +337,8 @@ void SAKInterface::addSerialPortParityItemsToComboBox(QComboBox *comboBox)
}
#endif
#ifdef SAK_IMPORT_MODULE_SERIALPORT
void SAKInterface::addSerialPortFlowControlItemsToComboBox(QComboBox *comboBox)
#ifdef X_TOOLS_IMPORT_MODULE_SERIALPORT
void xToolsInterface::addSerialPortFlowControlItemsToComboBox(QComboBox *comboBox)
{
if (comboBox) {
comboBox->clear();

View File

@ -92,7 +92,7 @@ public:
static void setLineEditValidator(QLineEdit *lineEdit,
SAKEnumValidatorType type,
int maxLength = INT_MAX);
#ifdef SAK_IMPORT_MODULE_SERIALPORT
#ifdef X_TOOLS_IMPORT_MODULE_SERIALPORT
// Serialport interfaces
static void addSerialPortNametItemsToComboBox(QComboBox *comboBox);
static void addSerialPortBaudRateItemsToComboBox(QComboBox *comboBox);

View File

@ -9,7 +9,7 @@
#include <QDebug>
#include <QRegularExpression>
#include <QTextDocument>
#ifdef SAK_IMPORT_MODULE_QML
#ifdef X_TOOLS_IMPORT_MODULE_QML
#if QT_VERSION >= QT_VERSION_CHECK(6, 4, 0)
#include <QQuickTextDocument>
#endif
@ -24,7 +24,7 @@ xToolsHighlighter::xToolsHighlighter(QObject *parent)
void xToolsHighlighter::setDoc(QVariant doc)
{
auto obj = doc.value<QObject *>();
#ifdef SAK_IMPORT_MODULE_QML
#ifdef X_TOOLS_IMPORT_MODULE_QML
#if QT_VERSION >= QT_VERSION_CHECK(6, 4, 0)
if (obj->inherits("QQuickTextDocument")) {
setDocument(doc.value<QQuickTextDocument *>()->textDocument());

View File

@ -43,19 +43,14 @@
#include "xToolsUiInterface.h"
#include "xToolsAssistantFactory.h"
#ifdef SAK_IMPORT_MODULE_CANBUSSTUDIO
#ifdef X_TOOLS_IMPORT_MODULE_CANBUS_STUDIO
#include "sakcanbusstudioui.h"
#endif
#ifdef SAK_IMPORT_MODULE_MODBUSSTUDIO
#ifdef X_TOOLS_IMPORT_MODULE_MODBUS_STUDIO
#include "sakmodbusui.h"
#endif
#ifdef SAK_IMPORT_MODULE_PRIVATE_MODBUS
#include "SAKPrivateModbusClient.h"
#include "SAKPrivateModbusServer.h"
#endif
#define SAK_QT_CONF (qApp->applicationDirPath() + "/qt.conf")
QString palettePath()
@ -96,13 +91,13 @@ MainWindow::MainWindow(QWidget* parent)
#endif
QString title = QString("xTools");
#ifndef SAK_IMPORT_MODULE_PRIVATE
#ifndef X_TOOLS_IMPORT_MODULE_PRIVATE
title.append(tr("(Community)"));
#endif
title.append(QString(" "));
title.append(QString("v"));
title.append(qApp->applicationVersion());
#ifndef SAK_IMPORT_MODULE_PRIVATE
#ifndef X_TOOLS_IMPORT_MODULE_PRIVATE
title.append(" ");
title.append("Beta1");
#endif
@ -166,7 +161,7 @@ void MainWindow::initFileMenu()
}
// Other tools
#ifdef SAK_IMPORT_MODULE_MODBUSSTUDIO
#ifdef X_TOOLS_IMPORT_MODULE_MODBUSSTUDIO
QAction* modbusAction = new QAction("Modbus Studio", this);
connect(modbusAction, &QAction::triggered, this, [=]() {
SAKModbusUi* w = new SAKModbusUi();
@ -178,7 +173,7 @@ void MainWindow::initFileMenu()
windowMenu->addAction(modbusAction);
#endif
#ifndef SAK_RELEASE_FOR_APP_STORE
#ifdef SAK_IMPORT_MODULE_CANBUSSTUDIO
#ifdef X_TOOLS_IMPORT_MODULE_CANBUSSTUDIO
QAction* canbusAction = new QAction("CANBus Studio", this);
connect(canbusAction, &QAction::triggered, this, [=]() {
SAKCanBusUi* w = new SAKCanBusUi();
@ -578,7 +573,7 @@ void MainWindow::initHelpMenu()
QAction* qrCodeAction = new QAction(tr("QR Code"), this);
helpMenu->addAction(qrCodeAction);
connect(qrCodeAction, &QAction::triggered, this, &MainWindow::showQrCode);
#ifndef SAK_IMPORT_MODULE_PRIVATE
#ifndef X_TOOLS_IMPORT_MODULE_PRIVATE
helpMenu->addAction(tr("Donate"), this, &MainWindow::showDonation);
#endif
}
@ -651,33 +646,17 @@ void MainWindow::initNav()
tb->addSeparator();
QString path = ":/Resources/Icon/IconModbus.svg";
#ifdef SAK_IMPORT_MODULE_MODBUSSTUDIO
#ifdef X_TOOLS_IMPORT_MODULE_MODBUS_STUDIO
SAKModbusUi* modbus = new SAKModbusUi(this);
initNav({&navButtonGroup, SAKUiInterface::cookedIcon(QIcon(path)), "Modbus Studio", modbus, tb});
#ifdef SAK_IMPORT_MODULE_PRIVATE_MODBUS
SAKPrivateModbusClient* modbusClient = new SAKPrivateModbusClient(this);
SAKPrivateModbusServer* modbusServer = new SAKPrivateModbusServer(this);
path = ":/Resources/Icon/IconModbus.svg";
initNav(&navButtonGroup,
SAKUiInterface::cookedIcon(QIcon(path)),
"Modbus Master",
modbusClient,
tb);
path = ":/Resources/Icon/IconModbus.svg";
initNav(&navButtonGroup,
SAKUiInterface::cookedIcon(QIcon(path)),
"Modbus Slave",
modbusServer,
tb);
modbusClient->importProject();
modbusServer->importProject();
initNav(
{&navButtonGroup, xToolsUiInterface::cookedIcon(QIcon(path)), "Modbus Studio", modbus, tb});
#endif
#endif
#ifndef SAK_RELEASE_FOR_APP_STORE
#ifdef SAK_IMPORT_MODULE_CANBUSSTUDIO
#ifndef X_TOOLS_BUILD_FOR_STORE
#ifdef X_TOOLS_IMPORT_MODULE_CANBUS_STUDIO
SAKCanBusUi* canbus = new SAKCanBusUi(this);
path = ":/Resources/Icon/IconCanBus.svg";
initNav({&navButtonGroup, SAKUiInterface::cookedIcon(QIcon(path)), "CANBus Studio", canbus, tb});
initNav(
{&navButtonGroup, xToolsUiInterface::cookedIcon(QIcon(path)), "CANBus Studio", canbus, tb});
#endif
#endif
QLabel* lb = new QLabel(" ");

View File

@ -1,25 +1,25 @@
file(GLOB_RECURSE SAK_MODBUSSTUDIO_SOURCES "${CMAKE_SOURCE_DIR}/src/modbusstudio/*.h"
"${CMAKE_SOURCE_DIR}/src/modbusstudio/*.cc" "${CMAKE_SOURCE_DIR}/src/modbusstudio/*.ui")
file(GLOB_RECURSE SAK_MODBUSSTUDIO_SOURCES "${CMAKE_SOURCE_DIR}/Source/ModbusStudio/*.h"
"${CMAKE_SOURCE_DIR}/Source/ModbusStudio/*.cc" "${CMAKE_SOURCE_DIR}/Source/ModbusStudio/*.ui")
set(SAK_COMMON_SOURCES
${STUDIO_SOURCES}
${CMAKE_SOURCE_DIR}/src/common/common/saksettings.h
${CMAKE_SOURCE_DIR}/src/common/common/saksettings.cc
${CMAKE_SOURCE_DIR}/src/common/common/sakinterface.h
${CMAKE_SOURCE_DIR}/src/common/common/sakinterface.cc
${CMAKE_SOURCE_DIR}/src/common/common/saktranslator.h
${CMAKE_SOURCE_DIR}/src/common/common/saktranslator.cc
${CMAKE_SOURCE_DIR}/src/common/commonui/sakui.h
${CMAKE_SOURCE_DIR}/src/common/commonui/sakcommonmainwindow.h
${CMAKE_SOURCE_DIR}/src/common/commonui/sakcommonmainwindow.cc
${CMAKE_SOURCE_DIR}/qtswissarmyknife.qrc)
${CMAKE_SOURCE_DIR}/Source/Common/Common/xToolsSettings.h
${CMAKE_SOURCE_DIR}/Source/Common/Common/xToolsSettings.cpp
${CMAKE_SOURCE_DIR}/Source/Common/Common/xToolsInterface.h
${CMAKE_SOURCE_DIR}/Source/Common/Common/xToolsInterface.cpp
${CMAKE_SOURCE_DIR}/Source/Common/Common/xToolsTranslator.h
${CMAKE_SOURCE_DIR}/Source/Common/Common/xToolsTranslator.cpp
${CMAKE_SOURCE_DIR}/Source/Common/Commonui/xToolsUi.h
${CMAKE_SOURCE_DIR}/Source/Common/Commonui/xToolsMainWindow.h
${CMAKE_SOURCE_DIR}/Source/Common/Commonui/xToolsMainWindow.cpp
${CMAKE_SOURCE_DIR}/xTools.qrc)
set(SAK_MODBUSSTUDIO_SOURCES ${SAK_MODBUSSTUDIO_SOURCES} ${SAK_COMMON_SOURCES})
sak_add_executable("ModbusStudio" ${SAK_MODBUSSTUDIO_SOURCES})
sak_set_target_properties(ModbusStudio)
sak_auto_execute_windeployqt(ModbusStudio)
sak_3rd_setup_glog(ModbusStudio)
x_tools_3rd_setup_glog(ModbusStudio)
target_link_libraries(
ModbusStudio PRIVATE Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::SerialBus

View File

@ -1,16 +1,16 @@
/***************************************************************************************************
* Copyright 2023-2024 Qsaker(qsaker@foxmail.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 QtSwissArmyKnife project.
* The file is encoded using "utf8 with bom", it is a part of xTools project.
*
* QtSwissArmyKnife is licensed according to the terms in the file LICENCE in the root of the source
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory.
**************************************************************************************************/
#include "sakmodbusui.h"
#include "sakui.h"
#include "xToolsUi.h"
int main(int argc, char* argv[])
{
const QString appName = QObject::tr("Modbus Studio");
return sakExec<SAKModbusUi>(argc, argv, appName);
return xToolsExec<SAKModbusUi>(argc, argv, appName);
}

View File

@ -1,9 +1,9 @@
/***************************************************************************************************
* Copyright 2023 Qsaker(qsaker@foxmail.com). All rights reserved.
* Copyright 2023 x-tools-author(x-tools@outlook.com). All rights reserved.
*
* The file is encoded using "utf8 with bom", it is a part of QtSwissArmyKnife project.
* The file is encoded using "utf8 with bom", it is a part of xTools project.
*
* QtSwissArmyKnife is licensed according to the terms in the file LICENCE in the root of the source
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory.
**************************************************************************************************/
#include <QCoreApplication>

View File

@ -1,9 +1,9 @@
/***************************************************************************************************
* Copyright 2023 Qsaker(qsaker@foxmail.com). All rights reserved.
* Copyright 2023 x-tools-author(x-tools@outlook.com). All rights reserved.
*
* The file is encoded using "utf8 with bom", it is a part of QtSwissArmyKnife project.
* The file is encoded using "utf8 with bom", it is a part of xTools project.
*
* QtSwissArmyKnife is licensed according to the terms in the file LICENCE in the root of the source
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory.
**************************************************************************************************/
#ifndef SAKMODBUSFACTORY_H

View File

@ -1,12 +1,13 @@
/***************************************************************************************************
* Copyright 2023 Qsaker(qsaker@foxmail.com). All rights reserved.
* Copyright 2023 x-tools-author(x-tools@outlook.com). All rights reserved.
*
* The file is encoded using "utf8 with bom", it is a part of QtSwissArmyKnife project.
* The file is encoded using "utf8 with bom", it is a part of xTools project.
*
* QtSwissArmyKnife is licensed according to the terms in the file LICENCE in the root of the source
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory.
**************************************************************************************************/
#include "sakmodbusui.h"
#include "ui_sakmodbusui.h"
#include <QAbstractSocket>
#include <QCheckBox>
@ -39,8 +40,7 @@
#endif
#include "sakmodbusfactory.h"
#include "saksettings.h"
#include "ui_sakmodbusui.h"
#include "xToolsSettings.h"
#define RXCOLOR "green"
#define TXCOLOR "blue"
@ -105,7 +105,7 @@ SAKModbusUi::SAKModbusUi(QWidget *parent)
, key_ctx_(new SAKModbusUiSettingKeys)
{
if (!settings_) {
settings_ = SAKSettings::instance();
settings_ = xToolsSettings::instance();
}
ui->setupUi(this);

View File

@ -1,9 +1,9 @@
/***************************************************************************************************
* Copyright 2023 Qsaker(qsaker@foxmail.com). All rights reserved.
* Copyright 2023 x-tools-author(x-tools@outlook.com). All rights reserved.
*
* The file is encoded using "utf8 with bom", it is a part of QtSwissArmyKnife project.
* The file is encoded using "utf8 with bom", it is a part of xTools project.
*
* QtSwissArmyKnife is licensed according to the terms in the file LICENCE in the root of the source
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory.
**************************************************************************************************/
#ifndef SAKMODBUSUI_H

View File

@ -1,9 +1,9 @@
/***************************************************************************************************
* Copyright 2023-2024 Qsaker(qsaker@foxmail.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 QtSwissArmyKnife project.
* The file is encoded using "utf8 with bom", it is a part of xTools project.
*
* QtSwissArmyKnife is licensed according to the terms in the file LICENCE in the root of the source
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory.
**************************************************************************************************/
#include <QBluetoothDeviceInfo>
@ -14,7 +14,7 @@
#define BLE_ERR_SIG QLowEnergyController::Error
SAKBleCentralTool::SAKBleCentralTool(QObject *parent)
: SAKCommunicationTool(parent)
: xToolsCommunicationTool(parent)
{}
SAKBleCentralTool::~SAKBleCentralTool() {}

View File

@ -1,9 +1,9 @@
/***************************************************************************************************
* Copyright 2023-2024 Qsaker(qsaker@foxmail.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 QtSwissArmyKnife project.
* The file is encoded using "utf8 with bom", it is a part of xTools project.
*
* QtSwissArmyKnife is licensed according to the terms in the file LICENCE in the root of the source
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory.
**************************************************************************************************/
#ifndef EDBLECENTRAL_HH
@ -15,9 +15,9 @@
#include <QLowEnergyService>
#include <QVariantList>
#include "sakcommunicationtool.h"
#include "xToolsCommunicationTool.h"
class SAKBleCentralTool : public SAKCommunicationTool
class SAKBleCentralTool : public xToolsCommunicationTool
{
Q_OBJECT
// clang-format off

View File

@ -1,12 +1,13 @@
/***************************************************************************************************
* Copyright 2023 Qsaker(qsaker@foxmail.com). All rights reserved.
* Copyright 2023 x-tools-author(x-tools@outlook.com). All rights reserved.
*
* The file is encoded using "utf8 with bom", it is a part of QtSwissArmyKnife project.
* The file is encoded using "utf8 with bom", it is a part of xTools project.
*
* QtSwissArmyKnife is licensed according to the terms in the file LICENCE in the root of the source
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory.
**************************************************************************************************/
#include "sakblecentraltoolui.h"
#include "ui_sakblecentraltoolui.h"
#include <QGridLayout>
#include <QLabel>
@ -15,14 +16,13 @@
#include <QWidget>
#include <QWidgetAction>
#include "saklineedit.h"
#include "sakspinbox.h"
#include "ui_sakblecentraltoolui.h"
#include "xToolsLineEdit.h"
#include "xToolsSpinBox.h"
#define SAK_CB_I_C &QComboBox::currentIndexChanged
SAKBleCentralToolUi::SAKBleCentralToolUi(QWidget* parent)
: SAKCommunicationToolUi{parent}
: xToolsCommunicationToolUi{parent}
, ui(new Ui::SAKBleCentralToolUi)
, mBleTool(Q_NULLPTR)
{
@ -78,9 +78,9 @@ SAKBleCentralToolUi::~SAKBleCentralToolUi()
delete ui;
}
void SAKBleCentralToolUi::onBaseToolUiInitialized(SAKBaseTool* tool, const QString& settingsGroup)
void SAKBleCentralToolUi::onBaseToolUiInitialized(xToolsBaseTool* tool, const QString& settingsGroup)
{
SAKCommunicationToolUi::onBaseToolUiInitialized(tool, settingsGroup);
xToolsCommunicationToolUi::onBaseToolUiInitialized(tool, settingsGroup);
mBleTool = qobject_cast<SAKBleCentralTool*>(mTool);
if (!mBleTool) {
@ -114,7 +114,7 @@ void SAKBleCentralToolUi::initSettingsMenu(const QString& settingsGroup)
int rowIndex = 0;
gl->addWidget(new QLabel(tr("Timeout interval(S)"), w), rowIndex, 0, 1, 1);
SAKSpinBox* sp = new SAKSpinBox(w);
xToolsSpinBox* sp = new xToolsSpinBox(w);
sp->setMinimum(10);
sp->setMaximum(120);
sp->setValue(120);
@ -131,10 +131,10 @@ void SAKBleCentralToolUi::initSettingsMenu(const QString& settingsGroup)
rowIndex += 1;
gl->addWidget(new QLabel(tr("Name filtter"), w), rowIndex, 0, 1, 1);
SAKLineEdit* le = new SAKLineEdit(w);
xToolsLineEdit* le = new xToolsLineEdit(w);
le->setGroupKey(settingsGroup, "nameFiltter");
gl->addWidget(le, rowIndex, 1, 1, 1);
connect(le, &SAKLineEdit::textChanged, this, [=](const QString& text) {
connect(le, &xToolsLineEdit::textChanged, this, [=](const QString& text) {
ui->comboBoxDevices->setNameFiltter(text);
});

View File

@ -1,9 +1,9 @@
/***************************************************************************************************
* Copyright 2023 Qsaker(qsaker@foxmail.com). All rights reserved.
* Copyright 2023 x-tools-author(x-tools@outlook.com). All rights reserved.
*
* The file is encoded using "utf8 with bom", it is a part of QtSwissArmyKnife project.
* The file is encoded using "utf8 with bom", it is a part of xTools project.
*
* QtSwissArmyKnife is licensed according to the terms in the file LICENCE in the root of the source
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory.
**************************************************************************************************/
#ifndef SAKBLECENTRALTOOLUI_H
@ -12,12 +12,12 @@
#include <QLowEnergyDescriptor>
#include "sakblecentraltool.h"
#include "sakcommunicationtoolui.h"
#include "xToolsCommunicationToolUi.h"
namespace Ui {
class SAKBleCentralToolUi;
}
class SAKBleCentralToolUi : public SAKCommunicationToolUi
class SAKBleCentralToolUi : public xToolsCommunicationToolUi
{
Q_OBJECT
public:
@ -25,7 +25,8 @@ public:
~SAKBleCentralToolUi();
protected:
virtual void onBaseToolUiInitialized(SAKBaseTool *tool, const QString &settingsGroup) override;
virtual void onBaseToolUiInitialized(xToolsBaseTool *tool,
const QString &settingsGroup) override;
virtual void onIsWorkingChanged(bool isWorking) final;

View File

@ -1,9 +1,9 @@
/***************************************************************************************************
* Copyright 2023-2024 Qsaker(qsaker@foxmail.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 QtSwissArmyKnife project.
* The file is encoded using "utf8 with bom", it is a part of xTools project.
*
* QtSwissArmyKnife is licensed according to the terms in the file LICENCE in the root of the source
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory.
**************************************************************************************************/
#include "sakblescanner.h"

View File

@ -1,9 +1,9 @@
/***************************************************************************************************
* Copyright 2023-2024 Qsaker(qsaker@foxmail.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 QtSwissArmyKnife project.
* The file is encoded using "utf8 with bom", it is a part of xTools project.
*
* QtSwissArmyKnife is licensed according to the terms in the file LICENCE in the root of the source
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory.
**************************************************************************************************/
#ifndef SAKBLESCANNER_H

View File

@ -1,9 +1,9 @@
/***************************************************************************************************
* Copyright 2023 Qsaker(qsaker@foxmail.com). All rights reserved.
* Copyright 2023 x-tools-author(x-tools@outlook.com). All rights reserved.
*
* The file is encoded using "utf8 with bom", it is a part of QtSwissArmyKnife project.
* The file is encoded using "utf8 with bom", it is a part of xTools project.
*
* QtSwissArmyKnife is licensed according to the terms in the file LICENCE in the root of the source
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory.
**************************************************************************************************/
#include "sakbluetoothdeviceInfocombobox.h"
@ -12,7 +12,7 @@
#include <QMessageBox>
SAKBluetoothDeviceInfoComboBox::SAKBluetoothDeviceInfoComboBox(QWidget* parent)
: SAKComboBox(parent)
: xToolsComboBox(parent)
, mScanner(Q_NULLPTR)
{
#if 0
@ -72,7 +72,7 @@ void SAKBluetoothDeviceInfoComboBox::setNameFiltter(const QString& filtter)
void SAKBluetoothDeviceInfoComboBox::changeEvent(QEvent* event)
{
SAKComboBox::changeEvent(event);
xToolsComboBox::changeEvent(event);
if ((event->type() == QEvent::EnabledChange) && isEnabled()) {
onFinished();
}

View File

@ -1,9 +1,9 @@
/***************************************************************************************************
* Copyright 2023 Qsaker(qsaker@foxmail.com). All rights reserved.
* Copyright 2023 x-tools-author(x-tools@outlook.com). All rights reserved.
*
* The file is encoded using "utf8 with bom", it is a part of QtSwissArmyKnife project.
* The file is encoded using "utf8 with bom", it is a part of xTools project.
*
* QtSwissArmyKnife is licensed according to the terms in the file LICENCE in the root of the source
* xTools is licensed according to the terms in the file LICENCE(GPL V3) in the root of the source
* code directory.
**************************************************************************************************/
#ifndef SAKBLUETOOTHDEVICEINFOCOMBOBOX_H
@ -12,9 +12,9 @@
#include <QEvent>
#include "sakblescanner.h"
#include "sakcombobox.h"
#include "xToolsComboBox.h"
class SAKBluetoothDeviceInfoComboBox : public SAKComboBox
class SAKBluetoothDeviceInfoComboBox : public xToolsComboBox
{
Q_OBJECT
public:

View File

@ -39,7 +39,7 @@
#include "xToolsUiInterface.h"
#include "xToolsWebSocketTransmitterToolUi.h"
#ifdef SAK_IMPORT_MODULE_BLUETOOTH
#ifdef X_TOOLS_IMPORT_MODULE_BLUETOOTH
#include "sakblecentraltoolui.h"
#endif
@ -69,8 +69,8 @@ QList<int> xToolsToolBoxUi::supportedCommunicationTools()
{
QList<int> list;
list << xToolsToolFactory::SerialportTool
#ifdef SAK_IMPORT_MODULE_BLUETOOTH
<< SAKToolFactory::BleCentralTool
#ifdef X_TOOLS_IMPORT_MODULE_BLUETOOTH
<< xToolsToolFactory::BleCentralTool
#endif
<< xToolsToolFactory::UdpClientTool << xToolsToolFactory::UdpServerTool
<< xToolsToolFactory::TcpClientTool << xToolsToolFactory::TcpServerTool
@ -169,8 +169,8 @@ xToolsCommunicationToolUi* xToolsToolBoxUi::communicationToolUi(int type)
} else if (type == xToolsToolFactory::WebSocketServerTool) {
w = new xToolsSocketServerToolUi();
}
#ifdef SAK_IMPORT_MODULE_BLUETOOTH
else if (type == SAKToolFactory::BleCentralTool) {
#ifdef X_TOOLS_IMPORT_MODULE_BLUETOOTH
else if (type == xToolsToolFactory::BleCentralTool) {
w = new SAKBleCentralToolUi();
}
#endif

View File

@ -31,7 +31,7 @@
#include "xToolsWebSocketServerTool.h"
#include "xToolsWebSocketTransmitterTool.h"
#ifdef SAK_IMPORT_MODULE_BLUETOOTH
#ifdef X_TOOLS_IMPORT_MODULE_BLUETOOTH
#include "sakblecentraltool.h"
#endif
@ -77,7 +77,7 @@ xToolsBaseTool *xToolsToolFactory::createTool(int type)
} else if (WebSocketServerTool == type) {
tool = new xToolsWebSocketServerTool();
}
#ifdef SAK_IMPORT_MODULE_BLUETOOTH
#ifdef X_TOOLS_IMPORT_MODULE_BLUETOOTH
else if (BleCentralTool == type) {
tool = new SAKBleCentralTool();
}

View File

@ -29,7 +29,7 @@
#include "xToolsVelometerToolUi.h"
#include "xToolsWebSocketTransmitterToolUi.h"
#ifdef SAK_IMPORT_MODULE_BLUETOOTH
#ifdef X_TOOLS_IMPORT_MODULE_BLUETOOTH
#include "sakblecentraltoolui.h"
#endif
@ -78,8 +78,8 @@ xToolsBaseToolUi *xToolsToolUiFactory::createToolUi(int type)
return new xToolsSocketClientToolUi();
case xToolsToolFactory::WebSocketServerTool:
return new xToolsSocketServerToolUi();
#ifdef SAK_IMPORT_MODULE_BLUETOOTH
case SAKToolFactory::BleCentralTool:
#ifdef X_TOOLS_IMPORT_MODULE_BLUETOOTH
case xToolsToolFactory::BleCentralTool:
return new SAKBleCentralToolUi();
#endif
case xToolsToolFactory::StatistiticianTool:

View File

@ -12,7 +12,7 @@
int main(const int argc, char *argv[])
{
QString appName = QString("xTools");
#ifndef SAK_IMPORT_MODULE_PRIVATE
#ifndef X_TOOLS_IMPORT_MODULE_PRIVATE
appName += QObject::tr("(Community)");
#endif
sakDoSomethingBeforeAppCreated(argv, appName);