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_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS 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) set(X_TOOLS_QT_COMPONENTS Core Gui Widgets WebSockets Network)
if(NOT CMAKE_SYSTEM_NAME STREQUAL "iOS") if(NOT CMAKE_SYSTEM_NAME STREQUAL "iOS")
list(APPEND X_TOOLS_QT_COMPONENTS SerialPort) list(APPEND X_TOOLS_QT_COMPONENTS SerialPort)
list(APPEND X_TOOLS_QT_COMPONENTS SerialBus) 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) add_compile_definitions(X_TOOLS_IMPORT_MODULE_SERIALBUS)
endif() 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_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_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_H})
list(APPEND X_TOOLS_SOURCE ${X_TOOLS_COMMOM_SOURCE_UI}) list(APPEND X_TOOLS_SOURCE ${X_TOOLS_COMMOM_SOURCE_UI})
list(APPEND X_TOOLS_SOURCE ${X_TOOLS_COMMOM_SOURCE_CPP}) 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/Broadcast/Source)
include_directories(${CMAKE_SOURCE_DIR}/Source/Assistants/FileCheck/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(WITH_GFLAGS OFF)
set(BUILD_TESTING OFF) set(BUILD_TESTING OFF)
set(BUILD_SHARED_LIBS OFF) set(BUILD_SHARED_LIBS OFF)
@ -114,7 +158,12 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL "iOS")
endif() endif()
target_link_libraries(xTools PRIVATE qmdnsengine) target_link_libraries(xTools PRIVATE qmdnsengine)
target_link_libraries(xTools PRIVATE glog::glog) 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 # Assistants
add_subdirectory(${CMAKE_SOURCE_DIR}/Source/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. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#include "xToolsAsciiAssistant.h" #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. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#include "xToolsBase64Assisatnt.h" #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. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#include "xToolsBroadcastAssistant.h" #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. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#include "xToolsCRCAssistant.h" #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. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#include "xToolsFileCheckAssistant.h" #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. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#include "xToolsNumberAssistant.h" #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. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#include "xToolsPingAssistant.h" #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. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#include "xToolsStringAssistant.h" #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. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#include "xToolsMdnsAssistant.h" #include "xToolsMdnsAssistant.h"

View File

@ -1,25 +1,25 @@
file(GLOB_RECURSE SAK_CANBUSSTUDIO_SOURCES "${CMAKE_SOURCE_DIR}/src/canbusstudio/*.h" file(GLOB_RECURSE SAK_CANBUSSTUDIO_SOURCES "${CMAKE_SOURCE_DIR}/Source/CANBusStudio/*.h"
"${CMAKE_SOURCE_DIR}/src/canbusstudio/*.cc" "${CMAKE_SOURCE_DIR}/src/canbusstudio/*.ui") "${CMAKE_SOURCE_DIR}/Source/CANBusStudio/*.cc" "${CMAKE_SOURCE_DIR}/Source/CANBusStudio/*.ui")
set(SAK_COMMON_SOURCES set(SAK_COMMON_SOURCES
${STUDIO_SOURCES} ${STUDIO_SOURCES}
${CMAKE_SOURCE_DIR}/src/common/common/saksettings.h ${CMAKE_SOURCE_DIR}/Source/Common/Common/xToolsSettings.h
${CMAKE_SOURCE_DIR}/src/common/common/saksettings.cc ${CMAKE_SOURCE_DIR}/Source/Common/Common/xToolsSettings.cpp
${CMAKE_SOURCE_DIR}/src/common/common/sakinterface.h ${CMAKE_SOURCE_DIR}/Source/Common/Common/xToolsInterface.h
${CMAKE_SOURCE_DIR}/src/common/common/sakinterface.cc ${CMAKE_SOURCE_DIR}/Source/Common/Common/xToolsInterface.cpp
${CMAKE_SOURCE_DIR}/src/common/common/saktranslator.h ${CMAKE_SOURCE_DIR}/Source/Common/Common/xToolsTranslator.h
${CMAKE_SOURCE_DIR}/src/common/common/saktranslator.cc ${CMAKE_SOURCE_DIR}/Source/Common/Common/xToolsTranslator.cpp
${CMAKE_SOURCE_DIR}/src/common/commonui/sakui.h ${CMAKE_SOURCE_DIR}/Source/Common/Commonui/xToolsUi.h
${CMAKE_SOURCE_DIR}/src/common/commonui/sakcommonmainwindow.h ${CMAKE_SOURCE_DIR}/Source/Common/Commonui/xToolsMainWindow.h
${CMAKE_SOURCE_DIR}/src/common/commonui/sakcommonmainwindow.cc ${CMAKE_SOURCE_DIR}/Source/Common/Commonui/xToolsMainWindow.cpp
${CMAKE_SOURCE_DIR}/qtswissarmyknife.qrc) ${CMAKE_SOURCE_DIR}/xTools.qrc)
set(SAK_CANBUSSTUDIO_SOURCES ${SAK_CANBUSSTUDIO_SOURCES} ${SAK_COMMON_SOURCES}) set(SAK_CANBUSSTUDIO_SOURCES ${SAK_CANBUSSTUDIO_SOURCES} ${SAK_COMMON_SOURCES})
sak_add_executable("CANBusStudio" ${SAK_CANBUSSTUDIO_SOURCES}) sak_add_executable("CANBusStudio" ${SAK_CANBUSSTUDIO_SOURCES})
sak_set_target_properties(CANBusStudio) sak_set_target_properties(CANBusStudio)
sak_auto_execute_windeployqt(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 target_link_libraries(CANBusStudio PRIVATE Qt${QT_VERSION_MAJOR}::Widgets
Qt${QT_VERSION_MAJOR}::SerialBus) 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. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#include "sakcanbus.h" #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. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#ifndef SAKCANBUS_H #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. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#include "sakcanbusstudioui.h" #include "sakcanbusstudioui.h"
#include "ui_sakcanbusstudioui.h"
#include <QCanBus> #include <QCanBus>
#include <QCheckBox> #include <QCheckBox>
@ -16,8 +17,7 @@
#include <QMessageBox> #include <QMessageBox>
#include <QVector> #include <QVector>
#include "saksettings.h" #include "xToolsSettings.h"
#include "ui_sakcanbusstudioui.h"
const QLoggingCategory gLC("sak.canstudio"); const QLoggingCategory gLC("sak.canstudio");
@ -27,7 +27,7 @@ SAKCanBusUi::SAKCanBusUi(QWidget* parent)
, mDevice(Q_NULLPTR) , mDevice(Q_NULLPTR)
{ {
if (!mSettings) { if (!mSettings) {
mSettings = SAKSettings::instance(); mSettings = xToolsSettings::instance();
} }
ui->setupUi(this); 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. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#ifndef SAKCANBUSSTUDIOUI_H #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. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#include "sakcanbusstudioui.h" #include "sakcanbusstudioui.h"
#include "sakui.h" #include "xToolsUi.h"
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
const QString appName = QObject::tr("CAN Bus Studio"); 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 <QObject>
#include <QTextEdit> #include <QTextEdit>
#ifdef SAK_IMPORT_MODULE_SERIALPORT #ifdef X_TOOLS_IMPORT_MODULE_SERIALPORT
#include <QSerialPort> #include <QSerialPort>
#include <QSerialPortInfo>
#endif #endif
#ifdef SAK_IMPORT_MODULE_BLE #ifdef X_TOOLS_IMPORT_MODULE_BLE
#ifdef SAK_IMPORT_MODULE_BLE_CENTRAL #ifdef X_TOOLS_IMPORT_MODULE_BLE_CENTRAL
#include <QBluetoothDeviceInfo> #include <QBluetoothDeviceInfo>
#endif #endif
#endif #endif
@ -145,7 +146,7 @@ public:
enum SAKEnumPrefixType { PrefixTypeNone, PrefixTypeR, PrefixTypeN, PrefixTypeRN, PrefixTypeNR }; enum SAKEnumPrefixType { PrefixTypeNone, PrefixTypeR, PrefixTypeN, PrefixTypeRN, PrefixTypeNR };
Q_ENUM(SAKEnumPrefixType); Q_ENUM(SAKEnumPrefixType);
#ifdef SAK_IMPORT_MODULE_TEST #ifdef X_TOOLS_IMPORT_MODULE_TEST
struct SAKStructTestParametersContext struct SAKStructTestParametersContext
{ {
bool openFailed; bool openFailed;
@ -159,7 +160,7 @@ public:
}; };
#endif #endif
#ifdef SAK_IMPORT_MODULE_SERIALPORT #ifdef X_TOOLS_IMPORT_MODULE_SERIALPORT
struct SAKStructSerialPortParametersContext struct SAKStructSerialPortParametersContext
{ {
QString portName; QString portName;
@ -173,8 +174,8 @@ public:
}; };
#endif #endif
#ifdef SAK_IMPORT_MODULE_UDP #ifdef X_TOOLS_IMPORT_MODULE_UDP
#ifdef SAK_IMPORT_MODULE_UDP_CLIENT #ifdef X_TOOLS_IMPORT_MODULE_UDP_CLIENT
struct SAKStructUdpClientParametersContext struct SAKStructUdpClientParametersContext
{ {
QString peerHost; QString peerHost;
@ -196,8 +197,8 @@ public:
#endif #endif
#endif #endif
#ifdef SAK_IMPORT_MODULE_TCP #ifdef X_TOOLS_IMPORT_MODULE_TCP
#ifdef SAK_IMPORT_MODULE_TCP_CLIENT #ifdef X_TOOLS_IMPORT_MODULE_TCP_CLIENT
struct SAKStructTcpClientParametersContext struct SAKStructTcpClientParametersContext
{ {
QString localHost; QString localHost;
@ -208,7 +209,7 @@ public:
bool allowAutomaticConnection; bool allowAutomaticConnection;
}; };
#endif #endif
#ifdef SAK_IMPORT_MODULE_TCP_SERVER #ifdef X_TOOLS_IMPORT_MODULE_TCP_SERVER
struct SAKStructTcpServerParametersContext struct SAKStructTcpServerParametersContext
{ {
QString serverHost; QString serverHost;
@ -218,15 +219,15 @@ public:
}; };
#endif #endif
#endif #endif
#ifdef SAK_IMPORT_MODULE_WEBSOCKET #ifdef X_TOOLS_IMPORT_MODULE_WEBSOCKET
#ifdef SAK_IMPORT_MODULE_WEBSOCKET_CLIENT #ifdef X_TOOLS_IMPORT_MODULE_WEBSOCKET_CLIENT
struct SAKStructWSClientParametersContext struct SAKStructWSClientParametersContext
{ {
QString serverAddress; QString serverAddress;
quint32 sendingType; quint32 sendingType;
}; };
#endif #endif
#ifdef SAK_IMPORT_MODULE_WEBSOCKET_SERVER #ifdef X_TOOLS_IMPORT_MODULE_WEBSOCKET_SERVER
struct SAKStructWSServerParametersContext struct SAKStructWSServerParametersContext
{ {
QString serverHost; QString serverHost;
@ -237,8 +238,8 @@ public:
}; };
#endif #endif
#endif #endif
#ifdef SAK_IMPORT_MODULE_BLE #ifdef X_TOOLS_IMPORT_MODULE_BLE
#ifdef SAK_IMPORT_MODULE_BLE_CENTRAL #ifdef X_TOOLS_IMPORT_MODULE_BLE_CENTRAL
struct SAKStructBleCentralParametersContext struct SAKStructBleCentralParametersContext
{ {
QBluetoothDeviceInfo info; QBluetoothDeviceInfo info;

View File

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

View File

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

View File

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

View File

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

View File

@ -1,25 +1,25 @@
file(GLOB_RECURSE SAK_MODBUSSTUDIO_SOURCES "${CMAKE_SOURCE_DIR}/src/modbusstudio/*.h" file(GLOB_RECURSE SAK_MODBUSSTUDIO_SOURCES "${CMAKE_SOURCE_DIR}/Source/ModbusStudio/*.h"
"${CMAKE_SOURCE_DIR}/src/modbusstudio/*.cc" "${CMAKE_SOURCE_DIR}/src/modbusstudio/*.ui") "${CMAKE_SOURCE_DIR}/Source/ModbusStudio/*.cc" "${CMAKE_SOURCE_DIR}/Source/ModbusStudio/*.ui")
set(SAK_COMMON_SOURCES set(SAK_COMMON_SOURCES
${STUDIO_SOURCES} ${STUDIO_SOURCES}
${CMAKE_SOURCE_DIR}/src/common/common/saksettings.h ${CMAKE_SOURCE_DIR}/Source/Common/Common/xToolsSettings.h
${CMAKE_SOURCE_DIR}/src/common/common/saksettings.cc ${CMAKE_SOURCE_DIR}/Source/Common/Common/xToolsSettings.cpp
${CMAKE_SOURCE_DIR}/src/common/common/sakinterface.h ${CMAKE_SOURCE_DIR}/Source/Common/Common/xToolsInterface.h
${CMAKE_SOURCE_DIR}/src/common/common/sakinterface.cc ${CMAKE_SOURCE_DIR}/Source/Common/Common/xToolsInterface.cpp
${CMAKE_SOURCE_DIR}/src/common/common/saktranslator.h ${CMAKE_SOURCE_DIR}/Source/Common/Common/xToolsTranslator.h
${CMAKE_SOURCE_DIR}/src/common/common/saktranslator.cc ${CMAKE_SOURCE_DIR}/Source/Common/Common/xToolsTranslator.cpp
${CMAKE_SOURCE_DIR}/src/common/commonui/sakui.h ${CMAKE_SOURCE_DIR}/Source/Common/Commonui/xToolsUi.h
${CMAKE_SOURCE_DIR}/src/common/commonui/sakcommonmainwindow.h ${CMAKE_SOURCE_DIR}/Source/Common/Commonui/xToolsMainWindow.h
${CMAKE_SOURCE_DIR}/src/common/commonui/sakcommonmainwindow.cc ${CMAKE_SOURCE_DIR}/Source/Common/Commonui/xToolsMainWindow.cpp
${CMAKE_SOURCE_DIR}/qtswissarmyknife.qrc) ${CMAKE_SOURCE_DIR}/xTools.qrc)
set(SAK_MODBUSSTUDIO_SOURCES ${SAK_MODBUSSTUDIO_SOURCES} ${SAK_COMMON_SOURCES}) set(SAK_MODBUSSTUDIO_SOURCES ${SAK_MODBUSSTUDIO_SOURCES} ${SAK_COMMON_SOURCES})
sak_add_executable("ModbusStudio" ${SAK_MODBUSSTUDIO_SOURCES}) sak_add_executable("ModbusStudio" ${SAK_MODBUSSTUDIO_SOURCES})
sak_set_target_properties(ModbusStudio) sak_set_target_properties(ModbusStudio)
sak_auto_execute_windeployqt(ModbusStudio) sak_auto_execute_windeployqt(ModbusStudio)
sak_3rd_setup_glog(ModbusStudio) x_tools_3rd_setup_glog(ModbusStudio)
target_link_libraries( target_link_libraries(
ModbusStudio PRIVATE Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::SerialBus 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. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#include "sakmodbusui.h" #include "sakmodbusui.h"
#include "sakui.h" #include "xToolsUi.h"
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
const QString appName = QObject::tr("Modbus Studio"); 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. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#include <QCoreApplication> #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. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#ifndef SAKMODBUSFACTORY_H #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. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#include "sakmodbusui.h" #include "sakmodbusui.h"
#include "ui_sakmodbusui.h"
#include <QAbstractSocket> #include <QAbstractSocket>
#include <QCheckBox> #include <QCheckBox>
@ -39,8 +40,7 @@
#endif #endif
#include "sakmodbusfactory.h" #include "sakmodbusfactory.h"
#include "saksettings.h" #include "xToolsSettings.h"
#include "ui_sakmodbusui.h"
#define RXCOLOR "green" #define RXCOLOR "green"
#define TXCOLOR "blue" #define TXCOLOR "blue"
@ -105,7 +105,7 @@ SAKModbusUi::SAKModbusUi(QWidget *parent)
, key_ctx_(new SAKModbusUiSettingKeys) , key_ctx_(new SAKModbusUiSettingKeys)
{ {
if (!settings_) { if (!settings_) {
settings_ = SAKSettings::instance(); settings_ = xToolsSettings::instance();
} }
ui->setupUi(this); 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. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#ifndef SAKMODBUSUI_H #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. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#include <QBluetoothDeviceInfo> #include <QBluetoothDeviceInfo>
@ -14,7 +14,7 @@
#define BLE_ERR_SIG QLowEnergyController::Error #define BLE_ERR_SIG QLowEnergyController::Error
SAKBleCentralTool::SAKBleCentralTool(QObject *parent) SAKBleCentralTool::SAKBleCentralTool(QObject *parent)
: SAKCommunicationTool(parent) : xToolsCommunicationTool(parent)
{} {}
SAKBleCentralTool::~SAKBleCentralTool() {} 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. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#ifndef EDBLECENTRAL_HH #ifndef EDBLECENTRAL_HH
@ -15,9 +15,9 @@
#include <QLowEnergyService> #include <QLowEnergyService>
#include <QVariantList> #include <QVariantList>
#include "sakcommunicationtool.h" #include "xToolsCommunicationTool.h"
class SAKBleCentralTool : public SAKCommunicationTool class SAKBleCentralTool : public xToolsCommunicationTool
{ {
Q_OBJECT Q_OBJECT
// clang-format off // 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. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#include "sakblecentraltoolui.h" #include "sakblecentraltoolui.h"
#include "ui_sakblecentraltoolui.h"
#include <QGridLayout> #include <QGridLayout>
#include <QLabel> #include <QLabel>
@ -15,14 +16,13 @@
#include <QWidget> #include <QWidget>
#include <QWidgetAction> #include <QWidgetAction>
#include "saklineedit.h" #include "xToolsLineEdit.h"
#include "sakspinbox.h" #include "xToolsSpinBox.h"
#include "ui_sakblecentraltoolui.h"
#define SAK_CB_I_C &QComboBox::currentIndexChanged #define SAK_CB_I_C &QComboBox::currentIndexChanged
SAKBleCentralToolUi::SAKBleCentralToolUi(QWidget* parent) SAKBleCentralToolUi::SAKBleCentralToolUi(QWidget* parent)
: SAKCommunicationToolUi{parent} : xToolsCommunicationToolUi{parent}
, ui(new Ui::SAKBleCentralToolUi) , ui(new Ui::SAKBleCentralToolUi)
, mBleTool(Q_NULLPTR) , mBleTool(Q_NULLPTR)
{ {
@ -78,9 +78,9 @@ SAKBleCentralToolUi::~SAKBleCentralToolUi()
delete ui; 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); mBleTool = qobject_cast<SAKBleCentralTool*>(mTool);
if (!mBleTool) { if (!mBleTool) {
@ -114,7 +114,7 @@ void SAKBleCentralToolUi::initSettingsMenu(const QString& settingsGroup)
int rowIndex = 0; int rowIndex = 0;
gl->addWidget(new QLabel(tr("Timeout interval(S)"), w), rowIndex, 0, 1, 1); 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->setMinimum(10);
sp->setMaximum(120); sp->setMaximum(120);
sp->setValue(120); sp->setValue(120);
@ -131,10 +131,10 @@ void SAKBleCentralToolUi::initSettingsMenu(const QString& settingsGroup)
rowIndex += 1; rowIndex += 1;
gl->addWidget(new QLabel(tr("Name filtter"), w), rowIndex, 0, 1, 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"); le->setGroupKey(settingsGroup, "nameFiltter");
gl->addWidget(le, rowIndex, 1, 1, 1); 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); 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. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#ifndef SAKBLECENTRALTOOLUI_H #ifndef SAKBLECENTRALTOOLUI_H
@ -12,12 +12,12 @@
#include <QLowEnergyDescriptor> #include <QLowEnergyDescriptor>
#include "sakblecentraltool.h" #include "sakblecentraltool.h"
#include "sakcommunicationtoolui.h" #include "xToolsCommunicationToolUi.h"
namespace Ui { namespace Ui {
class SAKBleCentralToolUi; class SAKBleCentralToolUi;
} }
class SAKBleCentralToolUi : public SAKCommunicationToolUi class SAKBleCentralToolUi : public xToolsCommunicationToolUi
{ {
Q_OBJECT Q_OBJECT
public: public:
@ -25,7 +25,8 @@ public:
~SAKBleCentralToolUi(); ~SAKBleCentralToolUi();
protected: 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; 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. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#include "sakblescanner.h" #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. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#ifndef SAKBLESCANNER_H #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. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#include "sakbluetoothdeviceInfocombobox.h" #include "sakbluetoothdeviceInfocombobox.h"
@ -12,7 +12,7 @@
#include <QMessageBox> #include <QMessageBox>
SAKBluetoothDeviceInfoComboBox::SAKBluetoothDeviceInfoComboBox(QWidget* parent) SAKBluetoothDeviceInfoComboBox::SAKBluetoothDeviceInfoComboBox(QWidget* parent)
: SAKComboBox(parent) : xToolsComboBox(parent)
, mScanner(Q_NULLPTR) , mScanner(Q_NULLPTR)
{ {
#if 0 #if 0
@ -72,7 +72,7 @@ void SAKBluetoothDeviceInfoComboBox::setNameFiltter(const QString& filtter)
void SAKBluetoothDeviceInfoComboBox::changeEvent(QEvent* event) void SAKBluetoothDeviceInfoComboBox::changeEvent(QEvent* event)
{ {
SAKComboBox::changeEvent(event); xToolsComboBox::changeEvent(event);
if ((event->type() == QEvent::EnabledChange) && isEnabled()) { if ((event->type() == QEvent::EnabledChange) && isEnabled()) {
onFinished(); 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. * code directory.
**************************************************************************************************/ **************************************************************************************************/
#ifndef SAKBLUETOOTHDEVICEINFOCOMBOBOX_H #ifndef SAKBLUETOOTHDEVICEINFOCOMBOBOX_H
@ -12,9 +12,9 @@
#include <QEvent> #include <QEvent>
#include "sakblescanner.h" #include "sakblescanner.h"
#include "sakcombobox.h" #include "xToolsComboBox.h"
class SAKBluetoothDeviceInfoComboBox : public SAKComboBox class SAKBluetoothDeviceInfoComboBox : public xToolsComboBox
{ {
Q_OBJECT Q_OBJECT
public: public:

View File

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

View File

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

View File

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

View File

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