Compare commits
12 Commits
Author | SHA1 | Date |
---|---|---|
|
f0383879ed | |
|
b528d2e3e4 | |
|
fbe3aa7cef | |
|
ce2c96deca | |
|
a93db498b8 | |
|
b2b3956dea | |
|
d71f5b963c | |
|
1bb01e1e60 | |
|
491961daf1 | |
|
66f1221943 | |
|
b5a0aa63a4 | |
|
2e7dc7d857 |
|
@ -57,7 +57,7 @@ jobs:
|
||||||
# 拷贝依赖
|
# 拷贝依赖
|
||||||
sudo macdeployqt /Users/runner/work/ProtocolParser/ProtocolParser/build/app/release/${targetName}.app -qmldir=. -verbose=1 -dmg
|
sudo macdeployqt /Users/runner/work/ProtocolParser/ProtocolParser/build/app/release/${targetName}.app -qmldir=. -verbose=1 -dmg
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}_shared.zip
|
name: ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}_shared.zip
|
||||||
path: /Users/runner/work/ProtocolParser/ProtocolParser/build/app/release/${{ env.targetName }}.dmg
|
path: /Users/runner/work/ProtocolParser/ProtocolParser/build/app/release/${{ env.targetName }}.dmg
|
||||||
|
|
|
@ -57,7 +57,7 @@ jobs:
|
||||||
# 拷贝依赖
|
# 拷贝依赖
|
||||||
macdeployqt /Users/runner/work/ProtocolParser/ProtocolParser/build/app/release/${targetName}.app -qmldir=. -verbose=1 -dmg
|
macdeployqt /Users/runner/work/ProtocolParser/ProtocolParser/build/app/release/${targetName}.app -qmldir=. -verbose=1 -dmg
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}_static.zip
|
name: ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}_static.zip
|
||||||
path: /Users/runner/work/ProtocolParser/ProtocolParser/build/app/release/${{ env.targetName }}.dmg
|
path: /Users/runner/work/ProtocolParser/ProtocolParser/build/app/release/${{ env.targetName }}.dmg
|
||||||
|
|
|
@ -74,7 +74,7 @@ jobs:
|
||||||
linuxdeploy-x86_64.AppImage --plugin=qt --output=appimage --create-desktop-file --icon-file=${targetName}.svg --executable=/home/runner/work/ProtocolParser/ProtocolParser/build/app/release/${targetName} --appdir /home/runner/work/ProtocolParser/ProtocolParser/build/app/release/
|
linuxdeploy-x86_64.AppImage --plugin=qt --output=appimage --create-desktop-file --icon-file=${targetName}.svg --executable=/home/runner/work/ProtocolParser/ProtocolParser/build/app/release/${targetName} --appdir /home/runner/work/ProtocolParser/ProtocolParser/build/app/release/
|
||||||
mv ${{ env.targetName }}-*.AppImage ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}_shared.AppImage
|
mv ${{ env.targetName }}-*.AppImage ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}_shared.AppImage
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}_shared
|
name: ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}_shared
|
||||||
path: ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}_shared.AppImage
|
path: ${{ env.targetName }}_${{ matrix.os }}_${{matrix.qt_ver}}_shared.AppImage
|
||||||
|
|
|
@ -74,7 +74,7 @@ jobs:
|
||||||
linuxdeploy-x86_64.AppImage --plugin=qt --output=appimage --create-desktop-file --icon-file=${targetName}.svg --executable=/home/runner/work/ProtocolParser/ProtocolParser/build/app/release/${targetName} --appdir /home/runner/work/ProtocolParser/ProtocolParser/build/app/release/
|
linuxdeploy-x86_64.AppImage --plugin=qt --output=appimage --create-desktop-file --icon-file=${targetName}.svg --executable=/home/runner/work/ProtocolParser/ProtocolParser/build/app/release/${targetName} --appdir /home/runner/work/ProtocolParser/ProtocolParser/build/app/release/
|
||||||
mv ${{ env.targetName }}-*.AppImage ${{ env.targetName }}_${{ matrix.os }}_Qt${{ matrix.qt_ver }}_static.AppImage
|
mv ${{ env.targetName }}-*.AppImage ${{ env.targetName }}_${{ matrix.os }}_Qt${{ matrix.qt_ver }}_static.AppImage
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ env.targetName }}_${{ matrix.os }}_Qt${{ matrix.qt_ver }}_static
|
name: ${{ env.targetName }}_${{ matrix.os }}_Qt${{ matrix.qt_ver }}_static
|
||||||
path: ${{ env.targetName }}_${{ matrix.os }}_Qt${{ matrix.qt_ver }}_static.AppImage
|
path: ${{ env.targetName }}_${{ matrix.os }}_Qt${{ matrix.qt_ver }}_static.AppImage
|
||||||
|
|
|
@ -74,7 +74,7 @@ jobs:
|
||||||
$name = ${env:archiveName}
|
$name = ${env:archiveName}
|
||||||
echo "packageName=$name" >> $env:GITHUB_OUTPUT
|
echo "packageName=$name" >> $env:GITHUB_OUTPUT
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ steps.package.outputs.packageName }}
|
name: ${{ steps.package.outputs.packageName }}
|
||||||
path: ${{ steps.package.outputs.packageName }}
|
path: ${{ steps.package.outputs.packageName }}
|
||||||
|
|
|
@ -74,7 +74,7 @@ jobs:
|
||||||
$name = ${env:archiveName}
|
$name = ${env:archiveName}
|
||||||
echo "packageName=$name" >> $env:GITHUB_OUTPUT
|
echo "packageName=$name" >> $env:GITHUB_OUTPUT
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ steps.package.outputs.packageName }}
|
name: ${{ steps.package.outputs.packageName }}
|
||||||
path: ${{ steps.package.outputs.packageName }}
|
path: ${{ steps.package.outputs.packageName }}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit c8d7d6d4689b422bdbe7cf1ef0cdcaf2948aeee6
|
Subproject commit 87c11a384af7ea474246780c98b221ef28a69a18
|
|
@ -1,8 +1,7 @@
|
||||||
cmake_minimum_required(VERSION 3.20)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
|
|
||||||
project(ProtocolParser_APP VERSION 1.0.4 LANGUAGES CXX)
|
project(ProtocolParser_APP VERSION 1.0.5 LANGUAGES CXX)
|
||||||
|
|
||||||
set(RIBBONUI_BUILD_FRAMELESSHEPLER ON)
|
|
||||||
set(RIBBONUI_BUILD_EXAMPLES OFF)
|
set(RIBBONUI_BUILD_EXAMPLES OFF)
|
||||||
add_subdirectory(3rdparty/RibbonUI)
|
add_subdirectory(3rdparty/RibbonUI)
|
||||||
add_subdirectory(app_source)
|
add_subdirectory(app_source)
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<div align="center">
|
<div align="center">
|
||||||
<img src="app_source/resources/imgs/icon.png" alt="Logo" style="width:40%; height:auto;">
|
<img src="app_source/resources/imgs/icon.png" alt="Logo" style="width:40%; height:auto;">
|
||||||
</div>
|
</div>
|
||||||
<h1 align="center"> ProtocolParser 协议解析器 V1.0.4</h1>
|
<h1 align="center"> ProtocolParser 协议解析器 V1.0.5</h1>
|
||||||
|
|
||||||
## 一、介绍
|
## 一、介绍
|
||||||
这是一个用于与DKY的THM3682实验箱搭配使用的上位机协议解析器,具体如何使用请看[使用说明](#使用说明)。
|
这是一个用于与DKY的THM3682实验箱搭配使用的上位机协议解析器,具体如何使用请看[使用说明](#使用说明)。
|
||||||
|
|
|
@ -0,0 +1,45 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
|
<string>6.0</string>
|
||||||
|
<key>CFBundlePackageType</key>
|
||||||
|
<string>APPL</string>
|
||||||
|
|
||||||
|
<key>CFBundleName</key>
|
||||||
|
<string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
|
||||||
|
<key>CFBundleIdentifier</key>
|
||||||
|
<string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
|
||||||
|
<key>CFBundleExecutable</key>
|
||||||
|
<string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
|
||||||
|
|
||||||
|
<key>CFBundleVersion</key>
|
||||||
|
<string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
|
||||||
|
<key>CFBundleShortVersionString</key>
|
||||||
|
<string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
|
||||||
|
|
||||||
|
<key>LSMinimumSystemVersion</key>
|
||||||
|
<string>${CMAKE_OSX_DEPLOYMENT_TARGET}</string>
|
||||||
|
|
||||||
|
<key>NSHumanReadableCopyright</key>
|
||||||
|
<string>${MACOSX_BUNDLE_COPYRIGHT}</string>
|
||||||
|
|
||||||
|
<key>CFBundleIconFile</key>
|
||||||
|
<string>${MACOSX_BUNDLE_ICON_FILE}</string>
|
||||||
|
|
||||||
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
|
<string>${MACOSX_BUNDLE_DEVELOPMENT_REGION}</string>
|
||||||
|
<key>CFBundleAllowMixedLocalizations</key>
|
||||||
|
<true/>
|
||||||
|
|
||||||
|
<key>NSHighResolutionCapable</key>
|
||||||
|
<true/>
|
||||||
|
|
||||||
|
<key>NSPrincipalClass</key>
|
||||||
|
<string>NSApplication</string>
|
||||||
|
|
||||||
|
<key>NSSupportsAutomaticGraphicsSwitching</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
|
@ -0,0 +1,37 @@
|
||||||
|
#include <windows.h>
|
||||||
|
|
||||||
|
IDI_ICON1 ICON "${PROJECT_SOURCE_DIR}/resources/imgs/icon.ico"
|
||||||
|
|
||||||
|
VS_VERSION_INFO VERSIONINFO
|
||||||
|
FILEVERSION ${version_str}
|
||||||
|
PRODUCTVERSION ${version_str}
|
||||||
|
FILEFLAGSMASK 0x3fL
|
||||||
|
#ifdef _DEBUG
|
||||||
|
FILEFLAGS VS_FF_DEBUG
|
||||||
|
#else
|
||||||
|
FILEFLAGS 0x0L
|
||||||
|
#endif
|
||||||
|
FILEOS VOS_NT_WINDOWS32
|
||||||
|
FILETYPE VFT_APP
|
||||||
|
FILESUBTYPE VFT2_UNKNOWN
|
||||||
|
BEGIN
|
||||||
|
BLOCK "StringFileInfo"
|
||||||
|
BEGIN
|
||||||
|
BLOCK "040904b0"
|
||||||
|
BEGIN
|
||||||
|
VALUE "Comments", "Made by Mentalflow."
|
||||||
|
VALUE "CompanyName", "${PROJECT_COMPANY}"
|
||||||
|
VALUE "FileDescription", "${PROJECT_COPYRIGHT}"
|
||||||
|
VALUE "FileVersion", "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}"
|
||||||
|
VALUE "InternalName", "${PROJECT_BUNDLE_NAME}.exe"
|
||||||
|
VALUE "LegalCopyright", "${PROJECT_COPYRIGHT}"
|
||||||
|
VALUE "OriginalFilename", "${PROJECT_BUNDLE_NAME}.exe"
|
||||||
|
VALUE "ProductName", "${PROJECT_BUNDLE_NAME}"
|
||||||
|
VALUE "ProductVersion", "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}"
|
||||||
|
END
|
||||||
|
END
|
||||||
|
BLOCK "VarFileInfo"
|
||||||
|
BEGIN
|
||||||
|
VALUE "Translation", 0x409, 1200
|
||||||
|
END
|
||||||
|
END
|
|
@ -20,8 +20,9 @@ endif()
|
||||||
|
|
||||||
set(QML_IMPORT_PATH ${CMAKE_BINARY_DIR}/app_source CACHE STRING "Qt Creator extra QML import paths" FORCE)
|
set(QML_IMPORT_PATH ${CMAKE_BINARY_DIR}/app_source CACHE STRING "Qt Creator extra QML import paths" FORCE)
|
||||||
|
|
||||||
|
string(TIMESTAMP TIME_YEAR %Y)
|
||||||
set(PROJECT_COMPANY "Mentalflow's Lab")
|
set(PROJECT_COMPANY "Mentalflow's Lab")
|
||||||
set(PROJECT_COPYRIGHT "Copyright (c) 2023 Mentalflow's Lab. All rights reserved.")
|
set(PROJECT_COPYRIGHT "Copyright (c) ${TIME_YEAR} Mentalflow's Lab. All rights reserved.")
|
||||||
set(PROJECT_DOMAIN "dev.ourdocs.cn.protocolparser")
|
set(PROJECT_DOMAIN "dev.ourdocs.cn.protocolparser")
|
||||||
set(PROJECT_BUNDLE_NAME ${PROJECT_NAME})
|
set(PROJECT_BUNDLE_NAME ${PROJECT_NAME})
|
||||||
set(version_str "${CMAKE_PROJECT_VERSION_MAJOR},${CMAKE_PROJECT_VERSION_MINOR},${CMAKE_PROJECT_VERSION_PATCH}")
|
set(version_str "${CMAKE_PROJECT_VERSION_MAJOR},${CMAKE_PROJECT_VERSION_MINOR},${CMAKE_PROJECT_VERSION_PATCH}")
|
||||||
|
@ -43,13 +44,12 @@ set(
|
||||||
)
|
)
|
||||||
|
|
||||||
set(
|
set(
|
||||||
qml_files qml/Main.qml qml/components/RibbonWindow.qml qml/components/ZigBeeFrame.qml
|
qml_files qml/Main.qml qml/components/ZigBeeFrame.qml
|
||||||
qml/components/RibbonMessageListView.qml qml/components/RibbonMessage.qml
|
|
||||||
qml/components/ZigBeeMessage.qml qml/components/SerialPortAssistant.qml
|
qml/components/ZigBeeMessage.qml qml/components/SerialPortAssistant.qml
|
||||||
qml/components/ZigBeeDataView.qml qml/components/TabBar.qml qml/components/CenterView.qml
|
qml/components/ZigBeeDataView.qml qml/components/TabBar.qml qml/components/CenterView.qml
|
||||||
qml/components/ListTable.qml qml/components/DeviceList.qml qml/components/KeysList.qml
|
qml/components/ListTable.qml qml/components/DeviceList.qml qml/components/KeysList.qml
|
||||||
qml/components/EventsHistoryList.qml qml/components/FrameChooser.qml qml/components/RibbonMarkDownViewer.qml
|
qml/components/EventsHistoryList.qml qml/components/FrameChooser.qml qml/components/RibbonMarkDownViewer.qml
|
||||||
qml/components/HelpView.qml
|
qml/HelperWindow.qml
|
||||||
)
|
)
|
||||||
|
|
||||||
set(js_files js/markdown-it.js js/markdown-it-deflist.js js/markdown-it-emoji.js
|
set(js_files js/markdown-it.js js/markdown-it-deflist.js js/markdown-it-emoji.js
|
||||||
|
@ -64,7 +64,7 @@ set(doc_files ${CMAKE_SOURCE_DIR}/README.md ${CMAKE_SOURCE_DIR}/documents/protoc
|
||||||
${CMAKE_SOURCE_DIR}/documents/pictures/home-light.png ${CMAKE_SOURCE_DIR}/app_source/resources/imgs/icon.png
|
${CMAKE_SOURCE_DIR}/documents/pictures/home-light.png ${CMAKE_SOURCE_DIR}/app_source/resources/imgs/icon.png
|
||||||
)
|
)
|
||||||
|
|
||||||
INCLUDE_DIRECTORIES(dlln3x include)
|
include_directories(dlln3x include)
|
||||||
add_subdirectory(sm_crypto)
|
add_subdirectory(sm_crypto)
|
||||||
|
|
||||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
|
@ -74,27 +74,37 @@ else()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
set(app_icon_resource_windows resources/icon.rc)
|
configure_file(.cmake/win_app.rc.in ${CMAKE_BINARY_DIR}/win_app.rc)
|
||||||
|
set(app_icon_resource_windows ${CMAKE_BINARY_DIR}/win_app.rc)
|
||||||
qt_add_executable(${PROJECT_NAME}
|
qt_add_executable(${PROJECT_NAME}
|
||||||
${sources_files}
|
${sources_files}
|
||||||
resources/icon.rc
|
${app_icon_resource_windows}
|
||||||
|
)
|
||||||
|
file(TO_CMAKE_PATH "/" PATH_SEPARATOR)
|
||||||
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||||
|
set(DLLPATH ${CMAKE_SOURCE_DIR}/3rdparty/msvc/*.dll)
|
||||||
|
else()
|
||||||
|
set(DLLPATH ${CMAKE_SOURCE_DIR}/3rdparty/mingw/*.dll)
|
||||||
|
endif()
|
||||||
|
string(REPLACE "/" ${PATH_SEPARATOR} DLLPATH "${DLLPATH}")
|
||||||
|
file(GLOB DLL_FILES ${DLLPATH})
|
||||||
|
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy
|
||||||
|
${DLL_FILES}
|
||||||
|
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
||||||
)
|
)
|
||||||
file(TO_CMAKE_PATH "/" PATH_SEPARATOR)
|
|
||||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
|
||||||
set(DLLPATH ../3rdparty/msvc/*.dll)
|
|
||||||
else()
|
|
||||||
set(DLLPATH ../3rdparty/mingw/*.dll)
|
|
||||||
endif()
|
|
||||||
string(REPLACE "/" ${PATH_SEPARATOR} DLLPATH "${DLLPATH}")
|
|
||||||
file(GLOB DLL_FILES ${DLLPATH})
|
|
||||||
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy
|
|
||||||
${DLL_FILES}
|
|
||||||
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
|
|
||||||
)
|
|
||||||
elseif(APPLE)
|
elseif(APPLE)
|
||||||
|
set(MACOSX_BUNDLE_GUI_IDENTIFIER ${PROJECT_DOMAIN})
|
||||||
|
set(MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION})
|
||||||
|
set(MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR})
|
||||||
|
set(MACOSX_BUNDLE_BUNDLE_NAME ${PROJECT_BUNDLE_NAME})
|
||||||
|
set(MACOSX_BUNDLE_COPYRIGHT ${PROJECT_COPYRIGHT})
|
||||||
|
set(MACOSX_BUNDLE_DEVELOPMENT_REGION "Chinese")
|
||||||
|
set(CMAKE_OSX_DEPLOYMENT_TARGET "11.0" CACHE STRING "Minimum OS X deployment version" FORCE)
|
||||||
|
set(MACOSX_BUNDLE_EXECUTABLE_NAME ${PROJECT_BUNDLE_NAME})
|
||||||
set(MACOSX_BUNDLE_ICON_FILE AppIcon)
|
set(MACOSX_BUNDLE_ICON_FILE AppIcon)
|
||||||
set(App_ICON "resources/imgs/AppIcon.icns")
|
configure_file(.cmake/MacOSXBundleInfo.plist.in ${CMAKE_BINARY_DIR}/Info.plist)
|
||||||
|
set(App_ICON "${PROJECT_SOURCE_DIR}/resources/imgs/AppIcon.icns")
|
||||||
set_source_files_properties(${App_ICON} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
|
set_source_files_properties(${App_ICON} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
|
||||||
qt_add_executable(${PROJECT_NAME}
|
qt_add_executable(${PROJECT_NAME}
|
||||||
${sources_files}
|
${sources_files}
|
||||||
|
@ -131,11 +141,7 @@ qt_add_qml_module(${PROJECT_NAME}
|
||||||
)
|
)
|
||||||
|
|
||||||
set_target_properties(${PROJECT_NAME} PROPERTIES
|
set_target_properties(${PROJECT_NAME} PROPERTIES
|
||||||
MACOSX_BUNDLE_GUI_IDENTIFIER ${PROJECT_DOMAIN}
|
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_BINARY_DIR}/Info.plist
|
||||||
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
|
|
||||||
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
|
|
||||||
MACOSX_BUNDLE_BUNDLE_NAME ${PROJECT_BUNDLE_NAME}
|
|
||||||
MACOSX_BUNDLE_COPYRIGHT ${PROJECT_COPYRIGHT}
|
|
||||||
MACOSX_BUNDLE TRUE
|
MACOSX_BUNDLE TRUE
|
||||||
WIN32_EXECUTABLE TRUE
|
WIN32_EXECUTABLE TRUE
|
||||||
OUTPUT_NAME ${PROJECT_BUNDLE_NAME}
|
OUTPUT_NAME ${PROJECT_BUNDLE_NAME}
|
||||||
|
@ -147,31 +153,42 @@ qt_add_translations(${PROJECT_NAME}
|
||||||
)
|
)
|
||||||
|
|
||||||
if(RIBBONUI_BUILD_STATIC_LIB)
|
if(RIBBONUI_BUILD_STATIC_LIB)
|
||||||
add_definitions(-DRIBBONUI_BUILD_STATIC_LIB)
|
|
||||||
target_link_libraries(${PROJECT_NAME} PRIVATE
|
target_link_libraries(${PROJECT_NAME} PRIVATE
|
||||||
Qt::Quick
|
|
||||||
Qt::SerialPort
|
|
||||||
Qt::WebView
|
|
||||||
Qt::Core5Compat
|
|
||||||
RibbonUIplugin
|
RibbonUIplugin
|
||||||
sm_crypto
|
|
||||||
FramelessHelper::Core
|
|
||||||
FramelessHelper::Quick
|
|
||||||
)
|
)
|
||||||
|
target_compile_definitions(${PROJECT_NAME} PRIVATE
|
||||||
|
RIBBONUI_BUILD_STATIC_LIB
|
||||||
|
)
|
||||||
else()
|
else()
|
||||||
target_link_libraries(${PROJECT_NAME} PRIVATE
|
if(WIN32)
|
||||||
Qt::Quick
|
if (MINGW)
|
||||||
Qt::SerialPort
|
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
|
||||||
Qt::WebView
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||||
Qt::Core5Compat
|
"${RIBBONUI_QML_PLUGIN_DIRECTORY}/RibbonUI.dll"
|
||||||
RibbonUI
|
${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
|
||||||
sm_crypto
|
else()
|
||||||
FramelessHelper::Core
|
if (NOT RIBBONUI_BUILD_STATIC_LIB)
|
||||||
FramelessHelper::Quick
|
if (CMAKE_BUILD_TYPE MATCHES "Debug")
|
||||||
)
|
set(DEBUG_POSTFIX "d")
|
||||||
|
endif()
|
||||||
|
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||||
|
"${RIBBONUI_QML_PLUGIN_DIRECTORY}/RibbonUI${DEBUG_POSTFIX}.dll"
|
||||||
|
${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
target_link_libraries(${PROJECT_NAME} PRIVATE
|
||||||
|
Qt::Quick
|
||||||
|
Qt::SerialPort
|
||||||
|
Qt::WebView
|
||||||
|
Qt::Core5Compat
|
||||||
|
RibbonUI
|
||||||
|
sm_crypto
|
||||||
|
)
|
||||||
|
|
||||||
add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}_lupdate)
|
add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}_lupdate)
|
||||||
add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}_lrelease)
|
add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}_lrelease)
|
||||||
target_compile_definitions(${PROJECT_NAME} PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
|
target_compile_definitions(${PROJECT_NAME} PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
|
||||||
|
|
|
@ -5,37 +5,24 @@ import RibbonUI
|
||||||
import ProtocolParser
|
import ProtocolParser
|
||||||
import "."
|
import "."
|
||||||
|
|
||||||
Item {
|
RibbonWindow {
|
||||||
id:root
|
id: root
|
||||||
implicitHeight: 550
|
height: 550
|
||||||
implicitWidth: 550
|
width: 550
|
||||||
property string title: qsTr("帮助")
|
title_bar.show_darkmode_btn: false
|
||||||
|
title_bar.show_style_switch: false
|
||||||
|
title: qsTr("帮助")
|
||||||
Component.onCompleted: Tools.writeDirtoTempDir(":/qt/qml/ProtocolParser/")
|
Component.onCompleted: Tools.writeDirtoTempDir(":/qt/qml/ProtocolParser/")
|
||||||
|
|
||||||
RibbonButton{
|
|
||||||
anchors{
|
|
||||||
top:parent.top
|
|
||||||
margins: 4
|
|
||||||
right:parent.right
|
|
||||||
}
|
|
||||||
show_bg: false
|
|
||||||
show_hovered_bg: false
|
|
||||||
icon_source: RibbonIcons.Dismiss
|
|
||||||
onClicked: window_popup.close()
|
|
||||||
}
|
|
||||||
|
|
||||||
RibbonText{
|
|
||||||
anchors{
|
|
||||||
top:parent.top
|
|
||||||
topMargin: 10
|
|
||||||
horizontalCenter: parent.horizontalCenter
|
|
||||||
}
|
|
||||||
text: title
|
|
||||||
}
|
|
||||||
|
|
||||||
RibbonMarkDownViewer{
|
RibbonMarkDownViewer{
|
||||||
id: viewer
|
id: viewer
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
anchors{
|
||||||
|
topMargin: 10
|
||||||
|
leftMargin: anchors.topMargin
|
||||||
|
rightMargin: anchors.topMargin
|
||||||
|
bottomMargin: viewer.can_goback || viewer.can_goforward ? 30 : 10
|
||||||
|
}
|
||||||
file_name: 'qrc:/qt/qml/ProtocolParser/README.md'
|
file_name: 'qrc:/qt/qml/ProtocolParser/README.md'
|
||||||
base_url: 'qrc:/qt/qml/ProtocolParser/'
|
base_url: 'qrc:/qt/qml/ProtocolParser/'
|
||||||
resource_dir: Tools.baseDir
|
resource_dir: Tools.baseDir
|
||||||
|
@ -43,10 +30,11 @@ Item {
|
||||||
|
|
||||||
RibbonButton{
|
RibbonButton{
|
||||||
anchors{
|
anchors{
|
||||||
bottom: root.bottom
|
topMargin: 5
|
||||||
bottomMargin: 10
|
bottom: parent.bottom
|
||||||
left: root.left
|
bottomMargin: 5
|
||||||
leftMargin: 30
|
left: parent.left
|
||||||
|
leftMargin: viewer.anchors.leftMargin
|
||||||
}
|
}
|
||||||
show_bg: false
|
show_bg: false
|
||||||
show_hovered_bg: false
|
show_hovered_bg: false
|
||||||
|
@ -59,10 +47,11 @@ Item {
|
||||||
|
|
||||||
RibbonButton{
|
RibbonButton{
|
||||||
anchors{
|
anchors{
|
||||||
bottom: root.bottom
|
topMargin: 5
|
||||||
bottomMargin: 10
|
bottom: parent.bottom
|
||||||
right: root.right
|
bottomMargin: 5
|
||||||
rightMargin: 30
|
right: parent.right
|
||||||
|
rightMargin: viewer.anchors.rightMargin
|
||||||
}
|
}
|
||||||
show_bg: false
|
show_bg: false
|
||||||
show_hovered_bg: false
|
show_hovered_bg: false
|
|
@ -5,7 +5,6 @@ import QtQuick.Window
|
||||||
import RibbonUI
|
import RibbonUI
|
||||||
import ProtocolParser
|
import ProtocolParser
|
||||||
import org.wangwenx190.FramelessHelper
|
import org.wangwenx190.FramelessHelper
|
||||||
import "components"
|
|
||||||
|
|
||||||
RibbonWindow {
|
RibbonWindow {
|
||||||
id:root
|
id:root
|
||||||
|
@ -13,6 +12,7 @@ RibbonWindow {
|
||||||
minimumWidth: 1200
|
minimumWidth: 1200
|
||||||
height: 800
|
height: 800
|
||||||
minimumHeight: 800
|
minimumHeight: 800
|
||||||
|
comfirmed_quit: true
|
||||||
title: qsTr("Protocol Parser") + ` V${PPAPP_Version}`
|
title: qsTr("Protocol Parser") + ` V${PPAPP_Version}`
|
||||||
|
|
||||||
title_bar.right_content:RowLayout{
|
title_bar.right_content:RowLayout{
|
||||||
|
@ -28,20 +28,13 @@ RibbonWindow {
|
||||||
text_color: title_bar.title_text_color
|
text_color: title_bar.title_text_color
|
||||||
text_color_reverse: false
|
text_color_reverse: false
|
||||||
onClicked: {
|
onClicked: {
|
||||||
show_popup("components/HelpView.qml")
|
root.show_window("qrc:/qt/qml/ProtocolParser/HelperWindow.qml")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
TabBar{
|
|
||||||
id: tab_bar
|
|
||||||
center_view: center_view
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CenterView{
|
CenterView{
|
||||||
id: center_view
|
id: center_view
|
||||||
z:-2
|
|
||||||
anchors{
|
anchors{
|
||||||
top: parent.top
|
top: parent.top
|
||||||
bottom: parent.bottom
|
bottom: parent.bottom
|
||||||
|
@ -51,6 +44,11 @@ RibbonWindow {
|
||||||
bottom_bar: bottom_bar
|
bottom_bar: bottom_bar
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TabBar{
|
||||||
|
id: tab_bar
|
||||||
|
center_view: center_view
|
||||||
|
}
|
||||||
|
|
||||||
RibbonBottomBar{
|
RibbonBottomBar{
|
||||||
id: bottom_bar
|
id: bottom_bar
|
||||||
anchors{
|
anchors{
|
||||||
|
@ -63,33 +61,4 @@ RibbonWindow {
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
RibbonTheme.modern_style=true
|
RibbonTheme.modern_style=true
|
||||||
}
|
}
|
||||||
|
|
||||||
RibbonPopup{
|
|
||||||
id:window_popup
|
|
||||||
onClosed: window_popup.contentItem.destroy()
|
|
||||||
}
|
|
||||||
|
|
||||||
function show_popup(content_url, argument)
|
|
||||||
{
|
|
||||||
let component = Qt.createComponent(content_url,window_popup)
|
|
||||||
|
|
||||||
if (component.status === Component.Error) {
|
|
||||||
console.log(qsTr("Error loading component:"), component.errorString());
|
|
||||||
return
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (typeof(argument)!='undefined')
|
|
||||||
window_popup.contentItem = component.createObject(window_popup,argument)
|
|
||||||
else
|
|
||||||
window_popup.contentItem = component.createObject(window_popup)
|
|
||||||
}
|
|
||||||
window_popup.open()
|
|
||||||
}
|
|
||||||
|
|
||||||
function close_popup()
|
|
||||||
{
|
|
||||||
window_popup.close()
|
|
||||||
window_popup.contentItem.destroy()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,18 +86,6 @@ Item{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RibbonButton{
|
|
||||||
anchors{
|
|
||||||
top:parent.top
|
|
||||||
margins: 4
|
|
||||||
right:parent.right
|
|
||||||
}
|
|
||||||
show_bg: false
|
|
||||||
show_hovered_bg: false
|
|
||||||
icon_source: RibbonIcons.Dismiss
|
|
||||||
onClicked: window_popup.close()
|
|
||||||
}
|
|
||||||
|
|
||||||
ColumnLayout{
|
ColumnLayout{
|
||||||
id:list_layout
|
id:list_layout
|
||||||
anchors{
|
anchors{
|
||||||
|
|
|
@ -38,18 +38,6 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RibbonButton{
|
|
||||||
anchors{
|
|
||||||
top:parent.top
|
|
||||||
margins: 4
|
|
||||||
right:parent.right
|
|
||||||
}
|
|
||||||
show_bg: false
|
|
||||||
show_hovered_bg: false
|
|
||||||
icon_source: RibbonIcons.Dismiss
|
|
||||||
onClicked: window_popup.close()
|
|
||||||
}
|
|
||||||
|
|
||||||
ColumnLayout{
|
ColumnLayout{
|
||||||
id:list_layout
|
id:list_layout
|
||||||
anchors{
|
anchors{
|
||||||
|
|
|
@ -61,18 +61,6 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RibbonButton{
|
|
||||||
anchors{
|
|
||||||
top:parent.top
|
|
||||||
margins: 4
|
|
||||||
right:parent.right
|
|
||||||
}
|
|
||||||
show_bg: false
|
|
||||||
show_hovered_bg: false
|
|
||||||
icon_source: RibbonIcons.Dismiss
|
|
||||||
onClicked: window_popup.close()
|
|
||||||
}
|
|
||||||
|
|
||||||
ColumnLayout{
|
ColumnLayout{
|
||||||
id:layout
|
id:layout
|
||||||
anchors{
|
anchors{
|
||||||
|
|
|
@ -38,18 +38,6 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RibbonButton{
|
|
||||||
anchors{
|
|
||||||
top:parent.top
|
|
||||||
margins: 4
|
|
||||||
right:parent.right
|
|
||||||
}
|
|
||||||
show_bg: false
|
|
||||||
show_hovered_bg: false
|
|
||||||
icon_source: RibbonIcons.Dismiss
|
|
||||||
onClicked: window_popup.close()
|
|
||||||
}
|
|
||||||
|
|
||||||
ColumnLayout{
|
ColumnLayout{
|
||||||
id:list_layout
|
id:list_layout
|
||||||
anchors{
|
anchors{
|
||||||
|
|
|
@ -138,7 +138,7 @@ Item {
|
||||||
NumberAnimation { properties: "y"; from: list_table.height; duration: 200 }
|
NumberAnimation { properties: "y"; from: list_table.height; duration: 200 }
|
||||||
}
|
}
|
||||||
|
|
||||||
ScrollBar.vertical: ScrollBar {
|
ScrollBar.vertical: RibbonScrollBar {
|
||||||
anchors.right: list_table.right
|
anchors.right: list_table.right
|
||||||
anchors.rightMargin: 2
|
anchors.rightMargin: 2
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,13 +27,7 @@ Item {
|
||||||
|
|
||||||
WebView{
|
WebView{
|
||||||
id: viewer
|
id: viewer
|
||||||
anchors{
|
anchors.fill: parent
|
||||||
top: parent.top
|
|
||||||
left: parent.left
|
|
||||||
margins: 30
|
|
||||||
}
|
|
||||||
width: parent.width
|
|
||||||
height: parent.height
|
|
||||||
settings.allowFileAccess: true
|
settings.allowFileAccess: true
|
||||||
settings.localStorageEnabled: true
|
settings.localStorageEnabled: true
|
||||||
settings.javaScriptEnabled: true
|
settings.javaScriptEnabled: true
|
||||||
|
@ -54,8 +48,6 @@ Item {
|
||||||
}
|
}
|
||||||
else if (request.status === WebView.LoadSucceededStatus)
|
else if (request.status === WebView.LoadSucceededStatus)
|
||||||
{
|
{
|
||||||
viewer.width = parent.width - (anchors.margins * 2)
|
|
||||||
viewer.height = parent.height - (anchors.margins * 2)
|
|
||||||
viewer.runJavaScript(`document.body.scrollTop = ${viewer.pre_height};`)
|
viewer.runJavaScript(`document.body.scrollTop = ${viewer.pre_height};`)
|
||||||
get_height()
|
get_height()
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,55 +0,0 @@
|
||||||
import QtQuick
|
|
||||||
import QtQuick.Layouts
|
|
||||||
import QtQuick.Controls
|
|
||||||
import RibbonUI
|
|
||||||
|
|
||||||
Rectangle{
|
|
||||||
id: bubble
|
|
||||||
color: "transparent"
|
|
||||||
property double padding: 10
|
|
||||||
default property alias content: message_layout.data
|
|
||||||
property var data_model: model
|
|
||||||
property int font_size: 13
|
|
||||||
property string sender_text: "sender"
|
|
||||||
width: ListView.view.width
|
|
||||||
height: bubble_layout.height + padding*2
|
|
||||||
|
|
||||||
ColumnLayout{
|
|
||||||
id: bubble_layout
|
|
||||||
anchors{
|
|
||||||
top: parent.top
|
|
||||||
topMargin: parent.padding
|
|
||||||
}
|
|
||||||
layoutDirection: data_model.recieved ? Qt.LeftToRight : Qt.RightToLeft
|
|
||||||
Component.onCompleted: {
|
|
||||||
if (data_model.recieved)
|
|
||||||
{
|
|
||||||
anchors.left = parent.left
|
|
||||||
anchors.leftMargin = parent.padding
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
anchors.right = parent.right
|
|
||||||
anchors.rightMargin = parent.padding
|
|
||||||
}
|
|
||||||
}
|
|
||||||
RibbonText{
|
|
||||||
id: sender_text
|
|
||||||
text: bubble.sender_text
|
|
||||||
padding: bubble.padding
|
|
||||||
color: RibbonTheme.dark_mode ? "white" : "black"
|
|
||||||
}
|
|
||||||
RibbonRectangle{
|
|
||||||
id: bubble_bg
|
|
||||||
color: data_model.recieved ? RibbonTheme.dark_mode ? "#202020" : "#FFFFFF" : RibbonTheme.dark_mode ? "#272727" : "#4397F7"
|
|
||||||
height: message_layout.height + bubble.padding*2
|
|
||||||
width: message_layout.width + bubble.padding*2
|
|
||||||
radius: 10
|
|
||||||
topLeftRadius: data_model.recieved ? 2 : bubble.padding
|
|
||||||
topRightRadius: !data_model.recieved ? 2 : bubble.padding
|
|
||||||
ColumnLayout{
|
|
||||||
id: message_layout
|
|
||||||
anchors.centerIn: parent
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,64 +0,0 @@
|
||||||
import QtQuick
|
|
||||||
import QtQuick.Layouts
|
|
||||||
import QtQuick.Controls
|
|
||||||
import RibbonUI
|
|
||||||
|
|
||||||
RibbonView{
|
|
||||||
id: view
|
|
||||||
anchors{
|
|
||||||
top: parent.top
|
|
||||||
bottom: parent.bottom
|
|
||||||
}
|
|
||||||
spacing: 0
|
|
||||||
|
|
||||||
property int max_msg_num: 10
|
|
||||||
property bool auto_scroll_to_bottom: false
|
|
||||||
property int animation_time: 200
|
|
||||||
property alias delegate: message_list.delegate
|
|
||||||
property alias message_model: message_model
|
|
||||||
property alias view: message_list
|
|
||||||
|
|
||||||
ListModel{
|
|
||||||
id: message_model
|
|
||||||
onCountChanged: auto_scroll_btn_timer.restart()
|
|
||||||
}
|
|
||||||
|
|
||||||
Timer{
|
|
||||||
id: auto_scroll_btn_timer
|
|
||||||
interval: animation_time
|
|
||||||
repeat: false
|
|
||||||
onTriggered: {
|
|
||||||
if(view.auto_scroll_to_bottom)
|
|
||||||
view.scroll_to_bottom()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ListView{
|
|
||||||
id: message_list
|
|
||||||
cacheBuffer: message_list.height * 2
|
|
||||||
Layout.alignment: Qt.AlignHCenter
|
|
||||||
Layout.preferredHeight: parent.height
|
|
||||||
Layout.preferredWidth: parent.width
|
|
||||||
model: message_model
|
|
||||||
add: Transition {
|
|
||||||
NumberAnimation {
|
|
||||||
properties: "y"
|
|
||||||
from: message_list.height
|
|
||||||
duration: animation_time
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ScrollBar.vertical: ScrollBar {
|
|
||||||
anchors.right: message_list.right
|
|
||||||
anchors.rightMargin: 2
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function scroll_to_up(){
|
|
||||||
message_list.positionViewAtBeginning()
|
|
||||||
}
|
|
||||||
|
|
||||||
function scroll_to_bottom(){
|
|
||||||
message_list.positionViewAtEnd()
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,85 +0,0 @@
|
||||||
import QtQuick
|
|
||||||
import RibbonUI
|
|
||||||
import org.wangwenx190.FramelessHelper
|
|
||||||
|
|
||||||
Window {
|
|
||||||
id:window
|
|
||||||
default property alias content: container.data
|
|
||||||
property alias title_bar: titleBar
|
|
||||||
property alias popup: pop
|
|
||||||
property bool comfirmed_quit: false
|
|
||||||
visible: false
|
|
||||||
color: {
|
|
||||||
if (FramelessHelper.blurBehindWindowEnabled) {
|
|
||||||
return "transparent";
|
|
||||||
}
|
|
||||||
if (FramelessUtils.systemTheme === FramelessHelperConstants.Dark) {
|
|
||||||
return FramelessUtils.defaultSystemDarkColor;
|
|
||||||
}
|
|
||||||
return FramelessUtils.defaultSystemLightColor;
|
|
||||||
}
|
|
||||||
FramelessHelper.onReady: {
|
|
||||||
if (Qt.platform.os === 'windows')
|
|
||||||
{
|
|
||||||
FramelessHelper.setSystemButton(titleBar.minimizeBtn, FramelessHelperConstants.Minimize);
|
|
||||||
FramelessHelper.setSystemButton(titleBar.maximizeBtn, FramelessHelperConstants.Maximize);
|
|
||||||
FramelessHelper.setSystemButton(titleBar.closeBtn, FramelessHelperConstants.Close);
|
|
||||||
}
|
|
||||||
FramelessHelper.setHitTestVisible(titleBar.left_container)
|
|
||||||
FramelessHelper.setHitTestVisible(titleBar.right_container)
|
|
||||||
FramelessHelper.titleBarItem = titleBar;
|
|
||||||
FramelessHelper.moveWindowToDesktopCenter();
|
|
||||||
window.visible = true;
|
|
||||||
}
|
|
||||||
RibbonTitleBar {
|
|
||||||
id: titleBar
|
|
||||||
}
|
|
||||||
Item{
|
|
||||||
id:container
|
|
||||||
anchors{
|
|
||||||
top: titleBar.bottom
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
bottom: parent.bottom
|
|
||||||
}
|
|
||||||
clip: true
|
|
||||||
}
|
|
||||||
Connections{
|
|
||||||
target: RibbonTheme
|
|
||||||
function onTheme_modeChanged() {
|
|
||||||
if (RibbonTheme.dark_mode)
|
|
||||||
FramelessUtils.systemTheme = FramelessHelperConstants.Dark
|
|
||||||
else
|
|
||||||
FramelessUtils.systemTheme = FramelessHelperConstants.Light
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Rectangle{
|
|
||||||
z:99
|
|
||||||
anchors.fill: parent
|
|
||||||
color: !RibbonTheme.dark_mode ? Qt.rgba(255,255,255,0.3) : Qt.rgba(0,0,0,0.3)
|
|
||||||
visible: !Window.active
|
|
||||||
}
|
|
||||||
RibbonPopup{
|
|
||||||
id: pop
|
|
||||||
}
|
|
||||||
RibbonPopupDialog{
|
|
||||||
id: dialog
|
|
||||||
positiveText: qsTr("Quit")
|
|
||||||
neutralText: qsTr("Minimize")
|
|
||||||
negativeText: qsTr("Cancel")
|
|
||||||
message: qsTr("Do you want to quit the APP?")
|
|
||||||
title: qsTr("Please note")
|
|
||||||
buttonFlags: RibbonPopupDialogType.NegativeButton | RibbonPopupDialogType.PositiveButton | RibbonPopupDialogType.NeutralButton
|
|
||||||
onNeutralClicked: window.visibility = Window.Minimized
|
|
||||||
onPositiveClicked: {
|
|
||||||
comfirmed_quit = true
|
|
||||||
Qt.quit()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onClosing:function(event){
|
|
||||||
window.raise()
|
|
||||||
event.accepted = comfirmed_quit
|
|
||||||
if (!comfirmed_quit)
|
|
||||||
dialog.open()
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -242,7 +242,7 @@ RibbonTabBar {
|
||||||
text: qsTr("等待队列")
|
text: qsTr("等待队列")
|
||||||
show_tooltip: false
|
show_tooltip: false
|
||||||
onClicked: {
|
onClicked: {
|
||||||
show_popup("components/DeviceList.qml",{list_type:0})
|
Window.window.popup.show_content("qrc:/qt/qml/ProtocolParser/components/DeviceList.qml",{list_type:0})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
RibbonButton{
|
RibbonButton{
|
||||||
|
@ -251,7 +251,7 @@ RibbonTabBar {
|
||||||
text: qsTr("认证列表")
|
text: qsTr("认证列表")
|
||||||
show_tooltip: false
|
show_tooltip: false
|
||||||
onClicked: {
|
onClicked: {
|
||||||
show_popup("components/DeviceList.qml",{list_type:1})
|
Window.window.popup.show_content("qrc:/qt/qml/ProtocolParser/components/DeviceList.qml",{list_type:1})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
RibbonButton{
|
RibbonButton{
|
||||||
|
@ -260,7 +260,7 @@ RibbonTabBar {
|
||||||
text: qsTr("黑名单列表")
|
text: qsTr("黑名单列表")
|
||||||
show_tooltip: false
|
show_tooltip: false
|
||||||
onClicked: {
|
onClicked: {
|
||||||
show_popup("components/DeviceList.qml",{list_type:2})
|
Window.window.popup.show_content("qrc:/qt/qml/ProtocolParser/components/DeviceList.qml",{list_type:2})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -321,7 +321,7 @@ RibbonTabBar {
|
||||||
text: qsTr("历史密钥列表")
|
text: qsTr("历史密钥列表")
|
||||||
show_tooltip: false
|
show_tooltip: false
|
||||||
onClicked: {
|
onClicked: {
|
||||||
show_popup("components/KeysList.qml")
|
Window.window.popup.show_content("qrc:/qt/qml/ProtocolParser/components/KeysList.qml")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function key_format_validate(str) {
|
function key_format_validate(str) {
|
||||||
|
@ -393,7 +393,7 @@ RibbonTabBar {
|
||||||
text: qsTr("事件历史信息")
|
text: qsTr("事件历史信息")
|
||||||
tip_text: qsTr("查看所有事件历史信息(包含调试信息)")
|
tip_text: qsTr("查看所有事件历史信息(包含调试信息)")
|
||||||
onClicked: {
|
onClicked: {
|
||||||
show_popup("components/EventsHistoryList.qml")
|
Window.window.popup.show_content("qrc:/qt/qml/ProtocolParser/components/EventsHistoryList.qml")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -474,7 +474,7 @@ RibbonTabBar {
|
||||||
text: qsTr("自定义数据帧")
|
text: qsTr("自定义数据帧")
|
||||||
tip_text: qsTr("自定义传感器数据帧结构")
|
tip_text: qsTr("自定义传感器数据帧结构")
|
||||||
onClicked: {
|
onClicked: {
|
||||||
show_popup("components/FrameChooser.qml")
|
Window.window.popup.show_content("qrc:/qt/qml/ProtocolParser/components/FrameChooser.qml")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,17 +103,13 @@ Item{
|
||||||
height: parent.height
|
height: parent.height
|
||||||
RibbonMessageListView{
|
RibbonMessageListView{
|
||||||
id: data_view
|
id: data_view
|
||||||
top_padding: control.top_padding + data_title_bar.height
|
anchors.fill: parent
|
||||||
|
top_padding: control.top_padding + data_title_bar.height + (!RibbonTheme.modern_style ? 10 : 0)
|
||||||
bottom_padding: bottom_bar.height
|
bottom_padding: bottom_bar.height
|
||||||
width: parent.width / 2
|
|
||||||
delegate: ZigBeeMessage{
|
delegate: ZigBeeMessage{
|
||||||
show_tooltip: control.show_tooltip
|
show_tooltip: control.show_tooltip
|
||||||
component_width: data_view.width / 2
|
component_width: data_view.width / 2
|
||||||
}
|
}
|
||||||
view.onHeightChanged: {
|
|
||||||
if (control.auto_scroll_to_bottom)
|
|
||||||
scroll_to_bottom()
|
|
||||||
}
|
|
||||||
Event{
|
Event{
|
||||||
id:data_view_event
|
id:data_view_event
|
||||||
type: "zigbee_recv_data_view"
|
type: "zigbee_recv_data_view"
|
||||||
|
|
|
@ -1,42 +0,0 @@
|
||||||
#include <windows.h>
|
|
||||||
|
|
||||||
IDI_ICON1 ICON "imgs/icon.ico"
|
|
||||||
|
|
||||||
#define STR(x) #x
|
|
||||||
#define VER_JOIN(a,b,c) STR(a.b.c)
|
|
||||||
#define VER_JOIN_(x) VER_JOIN x
|
|
||||||
#define VER_STR VER_JOIN_((PROTOCOLPARSER_VERSION))
|
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
|
||||||
FILEVERSION PROTOCOLPARSER_VERSION
|
|
||||||
PRODUCTVERSION PROTOCOLPARSER_VERSION
|
|
||||||
FILEFLAGSMASK 0x3fL
|
|
||||||
#ifdef _DEBUG
|
|
||||||
FILEFLAGS VS_FF_DEBUG
|
|
||||||
#else
|
|
||||||
FILEFLAGS 0x0L
|
|
||||||
#endif
|
|
||||||
FILEOS VOS_NT_WINDOWS32
|
|
||||||
FILETYPE VFT_APP
|
|
||||||
FILESUBTYPE VFT2_UNKNOWN
|
|
||||||
BEGIN
|
|
||||||
BLOCK "StringFileInfo"
|
|
||||||
BEGIN
|
|
||||||
BLOCK "040904b0"
|
|
||||||
BEGIN
|
|
||||||
VALUE "Comments", "Made by Mentalflow."
|
|
||||||
VALUE "CompanyName", "Mentalflow"
|
|
||||||
VALUE "FileDescription", "Protocol Parser"
|
|
||||||
VALUE "FileVersion", VER_STR
|
|
||||||
VALUE "InternalName", ""
|
|
||||||
VALUE "LegalCopyright", "Copyright (C) 2023"
|
|
||||||
VALUE "OriginalFilename", ""
|
|
||||||
VALUE "ProductName", "Protocol Parser"
|
|
||||||
VALUE "ProductVersion", VER_STR
|
|
||||||
END
|
|
||||||
END
|
|
||||||
BLOCK "VarFileInfo"
|
|
||||||
BEGIN
|
|
||||||
VALUE "Translation", 0x409, 1200
|
|
||||||
END
|
|
||||||
END
|
|
|
@ -1,35 +1,25 @@
|
||||||
#include <QGuiApplication>
|
#include <QGuiApplication>
|
||||||
#include <QQmlApplicationEngine>
|
#include <QQmlApplicationEngine>
|
||||||
#include <QtQml/qqmlextensionplugin.h>
|
#include <QtQml/qqmlextensionplugin.h>
|
||||||
#include <FramelessHelper/Quick/framelessquickmodule.h>
|
|
||||||
#include <FramelessHelper/Core/private/framelessconfig_p.h>
|
|
||||||
#include <QTranslator>
|
#include <QTranslator>
|
||||||
#include <QQmlContext>
|
#include <QQmlContext>
|
||||||
#include <QtWebView>
|
#include <QtWebView>
|
||||||
|
#include "ribbonui.h"
|
||||||
|
|
||||||
FRAMELESSHELPER_USE_NAMESPACE
|
|
||||||
#ifdef RIBBONUI_BUILD_STATIC_LIB
|
#ifdef RIBBONUI_BUILD_STATIC_LIB
|
||||||
Q_IMPORT_QML_PLUGIN(RibbonUIPlugin)
|
Q_IMPORT_QML_PLUGIN(RibbonUIPlugin)
|
||||||
#endif
|
#endif
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
qputenv("QT_QUICK_CONTROLS_STYLE","Basic");
|
|
||||||
QtWebView::initialize();
|
QtWebView::initialize();
|
||||||
FramelessHelper::Quick::initialize();
|
RibbonUI::init();
|
||||||
QGuiApplication app(argc, argv);
|
QGuiApplication app(argc, argv);
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
|
||||||
FramelessConfig::instance()->set(Global::Option::ForceHideWindowFrameBorder);
|
|
||||||
FramelessConfig::instance()->set(Global::Option::WindowUseRoundCorners);
|
|
||||||
#endif
|
|
||||||
FramelessConfig::instance()->set(Global::Option::EnableBlurBehindWindow);
|
|
||||||
FramelessConfig::instance()->set(Global::Option::CenterWindowBeforeShow);
|
|
||||||
QTranslator translator;
|
QTranslator translator;
|
||||||
bool result = translator.load(QLocale::system(), u""_qs, u""_qs, u":/translations"_qs);
|
bool result = translator.load(QLocale::system(), u""_qs, u""_qs, u":/translations"_qs);
|
||||||
if (result)
|
if (result)
|
||||||
app.installTranslator(&translator);
|
app.installTranslator(&translator);
|
||||||
QQmlApplicationEngine engine;
|
QQmlApplicationEngine engine;
|
||||||
FramelessHelper::Quick::registerTypes(&engine);
|
RibbonUI::registerTypes(&engine);
|
||||||
QList<int> verl = {PROTOCOLPARSER_VERSION};
|
QList<int> verl = {PROTOCOLPARSER_VERSION};
|
||||||
QString version = QString::number(verl[0])+'.'+QString::number(verl[1])+'.'+QString::number(verl[2]);
|
QString version = QString::number(verl[0])+'.'+QString::number(verl[1])+'.'+QString::number(verl[2]);
|
||||||
engine.rootContext()->setContextProperty("PPAPP_Version",version);
|
engine.rootContext()->setContextProperty("PPAPP_Version",version);
|
||||||
|
|
|
@ -453,13 +453,13 @@ QString ZigBeeDataResolver::sensor_data_reader(void **data,QString type)
|
||||||
}
|
}
|
||||||
else if (type=="float")
|
else if (type=="float")
|
||||||
{
|
{
|
||||||
d = QString::number(*(float*)(*data), 'g', 1);
|
d = QString::number(*(float*)(*data), 'f', 3);
|
||||||
*pdata += sizeof(float);
|
*pdata += sizeof(float);
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
else if (type=="double")
|
else if (type=="double")
|
||||||
{
|
{
|
||||||
d = QString::number(*(double*)(*data), 'g', 1);
|
d = QString::number(*(double*)(*data), 'f', 3);
|
||||||
*pdata += sizeof(double);
|
*pdata += sizeof(double);
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue