commit 55e280f1ce88c112ba948a54102b7f6efe4c6ba5 Author: zhaohe Date: Sun Aug 4 11:26:37 2024 +0800 init proj diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..4c41736 --- /dev/null +++ b/.clang-format @@ -0,0 +1,9 @@ +# Defines the Chromium style for automatic reformatting. +# http://clang.llvm.org/docs/ClangFormatStyleOptions.html +Language: Cpp +BasedOnStyle: Google +ColumnLimit: 300 +AlignConsecutiveMacros: true +AlignConsecutiveDeclarations: true +AlignConsecutiveAssignments: true +AlignOperands: true \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7f96686 --- /dev/null +++ b/.gitignore @@ -0,0 +1,73 @@ +# This file is used to ignore files which are generated +# ---------------------------------------------------------------------------- + +*~ +*.autosave +*.a +*.core +*.moc +*.o +*.obj +*.orig +*.rej +*.so +*.so.* +*_pch.h.cpp +*_resource.rc +*.qm +.#* +*.*# +core +!core/ +tags +.DS_Store +.directory +*.debug +Makefile* +*.prl +*.app +moc_*.cpp +ui_*.h +qrc_*.cpp +Thumbs.db +*.res +# *.rc +/.qmake.cache +/.qmake.stash + +# qtcreator generated files +*.pro.user* + +# xemacs temporary files +*.flc + +# Vim temporary files +.*.swp + +# Visual Studio generated files +*.ib_pdb_index +*.idb +*.ilk +*.pdb +*.sln +*.suo +*.vcproj +*vcproj.*.*.user +*.ncb +*.sdf +*.opensdf +*.vcxproj +*vcxproj.* + +# MinGW generated files +*.Debug +*.Release + +# Python byte code +*.pyc + +# Binaries +# -------- +*.dll + +build \ No newline at end of file diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..321e3f3 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "libxsync"] + path = libxsync + url = zwsd@192.168.1.3:p_lusterinc/libxsync.git +[submodule "zaf_protocol"] + path = zaf_protocol + url = zwsd@192.168.1.3:p_camera_light_source_timing_controller/zaf_protocol.git diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..b922719 --- /dev/null +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,21 @@ +{ + "configurations": [ + { + "name": "Win32", + "includePath": [ + "${workspaceFolder}/**" + ], + "defines": [ + "_DEBUG", + "UNICODE", + "_UNICODE" + ], + "compilerPath": "C:\\msys64\\mingw64\\bin\\gcc.exe", + "cStandard": "c17", + "cppStandard": "gnu++17", + "intelliSenseMode": "windows-gcc-x64", + "compileCommands": "${workspaceFolder}/../build-zfpga_pc-Desktop_Qt_5_12_12_MinGW_64_bit-Debug/compile_commands.json" + } + ], + "version": 4 +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..1722855 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,116 @@ +{ + "files.associations": { + "*.hpp": "cpp", + "qapplication": "cpp", + "qdebug": "cpp", + "qdatetime": "cpp", + "vector": "cpp", + "typeindex": "cpp", + "typeinfo": "cpp", + "string": "cpp", + "memory": "cpp", + "any": "cpp", + "array": "cpp", + "atomic": "cpp", + "bit": "cpp", + "*.tcc": "cpp", + "bitset": "cpp", + "cctype": "cpp", + "charconv": "cpp", + "chrono": "cpp", + "clocale": "cpp", + "cmath": "cpp", + "codecvt": "cpp", + "compare": "cpp", + "complex": "cpp", + "concepts": "cpp", + "condition_variable": "cpp", + "cstdarg": "cpp", + "cstddef": "cpp", + "cstdint": "cpp", + "cstdio": "cpp", + "cstdlib": "cpp", + "cstring": "cpp", + "ctime": "cpp", + "cwchar": "cpp", + "cwctype": "cpp", + "deque": "cpp", + "list": "cpp", + "map": "cpp", + "set": "cpp", + "unordered_map": "cpp", + "exception": "cpp", + "algorithm": "cpp", + "functional": "cpp", + "iterator": "cpp", + "memory_resource": "cpp", + "numeric": "cpp", + "optional": "cpp", + "random": "cpp", + "ratio": "cpp", + "string_view": "cpp", + "system_error": "cpp", + "tuple": "cpp", + "type_traits": "cpp", + "utility": "cpp", + "fstream": "cpp", + "initializer_list": "cpp", + "iomanip": "cpp", + "iosfwd": "cpp", + "iostream": "cpp", + "istream": "cpp", + "limits": "cpp", + "mutex": "cpp", + "new": "cpp", + "numbers": "cpp", + "ostream": "cpp", + "semaphore": "cpp", + "span": "cpp", + "sstream": "cpp", + "stdexcept": "cpp", + "stop_token": "cpp", + "streambuf": "cpp", + "thread": "cpp", + "cinttypes": "cpp", + "variant": "cpp", + "qfile": "cpp", + "qmainwindow": "cpp", + "qvalueaxis": "cpp", + "qlabel": "cpp", + "future": "cpp", + "qcoreapplication": "cpp", + "qcategoryaxis": "cpp", + "qaction": "cpp", + "qthread": "cpp", + "zaf_ecode.h": "c", + "qserialport": "cpp", + "qserialportinfo": "cpp", + "qmessagebox": "cpp", + "qgridlayout": "cpp", + "qmenu": "cpp", + "qmenubar": "cpp", + "qtextedit": "cpp", + "ios": "cpp", + "format": "cpp", + "forward_list": "cpp", + "locale": "cpp", + "queue": "cpp", + "ranges": "cpp", + "xfacet": "cpp", + "xhash": "cpp", + "xiosbase": "cpp", + "xlocale": "cpp", + "xlocbuf": "cpp", + "xlocinfo": "cpp", + "xlocmes": "cpp", + "xlocmon": "cpp", + "xlocnum": "cpp", + "xloctime": "cpp", + "xmemory": "cpp", + "xstring": "cpp", + "xtr1common": "cpp", + "xtree": "cpp", + "xutility": "cpp" + }, + "files.autoGuessEncoding": false, +} \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..3081bd0 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,55 @@ +cmake_minimum_required(VERSION 3.5) + +project(zfpga_pc VERSION 0.1 LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + +find_package(QT NAMES Qt6 Qt5 COMPONENTS Widgets REQUIRED) +find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets SerialPort Charts Concurrent REQUIRED) + +include_directories(libxsync/include) +include_directories(src) +include_directories(./) +include_directories(libzqt) + +add_compile_options(-Wall ) + + +file(GLOB_RECURSE APPSRC # + src/*.cpp # + src/*.c # + src/*.ui # + src/*.h # + src/*.hpp # +) + +set(PROJECT_SOURCES + ${APPSRC} + app.rc +) + + +add_executable(zfpga_pc WIN32 + ${PROJECT_SOURCES} +) +target_link_options(zfpga_pc PRIVATE -static -static-libgcc -static-libstdc++) + +target_link_libraries(zfpga_pc PRIVATE Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::SerialPort Qt${QT_VERSION_MAJOR}::Charts Qt${QT_VERSION_MAJOR}::Concurrent wsock32) + +set_target_properties(zfpga_pc PROPERTIES + MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com + MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION} + MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} +) + +if(QT_VERSION_MAJOR EQUAL 6) + qt_finalize_executable(zfpga_pc) +endif() diff --git a/CMakeLists.txt.user b/CMakeLists.txt.user new file mode 100644 index 0000000..2cb9ce5 --- /dev/null +++ b/CMakeLists.txt.user @@ -0,0 +1,320 @@ + + + + + + EnvironmentId + {4b1b8946-9605-410f-846a-42fb19af5924} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + false + true + false + 0 + true + true + 0 + 8 + true + false + 1 + true + true + true + *.md, *.MD, Makefile + false + true + + + + ProjectExplorer.Project.PluginSettings + + + true + false + true + true + true + true + + + 0 + true + + -fno-delayed-template-parsing + + true + Builtin.BuildSystem + + true + true + Builtin.DefaultTidyAndClazy + 10 + + + + true + + + + + ProjectExplorer.Project.Target.0 + + Desktop + Desktop Qt 5.12.12 MinGW 64-bit + Desktop Qt 5.12.12 MinGW 64-bit + qt.qt5.51212.win64_mingw73_kit + 0 + 0 + 0 + + Debug + -GMinGW Makefiles +-DCMAKE_BUILD_TYPE:STRING=Debug +-DCMAKE_PROJECT_INCLUDE_BEFORE:PATH=%{IDE:ResourcePath}/package-manager/auto-setup.cmake +-DQT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable} +-DCMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX} +-DCMAKE_C_COMPILER:STRING=%{Compiler:Executable:C} +-DCMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx} + D:\zfpge_workspace\build-zfpga_pc-Desktop_Qt_5_12_12_MinGW_64_bit-Debug + + + + all + + true + Build + CMakeProjectManager.MakeStep + + 1 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + + clean + + true + Build + CMakeProjectManager.MakeStep + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + + Debug + CMakeProjectManager.CMakeBuildConfiguration + + + Release + -GMinGW Makefiles +-DCMAKE_BUILD_TYPE:STRING=Release +-DCMAKE_PROJECT_INCLUDE_BEFORE:PATH=%{IDE:ResourcePath}/package-manager/auto-setup.cmake +-DQT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable} +-DCMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX} +-DCMAKE_C_COMPILER:STRING=%{Compiler:Executable:C} +-DCMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx} + D:\zfpge_workspace\build-zfpga_pc-Desktop_Qt_5_12_12_MinGW_64_bit-Release + + + + all + + true + CMakeProjectManager.MakeStep + + 1 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + + clean + + true + CMakeProjectManager.MakeStep + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + + Release + CMakeProjectManager.CMakeBuildConfiguration + + + RelWithDebInfo + -GMinGW Makefiles +-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo +-DCMAKE_PROJECT_INCLUDE_BEFORE:PATH=%{IDE:ResourcePath}/package-manager/auto-setup.cmake +-DQT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable} +-DCMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX} +-DCMAKE_C_COMPILER:STRING=%{Compiler:Executable:C} +-DCMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx} + D:\zfpge_workspace\build-zfpga_pc-Desktop_Qt_5_12_12_MinGW_64_bit-RelWithDebInfo + + + + all + + true + CMakeProjectManager.MakeStep + + 1 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + + clean + + true + CMakeProjectManager.MakeStep + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + + Release with Debug Information + CMakeProjectManager.CMakeBuildConfiguration + + + MinSizeRel + -GMinGW Makefiles +-DCMAKE_BUILD_TYPE:STRING=MinSizeRel +-DCMAKE_PROJECT_INCLUDE_BEFORE:PATH=%{IDE:ResourcePath}/package-manager/auto-setup.cmake +-DQT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable} +-DCMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX} +-DCMAKE_C_COMPILER:STRING=%{Compiler:Executable:C} +-DCMAKE_CXX_COMPILER:STRING=%{Compiler:Executable:Cxx} + D:\zfpge_workspace\build-zfpga_pc-Desktop_Qt_5_12_12_MinGW_64_bit-MinSizeRel + + + + all + + true + CMakeProjectManager.MakeStep + + 1 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + + clean + + true + CMakeProjectManager.MakeStep + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + + Minimum Size Release + CMakeProjectManager.CMakeBuildConfiguration + + 4 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + + false + ProjectExplorer.DefaultDeployConfiguration + + 1 + + true + true + true + + 2 + + zfpga_pc + CMakeProjectManager.CMakeRunConfiguration.zfpga_pc + zfpga_pc + false + true + true + false + true + D:/zfpge_workspace/build-zfpga_pc-Desktop_Qt_5_12_12_MinGW_64_bit-Debug + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 22 + + + Version + 22 + + diff --git a/README.md b/README.md new file mode 100644 index 0000000..08fcf43 --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +``` + + +``` \ No newline at end of file diff --git a/app.rc b/app.rc new file mode 100644 index 0000000..c309aa1 --- /dev/null +++ b/app.rc @@ -0,0 +1 @@ +IDI_ICON1 ICON "logo.ico" \ No newline at end of file diff --git a/logo.ico b/logo.ico new file mode 100644 index 0000000..c7b5197 Binary files /dev/null and b/logo.ico differ diff --git a/qcss/style1 b/qcss/style1 new file mode 100644 index 0000000..5f713c1 --- /dev/null +++ b/qcss/style1 @@ -0,0 +1,496 @@ +/* +Ubuntu Style Sheet for QT Applications +Author: Jaime A. Quiroga P. +Company: GTRONICK +Last updated: 01/10/2021 (dd/mm/yyyy), 15:18. +Available at: https://github.com/GTRONICK/QSS/blob/master/Ubuntu.qss +*/ +QMainWindow { + background-color:#f0f0f0; +} +QCheckBox { + padding:2px; +} +QCheckBox:hover { + border:1px solid rgb(255,150,60); + border-radius:4px; + padding: 1px; + background-color:qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(190, 90, 50, 50), stop:1 rgba(250, 130, 40, 50)); +} +QCheckBox::indicator:checked { + border:1px solid rgb(246, 134, 86); + border-radius:4px; + background-color:rgb(246, 134, 86) +} +QCheckBox::indicator:unchecked { + border-width:1px solid rgb(246, 134, 86); + border-radius:4px; + background-color:rgb(255,255,255); +} +QColorDialog { + background-color:#f0f0f0; +} +QComboBox { + color:rgb(81,72,65); + background: #ffffff; +} +QComboBox:editable { + selection-color:rgb(81,72,65); + selection-background-color: #ffffff; +} +QComboBox QAbstractItemView { + selection-color: #ffffff; + selection-background-color: rgb(246, 134, 86); +} +QComboBox:!editable:on, QComboBox::drop-down:editable:on { + color: #1e1d23; +} +QDateTimeEdit, QDateEdit, QDoubleSpinBox, QFontComboBox { + color:rgb(81,72,65); + background-color: #ffffff; +} + +QDialog { + background-color:#f0f0f0; +} + +QLabel,QLineEdit { + color:rgb(17,17,17); +} +QLineEdit { + background-color:rgb(255,255,255); + selection-background-color:rgb(236,116,64); +} +QMenuBar { + color:rgb(223,219,210); + background-color:rgb(65,64,59); +} +QMenuBar::item { + padding-top:4px; + padding-left:4px; + padding-right:4px; + color:rgb(223,219,210); + background-color:rgb(65,64,59); +} +QMenuBar::item:selected { + color:rgb(255,255,255); + padding-top:2px; + padding-left:2px; + padding-right:2px; + border-top-width:2px; + border-left-width:2px; + border-right-width:2px; + border-top-right-radius:4px; + border-top-left-radius:4px; + border-style:solid; + background-color:rgb(65,64,59); + border-top-color: rgb(47,47,44); + border-right-color: qlineargradient(spread:pad, x1:0, y1:1, x2:1, y2:0, stop:0 rgba(90, 87, 78, 255), stop:1 rgba(47,47,44, 255)); + border-left-color: qlineargradient(spread:pad, x1:1, y1:0, x2:0, y2:0, stop:0 rgba(90, 87, 78, 255), stop:1 rgba(47,47,44, 255)); +} +QMenu { + color:rgb(223,219,210); + background-color:rgb(65,64,59); +} +QMenu::item { + color:rgb(223,219,210); + padding:4px 10px 4px 20px; +} +QMenu::item:selected { + color:rgb(255,255,255); + background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(225, 108, 54, 255), stop:1 rgba(246, 134, 86, 255)); + border-style:solid; + border-width:3px; + padding:4px 7px 4px 17px; + border-bottom-color:qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(175,85,48,255), stop:1 rgba(236,114,67, 255)); + border-top-color:qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(253,156,113,255), stop:1 rgba(205,90,46, 255)); + border-right-color:qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgba(253,156,113,255), stop:1 rgba(205,90,46, 255)); + border-left-color:qlineargradient(spread:pad, x1:1, y1:0.5, x2:0, y2:0.5, stop:0 rgba(253,156,113,255), stop:1 rgba(205,90,46, 255)); +} +QPlainTextEdit { + border: 1px solid transparent; + color:rgb(17,17,17); + selection-background-color:rgb(236,116,64); + background-color: #FFFFFF; +} +QProgressBar { + text-align: center; + color: rgb(0, 0, 0); + border: 1px inset rgb(150,150,150); + border-radius: 10px; + background-color:rgb(221,221,219); +} +QProgressBar::chunk:horizontal { + background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(225, 108, 54, 255), stop:1 rgba(246, 134, 86, 255)); + border:1px solid; + border-radius:8px; + border-bottom-color:qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(175,85,48,255), stop:1 rgba(236,114,67, 255)); + border-top-color:qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(253,156,113,255), stop:1 rgba(205,90,46, 255)); + border-right-color:qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgba(253,156,113,255), stop:1 rgba(205,90,46, 255)); + border-left-color:qlineargradient(spread:pad, x1:1, y1:0.5, x2:0, y2:0.5, stop:0 rgba(253,156,113,255), stop:1 rgba(205,90,46, 255)); +} +QPushButton{ + color:rgb(17,17,17); + border-width: 1px; + border-radius: 6px; + border-bottom-color: rgb(150,150,150); + border-right-color: rgb(165,165,165); + border-left-color: rgb(165,165,165); + border-top-color: rgb(180,180,180); + border-style: solid; + padding: 4px; + background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(220, 220, 220, 255), stop:1 rgba(255, 255, 255, 255)); +} +QPushButton:hover{ + color:rgb(17,17,17); + border-width: 1px; + border-radius:6px; + border-top-color: rgb(255,150,60); + border-right-color: qlineargradient(spread:pad, x1:0, y1:1, x2:1, y2:0, stop:0 rgba(200, 70, 20, 255), stop:1 rgba(255,150,60, 255)); + border-left-color: qlineargradient(spread:pad, x1:1, y1:0, x2:0, y2:0, stop:0 rgba(200, 70, 20, 255), stop:1 rgba(255,150,60, 255)); + border-bottom-color: rgb(200,70,20); + border-style: solid; + padding: 2px; + background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(220, 220, 220, 255), stop:1 rgba(255, 255, 255, 255)); +} +QPushButton:default{ + color:rgb(17,17,17); + border-width: 1px; + border-radius:6px; + border-top-color: rgb(255,150,60); + border-right-color: qlineargradient(spread:pad, x1:0, y1:1, x2:1, y2:0, stop:0 rgba(200, 70, 20, 255), stop:1 rgba(255,150,60, 255)); + border-left-color: qlineargradient(spread:pad, x1:1, y1:0, x2:0, y2:0, stop:0 rgba(200, 70, 20, 255), stop:1 rgba(255,150,60, 255)); + border-bottom-color: rgb(200,70,20); + border-style: solid; + padding: 2px; + background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(220, 220, 220, 255), stop:1 rgba(255, 255, 255, 255)); +} +QPushButton:pressed{ + color:rgb(17,17,17); + border-width: 1px; + border-radius: 6px; + border-width: 1px; + border-top-color: rgba(255,150,60,200); + border-right-color: qlineargradient(spread:pad, x1:0, y1:1, x2:1, y2:0, stop:0 rgba(200, 70, 20, 255), stop:1 rgba(255,150,60, 200)); + border-left-color: qlineargradient(spread:pad, x1:1, y1:0, x2:0, y2:0, stop:0 rgba(200, 70, 20, 255), stop:1 rgba(255,150,60, 200)); + border-bottom-color: rgba(200,70,20,200); + border-style: solid; + padding: 2px; + background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(220, 220, 220, 255), stop:1 rgba(255, 255, 255, 255)); +} +QPushButton:disabled{ + color:rgb(174,167,159); + border-width: 1px; + border-radius: 6px; + background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(200, 200, 200, 255), stop:1 rgba(230, 230, 230, 255)); +} +QRadioButton { + padding: 1px; +} +QRadioButton::indicator:checked { + height: 10px; + width: 10px; + border-style:solid; + border-radius:5px; + border-width: 1px; + border-color: rgba(246, 134, 86, 255); + color: #a9b7c6; + background-color:rgba(246, 134, 86, 255); +} +QRadioButton::indicator:!checked { + height: 10px; + width: 10px; + border-style:solid; + border-radius:5px; + border-width: 1px; + border-color: rgb(246, 134, 86); + color: #a9b7c6; + background-color: transparent; +} +QScrollArea { + color: white; + background-color:#f0f0f0; +} +QSlider::groove { + border-style: solid; + border-width: 1px; + border-color: rgb(207,207,207); +} +QSlider::groove:horizontal { + height: 5px; + background: rgb(246, 134, 86); +} +QSlider::groove:vertical { + width: 5px; + background: rgb(246, 134, 86); +} +QSlider::handle:horizontal { + background: rgb(253,253,253); + border-style: solid; + border-width: 1px; + border-color: rgb(207,207,207); + width: 12px; + margin: -5px 0; + border-radius: 7px; +} +QSlider::handle:vertical { + background: rgb(253,253,253); + border-style: solid; + border-width: 1px; + border-color: rgb(207,207,207); + height: 12px; + margin: 0 -5px; + border-radius: 7px; +} +QSlider::add-page:horizontal, QSlider::add-page:vertical { + background: white; +} +QSlider::sub-page:horizontal, QSlider::sub-page:vertical { + background: rgb(246, 134, 86); +} +QStatusBar, QSpinBox { + color:rgb(81,72,65); +} +QSpinBox { + background-color: #ffffff; +} +QScrollBar:horizontal { + max-height: 20px; + border: 1px transparent; + margin: 0px 20px 0px 20px; +} +QScrollBar::handle:horizontal { + background: rgb(253,253,253); + border: 1px solid rgb(207,207,207); + border-radius: 7px; + min-width: 25px; +} +QScrollBar::handle:horizontal:hover { + background: rgb(253,253,253); + border: 1px solid rgb(255,150,60); + border-radius: 7px; + min-width: 25px; +} +QScrollBar::add-line:horizontal { + border: 1px solid rgb(207,207,207); + border-top-right-radius: 7px; + border-top-left-radius: 7px; + border-bottom-right-radius: 7px; + background: rgb(255, 255, 255); + width: 20px; + subcontrol-position: right; + subcontrol-origin: margin; +} +QScrollBar::add-line:horizontal:hover { + border: 1px solid rgb(255,150,60); + border-top-right-radius: 7px; + border-top-left-radius: 7px; + border-bottom-right-radius: 7px; + background: rgb(255, 255, 255); + width: 20px; + subcontrol-position: right; + subcontrol-origin: margin; +} +QScrollBar::add-line:horizontal:pressed { + border: 1px solid grey; + border-top-left-radius: 7px; + border-top-right-radius: 7px; + border-bottom-right-radius: 7px; + background: rgb(231,231,231); + width: 20px; + subcontrol-position: right; + subcontrol-origin: margin; +} +QScrollBar::sub-line:horizontal { + border: 1px solid rgb(207,207,207); + border-top-right-radius: 7px; + border-top-left-radius: 7px; + border-bottom-left-radius: 7px; + background: rgb(255, 255, 255); + width: 20px; + subcontrol-position: left; + subcontrol-origin: margin; +} +QScrollBar::sub-line:horizontal:hover { + border: 1px solid rgb(255,150,60); + border-top-right-radius: 7px; + border-top-left-radius: 7px; + border-bottom-left-radius: 7px; + background: rgb(255, 255, 255); + width: 20px; + subcontrol-position: left; + subcontrol-origin: margin; +} +QScrollBar::sub-line:horizontal:pressed { + border: 1px solid grey; + border-top-right-radius: 7px; + border-top-left-radius: 7px; + border-bottom-left-radius: 7px; + background: rgb(231,231,231); + width: 20px; + subcontrol-position: left; + subcontrol-origin: margin; +} +QScrollBar::left-arrow:horizontal { + border: 1px transparent grey; + border-top-left-radius: 3px; + border-bottom-left-radius: 3px; + width: 6px; + height: 6px; + background: rgb(230,230,230); +} +QScrollBar::right-arrow:horizontal { + border: 1px transparent grey; + border-top-right-radius: 3px; + border-bottom-right-radius: 3px; + width: 6px; + height: 6px; + background: rgb(230,230,230); +} +QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal { + background: none; +} +QScrollBar:vertical { + max-width: 20px; + border: 1px transparent grey; + margin: 20px 0px 20px 0px; +} +QScrollBar::add-line:vertical { + border: 1px solid; + border-color: rgb(207,207,207); + border-bottom-right-radius: 7px; + border-bottom-left-radius: 7px; + border-top-left-radius: 7px; + background: rgb(255, 255, 255); + height: 20px; + subcontrol-position: bottom; + subcontrol-origin: margin; +} +QScrollBar::add-line:vertical:hover { + border: 1px solid; + border-color: rgb(255,150,60); + border-bottom-right-radius: 7px; + border-bottom-left-radius: 7px; + border-top-left-radius: 7px; + background: rgb(255, 255, 255); + height: 20px; + subcontrol-position: bottom; + subcontrol-origin: margin; +} +QScrollBar::add-line:vertical:pressed { + border: 1px solid grey; + border-bottom-left-radius: 7px; + border-bottom-right-radius: 7px; + border-top-left-radius: 7px; + background: rgb(231,231,231); + height: 20px; + subcontrol-position: bottom; + subcontrol-origin: margin; +} +QScrollBar::sub-line:vertical { + border: 1px solid rgb(207,207,207); + border-top-right-radius: 7px; + border-top-left-radius: 7px; + border-bottom-left-radius: 7px; + background: rgb(255, 255, 255); + height: 20px; + subcontrol-position: top; + subcontrol-origin: margin; +} +QScrollBar::sub-line:vertical:hover { + border: 1px solid rgb(255,150,60); + border-top-right-radius: 7px; + border-top-left-radius: 7px; + border-bottom-left-radius: 7px; + background: rgb(255, 255, 255); + height: 20px; + subcontrol-position: top; + subcontrol-origin: margin; +} +QScrollBar::sub-line:vertical:pressed { + border: 1px solid grey; + border-top-left-radius: 7px; + border-top-right-radius: 7px; + background: rgb(231,231,231); + height: 20px; + subcontrol-position: top; + subcontrol-origin: margin; +} +QScrollBar::handle:vertical { + background: rgb(253,253,253); + border: 1px solid rgb(207,207,207); + border-radius: 7px; + min-height: 25px; +} +QScrollBar::handle:vertical:hover { + background: rgb(253,253,253); + border: 1px solid rgb(255,150,60); + border-radius: 7px; + min-height: 25px; +} +QScrollBar::up-arrow:vertical { + border: 1px transparent grey; + border-top-left-radius: 3px; + border-top-right-radius: 3px; + width: 6px; + height: 6px; + background: rgb(230,230,230); +} +QScrollBar::down-arrow:vertical { + border: 1px transparent grey; + border-bottom-left-radius: 3px; + border-bottom-right-radius: 3px; + width: 6px; + height: 6px; + background: rgb(230,230,230); +} +QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical { + background: none; +} +QTabWidget { + color:rgb(0,0,0); + background-color:rgb(247,246,246); +} +QTabWidget::pane { + border-color: rgb(180,180,180); + background-color:rgb(247,246,246); + border-style: solid; + border-width: 1px; + border-radius: 6px; +} +QTabBar::tab { + padding-left:4px; + padding-right:4px; + padding-bottom:2px; + padding-top:2px; + color:rgb(81,72,65); + background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(221,218,217,255), stop:1 rgba(240,239,238,255)); + border-style: solid; + border-width: 1px; + border-top-right-radius:4px; + border-top-left-radius:4px; + border-top-color: rgb(180,180,180); + border-left-color: rgb(180,180,180); + border-right-color: rgb(180,180,180); + border-bottom-color: transparent; +} +QTabBar::tab:selected, QTabBar::tab:last:selected, QTabBar::tab:hover { + background-color:rgb(247,246,246); + margin-left: 0px; + margin-right: 1px; +} +QTabBar::tab:!selected { + margin-top: 1px; + margin-right: 1px; +} +QTextEdit { + border-width: 1px; + border-style: solid; + border-color:transparent; + color:rgb(17,17,17); + selection-background-color:rgb(236,116,64); +} +QTimeEdit, QToolBox, QToolBox::tab, QToolBox::tab:selected { + color:rgb(81,72,65); + background-color: #ffffff; +} diff --git a/qcss/style2 b/qcss/style2 new file mode 100644 index 0000000..6bebc38 --- /dev/null +++ b/qcss/style2 @@ -0,0 +1,559 @@ +/* +Aqua Style Sheet for QT Applications +Author: Jaime A. Quiroga P. +Company: GTRONICK +Last updated: 22/01/2019, 07:55. +Available at: https://github.com/GTRONICK/QSS/blob/master/Aqua.qss +*/ +QMainWindow { + background-color:#ececec; +} +QTextEdit { + border-width: 1px; + border-style: solid; + border-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255)); +} +QPlainTextEdit { + border-width: 1px; + border-style: solid; + border-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255)); +} +QToolButton { + border-style: solid; + border-top-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(215, 215, 215), stop:1 rgb(222, 222, 222)); + border-right-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(217, 217, 217), stop:1 rgb(227, 227, 227)); + border-left-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(227, 227, 227), stop:1 rgb(217, 217, 217)); + border-bottom-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(215, 215, 215), stop:1 rgb(222, 222, 222)); + border-width: 1px; + border-radius: 5px; + color: rgb(0,0,0); + padding: 2px; + background-color: rgb(255,255,255); +} +QToolButton:hover{ + border-style: solid; + border-top-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(195, 195, 195), stop:1 rgb(222, 222, 222)); + border-right-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(197, 197, 197), stop:1 rgb(227, 227, 227)); + border-left-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(227, 227, 227), stop:1 rgb(197, 197, 197)); + border-bottom-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(195, 195, 195), stop:1 rgb(222, 222, 222)); + border-width: 1px; + border-radius: 5px; + color: rgb(0,0,0); + padding: 2px; + background-color: rgb(255,255,255); +} +QToolButton:pressed{ + border-style: solid; + border-top-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(215, 215, 215), stop:1 rgb(222, 222, 222)); + border-right-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(217, 217, 217), stop:1 rgb(227, 227, 227)); + border-left-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(227, 227, 227), stop:1 rgb(217, 217, 217)); + border-bottom-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(215, 215, 215), stop:1 rgb(222, 222, 222)); + border-width: 1px; + border-radius: 5px; + color: rgb(0,0,0); + padding: 2px; + background-color: rgb(142,142,142); +} +QPushButton{ + border-style: solid; + border-top-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(215, 215, 215), stop:1 rgb(222, 222, 222)); + border-right-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(217, 217, 217), stop:1 rgb(227, 227, 227)); + border-left-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(227, 227, 227), stop:1 rgb(217, 217, 217)); + border-bottom-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(215, 215, 215), stop:1 rgb(222, 222, 222)); + border-width: 1px; + border-radius: 5px; + color: rgb(0,0,0); + padding: 2px; + background-color: rgb(255,255,255); +} +QPushButton::default{ + border-style: solid; + border-top-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(215, 215, 215), stop:1 rgb(222, 222, 222)); + border-right-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(217, 217, 217), stop:1 rgb(227, 227, 227)); + border-left-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(227, 227, 227), stop:1 rgb(217, 217, 217)); + border-bottom-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(215, 215, 215), stop:1 rgb(222, 222, 222)); + border-width: 1px; + border-radius: 5px; + color: rgb(0,0,0); + padding: 2px; + background-color: rgb(255,255,255); +} +QPushButton:hover{ + border-style: solid; + border-top-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(195, 195, 195), stop:1 rgb(222, 222, 222)); + border-right-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(197, 197, 197), stop:1 rgb(227, 227, 227)); + border-left-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(227, 227, 227), stop:1 rgb(197, 197, 197)); + border-bottom-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(195, 195, 195), stop:1 rgb(222, 222, 222)); + border-width: 1px; + border-radius: 5px; + color: rgb(0,0,0); + padding: 2px; + background-color: rgb(255,255,255); +} +QPushButton:pressed{ + border-style: solid; + border-top-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(215, 215, 215), stop:1 rgb(222, 222, 222)); + border-right-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(217, 217, 217), stop:1 rgb(227, 227, 227)); + border-left-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(227, 227, 227), stop:1 rgb(217, 217, 217)); + border-bottom-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(215, 215, 215), stop:1 rgb(222, 222, 222)); + border-width: 1px; + border-radius: 5px; + color: rgb(0,0,0); + padding: 2px; + background-color: rgb(142,142,142); +} +QPushButton:disabled{ + border-style: solid; + border-top-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(215, 215, 215), stop:1 rgb(222, 222, 222)); + border-right-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(217, 217, 217), stop:1 rgb(227, 227, 227)); + border-left-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(227, 227, 227), stop:1 rgb(217, 217, 217)); + border-bottom-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(215, 215, 215), stop:1 rgb(222, 222, 222)); + border-width: 1px; + border-radius: 5px; + color: #808086; + padding: 2px; + background-color: rgb(142,142,142); +} +QLineEdit { + border-width: 1px; border-radius: 4px; + border-style: solid; + border-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255)); +} +QLabel { + color: #000000; +} +QLCDNumber { + color: rgb(0, 113, 255, 255); +} +QProgressBar { + text-align: center; + color: rgb(240, 240, 240); + border-width: 1px; + border-radius: 10px; + border-color: rgb(230, 230, 230); + border-style: solid; + background-color:rgb(207,207,207); +} +QProgressBar::chunk { + background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(49, 147, 250, 255), stop:1 rgba(34, 142, 255, 255)); + border-radius: 10px; +} +QMenuBar { + background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(207, 209, 207, 255), stop:1 rgba(230, 229, 230, 255)); +} +QMenuBar::item { + color: #000000; + spacing: 3px; + padding: 1px 4px; + background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(207, 209, 207, 255), stop:1 rgba(230, 229, 230, 255)); +} + +QMenuBar::item:selected { + background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255)); + color: #FFFFFF; +} +QMenu::item:selected { + border-style: solid; + border-top-color: transparent; + border-right-color: transparent; + border-left-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255)); + border-bottom-color: transparent; + border-left-width: 2px; + color: #000000; + padding-left:15px; + padding-top:4px; + padding-bottom:4px; + padding-right:7px; +} +QMenu::item { + border-style: solid; + border-top-color: transparent; + border-right-color: transparent; + border-left-color: transparent; + border-bottom-color: transparent; + border-bottom-width: 1px; + color: #000000; + padding-left:17px; + padding-top:4px; + padding-bottom:4px; + padding-right:7px; +} +QTabWidget { + color:rgb(0,0,0); + background-color:#000000; +} +QTabWidget::pane { + border-color: rgb(223,223,223); + background-color:rgb(226,226,226); + border-style: solid; + border-width: 2px; + border-radius: 6px; +} +QTabBar::tab:first { + border-style: solid; + border-left-width:1px; + border-right-width:0px; + border-top-width:1px; + border-bottom-width:1px; + border-top-color: rgb(209,209,209); + border-left-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(209, 209, 209, 209), stop:1 rgba(229, 229, 229, 229)); + border-bottom-color: rgb(229,229,229); + border-top-left-radius: 4px; + border-bottom-left-radius: 4px; + color: #000000; + padding: 3px; + margin-left:0px; + background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(247, 247, 247, 255), stop:1 rgba(255, 255, 255, 255)); +} +QTabBar::tab:last { + border-style: solid; + border-width:1px; + border-top-color: rgb(209,209,209); + border-left-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(209, 209, 209, 209), stop:1 rgba(229, 229, 229, 229)); + border-right-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(209, 209, 209, 209), stop:1 rgba(229, 229, 229, 229)); + border-bottom-color: rgb(229,229,229); + border-top-right-radius: 4px; + border-bottom-right-radius: 4px; + color: #000000; + padding: 3px; + margin-left:0px; + background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(247, 247, 247, 255), stop:1 rgba(255, 255, 255, 255)); +} +QTabBar::tab { + border-style: solid; + border-top-width:1px; + border-bottom-width:1px; + border-left-width:1px; + border-top-color: rgb(209,209,209); + border-left-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(209, 209, 209, 209), stop:1 rgba(229, 229, 229, 229)); + border-bottom-color: rgb(229,229,229); + color: #000000; + padding: 3px; + margin-left:0px; + background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(247, 247, 247, 255), stop:1 rgba(255, 255, 255, 255)); +} +QTabBar::tab:selected, QTabBar::tab:last:selected, QTabBar::tab:hover { + border-style: solid; + border-left-width:1px; + border-right-color: transparent; + border-top-color: rgb(209,209,209); + border-left-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(209, 209, 209, 209), stop:1 rgba(229, 229, 229, 229)); + border-bottom-color: rgb(229,229,229); + color: #FFFFFF; + padding: 3px; + margin-left:0px; + background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255)); +} + +QTabBar::tab:selected, QTabBar::tab:first:selected, QTabBar::tab:hover { + border-style: solid; + border-left-width:1px; + border-bottom-width:1px; + border-top-width:1px; + border-right-color: transparent; + border-top-color: rgb(209,209,209); + border-left-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(209, 209, 209, 209), stop:1 rgba(229, 229, 229, 229)); + border-bottom-color: rgb(229,229,229); + color: #FFFFFF; + padding: 3px; + margin-left:0px; + background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255)); +} + +QCheckBox { + color: #000000; + padding: 2px; +} +QCheckBox:disabled { + color: #808086; + padding: 2px; +} + +QCheckBox:hover { + border-radius:4px; + border-style:solid; + padding-left: 1px; + padding-right: 1px; + padding-bottom: 1px; + padding-top: 1px; + border-width:1px; + border-color: transparent; +} +QCheckBox::indicator:checked { + + height: 10px; + width: 10px; + border-style:solid; + border-width: 1px; + border-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255)); + color: #000000; + background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255)); +} +QCheckBox::indicator:unchecked { + + height: 10px; + width: 10px; + border-style:solid; + border-width: 1px; + border-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255)); + color: #000000; +} +QRadioButton { + color: 000000; + padding: 1px; +} +QRadioButton::indicator:checked { + height: 10px; + width: 10px; + border-style:solid; + border-radius:5px; + border-width: 1px; + border-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255)); + color: #a9b7c6; + background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255)); +} +QRadioButton::indicator:!checked { + height: 10px; + width: 10px; + border-style:solid; + border-radius:5px; + border-width: 1px; + border-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255)); + color: #a9b7c6; + background-color: transparent; +} +QStatusBar { + color:#027f7f; +} +QSpinBox { + border-style: solid; + border-width: 1px; + border-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255)); +} +QDoubleSpinBox { + border-style: solid; + border-width: 1px; + border-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255)); +} +QTimeEdit { + border-style: solid; + border-width: 1px; + border-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255)); +} +QDateTimeEdit { + border-style: solid; + border-width: 1px; + border-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255)); +} +QDateEdit { + border-style: solid; + border-width: 1px; + border-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255)); +} + +QToolBox { + color: #a9b7c6; + background-color:#000000; +} +QToolBox::tab { + color: #a9b7c6; + background-color:#000000; +} +QToolBox::tab:selected { + color: #FFFFFF; + background-color:#000000; +} +QScrollArea { + color: #FFFFFF; + background-color:#000000; +} +QSlider::groove:horizontal { + height: 5px; + background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(49, 147, 250, 255), stop:1 rgba(34, 142, 255, 255)); +} +QSlider::groove:vertical { + width: 5px; + background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(49, 147, 250, 255), stop:1 rgba(34, 142, 255, 255)); +} +QSlider::handle:horizontal { + background: rgb(253,253,253); + border-style: solid; + border-width: 1px; + border-color: rgb(207,207,207); + width: 12px; + margin: -5px 0; + border-radius: 7px; +} +QSlider::handle:vertical { + background: rgb(253,253,253); + border-style: solid; + border-width: 1px; + border-color: rgb(207,207,207); + height: 12px; + margin: 0 -5px; + border-radius: 7px; +} +QSlider::add-page:horizontal { + background: rgb(181,181,181); +} +QSlider::add-page:vertical { + background: rgb(181,181,181); +} +QSlider::sub-page:horizontal { + background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(49, 147, 250, 255), stop:1 rgba(34, 142, 255, 255)); +} +QSlider::sub-page:vertical { + background-color: qlineargradient(spread:pad, y1:0.5, x1:1, y2:0.5, x2:0, stop:0 rgba(49, 147, 250, 255), stop:1 rgba(34, 142, 255, 255)); +} +QScrollBar:horizontal { + max-height: 20px; + border: 1px transparent grey; + margin: 0px 20px 0px 20px; +} +QScrollBar:vertical { + max-width: 20px; + border: 1px transparent grey; + margin: 20px 0px 20px 0px; +} +QScrollBar::handle:horizontal { + background: rgb(253,253,253); + border-style: solid; + border-width: 1px; + border-color: rgb(207,207,207); + border-radius: 7px; + min-width: 25px; +} +QScrollBar::handle:horizontal:hover { + background: rgb(253,253,253); + border-style: solid; + border-width: 1px; + border-color: rgb(147, 200, 200); + border-radius: 7px; + min-width: 25px; +} +QScrollBar::handle:vertical { + background: rgb(253,253,253); + border-style: solid; + border-width: 1px; + border-color: rgb(207,207,207); + border-radius: 7px; + min-height: 25px; +} +QScrollBar::handle:vertical:hover { + background: rgb(253,253,253); + border-style: solid; + border-width: 1px; + border-color: rgb(147, 200, 200); + border-radius: 7px; + min-height: 25px; +} +QScrollBar::add-line:horizontal { + border: 2px transparent grey; + border-top-right-radius: 7px; + border-bottom-right-radius: 7px; + background: rgba(34, 142, 255, 255); + width: 20px; + subcontrol-position: right; + subcontrol-origin: margin; +} +QScrollBar::add-line:horizontal:pressed { + border: 2px transparent grey; + border-top-right-radius: 7px; + border-bottom-right-radius: 7px; + background: rgb(181,181,181); + width: 20px; + subcontrol-position: right; + subcontrol-origin: margin; +} +QScrollBar::add-line:vertical { + border: 2px transparent grey; + border-bottom-left-radius: 7px; + border-bottom-right-radius: 7px; + background: rgba(34, 142, 255, 255); + height: 20px; + subcontrol-position: bottom; + subcontrol-origin: margin; +} +QScrollBar::add-line:vertical:pressed { + border: 2px transparent grey; + border-bottom-left-radius: 7px; + border-bottom-right-radius: 7px; + background: rgb(181,181,181); + height: 20px; + subcontrol-position: bottom; + subcontrol-origin: margin; +} +QScrollBar::sub-line:horizontal { + border: 2px transparent grey; + border-top-left-radius: 7px; + border-bottom-left-radius: 7px; + background: rgba(34, 142, 255, 255); + width: 20px; + subcontrol-position: left; + subcontrol-origin: margin; +} +QScrollBar::sub-line:horizontal:pressed { + border: 2px transparent grey; + border-top-left-radius: 7px; + border-bottom-left-radius: 7px; + background: rgb(181,181,181); + width: 20px; + subcontrol-position: left; + subcontrol-origin: margin; +} +QScrollBar::sub-line:vertical { + border: 2px transparent grey; + border-top-left-radius: 7px; + border-top-right-radius: 7px; + background: rgba(34, 142, 255, 255); + height: 20px; + subcontrol-position: top; + subcontrol-origin: margin; +} +QScrollBar::sub-line:vertical:pressed { + border: 2px transparent grey; + border-top-left-radius: 7px; + border-top-right-radius: 7px; + background: rgb(181,181,181); + height: 20px; + subcontrol-position: top; + subcontrol-origin: margin; +} +QScrollBar::left-arrow:horizontal { + border: 1px transparent grey; + border-top-left-radius: 3px; + border-bottom-left-radius: 3px; + width: 6px; + height: 6px; + background: white; +} +QScrollBar::right-arrow:horizontal { + border: 1px transparent grey; + border-top-right-radius: 3px; + border-bottom-right-radius: 3px; + width: 6px; + height: 6px; + background: white; +} +QScrollBar::up-arrow:vertical { + border: 1px transparent grey; + border-top-left-radius: 3px; + border-top-right-radius: 3px; + width: 6px; + height: 6px; + background: white; +} +QScrollBar::down-arrow:vertical { + border: 1px transparent grey; + border-bottom-left-radius: 3px; + border-bottom-right-radius: 3px; + width: 6px; + height: 6px; + background: white; +} +QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal { + background: none; +} +QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical { + background: none; +} \ No newline at end of file diff --git a/qcss/style3 b/qcss/style3 new file mode 100644 index 0000000..f57932b --- /dev/null +++ b/qcss/style3 @@ -0,0 +1,954 @@ +/* +* The MIT License (MIT) +* +* Copyright : http://blog.csdn.net/liang19890820 +* +* Author : ?????? +* +* Date : 2016/07/22 +* +* Description : ???? +* +*/ + +/**********?????**********/ +QWidget#customWidget { + background: rgb(173, 202, 232); +} + +/**********???????**********/ +QWidget#centerWidget { + background: rgb(232, 241, 252); +} + +/**********?????**********/ +QWidget#mainWindow { + border: 1px solid rgb(111, 156, 207); + background: rgb(232, 241, 252); +} + +QWidget#messageWidget { + background: rgba(173, 202, 232, 50%); +} + +QWidget#loadingWidget { + border: none; + border-radius: 5px; + background: rgb(187, 212, 238); +} + +QWidget#remoteWidget { + border-top-right-radius: 10px; + border-bottom-right-radius: 10px; + border: 1px solid rgb(111, 156, 207); + border-left: none; + background: transparent; +} + +StyledWidget { + qproperty-normalColor: rgb(65, 65, 65); + qproperty-disableColor: rgb(180, 180, 180); + qproperty-highlightColor: rgb(0, 160, 230); + qproperty-errorColor: red; +} + +QProgressIndicator { + qproperty-color: rgb(2, 65, 132); +} + +/**********??**********/ +QToolTip{ + border: 1px solid rgb(111, 156, 207); + background: white; + color: rgb(51, 51, 51); +} + +/**********???**********/ +QMenuBar { + background: rgb(187, 212, 238); + border: 1px solid rgb(111, 156, 207); + border-left: none; + border-right: none; +} +QMenuBar::item { + border: 1px solid transparent; + padding: 5px 10px 5px 10px; + background: transparent; +} +QMenuBar::item:enabled { + color: rgb(2, 65, 132); +} +QMenuBar::item:!enabled { + color: rgb(155, 155, 155); +} +QMenuBar::item:enabled:selected { + border-top-color: rgb(111, 156, 207); + border-bottom-color: rgb(111, 156, 207); + background: rgb(198, 224, 252); +} + +/**********??**********/ +QMenu { + border: 1px solid rgb(111, 156, 207); + background: rgb(232, 241, 250); +} +QMenu::item { + height: 22px; + padding: 0px 25px 0px 20px; +} +QMenu::item:enabled { + color: rgb(84, 84, 84); +} +QMenu::item:!enabled { + color: rgb(155, 155, 155); +} +QMenu::item:enabled:selected { + color: rgb(2, 65, 132); + background: rgba(255, 255, 255, 200); +} +QMenu::separator { + height: 1px; + background: rgb(111, 156, 207); +} +QMenu::indicator { + width: 13px; + height: 13px; +} +QMenu::icon { + padding-left: 2px; + padding-right: 2px; +} + +/**********???**********/ +QStatusBar { + background: rgb(187, 212, 238); + border: 1px solid rgb(111, 156, 207); + border-left: none; + border-right: none; + border-bottom: none; +} +QStatusBar::item { + border: none; + border-right: 1px solid rgb(111, 156, 207); +} + +/**********???**********/ +QGroupBox { + font-size: 15px; + border: 1px solid rgb(111, 156, 207); + border-radius: 4px; + margin-top: 10px; +} +QGroupBox::title { + color: rgb(56, 99, 154); + top: -12px; + left: 10px; +} + +/**********???**********/ +QTabWidget::pane { + border: none; + border-top: 3px solid rgb(0, 78, 161); + background: rgb(187, 212, 238); +} +QTabWidget::tab-bar { + border: none; +} +QTabBar::tab { + border: none; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + color: white; + background: rgb(120, 170, 220); + height: 28px; + min-width: 85px; + margin-right: 5px; + padding-left: 5px; + padding-right: 5px; +} +QTabBar::tab:hover { + background: rgb(0, 78, 161); +} +QTabBar::tab:selected { + color: white; + background: rgb(0, 78, 161); +} + +QTabWidget#tabWidget::pane { + border: 1px solid rgb(111, 156, 207); + background: rgb(232, 241, 252); + margin-top: -1px; +} + +QTabBar#tabBar::tab { + border: 1px solid rgb(111, 156, 207); + border-bottom: none; + color: rgb(70, 71, 73); + background: transparent; +} +QTabBar#tabBar::tab:hover { + color: rgb(2, 65, 132); +} +QTabBar#tabBar::tab:selected { + color: rgb(2, 65, 132); + background: rgb(232, 241, 252); +} + +/**********??**********/ +QHeaderView{ + border: none; + border-bottom: 3px solid rgb(0, 78, 161); + background: transparent; + min-height: 30px; +} +QHeaderView::section:horizontal { + border: none; + color: rgb(2, 65, 132); + background: transparent; + padding-left: 5px; +} +QHeaderView::section:horizontal:hover { + color: white; + background: rgb(0, 78, 161); +} +QHeaderView::section:horizontal:pressed { + color: white; + background: rgb(6, 94, 187); +} +QHeaderView::up-arrow { + width: 13px; + height: 11px; + padding-right: 5px; + image: url(:/White/topArrow); + subcontrol-position: center right; +} +QHeaderView::up-arrow:hover, QHeaderView::up-arrow:pressed { + image: url(:/White/topArrowHover); +} +QHeaderView::down-arrow { + width: 13px; + height: 11px; + padding-right: 5px; + image: url(:/White/bottomArrow); + subcontrol-position: center right; +} +QHeaderView::down-arrow:hover, QHeaderView::down-arrow:pressed { + image: url(:/White/bottomArrowHover); +} + +/**********??**********/ +QTableView { + border: 1px solid rgb(111, 156, 207); + background: rgb(224, 238, 255); + gridline-color: rgb(111, 156, 207); +} +QTableView::item { + padding-left: 5px; + padding-right: 5px; + border: none; + background: white; + border-right: 1px solid rgb(111, 156, 207); + border-bottom: 1px solid rgb(111, 156, 207); +} +QTableView::item:selected { + background: rgba(255, 255, 255, 100); +} +QTableView::item:selected:!active { + color: rgb(65, 65, 65); +} +QTableView::indicator { + width: 20px; + height: 20px; +} +QTableView::indicator:enabled:unchecked { + image: url(:/White/checkBox); +} +QTableView::indicator:enabled:unchecked:hover { + image: url(:/White/checkBoxHover); +} +QTableView::indicator:enabled:unchecked:pressed { + image: url(:/White/checkBoxPressed); +} +QTableView::indicator:enabled:checked { + image: url(:/White/checkBoxChecked); +} +QTableView::indicator:enabled:checked:hover { + image: url(:/White/checkBoxCheckedHover); +} +QTableView::indicator:enabled:checked:pressed { + image: url(:/White/checkBoxCheckedPressed); +} +QTableView::indicator:enabled:indeterminate { + image: url(:/White/checkBoxIndeterminate); +} +QTableView::indicator:enabled:indeterminate:hover { + image: url(:/White/checkBoxIndeterminateHover); +} +QTableView::indicator:enabled:indeterminate:pressed { + image: url(:/White/checkBoxIndeterminatePressed); +} + +/**********???-??**********/ +QScrollBar:horizontal { + height: 20px; + background: transparent; + margin-top: 3px; + margin-bottom: 3px; +} +QScrollBar::handle:horizontal { + height: 20px; + min-width: 30px; + background: rgb(170, 200, 230); + margin-left: 15px; + margin-right: 15px; +} +QScrollBar::handle:horizontal:hover { + background: rgb(165, 195, 225); +} +QScrollBar::sub-line:horizontal { + width: 15px; + background: transparent; + image: url(:/White/arrowLeft); + subcontrol-position: left; +} +QScrollBar::add-line:horizontal { + width: 15px; + background: transparent; + image: url(:/White/arrowRight); + subcontrol-position: right; +} +QScrollBar::sub-line:horizontal:hover { + background: rgb(170, 200, 230); +} +QScrollBar::add-line:horizontal:hover { + background: rgb(170, 200, 230); +} +QScrollBar::add-page:horizontal,QScrollBar::sub-page:horizontal { + background: transparent; +} + +/**********???-??**********/ +QScrollBar:vertical { + width: 20px; + background: transparent; + margin-left: 3px; + margin-right: 3px; +} +QScrollBar::handle:vertical { + width: 20px; + min-height: 30px; + background: rgb(170, 200, 230); + margin-top: 15px; + margin-bottom: 15px; +} +QScrollBar::handle:vertical:hover { + background: rgb(165, 195, 225); +} +QScrollBar::sub-line:vertical { + height: 15px; + background: transparent; + image: url(:/White/topArrow); + subcontrol-position: top; +} +QScrollBar::add-line:vertical { + height: 15px; + background: transparent; + image: url(:/White/bottomArrow); + subcontrol-position: bottom; +} +QScrollBar::sub-line:vertical:hover { + background: rgb(170, 200, 230); +} +QScrollBar::add-line:vertical:hover { + background: rgb(170, 200, 230); +} +QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical { + background: transparent; +} + +QScrollBar#verticalScrollBar:vertical { + margin-top: 30px; +} + +/**********????**********/ +QComboBox { + height: 25px; + border-radius: 4px; + border: 1px solid rgb(111, 156, 207); + background: white; +} +QComboBox:enabled { + color: rgb(84, 84, 84); +} +QComboBox:!enabled { + color: rgb(80, 80, 80); +} +QComboBox:enabled:hover, QComboBox:enabled:focus { + color: rgb(51, 51, 51); +} +QComboBox::drop-down { + width: 20px; + border: none; + background: transparent; +} +QComboBox::drop-down:hover { + background: rgba(255, 255, 255, 30); +} +QComboBox::down-arrow { + image: url(:/White/arrowBottom); +} +QComboBox::down-arrow:on { + /**top: 1px;**/ +} +QComboBox QAbstractItemView { + border: 1px solid rgb(111, 156, 207); + background: white; + outline: none; +} +QComboBox QAbstractItemView::item { + height: 25px; + color: rgb(73, 73, 73); +} +QComboBox QAbstractItemView::item:selected { + background: rgb(232, 241, 250); + color: rgb(2, 65, 132); +} + +/**********???**********/ +QProgressBar{ + border: none; + text-align: center; + color: white; + background: rgb(173, 202, 232); +} +QProgressBar::chunk { + background: rgb(16, 135, 209); +} + +QProgressBar#progressBar { + border: none; + text-align: center; + color: white; + background-color: transparent; + background-image: url(":/White/progressBar"); + background-repeat: repeat-x; +} +QProgressBar#progressBar::chunk { + border: none; + background-color: transparent; + background-image: url(":/White/progressBarChunk"); + background-repeat: repeat-x; +} + +/**********???**********/ +QCheckBox{ + spacing: 5px; +} +QCheckBox:enabled:checked{ + color: rgb(2, 65, 132); +} +QCheckBox:enabled:!checked{ + color: rgb(70, 71, 73); +} +QCheckBox:enabled:hover{ + color: rgb(0, 78, 161); +} +QCheckBox:!enabled{ + color: rgb(80, 80, 80); +} +QCheckBox::indicator { + width: 20px; + height: 20px; +} +QCheckBox::indicator:unchecked { + image: url(:/White/checkBox); +} +QCheckBox::indicator:unchecked:hover { + image: url(:/White/checkBoxHover); +} +QCheckBox::indicator:unchecked:pressed { + image: url(:/White/checkBoxPressed); +} +QCheckBox::indicator:checked { + image: url(:/White/checkBoxChecked); +} +QCheckBox::indicator:checked:hover { + image: url(:/White/checkBoxCheckedHover); +} +QCheckBox::indicator:checked:pressed { + image: url(:/White/checkBoxCheckedPressed); +} +QCheckBox::indicator:indeterminate { + image: url(:/White/checkBoxIndeterminate); +} +QCheckBox::indicator:indeterminate:hover { + image: url(:/White/checkBoxIndeterminateHover); +} +QCheckBox::indicator:indeterminate:pressed { + image: url(:/White/checkBoxIndeterminatePressed); +} + +/**********???**********/ +QRadioButton{ + spacing: 5px; +} +QRadioButton:enabled:checked{ + color: rgb(2, 65, 132); +} +QRadioButton:enabled:!checked{ + color: rgb(70, 71, 73); +} +QRadioButton:enabled:hover{ + color: rgb(0, 78, 161); +} +QRadioButton:!enabled{ + color: rgb(80, 80, 80); +} +QRadioButton::indicator { + width: 20px; + height: 20px; +} +QRadioButton::indicator:unchecked { + image: url(:/White/radioButton); +} +QRadioButton::indicator:unchecked:hover { + image: url(:/White/radioButtonHover); +} +QRadioButton::indicator:unchecked:pressed { + image: url(:/White/radioButtonPressed); +} +QRadioButton::indicator:checked { + image: url(:/White/radioButtonChecked); +} +QRadioButton::indicator:checked:hover { + image: url(:/White/radioButtonCheckedHover); +} +QRadioButton::indicator:checked:pressed { + image: url(:/White/radioButtonCheckedPressed); +} + +/**********???**********/ +QLineEdit { + border-radius: 4px; + height: 25px; + border: 1px solid rgb(111, 156, 207); + background: white; +} +QLineEdit:enabled { + color: rgb(84, 84, 84); +} +QLineEdit:enabled:hover, QLineEdit:enabled:focus { + color: rgb(51, 51, 51); +} +QLineEdit:!enabled { + color: rgb(80, 80, 80); +} + +/**********?????**********/ +QTextEdit { + border: 1px solid rgb(111, 156, 207); + color: rgb(70, 71, 73); + background: rgb(187, 212, 238); +} + +/**********????**********/ +QScrollArea { + border: 1px solid rgb(111, 156, 207); + background: rgb(187, 212, 238); +} + +/**********????**********/ +QWidget#transparentWidget { + background: transparent; +} + +/**********???**********/ +QSpinBox { + border-radius: 4px; + height: 24px; + min-width: 40px; + border: 1px solid rgb(111, 156, 207); + background: white; +} +QSpinBox:enabled { + color: rgb(60, 60, 60); +} +QSpinBox:enabled:hover, QSpinBox:enabled:focus { + color: rgb(51, 51, 51); +} +QSpinBox:!enabled { + color: rgb(210, 210, 210); + background: transparent; +} +QSpinBox::up-button { + border-left: 1px solid rgb(111, 156, 207); + width: 18px; + height: 12px; + border-top-right-radius: 4px; + image: url(:/White/upButton); +} +QSpinBox::up-button:!enabled { + background: transparent; +} +QSpinBox::up-button:enabled:hover { + background: rgb(255, 255, 255, 30); +} +QSpinBox::down-button { + border-left: 1px solid rgb(111, 156, 207); + width: 18px; + height: 12px; + border-bottom-right-radius: 4px; + image: url(:/White/downButton); +} +QSpinBox::down-button:!enabled { + background: transparent; +} +QSpinBox::down-button:hover { + background: rgb(255, 255, 255, 30); +} + +/**********??**********/ +QLabel#grayLabel { + color: rgb(70, 71, 73); +} + +QLabel#highlightLabel { + color: rgb(2, 65, 132); +} + +QLabel#redLabel { + color: red; +} + +QLabel#grayYaHeiLabel { + color: rgb(175, 175, 175); + font-size: 16px; +} + +QLabel#blueLabel { + color: rgb(0, 160, 230); +} + +QLabel#listLabel { + color: rgb(51, 51, 51); +} + +QLabel#lineBlueLabel { + background: rgb(0, 78, 161); +} + +QLabel#graySeperateLabel { + background: rgb(200, 220, 230); +} + +QLabel#seperateLabel { + background: rgb(112, 153, 194); +} + +QLabel#radiusBlueLabel { + border-radius: 15px; + color: white; + font-size: 16px; + background: rgb(0, 78, 161); +} + +QLabel#skinLabel[colorProperty="normal"] { + color: rgb(56, 99, 154); +} +QLabel#skinLabel[colorProperty="highlight"] { + color: rgb(0, 160, 230); +} + +QLabel#informationLabel { + qproperty-pixmap: url(:/White/information); +} + +QLabel#errorLabel { + qproperty-pixmap: url(:/White/error); +} + +QLabel#successLabel { + qproperty-pixmap: url(:/White/success); +} + +QLabel#questionLabel { + qproperty-pixmap: url(:/White/question); +} + +QLabel#warningLabel { + qproperty-pixmap: url(:/White/warning); +} + +QLabel#groupLabel { + color: rgb(56, 99, 154); + border: 1px solid rgb(111, 156, 207); + font-size: 15px; + border-top-color: transparent; + border-right-color: transparent; + border-left-color: transparent; +} + +/**********??**********/ +QToolButton#nsccButton { + border: none; + color: rgb(2, 65, 132); + background: transparent; + padding: 10px; + qproperty-icon: url(:/White/nscc); + qproperty-iconSize: 32px 32px; + qproperty-toolButtonStyle: ToolButtonTextUnderIcon; +} +QToolButton#nsccButton:hover { + background: rgb(187, 212, 238); +} + +QToolButton#transferButton { + border: none; + color: rgb(2, 65, 132); + background: transparent; + padding: 10px; + qproperty-icon: url(:/White/transfer); + qproperty-iconSize: 32px 32px; + qproperty-toolButtonStyle: ToolButtonTextUnderIcon; +} +QToolButton#transferButton:hover { + background: rgb(187, 212, 238); +} + +/**********??**********/ +QPushButton{ + border-radius: 4px; + border: none; + width: 75px; + height: 25px; +} +QPushButton:enabled { + background: rgb(120, 170, 220); + color: white; +} +QPushButton:!enabled { + background: rgb(180, 180, 180); + color: white; +} +QPushButton:enabled:hover{ + background: rgb(100, 160, 220); +} +QPushButton:enabled:pressed{ + background: rgb(0, 78, 161); +} + +QPushButton#blueButton { + color: white; +} +QPushButton#blueButton:enabled { + background: rgb(0, 78, 161); + color: white; +} +QPushButton:!enabled { + background: rgb(180, 180, 180); + color: white; +} +QPushButton#blueButton:enabled:hover { + background: rgb(2, 65, 132); +} +QPushButton#blueButton:enabled:pressed { + background: rgb(6, 94, 187); +} + +QPushButton#selectButton { + border: none; + border-radius: none; + border-left: 1px solid rgb(111, 156, 207); + background: transparent; + image: url(:/White/scan); + color: rgb(51, 51, 51); +} +QPushButton#selectButton:enabled:hover{ + background: rgb(187, 212, 238); +} +QPushButton#selectButton:enabled:pressed{ + background: rgb(120, 170, 220); +} + +QPushButton#linkButton { + background: transparent; + color: rgb(0, 160, 230); + text-align:left; +} +QPushButton#linkButton:hover { + color: rgb(20, 185, 255); + text-decoration: underline; +} +QPushButton#linkButton:pressed { + color: rgb(0, 160, 230); +} + +QPushButton#transparentButton { + background: transparent; +} + +/*****************?????*******************/ +QPushButton#minimizeButton { + border-radius: none; + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; + background: rgb(120, 170, 220); + image: url(:/White/minimizeHover); +} +QPushButton#minimizeButton:hover { + image: url(:/White/minimize); +} +QPushButton#minimizeButton:pressed { + image: url(:/White/minimizePressed); +} + +QPushButton#maximizeButton[maximizeProperty="maximize"] { + border-radius: none; + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; + background: rgb(120, 170, 220); + image: url(:/White/maximizeHover); +} +QPushButton#maximizeButton[maximizeProperty="maximize"]:hover { + image: url(:/White/maximize); +} +QPushButton#maximizeButton[maximizeProperty="maximize"]:pressed { + image: url(:/White/maximizePressed); +} + +QPushButton#maximizeButton[maximizeProperty="restore"] { + border-radius: none; + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; + background: rgb(120, 170, 220); + image: url(:/White/restoreHover); +} +QPushButton#maximizeButton[maximizeProperty="restore"]:hover { + image: url(:/White/restore); +} +QPushButton#maximizeButton[maximizeProperty="restore"]:pressed { + image: url(:/White/restorePressed); +} + +QPushButton#closeButton { + border-radius: none; + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; + background: rgb(120, 170, 220); + image: url(:/White/closeHover); +} +QPushButton#closeButton:hover { + image: url(:/White/close); +} +QPushButton#closeButton:pressed { + image: url(:/White/closePressed); +} + +QPushButton#skinButton { + border-radius: none; + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; + background: rgb(120, 170, 220); + image: url(:/White/skinHover); +} +QPushButton#skinButton:hover { + image: url(:/White/skin); +} +QPushButton#skinButton:pressed { + image: url(:/White/skinPressed); +} + +QPushButton#feedbackButton { + border-radius: none; + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; + background: rgb(120, 170, 220); + image: url(:/White/feedbackHover); +} +QPushButton#feedbackButton:hover { + image: url(:/White/feedback); +} +QPushButton#feedbackButton:pressed { + image: url(:/White/feedbackPressed); +} + +QPushButton#closeTipButton { + border-radius: none; + border-image: url(:/White/close); + background: transparent; +} +QPushButton#closeTipButton:hover { + border-image: url(:/White/closeHover); +} +QPushButton#closeTipButton:pressed { + border-image: url(:/White/closePressed); +} + +QPushButton#changeSkinButton{ + border-radius: 4px; + border: 2px solid rgb(111, 156, 207); + background: rgb(204, 227, 252); +} +QPushButton#changeSkinButton:hover{ + border-color: rgb(60, 150, 200); +} +QPushButton#changeSkinButton:pressed, QPushButton#changeSkinButton:checked{ + border-color: rgb(0, 160, 230); +} + +QPushButton#transferButton { + padding-left: 5px; + padding-right: 5px; + color: white; + background: rgb(0, 78, 161); +} +QPushButton#transferButton:hover { + background: rgb(2, 65, 132); +} +QPushButton#transferButton:pressed { + background: rgb(6, 94, 187); +} +QPushButton#transferButton[iconProperty="left"] { + qproperty-icon: url(:/White/left); +} +QPushButton#transferButton[iconProperty="right"] { + qproperty-icon: url(:/White/right); +} + +QPushButton#openButton { + border-radius: none; + image: url(:/White/open); + background: transparent; +} +QPushButton#openButton:hover { + image: url(:/White/openHover); +} +QPushButton#openButton:pressed { + image: url(:/White/openPressed); +} + +QPushButton#deleteButton { + border-radius: none; + image: url(:/White/delete); + background: transparent; +} +QPushButton#deleteButton:hover { + image: url(:/White/deleteHover); +} +QPushButton#deleteButton:pressed { + image: url(:/White/deletePressed); +} + +QPushButton#menuButton { + text-align: left center; + padding-left: 3px; + color: rgb(84, 84, 84); + border: 1px solid rgb(111, 156, 207); + background: white; +} +QPushButton#menuButton::menu-indicator{ + subcontrol-position: right center; + subcontrol-origin: padding; + image: url(:/White/arrowBottom); + padding-right: 3px; +} \ No newline at end of file diff --git a/release/V9/CameraLightingController.exe b/release/V9/CameraLightingController.exe new file mode 100644 index 0000000..7182bf0 Binary files /dev/null and b/release/V9/CameraLightingController.exe differ diff --git a/release/v3.0/CameraLightingController.exe b/release/v3.0/CameraLightingController.exe new file mode 100644 index 0000000..6a9be8e Binary files /dev/null and b/release/v3.0/CameraLightingController.exe differ diff --git a/release/v6/CameraLightingControllerV6.exe b/release/v6/CameraLightingControllerV6.exe new file mode 100644 index 0000000..610172f Binary files /dev/null and b/release/v6/CameraLightingControllerV6.exe differ diff --git a/src/app/main.cpp b/src/app/main.cpp new file mode 100644 index 0000000..49ba1df --- /dev/null +++ b/src/app/main.cpp @@ -0,0 +1,39 @@ +#include +#include +// #include +#include +// +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "zqtui/mainpage/mainwindow.h" +// +#include +// +#include +// +#define TAG "Main" +using namespace std; +QT_CHARTS_USE_NAMESPACE + +int main(int argc, char *argv[]) { + WSADATA wsaData; + WSAStartup(MAKEWORD(2, 2), &wsaData); + + QApplication a(argc, argv); + MainWindow w; + w.show(); + return a.exec(); +} diff --git a/src/app/syncbox16ch/syncbox16ch.cpp b/src/app/syncbox16ch/syncbox16ch.cpp new file mode 100644 index 0000000..b2b278e --- /dev/null +++ b/src/app/syncbox16ch/syncbox16ch.cpp @@ -0,0 +1,14 @@ +#include "syncbox16ch.h" +#include "ui_syncbox16ch.h" + +syncbox16ch::syncbox16ch(QWidget *parent) : + QWidget(parent), + ui(new Ui::syncbox16ch) +{ + ui->setupUi(this); +} + +syncbox16ch::~syncbox16ch() +{ + delete ui; +} diff --git a/src/app/syncbox16ch/syncbox16ch.h b/src/app/syncbox16ch/syncbox16ch.h new file mode 100644 index 0000000..b9380a7 --- /dev/null +++ b/src/app/syncbox16ch/syncbox16ch.h @@ -0,0 +1,22 @@ +#ifndef SYNCBOX16CH_H +#define SYNCBOX16CH_H + +#include + +namespace Ui { +class syncbox16ch; +} + +class syncbox16ch : public QWidget +{ + Q_OBJECT + +public: + explicit syncbox16ch(QWidget *parent = nullptr); + ~syncbox16ch(); + +private: + Ui::syncbox16ch *ui; +}; + +#endif // SYNCBOX16CH_H diff --git a/src/app/syncbox16ch/syncbox16ch.ui b/src/app/syncbox16ch/syncbox16ch.ui new file mode 100644 index 0000000..813bd8b --- /dev/null +++ b/src/app/syncbox16ch/syncbox16ch.ui @@ -0,0 +1,58 @@ + + + syncbox16ch + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + 80 + 50 + 111 + 41 + + + + PushButton + + + + + + 240 + 120 + 91 + 51 + + + + ... + + + + + + 40 + 170 + 121 + 71 + + + + PushButton + + + + + + diff --git a/src/zqtui/base/QFunction.cpp b/src/zqtui/base/QFunction.cpp new file mode 100644 index 0000000..7a73688 --- /dev/null +++ b/src/zqtui/base/QFunction.cpp @@ -0,0 +1,4 @@ +#include "qfunction.hpp" +QFunction::QFunction() : QObject(nullptr) {} +QFunction::QFunction(std::function func, QObject *parent) : m_func(func), QObject(parent) {} +std::function &QFunction::get() { return m_func; } diff --git a/src/zqtui/base/QFunction.hpp b/src/zqtui/base/QFunction.hpp new file mode 100644 index 0000000..d5fe2c3 --- /dev/null +++ b/src/zqtui/base/QFunction.hpp @@ -0,0 +1,26 @@ +#ifndef QFUNCTION_HPP +#define QFUNCTION_HPP + +#include +#include +class QFunction : public QObject { + Q_OBJECT + + std::function m_func; + + public: + explicit QFunction(std::function func, QObject *parent = nullptr); + QFunction(); + QFunction(const QFunction &other) { m_func = other.m_func; } + QFunction &operator=(const QFunction &other) { + m_func = other.m_func; + return *this; + } + std::function &get(); + + // 拷贝构造函数 + + signals: +}; + +#endif // QFUNCTION_HPP diff --git a/src/zqtui/base/logger.cpp b/src/zqtui/base/logger.cpp new file mode 100644 index 0000000..26822df --- /dev/null +++ b/src/zqtui/base/logger.cpp @@ -0,0 +1,45 @@ +#include "logger.hpp" + +#include +#include +#include +#include + +void zos_log(const char* fmt, ...) { + va_list args; + va_start(args, fmt); + char buf[1024] = {0}; + vsnprintf(buf, sizeof(buf), fmt, args); + qInfo() << buf; + va_end(args); +} + +uint32_t zos_get_ticket() { return (uint32_t)QDateTime::currentMSecsSinceEpoch(); } + +std::string zhex2str(const uint8_t* hex, size_t len) { + std::string str; + for (size_t i = 0; i < len; i++) { + char buf[3] = {0}; + snprintf(buf, sizeof(buf), "%02x ", hex[i]); + str += buf; + } + return str; +} + +std::string zhex2binary(uint8_t hex) { + std::string str; + for (int i = 0; i < 8; i++) { + str += (hex & 0x80) ? "1" : "0"; + hex <<= 1; + } + return str; +} + +std::string zhex32ToBinary(uint32_t hex) { + std::string str; + for (int i = 0; i < 32; i++) { + str += (hex & 0x80000000) ? "1" : "0"; + hex <<= 1; + } + return str; +} diff --git a/src/zqtui/base/logger.hpp b/src/zqtui/base/logger.hpp new file mode 100644 index 0000000..8b52340 --- /dev/null +++ b/src/zqtui/base/logger.hpp @@ -0,0 +1,25 @@ + +#pragma once +#include + +#include + +void zos_log(const char* fmt, ...); +uint32_t zos_get_ticket(); + +std::string zhex2str(const uint8_t* hex, size_t len); +std::string zhex2binary(uint8_t hex); +std::string zhex32ToBinary(uint32_t hex); + +#define ZLOGI(TAG, fmt, ...) zos_log("%08lu INFO [%-10s] " fmt "", zos_get_ticket(), TAG, ##__VA_ARGS__); +#define ZLOGD(TAG, fmt, ...) zos_log("%08lu DEBU [%-10s] " fmt "", zos_get_ticket(), TAG, ##__VA_ARGS__); +#define ZLOGE(TAG, fmt, ...) zos_log("%08lu ERRO [%-10s] " fmt "", zos_get_ticket(), TAG, ##__VA_ARGS__); +#define ZLOGW(TAG, fmt, ...) zos_log("%08lu WARN [%-10s] " fmt "", zos_get_ticket(), TAG, ##__VA_ARGS__); +#define ZASSERT(cond) \ + if (!(cond)) { \ + ZLOGE("ASSERT", "condition: %s", #cond); \ + exit(-1); \ + } + + +#define ZARRAY_SIZE(array) (sizeof(array) / sizeof(array[0])) \ No newline at end of file diff --git a/src/zqtui/base/zexception.hpp b/src/zqtui/base/zexception.hpp new file mode 100644 index 0000000..b1b59a5 --- /dev/null +++ b/src/zqtui/base/zexception.hpp @@ -0,0 +1,52 @@ +#pragma once + +#include +#include + +namespace std _GLIBCXX_VISIBILITY(default) { + +class zexception : public exception { + string m_ecodeinfo = ""; + int32_t m_ecode = 0; + + public: + /** Takes a character string describing the error. */ + explicit zexception(int32_t ecode, const string& __arg) { + m_ecodeinfo = __arg; + m_ecode = ecode; + } + + const char* what() const noexcept override { return m_ecodeinfo.c_str(); } + int32_t ecode() const noexcept { return m_ecode; } +}; + +typedef enum { + ke_ok = 10000 + 0, + ke_error = 10000 + 1, + ke_channel_is_close = 10000 + 2, + ke_invalid_param = 10000 + 3, + ke_invalid_packet_format = 10000 + 4, + ke_overtime = 10000 + 5, + ke_parse_config_file_fail = 10000 + 6, +} zecode_t; + +static inline const char* zecode2str(zecode_t ecode) { + switch (ecode) { + case ke_ok: + return "success"; + case ke_channel_is_close: + return "channel_is_close"; + case ke_invalid_param: + return "invalid_param"; + case ke_invalid_packet_format: + return "invalid_packet_format"; + case ke_overtime: + return "overtime"; + case ke_parse_config_file_fail: + return "parse_config_file_fail"; + default: + return "unkown error"; + } +} + +} // namespace std _GLIBCXX_VISIBILITY(default) diff --git a/src/zqtui/base/zqthread.cpp b/src/zqtui/base/zqthread.cpp new file mode 100644 index 0000000..5444615 --- /dev/null +++ b/src/zqtui/base/zqthread.cpp @@ -0,0 +1,17 @@ +#include "zqthread.hpp" +using namespace iflytop; +using namespace std; + +ZQThread::ZQThread(const char* name, function cb) { + name_ = QString(name); + cb_ = cb; +} + +void ZQThread::run() { + if (cb_) cb_(); +} + +void ZQThread::quit() { + tryexitflag_ = true; + QThread::quit(); +} diff --git a/src/zqtui/base/zqthread.hpp b/src/zqtui/base/zqthread.hpp new file mode 100644 index 0000000..a35a267 --- /dev/null +++ b/src/zqtui/base/zqthread.hpp @@ -0,0 +1,37 @@ +#pragma once +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// +#include +#include + +namespace iflytop { +using namespace std; + +class ZQThread : public QThread { + Q_OBJECT + private: + QString name_; + function cb_; + bool tryexitflag_ = false; + + public: + ZQThread(const char* name, function cb); + void quit(); + + bool isTryExit() { return tryexitflag_; } + + protected: + virtual void run() override; +}; + +} // namespace xsync \ No newline at end of file diff --git a/src/zqtui/base/zworkqueue.cpp b/src/zqtui/base/zworkqueue.cpp new file mode 100644 index 0000000..4d5e9b8 --- /dev/null +++ b/src/zqtui/base/zworkqueue.cpp @@ -0,0 +1,52 @@ +#include "zworkqueue.hpp" + +using namespace iflytop; +using namespace std; + +void ZWorkQueue::startSchedule() { + lock_guard lock(m_mutex); + + m_isJoining = false; + m_workQue.reset(new thread([this]() { + while (true) { + if (m_isJoining) { + break; + } + + function work; + { + lock_guard lock(m_QueueMutex); + if (m_workQueue.empty()) { + this_thread::sleep_for(chrono::milliseconds(2)); + continue; + } + work = m_workQueue.front(); + m_workQueue.pop(); + } + if (work) work(); + } + })); + workFlag = true; +} +void ZWorkQueue::stopSchedule() { + lock_guard lock(m_mutex); + + if (m_workQue) { + m_isJoining = true; + m_workQue->join(); + m_workQue.reset(); + m_workQue = nullptr; + } + workFlag = false; +} +bool ZWorkQueue::push(function work) { + lock_guard lock(m_QueueMutex); + m_workQueue.push(work); + return true; +} + +ZWorkQueue::ZWorkQueue() { + // startSchedule(); +} + +ZWorkQueue::~ZWorkQueue() { stopSchedule(); } \ No newline at end of file diff --git a/src/zqtui/base/zworkqueue.hpp b/src/zqtui/base/zworkqueue.hpp new file mode 100644 index 0000000..c2e5554 --- /dev/null +++ b/src/zqtui/base/zworkqueue.hpp @@ -0,0 +1,41 @@ +#pragma once +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace iflytop { +using namespace std; + +class ZWorkQueue { + private: + bool m_isJoining = false; + + unique_ptr m_workQue; + queue> m_workQueue; + + mutex m_QueueMutex; + mutex m_mutex; + + bool workFlag = false; + + public: + ZWorkQueue(); + ~ZWorkQueue(); + void startSchedule(); + void stopSchedule(); + + bool isWorking() { return workFlag; } + bool push(function work); +}; + +} // namespace iflytop \ No newline at end of file diff --git a/src/zqtui/channelmgr/qt_serial_datachannel.cpp b/src/zqtui/channelmgr/qt_serial_datachannel.cpp new file mode 100644 index 0000000..b551178 --- /dev/null +++ b/src/zqtui/channelmgr/qt_serial_datachannel.cpp @@ -0,0 +1,155 @@ +#include "qt_serial_datachannel.hpp" + +// + +#include +#include + +#pragma comment(lib, "ws2_32.lib") + +#include "zqtui/base/logger.hpp" + +using namespace iflytop; +using namespace std; +using namespace clst; + +#define TAG "QTDataChannel" + +void QTSerialChannel::init() { + m_thread.reset(new thread([this]() { + while (true) { + if (m_isOpen) { + uint8_t rx[1024] = {0}; + int rx_cnt = com_receive(rx, 1024); + if (rx_cnt != 0) { + // ZLOGI(TAG, "rx %d bytes", rx_cnt); + if (m_rxcb) m_rxcb(rx, rx_cnt); + } + this_thread::sleep_for(chrono::microseconds(100)); + } else { + this_thread::sleep_for(chrono::microseconds(10000)); + } + } + })); +} +bool QTSerialChannel::open() { + char portnamebuf[256] = {0}; + sprintf(portnamebuf, "\\\\.\\%s", m_name.c_str()); + m_CommHandler = CreateFileA(portnamebuf, // port name + GENERIC_READ | GENERIC_WRITE, // Read/Write + 0, // No Sharing + NULL, // No Security + OPEN_EXISTING, // Open existing port only + 0, // Non Overlapped I/O + NULL); // Null for Comm Devices + if (m_CommHandler == INVALID_HANDLE_VALUE) { + ZLOGI(TAG, "Error in opening serial port"); + return false; + } + DCB p; + memset(&p, 0, sizeof(p)); + p.DCBlength = sizeof(p); + p.BaudRate = m_baudRate; // 波特率 + + switch (m_dataBits) { + case QSerialPort::Data5: + p.ByteSize = 5; + break; + case QSerialPort::Data6: + p.ByteSize = 6; + break; + case QSerialPort::Data7: + p.ByteSize = 7; + break; + case QSerialPort::Data8: + p.ByteSize = 8; + break; + default: + p.ByteSize = 8; + break; + } + + // QSerialPort::NoParity = 0, + // QSerialPort::EvenParity = 2, + // QSerialPort::OddParity = 3, + // QSerialPort::SpaceParity = 4, + // QSerialPort::MarkParity = 5, + // QSerialPort::UnknownParity = -1 + + switch (m_parity) // 校验位 + { + case QSerialPort::NoParity: + p.Parity = NOPARITY; // 无校验 + break; + case QSerialPort::EvenParity: + p.Parity = EVENPARITY; // 奇校验 + break; + case QSerialPort::OddParity: + p.Parity = ODDPARITY; // 偶校验 + break; + case QSerialPort::MarkParity: + p.Parity = MARKPARITY; // 标记校验 + break; + default: + p.Parity = NOPARITY; // 无校验 + } + + switch (m_stopBits) // 停止位 + { + case QSerialPort::OneStop: + p.StopBits = ONESTOPBIT; // 1位停止位 + break; + case QSerialPort::OneAndHalfStop: + p.StopBits = TWOSTOPBITS; // 2位停止位 + break; + case QSerialPort::TwoStop: + p.StopBits = ONE5STOPBITS; // 1.5位停止位 + break; + default: + p.StopBits = ONESTOPBIT; // 无校验 + } + + if (!SetCommState(m_CommHandler, &p)) { + // 设置参数失败 + CloseHandle(m_CommHandler); + return false; + } + m_isOpen = true; + return true; +} + +void QTSerialChannel::close() { + CloseHandle(m_CommHandler); + m_isOpen = false; +} + +bool QTSerialChannel::isOpen() { return m_isOpen; } +bool QTSerialChannel::send(const uint8_t *data, size_t len) { + DWORD dwBytesWrite = len; + BOOL bWriteStat = WriteFile(m_CommHandler, // 串口句柄 + (char *)data, // 数据首地址 + dwBytesWrite, // 要发送的数据字节数 + &dwBytesWrite, // DWORD*,用来接收返回成功发送的数据字节数 + NULL); // NULL为同步发送,OVERLAPPED*为异步发送 + return dwBytesWrite; +} +void QTSerialChannel::regRxListener(function cb) { m_rxcb = cb; } + +int QTSerialChannel::com_receive(uint8_t *rxbuf, int rxbufsize) { + COMMTIMEOUTS TimeOuts; + GetCommTimeouts(m_CommHandler, &TimeOuts); + TimeOuts.ReadIntervalTimeout = 0; // 读间隔超时 + TimeOuts.ReadTotalTimeoutMultiplier = 0; // 读时间系数 + TimeOuts.ReadTotalTimeoutConstant = 1; // 读时间常量 + SetCommTimeouts(m_CommHandler, &TimeOuts); + + // PurgeComm(m_CommHandler, PURGE_RXCLEAR); + + DWORD wCount = rxbufsize; // 成功读取的数据字节数 + BOOL bReadStat = ReadFile(m_CommHandler, // 串口句柄 + rxbuf, // 数据首地址 + wCount, // 要读取的数据最大字节数 + &wCount, // DWORD*,用来接收返回成功读取的数据字节数 + NULL); + return wCount; +} diff --git a/src/zqtui/channelmgr/qt_serial_datachannel.hpp b/src/zqtui/channelmgr/qt_serial_datachannel.hpp new file mode 100644 index 0000000..361dd5e --- /dev/null +++ b/src/zqtui/channelmgr/qt_serial_datachannel.hpp @@ -0,0 +1,76 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +// + +#include +// +#include +// +#include +#include +// +#include "zqtui\base\zqthread.hpp" + +#define SDK_VERSION 1 + +namespace iflytop { +namespace clst { +using namespace std; +// QT_CHARTS_USE_NAMESPACE + +class QTSerialChannel { + function m_rxcb; + + QSerialPort::DataBits m_dataBits; + QSerialPort::Parity m_parity; + QSerialPort::StopBits m_stopBits; + QSerialPort::FlowControl m_flowControl; + string m_name; + + unique_ptr m_thread; + + uint32_t m_baudRate; + HANDLE m_CommHandler; + + bool m_isOpen = false; + + public: + void init(); + + virtual bool isOpen(); + virtual bool send(const uint8_t *data, size_t len); + virtual void regRxListener(function cb); + + bool open(); + void close(); + + bool setBaudRate(qint32 baudRate) { m_baudRate = baudRate; } + qint32 baudRate() const { return m_baudRate; } + + bool setPortName(string name) { m_name = name; } + bool setDataBits(QSerialPort::DataBits dataBits) { m_dataBits = dataBits; } + bool setParity(QSerialPort::Parity parity) { m_parity = parity; } + bool setStopBits(QSerialPort::StopBits stopBits) { m_stopBits = stopBits; } + bool setFlowControl(QSerialPort::FlowControl flowControl) { m_flowControl = flowControl; } + + QSerialPort::DataBits dataBits() const { return m_dataBits; } + QSerialPort::Parity parity() const { return m_parity; } + QSerialPort::StopBits stopBits() const { return m_stopBits; } + QSerialPort::FlowControl flowControl() const { return m_flowControl; } + + private: + int com_receive(uint8_t *rxbuf, int rxbufsize); +}; +} // namespace clst +} // namespace iflytop diff --git a/src/zqtui/mainpage/mainwindow.cpp b/src/zqtui/mainpage/mainwindow.cpp new file mode 100644 index 0000000..9e308df --- /dev/null +++ b/src/zqtui/mainpage/mainwindow.cpp @@ -0,0 +1,77 @@ +#include "mainwindow.h" + +#include +#include +#include +#include +#include + +#include "./ui_mainwindow.h" +// #include "app/syncbox16ch.h" +// #include "version.h" + +//syncbox16ch *app; +MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { + ui->setupUi(this); + + // app = new syncbox16ch(ui->app_content); + // app->show(); +} + +void MainWindow::constructChannel() { + // /** + // * @brief 指令串口UI + // */ + // { + // const auto infos = QSerialPortInfo::availablePorts(); + // for (const QSerialPortInfo &info : infos) { + // ui->serialPortCB->addItem(info.portName()); + // } + // } + + // ui->serialBaudrateCB->addItem("2000000"); + // ui->serialBaudrateCB->setCurrentIndex(0); + + // connect(ui->serialPortRefreshKey, &QPushButton::clicked, this, [this](bool check) { + // ui->serialPortCB->clear(); + // const auto infos = QSerialPortInfo::availablePorts(); + // for (const QSerialPortInfo &info : infos) { + // ui->serialPortCB->addItem(info.portName()); + // } + // }); + + // connect(ui->serialOpenKey, &QPushButton::clicked, this, [=](bool check) { + // // 打开串口 + // if (ui->serialOpenKey->text() == "打开") { + // G_QTDataChannel.setPortName(ui->serialPortCB->currentText().toStdString()); + // G_QTDataChannel.setBaudRate(ui->serialBaudrateCB->currentText().toInt()); + // G_QTDataChannel.setDataBits(QSerialPort::Data8); + // G_QTDataChannel.setParity(QSerialPort::NoParity); + // G_QTDataChannel.setFlowControl(QSerialPort::NoFlowControl); + // G_QTDataChannel.setStopBits(QSerialPort::OneStop); + + // /** + // * @brief 串口打开时,初始化相应参数 + // */ + + // if (!G_QTDataChannel.open()) { + // QMessageBox::about(NULL, "提示", "串口无法打开,串口不存在或已被占??"); + // return; + // } + // ui->serialOpenKey->setText("关闭"); + // // 下拉菜单控件使能 + // ui->serialBaudrateCB->setEnabled(false); + // ui->serialPortCB->setEnabled(false); + // ui->serialPortRefreshKey->setEnabled(false); + + // IflytopCanbusMaster::ins()->updateChannelConfig(); + + // } else { + // G_QTDataChannel.close(); + // ui->serialOpenKey->setText("打开"); + // ui->serialBaudrateCB->setEnabled(true); + // ui->serialPortCB->setEnabled(true); + // ui->serialPortRefreshKey->setEnabled(true); + // } + // }); +} diff --git a/src/zqtui/mainpage/mainwindow.h b/src/zqtui/mainpage/mainwindow.h new file mode 100644 index 0000000..f8dcc57 --- /dev/null +++ b/src/zqtui/mainpage/mainwindow.h @@ -0,0 +1,51 @@ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +// + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// + +QT_BEGIN_NAMESPACE +namespace Ui { +class MainWindow; +} +QT_END_NAMESPACE + +class MainWindow : public QMainWindow { + Q_OBJECT + + public: + Ui::MainWindow *ui; + + MainWindow(QWidget *parent = nullptr); + ~MainWindow() {}; + + private: + void constructChannel(); +}; +#endif // MAINWINDOW_H diff --git a/src/zqtui/mainpage/mainwindow.ui b/src/zqtui/mainpage/mainwindow.ui new file mode 100644 index 0000000..0366581 --- /dev/null +++ b/src/zqtui/mainpage/mainwindow.ui @@ -0,0 +1,878 @@ + + + MainWindow + + + + 0 + 0 + 753 + 545 + + + + + 0 + 8 + + + + ZFPGA + + + /* +Aqua Style Sheet for QT Applications +Author: Jaime A. Quiroga P. +Company: GTRONICK +Last updated: 22/01/2019, 07:55. +Available at: https://github.com/GTRONICK/QSS/blob/master/Aqua.qss +*/ +QMainWindow { + background-color:#ececec; +} +QTextEdit { + border-width: 1px; + border-style: solid; + border-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255)); +} +QPlainTextEdit { + border-width: 1px; + border-style: solid; + border-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255)); +} +QToolButton { + border-style: solid; + border-top-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(215, 215, 215), stop:1 rgb(222, 222, 222)); + border-right-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(217, 217, 217), stop:1 rgb(227, 227, 227)); + border-left-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(227, 227, 227), stop:1 rgb(217, 217, 217)); + border-bottom-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(215, 215, 215), stop:1 rgb(222, 222, 222)); + border-width: 1px; + border-radius: 5px; + color: rgb(0,0,0); + padding: 2px; + background-color: rgb(255,255,255); +} +QToolButton:hover{ + border-style: solid; + border-top-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(195, 195, 195), stop:1 rgb(222, 222, 222)); + border-right-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(197, 197, 197), stop:1 rgb(227, 227, 227)); + border-left-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(227, 227, 227), stop:1 rgb(197, 197, 197)); + border-bottom-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(195, 195, 195), stop:1 rgb(222, 222, 222)); + border-width: 1px; + border-radius: 5px; + color: rgb(0,0,0); + padding: 2px; + background-color: rgb(255,255,255); +} +QToolButton:pressed{ + border-style: solid; + border-top-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(215, 215, 215), stop:1 rgb(222, 222, 222)); + border-right-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(217, 217, 217), stop:1 rgb(227, 227, 227)); + border-left-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(227, 227, 227), stop:1 rgb(217, 217, 217)); + border-bottom-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(215, 215, 215), stop:1 rgb(222, 222, 222)); + border-width: 1px; + border-radius: 5px; + color: rgb(0,0,0); + padding: 2px; + background-color: rgb(142,142,142); +} +QPushButton{ + border-style: solid; + border-top-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(215, 215, 215), stop:1 rgb(222, 222, 222)); + border-right-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(217, 217, 217), stop:1 rgb(227, 227, 227)); + border-left-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(227, 227, 227), stop:1 rgb(217, 217, 217)); + border-bottom-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(215, 215, 215), stop:1 rgb(222, 222, 222)); + border-width: 1px; + border-radius: 5px; + color: rgb(0,0,0); + padding: 2px; + background-color: rgb(255,255,255); +} +QPushButton::default{ + border-style: solid; + border-top-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(215, 215, 215), stop:1 rgb(222, 222, 222)); + border-right-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(217, 217, 217), stop:1 rgb(227, 227, 227)); + border-left-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(227, 227, 227), stop:1 rgb(217, 217, 217)); + border-bottom-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(215, 215, 215), stop:1 rgb(222, 222, 222)); + border-width: 1px; + border-radius: 5px; + color: rgb(0,0,0); + padding: 2px; + background-color: rgb(255,255,255); +} +QPushButton:hover{ + border-style: solid; + border-top-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(195, 195, 195), stop:1 rgb(222, 222, 222)); + border-right-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(197, 197, 197), stop:1 rgb(227, 227, 227)); + border-left-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(227, 227, 227), stop:1 rgb(197, 197, 197)); + border-bottom-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(195, 195, 195), stop:1 rgb(222, 222, 222)); + border-width: 1px; + border-radius: 5px; + color: rgb(0,0,0); + padding: 2px; + background-color: rgb(255,255,255); +} +QPushButton:pressed{ + border-style: solid; + border-top-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(215, 215, 215), stop:1 rgb(222, 222, 222)); + border-right-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(217, 217, 217), stop:1 rgb(227, 227, 227)); + border-left-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(227, 227, 227), stop:1 rgb(217, 217, 217)); + border-bottom-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(215, 215, 215), stop:1 rgb(222, 222, 222)); + border-width: 1px; + border-radius: 5px; + color: rgb(0,0,0); + padding: 2px; + background-color: rgb(142,142,142); +} +QPushButton:disabled{ + border-style: solid; + border-top-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(215, 215, 215), stop:1 rgb(222, 222, 222)); + border-right-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(217, 217, 217), stop:1 rgb(227, 227, 227)); + border-left-color: qlineargradient(spread:pad, x1:0, y1:0.5, x2:1, y2:0.5, stop:0 rgb(227, 227, 227), stop:1 rgb(217, 217, 217)); + border-bottom-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgb(215, 215, 215), stop:1 rgb(222, 222, 222)); + border-width: 1px; + border-radius: 5px; + color: #808086; + padding: 2px; + background-color: rgb(142,142,142); +} +QLineEdit { + border-width: 1px; border-radius: 4px; + border-style: solid; + border-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255)); +} +QLabel { + color: #000000; +} +QLCDNumber { + color: rgb(0, 113, 255, 255); +} +QProgressBar { + text-align: center; + color: rgb(240, 240, 240); + border-width: 1px; + border-radius: 10px; + border-color: rgb(230, 230, 230); + border-style: solid; + background-color:rgb(207,207,207); +} +QProgressBar::chunk { + background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(49, 147, 250, 255), stop:1 rgba(34, 142, 255, 255)); + border-radius: 10px; +} +QMenuBar { + background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(207, 209, 207, 255), stop:1 rgba(230, 229, 230, 255)); +} +QMenuBar::item { + color: #000000; + spacing: 3px; + padding: 1px 4px; + background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(207, 209, 207, 255), stop:1 rgba(230, 229, 230, 255)); +} + +QMenuBar::item:selected { + background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255)); + color: #FFFFFF; +} +QMenu::item:selected { + border-style: solid; + border-top-color: transparent; + border-right-color: transparent; + border-left-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255)); + border-bottom-color: transparent; + border-left-width: 2px; + color: #000000; + padding-left:15px; + padding-top:4px; + padding-bottom:4px; + padding-right:7px; +} +QMenu::item { + border-style: solid; + border-top-color: transparent; + border-right-color: transparent; + border-left-color: transparent; + border-bottom-color: transparent; + border-bottom-width: 1px; + color: #000000; + padding-left:17px; + padding-top:4px; + padding-bottom:4px; + padding-right:7px; +} +QTabWidget { + color:rgb(0,0,0); + background-color:#000000; +} +QTabWidget::pane { + border-color: rgb(223,223,223); + background-color:rgb(226,226,226); + border-style: solid; + border-width: 2px; + border-radius: 6px; +} +QTabBar::tab:first { + border-style: solid; + border-left-width:1px; + border-right-width:0px; + border-top-width:1px; + border-bottom-width:1px; + border-top-color: rgb(209,209,209); + border-left-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(209, 209, 209, 209), stop:1 rgba(229, 229, 229, 229)); + border-bottom-color: rgb(229,229,229); + border-top-left-radius: 4px; + border-bottom-left-radius: 4px; + color: #000000; + padding: 3px; + margin-left:0px; + background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(247, 247, 247, 255), stop:1 rgba(255, 255, 255, 255)); +} +QTabBar::tab:last { + border-style: solid; + border-width:1px; + border-top-color: rgb(209,209,209); + border-left-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(209, 209, 209, 209), stop:1 rgba(229, 229, 229, 229)); + border-right-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(209, 209, 209, 209), stop:1 rgba(229, 229, 229, 229)); + border-bottom-color: rgb(229,229,229); + border-top-right-radius: 4px; + border-bottom-right-radius: 4px; + color: #000000; + padding: 3px; + margin-left:0px; + background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(247, 247, 247, 255), stop:1 rgba(255, 255, 255, 255)); +} +QTabBar::tab { + border-style: solid; + border-top-width:1px; + border-bottom-width:1px; + border-left-width:1px; + border-top-color: rgb(209,209,209); + border-left-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(209, 209, 209, 209), stop:1 rgba(229, 229, 229, 229)); + border-bottom-color: rgb(229,229,229); + color: #000000; + padding: 3px; + margin-left:0px; + background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(247, 247, 247, 255), stop:1 rgba(255, 255, 255, 255)); +} +QTabBar::tab:selected, QTabBar::tab:last:selected, QTabBar::tab:hover { + border-style: solid; + border-left-width:1px; + border-right-color: transparent; + border-top-color: rgb(209,209,209); + border-left-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(209, 209, 209, 209), stop:1 rgba(229, 229, 229, 229)); + border-bottom-color: rgb(229,229,229); + color: #FFFFFF; + padding: 3px; + margin-left:0px; + background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255)); +} + +QTabBar::tab:selected, QTabBar::tab:first:selected, QTabBar::tab:hover { + border-style: solid; + border-left-width:1px; + border-bottom-width:1px; + border-top-width:1px; + border-right-color: transparent; + border-top-color: rgb(209,209,209); + border-left-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(209, 209, 209, 209), stop:1 rgba(229, 229, 229, 229)); + border-bottom-color: rgb(229,229,229); + color: #FFFFFF; + padding: 3px; + margin-left:0px; + background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255)); +} + +QCheckBox { + color: #000000; + padding: 2px; +} +QCheckBox:disabled { + color: #808086; + padding: 2px; +} + +QCheckBox:hover { + border-radius:4px; + border-style:solid; + padding-left: 1px; + padding-right: 1px; + padding-bottom: 1px; + padding-top: 1px; + border-width:1px; + border-color: transparent; +} +QCheckBox::indicator:checked { + + height: 10px; + width: 10px; + border-style:solid; + border-width: 1px; + border-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255)); + color: #000000; + background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255)); +} +QCheckBox::indicator:unchecked { + + height: 10px; + width: 10px; + border-style:solid; + border-width: 1px; + border-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255)); + color: #000000; +} +QRadioButton { + color: 000000; + padding: 1px; +} +QRadioButton::indicator:checked { + height: 10px; + width: 10px; + border-style:solid; + border-radius:5px; + border-width: 1px; + border-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255)); + color: #a9b7c6; + background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255)); +} +QRadioButton::indicator:!checked { + height: 10px; + width: 10px; + border-style:solid; + border-radius:5px; + border-width: 1px; + border-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255)); + color: #a9b7c6; + background-color: transparent; +} +QStatusBar { + color:#027f7f; +} +QSpinBox { + border-style: solid; + border-width: 1px; + border-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255)); +} +QDoubleSpinBox { + border-style: solid; + border-width: 1px; + border-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255)); +} +QTimeEdit { + border-style: solid; + border-width: 1px; + border-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255)); +} +QDateTimeEdit { + border-style: solid; + border-width: 1px; + border-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255)); +} +QDateEdit { + border-style: solid; + border-width: 1px; + border-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(0, 113, 255, 255), stop:1 rgba(91, 171, 252, 255)); +} + +QToolBox { + color: #a9b7c6; + background-color:#000000; +} +QToolBox::tab { + color: #a9b7c6; + background-color:#000000; +} +QToolBox::tab:selected { + color: #FFFFFF; + background-color:#000000; +} +QScrollArea { + color: #FFFFFF; + background-color:#000000; +} +QSlider::groove:horizontal { + height: 5px; + background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(49, 147, 250, 255), stop:1 rgba(34, 142, 255, 255)); +} +QSlider::groove:vertical { + width: 5px; + background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(49, 147, 250, 255), stop:1 rgba(34, 142, 255, 255)); +} +QSlider::handle:horizontal { + background: rgb(253,253,253); + border-style: solid; + border-width: 1px; + border-color: rgb(207,207,207); + width: 12px; + margin: -5px 0; + border-radius: 7px; +} +QSlider::handle:vertical { + background: rgb(253,253,253); + border-style: solid; + border-width: 1px; + border-color: rgb(207,207,207); + height: 12px; + margin: 0 -5px; + border-radius: 7px; +} +QSlider::add-page:horizontal { + background: rgb(181,181,181); +} +QSlider::add-page:vertical { + background: rgb(181,181,181); +} +QSlider::sub-page:horizontal { + background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(49, 147, 250, 255), stop:1 rgba(34, 142, 255, 255)); +} +QSlider::sub-page:vertical { + background-color: qlineargradient(spread:pad, y1:0.5, x1:1, y2:0.5, x2:0, stop:0 rgba(49, 147, 250, 255), stop:1 rgba(34, 142, 255, 255)); +} +QScrollBar:horizontal { + max-height: 20px; + border: 1px transparent grey; + margin: 0px 20px 0px 20px; +} +QScrollBar:vertical { + max-width: 20px; + border: 1px transparent grey; + margin: 20px 0px 20px 0px; +} +QScrollBar::handle:horizontal { + background: rgb(253,253,253); + border-style: solid; + border-width: 1px; + border-color: rgb(207,207,207); + border-radius: 7px; + min-width: 25px; +} +QScrollBar::handle:horizontal:hover { + background: rgb(253,253,253); + border-style: solid; + border-width: 1px; + border-color: rgb(147, 200, 200); + border-radius: 7px; + min-width: 25px; +} +QScrollBar::handle:vertical { + background: rgb(253,253,253); + border-style: solid; + border-width: 1px; + border-color: rgb(207,207,207); + border-radius: 7px; + min-height: 25px; +} +QScrollBar::handle:vertical:hover { + background: rgb(253,253,253); + border-style: solid; + border-width: 1px; + border-color: rgb(147, 200, 200); + border-radius: 7px; + min-height: 25px; +} +QScrollBar::add-line:horizontal { + border: 2px transparent grey; + border-top-right-radius: 7px; + border-bottom-right-radius: 7px; + background: rgba(34, 142, 255, 255); + width: 20px; + subcontrol-position: right; + subcontrol-origin: margin; +} +QScrollBar::add-line:horizontal:pressed { + border: 2px transparent grey; + border-top-right-radius: 7px; + border-bottom-right-radius: 7px; + background: rgb(181,181,181); + width: 20px; + subcontrol-position: right; + subcontrol-origin: margin; +} +QScrollBar::add-line:vertical { + border: 2px transparent grey; + border-bottom-left-radius: 7px; + border-bottom-right-radius: 7px; + background: rgba(34, 142, 255, 255); + height: 20px; + subcontrol-position: bottom; + subcontrol-origin: margin; +} +QScrollBar::add-line:vertical:pressed { + border: 2px transparent grey; + border-bottom-left-radius: 7px; + border-bottom-right-radius: 7px; + background: rgb(181,181,181); + height: 20px; + subcontrol-position: bottom; + subcontrol-origin: margin; +} +QScrollBar::sub-line:horizontal { + border: 2px transparent grey; + border-top-left-radius: 7px; + border-bottom-left-radius: 7px; + background: rgba(34, 142, 255, 255); + width: 20px; + subcontrol-position: left; + subcontrol-origin: margin; +} +QScrollBar::sub-line:horizontal:pressed { + border: 2px transparent grey; + border-top-left-radius: 7px; + border-bottom-left-radius: 7px; + background: rgb(181,181,181); + width: 20px; + subcontrol-position: left; + subcontrol-origin: margin; +} +QScrollBar::sub-line:vertical { + border: 2px transparent grey; + border-top-left-radius: 7px; + border-top-right-radius: 7px; + background: rgba(34, 142, 255, 255); + height: 20px; + subcontrol-position: top; + subcontrol-origin: margin; +} +QScrollBar::sub-line:vertical:pressed { + border: 2px transparent grey; + border-top-left-radius: 7px; + border-top-right-radius: 7px; + background: rgb(181,181,181); + height: 20px; + subcontrol-position: top; + subcontrol-origin: margin; +} +QScrollBar::left-arrow:horizontal { + border: 1px transparent grey; + border-top-left-radius: 3px; + border-bottom-left-radius: 3px; + width: 6px; + height: 6px; + background: white; +} +QScrollBar::right-arrow:horizontal { + border: 1px transparent grey; + border-top-right-radius: 3px; + border-bottom-right-radius: 3px; + width: 6px; + height: 6px; + background: white; +} +QScrollBar::up-arrow:vertical { + border: 1px transparent grey; + border-top-left-radius: 3px; + border-top-right-radius: 3px; + width: 6px; + height: 6px; + background: white; +} +QScrollBar::down-arrow:vertical { + border: 1px transparent grey; + border-bottom-left-radius: 3px; + border-bottom-right-radius: 3px; + width: 6px; + height: 6px; + background: white; +} +QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal { + background: none; +} +QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical { + background: none; +} +QGroupBox { + border-color: rgb(156, 156, 156); + border-width: 1px; + border-style: solid; + border-radius:8px; + padding: 10px 0px 0px 0px; + +} + +QGroupBox:title { + subcontrol-origin: margin; + left: 7px; + padding: 0px 0px 0px 0px; +} + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + 5 + + + 5 + + + 5 + + + 5 + + + 5 + + + + + + 200 + 0 + + + + + 200 + 16777215 + + + + + + + + 16777215 + 16777215 + + + + 端口 + + + + + + + + + 串口号 + + + + + + + 波特率 + + + + + + + + + + 打开 + + + + + + + 刷新 + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + + + + + + + 4 + 0 + + + + + DengXian + 9 + + + + + + + + 0 + + + QLayout::SetNoConstraint + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 4 + + + + + + + + + 0 + 2 + + + + QTabWidget::North + + + QTabWidget::Rounded + + + 1 + + + Qt::ElideLeft + + + false + + + false + + + + 指令 + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + 上报 + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + + + content + sidebar + + + + + + + true + + + 专业模式 + + + 专业模式 + + + + + + diff --git a/src/zqtui/version.h b/src/zqtui/version.h new file mode 100644 index 0000000..40f364b --- /dev/null +++ b/src/zqtui/version.h @@ -0,0 +1,4 @@ +#pragma once + +#define VERSION 17 +#define MAUFACTURER "iflytop" \ No newline at end of file diff --git a/zaf_protocol/zaf_ecode.c b/zaf_protocol/zaf_ecode.c new file mode 100644 index 0000000..19efd74 --- /dev/null +++ b/zaf_protocol/zaf_ecode.c @@ -0,0 +1,26 @@ +#include "zaf_ecode.h" + +const char* zaf_error_code_2_str(zaf_error_code_t ecode) { + switch (ecode) { + case kaf_ec_success: + return "success"; + case kaf_ec_overtime: + return "overtime"; + case kaf_ec_socket_fail: + return "socket fail"; + case kaf_ec_bind_fail: + return "bind fail"; + case kaf_ec_send_fail: + return "send fail"; + case kaf_ec_receive_fail: + return "receive fail"; + case kaf_ec_setsockopt_rx_timeout_fail: + return "setsockopt rx timeout fail"; + case kaf_ec_lose_connect: + return "lose connect"; + case kaf_ec_param_error: + return "param error"; + default: + return "unknown error"; + } +} diff --git a/zaf_protocol/zaf_ecode.h b/zaf_protocol/zaf_ecode.h new file mode 100644 index 0000000..ff0b434 --- /dev/null +++ b/zaf_protocol/zaf_ecode.h @@ -0,0 +1,13 @@ +#pragma once +typedef enum { + kaf_ec_success = 0, + kaf_ec_overtime = 1, + kaf_ec_socket_fail = 2, + kaf_ec_bind_fail = 3, + kaf_ec_send_fail = 4, + kaf_ec_receive_fail = 5, + kaf_ec_setsockopt_rx_timeout_fail = 6, + kaf_ec_lose_connect = 7, + kaf_ec_param_error = 8, + kaf_ec_device_notopen = 9, +} zaf_error_code_t; diff --git a/zaf_protocol/zaf_port.h b/zaf_protocol/zaf_port.h new file mode 100644 index 0000000..64b2141 --- /dev/null +++ b/zaf_protocol/zaf_port.h @@ -0,0 +1,5 @@ +#pragma once +#include + +#define ZAF_SERVICE_DEVICE_PORT 20000 // 豸 ˶˿ +#define ZAF_SERVICE_PC_PORT 20001 // pc ˶˿ \ No newline at end of file diff --git a/zaf_protocol/zaf_protocol.c b/zaf_protocol/zaf_protocol.c new file mode 100644 index 0000000..45b745a --- /dev/null +++ b/zaf_protocol/zaf_protocol.c @@ -0,0 +1,2 @@ +#include "zaf_protocol.h" + diff --git a/zaf_protocol/zaf_protocol.h b/zaf_protocol/zaf_protocol.h new file mode 100644 index 0000000..007a495 --- /dev/null +++ b/zaf_protocol/zaf_protocol.h @@ -0,0 +1,74 @@ +#pragma once +#include + +#include "zaf_ecode.h" +#include "zaf_port.h" +#include "zaf_regs.hpp" + +#pragma pack(1) + +/******************************************************************************* + * ָͨ * + *******************************************************************************/ + +#define PACKET_HEADER 0x5A5A +#define PACKET_TAIL 0xA5A5 +#define PROTOCOL_VERSION 1 + +/** + * + * ЭΪ: + * ͷ(2Byte) (2Byte) Index(2Byte) ָ(2Byte ndata(2byte) data[...] У(1Byte) β(2Byte) + * + */ + +typedef struct { + uint16_t packet_header; + uint16_t packet_type; // zaf_protocol_packet_type_t + uint16_t index; // + uint16_t cmd; // zaf_protocol_cmd_t + uint16_t ndata; // + uint32_t data[]; // first is always checksum +} zaf_packet_header_t; +#pragma pack() + +/** + * @brief CMD + */ +typedef enum { + kzaf_cmd_none = 0, + kzaf_cmd_reg_read = 1, + kzaf_cmd_reg_write = 2, + kzaf_cmd_reg_read_regs = 3, + kzaf_cmd_generator_new_mac = 4, + kzaf_cmd_factory_reset = 5, + kzaf_cmd_reboot = 6, + kzaf_cmd_storage_cfg = 7, +} zaf_protocol_cmd_t; + +/** + * @brief + */ +typedef enum { + kzaf_packet_type_cmd = 0, + kzaf_packet_type_receipt = 1, + kzaf_packet_type_report = 2, +} zaf_protocol_packet_type_t; + +/******************************************************************************* + * ҵ߼ö * + *******************************************************************************/ +typedef enum { + obtaining_ip_mode_type_static = 0, + obtaining_ip_mode_type_dhcp = 1, +} obtaining_ip_mode_t; +static inline const char* obtaining_ip_mode_to_string(obtaining_ip_mode_t mode) { + switch (mode) { + case obtaining_ip_mode_type_static: + return "static"; + case obtaining_ip_mode_type_dhcp: + return "dhcp"; + default: + return "unknown"; + } +} diff --git a/zaf_protocol/zaf_regs.hpp b/zaf_protocol/zaf_regs.hpp new file mode 100644 index 0000000..880a384 --- /dev/null +++ b/zaf_protocol/zaf_regs.hpp @@ -0,0 +1,228 @@ +#pragma once +#define REGADD__STM32_COMMON (0x0010) +#define REGADD__STM32_BUSINESS (0x0020) +#define REGADD__FPGA_START (0x0100) + +#define REGADDOFF__FPGA_INFO (0x1000) +#define REGADDOFF__INTERNAL_CLK (0x1020) +#define REGADDOFF__INTERNAL_TRIGGER (0x1040) +#define REGADDOFF__TRIGGER_IN1 (0x2000) +#define REGADDOFF__TRIGGER_IN2 (0x2020) +#define REGADDOFF__TRIGGER_IN3 (0x2040) +#define REGADDOFF__TRIGGER_IN4 (0x2060) +#define REGADDOFF__LIGHT_CTROL_MODULE1 (0x3000) +#define REGADDOFF__LIGHT_CTROL_MODULE2 (0x3020) +#define REGADDOFF__LIGHT_CTROL_MODULE3 (0x3040) +#define REGADDOFF__LIGHT_CTROL_MODULE4 (0x3060) +#define REGADDOFF__TTL_OUTPUT_MODULE1 (0x4000) +#define REGADDOFF__TTL_OUTPUT_MODULE2 (0x4020) +#define REGADDOFF__TTL_OUTPUT_MODULE3 (0x4040) +#define REGADDOFF__TTL_OUTPUT_MODULE4 (0x4060) + +typedef enum { + /** + * @brief + * REG 0(16) 设备信息基础寄存器 + */ + kreg_software_version = 0, + kreg_manufacturer0 = 1, + kreg_manufacturer1 = 2, + kreg_product_type_id = 3, + kreg_sn_id0 = 4, + kreg_sn_id1 = 5, + kreg_sn_id2 = 6, + kreg_mac0 = 7, + kreg_mac1 = 8, + + kreg_fpga_version = REGADDOFF__FPGA_INFO + 1, + + /** + * @brief + * REG 16(32) STM32配置寄存器0 + */ + kreg_stm32_obtaining_ip_mode = REGADD__STM32_COMMON + 0, + kreg_stm32_ip = REGADD__STM32_COMMON + 1, + kreg_stm32_gw = REGADD__STM32_COMMON + 2, + kreg_stm32_netmask = REGADD__STM32_COMMON + 3, + kreg_stm32_config0 = REGADD__STM32_COMMON + 4, // bit0: timecode report enable, bit1: camera sync report enable + + kreg_stm32_action0 = REGADD__STM32_COMMON + 14, // action reg + kreg_stm32_action_val0 = REGADD__STM32_COMMON + 15, // action val reg + + kreg_stm32_temperature = REGADD__STM32_BUSINESS + 0, + kreg_stm32_fan0_error_flag = REGADD__STM32_BUSINESS + 1, + + /******************************************************************************* + * 内部时钟源 * + *******************************************************************************/ + + kreg_internal_clk_module = REGADDOFF__INTERNAL_CLK, + kreg_internal_clk_ctrl = REGADDOFF__INTERNAL_CLK + 1, + kreg_internal_clk_freq_cnt = REGADDOFF__INTERNAL_CLK + 2, + kreg_internal_clk_pluse_cnt = REGADDOFF__INTERNAL_CLK + 3, + kreg_internal_clk_output_sig_detect = REGADDOFF__INTERNAL_CLK + 15, + + kreg_internal_clk_tri_module = REGADDOFF__INTERNAL_TRIGGER, + kreg_internal_clk_tri_src_slect = REGADDOFF__INTERNAL_TRIGGER + 1, + kreg_internal_clk_tri_fileter_coefficient = REGADDOFF__INTERNAL_TRIGGER + 2, + kreg_internal_clk_tri_freq_detect_bias = REGADDOFF__INTERNAL_TRIGGER + 3, + kreg_internal_clk_tri_mode = REGADDOFF__INTERNAL_TRIGGER + 4, + kreg_internal_clk_tri_trigger_mode_trigger_edge = REGADDOFF__INTERNAL_TRIGGER + 5, + kreg_internal_clk_tri_trigger_mode_freq_division = REGADDOFF__INTERNAL_TRIGGER + 6, + kreg_internal_clk_tri_trigger_mode_freq_multiplication = REGADDOFF__INTERNAL_TRIGGER + 7, + kreg_internal_clk_tri_sequential_control_pluse_cnt_max = REGADDOFF__INTERNAL_TRIGGER + 10, + kreg_internal_clk_tri_in_signal_freq = REGADDOFF__INTERNAL_TRIGGER + 14, + kreg_internal_clk_tri_out_signal_freq = REGADDOFF__INTERNAL_TRIGGER + 15, + + /******************************************************************************* + * reg_trigger_in * + *******************************************************************************/ + + kreg_trigger_in1_module = REGADDOFF__TRIGGER_IN1, + kreg_trigger_in1_src_slect = REGADDOFF__TRIGGER_IN1 + 1, + kreg_trigger_in1_fileter_coefficient = REGADDOFF__TRIGGER_IN1 + 2, // 滤波系数,单位是10ns + kreg_trigger_in1_freq_detect_bias = REGADDOFF__TRIGGER_IN1 + 3, + kreg_trigger_in1_mode = REGADDOFF__TRIGGER_IN1 + 4, // mode 0:触发 1:转发模式 + kreg_trigger_in1_trigger_mode_trigger_edge = REGADDOFF__TRIGGER_IN1 + 5, + kreg_trigger_in1_trigger_mode_freq_division = REGADDOFF__TRIGGER_IN1 + 6, + kreg_trigger_in1_trigger_mode_freq_multiplication = REGADDOFF__TRIGGER_IN1 + 7, + kreg_trigger_in1_sequential_control_pluse_cnt_max = REGADDOFF__TRIGGER_IN1 + 10, // 顺序控制信号最大计数 + kreg_trigger_in1_in_signal_freq = REGADDOFF__TRIGGER_IN1 + 14, + kreg_trigger_in1_out_signal_freq = REGADDOFF__TRIGGER_IN1 + 15, + + kreg_trigger_in2_module = REGADDOFF__TRIGGER_IN2, + kreg_trigger_in2_src_slect = REGADDOFF__TRIGGER_IN2 + 1, + kreg_trigger_in2_fileter_coefficient = REGADDOFF__TRIGGER_IN2 + 2, + kreg_trigger_in2_freq_detect_bias = REGADDOFF__TRIGGER_IN2 + 3, + kreg_trigger_in2_mode = REGADDOFF__TRIGGER_IN2 + 4, + kreg_trigger_in2_trigger_mode_trigger_edge = REGADDOFF__TRIGGER_IN2 + 5, + kreg_trigger_in2_trigger_mode_freq_division = REGADDOFF__TRIGGER_IN2 + 6, + kreg_trigger_in2_trigger_mode_freq_multiplication = REGADDOFF__TRIGGER_IN2 + 7, + kreg_trigger_in2_sequential_control_pluse_cnt_max = REGADDOFF__TRIGGER_IN2 + 10, + kreg_trigger_in2_in_signal_freq = REGADDOFF__TRIGGER_IN2 + 14, + kreg_trigger_in2_out_signal_freq = REGADDOFF__TRIGGER_IN2 + 15, + + kreg_trigger_in3_module = REGADDOFF__TRIGGER_IN3, + kreg_trigger_in3_src_slect = REGADDOFF__TRIGGER_IN3 + 1, + kreg_trigger_in3_fileter_coefficient = REGADDOFF__TRIGGER_IN3 + 2, + kreg_trigger_in3_freq_detect_bias = REGADDOFF__TRIGGER_IN3 + 3, + kreg_trigger_in3_mode = REGADDOFF__TRIGGER_IN3 + 4, + kreg_trigger_in3_trigger_mode_trigger_edge = REGADDOFF__TRIGGER_IN3 + 5, + kreg_trigger_in3_trigger_mode_freq_division = REGADDOFF__TRIGGER_IN3 + 6, + kreg_trigger_in3_trigger_mode_freq_multiplication = REGADDOFF__TRIGGER_IN3 + 7, + kreg_trigger_in3_sequential_control_pluse_cnt_max = REGADDOFF__TRIGGER_IN3 + 10, + kreg_trigger_in3_in_signal_freq = REGADDOFF__TRIGGER_IN3 + 14, + kreg_trigger_in3_out_signal_freq = REGADDOFF__TRIGGER_IN3 + 15, + + kreg_trigger_in4_module = REGADDOFF__TRIGGER_IN4, + kreg_trigger_in4_src_slect = REGADDOFF__TRIGGER_IN4 + 1, + kreg_trigger_in4_fileter_coefficient = REGADDOFF__TRIGGER_IN4 + 2, + kreg_trigger_in4_freq_detect_bias = REGADDOFF__TRIGGER_IN4 + 3, + kreg_trigger_in4_mode = REGADDOFF__TRIGGER_IN4 + 4, + kreg_trigger_in4_trigger_mode_trigger_edge = REGADDOFF__TRIGGER_IN4 + 5, + kreg_trigger_in4_trigger_mode_freq_division = REGADDOFF__TRIGGER_IN4 + 6, + kreg_trigger_in4_trigger_mode_freq_multiplication = REGADDOFF__TRIGGER_IN4 + 7, + kreg_trigger_in4_sequential_control_pluse_cnt_max = REGADDOFF__TRIGGER_IN4 + 10, + kreg_trigger_in4_in_signal_freq = REGADDOFF__TRIGGER_IN4 + 14, + kreg_trigger_in4_out_signal_freq = REGADDOFF__TRIGGER_IN4 + 15, + + /******************************************************************************* + * 快门控制输出 * + *******************************************************************************/ + + kreg_ttl_output_module1 = REGADDOFF__TTL_OUTPUT_MODULE1, + kreg_ttl_output_module1_output_ctrl_mode = REGADDOFF__TTL_OUTPUT_MODULE1 + 1, + kreg_ttl_output_module1_lt_en_bind = REGADDOFF__TTL_OUTPUT_MODULE1 + 2, + kreg_ttl_output_module1_lt_en_offset = REGADDOFF__TTL_OUTPUT_MODULE1 + 3, + kreg_ttl_output_module1_in_sig_select = REGADDOFF__TTL_OUTPUT_MODULE1 + 4, + kreg_ttl_output_module1_out_polarity_reversal = REGADDOFF__TTL_OUTPUT_MODULE1 + 5, + + kreg_ttl_output_module2 = REGADDOFF__TTL_OUTPUT_MODULE2, + kreg_ttl_output_module2_output_ctrl_mode = REGADDOFF__TTL_OUTPUT_MODULE2 + 1, + kreg_ttl_output_module2_lt_en_bind = REGADDOFF__TTL_OUTPUT_MODULE2 + 2, + kreg_ttl_output_module2_lt_en_offset = REGADDOFF__TTL_OUTPUT_MODULE2 + 3, + kreg_ttl_output_module2_in_sig_select = REGADDOFF__TTL_OUTPUT_MODULE2 + 4, + kreg_ttl_output_module2_out_polarity_reversal = REGADDOFF__TTL_OUTPUT_MODULE2 + 5, + + kreg_ttl_output_module3 = REGADDOFF__TTL_OUTPUT_MODULE3, + kreg_ttl_output_module3_output_ctrl_mode = REGADDOFF__TTL_OUTPUT_MODULE3 + 1, + kreg_ttl_output_module3_lt_en_bind = REGADDOFF__TTL_OUTPUT_MODULE3 + 2, + kreg_ttl_output_module3_lt_en_offset = REGADDOFF__TTL_OUTPUT_MODULE3 + 3, + kreg_ttl_output_module3_in_sig_select = REGADDOFF__TTL_OUTPUT_MODULE3 + 4, + kreg_ttl_output_module3_out_polarity_reversal = REGADDOFF__TTL_OUTPUT_MODULE3 + 5, + + kreg_ttl_output_module4 = REGADDOFF__TTL_OUTPUT_MODULE4, + kreg_ttl_output_module4_output_ctrl_mode = REGADDOFF__TTL_OUTPUT_MODULE4 + 1, + kreg_ttl_output_module4_lt_en_bind = REGADDOFF__TTL_OUTPUT_MODULE4 + 2, + kreg_ttl_output_module4_lt_en_offset = REGADDOFF__TTL_OUTPUT_MODULE4 + 3, + kreg_ttl_output_module4_in_sig_select = REGADDOFF__TTL_OUTPUT_MODULE4 + 4, + kreg_ttl_output_module4_out_polarity_reversal = REGADDOFF__TTL_OUTPUT_MODULE4 + 5, + + /******************************************************************************* + * 光源控制 * + *******************************************************************************/ + kreg_light_ctrol_module1 = REGADDOFF__LIGHT_CTROL_MODULE1, + kreg_light_ctrol_module1_source_select = REGADDOFF__LIGHT_CTROL_MODULE1 + 1, + kreg_light_ctrol_module1_en_sig_ctrl_mode = REGADDOFF__LIGHT_CTROL_MODULE1 + 2, + kreg_light_ctrol_module1_light_intensity_ctrl_mode = REGADDOFF__LIGHT_CTROL_MODULE1 + 3, + kreg_light_ctrol_module1_trigger_mode_pluse_num = REGADDOFF__LIGHT_CTROL_MODULE1 + 4, + kreg_light_ctrol_module1_trigger_mode_pluse_interval = REGADDOFF__LIGHT_CTROL_MODULE1 + 5, + kreg_light_ctrol_module1_trigger_mode_pluse_width = REGADDOFF__LIGHT_CTROL_MODULE1 + 6, + kreg_light_ctrol_module1_trigger_mode_first_pluse_offset = REGADDOFF__LIGHT_CTROL_MODULE1 + 7, + kreg_light_ctrol_module1_trigger_mode_output_polarity = REGADDOFF__LIGHT_CTROL_MODULE1 + 8, // 无用 + kreg_light_ctrol_module1_light_intensity_cnt = REGADDOFF__LIGHT_CTROL_MODULE1 + 9, + kreg_light_ctrol_module1_light_driver_freq_cnt = REGADDOFF__LIGHT_CTROL_MODULE1 + 10, + kreg_light_ctrol_module1_freq_detect_bias = REGADDOFF__LIGHT_CTROL_MODULE1 + 12, + kreg_light_ctrol_module1_light_src_error_state = REGADDOFF__LIGHT_CTROL_MODULE1 + 13, + kreg_light_ctrol_module1_in_sig_freq_detect = REGADDOFF__LIGHT_CTROL_MODULE1 + 14, + kreg_light_ctrol_module1_out_sig_freq_detect = REGADDOFF__LIGHT_CTROL_MODULE1 + 15, + + kreg_light_ctrol_module2 = REGADDOFF__LIGHT_CTROL_MODULE2, + kreg_light_ctrol_module2_source_select = REGADDOFF__LIGHT_CTROL_MODULE2 + 1, + kreg_light_ctrol_module2_en_sig_ctrl_mode = REGADDOFF__LIGHT_CTROL_MODULE2 + 2, + kreg_light_ctrol_module2_light_intensity_ctrl_mode = REGADDOFF__LIGHT_CTROL_MODULE2 + 3, + kreg_light_ctrol_module2_trigger_mode_pluse_num = REGADDOFF__LIGHT_CTROL_MODULE2 + 4, + kreg_light_ctrol_module2_trigger_mode_pluse_interval = REGADDOFF__LIGHT_CTROL_MODULE2 + 5, + kreg_light_ctrol_module2_trigger_mode_pluse_width = REGADDOFF__LIGHT_CTROL_MODULE2 + 6, + kreg_light_ctrol_module2_trigger_mode_first_pluse_offset = REGADDOFF__LIGHT_CTROL_MODULE2 + 7, + kreg_light_ctrol_module2_trigger_mode_output_polarity = REGADDOFF__LIGHT_CTROL_MODULE2 + 8, + kreg_light_ctrol_module2_light_intensity_cnt = REGADDOFF__LIGHT_CTROL_MODULE2 + 9, + kreg_light_ctrol_module2_light_driver_freq_cnt = REGADDOFF__LIGHT_CTROL_MODULE2 + 10, + kreg_light_ctrol_module2_freq_detect_bias = REGADDOFF__LIGHT_CTROL_MODULE2 + 12, + kreg_light_ctrol_module2_light_src_error_state = REGADDOFF__LIGHT_CTROL_MODULE2 + 13, + kreg_light_ctrol_module2_in_sig_freq_detect = REGADDOFF__LIGHT_CTROL_MODULE2 + 14, + kreg_light_ctrol_module2_out_sig_freq_detect = REGADDOFF__LIGHT_CTROL_MODULE2 + 15, + + kreg_light_ctrol_module3 = REGADDOFF__LIGHT_CTROL_MODULE3, + kreg_light_ctrol_module3_source_select = REGADDOFF__LIGHT_CTROL_MODULE3 + 1, + kreg_light_ctrol_module3_en_sig_ctrl_mode = REGADDOFF__LIGHT_CTROL_MODULE3 + 2, + kreg_light_ctrol_module3_light_intensity_ctrl_mode = REGADDOFF__LIGHT_CTROL_MODULE3 + 3, + kreg_light_ctrol_module3_trigger_mode_pluse_num = REGADDOFF__LIGHT_CTROL_MODULE3 + 4, + kreg_light_ctrol_module3_trigger_mode_pluse_interval = REGADDOFF__LIGHT_CTROL_MODULE3 + 5, + kreg_light_ctrol_module3_trigger_mode_pluse_width = REGADDOFF__LIGHT_CTROL_MODULE3 + 6, + kreg_light_ctrol_module3_trigger_mode_first_pluse_offset = REGADDOFF__LIGHT_CTROL_MODULE3 + 7, + kreg_light_ctrol_module3_trigger_mode_output_polarity = REGADDOFF__LIGHT_CTROL_MODULE3 + 8, + kreg_light_ctrol_module3_light_intensity_cnt = REGADDOFF__LIGHT_CTROL_MODULE3 + 9, + kreg_light_ctrol_module3_light_driver_freq_cnt = REGADDOFF__LIGHT_CTROL_MODULE3 + 10, + kreg_light_ctrol_module3_freq_detect_bias = REGADDOFF__LIGHT_CTROL_MODULE3 + 12, + kreg_light_ctrol_module3_light_src_error_state = REGADDOFF__LIGHT_CTROL_MODULE3 + 13, + kreg_light_ctrol_module3_in_sig_freq_detect = REGADDOFF__LIGHT_CTROL_MODULE3 + 14, + kreg_light_ctrol_module3_out_sig_freq_detect = REGADDOFF__LIGHT_CTROL_MODULE3 + 15, + + kreg_light_ctrol_module4 = REGADDOFF__LIGHT_CTROL_MODULE4, + kreg_light_ctrol_module4_source_select = REGADDOFF__LIGHT_CTROL_MODULE4 + 1, + kreg_light_ctrol_module4_en_sig_ctrl_mode = REGADDOFF__LIGHT_CTROL_MODULE4 + 2, + kreg_light_ctrol_module4_light_intensity_ctrl_mode = REGADDOFF__LIGHT_CTROL_MODULE4 + 3, + kreg_light_ctrol_module4_trigger_mode_pluse_num = REGADDOFF__LIGHT_CTROL_MODULE4 + 4, + kreg_light_ctrol_module4_trigger_mode_pluse_interval = REGADDOFF__LIGHT_CTROL_MODULE4 + 5, + kreg_light_ctrol_module4_trigger_mode_pluse_width = REGADDOFF__LIGHT_CTROL_MODULE4 + 6, + kreg_light_ctrol_module4_trigger_mode_first_pluse_offset = REGADDOFF__LIGHT_CTROL_MODULE4 + 7, + kreg_light_ctrol_module4_trigger_mode_output_polarity = REGADDOFF__LIGHT_CTROL_MODULE4 + 8, + kreg_light_ctrol_module4_light_intensity_cnt = REGADDOFF__LIGHT_CTROL_MODULE4 + 9, + kreg_light_ctrol_module4_light_driver_freq_cnt = REGADDOFF__LIGHT_CTROL_MODULE4 + 10, + kreg_light_ctrol_module4_freq_detect_bias = REGADDOFF__LIGHT_CTROL_MODULE4 + 12, + kreg_light_ctrol_module4_light_src_error_state = REGADDOFF__LIGHT_CTROL_MODULE4 + 13, + kreg_light_ctrol_module4_in_sig_freq_detect = REGADDOFF__LIGHT_CTROL_MODULE4 + 14, + kreg_light_ctrol_module4_out_sig_freq_detect = REGADDOFF__LIGHT_CTROL_MODULE4 + 15, + +} RegAdd_t;