Bläddra i källkod

V0.8
1、Windows下所有的都完成了

Apple 3 månader sedan
förälder
incheckning
9e2ffed4e0
91 ändrade filer med 4967 tillägg och 278 borttagningar
  1. 10 18
      CMakeLists.txt
  2. 1 1
      External
  3. 1 1
      TransmitterSwitch/AddItem/addnormalitem.cpp
  4. 1 1
      TransmitterSwitch/AddItem/addspecialitem.cpp
  5. 103 0
      TransmitterSwitch/CMakeLists.txt
  6. 22 13
      TransmitterSwitch/ItemData/oneitem.cpp
  7. 4 0
      TransmitterSwitch/ItemData/oneitem.h
  8. 3 3
      TransmitterSwitch/Resource/QSS/black/SelectTime/timepartwidget.qss
  9. 16 4
      TransmitterSwitch/Resource/QSS/black/addnormalitem.qss
  10. 16 5
      TransmitterSwitch/Resource/QSS/black/addspecialitem.qss
  11. 1 1
      TransmitterSwitch/Resource/QSS/black/importtemplate.qss
  12. 1 1
      TransmitterSwitch/Resource/QSS/black/oneitem.qss
  13. 2 2
      TransmitterSwitch/Resource/QSS/black/savetotemplate.qss
  14. 8 2
      TransmitterSwitch/Resource/QSS/black/transmitterswitch.qss
  15. 3 3
      TransmitterSwitch/Resource/QSS/black/warning.qss
  16. 3 3
      TransmitterSwitch/Resource/QSS/white/SelectTime/timepartwidget.qss
  17. 16 4
      TransmitterSwitch/Resource/QSS/white/addnormalitem.qss
  18. 16 4
      TransmitterSwitch/Resource/QSS/white/addspecialitem.qss
  19. 2 1
      TransmitterSwitch/Resource/QSS/white/importtemplate.qss
  20. 1 1
      TransmitterSwitch/Resource/QSS/white/oneitem.qss
  21. 4 2
      TransmitterSwitch/Resource/QSS/white/savetotemplate.qss
  22. 14 6
      TransmitterSwitch/Resource/QSS/white/transmitterswitch.qss
  23. 6 3
      TransmitterSwitch/Resource/QSS/white/warning.qss
  24. 24 7
      TransmitterSwitch/Resource/TransSwitch.qrc
  25. 2 2
      TransmitterSwitch/Template/importtemplate.cpp
  26. 1 1
      TransmitterSwitch/Template/savetotemplate.cpp
  27. 27 9
      TransmitterSwitch/TransmitterSwitchInfo.cpp
  28. 42 2
      TransmitterSwitch/TransmitterSwitchInfo.h
  29. 4 4
      TransmitterSwitch/WebAPI/FromWebAPI.cpp
  30. 0 0
      TransmitterSwitch/common/LHLog/LHQLogAPI.cpp
  31. 0 0
      TransmitterSwitch/common/LHLog/LHQLogAPI.h
  32. 69 0
      TransmitterSwitch/common/Logs/loginit.cpp
  33. 8 0
      TransmitterSwitch/common/Logs/loginit.h
  34. 4 11
      TransmitterSwitch/common/SelectTime/timepartwidget.cpp
  35. 3 11
      TransmitterSwitch/common/SelectTime/timewidget.cpp
  36. 10 6
      TransmitterSwitch/common/date/calendarheader.cpp
  37. 4 1
      TransmitterSwitch/common/date/calendarheader.h
  38. 4 4
      TransmitterSwitch/common/date/calendarnav.cpp
  39. 1 1
      TransmitterSwitch/common/date/calendarnav.h
  40. 29 12
      TransmitterSwitch/common/date/calendarwidgetex.cpp
  41. 9 0
      TransmitterSwitch/common/date/calendarwidgetex.h
  42. 1 1
      TransmitterSwitch/common/date/cdate.cpp
  43. 1 0
      TransmitterSwitch/common/date/cdate.h
  44. 2 1
      TransmitterSwitch/common/warning/warning.cpp
  45. 91 0
      TransmitterSwitch/lhtranmitterswitch.cpp
  46. 99 0
      TransmitterSwitch/lhtranmitterswitch.h
  47. 62 11
      TransmitterSwitch/transmitterswitch.cpp
  48. 7 0
      TransmitterSwitch/transmitterswitch.h
  49. 67 0
      demo/LHCoaxialSwitchSetInfo/LHCoaxialSwitchSetInfo.pro
  50. 422 0
      demo/LHCoaxialSwitchSetInfo/LHCoaxialSwitchSetInfo.pro.user
  51. 12 0
      demo/LHCoaxialSwitchSetInfo/LHCoaxialSwitchSetInfo_global.h
  52. 40 0
      demo/LHCoaxialSwitchSetInfo/comboBox/customcombobox.cpp
  53. 20 0
      demo/LHCoaxialSwitchSetInfo/comboBox/customcombobox.h
  54. BIN
      demo/LHCoaxialSwitchSetInfo/common/GlobalMsgMgr/error.png
  55. 208 0
      demo/LHCoaxialSwitchSetInfo/common/GlobalMsgMgr/globalmsgmgr.cpp
  56. 94 0
      demo/LHCoaxialSwitchSetInfo/common/GlobalMsgMgr/globalmsgmgr.h
  57. BIN
      demo/LHCoaxialSwitchSetInfo/common/GlobalMsgMgr/normal.png
  58. 8 0
      demo/LHCoaxialSwitchSetInfo/common/GlobalMsgMgr/resglobalmsg.qrc
  59. BIN
      demo/LHCoaxialSwitchSetInfo/common/GlobalMsgMgr/success.png
  60. BIN
      demo/LHCoaxialSwitchSetInfo/common/GlobalMsgMgr/warn.png
  61. 201 0
      demo/LHCoaxialSwitchSetInfo/common/LHHTTPAPI/lhhttpapi.cpp
  62. 85 0
      demo/LHCoaxialSwitchSetInfo/common/LHHTTPAPI/lhhttpapi.h
  63. 64 0
      demo/LHCoaxialSwitchSetInfo/common/LHQLogAPI/LHQLogAPI.cpp
  64. 63 0
      demo/LHCoaxialSwitchSetInfo/common/LHQLogAPI/LHQLogAPI.h
  65. 186 0
      demo/LHCoaxialSwitchSetInfo/common/PaintHelper/painthelper.cpp
  66. 75 0
      demo/LHCoaxialSwitchSetInfo/common/PaintHelper/painthelper.h
  67. 129 0
      demo/LHCoaxialSwitchSetInfo/common/Singletonwork/singletonwork.cpp
  68. 62 0
      demo/LHCoaxialSwitchSetInfo/common/Singletonwork/singletonwork.h
  69. 85 0
      demo/LHCoaxialSwitchSetInfo/common/UpdateSkinStyle/lhstylemanager.cpp
  70. 49 0
      demo/LHCoaxialSwitchSetInfo/common/UpdateSkinStyle/lhstylemanager.h
  71. 297 0
      demo/LHCoaxialSwitchSetInfo/configwidget.cpp
  72. 44 0
      demo/LHCoaxialSwitchSetInfo/configwidget.h
  73. 424 0
      demo/LHCoaxialSwitchSetInfo/configwidget.ui
  74. BIN
      demo/LHCoaxialSwitchSetInfo/deep/dropdown.png
  75. 234 0
      demo/LHCoaxialSwitchSetInfo/deep/lhcoaxialswitchsetinfo.qss
  76. 335 0
      demo/LHCoaxialSwitchSetInfo/devicemanager.cpp
  77. 125 0
      demo/LHCoaxialSwitchSetInfo/devicemanager.h
  78. 99 0
      demo/LHCoaxialSwitchSetInfo/lhcoaxialconfig.cpp
  79. 42 0
      demo/LHCoaxialSwitchSetInfo/lhcoaxialconfig.h
  80. 104 0
      demo/LHCoaxialSwitchSetInfo/lhcoaxialswitchsetinfo.cpp
  81. 96 0
      demo/LHCoaxialSwitchSetInfo/lhcoaxialswitchsetinfo.h
  82. BIN
      demo/LHCoaxialSwitchSetInfo/light/dropdown.png
  83. 232 0
      demo/LHCoaxialSwitchSetInfo/light/lhcoaxialswitchsetinfo.qss
  84. 8 0
      demo/LHCoaxialSwitchSetInfo/resource.qrc
  85. 39 0
      demo/LHCoaxialSwitchSetInfo/version.rc
  86. 52 47
      show1/CMakeLists.txt
  87. 83 0
      show1/LHTransmitterSwitchAPI/lhtransmitterswitchapi.cpp
  88. 47 0
      show1/LHTransmitterSwitchAPI/lhtransmitterswitchapi.h
  89. 3 4
      show1/main.cpp
  90. 72 62
      show1/widget.cpp
  91. 3 2
      show1/widget.h

+ 10 - 18
CMakeLists.txt

@@ -7,26 +7,20 @@ set(CMAKE_AUTOUIC ON)
 set(CMAKE_AUTOMOC ON)
 set(CMAKE_AUTORCC ON)
 
-set(CMAKE_CXX_STANDARD 17)
+set(CMAKE_CXX_STANDARD 11)
 set(CMAKE_CXX_STANDARD_REQUIRED ON)
 
 
 
 #=========================================================
-#********************  指定Qt安装路径 ********************
+#*******************  设置可执行文件名称 *****************
 #=========================================================
-# option(QT_5.12.12 "使用Qt5.12.12" OFF)
 
-# if(QT_5.12.12)
-#     if(CMAKE_CXX_COMPILER_ID MATCHES GNU)
-#         set(CMAKE_PREFIX_PATH "C:/Qt/Qt5.12.12/5.12.12/mingw73_64")
-#     elseif(CMAKE_CXX_COMPILER_ID MATCHES MSVC)
-#         set(CMAKE_PREFIX_PATH "C:/Qt/Qt5.12.12/5.12.12/msvc2017_64/bin")
-#     endif()
-# endif()
+set(lib_name LHTransmitterSwitch)
+
 
 #=========================================================
-#*************  设置可执行文件的名称和输出位置 *************
+#****************  设置可执行文件输出位置 ****************
 #=========================================================
 
 
@@ -34,7 +28,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
 
 #设置可执行文件和库位置,可能是qt tools的bug,选择32位依旧是64位编译器
 if(CMAKE_SYSTEM_NAME MATCHES "Linux")
-    message(STATUS "Using Linux System")
+    # message(STATUS "Using Linux System")
     if(CMAKE_BUILD_TYPE MATCHES Debug)
         set(exec_out_path ${CMAKE_SOURCE_DIR}/../bin_Debug)
         set(BUILD_LIB_PATH ${CMAKE_SOURCE_DIR}/../bin_Debug)
@@ -43,7 +37,7 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux")
         set(BUILD_LIB_PATH ${CMAKE_SOURCE_DIR}/../bin_Release)
     endif()
 elseif(CMAKE_SYSTEM_NAME MATCHES "Windows")
-    message(STATUS "Using Windows System")
+    # message(STATUS "Using Windows System")
     if(CMAKE_CXX_COMPILER_ID MATCHES GNU)
         message(STATUS "Using Compiler : ${CMAKE_CXX_COMPILER_ID}")
         #设置日志库的位置,判断32位和64位,CMAKE_CL_64已经被废弃
@@ -112,11 +106,9 @@ elseif(CMAKE_BUILD_TYPE MATCHES Release)
     add_compile_definitions(C_RELEASE)
 endif()
 
-if(CMAKE_SIZEOF_VOID_P EQUAL 8)
-    option(ENABLE_SPDLOG_STATIC_LIB "使用SPDLOG静态库" OFF)
-elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)
+#是否启用SPDLOG的静态库
+option(ENABLE_SPDLOG_STATIC_LIB "使用SPDLOG静态库" ON)
 
-endif()
 
 #需要定义这个宏,才会使用编译好的动态库
 add_compile_definitions(SPDLOG_COMPILED_LIB)
@@ -156,7 +148,7 @@ file(GLOB GLOBAL_SRC
 #=========================================================
 
 
-# add_subdirectory(TransmitterSwitch)
+add_subdirectory(TransmitterSwitch)
 add_subdirectory(show1)
 
 

+ 1 - 1
External

@@ -1 +1 @@
-Subproject commit df215c0e95cb4390fa4294619d1dffb578532a4f
+Subproject commit f3cef7cf1b2e18868aa975b9a82c51565e658041

+ 1 - 1
TransmitterSwitch/AddItem/addnormalitem.cpp

@@ -16,7 +16,7 @@
 #include "ItemData.h"
 #include "oneshadow.h"
 
-#include "lhstylemanager.h"
+// #include "lhstylemanager.h"
 
 AddNormalItem::AddNormalItem(QWidget *parent) :
     QDialog(parent),

+ 1 - 1
TransmitterSwitch/AddItem/addspecialitem.cpp

@@ -17,7 +17,7 @@
 #include "ItemData.h"
 #include "oneshadow.h"
 
-#include "lhstylemanager.h"
+// #include "lhstylemanager.h"
 
 AddSpecialItem::AddSpecialItem(QWidget *parent) :
     QDialog(parent),

+ 103 - 0
TransmitterSwitch/CMakeLists.txt

@@ -0,0 +1,103 @@
+cmake_minimum_required(VERSION 3.12)
+
+#设置宏定义
+add_compile_definitions(LHTRANSMITTERSWITCH_LIBRARY)
+
+
+
+#包含源文件
+file(GLOB LOCAL_SRC
+    ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/*.ui
+    ${CMAKE_CURRENT_SOURCE_DIR}/*.qrc
+
+    # ${CMAKE_CURRENT_SOURCE_DIR}/StyleManager/*.cpp
+
+    ${CMAKE_SOURCE_DIR}/External/common/Thread/*.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/WebAPI/*.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/Resource/*.qrc
+    ${CMAKE_CURRENT_SOURCE_DIR}/WidgetItems/*.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/UserData/*.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/AddItem/*.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/ItemData/*.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/Template/*.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/warnning/*.cpp
+
+    ${CMAKE_CURRENT_SOURCE_DIR}/common/Shadow/*.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/common/ImageBlur/*.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/common/combobox/*.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/common/SelectTime/*.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/common/date/*.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/common/date/*.qrc
+    ${CMAKE_CURRENT_SOURCE_DIR}/common/DropShadow/*.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/common/PaintHelper/*.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/common/warning/*.cpp
+    # ${CMAKE_CURRENT_SOURCE_DIR}/common/LHLog/*.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/common/Logs/*.cpp
+
+    # ${LHQLog_SOURCE_DIRS}/*.cpp
+    ${LHHTTPAPI_SOURCE_DIRS}/*.cpp
+    ${LHQLog_SOURCE_DIRS}/*.cpp
+)
+
+# message(STATUS "LHQLog_SOURCE_DIRS: ${LHQLog_SOURCE_DIRS}")
+# message(STATUS "LHHTTPAPI_SOURCE_DIRS: ${LHHTTPAPI_SOURCE_DIRS}")
+
+#生成可执行程序
+# add_executable(${lib_name} ${LOCAL_SRC})
+add_library(${lib_name} SHARED ${LOCAL_SRC})
+
+
+#添加头文件
+target_include_directories(${lib_name} PRIVATE
+    ${CMAKE_CURRENT_SOURCE_DIR}
+    ${CMAKE_CURRENT_SOURCE_DIR}/LHLog
+
+    # ${CMAKE_CURRENT_SOURCE_DIR}/StyleManager
+
+    ${CMAKE_SOURCE_DIR}/External/common/Thread
+
+    ${CMAKE_CURRENT_SOURCE_DIR}/WebAPI
+    ${CMAKE_CURRENT_SOURCE_DIR}/WidgetItems
+    ${CMAKE_CURRENT_SOURCE_DIR}/UserData
+    ${CMAKE_CURRENT_SOURCE_DIR}/AddItem
+    ${CMAKE_CURRENT_SOURCE_DIR}/ItemData
+    ${CMAKE_CURRENT_SOURCE_DIR}/Template
+    ${CMAKE_CURRENT_SOURCE_DIR}/warnning
+
+    ${CMAKE_CURRENT_SOURCE_DIR}/common
+    ${CMAKE_CURRENT_SOURCE_DIR}/common/nlohmann
+    ${CMAKE_CURRENT_SOURCE_DIR}/common/Shadow
+    ${CMAKE_CURRENT_SOURCE_DIR}/common/ImageBlur
+    ${CMAKE_CURRENT_SOURCE_DIR}/common/combobox
+    ${CMAKE_CURRENT_SOURCE_DIR}/common/SelectTime
+    ${CMAKE_CURRENT_SOURCE_DIR}/common/date
+    ${CMAKE_CURRENT_SOURCE_DIR}/common/warning
+    ${CMAKE_CURRENT_SOURCE_DIR}/common/LHLog
+    ${CMAKE_CURRENT_SOURCE_DIR}/common/Logs
+
+    # ${LHQLog_INCLUDE_DIRS}
+    ${LHHTTPAPI_INCLUDE_DIRS}
+    ${spdlog_INCLUDE_DIR}
+    # ${LHQLog_INCLUDE_DIRS}
+)
+#链接Qt库
+target_link_libraries(${lib_name} PRIVATE
+    Qt5::Widgets
+    Qt5::Core
+    Qt5::Network
+)
+
+#链接外部库
+target_link_libraries(${lib_name} PRIVATE
+    # ${spdlog_LIBRARY}
+    ${spdlog_STATIC_LIBRARY}
+)
+
+#连接stdc++fs库,如果编译器版本低于GCC9.0,则需要连接这个库
+#GCC9.0以上包含进了标准库
+# if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+#     if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0)
+#         target_link_libraries(${execName1} PRIVATE stdc++fs)
+#     endif()
+# endif()

+ 22 - 13
TransmitterSwitch/ItemData/oneitem.cpp

@@ -7,7 +7,7 @@
 #include "TransmitterSwitchInfo.h"
 #include "customcombobox.h"
 
-#include "lhstylemanager.h"
+// #include "lhstylemanager.h"
 
 OneItem::OneItem(QWidget *parent, bool isSpecial) :
     QWidget(parent), m_isSpecial(isSpecial),
@@ -29,7 +29,7 @@ OneItem::OneItem(bool isSpecial) :
 
 OneItem::~OneItem()
 {
-    LHStyleManager::Instance()->RemoveWidget(this);
+    // LHStyleManager::Instance()->RemoveWidget(this);
     delete ui;
 }
 
@@ -37,18 +37,19 @@ OneItem::~OneItem()
 /* 初始化 */
 void OneItem::init()
 {
+    QString qssPath = EPConfig.getQSSPath() + "/oneitem.qss";
     /* 加载QSS */
-    // QFile file(":/QSS/QSS/OneItem_dark.qss");
-    // if(file.open(QIODevice::ReadOnly))
-    // {
-    //     QString stylesheet = file.readAll();
-    //     this->setStyleSheet(stylesheet);
-    //     file.close();
-    // } else
-    // {
-    //     LH_WRITE_ERROR(QString("打开文件失败:%1").arg(file.fileName()));
-    // }
-    LHStyleManager::Instance()->AddWidget(this);
+    QFile file(qssPath);
+    if(file.open(QIODevice::ReadOnly))
+    {
+        QString stylesheet = file.readAll();
+        this->setStyleSheet(stylesheet);
+        file.close();
+    } else
+    {
+        LH_WRITE_ERROR(QString("打开文件失败:%1").arg(file.fileName()));
+    }
+    // LHStyleManager::Instance()->AddWidget(this);
     /* 设置背景透明 */
     this->setAttribute(Qt::WA_TranslucentBackground);
     /* 设置无边框 */
@@ -85,6 +86,8 @@ void OneItem::init()
     connect(ui->pBtn_execDate,&QPushButton::clicked,this,&OneItem::do_pBtn_execDate_clicked);
     connect(ui->pBtn_iconDate,&QPushButton::clicked,this,&OneItem::do_pBtn_execDate_clicked);
     connect(ui->pBtn_close, &QPushButton::clicked, this, &OneItem::do_pBtn_close_clicked);
+    /* 连接切换样式表的信号和槽 */
+    connect(&EPConfig, &ExecPlanGlobalConfig::signal_oneItemQssChanged, this, &OneItem::do_setQSS);
 }
 
 /* 设置序号 */
@@ -239,6 +242,12 @@ QSize OneItem::getExecDateSize()
     return ui->pBtn_execDate->size();
 }
 
+/* 设置样式表,打开的样式表 */
+void OneItem::do_setQSS(const QString& qss)
+{
+    this->setStyleSheet(qss);
+}
+
 /* 设备改变了 */
 void OneItem::do_devChanged(QString devName)
 {

+ 4 - 0
TransmitterSwitch/ItemData/oneitem.h

@@ -79,6 +79,10 @@ signals:
     /* 设备改变了 */
     void signal_devChanged();
 
+public slots:
+    /* 设置样式表,打开的样式表 */
+    void do_setQSS(const QString& qss);
+
 private slots:
     /* 设备改变了 */
     void do_devChanged(QString devName);

+ 3 - 3
TransmitterSwitch/Resource/QSS/black/SelectTime/timepartwidget.qss

@@ -8,7 +8,7 @@ QWidget
 
 QListWidget
 {
-	font-family:"Source Han Sans CN";
+	/* font-family:"Source Han Sans CN"; */
     font-size: 14px;
     font-weight: 400;
     color: rgba(255,255,255,0.9);
@@ -21,7 +21,7 @@ QListView::item:hover
 {
 	/* background-color: rgb(245,245,245); */
     background-color: rgb(227, 238, 255);
-	font-family:"Source Han Sans CN";
+	/* font-family:"Source Han Sans CN"; */
     font-size: 14px;
     font-weight: 400;
     color: "#3A3F63";
@@ -31,7 +31,7 @@ QListView::item:selected
 {
 	/* background-color: rgb(227, 238, 255); */
     background-color: #438EFF;
-	font-family:"Source Han Sans CN";
+	/* font-family:"Source Han Sans CN"; */
     font-size: 14px;
     font-weight: 500;
     color: rgba(255,255,255,0.9);

+ 16 - 4
TransmitterSwitch/Resource/QSS/black/addnormalitem.qss

@@ -4,7 +4,7 @@
  * ========================================================== */
 QWidget
 {
-    font-family: 思源黑体R;
+    /* font-family: 思源黑体R; */
     font-weight: 400;
     font-size: 14px;
     color: #D2D2D2;
@@ -52,7 +52,7 @@ QLabel#label_title
 QPushButton
 {
 	text-align: center;
-	font-family: 思源黑体M;
+	/* font-family: 思源黑体M; */
 }
 
 QPushButton#pBtn_Close
@@ -135,6 +135,18 @@ QComboBox:enabled
     padding-left: 12px;
 }
 
+
+QComboBox:enabled[Warn=true]
+{
+    background-color: transparent;
+    border: 1px solid #D21F21;
+    border-radius: 4px;
+    font-size:14px;
+    font-weight: 400;
+    color:#3A3F63;
+    padding-left: 12px;
+}
+
 /* 不能编辑的时候的样式,setEnable(false) */
 QComboBox:!enabled
 {
@@ -249,7 +261,7 @@ TimeWidget
 
 QPushButton#pBtn_selectTime
 {
-    font-family: 思源黑体R;
+    /* font-family: 思源黑体R; */
     background: transparent;
     border: 1px solid rgba(255,255,255,0.15);
     border-radius: 4px;
@@ -261,7 +273,7 @@ QPushButton#pBtn_selectTime
 
 QPushButton#pBtn_selectTime:hover
 {
-    font-family: 思源黑体R;
+    /* font-family: 思源黑体R; */
     background: transparent;
     border: 1px solid #438EFF;
     border-radius: 4px;

+ 16 - 5
TransmitterSwitch/Resource/QSS/black/addspecialitem.qss

@@ -4,7 +4,7 @@
  * ========================================================== */
 QWidget
 {
-    font-family: 思源黑体R;
+    /* font-family: 思源黑体R; */
     font-weight: 400;
     font-size: 14px;
     color: #D2D2D2;
@@ -50,7 +50,7 @@ QLabel#label_title
 QPushButton
 {
 	text-align: center;
-	font-family: 思源黑体M;
+	/* font-family: 思源黑体M; */
 }
 
 QPushButton#pBtn_Close
@@ -131,6 +131,17 @@ QComboBox:enabled
     padding-left: 12px;
 }
 
+QComboBox:enabled[Warn=true]
+{
+    background-color: transparent;
+    border: 1px solid #D21F21;
+    border-radius: 4px;
+    font-size:14px;
+    font-weight: 400;
+    color:#3A3F63;
+    padding-left: 12px;
+}
+
 /* 不能编辑的时候的样式,setEnable(false) */
 QComboBox:!enabled
 {
@@ -244,7 +255,7 @@ TimeWidget
 
 QPushButton#pBtn_selectTime
 {
-    font-family: 思源黑体R;
+    /* font-family: 思源黑体R; */
     background: transparent;
     border: 1px solid rgba(255,255,255,0.15);
     border-radius: 4px;
@@ -256,7 +267,7 @@ QPushButton#pBtn_selectTime
 
 QPushButton#pBtn_selectTime:hover
 {
-    font-family: 思源黑体R;
+    /* font-family: 思源黑体R; */
     background: transparent;
     border: 1px solid #438EFF;
     border-radius: 4px;
@@ -268,7 +279,7 @@ QPushButton#pBtn_selectTime:hover
 /* 报警红框 */
 QPushButton#pBtn_selectTime[Warn=true]
 {
-    font-family: 思源黑体R;
+    /* font-family: 思源黑体R; */
 	background: transparent;
     border-radius: 4px;
     padding-left:12px;

+ 1 - 1
TransmitterSwitch/Resource/QSS/black/importtemplate.qss

@@ -3,7 +3,7 @@ QWidget
     background: transparent;
     border-radius: 8px;
 
-    font-family: 思源黑体R;
+    /* font-family: 思源黑体R; */
     font-weight: 400;
     font-size: 14px;
     color: #D2D2D2;

+ 1 - 1
TransmitterSwitch/Resource/QSS/black/oneitem.qss

@@ -1,7 +1,7 @@
 
 QWidget
 {
-    font-family: 思源黑体R;
+    /* font-family: 思源黑体R; */
     font-weight: 400;
     font-size: 14px;
     color: #D2D2D2;

+ 2 - 2
TransmitterSwitch/Resource/QSS/black/savetotemplate.qss

@@ -2,7 +2,7 @@ QWidget
 {
     background: #FFFFFF;
     border-radius: 8px;
-    font-family: 思源黑体R;
+    /* font-family: 思源黑体R; */
     font-weight: 400;
     font-size: 14px;
     color: #D2D2D2;
@@ -28,7 +28,7 @@ QWidget#widget_Top
 
 QLabel#label_title
 {
-    font-family: 思源黑体M;
+    /* font-family: 思源黑体M; */
     font-weight: bold;
     font-size: 18px;
     color: #EBEBEB;

+ 8 - 2
TransmitterSwitch/Resource/QSS/black/transmitterswitch.qss

@@ -2,7 +2,7 @@
 
 QWidget
 {
-    font-family: 思源黑体R;
+    /* font-family: 思源黑体R; */
     font-weight: 400;
     font-size: 14px;
     color: #B1B3B4;
@@ -25,7 +25,7 @@ QWidget#widget
 
 QPushButton
 {
-    font-family: 思源黑体M;
+    /* font-family: 思源黑体M; */
     font-weight: 400;
     font-size: 14px;
     color: #D2D2D2;
@@ -109,6 +109,9 @@ QWidget#widget_weekpBtn
 /* 周几按钮 */
 QPushButton#pBtn_Monday, #pBtn_Tuesday, #pBtn_Wednesday, #pBtn_Thursday, #pBtn_Friday, #pBtn_Saturday, #pBtn_Sunday, #pBtn_SpecialDay
 {
+    font-weight: 600;
+    font-size: 14px;
+
     text-align: left;
     padding-left: 19px;
     background: #313539;
@@ -118,6 +121,9 @@ QPushButton#pBtn_Monday, #pBtn_Tuesday, #pBtn_Wednesday, #pBtn_Thursday, #pBtn_F
 
 QPushButton#pBtn_Monday:checked, #pBtn_Tuesday:checked, #pBtn_Wednesday:checked, #pBtn_Thursday:checked, #pBtn_Friday:checked, #pBtn_Saturday:checked, #pBtn_Sunday:checked, #pBtn_SpecialDay:checked
 {
+    font-weight: 600;
+    font-size: 14px;
+    
     text-align: left;
     padding-left: 19px;
     background: rgba(67,142,255,0.2);

+ 3 - 3
TransmitterSwitch/Resource/QSS/black/warning.qss

@@ -2,7 +2,7 @@ QWidget
 {
     background: transparent;
     border-radius: 8px;
-    font-family: 思源黑体R;
+    /* font-family: 思源黑体R; */
     font-weight: 400;
     font-size: 18px;
     color: #D2D2D2;
@@ -27,7 +27,7 @@ QWidget#widget_Top
 
 QLabel#label_title
 {
-    font-family: 思源黑体M;
+    /* font-family: 思源黑体M; */
     font-weight: bold;
     font-size: 18px;
     color: #D2D2D2;
@@ -48,7 +48,7 @@ QLabel#label_warnIcon
 
 QLabel#label_Warn
 {
-	font-family: 思源黑体R;
+	/* font-family: 思源黑体R; */
 	font-weight: 400;
 	font-size: 18px;
 	color: #D2D2D2;

+ 3 - 3
TransmitterSwitch/Resource/QSS/white/SelectTime/timepartwidget.qss

@@ -1,6 +1,6 @@
 QListWidget
 {
-	font-family:"Source Han Sans CN";
+	/* font-family:"Source Han Sans CN"; */
     font-size: 14px;
     font-weight: 400;
     color: "#3A3F63";
@@ -12,7 +12,7 @@ QListWidget
 QListView::item:hover 
 {
 	background-color: rgb(245,245,245);
-	font-family:"Source Han Sans CN";
+	/* font-family:"Source Han Sans CN"; */
     font-size: 14px;
     font-weight: 400;
     color: "#3A3F63";
@@ -21,7 +21,7 @@ QListView::item:hover
 QListView::item:selected 
 {
 	background-color: rgb(227, 238, 255);
-	font-family:"Source Han Sans CN";
+	/* font-family:"Source Han Sans CN"; */
     font-size: 14px;
     font-weight: 500;
     color: "#3A3F63";

+ 16 - 4
TransmitterSwitch/Resource/QSS/white/addnormalitem.qss

@@ -4,7 +4,7 @@
  * ========================================================== */
 QWidget
 {
-    font-family: 思源黑体R;
+    /* font-family: 思源黑体R; */
     font-weight: 400;
     font-size: 14px;
     color: #3A3F63;
@@ -51,7 +51,7 @@ QLabel#label_title
 QPushButton
 {
 	text-align: center;
-	font-family: 思源黑体M;
+	/* font-family: 思源黑体M; */
 }
 
 QPushButton#pBtn_Close
@@ -133,6 +133,18 @@ QComboBox:enabled
     padding-left: 12px;
 }
 
+QComboBox:enabled[Warn=true]
+{
+    background-color:#FFFFFF;
+    border: 1px solid #D21F21;
+    border-radius: 4px;
+    font-size:14px;
+    font-weight: 400;
+    color:#3A3F63;
+    padding-left: 12px;
+}
+
+
 /* 不能编辑的时候的样式,setEnable(false) */
 QComboBox:!enabled
 {
@@ -266,7 +278,7 @@ TimeWidget
 
 QPushButton#pBtn_selectTime
 {
-    font-family: 思源黑体R;
+    /* font-family: 思源黑体R; */
     background: transparent;
     border: 1px solid #E6E9F4;
     border-radius: 4px;
@@ -279,7 +291,7 @@ QPushButton#pBtn_selectTime
 
 QPushButton#pBtn_selectTime:hover
 {
-    font-family: 思源黑体R;
+    /* font-family: 思源黑体R; */
     background: transparent;
     border: 1px solid #4458FE;
     border-radius: 4px;

+ 16 - 4
TransmitterSwitch/Resource/QSS/white/addspecialitem.qss

@@ -4,7 +4,7 @@
  * ========================================================== */
 QWidget
 {
-    font-family: 思源黑体R;
+    /* font-family: 思源黑体R; */
     font-weight: 400;
     font-size: 14px;
     color: #3A3F63;
@@ -46,7 +46,7 @@ QLabel#label_title
 QPushButton
 {
 	text-align: center;
-	font-family: 思源黑体M;
+	/* font-family: 思源黑体M; */
 }
 
 QPushButton#pBtn_Close
@@ -128,6 +128,18 @@ QComboBox:enabled
     padding-left: 12px;
 }
 
+QComboBox:enabled[Warn=true]
+{
+    background-color:#FFFFFF;
+    border: 1px solid #D21F21;
+    border-radius: 4px;
+    font-size:14px;
+    font-weight: 400;
+    color:#3A3F63;
+    padding-left: 12px;
+}
+
+
 /* 不能编辑的时候的样式,setEnable(false) */
 QComboBox:!enabled
 {
@@ -252,7 +264,7 @@ TimeWidget:!enabled
 
 QPushButton#pBtn_selectTime
 {
-    font-family: 思源黑体R;
+    /* font-family: 思源黑体R; */
     background: transparent;
     border: 1px solid #E6E9F4;
     border-radius: 4px;
@@ -265,7 +277,7 @@ QPushButton#pBtn_selectTime
 
 QPushButton#pBtn_selectTime:hover
 {
-    font-family: 思源黑体R;
+    /* font-family: 思源黑体R; */
     background: transparent;
     border: 1px solid #4458FE;
     border-radius: 4px;

+ 2 - 1
TransmitterSwitch/Resource/QSS/white/importtemplate.qss

@@ -3,7 +3,7 @@ QWidget
     background: #FFFFFF;
     border-radius: 8px;
 
-    font-family: 思源黑体R;
+    /* font-family: 思源黑体R; */
     font-weight: 400;
     font-size: 14px;
     color: #3A3F63;
@@ -57,6 +57,7 @@ QLabel#label_warning
     color:red;
 }
 
+
 QPushButton#pBtn_close
 {
 	/* border-image: url(:/ICON/ICON/Dialog_close.png); */

+ 1 - 1
TransmitterSwitch/Resource/QSS/white/oneitem.qss

@@ -1,7 +1,7 @@
 
 QWidget
 {
-    font-family: 思源黑体R;
+    /* font-family: 思源黑体R; */
     font-weight: 400;
     font-size: 14px;
     color: #3A3F63;

+ 4 - 2
TransmitterSwitch/Resource/QSS/white/savetotemplate.qss

@@ -2,7 +2,7 @@ QWidget
 {
     background: #FFFFFF;
     border-radius: 8px;
-    font-family: 思源黑体R;
+    /* font-family: 思源黑体R; */
     font-weight: 400;
     font-size: 14px;
     color: #3A3F63;
@@ -23,7 +23,7 @@ QWidget#widget_Top
 
 QLabel#label_title
 {
-    font-family: 思源黑体M;
+    /* font-family: 思源黑体M; */
     font-weight: bold;
     font-size: 18px;
     color: #3A3F63;
@@ -63,6 +63,7 @@ QPushButton#pBtn_close[Hover = true]
 /********* 普通方框按钮三种状态效果 *********/
 QPushButton#pBtn_cancel
 {
+
 	border-radius: 16px;
 	text-align: center;
     background: #FFFFFF;
@@ -83,6 +84,7 @@ QPushButton#pBtn_cancel:hover
 /********* 带有底色按钮三种状态效果 *********/
 QPushButton#pBtn_ok
 {
+
 	border-radius: 16px;
 	text-align: center;
     color:white;

+ 14 - 6
TransmitterSwitch/Resource/QSS/white/transmitterswitch.qss

@@ -2,7 +2,7 @@
 
 QWidget
 {
-    font-family: 思源黑体R;
+    /* font-family: 思源黑体R; */
     font-weight: 400;
     font-size: 14px;
     color: #1D2129;
@@ -25,9 +25,7 @@ QWidget#widget
 
 QPushButton
 {
-    font-family: 思源黑体M;
-    font-weight: 400;
-    font-size: 14px;
+    /* font-family: 思源黑体M; */
     color: #3A3F63;
     line-height: 22px;
     text-align: center;
@@ -108,6 +106,9 @@ QWidget#widget_weekpBtn
 /* 周几按钮 */
 QPushButton#pBtn_Monday, #pBtn_Tuesday, #pBtn_Wednesday, #pBtn_Thursday, #pBtn_Friday, #pBtn_Saturday, #pBtn_Sunday, #pBtn_SpecialDay
 {
+    font-weight: 600;
+    font-size: 14px;
+
     background-color: #F5F5FA;
 
     text-align: left;
@@ -119,6 +120,9 @@ QPushButton#pBtn_Monday, #pBtn_Tuesday, #pBtn_Wednesday, #pBtn_Thursday, #pBtn_F
 
 QPushButton#pBtn_Monday:checked, #pBtn_Tuesday:checked, #pBtn_Wednesday:checked, #pBtn_Thursday:checked, #pBtn_Friday:checked, #pBtn_Saturday:checked, #pBtn_Sunday:checked, #pBtn_SpecialDay:checked
 {
+    font-weight: 600;
+    font-size: 14px;
+
     color:#4458FE;
     background-color:rgba(68, 88, 254, 0.10);
     text-align: left;
@@ -141,7 +145,9 @@ QWidget#widget_bottom
 
 QPushButton#pBtn_addPlan, QPushButton#pBtn_clearPlan, QPushButton#pBtn_importPlan, QPushButton#pBtn_exportPlan
 {
-    font-family: 思源黑体M;
+    font-weight: 400;
+    font-size: 14px;
+    /* font-family: 思源黑体M; */
     background-color: #FFFFFF;
     border-radius: 4px;
     border: 1px solid #E6E9F4;
@@ -149,7 +155,9 @@ QPushButton#pBtn_addPlan, QPushButton#pBtn_clearPlan, QPushButton#pBtn_importPla
 
 QPushButton#pBtn_addPlan:hover, #pBtn_clearPlan:hover, #pBtn_importPlan:hover, #pBtn_exportPlan:hover
 {
-    font-family: 思源黑体M;
+    font-weight: 400;
+    font-size: 14px;
+    /* font-family: 思源黑体M; */
     color: #4458FE;
     background-color: #FFFFFF;
     border-radius: 4px;

+ 6 - 3
TransmitterSwitch/Resource/QSS/white/warning.qss

@@ -2,7 +2,7 @@ QWidget
 {
     background: transparent;
     border-radius: 8px;
-    font-family: 思源黑体R;
+    /* font-family: 思源黑体R; */
     font-weight: 400;
     font-size: 18px;
     color: #3A3F63;
@@ -28,7 +28,7 @@ QWidget#widget_Top
 
 QLabel#label_title
 {
-    font-family: 思源黑体M;
+    /* font-family: 思源黑体M; */
     font-weight: bold;
     font-size: 18px;
     color: #3A3F63;
@@ -49,7 +49,7 @@ QLabel#label_warnIcon
 
 QLabel#label_Warn
 {
-	font-family: 思源黑体R;
+	/* font-family: 思源黑体R; */
 	font-weight: 400;
 	font-size: 18px;
 	color: #3A3F63;
@@ -95,6 +95,7 @@ QPushButton#pBtn_cancel
 }
 QPushButton#pBtn_cancel:hover
 {
+
     background: #FFFFFF;
     border-radius: 16px;
     border: 1px solid #4458FE;
@@ -104,6 +105,7 @@ QPushButton#pBtn_cancel:hover
 /********* 带有底色按钮三种状态效果 *********/
 QPushButton#pBtn_ok
 {
+
     color:white;
     background: qlineargradient( x0:1,x1:1,y1:0,y2:0,stop:1 #4F8AFF,stop:0 #4B5EFF);
     border-radius: 16px;
@@ -111,6 +113,7 @@ QPushButton#pBtn_ok
 
 QPushButton#pBtn_ok:hover
 {
+
     color:white;
     background: qlineargradient( x0:1,x1:1,y1:0,y2:0,stop:0 #5D73FF,stop:1 #6092FF);
     border-radius: 16px;

+ 24 - 7
TransmitterSwitch/Resource/TransSwitch.qrc

@@ -1,12 +1,29 @@
 <RCC>
     <qresource prefix="/QSS">
-        <!-- <file>QSS/TransmitterSwitch_dark.qss</file>
-        <file>QSS/AddNormalItem_Light.qss</file>
-        <file>QSS/AddSpecialItem_Light.qss</file>
-        <file>QSS/OneItem_dark.qss</file>
-        <file>QSS/savetotemplate_light.qss</file>
-        <file>QSS/importtemplate_light.qss</file>
-        <file>QSS/warning_light.qss</file> -->
+        <file>QSS/white/addnormalitem.qss</file>
+        <file>QSS/white/addspecialitem.qss</file>
+        <file>QSS/white/importtemplate.qss</file>
+        <file>QSS/white/oneitem.qss</file>
+        <file>QSS/white/savetotemplate.qss</file>
+        <file>QSS/white/transmitterswitch.qss</file>
+        <file>QSS/white/warning.qss</file>
+        <file>QSS/white/warning.qss</file>
+        <file>QSS/white/SelectTime/timepartwidget.qss</file>
+        <file>QSS/white/SelectTime/timewidget.qss</file>
+        <file>QSS/white/SelectDate/calendarheader.qss</file>
+        <file>QSS/white/SelectDate/calendarnav.qss</file>
+        <file>QSS/black/addnormalitem.qss</file>
+        <file>QSS/black/addspecialitem.qss</file>
+        <file>QSS/black/importtemplate.qss</file>
+        <file>QSS/black/oneitem.qss</file>
+        <file>QSS/black/savetotemplate.qss</file>
+        <file>QSS/black/transmitterswitch.qss</file>
+        <file>QSS/black/warning.qss</file>
+        <file>QSS/black/warning.qss</file>
+        <file>QSS/black/SelectTime/timepartwidget.qss</file>
+        <file>QSS/black/SelectTime/timewidget.qss</file>
+        <file>QSS/black/SelectDate/calendarheader.qss</file>
+        <file>QSS/black/SelectDate/calendarnav.qss</file>
     </qresource>
     <qresource prefix="/ICON">
         <file>Tip/Complete2x.png</file>

+ 2 - 2
TransmitterSwitch/Template/importtemplate.cpp

@@ -8,7 +8,7 @@
 #include <QPainter>
 
 #include "warning/warning.h"
-#include "lhstylemanager.h"
+// #include "lhstylemanager.h"
 #include "LHQLogAPI.h"
 #include "oneshadow.h"
 #include "TransmitterSwitchInfo.h"
@@ -147,7 +147,7 @@ void ImportTemplate::do_seletctRow(int row, int col)
 void ImportTemplate::createRow(int row,int num,const QString &text)
 {
     /* 获取亮色还是暗色 */
-    bool isDark = (LHStyleManager::Instance()->GetCurSkinStyle() == SkinStyle::eBlackStyle ? true : false);
+    bool isDark = (EPConfig.getUIStyle() == enum_UIStyle::UI_Dark ? true : false);
 
     QTableWidgetItem* item = new QTableWidgetItem;
     item->setData(Qt::DisplayRole,num);

+ 1 - 1
TransmitterSwitch/Template/savetotemplate.cpp

@@ -5,7 +5,7 @@
 #include <QFile>
 #include <QPainter>
 
-#include "lhstylemanager.h"
+// #include "lhstylemanager.h"
 #include "LHQLogAPI.h"
 #include "oneshadow.h"
 

+ 27 - 9
TransmitterSwitch/TransmitterSwitchInfo.cpp

@@ -1,7 +1,7 @@
 #include "TransmitterSwitchInfo.h"
 
-#include "lhstylemanager.h"
-
+// #include "lhstylemanager.h"
+#include <QFile>
 
 ExecPlanItemInfo::ExecPlanItemInfo()
 {
@@ -183,26 +183,44 @@ void MapDevice::deleteDevice(const QString& devName)
 
 ExecPlanGlobalConfig::ExecPlanGlobalConfig()
 {
-    m_qssPath = "";
+    m_qssPath = ":/QSS/QSS";
 }
 
 /* 设置样式表路径 */
-void ExecPlanGlobalConfig::setQSSPath(const QString& qssPath)
-{
-    m_qssPath = qssPath;
-}
+// void ExecPlanGlobalConfig::setQSSPath(const QString& qssPath)
+// {
+//     m_qssPath = qssPath;
+// }
 
 /* 获取样式表路径 */
 QString ExecPlanGlobalConfig::getQSSPath()
 {
-    if(LHStyleManager::Instance()->GetCurSkinStyle() == SkinStyle::eWhiteStyle)
+    if(m_UIStyle == enum_UIStyle::UI_Light)
     {
         return m_qssPath + m_lightQSS;
     }
-    else if(LHStyleManager::Instance()->GetCurSkinStyle() == SkinStyle::eBlackStyle)
+    else if(m_UIStyle == enum_UIStyle::UI_Dark)
     {
         return m_qssPath + m_darkQSS;
     }
     return QString();
 }
 
+/* 换肤,修改样式表 */
+void ExecPlanGlobalConfig::setUIStyle(enum_UIStyle style)
+{
+    m_UIStyle = style;
+    /* 打开文件OneItem的样式表,发送特殊换肤信号 */
+    QFile file;
+    QString qssOneItem = getQSSPath() + "/oneitem.qss";
+    file.setFileName(qssOneItem);
+    if(file.open(QIODevice::ReadOnly))
+    {
+        QString qss = file.readAll();
+        file.close();
+        emit signal_oneItemQssChanged(qss);
+    }
+    /* 发送普通换肤信号信号 */
+    emit signal_qssChanged();
+}
+

+ 42 - 2
TransmitterSwitch/TransmitterSwitchInfo.h

@@ -4,6 +4,7 @@
 #include <QDate>
 #include <QString>
 #include <QMap>
+#include <QObject>
 
 #include "nlohmann/json.hpp"
 
@@ -34,6 +35,32 @@ enum class enum_Action : int
     Act_OFF = 2,                /* 关机 */
 };
 
+/**
+ * @brief UI样式
+ * 
+ */
+enum class enum_UIStyle
+{
+    UI_Light = 0,               /* 亮色 */
+    UI_Dark = 1                 /* 暗色 */
+};
+
+
+struct InitData
+{
+    QString url;                /* WebAPI地址 */
+    QString serverID;           /* 服务器ID */
+    QString serverKey;          /* 服务器Key */
+    InitData& operator=(const InitData& data)
+    {
+        url = data.url;
+        serverID = data.serverID;
+        serverKey = data.serverKey;
+        return *this;
+    }
+};
+
+
 /**
  * @brief 执行计划条目信息
  * 
@@ -166,8 +193,10 @@ private:
  * @brief 执行计划页面的全局配置信息
  * 
  */
-class ExecPlanGlobalConfig
+class ExecPlanGlobalConfig : public QObject
 {
+    Q_OBJECT
+
     ExecPlanGlobalConfig();
     ExecPlanGlobalConfig(const ExecPlanGlobalConfig& config) = delete;
     ExecPlanGlobalConfig& operator=(const ExecPlanGlobalConfig& config) = delete;
@@ -181,15 +210,26 @@ public:
     }
 
     /* 设置样式表路径 */
-    void setQSSPath(const QString& qssPath);
+    // void setQSSPath(const QString& qssPath);
     /* 获取样式表路径 */
     QString getQSSPath();
+    /* 换肤,修改样式表 */
+    void setUIStyle(enum_UIStyle style);
+    /* 获取当前UI风格 */
+    enum_UIStyle getUIStyle() { return m_UIStyle; }
+
+signals:
+    /* 样式表改变了 */
+    void signal_qssChanged();
+    /* OneIten样式表改变了 */
+    void signal_oneItemQssChanged(const QString& qssPath);
 
 private:
     QString m_qssPath;                      /* 样式表路径 */
     const QString m_lightQSS = "/white";    /* 亮色样式表路径 */
     const QString m_darkQSS = "/black";     /* 暗色样式表路径 */
 
+    enum_UIStyle m_UIStyle;                 /* 当前UI样式 */
 };
 
 #define EPConfig ExecPlanGlobalConfig::getInstance()

+ 4 - 4
TransmitterSwitch/WebAPI/FromWebAPI.cpp

@@ -50,7 +50,7 @@ bool FromWebAPI::initWebApi(const QString& url, const QString& serverID, const Q
         LH_WRITE_ERROR(QString("Get server list failed:%1, error info:%2").arg(ret).arg(m_httpApi->DoGetLastError(&ret)));
         return false;
     }
-    LH_WRITE_LOG(QString("\nGet server list success:%1").arg(serverList));
+    // LH_WRITE_LOG(QString("\nGet server list success:%1").arg(serverList));
 #endif
 
     /* 登录,第二个参数是限制的服务 */
@@ -85,7 +85,7 @@ bool FromWebAPI::getDeviceInfo(QMap<QString, DeviceInfo>& mapDevice)
         return false;
     }
     /* 解析获取到的JSON数据 */
-    LH_WRITE_LOG_DEBUG(strRet);
+    // LH_WRITE_LOG_DEBUG(strRet);
 
     try 
     {
@@ -108,7 +108,7 @@ bool FromWebAPI::getDeviceInfo(QMap<QString, DeviceInfo>& mapDevice)
             DevInfo.ChannelID = it["chnid"].is_null() ? -1 : it["chnid"].get<int>();
             if(DevInfo.ChannelID <= 0)
             {
-                LH_WRITE_ERROR(QString("通道ID错误:%1").arg(DevInfo.ChannelID));
+                LH_WRITE_LOG_DEBUG(QString("通道ID错误:%1").arg(DevInfo.ChannelID));
                 continue;
             }
 
@@ -116,7 +116,7 @@ bool FromWebAPI::getDeviceInfo(QMap<QString, DeviceInfo>& mapDevice)
             auto devType = DevTypeContainer.getDevType(DevInfo.PTTypeCode);
             if(devType.PTTypeCode < 0)
             {
-                LH_WRITE_ERROR(QString("未找到设备类型:%1").arg(DevInfo.PTTypeCode));
+                LH_WRITE_LOG_DEBUG(QString("未找到设备类型:%1").arg(DevInfo.PTTypeCode));
                 continue;
             }
 

+ 0 - 0
show1/LHLog/LHQLogAPI.cpp → TransmitterSwitch/common/LHLog/LHQLogAPI.cpp


+ 0 - 0
show1/LHLog/LHQLogAPI.h → TransmitterSwitch/common/LHLog/LHQLogAPI.h


+ 69 - 0
TransmitterSwitch/common/Logs/loginit.cpp

@@ -0,0 +1,69 @@
+#include "loginit.h"
+
+#include "spdlog/spdlog.h"
+#include "spdlog/sinks/stdout_color_sinks.h"
+#include "spdlog/sinks/daily_file_sink.h"
+
+// #include "fmt/base.h"
+
+/* 初始化spdlog */
+void init_log()
+{
+    try 
+    {
+        /* 给默认记录器用的sink */
+        auto sink_default = std::make_shared<spdlog::sinks::stdout_color_sink_mt>();
+        /* 创建一个控制台sink */
+        auto sink_consolse = std::make_shared<spdlog::sinks::stdout_color_sink_mt>();
+        /* 创建一个文件sink,每天一个,00:00创建新的 */
+        auto sink_file = std::make_shared<spdlog::sinks::daily_file_sink_mt>("log/log.txt", 0, 0);
+        /* 修改输出格式 */
+        #if C_DEBUG
+            sink_default->set_pattern("%^[%Y-%m-%d %H:%M:%S:%e] [%l] [%s %#] %v %$");
+            sink_consolse->set_pattern("%^[%Y-%m-%d %H:%M:%S:%e] [%l] [%n] [%s %#] %v %$");
+            sink_file->set_pattern("%^[%Y-%m-%d %H:%M:%S:%e] [%l] [%n] [%s %#] %v %$");
+        #elif C_RELEASE
+            sink_default->set_pattern("%^[%Y-%m-%d %H:%M:%S:%e] [%l] %v %$");
+            sink_consolse->set_pattern("%^[%Y-%m-%d %H:%M:%S:%e] [%l] [%n] %v %$");
+            sink_file->set_pattern("%^[%Y-%m-%d %H:%M:%S:%e] [%l] [%n] %v %$");
+        #endif
+
+        /* 设置默认日志记录器,设置成自定义的sink */
+        spdlog::default_logger()->sinks().clear();
+        spdlog::default_logger()->sinks().push_back(sink_default);
+        spdlog::default_logger()->sinks().push_back(sink_file);
+        /* 创建sink数组 */
+        std::vector<spdlog::sink_ptr> sinks;
+        sinks.push_back(sink_consolse);
+        sinks.push_back(sink_file);
+
+        /* 创建一个标准输出 */
+        auto logger_main = std::make_shared<spdlog::logger>("main",begin(sinks),end(sinks));
+        /* 创建一个MQTT输出Logger */
+        auto logger_MQTT = std::make_shared<spdlog::logger>("MQTT",begin(sinks),end(sinks));
+        /* 创建一个线程池输出Logger */
+        auto logger_threadPool = std::make_shared<spdlog::logger>("ThreadPool",begin(sinks),end(sinks));
+
+        /* 注册到注册表 */
+        spdlog::register_logger(logger_main);
+        spdlog::register_logger(logger_MQTT);
+        spdlog::register_logger(logger_threadPool);
+
+
+        /* 设置spdlog输出级别,默认的估计不输出debug这个级别 */
+#ifdef C_DEBUG
+        spdlog::set_level(spdlog::level::trace);
+        spdlog::flush_on(spdlog::level::trace);
+#elif C_RELEASE
+        spdlog::set_level(spdlog::level::info);
+        spdlog::flush_on(spdlog::level::info);
+#endif
+
+
+
+    //    SPDLOG_LOGGER_DEBUG(logger_main,"******* 有行号且debug也能输出 *******");
+    }  catch (const spdlog::spdlog_ex& ex) {
+        fmt::print("Log initialization failed: %s\n", ex.what());
+    }
+}
+

+ 8 - 0
TransmitterSwitch/common/Logs/loginit.h

@@ -0,0 +1,8 @@
+
+
+#ifndef LOGINIT_H
+#define LOGINIT_H
+
+void init_log();
+
+#endif /* LOGINIT_H */

+ 4 - 11
TransmitterSwitch/common/SelectTime/timepartwidget.cpp

@@ -7,8 +7,9 @@
 #include <QDebug>
 #include <QFile>
 #include "mytimedelegate.h"
-#include "lhstylemanager.h"
+// #include "lhstylemanager.h"
 #include "LHQLogApi.h"
+#include "TransmitterSwitchInfo.h"
 
 TimePartWidget::TimePartWidget(QWidget *parent) :
     QWidget(parent),
@@ -104,16 +105,8 @@ void TimePartWidget::ScrollToSelect()
 /* 设置QSS */
 void TimePartWidget::setQSS()
 {
-    QString appPath = QCoreApplication::applicationDirPath();
-    QString qssPath;
-    if(LHStyleManager::Instance()->GetCurSkinStyle() == SkinStyle::eWhiteStyle)
-    {
-        qssPath = appPath + "/white/SelectTime/timepartwidget.qss";
-    }
-    else if(LHStyleManager::Instance()->GetCurSkinStyle() == SkinStyle::eBlackStyle)
-    {
-        qssPath = appPath + "/black/SelectTime/timepartwidget.qss";
-    }
+    // QString appPath = QCoreApplication::applicationDirPath();
+    QString qssPath = EPConfig.getQSSPath() + "/SelectTime/timepartwidget.qss";
 
     QFile file(qssPath);
     if(file.open(QFile::ReadOnly))

+ 3 - 11
TransmitterSwitch/common/SelectTime/timewidget.cpp

@@ -7,8 +7,9 @@
 #include <QFile>
 #include "timepartwidget.h"
 #include "shadowwidget.h"
-#include "lhstylemanager.h"
+// #include "lhstylemanager.h"
 #include "LHQLogApi.h"
+#include "TransmitterSwitchInfo.h"
 
 TimeWidget::TimeWidget(QWidget *parent , ShowType type) :
     QFrame(parent),
@@ -227,16 +228,7 @@ void TimeWidget::setEditLine(int w, int h)
 /* 设置QSS */
 void TimeWidget::setQSS()
 {
-    QString appPath = QCoreApplication::applicationDirPath();
-    QString qssPath;
-    if(LHStyleManager::Instance()->GetCurSkinStyle() == SkinStyle::eWhiteStyle)
-    {
-        qssPath = appPath + "/white/SelectTime/timewidget.qss";
-    }
-    else if(LHStyleManager::Instance()->GetCurSkinStyle() == SkinStyle::eBlackStyle)
-    {
-        qssPath = appPath + "/black/SelectTime/timewidget.qss";
-    }
+    QString qssPath = EPConfig.getQSSPath() + "/SelectTime/timewidget.qss";
 
     QFile file(qssPath);
     if(file.open(QFile::ReadOnly))

+ 10 - 6
TransmitterSwitch/common/date/calendarheader.cpp

@@ -1,7 +1,7 @@
 #include "calendarheader.h"
 #include "ui_calendarheader.h"
 #include "PaintHelper/painthelper.h"
-#include "StyleManager/lhstylemanager.h"
+// #include "StyleManager/lhstylemanager.h"
 #include "LHQLogAPI.h"
 
 #include <QFile>
@@ -12,7 +12,8 @@ CalendarHeader::CalendarHeader(QWidget *parent) :
 {
     ui->setupUi(this);
     // LHStyleManager::Instance()->AddWidget(this);
-    setQSS();
+    // setQSS();
+    setQSS(0);
 }
 
 CalendarHeader::~CalendarHeader()
@@ -35,15 +36,17 @@ void CalendarHeader::SetFirstDayOfWeek(Qt::DayOfWeek dayOfWeek)
 }
 
 /* 设置QSS */
-void CalendarHeader::setQSS()
+void CalendarHeader::setQSS(int style)
 {
     QString qssPath;
-    if(LHStyleManager::Instance()->GetCurSkinStyle() == SkinStyle::eWhiteStyle)
+    if(style == 0)
     {
+        /* 亮色UI */
         qssPath = ":/Calendar/qss/calendarheader_light.qss";
-    } 
-    else if(LHStyleManager::Instance()->GetCurSkinStyle() == SkinStyle::eBlackStyle)
+    }
+    else if(style == 1)
     {
+        /* 暗色UI */
         qssPath = ":/Calendar/qss/calendarheader_dark.qss";
     }
     QFile qssFile(qssPath);
@@ -57,6 +60,7 @@ void CalendarHeader::setQSS()
     }
 }
 
+
 void CalendarHeader::paintEvent(QPaintEvent *)
 {
     PainterEx painter(this);

+ 4 - 1
TransmitterSwitch/common/date/calendarheader.h

@@ -17,7 +17,10 @@ public:
     void SetFirstDayOfWeek(Qt::DayOfWeek dayOfWeek);
     
     /* 设置QSS */
-    void setQSS();
+    void setQSS(int style);
+
+public slots:
+
     
 private:
     Ui::CalendarHeader *ui;

+ 4 - 4
TransmitterSwitch/common/date/calendarnav.cpp

@@ -1,7 +1,7 @@
 #include "calendarnav.h"
 #include "PaintHelper/painthelper.h"
 #include "ui_calendarnav.h"
-#include "StyleManager/lhstylemanager.h"
+// #include "StyleManager/lhstylemanager.h"
 #include <QDebug>
 #include <QFile>
 
@@ -63,15 +63,15 @@ void CalendarNav::hideNextMonth(bool flag)
 }
 
 /* 设置QSS */
-void CalendarNav::setQSS()
+void CalendarNav::setQSS(int style)
 {
     QString qssPath = QApplication::applicationDirPath();
     QString qssFile;
-    if(LHStyleManager::Instance()->GetCurSkinStyle() == SkinStyle::eWhiteStyle)
+    if(style == 0)
     {
         // qssFile = qssPath + "/white/SelectDate/calendarnav.qss";
         qssFile = ":/Calendar/qss/CalendarNav_light.qss";
-    }else if(LHStyleManager::Instance()->GetCurSkinStyle() == SkinStyle::eBlackStyle)
+    }else if(style == 1)
     {
         // qssFile = qssPath + "/black/SelectDate/calendarnav.qss";
         qssFile = ":/Calendar/qss/CalendarNav_dark.qss";

+ 1 - 1
TransmitterSwitch/common/date/calendarnav.h

@@ -22,7 +22,7 @@ public:
     void hideNextMonth(bool);
 
     /* 设置QSS */
-    void setQSS();
+    void setQSS(int style = 0);
 private:
     Ui::CalendarNav *ui;
     QCalendarWidget *m_pCalendar;

+ 29 - 12
TransmitterSwitch/common/date/calendarwidgetex.cpp

@@ -13,11 +13,10 @@
 #include <QPainterPath>
 
 #include "scopeselectionmodel.h"
-#include "calendarheader.h"
-#include "calendarnav.h"
 #include "PaintHelper/painthelper.h"
-#include "StyleManager/lhstylemanager.h"
+// #include "StyleManager/lhstylemanager.h"
 //#include "utility/utility.h"
+#include "TransmitterSwitchInfo.h"
 
 CalendarWidgetEx::CalendarWidgetEx(QWidget *parent)
     : QCalendarWidget(parent)
@@ -43,15 +42,15 @@ CalendarWidgetEx::CalendarWidgetEx(QWidget *parent)
     QVBoxLayout *vBodyLayout = qobject_cast<QVBoxLayout *>(layout());
     if(vBodyLayout == nullptr) return;
 
-    CalendarNav *pNav = new CalendarNav(this);
-    CalendarHeader *pHeader = new CalendarHeader(this);
+    m_pNav = new CalendarNav(this);
+    m_pHeader = new CalendarHeader(this);
     setFirstDayOfWeek(Qt::Sunday);
-    pHeader->SetFirstDayOfWeek(Qt::Sunday);
+    m_pHeader->SetFirstDayOfWeek(Qt::Sunday);
 
-    vBodyLayout->insertWidget(0, pNav);
+    vBodyLayout->insertWidget(0, m_pNav);
     // 导航和星期标题间距
     vBodyLayout->insertSpacing(1, 10);
-    vBodyLayout->insertWidget(2, pHeader);
+    vBodyLayout->insertWidget(2, m_pHeader);
 
     vBodyLayout->setSpacing(10);
     vBodyLayout->setContentsMargins(10,0,10,10);
@@ -82,7 +81,8 @@ CalendarWidgetEx::CalendarWidgetEx(QWidget *parent)
     }
 
     connect(this, &QCalendarWidget::clicked, this, &CalendarWidgetEx::OnClicked);
-    initSkinColor();
+    // initSkinColor();
+    setUIStyle();
 
     /* 设置对象名称,加载QSS */
     // this->setObjectName("calendarWidget");
@@ -115,6 +115,23 @@ void CalendarWidgetEx::hideNavigatioinButton(bool bPreYear, bool bPreMon, bool b
     }
 }
 
+/* 设置UI样式,0亮色,1暗色 */
+void CalendarWidgetEx::setUIStyle()
+{
+    if(EPConfig.getUIStyle() == enum_UIStyle::UI_Light)
+    {
+        m_style = 0;
+    }
+    else if(EPConfig.getUIStyle() == enum_UIStyle::UI_Dark)
+    {
+        m_style = 1;
+    }
+    initSkinColor();
+    m_pNav->setQSS(m_style);
+    m_pHeader->setQSS(m_style);
+    update();
+}
+
 void CalendarWidgetEx::paintCell(QPainter *painter, const QRect &rect, const QDate &date) const
 {
     PainterEx *painterEx = static_cast<PainterEx*>(painter);
@@ -307,9 +324,9 @@ int CalendarWidgetEx::columnForDayOfWeek(int day) const
 
 void CalendarWidgetEx::initSkinColor()
 {
-    switch (LHStyleManager::Instance()->GetCurSkinStyle()) 
+    switch (m_style) 
     {
-    case eWhiteStyle:
+    case 0:
         m_normalTextColor = NORMAL_TEXT_BRIGHT;
         m_todayTextColor = TODAY_TEXT_BRIGHT;
         m_selectTextColor = SELECT_TEXT_BRIGHT;
@@ -320,7 +337,7 @@ void CalendarWidgetEx::initSkinColor()
         m_bgBrushColor = BG_BRUSH_BRIGHT;
         m_bgPenColor = BG_PEN_BRIGHT;
         break;
-    case eBlackStyle:
+    case 1:
         m_normalTextColor = NORMAL_TEXT_DEEP;
         m_todayTextColor = TODAY_TEXT_DEEP;
         m_selectTextColor = SELECT_TEXT_DEEP;

+ 9 - 0
TransmitterSwitch/common/date/calendarwidgetex.h

@@ -6,6 +6,9 @@
 #include <QLabel>
 #include <QProxyStyle>
 
+#include "calendarheader.h"
+#include "calendarnav.h"
+
 class ScopeSelectionModel;
 
 class NoFocusStyle : public QProxyStyle
@@ -39,6 +42,9 @@ public:
 
     void hideNavigatioinButton(bool bPreYear, bool bPreMon, bool bNextYear, bool bNextMon);
 
+    /* 设置UI样式,0亮色,1暗色 */
+    void setUIStyle();
+
 private:
     QDate dateForCell(int row, int column) const;
     QDate referenceDate() const;
@@ -55,6 +61,9 @@ public:
 private slots:
     void OnClicked(const QDate &date);
 private:
+    int m_style = 0;
+    CalendarNav* m_pNav = nullptr;
+    CalendarHeader* m_pHeader = nullptr;
     /* 亮色 */
     const QColor NORMAL_TEXT_BRIGHT{QColor(58,63,99)};
     const QColor TODAY_TEXT_BRIGHT{QColor(68,88,254)};

+ 1 - 1
TransmitterSwitch/common/date/cdate.cpp

@@ -47,6 +47,7 @@ void CDate::setDate(const QDate& date)
     m_calendarEx->setSelectedDate(date);
 }
 
+
 void CDate::paintEvent(QPaintEvent *event)
 {
     QPainter painter(this);
@@ -127,5 +128,4 @@ void CDate::init(const QDate &defaultDate)
         emit signal_close();
         this->close();
     });
-
 }

+ 1 - 0
TransmitterSwitch/common/date/cdate.h

@@ -41,6 +41,7 @@ public:
     /* 获取日期 */
     QDate getDate() const { return m_date; }
 
+
 signals:
     void signal_DateChanged(const QDate& date);
     void signal_close();

+ 2 - 1
TransmitterSwitch/common/warning/warning.cpp

@@ -8,9 +8,10 @@
 #include <QStyle>
 
 #include "oneshadow.h"
-#include "lhstylemanager.h"
+// #include "lhstylemanager.h"
 #include "LHQLogAPI.h"
 
+
 Warning::Warning(QWidget *parent) :
     QDialog(parent),
     ui(new Ui::Warning)

+ 91 - 0
TransmitterSwitch/lhtranmitterswitch.cpp

@@ -0,0 +1,91 @@
+#include "lhtranmitterswitch.h"
+
+#include "TransmitterSwitchInfo.h"
+#include "transmitterswitch.h"
+#include "loginit.h"
+
+TransmitterSwitch* g_pTransmitterSwitch = nullptr;
+InitData g_initData;
+
+int LHTRANSMITTERSWITCH_EXPORT DoInit(const InitData* pData)
+{
+    /* 初始化日志库 */
+    init_log();
+    g_initData = *pData;
+
+    return 0;
+}
+
+
+int LHTRANSMITTERSWITCH_EXPORT DoCreateWindow(int skintype, QWidget* parent)
+{
+    if (g_pTransmitterSwitch == nullptr)
+    {
+        g_pTransmitterSwitch = new TransmitterSwitch(parent);
+        if(skintype < 0 || skintype > 1)
+        {
+            g_pTransmitterSwitch->setUIStyle(0);
+            return -2;
+        }
+        g_pTransmitterSwitch->setUIStyle(skintype);
+    }
+    g_pTransmitterSwitch->setWebAPIInfo(g_initData);
+    return 0;
+}
+
+
+int LHTRANSMITTERSWITCH_EXPORT DoShowWindow(int skintype, bool showWindow)
+{
+    if(g_pTransmitterSwitch == nullptr)
+    {
+        return -1;
+    }
+    if(skintype < 0 || skintype > 1)
+    {
+        g_pTransmitterSwitch->setUIStyle(0);
+        return -2;
+    }
+    g_pTransmitterSwitch->setUIStyle(skintype);
+    if(showWindow)
+    {
+        g_pTransmitterSwitch->show();
+    } else
+    {
+        g_pTransmitterSwitch->hide();
+    }
+
+    return 0;
+}
+
+
+int LHTRANSMITTERSWITCH_EXPORT DoGetExecPlanFromEQM()
+{
+    if(g_pTransmitterSwitch == nullptr)
+    {
+        return -1;
+    }
+    g_pTransmitterSwitch->getExecPlanFromEQM();
+
+    return 0;
+}
+
+int LHTRANSMITTERSWITCH_EXPORT DoSaveExecPlanToEQM()
+{
+    if(g_pTransmitterSwitch == nullptr)
+    {
+        return -1;
+    }
+    g_pTransmitterSwitch->saveExecPlanToEQM();
+
+    return 0;
+}
+
+int LHTRANSMITTERSWITCH_EXPORT DoRelease()
+{
+    if(g_pTransmitterSwitch != nullptr)
+    {
+        delete g_pTransmitterSwitch;
+        g_pTransmitterSwitch = nullptr;
+    }
+    return 0;
+}

+ 99 - 0
TransmitterSwitch/lhtranmitterswitch.h

@@ -0,0 +1,99 @@
+#ifndef LHTRANSMITTERSWITCH_H
+#define LHTRANSMITTERSWITCH_H
+
+
+#include <QtCore/qglobal.h>
+#include <QWidget>
+
+#if defined(LHTRANSMITTERSWITCH_LIBRARY)
+#  define LHTRANSMITTERSWITCH_EXPORT Q_DECL_EXPORT
+#else
+#  define LHTRANSMITTERSWITCH_EXPORT Q_DECL_IMPORT
+#endif
+
+struct InitData;
+
+extern "C"
+{
+
+
+//------------------------------------------------------------------------
+//函    数: DoInit()
+//
+//说    明:初始化dll
+//
+//参    数:
+//       pData: 初始化数据
+//返 回 值:0:成功; 其他:失败(详见返回码定义)
+//------------------------------------------------------------------------
+int LHTRANSMITTERSWITCH_EXPORT DoInit(const InitData* pData);
+
+//------------------------------------------------------------------------
+//函    数: DoCreateWindow(int skintype, QWidget* parent)
+//
+//说    明: 创建窗口
+//
+//参    数: skintype:皮肤类型 0 白色风格  1 黑色风格
+//             parent 父窗口指针(父窗口隐藏子窗口也会隐藏,这里是必填)
+//
+//返 回 值:0:成功; 其他:失败(详见返回码定义)
+//------------------------------------------------------------------------
+int LHTRANSMITTERSWITCH_EXPORT DoCreateWindow(int skintype, QWidget* parent);
+
+
+//------------------------------------------------------------------------
+//函    数: DoShowWindow(int skintype, int serviceid, bool showWindow)
+//
+//说    明: 设置窗口显示状态、加载配置信息
+//
+//参    数: skintype 皮肤类型
+// serviceid: 服务id唯一标识,如果小于0界面显示默认值,大于0获取对应的配置数据
+// showWindow: true 显示 false 隐藏
+//
+//返 回 值:0:成功; 其他:失败(详见返回码定义)
+//------------------------------------------------------------------------
+int LHTRANSMITTERSWITCH_EXPORT DoShowWindow(int skintype, bool showWindow);
+
+
+//------------------------------------------------------------------------
+//函    数: DoGetExecPlanFromEQM
+//
+//说    明: 从EQM数据库中获取计划数据
+//
+//参    数: 无
+//
+//返 回 值:0:成功; 其他:失败(详见返回码定义)
+
+//------------------------------------------------------------------------
+int LHTRANSMITTERSWITCH_EXPORT DoGetExecPlanFromEQM();
+
+
+//------------------------------------------------------------------------
+//函    数: DoSaveExecPlanToEQM
+//
+//说    明: 保存计划到EQM数据库中
+//
+//参    数: 无
+//
+//返 回 值:0:成功; 其他:失败(详见返回码定义)
+
+//------------------------------------------------------------------------
+int LHTRANSMITTERSWITCH_EXPORT DoSaveExecPlanToEQM();
+
+
+//------------------------------------------------------------------------
+//函    数: DoRelease()
+//
+//说    明: 释放资源
+//
+//参    数: void
+//
+//返 回 值:0:成功; 其他:失败(详见返回码定义)
+//------------------------------------------------------------------------
+int LHTRANSMITTERSWITCH_EXPORT DoRelease();
+
+
+}
+
+
+#endif // LHTRANSMITTERSWITCH_H

+ 62 - 11
TransmitterSwitch/transmitterswitch.cpp

@@ -5,8 +5,9 @@
 #include <QFile>
 #include <QList>
 #include <memory>
-#include <qlist.h>
-#include <qstringliteral.h>
+#include <QLayout>
+// #include <qlist.h>
+// #include <qstringliteral.h>
 
 #include "LHQLogAPI.h"
 #include "widgetitems.h"
@@ -21,7 +22,7 @@
 #include "cdate.h"
 #include "savetotemplate.h"
 #include "importtemplate.h"
-#include "lhstylemanager.h"
+// #include "lhstylemanager.h"
 
 TransmitterSwitch::TransmitterSwitch(QWidget *parent) :
     QWidget(parent),
@@ -29,6 +30,12 @@ TransmitterSwitch::TransmitterSwitch(QWidget *parent) :
 {
     ui->setupUi(this);
 
+    /* 创建一个布局 */
+    QVBoxLayout* layout = new QVBoxLayout(parent);
+    layout->setMargin(0);
+    layout->setSpacing(0);
+    layout->addWidget(this);
+
     /* 创建WebAPI实例 */
     m_fromWebAPI = new FromWebAPI;
 
@@ -62,7 +69,10 @@ TransmitterSwitch::TransmitterSwitch(QWidget *parent) :
     connect(ui->pBtn_clearPlan, &QPushButton::clicked, this, &TransmitterSwitch::do_clearCurrentPage);
 
     /* 设置QSS */
-    LHStyleManager::Instance()->AddWidget(this);
+    // LHStyleManager::Instance()->AddWidget(this);
+    connect(&EPConfig, &ExecPlanGlobalConfig::signal_qssChanged, this, &TransmitterSwitch::do_setUIStyle);
+    /* 设置默认的皮肤 */
+    EPConfig.setUIStyle(enum_UIStyle::UI_Light);
 }
 
 TransmitterSwitch::~TransmitterSwitch()
@@ -84,13 +94,13 @@ void TransmitterSwitch::setQSSPath(const QString &qssPath)
         return;
     }
     /* 去掉最后的“/” */
-    if(qssPath.endsWith("/"))
-    {
-        EPConfig.setQSSPath(qssPath.left(qssPath.length() - 1));
-    } else
-    {
-        EPConfig.setQSSPath(qssPath);
-    }
+    // if(qssPath.endsWith("/"))
+    // {
+    //     EPConfig.setQSSPath(qssPath.left(qssPath.length() - 1));
+    // } else
+    // {
+    //     EPConfig.setQSSPath(qssPath);
+    // }
 }
 
 /**
@@ -116,6 +126,18 @@ void TransmitterSwitch::setWebAPIInfo(const QString &url, const QString &serverI
     m_fromWebAPI->getDeviceInfo(DeviceContainer.getMapDevice());
 }
 
+/* 初始化webAPI,重载版 */
+void TransmitterSwitch::setWebAPIInfo(const InitData& data)
+{
+    if(m_fromWebAPI == nullptr)
+    {
+        m_fromWebAPI = new FromWebAPI;
+    }
+    m_fromWebAPI->initWebApi(data.url, data.serverID, data.serverKey);
+    /* 获取支持的设备 */
+    m_fromWebAPI->getDeviceInfo(DeviceContainer.getMapDevice());
+}
+
 /* 获取EQM数据库计划 */
 void TransmitterSwitch::getExecPlanFromEQM()
 {
@@ -181,6 +203,21 @@ void TransmitterSwitch::saveExecPlanToEQM()
     m_fromWebAPI->insertData(list);
 }
 
+/* 亮/暗换肤,0是亮色,1是暗色 */
+void TransmitterSwitch::setUIStyle(int style)
+{
+    if(style == 0)
+    {
+        EPConfig.setUIStyle(enum_UIStyle::UI_Light);
+    }
+    else if(style == 1)
+    {
+        EPConfig.setUIStyle(enum_UIStyle::UI_Dark);
+    }else {
+        LH_WRITE_ERROR(QString("错误的样式类型: %1").arg(style));
+    }
+}
+
 
 /* 每周几的按钮点击了,设置stackedWidegt页面 */
 void TransmitterSwitch::do_weekpBtn_clicked()
@@ -472,6 +509,20 @@ void TransmitterSwitch::do_deleteTemplate(QString name)
     m_fromWebAPI->deleteTemplate(name);
 }
 
+/* 切换亮色/暗色外观 */
+void TransmitterSwitch::do_setUIStyle()
+{
+    QString qssPath = EPConfig.getQSSPath() + "/transmitterswitch.qss";
+    QFile file(qssPath);
+    if(file.open(QFile::ReadOnly))
+    {
+        QString qss = file.readAll();
+        this->setStyleSheet(qss);
+        file.close();
+    }else {
+        LH_WRITE_ERROR(QString("打开样式表失败: %1").arg(qssPath));
+    }
+}
 
 /* 创建一周8天的item页面 */
 void TransmitterSwitch::createWeekWidget()

+ 7 - 0
TransmitterSwitch/transmitterswitch.h

@@ -8,6 +8,7 @@
 
 class WidgetItems;
 class FromWebAPI;
+struct InitData;
 
 namespace Ui {
 class TransmitterSwitch;
@@ -25,10 +26,13 @@ public:
     void setQSSPath(const QString &qssPath);
     /* 设置WebAPI信息 */
     void setWebAPIInfo(const QString &url, const QString &serverID, const QString &serverKey);
+    void setWebAPIInfo(const InitData& data);
     /* 获取EQM数据库中的计划 */
     void getExecPlanFromEQM();
     /* 将计划保存到EQM数据库 */
     void saveExecPlanToEQM();
+    /* 亮/暗换肤,0是亮色,1是暗色 */
+    void setUIStyle(int style);
 
 private slots:
     /* 每周几的按钮点击了,设置stackedWidegt页面 */
@@ -54,6 +58,9 @@ private slots:
     /* 删除一个模板 */
     void do_deleteTemplate(QString name);
 
+    /* 切换亮色/暗色外观 */
+    void do_setUIStyle();
+
 private:
     /* 创建一周8天的item页面 */
     void createWeekWidget();

+ 67 - 0
demo/LHCoaxialSwitchSetInfo/LHCoaxialSwitchSetInfo.pro

@@ -0,0 +1,67 @@
+QT += widgets
+QT += network
+QT += gui
+QT += core
+#QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO
+#QMAKE_LFLAGS_RELEASE = $$QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO
+QMAKE_CXXFLAGS += -Wall
+QMAKE_CXXFLAGS += -Werror=return-type  #函数无返回值
+QMAKE_CXXFLAGS += -Werror=return-local-addr #返回局部变量地址
+#        QMAKE_CXXFLAGS += -Werror=missing-field-initializers #缺少初始值设定项
+QMAKE_CXXFLAGS += -Werror=maybe-uninitialized #变量可能没有被初始化
+#        QMAKE_CXXFLAGS += -Werror=delete-non-virtual-dtor #
+#        QMAKE_CXXFLAGS += -Werror=unused-but-set-variable #设置了但未使用的变量
+QMAKE_CXXFLAGS += -Werror=parentheses #括号不匹配
+QMAKE_CXXFLAGS += -Werror=pointer-arith #指针用在了算术运算
+#        QMAKE_CXXFLAGS += -Werror=reorder #警告构造函数的顺序不会被使用
+QMAKE_CXXFLAGS += -Werror=format-extra-args #格式不对
+#        QMAKE_CXXFLAGS += -Werror=unused-variable #未使用的变量
+TARGET = LHCoaxialServerSetInfo
+TEMPLATE = lib
+DEFINES += LHCOAXIALSWITCHSETINFO_LIBRARY
+
+CONFIG += c++11
+
+# You can make your code fail to compile if it uses deprecated APIs.
+# In order to do so, uncomment the following line.
+#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
+
+SOURCES += \
+    comboBox/customcombobox.cpp \
+    common/GlobalMsgMgr/globalmsgmgr.cpp \
+    common/LHHTTPAPI/lhhttpapi.cpp \
+    common/LHQLogAPI/LHQLogAPI.cpp \
+    common/PaintHelper/painthelper.cpp \
+    common/Singletonwork/singletonwork.cpp \
+    common/UpdateSkinStyle/lhstylemanager.cpp \
+    configwidget.cpp \
+    devicemanager.cpp \
+    lhcoaxialconfig.cpp \
+    lhcoaxialswitchsetinfo.cpp
+
+HEADERS += \
+    LHCoaxialSwitchSetInfo_global.h \
+    comboBox/customcombobox.h \
+    common/GlobalMsgMgr/globalmsgmgr.h \
+    common/LHHTTPAPI/lhhttpapi.h \
+    common/LHQLogAPI/LHQLogAPI.h \
+    common/PaintHelper/painthelper.h \
+    common/Singletonwork/singletonwork.h \
+    common/UpdateSkinStyle/lhstylemanager.h \
+    configwidget.h \
+    devicemanager.h \
+    lhcoaxialconfig.h \
+    lhcoaxialswitchsetinfo.h
+
+# Default rules for deployment.
+unix {
+    target.path = /usr/lib
+}
+!isEmpty(target.path): INSTALLS += target
+
+FORMS += \
+    configwidget.ui
+
+RESOURCES += \
+    common/GlobalMsgMgr/resglobalmsg.qrc \
+    resource.qrc

+ 422 - 0
demo/LHCoaxialSwitchSetInfo/LHCoaxialSwitchSetInfo.pro.user

@@ -0,0 +1,422 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE QtCreatorProject>
+<!-- Written by QtCreator 5.0.2, 2024-11-27T15:34:24. -->
+<qtcreator>
+ <data>
+  <variable>EnvironmentId</variable>
+  <value type="QByteArray">{99744723-a061-4cde-baed-505706265dc7}</value>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.ActiveTarget</variable>
+  <value type="int">0</value>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.EditorSettings</variable>
+  <valuemap type="QVariantMap">
+   <value type="bool" key="EditorConfiguration.AutoIndent">true</value>
+   <value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
+   <value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
+   <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
+    <value type="QString" key="language">Cpp</value>
+    <valuemap type="QVariantMap" key="value">
+     <value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
+    </valuemap>
+   </valuemap>
+   <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
+    <value type="QString" key="language">QmlJS</value>
+    <valuemap type="QVariantMap" key="value">
+     <value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
+    </valuemap>
+   </valuemap>
+   <value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
+   <value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
+   <value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
+   <value type="int" key="EditorConfiguration.IndentSize">4</value>
+   <value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
+   <value type="int" key="EditorConfiguration.MarginColumn">80</value>
+   <value type="bool" key="EditorConfiguration.MouseHiding">true</value>
+   <value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
+   <value type="int" key="EditorConfiguration.PaddingMode">1</value>
+   <value type="bool" key="EditorConfiguration.PreferSingleLineComments">false</value>
+   <value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
+   <value type="bool" key="EditorConfiguration.ShowMargin">false</value>
+   <value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
+   <value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value>
+   <value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
+   <value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
+   <value type="int" key="EditorConfiguration.TabSize">8</value>
+   <value type="bool" key="EditorConfiguration.UseGlobal">true</value>
+   <value type="bool" key="EditorConfiguration.UseIndenter">false</value>
+   <value type="int" key="EditorConfiguration.Utf8BomBehavior">0</value>
+   <value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
+   <value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
+   <value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
+   <value type="QString" key="EditorConfiguration.ignoreFileTypes">*.md, *.MD, Makefile</value>
+   <value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
+   <value type="bool" key="EditorConfiguration.skipTrailingWhitespace">true</value>
+  </valuemap>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.PluginSettings</variable>
+  <valuemap type="QVariantMap">
+   <valuemap type="QVariantMap" key="AutoTest.ActiveFrameworks">
+    <value type="bool" key="AutoTest.Framework.Boost">true</value>
+    <value type="bool" key="AutoTest.Framework.CTest">false</value>
+    <value type="bool" key="AutoTest.Framework.Catch">true</value>
+    <value type="bool" key="AutoTest.Framework.GTest">true</value>
+    <value type="bool" key="AutoTest.Framework.QtQuickTest">true</value>
+    <value type="bool" key="AutoTest.Framework.QtTest">true</value>
+   </valuemap>
+   <valuemap type="QVariantMap" key="AutoTest.CheckStates"/>
+   <value type="int" key="AutoTest.RunAfterBuild">0</value>
+   <value type="bool" key="AutoTest.UseGlobal">true</value>
+   <valuelist type="QVariantList" key="ClangCodeModel.CustomCommandLineKey">
+    <value type="QString">-fno-delayed-template-parsing</value>
+   </valuelist>
+   <value type="bool" key="ClangCodeModel.UseGlobalConfig">true</value>
+   <value type="QString" key="ClangCodeModel.WarningConfigId">Builtin.BuildSystem</value>
+   <valuemap type="QVariantMap" key="ClangTools">
+    <value type="bool" key="ClangTools.AnalyzeOpenFiles">true</value>
+    <value type="bool" key="ClangTools.BuildBeforeAnalysis">true</value>
+    <value type="QString" key="ClangTools.DiagnosticConfig">Builtin.DefaultTidyAndClazy</value>
+    <value type="int" key="ClangTools.ParallelJobs">8</value>
+    <valuelist type="QVariantList" key="ClangTools.SelectedDirs"/>
+    <valuelist type="QVariantList" key="ClangTools.SelectedFiles"/>
+    <valuelist type="QVariantList" key="ClangTools.SuppressedDiagnostics"/>
+    <value type="bool" key="ClangTools.UseGlobalSettings">true</value>
+   </valuemap>
+  </valuemap>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.Target.0</variable>
+  <valuemap type="QVariantMap">
+   <value type="QString" key="DeviceType">Desktop</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.12.12 MinGW 32-bit</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.12.12 MinGW 32-bit</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt5.51212.win32_mingw73_kit</value>
+   <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
+   <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
+   <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
+    <value type="int" key="EnableQmlDebugging">0</value>
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:/MyWork/Products/EQM6.0/TongZhouServer/build-TestConfigWidget-Desktop_Qt_5_12_12_MinGW_32_bit-Debug</value>
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">D:/MyWork/Products/EQM6.0/TongZhouServer/build-TestConfigWidget-Desktop_Qt_5_12_12_MinGW_32_bit-Debug</value>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
+      <valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
+     </valuemap>
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
+    </valuemap>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
+    </valuemap>
+    <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
+    <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
+    <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
+    <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Debug</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
+    <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
+   </valuemap>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:\MyWork\Products\EQM6.0\TongZhouServer\build-LHCoaxialSwitchSetInfo-Desktop_Qt_5_12_12_MinGW_32_bit-Release</value>
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">D:/MyWork/Products/EQM6.0/TongZhouServer/build-LHCoaxialSwitchSetInfo-Desktop_Qt_5_12_12_MinGW_32_bit-Release</value>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
+      <valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
+     </valuemap>
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
+    </valuemap>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
+    </valuemap>
+    <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
+    <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
+    <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
+    <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Release</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
+    <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
+    <value type="int" key="QtQuickCompiler">0</value>
+   </valuemap>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
+    <value type="int" key="EnableQmlDebugging">0</value>
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:\MyWork\Products\EQM6.0\TongZhouServer\build-LHCoaxialSwitchSetInfo-Desktop_Qt_5_12_12_MinGW_32_bit-Profile</value>
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">D:/MyWork/Products/EQM6.0/TongZhouServer/build-LHCoaxialSwitchSetInfo-Desktop_Qt_5_12_12_MinGW_32_bit-Profile</value>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
+      <valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
+     </valuemap>
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
+    </valuemap>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
+    </valuemap>
+    <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
+    <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
+    <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
+    <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Profile</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
+    <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
+    <value type="int" key="QtQuickCompiler">0</value>
+    <value type="int" key="SeparateDebugInfo">0</value>
+   </valuemap>
+   <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">3</value>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Deploy</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
+    </valuemap>
+    <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
+    <valuemap type="QVariantMap" key="ProjectExplorer.DeployConfiguration.CustomData"/>
+    <value type="bool" key="ProjectExplorer.DeployConfiguration.CustomDataEnabled">false</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
+   </valuemap>
+   <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
+    <value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
+    <value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
+    <value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
+    <valuelist type="QVariantList" key="CustomOutputParsers"/>
+    <value type="int" key="PE.EnvironmentAspect.Base">2</value>
+    <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
+    <value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey"></value>
+    <value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
+    <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
+    <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
+    <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
+   </valuemap>
+   <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
+  </valuemap>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.Target.1</variable>
+  <valuemap type="QVariantMap">
+   <value type="QString" key="DeviceType">Desktop</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.12.12 MinGW 64-bit</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.12.12 MinGW 64-bit</value>
+   <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt5.51212.win64_mingw73_kit</value>
+   <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
+   <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
+   <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
+    <value type="int" key="EnableQmlDebugging">0</value>
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:\MyWork\Products\EQM6.0\TongZhouServer\build-LHCoaxialSwitchSetInfo-Desktop_Qt_5_12_12_MinGW_64_bit-Debug</value>
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">D:/MyWork/Products/EQM6.0/TongZhouServer/build-LHCoaxialSwitchSetInfo-Desktop_Qt_5_12_12_MinGW_64_bit-Debug</value>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
+      <valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
+     </valuemap>
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
+    </valuemap>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
+    </valuemap>
+    <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
+    <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
+    <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
+    <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Debug</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
+    <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
+   </valuemap>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:\MyWork\Products\EQM6.0\TongZhouServer\build-LHCoaxialSwitchSetInfo-Desktop_Qt_5_12_12_MinGW_64_bit-Release</value>
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">D:/MyWork/Products/EQM6.0/TongZhouServer/build-LHCoaxialSwitchSetInfo-Desktop_Qt_5_12_12_MinGW_64_bit-Release</value>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
+      <valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
+     </valuemap>
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
+    </valuemap>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
+    </valuemap>
+    <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
+    <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
+    <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
+    <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Release</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
+    <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
+    <value type="int" key="QtQuickCompiler">0</value>
+   </valuemap>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
+    <value type="int" key="EnableQmlDebugging">0</value>
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">D:\MyWork\Products\EQM6.0\TongZhouServer\build-LHCoaxialSwitchSetInfo-Desktop_Qt_5_12_12_MinGW_64_bit-Profile</value>
+    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">D:/MyWork/Products/EQM6.0/TongZhouServer/build-LHCoaxialSwitchSetInfo-Desktop_Qt_5_12_12_MinGW_64_bit-Profile</value>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
+      <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
+      <valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
+     </valuemap>
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
+    </valuemap>
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
+     <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+      <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+      <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
+      <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
+     </valuemap>
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
+    </valuemap>
+    <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
+    <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
+    <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
+    <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Profile</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
+    <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
+    <value type="int" key="QtQuickCompiler">0</value>
+    <value type="int" key="SeparateDebugInfo">0</value>
+   </valuemap>
+   <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">3</value>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
+    <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
+     <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Deploy</value>
+     <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
+    </valuemap>
+    <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
+    <valuemap type="QVariantMap" key="ProjectExplorer.DeployConfiguration.CustomData"/>
+    <value type="bool" key="ProjectExplorer.DeployConfiguration.CustomDataEnabled">false</value>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
+   </valuemap>
+   <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
+   <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
+    <value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
+    <value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
+    <value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
+    <valuelist type="QVariantList" key="CustomOutputParsers"/>
+    <value type="int" key="PE.EnvironmentAspect.Base">2</value>
+    <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
+    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
+    <value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey"></value>
+    <value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
+    <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
+    <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
+    <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
+   </valuemap>
+   <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
+  </valuemap>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.TargetCount</variable>
+  <value type="int">2</value>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.Updater.FileVersion</variable>
+  <value type="int">22</value>
+ </data>
+ <data>
+  <variable>Version</variable>
+  <value type="int">22</value>
+ </data>
+</qtcreator>

+ 12 - 0
demo/LHCoaxialSwitchSetInfo/LHCoaxialSwitchSetInfo_global.h

@@ -0,0 +1,12 @@
+#ifndef LHCOAXIALSWITCHSETINFO_GLOBAL_H
+#define LHCOAXIALSWITCHSETINFO_GLOBAL_H
+
+#include <QtCore/qglobal.h>
+
+#if defined(LHCOAXIALSWITCHSETINFO_LIBRARY)
+#  define LHCOAXIALSWITCHSETINFO_EXPORT Q_DECL_EXPORT
+#else
+#  define LHCOAXIALSWITCHSETINFO_EXPORT Q_DECL_IMPORT
+#endif
+
+#endif // LHCOAXIALSWITCHSETINFO_GLOBAL_H

+ 40 - 0
demo/LHCoaxialSwitchSetInfo/comboBox/customcombobox.cpp

@@ -0,0 +1,40 @@
+#include "customcombobox.h"
+#include <QGraphicsDropShadowEffect>
+#include <QAbstractItemView>
+#include <QListView>
+#include <QTimer>
+#include <QDebug>
+#include <QStyleFactory>
+
+CustomComboBox::CustomComboBox(QWidget *parent)
+    : QComboBox(parent)
+    , m_nMargin(0)
+{
+    setStyle(QStyleFactory::create("Windows"));
+
+    setView(new QListView());
+    view()->window()->setWindowFlags(Qt::Popup|Qt::FramelessWindowHint|Qt::NoDropShadowWindowHint);
+    view()->window()->setAttribute(Qt::WA_TranslucentBackground);
+
+    QGraphicsDropShadowEffect *pShadowEffect = new QGraphicsDropShadowEffect(this);
+    pShadowEffect->setBlurRadius(10); // 模糊度
+    pShadowEffect->setColor(QColor(0, 0, 0, 76)); // 阴影的颜色
+    pShadowEffect->setOffset(0, 0); // 水平和垂直偏移量
+    view()->setGraphicsEffect(pShadowEffect);
+
+    QTimer::singleShot(0, this, [=]
+    {
+        view()->setMinimumWidth(width()+m_nMargin*2);
+    });
+}
+CustomComboBox::~CustomComboBox()
+{
+    qDebug()<<__func__;
+}
+
+void CustomComboBox::showPopup()
+{
+    QComboBox::showPopup();
+    QWidget *popup = findChild<QFrame*>();
+    popup->move(mapToGlobal(QPoint(-m_nMargin, height())));
+}

+ 20 - 0
demo/LHCoaxialSwitchSetInfo/comboBox/customcombobox.h

@@ -0,0 +1,20 @@
+#ifndef CUSTOMCOMBOBOX_H
+#define CUSTOMCOMBOBOX_H
+
+#include <QComboBox>
+#include <QMouseEvent>
+
+class CustomComboBox : public QComboBox
+{
+public:
+    explicit CustomComboBox(QWidget *parent = nullptr);
+    ~CustomComboBox();
+
+    //重写下拉框弹出位置
+    void showPopup() override;
+
+private:
+    int m_nMargin;
+};
+
+#endif // CUSTOMCOMBOBOX_H

BIN
demo/LHCoaxialSwitchSetInfo/common/GlobalMsgMgr/error.png


+ 208 - 0
demo/LHCoaxialSwitchSetInfo/common/GlobalMsgMgr/globalmsgmgr.cpp

@@ -0,0 +1,208 @@
+#include "../PaintHelper/painthelper.h"
+#include "globalmsgmgr.h"
+
+#include <QPainter>
+#include <QTimer>
+#include <QDebug>
+GlobalMsgMgr::GlobalMsgMgrGarbo GlobalMsgMgr::garbo;
+GlobalMsgMgr* GlobalMsgMgr::sm_pInstance = new GlobalMsgMgr(nullptr);     //初始化静态单例(饿汉):
+
+const int g_nSpacing = 20;                     //弹出消息的间距
+const int g_nFlyDistance = 60;                 //飞入飞出的距离
+//const QSize g_sizeWeakHint = QSize(380,48);    //弱提示的尺寸(对应窗口的高度还要加上飞入飞出的距离)
+const int g_nWeakHintHeight = 48;              //弱提示的高度(对应窗口的高度还要加上飞入飞出的距离)
+const int g_nSpeed = 3;                        //每update间隔时间里移动的像素
+const int g_nUpdateInterval = 10;              //update间隔时间
+const int g_nPaddingTop = 20;                 //距离上方的高度
+
+const int g_nTextPaddingL = 60;                 //文本左间距
+const int g_nTextPaddingR = 24;                 //文本右间距
+
+GlobalMsgWidget::GlobalMsgWidget(const QString &msg, HintMode mode, QWidget *parent) 
+    : QWidget(parent)
+    , m_mode(mode)
+    , m_strMsg(msg)
+{
+    setAttribute(Qt::WA_TransparentForMouseEvents);
+    setAttribute(Qt::WA_TranslucentBackground);
+    setWindowFlag(Qt::FramelessWindowHint);
+    QFontMetrics fMetrics(FontEx(fontInfo().family(), 14));
+    QSize textSize = fMetrics.size(Qt::TextSingleLine, msg);
+    int width = qBound(380, g_nTextPaddingL + g_nTextPaddingR + textSize.width(), 800);
+    
+    m_strMsg = fMetrics.elidedText(msg, Qt::ElideRight, width - g_nTextPaddingL - g_nTextPaddingR);
+    
+    resize(QSize(width, g_nWeakHintHeight + g_nFlyDistance));
+    
+    m_animFlyInOut.setDuration(g_nFlyDistance/g_nSpeed*g_nUpdateInterval);
+    m_animFlyInOut.setStartValue(0);
+    m_animFlyInOut.setEndValue(g_nFlyDistance);
+    connect(&m_animFlyInOut, &QVariantAnimation::valueChanged, [&](const QVariant &){update();});
+    connect(&m_animFlyInOut, &QVariantAnimation::finished, [&](){
+        if(m_animFlyInOut.direction() == QVariantAnimation::Backward) deleteLater();
+    });
+    
+    m_animFlyInOut.start();
+    m_dtStart = QDateTime::currentDateTime();
+    connect(&m_timerCheckIfStay, &QTimer::timeout, this, &GlobalMsgWidget::CheckIfStay);
+    m_timerCheckIfStay.start(10);
+}
+void GlobalMsgWidget::CheckIfStay()
+{
+    QPoint cursorPos = mapFromGlobal(QCursor::pos());
+    QRect rectContent(0,m_animFlyInOut.currentValue().toInt(),width(),40);
+    if(rectContent.contains(cursorPos))
+    {
+        m_dtStart = QDateTime::currentDateTime();
+        return;
+    }
+    if(m_dtStart.msecsTo(QDateTime::currentDateTime()) >= 3000)
+    {
+        m_animFlyInOut.setDirection(QVariantAnimation::Backward);
+        m_animFlyInOut.start();
+        m_timerCheckIfStay.stop();
+        emit sig_Hide(this);
+    }
+}
+
+QColor GlobalMsgWidget::GetBGColor(HintMode mode, int alpha)
+{
+    if(mode == Success) return QColor(240,249,235,alpha);
+    if(mode == Warn) return QColor(253,246,236,alpha);
+    if(mode == Normal) return QColor(237,242,252,alpha);
+    if(mode == Error) return QColor(254,240,240,alpha);
+    return QColor(30,30,30,alpha);
+}
+
+QColor GlobalMsgWidget::GetTextColor(HintMode mode, int alpha)
+{
+    if(mode == Success) return QColor(103,194,58,alpha);
+    if(mode == Warn) return QColor(230,162,60,alpha);
+    if(mode == Normal) return QColor(144,147,153,alpha);
+    if(mode == Error) return QColor(245,108,108,alpha);
+    return QColor(30,30,30,alpha);
+}
+
+QString GlobalMsgWidget::GetIconPath(HintMode mode)
+{
+    if(mode == Success) return QString(":/GlobalMsg/success.png");
+    if(mode == Warn) return QString(":/GlobalMsg/warn.png");
+    if(mode == Normal) return QString(":/GlobalMsg/normal.png");
+    if(mode == Error) return QString(":/GlobalMsg/error.png");
+    return QString(":/GlobalMsg/normal.png");
+}
+void GlobalMsgWidget::paintEvent(QPaintEvent *)
+{
+    PainterEx painter(this);
+    
+    QRect rectContent(0,m_animFlyInOut.currentValue().toInt(),width(),g_nWeakHintHeight);
+    
+    double startValue = m_animFlyInOut.startValue().toDouble();
+    double endValue = m_animFlyInOut.endValue().toDouble();
+    double curValue = m_animFlyInOut.currentValue().toDouble();
+    
+    int alpha = qRound((curValue - startValue)/(endValue - startValue) * 255);
+    {//底色
+        painter.DrawRoundedRect(rectContent, 4, GetBGColor(m_mode,alpha));
+    }
+    {//图标
+        QRect iconRect(rectContent.topLeft()+QPoint(28,14), QSize(20,20));
+        painter.DrawPixmap(iconRect, GetIconPath(m_mode), alpha);
+    }
+    {//文字
+        QRect textRect(g_nTextPaddingL, rectContent.top(), width() - g_nTextPaddingL - g_nTextPaddingR, g_nWeakHintHeight);
+        painter.setFont(FontEx(painter.fontInfo().family(), 14));
+        painter.DrawText(textRect, m_strMsg, GetTextColor(m_mode,alpha), Qt::AlignLeft|Qt::AlignVCenter);
+    }
+}
+
+
+GlobalMsgMgr::GlobalMsgMgr(QObject *parent)
+    : QObject(parent)
+   , m_pRootWidget(nullptr)
+{
+    connect(&m_timerUpdate, &QTimer::timeout, this, &GlobalMsgMgr::OnUpdate);
+}
+
+void GlobalMsgMgr::SetRootWidget(QWidget *rootWidget)
+{
+    m_pRootWidget = rootWidget;
+}
+
+void GlobalMsgMgr::Popup(const QString &msg, GlobalMsgWidget::HintMode mode)
+{
+    //动画思路:单个消息窗, 飞入飞出+淡入淡出; 多个消息窗, 单个本身动画不变, 多个组成队列
+    //某个消息窗开始飞出时, 它后面的所有消息窗同时上移
+    //新消息窗飞入时, 从头部位置飞入; 头部位置随着[新消息飞入]和[所有窗口同时上移]而改变, [新消息飞入]则加一个单位, [所有窗口同时上移]则减一个单位
+    //单个消息窗的[飞入飞出+淡入淡出]用paintevent实现; [所有窗口同时上移]在OnUpdate实现
+    
+    if(m_pRootWidget == nullptr) return;
+    GlobalMsgWidget *weakWidget = new GlobalMsgWidget(msg, mode);
+    connect(weakWidget, &GlobalMsgWidget::sig_Hide, this, &GlobalMsgMgr::OnWeakHintHide);
+    weakWidget->setWindowFlag(Qt::ToolTip);
+    weakWidget->setParent(m_pRootWidget);
+    int x = (m_pRootWidget->width()-weakWidget->width())/2;
+    int offset = m_listWeakHints.count()*(g_nSpacing + g_nWeakHintHeight);
+    weakWidget->move(x, offset - g_nFlyDistance + g_nPaddingTop);
+    weakWidget->show();
+    m_listWeakHints.append(weakWidget);
+    if(!m_timerUpdate.isActive()) m_timerUpdate.start(g_nUpdateInterval);
+}
+
+void GlobalMsgMgr::Popup(const QString &msg, QWidget *parentWidget, GlobalMsgWidget::HintMode mode)
+{
+    //动画思路:单个消息窗, 飞入飞出+淡入淡出; 多个消息窗, 单个本身动画不变, 多个组成队列
+    //某个消息窗开始飞出时, 它后面的所有消息窗同时上移
+    //新消息窗飞入时, 从头部位置飞入; 头部位置随着[新消息飞入]和[所有窗口同时上移]而改变, [新消息飞入]则加一个单位, [所有窗口同时上移]则减一个单位
+    //单个消息窗的[飞入飞出+淡入淡出]用paintevent实现; [所有窗口同时上移]在OnUpdate实现
+
+    if(parentWidget == nullptr) return;
+    GlobalMsgWidget *weakWidget = new GlobalMsgWidget(msg, mode);
+    connect(weakWidget, &GlobalMsgWidget::sig_Hide, this, &GlobalMsgMgr::OnWeakHintHide);
+    weakWidget->setWindowFlag(Qt::ToolTip);
+	weakWidget->setParent(parentWidget);
+    int x = (parentWidget->width()-weakWidget->width())/2;
+    int offset = m_listWeakHints.count()*(g_nSpacing + g_nWeakHintHeight);
+    weakWidget->move(x, offset - g_nFlyDistance + g_nPaddingTop);
+    weakWidget->show();
+    m_listWeakHints.append(weakWidget);
+    if(!m_timerUpdate.isActive()) m_timerUpdate.start(g_nUpdateInterval);
+}
+
+void GlobalMsgMgr::Clear(QWidget *parentWidget)
+{
+    for(auto weakHint=m_listWeakHints.begin();weakHint!=m_listWeakHints.end();){
+        if((*weakHint)->parent() == parentWidget)
+            weakHint = m_listWeakHints.erase(weakHint);
+        else
+            ++weakHint;
+    }
+}
+
+void GlobalMsgMgr::OnUpdate()
+{
+    for(GlobalMsgWidget* weakHint: m_listWeakHints)
+    {
+        int offset = m_listWeakHints.indexOf(weakHint)*(g_nSpacing + g_nWeakHintHeight);
+        int targetPosY = offset - g_nFlyDistance + g_nPaddingTop;
+        QPoint curPos = weakHint->pos();
+        if(curPos.y() == targetPosY) continue;
+        if(targetPosY > curPos.y())
+        {
+            int newPosY = qMin(curPos.y()+g_nSpeed, targetPosY);
+            QPoint newPos = QPoint(curPos.x(), newPosY);
+            weakHint->move(newPos);
+        }
+        if(targetPosY < curPos.y())
+        {
+            int newPosY = qMax(curPos.y()-g_nSpeed, targetPosY);
+            QPoint newPos = QPoint(curPos.x(), newPosY);
+            weakHint->move(newPos);
+        }
+    }
+}
+
+void GlobalMsgMgr::OnWeakHintHide(GlobalMsgWidget* pWeakHint)
+{
+    if(m_listWeakHints.contains(pWeakHint)) m_listWeakHints.removeOne(pWeakHint);
+}

+ 94 - 0
demo/LHCoaxialSwitchSetInfo/common/GlobalMsgMgr/globalmsgmgr.h

@@ -0,0 +1,94 @@
+#ifndef WEAKHINTUTILITY_H
+#define WEAKHINTUTILITY_H
+
+#include <QDateTime>
+#include <QObject>
+#include <QTimer>
+#include <QVariantAnimation>
+#include <QPropertyAnimation>
+#include <QWidget>
+
+class GlobalMsgWidget : public QWidget
+{
+    Q_OBJECT
+public:
+    enum HintMode
+    {
+        Success = 0,
+        Warn = 1,
+        Normal = 2,
+        Error = 3,
+    };
+public:
+    explicit GlobalMsgWidget(const QString &msg, HintMode mode, QWidget *parent = nullptr);
+    ~GlobalMsgWidget() override{}
+private:
+    HintMode m_mode;
+    QString m_strMsg;
+//    int m_nYPos;
+    QDateTime m_dtStart;                    //弱提示出现的时间(鼠标移入将不断刷新该时间为当前时间)
+    QVariantAnimation m_animFlyInOut;       //飞入飞出动画
+    QPropertyAnimation m_animPos;           //控制位置的动画
+    QTimer m_timerCheckIfStay;
+private:
+    QColor GetBGColor(HintMode mode, int alpha = 255);
+    QColor GetTextColor(HintMode mode, int alpha = 255);
+    QString GetIconPath(HintMode mode);
+protected:
+    virtual void paintEvent(QPaintEvent *) override;
+private slots:
+    void CheckIfStay();
+signals:
+    void sig_Hide(GlobalMsgWidget *pWeakHint);
+};
+
+class GlobalMsgMgr : public QObject
+{
+    Q_OBJECT
+public:
+    static GlobalMsgMgr* Instance(){return sm_pInstance;}
+    ~GlobalMsgMgr(){sm_pInstance = nullptr;}
+    void SetRootWidget(QWidget *rootWidget);
+    QWidget* GetRootWidget(){return m_pRootWidget;}
+    void Popup(const QString &msg, GlobalMsgWidget::HintMode mode = GlobalMsgWidget::Normal);
+
+    //begin:指定弹出窗口为父窗口,父窗口释放前需要Clear
+    void Popup(const QString &msg, QWidget *parentWidget, GlobalMsgWidget::HintMode mode = GlobalMsgWidget::Normal);
+    void Clear(QWidget *parentWidget);
+    //end
+private:
+    GlobalMsgMgr(QObject *parent = nullptr);
+    //防拷贝, C++11
+    GlobalMsgMgr(GlobalMsgMgr const&) = delete;
+	GlobalMsgMgr& operator=(GlobalMsgMgr const&) = delete;
+    
+private:
+    static GlobalMsgMgr* sm_pInstance;     //单例实例
+    static const int skm_nMaxCount = 8;
+    QWidget *m_pRootWidget;
+    QList<GlobalMsgWidget*> m_listWeakHints;
+    QTimer m_timerUpdate;
+private slots:
+    void OnWeakHintHide(GlobalMsgWidget *pWeakHint);
+    void OnUpdate();
+private:
+    /*----------------------------------------------------------------
+     * 关于释放全局单例: 
+     * 一个妥善的方法是让这个类自己知道在合适的时候把自己删除; 或者说把删除自己的操作挂在系统中的某个合适的点上, 使其在恰当的时候自动被执行;
+     * 程序在结束的时候, 系统会自动析构所有的全局变量;事实上, 系统也会析构所有的类的静态成员变量, 就像这些静态成员也是全局变量一样;
+     * 利用这个特征, 我们可以在单例类中定义一个这样的静态成员变量, 而它的唯一工作就是在析构函数中删除单例类的实例;
+    ----------------------------------------------------------------*/
+    class GlobalMsgMgrGarbo
+    {
+    public:
+        ~GlobalMsgMgrGarbo()
+        {  
+            if(GlobalMsgMgr::sm_pInstance != nullptr)
+                delete GlobalMsgMgr::sm_pInstance;
+        }
+    };
+    static GlobalMsgMgrGarbo garbo;
+    /*----------------------------------------------------------------*/
+};
+
+#endif // WEAKHINTUTILITY_H

BIN
demo/LHCoaxialSwitchSetInfo/common/GlobalMsgMgr/normal.png


+ 8 - 0
demo/LHCoaxialSwitchSetInfo/common/GlobalMsgMgr/resglobalmsg.qrc

@@ -0,0 +1,8 @@
+<RCC>
+    <qresource prefix="/GlobalMsg">
+        <file>error.png</file>
+        <file>normal.png</file>
+        <file>success.png</file>
+        <file>warn.png</file>
+    </qresource>
+</RCC>

BIN
demo/LHCoaxialSwitchSetInfo/common/GlobalMsgMgr/success.png


BIN
demo/LHCoaxialSwitchSetInfo/common/GlobalMsgMgr/warn.png


+ 201 - 0
demo/LHCoaxialSwitchSetInfo/common/LHHTTPAPI/lhhttpapi.cpp

@@ -0,0 +1,201 @@
+#include "lhhttpapi.h"
+
+lhhttpapi::lhhttpapi(QObject *parent)
+    : QObject(parent)
+    , m_pQLib(nullptr)
+    , fnDBInit(nullptr)
+    , fnDBLogin(nullptr)
+    , fnDBGettServerList(nullptr)
+    , fnDBGetChannelList(nullptr)
+    , fnDBDoInterface(nullptr)
+    , fnDoGetHttpFileSize(nullptr)
+    , fnDoGetHttpFileContent(nullptr)
+    , fnDoUploadFtpFile(nullptr)
+    , fnDoUploadFtpFileContent(nullptr)
+    , fnDoCurlDeleteFtpFile(nullptr)
+    , fnDoCurlUploadFtpFile(nullptr)
+    , fnDoCurlUploadFtpFileContent(nullptr)
+    , fnGetLastError(nullptr)
+
+{
+
+}
+
+lhhttpapi::~lhhttpapi()
+{
+    UnLoad();
+}
+
+bool lhhttpapi::UnLoad()
+{
+    if(m_pQLib == nullptr)
+    {
+        return false;
+    }
+    bool bRet = m_pQLib->unload();
+    delete m_pQLib;
+    m_pQLib = nullptr;
+    return bRet;
+}
+
+bool lhhttpapi::Load(QString file)
+{
+    m_pQLib = new QLibrary(file);
+    if (!m_pQLib->load())
+    {
+        qDebug() << QString("模块%1加载失败-1").arg(file);
+        return false;
+    }
+    fnDBInit = reinterpret_cast<FunDBInit>(m_pQLib->resolve("DBInit"));
+    fnDBLogin = reinterpret_cast<FunDBLogin>(m_pQLib->resolve("DBLogin"));
+    fnDBGettServerList = reinterpret_cast<FunDBGetServerList>(m_pQLib->resolve("DBGetServerList"));
+    fnDBGetChannelList = reinterpret_cast<FunDBGetChannelList>(m_pQLib->resolve("DBGetChannelList"));
+    fnDBDoInterface = reinterpret_cast<FunDBDoInterface>(m_pQLib->resolve("DBDoInterface"));
+    fnDoGetHttpFileSize = reinterpret_cast<FunDoGetHttpFileSize>(m_pQLib->resolve("DoGetHttpFileSize"));
+    fnDoGetHttpFileContent = reinterpret_cast<FunDoGetHttpFileContent>(m_pQLib->resolve("DoGetHttpFileContent"));
+    fnDoUploadFtpFile = reinterpret_cast<FunDoUploadFtpFile>(m_pQLib->resolve("DoUploadFtpFile"));
+    fnDoUploadFtpFileContent = reinterpret_cast<FunDoUploadFtpFileContent>(m_pQLib->resolve("DoUploadFtpFileContent"));
+    fnDoCurlDeleteFtpFile = reinterpret_cast<FunDoCurlDeleteFtpFile>(m_pQLib->resolve("DoCurlDeleteFtpFile"));
+    fnDoCurlUploadFtpFile = reinterpret_cast<FunDoCurlUploadFtpFile>(m_pQLib->resolve("DoCurlUploadFtpFile"));
+    fnDoCurlUploadFtpFileContent = reinterpret_cast<FunDoCurlUploadFtpFileContent>(m_pQLib->resolve("DoCurlUploadFtpFileContent"));
+    fnGetLastError = reinterpret_cast<FunDoGetLastError>(m_pQLib->resolve("DBGetLastError"));
+
+    if(fnDBInit == nullptr||fnDBLogin == nullptr||fnDBGetChannelList == nullptr||
+            fnDBDoInterface == nullptr|| fnDBGettServerList == nullptr || fnGetLastError == nullptr
+            || fnDoGetHttpFileSize == nullptr || fnDoGetHttpFileContent == nullptr 
+            || fnDoUploadFtpFile == nullptr || fnDoUploadFtpFileContent == nullptr
+            || fnDoCurlDeleteFtpFile == nullptr || fnDoCurlUploadFtpFile == nullptr || fnDoCurlUploadFtpFileContent == nullptr )
+    {
+        return false;
+    }
+    return true;
+}
+
+
+int lhhttpapi::DBInit(const char* lpUrl)
+{
+    if(fnDBInit == nullptr) return -1;
+    return fnDBInit(lpUrl);
+}
+
+int lhhttpapi::DoGetToken(QString &szToken)
+{
+    return DBLogin(m_Localip,m_Serid,m_appType,szToken);
+}
+
+int lhhttpapi::DBLogin(const QString& pLocalip,const QString &pSerid, const QString &appType,  QString &pszUserToken)
+{
+    if(fnDBLogin == nullptr) return -1;
+    //char buffer[LHHTTPAPI_BUFFER_SIZE] = {0};
+    char *buffer = (char*)malloc(LHHTTPAPI_BUFFER_SIZE);
+    memset(buffer, 0, LHHTTPAPI_BUFFER_SIZE);
+    int ret =  fnDBLogin(pLocalip.toUtf8().data(),pSerid.toUtf8().data(),appType.toUtf8().data(), buffer, LHHTTPAPI_BUFFER_SIZE);
+    pszUserToken = QString::fromUtf8(buffer);
+    free(buffer);
+    buffer = nullptr;
+
+    m_Localip = pLocalip;
+    m_Serid = pSerid;
+    m_appType = appType;
+
+    return ret;
+}
+
+int lhhttpapi::DBGetServerList(char *pszList, int nSize)
+{
+    if(fnDBGettServerList == nullptr) return -1;
+    return fnDBGettServerList(pszList, nSize);
+}
+
+int lhhttpapi::DBGetChannelList(const char* pSerid,char *pszList, int nSize)
+{
+    if(fnDBGetChannelList == nullptr) return -1;
+    return fnDBGetChannelList(pSerid,pszList, nSize);
+}
+
+int lhhttpapi::DBDoInterface(const QString &strToken, int nOperatorType, const QString &strParamXml, QString &strRetXml)
+{
+    if(fnDBDoInterface == nullptr) return -1;
+    QString serid = m_Serid;
+    //QString appType = APPTYPE;//singletonWork::skm_type;
+    QString appType = WEBAPPTYPE;//singletonWork::skm_type;
+    char *buffer = (char*)malloc(LHHTTPAPI_BUFFER_SIZE);
+    memset(buffer, 0, LHHTTPAPI_BUFFER_SIZE);
+    int ret = fnDBDoInterface(serid.toUtf8().data(), appType.toUtf8().data(), strToken.toUtf8().data(), nOperatorType, strParamXml.toUtf8().data(), buffer, LHHTTPAPI_BUFFER_SIZE);
+    strRetXml = QString::fromUtf8(buffer);
+    free(buffer);
+    buffer = nullptr;
+    return ret;
+}
+
+
+int64_t lhhttpapi::DoGetHttpFileContent(const QString &url, char *pszContent, int nSize)
+{
+    if(fnDoGetHttpFileContent == nullptr) return 0;
+    return fnDoGetHttpFileContent(url.toUtf8().data(), pszContent, nSize);
+}
+
+bool lhhttpapi::DoUploadFtpFile(const QString &localFilePath, const QString &ftpFilePath)
+{
+    if(fnDoUploadFtpFile == nullptr) return -1;
+    return (fnDoUploadFtpFile(localFilePath.toUtf8(), ftpFilePath.toUtf8()) == 0);
+}
+
+bool lhhttpapi::DoUploadFtpFileContent(const char * szFileContent, int nSize, const QString &ftpFilePath)
+{
+    if(fnDoUploadFtpFileContent == nullptr) return -1;
+    return (fnDoUploadFtpFileContent(szFileContent, nSize, ftpFilePath.toUtf8()) == 0);
+}
+bool lhhttpapi::DoCurlDeleteFtpFile(const QString &targetFilePath)
+{
+    return DoCurlDeleteFtpFile("","",targetFilePath);
+}
+bool lhhttpapi::DoCurlDeleteFtpFile(const QString &user, const QString &pwd, const QString &targetFilePath)
+{
+    if(fnDoCurlDeleteFtpFile == nullptr) return -1;
+    return (fnDoCurlDeleteFtpFile(user.toUtf8(), pwd.toUtf8(), targetFilePath.toUtf8()) == 0);
+}
+bool lhhttpapi::DoCurlUploadFtpFile(const QString &localFilePath, const QString &destFilePath)
+{
+    return DoCurlUploadFtpFile("", "", localFilePath, destFilePath);
+}
+bool lhhttpapi::DoCurlUploadFtpFile(const QString &user, const QString &pwd, const QString &localFilePath, const QString &destFilePath)
+{
+    if(fnDoCurlUploadFtpFile == nullptr) return -1;
+    return (fnDoCurlUploadFtpFile(user.toUtf8(), pwd.toUtf8(), localFilePath.toUtf8(), destFilePath.toUtf8()) == 0);
+}
+
+bool lhhttpapi::DoCurlUploadFtpFileContent(const char *szFileContent, int nSize, const QString &destFilePath)
+{
+    return DoCurlUploadFtpFileContent("", "", szFileContent, nSize, destFilePath);
+}
+
+bool lhhttpapi::DoCurlUploadFtpFileContent(const QString &user, const QString &pwd, const char *szFileContent, int nSize, const QString &destFilePath)
+{
+    if(fnDoCurlUploadFtpFileContent == nullptr) return -1;
+    return (fnDoCurlUploadFtpFileContent(user.toUtf8(), pwd.toUtf8(), szFileContent, nSize, destFilePath.toUtf8()) == 0);
+}
+
+int64_t lhhttpapi::DoGetHttpFileSize(const QString &url)
+{
+    if(fnDoGetHttpFileSize == nullptr) return 0;
+    return fnDoGetHttpFileSize(url.toUtf8().data());
+}
+
+int lhhttpapi::DoGetLastError(char *pError, int nLen, int *nErrorCode)
+{
+    if(fnGetLastError == nullptr) return -1;
+    return fnGetLastError(pError, nLen, nErrorCode);
+}
+
+QString lhhttpapi::DoGetLastError(int *nErrorCode)
+{
+    if(fnGetLastError == nullptr) return QString();
+    int nLen = 1024;
+    char pError[1024] = {0};
+    if(fnGetLastError(pError, nLen, nErrorCode) != 0) return QString();
+    return QString::fromLocal8Bit(pError).toLocal8Bit();
+}
+
+
+

+ 85 - 0
demo/LHCoaxialSwitchSetInfo/common/LHHTTPAPI/lhhttpapi.h

@@ -0,0 +1,85 @@
+#pragma once
+#include <QString>
+#include <QLibrary>
+#include <QDateTime>
+#include <QObject>
+#include <QtDebug>
+
+//webApi链接数据库的类型根据web接口改变
+#define WEBAPPTYPE         "TZCJ"
+//webApi接口返回成功标记
+#define RERUNSUCCESS        0
+
+//不要超过4M, 4M是栈空间极限
+const int LHHTTPAPI_BUFFER_SIZE = 100*1024*1024;
+
+class lhhttpapi : public QObject
+{
+    Q_OBJECT
+public:
+    typedef int (*FunDBInit)(const char* lpUrl);
+    typedef int (*FunDBLogin)(const char *plocalip,const char *pSerid, const char* CType, char *pszUserToken, int nSize);
+    typedef int (*FunDBGetServerList)(char *pszList, int nSize);
+    typedef int (*FunDBGetChannelList)(const char* pSerid,char *pszList, int nSize);
+    typedef int (*FunDBDoInterface)(const char* pSerid,const char* CType,const char* strtoken,int nOperatorType, const char * strParamXml, char *strRetXml, int nSize);
+    typedef int64_t (*FunDoGetHttpFileSize)(const char* pHttAddr);
+    typedef int64_t (*FunDoGetHttpFileContent)(const char* lpHttpAddr, char *pszContent, int nSize);
+    typedef int (*FunDoUploadFtpFile)(const char* pszLocalFilePath, const char* pszFtpFilePath);
+    typedef int (*FunDoUploadFtpFileContent)(const char * szFileContent, int nSize, const char* strFtpFilePath);
+
+    typedef int (*FunDoCurlDeleteFtpFile)(const char* user, const char* pwd, const char* pszFtpFile);
+    typedef int (*FunDoCurlUploadFtpFile)(const char* user, const char* pwd, const char* pszLocalFilePath, const char* pszFtpFile);    
+    typedef int (*FunDoCurlUploadFtpFileContent)(const char* user, const char* pwd, const char* pszFileContent, int nSize, const char* pszFtpFile);
+    
+//    typedef int (*FunUnInit)();
+    typedef int (*FunDoGetLastError)(char *pError, int nLen, int *nErrorCode);
+public:
+    explicit lhhttpapi(QObject *parent = nullptr);
+    ~lhhttpapi();
+public:
+    QLibrary *m_pQLib;
+
+    FunDBInit fnDBInit;
+    FunDBLogin fnDBLogin;
+    FunDBGetServerList fnDBGettServerList;
+    FunDBGetChannelList fnDBGetChannelList;
+    FunDBDoInterface fnDBDoInterface;
+    FunDoGetHttpFileSize fnDoGetHttpFileSize;
+    FunDoGetHttpFileContent fnDoGetHttpFileContent;
+    FunDoUploadFtpFile fnDoUploadFtpFile;
+    FunDoUploadFtpFileContent fnDoUploadFtpFileContent;
+    FunDoCurlDeleteFtpFile fnDoCurlDeleteFtpFile;
+    FunDoCurlUploadFtpFile fnDoCurlUploadFtpFile;
+    FunDoCurlUploadFtpFileContent fnDoCurlUploadFtpFileContent;
+//    FunUnInit fnUnInit;
+    FunDoGetLastError fnGetLastError;
+    
+public:
+    bool Load(QString file);
+    bool UnLoad();
+    int DBLogin(const QString& pLocalip,const QString &pSerid,const QString &appType, QString &pszUserToken);
+    int DoGetToken(QString &szToken);
+
+    int DBGetServerList(char *pszList, int nSize);
+    int DBGetChannelList(const char* pSerid,char *pszList, int nSize);
+    int DBDoInterface(const QString &strToken, int nOperatorType, const QString &strParamXml, QString &strRetXml);
+    int DBInit (const char *lpUrl);
+    int DoGetLastError(char *pError, int nLen, int *nErrorCode);
+    QString DoGetLastError(int *nErrorCode);
+    int64_t DoGetHttpFileSize(const QString &url);
+    int64_t DoGetHttpFileContent(const QString &url, char *pszContent, int nSize);
+   // int64_t DoGetHttpPNGFile(const QString &url, QPixmap &outPixmap);
+    bool DoUploadFtpFile(const QString &localFilePath, const QString &ftpFilePath);
+    bool DoUploadFtpFileContent(const char * szFileContent, int nSize, const QString &ftpFilePath);
+    bool DoCurlDeleteFtpFile(const QString &targetFilePath);
+    bool DoCurlDeleteFtpFile(const QString &user, const QString &pwd, const QString &targetFilePath);
+    bool DoCurlUploadFtpFile(const QString &localFilePath, const QString &destFilePath);
+    bool DoCurlUploadFtpFile(const QString &user, const QString &pwd, const QString &localFilePath, const QString &destFilePath);
+    bool DoCurlUploadFtpFileContent(const char * szFileContent, int nSize, const QString &destFilePath);
+    bool DoCurlUploadFtpFileContent(const QString &user, const QString &pwd, const char * szFileContent, int nSize, const QString &destFilePath);
+
+private:
+    QString m_Localip;  // localip
+    QString m_Serid;    // 当前服务数据库id
+    QString m_appType;  // 设备类型
+};

+ 64 - 0
demo/LHCoaxialSwitchSetInfo/common/LHQLogAPI/LHQLogAPI.cpp

@@ -0,0 +1,64 @@
+#include "LHQLogAPI.h"
+
+CLHQLogApi::CLHQLogApi()
+{
+    fnDoInitial         = nullptr;
+    fnDoWriteLog        = nullptr;
+    fnDoWriteFileLog    = nullptr;
+}
+
+CLHQLogApi::~CLHQLogApi()
+{
+    m_QLib.unload();
+}
+
+int CLHQLogApi::Load(QString file)
+{
+    m_QLib.setFileName(file);
+    if (!m_QLib.load())
+    {
+		return false;
+    }
+
+    fnDoInitial = reinterpret_cast<FunDoInitial>(m_QLib.resolve("Initial"));
+    fnDoWriteLog = reinterpret_cast<FunDoWriteLog>(m_QLib.resolve("WriteLog"));
+    fnDoWriteFileLog = reinterpret_cast<FunDoWriteFileLog>(m_QLib.resolve("WriteFileLog"));
+    fnGetDebug = reinterpret_cast<FunGetDebug>(m_QLib.resolve("GetDebug"));
+
+    if(fnDoInitial == nullptr || fnDoWriteLog == nullptr || fnDoWriteFileLog == nullptr)
+    {
+        return false;
+    }
+    return true;
+}
+
+int CLHQLogApi::DoInitial(QString strLogName)
+{
+    m_strLogName = strLogName;
+    if(fnDoInitial == nullptr) return -1;
+    return fnDoInitial(strLogName.toUtf8());
+}
+
+int CLHQLogApi::DoWriteLogEx(QString strLogName, int nLogType, QString strLog)
+{
+    if(fnDoWriteLog == nullptr) return -1;
+    return fnDoWriteLog(strLogName.toUtf8(), nLogType, strLog.toUtf8());
+}
+
+int CLHQLogApi::DoWriteLog(int nLogType, QString strLog)
+{
+    if(fnDoWriteLog == nullptr) return -1;
+    return fnDoWriteLog(m_strLogName.toUtf8(), nLogType, strLog.toUtf8());
+}
+
+bool CLHQLogApi::IsInDebugMode()
+{
+    if(fnGetDebug == nullptr) return false;
+    return (fnGetDebug() == 1);
+}
+
+int CLHQLogApi::DoWriteFileLog(QString strLogFilePath, QString strLog)
+{
+    if(fnDoWriteFileLog == nullptr) return -1;
+    return fnDoWriteFileLog(strLogFilePath.toUtf8(), strLog.toUtf8());
+}

+ 63 - 0
demo/LHCoaxialSwitchSetInfo/common/LHQLogAPI/LHQLogAPI.h

@@ -0,0 +1,63 @@
+#pragma once
+
+#include <QString>
+#include <QLibrary>
+
+enum enLogType
+{
+    ELT_Log_ALL = 0,
+
+    // Debug.ini[system]Debug=1生效
+    ELT_Log_Debug,
+
+    // 错误日志,不自动删除和清空
+    ELT_Log_Error,
+
+    // 文件日志,就一个文件,超过10M自动清空,如记录xml,json的信息
+    ELT_Log_File,
+
+    // 一定会输出的日志
+    // 操作日志,如点击按钮,按快捷键
+    ELT_Log_Operator,
+    // 仅仅主程序记录,按键日志
+    ELT_Log_KeyDown,
+    // 通用日志,无特殊标记
+    ELT_Log_Common,
+};
+
+class CLHQLogApi
+{
+public:
+    CLHQLogApi();
+    ~CLHQLogApi();
+private:
+    typedef int (*FunDoInitial)(const char* szLogName);
+    typedef int (*FunDoWriteLog)(const char* szLogName, int nLogType, const char* szLog);
+    typedef int (*FunDoWriteFileLog)(const char* szFilePath, const char* szLog);
+    
+    //获取是否开启了Debug模式:  0未开启, 1已开启
+    typedef int (*FunGetDebug)();
+
+private:
+    QLibrary m_QLib;
+
+    FunDoInitial        fnDoInitial;
+    FunDoWriteLog       fnDoWriteLog;
+    FunDoWriteFileLog   fnDoWriteFileLog;
+    FunGetDebug fnGetDebug;
+
+public:
+    int Load(QString file);
+
+public:
+    int DoInitial(QString strLogName);
+
+    // 为了适应,一个进程多模块日志的功能,需要给出Log名称
+    int DoWriteLogEx(QString strLogName, int nLogType, QString strLog);
+    int DoWriteFileLog(QString strLogFilePath, QString strLog);
+
+public:
+    QString m_strLogName;
+    int DoWriteLog(int nLogType, QString strLog);
+    bool IsInDebugMode();
+};

+ 186 - 0
demo/LHCoaxialSwitchSetInfo/common/PaintHelper/painthelper.cpp

@@ -0,0 +1,186 @@
+#include "painthelper.h"
+
+FontEx::FontEx(const QString &family, int pixelSize, bool bold) : QFont(family)
+{
+    setPixelSize(pixelSize);
+    setBold(bold);
+}
+
+FontEx::FontEx(FontEx::NotoSansType type, int pixelSize)
+{
+    QString family = "黑体";
+    if(type == NotoSansType::Normal) family = "思源黑体 CN Normal";
+    if(type == NotoSansType::Medium) family = "思源黑体 CN Medium";
+    if(type == NotoSansType::Regular) family = "思源黑体 CN Regular";
+    if(type == NotoSansType::Bold) family = "思源黑体 CN Bold";
+    if(type == NotoSansType::Light) family = "思源黑体 CN Light";
+    setFamily(family);
+    setPixelSize(pixelSize);
+}
+
+PainterEx::PainterEx(QPaintDevice *device): QPainter(device)
+{
+    
+}
+
+
+void PainterEx::SetBrushOnly(const QColor &color)
+{
+    setPen(Qt::transparent);
+    setBrush(color);
+}
+
+void PainterEx::SetPenOnly(const QColor &color, qreal width, Qt::PenStyle style)
+{
+    setPen(QPen(color, width, style));
+    setBrush(Qt::transparent);
+}
+//------------------------------------------------------------------------
+//函    数:DrawCircle(QPointF center, double radius, const QColor &color = QColor())
+//
+//说    明:画圆的函数
+//
+//参    数:
+//[传入]center 中心点
+//[传入]radius 半径
+//
+//返 回 值:
+//------------------------------------------------------------------------
+void PainterEx::DrawCircle(QPointF center, double radius, const QColor &brush, const QPen &pen)
+{
+    save();
+    setRenderHint(QPainter::Antialiasing);
+    setPen(pen);
+    setBrush(brush.isValid()?brush:QColor(0,0,0,0));
+    translate(center - QPointF(radius, radius));
+    drawEllipse(QRectF(0, 0, radius*2, radius*2));
+    restore();
+}
+//------------------------------------------------------------------------
+//函    数:DrawTextTwice(const QRectF &textRect, const QString &text, const QColor &color = QColor(), Qt::Alignment flags = Qt::AlignHCenter|Qt::AlignVCenter);
+//
+//说    明:思源黑体连续绘制两次, 否则会有点失真
+//
+//参    数:
+//[传入]textRect 
+//[传入]text 
+//[传入]color 
+//[传入]flags 
+//
+//返 回 值:
+//------------------------------------------------------------------------
+void PainterEx::DrawTextTwice(const QRectF &textRect, const QString &text, const QColor &color, Qt::Alignment flags)
+{
+    save();
+    if(color.isValid()) SetPenOnly(color);
+    drawText(textRect, static_cast<int>(flags), text);
+    drawText(textRect, static_cast<int>(flags), text);
+    restore();
+}
+void PainterEx::DrawText(const QRectF &textRect, const QString &text, const QColor &color, Qt::Alignment flags)
+{
+    save();
+    if(color.isValid()) SetPenOnly(color);
+    drawText(textRect, static_cast<int>(flags), text);
+    restore();
+}
+
+void PainterEx::DrawRoundedRect(const QRectF &rect, int radius, const QColor &color, RoundedCorners flags)
+{
+//    save();
+//    setRenderHint(QPainter::Antialiasing);
+//    if(color.isValid()) SetBrushOnly(color);
+//    //先画4个圆
+//    DrawCircle(QPointF(radius, radius), radius, color);
+//    DrawCircle(QPointF(textRect.width() - radius, radius), radius, color);
+//    DrawCircle(QPointF(radius, textRect.height() - radius), radius, color);
+//    DrawCircle(QPointF(textRect.width() - radius, textRect.height() - radius), radius, color);
+//    //再画2个矩形
+//    drawRect(textRect.adjusted(0, radius, 0, -radius));
+//    drawRect(textRect.adjusted(radius, 0, -radius, 0));
+//    restore();
+    
+    save();
+    setRenderHint(QPainter::Antialiasing);
+    if(color.isValid()) SetBrushOnly(color);
+    QRectF cornerRect(0, 0, radius*2, radius*2);
+    //下面arcTo都是逆时针画90°弧
+    QPainterPath roundPath; //圆角矩形
+    roundPath.setFillRule(Qt::WindingFill);
+    
+    //起点
+    QPointF topLeftPoint = flags.testFlag(RoundedCorner::TopLeft)?QPointF(radius, 0):QPointF(0, 0);
+    QPointF bottomLeftPoint = flags.testFlag(RoundedCorner::BottomLeft)?QPointF(0, rect.height()-radius):QPointF(0, rect.height());
+    QPointF bottomRightPoint = flags.testFlag(RoundedCorner::BottomRight)?QPointF(rect.width()-radius, rect.height()):QPointF(rect.width(), rect.height());
+    QPointF topRightPoint = flags.testFlag(RoundedCorner::TopRight)?QPointF(rect.width(), radius):QPointF(rect.width(), 0);
+    
+    roundPath.moveTo(topLeftPoint);//左上角
+    if(flags.testFlag(RoundedCorner::TopLeft)) roundPath.arcTo(cornerRect, 90, 90);
+    roundPath.lineTo(bottomLeftPoint);//左下角
+    if(flags.testFlag(RoundedCorner::BottomLeft)) roundPath.arcTo(cornerRect.translated(0, rect.height()-radius*2), 180, 90);
+    roundPath.lineTo(bottomRightPoint);//右下角
+    if(flags.testFlag(RoundedCorner::BottomRight)) roundPath.arcTo(cornerRect.translated(rect.width()-radius*2, rect.height()-radius*2), 270, 90);
+    roundPath.lineTo(topRightPoint);//右上角
+    if(flags.testFlag(RoundedCorner::TopRight)) roundPath.arcTo(cornerRect.translated(rect.width()-radius*2, 0), 360, 90);
+    roundPath.closeSubpath();
+    
+    translate(rect.topLeft());
+    drawPath(roundPath);
+    restore();
+}
+
+void PainterEx::DrawPixmap(const QRectF &rect, const QPixmap &pixmap)
+{
+    QRectF sourceRect(0.0, 0.0, pixmap.width(), pixmap.height());
+    drawPixmap(rect, pixmap, sourceRect);
+}
+
+void PainterEx::DrawPixmap(const QRectF &rect, const QString &srcPath, int alpha)
+{
+    save();
+    QPixmap pixmap(srcPath);
+    if(alpha != 255)
+    {//将pixmap处理成半透明
+        QPixmap temp(pixmap.size());
+        temp.fill(Qt::transparent);
+        QPainter p1(&temp);
+        p1.setCompositionMode(QPainter::CompositionMode_Source);
+        p1.drawPixmap(0, 0, pixmap);
+        p1.setCompositionMode(QPainter::CompositionMode_DestinationIn);
+        p1.fillRect(temp.rect(), QColor(0, 0, 0, alpha));
+        p1.end();
+        pixmap = temp;
+    }
+    QRectF sourceRect(0.0, 0.0, pixmap.width(), pixmap.height());
+    drawPixmap(rect, pixmap, sourceRect);
+    restore();
+}
+
+void PainterEx::DrawBorder(const QRect &rect, const QPen &pen, RectBorders flags)
+{
+    save();
+    setPen(pen);
+    if(flags.testFlag(RectBorder::RectBorderLeft)) drawLine(rect.topLeft(), rect.bottomLeft());
+    if(flags.testFlag(RectBorder::RectBorderRight)) drawLine(rect.topRight(), rect.bottomRight());
+    if(flags.testFlag(RectBorder::RectBorderTop)) drawLine(rect.topLeft(), rect.topRight());
+    if(flags.testFlag(RectBorder::RectBorderBottom)) drawLine(rect.bottomLeft(), rect.bottomRight());
+    restore();
+}
+
+void PainterEx::DrawTriangle(const QRect &rect, bool isUp, const QColor &brush, const QPen &pen)
+{
+    save();
+    setRenderHint(QPainter::Antialiasing);
+    setPen(pen);
+    setBrush(brush.isValid()?brush:QColor(0,0,0,0));
+    QPainterPath roundPath;
+    roundPath.setFillRule(Qt::WindingFill);
+    
+    roundPath.moveTo(isUp?rect.bottomLeft():rect.topLeft()); //底边-左
+    roundPath.lineTo(isUp?rect.bottomRight():rect.topRight()); //底边-右
+    roundPath.lineTo(QPoint(rect.center().x(), isUp?rect.top():rect.bottom()));//头
+    roundPath.closeSubpath();
+    
+    drawPath(roundPath);
+    restore();
+}

+ 75 - 0
demo/LHCoaxialSwitchSetInfo/common/PaintHelper/painthelper.h

@@ -0,0 +1,75 @@
+#ifndef PAINTHELPER_H
+#define PAINTHELPER_H
+
+#include <QFont>
+#include <QPainter>
+
+class PainterEx : public QPainter
+{
+public:
+    enum RoundedCorner
+    {
+        None                = 0x0000,
+        TopLeft             = 0x0001,
+        TopRight            = 0x0002,
+        BottomLeft          = 0x0004,
+        BottomRight         = 0x0008,
+        Left                = TopLeft|BottomLeft,
+        Right               = TopRight|BottomRight,
+        Top                 = TopLeft|TopRight,
+        Bottom              = BottomLeft|BottomRight,
+        All                 = TopLeft|TopRight|BottomLeft|BottomRight,
+    };
+    Q_DECLARE_FLAGS(RoundedCorners, RoundedCorner)
+    enum RectBorder
+    {
+        RectBorderNone                = 0x0000,
+        RectBorderLeft                = 0x0001,
+        RectBorderRight               = 0x0002,
+        RectBorderTop                 = 0x0004,
+        RectBorderBottom              = 0x0008,
+        RectBorderAll                 = TopLeft|TopRight|BottomLeft|BottomRight,
+        RectBorderExceptLeft          = RectBorderAll & (~RectBorderLeft),
+        RectBorderExceptRight         = RectBorderAll & (~RectBorderRight),
+        RectBorderExceptTop           = RectBorderAll & (~RectBorderTop),
+        RectBorderExceptBottom        = RectBorderAll & (~RectBorderBottom),
+    };
+    Q_DECLARE_FLAGS(RectBorders, RectBorder)
+public:
+    explicit PainterEx(QPaintDevice *device);
+    void SetBrushOnly(const QColor &color);
+    void SetPenOnly(const QColor &color, qreal width = 1, Qt::PenStyle s = Qt::SolidLine);
+    void DrawCircle(QPointF center, double radius, const QColor &brush = QColor(), const QPen &pen = QPen(Qt::transparent));
+    void DrawTextTwice(const QRectF &textRect, const QString &text, const QColor &color = QColor(), Qt::Alignment flags = Qt::AlignHCenter|Qt::AlignVCenter);
+    void DrawText(const QRectF &textRect, const QString &text, const QColor &color, Qt::Alignment flags = Qt::AlignHCenter|Qt::AlignVCenter);
+    void DrawRoundedRect(const QRectF &rect, int radius, const QColor &color = QColor(), RoundedCorners flags = RoundedCorner::All);
+    void DrawPixmap(const QRectF &rect, const QPixmap &pixmap);
+    void DrawPixmap(const QRectF &rect, const QString &srcPath, int alpha = 255);
+    void DrawBorder(const QRect &rect, const QPen &pen, RectBorders flags = RectBorder::RectBorderAll);
+    void DrawTriangle(const QRect &rect, bool isUp, const QColor &brush = QColor(), const QPen &pen = QPen(Qt::transparent));
+};
+Q_DECLARE_OPERATORS_FOR_FLAGS(PainterEx::RoundedCorners)
+Q_DECLARE_OPERATORS_FOR_FLAGS(PainterEx::RectBorders)
+
+class FontEx : public QFont
+{
+public:
+    enum NotoSansType
+    {
+        Unkown,
+        Normal,
+        Regular,
+        Medium,
+        Light,
+        Bold
+    };
+public:
+    explicit FontEx(const QString &family, int pixelSize, bool bold = false);
+    explicit FontEx(NotoSansType type, int pixelSize);
+    
+signals:
+    
+public slots:
+};
+
+#endif // PAINTHELPER_H

+ 129 - 0
demo/LHCoaxialSwitchSetInfo/common/Singletonwork/singletonwork.cpp

@@ -0,0 +1,129 @@
+#include "singletonwork.h"
+
+QMutex singletonWork::m_Mutex;
+singletonWork* singletonWork::m_pInstance = nullptr;
+CLHQLogApi* singletonWork::m_pLHQLogApi = nullptr;
+lhhttpapi* singletonWork::m_pLhHttpAPI = nullptr;
+QString singletonWork::sm_ServerID = nullptr;
+QString singletonWork::sm_ServerDBID = nullptr;
+QString singletonWork::sm_ServerUrl = nullptr;
+QString singletonWork::sm_ServerToken = nullptr;
+
+singletonWork::singletonWork()
+{
+    if(m_pLHQLogApi == nullptr)
+    {
+        m_pLHQLogApi = new CLHQLogApi();
+#ifdef WIN32
+#ifdef QT_NO_DEBUG
+        QString strDllPath ="LHQLog.dll";
+#else
+        QString strDllPath =  "LHQLogd.dll";
+#endif
+#else
+        QString strDllPath = QDir::current().path()+"/LHQLog.so";
+#endif
+        bool isSuccess = m_pLHQLogApi->Load(strDllPath);
+        qDebug() << (isSuccess?"加载成功13:":"缺少文件:") << strDllPath;
+        m_pLHQLogApi->DoInitial("CAS_Dante_Driver");
+    }
+
+    if(m_pLhHttpAPI == nullptr)
+    {
+        qDebug() << "Load LHSqlWebInterface.dll begin";
+        m_pLhHttpAPI = new lhhttpapi();
+#ifdef WIN32
+#ifdef QT_NO_DEBUG
+        QString strDllPath = "LHSqlWebInterface.dll";
+#else
+        QString strDllPath = "LHSqlWebInterfaced.dll";
+#endif
+#else
+        QString strDllPath =  QDir::current().path()+"/LHSqlWebInterface.so";
+#endif
+        bool isSuccess = m_pLhHttpAPI->Load(strDllPath);
+        qDebug() << (isSuccess?"加载成功12:":"缺少文件:") << strDllPath;
+    }
+}
+singletonWork::~singletonWork()
+{
+    if(m_pLHQLogApi != nullptr)
+    {
+        delete m_pLHQLogApi;
+        m_pLHQLogApi = nullptr;
+    }
+    if(m_pLhHttpAPI != nullptr)
+    {
+        delete m_pLhHttpAPI;
+        m_pLhHttpAPI = nullptr;
+    }
+    if(m_pInstance != nullptr)
+    {
+        delete m_pInstance;
+        m_pInstance = nullptr;
+    }
+}
+
+void singletonWork::SetServerID(QString strserid)
+{
+    sm_ServerID = strserid;
+}
+void singletonWork::SetServerDBID(QString strserdbid)
+{
+    sm_ServerDBID = strserdbid;
+}
+
+void singletonWork::SetServerUrl(QString strserurl)
+{
+   sm_ServerUrl = strserurl;
+}
+
+void singletonWork::SetServerToken(QString strsertoken)
+{
+   sm_ServerToken = strsertoken;
+}
+
+QString singletonWork::GetServerID()
+{
+    return sm_ServerID;
+}
+
+QString singletonWork::GetServerDBID()
+{
+    return sm_ServerDBID;
+}
+
+QString singletonWork::GetServerUrl()
+{
+    return sm_ServerUrl;
+}
+
+QString singletonWork::GetServerToken()
+{
+    return sm_ServerToken;
+}
+
+CLHQLogApi *singletonWork::LHQLogAPI()
+{
+    return m_pLHQLogApi;
+}
+
+lhhttpapi *singletonWork::LhHttpAPI()
+{
+    return m_pLhHttpAPI;
+}
+
+singletonWork *singletonWork::instance()
+{
+    //单例对象
+    if (m_pInstance== nullptr)
+    {
+        QMutexLocker mutexLocker(&m_Mutex);
+        if (m_pInstance == nullptr)
+        {
+            m_pInstance = new singletonWork();
+        }
+    }
+    return m_pInstance;
+}
+

+ 62 - 0
demo/LHCoaxialSwitchSetInfo/common/Singletonwork/singletonwork.h

@@ -0,0 +1,62 @@
+#ifndef SINGLETONWORK_H
+#define SINGLETONWORK_H
+
+#include <QObject>
+#include <QMutex>
+#include <QSharedPointer>
+#include <QtSql/QSqlDatabase>
+#include <QtSql/QSqlQuery>
+#include <QtSql/QSql>
+#include <QtDebug>
+#include <QtSql/QSqlError>
+#include <QDir>
+#include "common/LHQLogAPI/LHQLogAPI.h"
+#include "common/LHHTTPAPI/lhhttpapi.h"
+
+#define LH_WRITE_DEBUG(x)  singletonWork::instance()->LHQLogAPI()->DoWriteLog(ELT_Log_Debug, (x));
+#define LH_WRITE_ERROR(x)  singletonWork::instance()->LHQLogAPI()->DoWriteLog(ELT_Log_Error, (x));
+#define LH_WRITE_COMMON(x) singletonWork::instance()->LHQLogAPI()->DoWriteLog(ELT_Log_Common, (x));
+
+
+/*
+ * 备注:
+ * 此文件是单利处理类,主要负责跨线程跨窗口间的通信
+ * 是一个消息分发中心
+ */
+class singletonWork :public QObject
+{
+    Q_OBJECT
+public:
+    ~singletonWork();
+public:
+    static singletonWork* instance();
+    static lhhttpapi* LhHttpAPI();
+    static CLHQLogApi* LHQLogAPI();
+
+    static QString GetServerID();
+    static QString GetServerUrl();
+    static QString GetServerDBID();
+    static QString GetServerToken();
+
+    static void SetServerID(QString strserid);
+    static void SetServerUrl(QString strserurl);
+    static void SetServerDBID(QString strserdbid);
+    static void SetServerToken(QString strsertoken);
+
+private:
+    singletonWork();
+    singletonWork(const singletonWork&){}
+    singletonWork* operator==(const singletonWork&){return NULL;}
+
+    static CLHQLogApi* m_pLHQLogApi;
+    static lhhttpapi* m_pLhHttpAPI;
+    static QString sm_ServerID;//服务器ID
+    static QString sm_ServerDBID;
+    static QString sm_ServerUrl;
+    static QString sm_ServerToken;
+
+private:
+    static QMutex m_Mutex;
+    static singletonWork* m_pInstance;
+};
+#endif // SINGLETONWORK_H

+ 85 - 0
demo/LHCoaxialSwitchSetInfo/common/UpdateSkinStyle/lhstylemanager.cpp

@@ -0,0 +1,85 @@
+#include "lhstylemanager.h"
+
+#include <QCoreApplication>
+#include <QDebug>
+
+LHStyleManager* LHStyleManager::m_instance = NULL;
+
+LHStyleManager::LHStyleManager(QObject *parent) : QObject(parent)
+{
+    m_nCurStyle = eDeepStyle;
+}
+
+LHStyleManager::~LHStyleManager()
+{
+    qDebug()<<__func__;
+    if(m_instance)
+    {
+        delete m_instance;
+    }
+}
+
+LHStyleManager *LHStyleManager::Instance()
+{
+    if(m_instance != NULL)
+    {
+        return m_instance;
+    }
+    m_instance = new LHStyleManager();
+    return m_instance;
+}
+
+void LHStyleManager::AddWidget(QWidget *widget)
+{
+    if(widget != NULL && !m_widgetList.contains(widget))
+    {
+        m_widgetList.append(widget);
+        UpdateWidgetStyle(widget);
+    }
+    else if(m_widgetList.contains(widget))
+    {
+        UpdateWidgetStyle(widget);
+    }
+}
+
+void LHStyleManager::UpdateWidgetStyle(QWidget *widget)
+{
+    if(widget == NULL)
+    {
+        return;
+    }
+    QString strBasePath = QCoreApplication::applicationDirPath();
+    QString strStylePath;
+    QString strName = widget->objectName();
+    if(m_nCurStyle == eDeepStyle)
+    {
+        strStylePath = ":/deep";
+    }
+    else if(m_nCurStyle == eLightStyle)
+    {
+        strStylePath = ":/light";
+    }
+    QString strStyleFile = QString("%1/%2.qss").arg(strStylePath).arg(strName);
+    QFile file(strStyleFile);
+    file.open(QFile::ReadOnly);
+    QString styleSheet = QLatin1String(file.readAll());
+    widget->setStyleSheet(styleSheet);
+    file.close();
+}
+
+void LHStyleManager::SetSkinStyle(int nStyle)
+{
+    if(m_nCurStyle == nStyle)
+    {
+        return;
+    }
+
+    m_nCurStyle = nStyle;
+
+    for(int i = 0; i < m_widgetList.size(); i++)
+    {
+        QWidget* widget = m_widgetList.at(i);
+        if(widget == NULL) continue;
+        UpdateWidgetStyle(widget);
+    }
+}

+ 49 - 0
demo/LHCoaxialSwitchSetInfo/common/UpdateSkinStyle/lhstylemanager.h

@@ -0,0 +1,49 @@
+#ifndef LHSTYLEMANAGER_H
+#define LHSTYLEMANAGER_H
+
+#include <QObject>
+#include <QWidget>
+#include <QList>
+
+enum SkinStyle{eLightStyle, eDeepStyle};
+
+class LHStyleManager : public QObject
+{
+    Q_OBJECT
+public:
+    explicit LHStyleManager(QObject *parent = nullptr);
+    ~LHStyleManager();
+
+    static LHStyleManager* Instance();
+
+    void AddWidget(QWidget* widget);
+
+    void SetSkinStyle(int nStyle);
+
+    int GetCurSkinStyle(){return m_nCurStyle;}
+
+    void SetSkin(SkinStyle style){m_nCurStyle = style;}
+
+    void ClearWidgetList(){m_widgetList.clear();}
+
+signals:
+
+public slots:
+
+private:
+    void UpdateWidgetStyle(QWidget* widget);
+
+private:
+    //当前样式
+    int m_nCurStyle;
+    //所有需要更改样式的widget
+    QWidgetList m_widgetList;
+    //白色样式表
+    QString m_strWhiteStyle;
+    //黑色样式表
+    QString m_strBlackStyle;
+
+    static LHStyleManager *m_instance;
+};
+
+#endif // LHSTYLEMANAGER_H

+ 297 - 0
demo/LHCoaxialSwitchSetInfo/configwidget.cpp

@@ -0,0 +1,297 @@
+#include "configwidget.h"
+#include "ui_configwidget.h"
+
+#include <QJsonArray>
+#include <QJsonDocument>
+#include <QJsonObject>
+#include <QJsonParseError>
+#include <QStandardItem>
+#include <QListView>
+#include <QStyleFactory>
+
+#define LOCAL_TOPIC "同轴采集服务配置"
+
+ConfigWidget::ConfigWidget(int skintype, QWidget *parent) :
+    QWidget(parent),
+    ui(new Ui::ConfigWidget)
+{
+    ui->setupUi(this);
+
+    DoSetStyleSheet(skintype);
+
+    QListView *view = new QListView();
+    view->window()->setWindowFlags(Qt::Popup|Qt::FramelessWindowHint|Qt::NoDropShadowWindowHint);
+    view->window()->setAttribute(Qt::WA_TranslucentBackground);
+    ui->comboBox->addItem("是");
+    ui->comboBox->addItem("否");
+    ui->comboBox->setStyle(QStyleFactory::create("Windows"));
+    ui->comboBox->setView(view);
+    ui->comboBox->installEventFilter(this);
+    ui->comboBox->setCurrentIndex(0);
+
+    QListView *view1 = new QListView();
+    view1->window()->setWindowFlags(Qt::Popup|Qt::FramelessWindowHint|Qt::NoDropShadowWindowHint);
+    view1->window()->setAttribute(Qt::WA_TranslucentBackground);
+    ui->comboBox_1->setStyle(QStyleFactory::create("Windows"));
+    ui->comboBox_1->setView(view1);
+    ui->comboBox_1->installEventFilter(this);
+
+    QListView *view2 = new QListView();
+    view2->window()->setWindowFlags(Qt::Popup|Qt::FramelessWindowHint|Qt::NoDropShadowWindowHint);
+    view2->window()->setAttribute(Qt::WA_TranslucentBackground);
+    ui->comboBox_2->setStyle(QStyleFactory::create("Windows"));
+    ui->comboBox_2->setView(view2);
+    ui->comboBox_2->installEventFilter(this);
+
+    QListView *view3 = new QListView();
+    view3->window()->setWindowFlags(Qt::Popup|Qt::FramelessWindowHint|Qt::NoDropShadowWindowHint);
+    view3->window()->setAttribute(Qt::WA_TranslucentBackground);
+    ui->comboBox_3->setStyle(QStyleFactory::create("Windows"));
+    ui->comboBox_3->setView(view3);
+    ui->comboBox_3->installEventFilter(this);
+
+    QListView *view4 = new QListView();
+    view4->window()->setWindowFlags(Qt::Popup|Qt::FramelessWindowHint|Qt::NoDropShadowWindowHint);
+    view4->window()->setAttribute(Qt::WA_TranslucentBackground);
+    ui->comboBox_4->addItem("是");
+    ui->comboBox_4->addItem("否");
+    ui->comboBox_4->setStyle(QStyleFactory::create("Windows"));
+    ui->comboBox_4->setView(view4);
+    ui->comboBox_4->installEventFilter(this);
+    ui->comboBox_4->setCurrentIndex(1);
+
+    ui->lineEdit_monIp->setEnabled(false);
+    ui->lineEdit_monPort->setEnabled(false);
+}
+
+ConfigWidget::~ConfigWidget()
+{
+    delete ui;
+}
+
+bool ConfigWidget::eventFilter(QObject *obj, QEvent *event)
+{
+    if (obj == ui->comboBox_1 ||obj == ui->comboBox_2
+            || obj == ui->comboBox_3 || obj == ui->comboBox_4
+            || obj == ui->comboBox)
+    {
+        if (event->type() == QEvent::MouseMove) { return true; }
+        else { return false; }
+    }
+    else
+    {
+        // pass the event on to the parent class
+        return ConfigWidget::eventFilter(obj, event);
+    }
+}
+
+void ConfigWidget::DoSetStyleSheet(int nstyle)
+{
+    QString strQssPath;
+    if(nstyle == 0)
+    {
+        strQssPath = QString(":/light/lhcoaxialswitchsetinfo.qss");
+    }
+    else
+    {
+        strQssPath = QString(":/deep/lhcoaxialswitchsetinfo.qss");
+    }
+
+    QFile file(strQssPath);
+    file.open(QFile::ReadOnly);
+    QString styleSheet = QLatin1String(file.readAll());
+    this->setStyleSheet(styleSheet);
+}
+
+void ConfigWidget::InitTransInfo(int nchnid, int ntype)
+{
+    for(int i = 0; i < m_dataManager.m_transDataList.size(); i++)
+    {
+        tMPinData &mpin = m_dataManager.m_transDataList[i];
+        if((mpin.nChnID == nchnid || mpin.nChnID == 0)
+                && (mpin.nFlags == ntype || mpin.nFlags < 0))
+        {
+            if(ntype == 0)
+            {
+                ui->comboBox_1->addItem(mpin.strDevName, mpin.nMPID);
+            }
+            else if(ntype == 1)
+            {
+                ui->comboBox_2->addItem(mpin.strDevName, mpin.nMPID);
+            }
+            else if(ntype == 2)
+            {
+                ui->comboBox_3->addItem(mpin.strDevName, mpin.nMPID);
+            }
+
+            break;
+        }
+    }
+
+    if(ntype == 0)
+    {
+        ui->comboBox_1->setCurrentIndex(0);
+    }
+    else if(ntype == 1)
+    {
+        ui->comboBox_2->setCurrentIndex(0);
+    }
+    else if(ntype == 2)
+    {
+        ui->comboBox_3->setCurrentIndex(0);
+    }
+}
+
+void ConfigWidget::SetTransInfo(int nmpid, int ntype)
+{
+    if(ntype == 0)
+    {
+        int nRow = ui->comboBox_1->findData(nmpid);
+        nRow = nRow < 0 ? 0 : nRow;
+        ui->comboBox_1->setCurrentIndex(nRow);
+    }
+    else if(ntype == 1)
+    {
+        int nRow = ui->comboBox_2->findData(nmpid);
+        nRow = nRow < 0 ? 0 : nRow;
+        ui->comboBox_2->setCurrentIndex(nRow);
+    }
+    else if(ntype == 2)
+    {
+        int nRow = ui->comboBox_3->findData(nmpid);
+        nRow = nRow < 0 ? 0 : nRow;
+        ui->comboBox_3->setCurrentIndex(nRow);
+    }
+}
+
+bool ConfigWidget::DoSave(int serviceid)
+{
+    QListWidgetItem* pItem = ui->listWidget->currentItem();
+    if(pItem == NULL)
+    {
+        return false;
+    }
+
+    SaveDeviceData(pItem->data(Qt::UserRole).toInt());
+
+    m_dataManager.m_transServerIP = ui->lineEdit_TransIp->text();
+    m_dataManager.m_transServerPort = ui->lineEdit_TransPort->text().toInt();
+    m_dataManager.DoSaveServiceConfig(serviceid);
+    return true;
+}
+
+void ConfigWidget::SaveDeviceData(int nMPID)
+{
+    tTZConfig tzConfig;
+    tzConfig.enable = ui->comboBox->currentIndex() == 0 ? true : false;
+    tzConfig.enablemutilchannel = ui->comboBox_4->currentText() == 0 ? true : false;
+    tzConfig.mpid = nMPID;
+    tzConfig.powerofftime = ui->lineEdit_wait->text().toInt();
+    tzConfig.hosttransmpid = ui->comboBox_1->currentData().toInt();
+    tzConfig.backtransmpid = ui->comboBox_2->currentData().toInt();
+    tzConfig.emergencympid = ui->comboBox_3->currentData().toInt();
+    tzConfig.strhosttransName = ui->comboBox_1->currentText();
+    tzConfig.strbacktransName = ui->comboBox_2->currentText();
+    tzConfig.stremergencyName = ui->comboBox_3->currentText();
+    tzConfig.address = ui->lineEdit_monIp->text();
+    tzConfig.port = ui->lineEdit_monPort->text().toInt();
+    tzConfig.slaveid = ui->lineEdit_monAddr->text().toInt();
+
+    m_dataManager.SetDeviceConfig(nMPID, tzConfig);
+}
+
+void ConfigWidget::GetInfoFromDb(int serviceid)
+{
+    m_dataManager.DoLoadDeviceData();
+    m_dataManager.DoLoadServiceConfig(serviceid);
+
+    //更新列表
+    for(int i = 0; i < m_dataManager.m_deviceDataList.size(); i++)
+    {
+        tDeviceData &devData = m_dataManager.m_deviceDataList[i];
+        QString strText = QString("%1.%2").arg(ui->listWidget->count() + 1).arg(devData.strDevName);
+        QListWidgetItem* item = new QListWidgetItem(strText, ui->listWidget);
+        item->setData(Qt::UserRole, devData.nMPID);
+        item->setTextAlignment(Qt::AlignLeft|Qt::AlignVCenter);
+
+        ui->listWidget->addItem(item);
+    }
+
+    ui->listWidget->setCurrentRow(0);
+    ui->lineEdit_TransIp->setText(m_dataManager.m_transServerIP);
+    ui->lineEdit_TransPort->setText(QString::number(m_dataManager.m_transServerPort));
+}
+
+void ConfigWidget::on_listWidget_currentItemChanged(QListWidgetItem *current, QListWidgetItem *previous)
+{
+    if(previous != NULL)
+    {
+        int nMPID = previous->data(Qt::UserRole).toInt();
+        SaveDeviceData(nMPID);
+    }
+    if(current == NULL)
+    {
+        return;
+    }
+
+    qDebug() << current->text();
+
+    ui->lineEdit_monIp->setText("");
+    ui->lineEdit_monPort->setText("");
+    ui->lineEdit_monAddr->setText("1");
+    ui->lineEdit_wait->setText("1");
+    ui->comboBox->setCurrentIndex(0);
+    ui->comboBox_4->setCurrentIndex(1);
+    ui->comboBox_1->clear();
+    ui->comboBox_2->clear();
+    ui->comboBox_3->clear();
+    int nMPID = current->data(Qt::UserRole).toInt();
+    for(int i = 0; i < m_dataManager.m_deviceDataList.size(); i++)
+    {
+        tDeviceData &devData = m_dataManager.m_deviceDataList[i];
+        if(devData.nMPID == nMPID)
+        {
+            QString strAddress = devData.strMaddress;
+            QStringList strList = strAddress.split(':');
+            if(strList.size() == 2)
+            {
+                ui->lineEdit_monIp->setText(strList.at(0));
+                ui->lineEdit_monPort->setText(strList.at(1));
+            }
+            InitTransInfo(devData.nChnID, 0);
+            InitTransInfo(devData.nChnID, 1);
+            InitTransInfo(devData.nChnID, 2);
+
+            tTZConfig tzConfig;
+            m_dataManager.GetDeviceConfig(nMPID, tzConfig);
+            if(!tzConfig.isValid())
+            {
+                SetTransInfo(tzConfig.hosttransmpid, 0);
+                SetTransInfo(tzConfig.backtransmpid, 1);
+                SetTransInfo(tzConfig.emergencympid, 2);
+
+                ui->lineEdit_monAddr->setText(QString::number(tzConfig.slaveid));
+                ui->lineEdit_wait->setText(QString::number(tzConfig.powerofftime));
+                if(tzConfig.enable)
+                {
+                    ui->comboBox->setCurrentIndex(0);
+                }
+                else
+                {
+                    ui->comboBox->setCurrentIndex(1);
+                }
+                if(tzConfig.enablemutilchannel)
+                {
+                    ui->comboBox_4->setCurrentIndex(0);
+                }
+                else
+                {
+                    ui->comboBox_4->setCurrentIndex(1);
+                }
+            }
+
+            break;
+        }
+    }
+}
+

+ 44 - 0
demo/LHCoaxialSwitchSetInfo/configwidget.h

@@ -0,0 +1,44 @@
+#ifndef CONFIGWIDGET_H
+#define CONFIGWIDGET_H
+
+#include <QWidget>
+#include <QTimer>
+#include <QListWidget>
+#include <QListWidgetItem>
+#include <QComboBox>
+#include "devicemanager.h"
+
+namespace Ui {
+class ConfigWidget;
+}
+
+class ConfigWidget : public QWidget
+{
+    Q_OBJECT
+
+public:
+    explicit ConfigWidget(int skintype=0, QWidget *parent = nullptr);
+    ~ConfigWidget();
+
+    bool DoSave(int serviceid);
+    void GetInfoFromDb(int serviceid);
+    void DoSetStyleSheet(int nstyle);
+
+protected:
+    bool eventFilter(QObject *obj, QEvent *event);
+
+private:
+    void SaveDeviceData(int nMPID);
+    void InitTransInfo(int nchnid, int ntype);
+    void SetTransInfo(int nmpid, int ntype);
+
+private slots:
+    void on_listWidget_currentItemChanged(QListWidgetItem *current, QListWidgetItem *previous);
+
+private:
+    Ui::ConfigWidget *ui;
+
+    DeviceManager m_dataManager;
+};
+
+#endif // CONFIGWIDGET_H

+ 424 - 0
demo/LHCoaxialSwitchSetInfo/configwidget.ui

@@ -0,0 +1,424 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>ConfigWidget</class>
+ <widget class="QWidget" name="ConfigWidget">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>350</width>
+    <height>745</height>
+   </rect>
+  </property>
+  <property name="minimumSize">
+   <size>
+    <width>0</width>
+    <height>745</height>
+   </size>
+  </property>
+  <property name="windowTitle">
+   <string>Form</string>
+  </property>
+  <widget class="QWidget" name="widget_bg" native="true">
+   <property name="geometry">
+    <rect>
+     <x>0</x>
+     <y>0</y>
+     <width>350</width>
+     <height>741</height>
+    </rect>
+   </property>
+   <widget class="QLabel" name="label_t1">
+    <property name="geometry">
+     <rect>
+      <x>0</x>
+      <y>0</y>
+      <width>350</width>
+      <height>47</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>采集设备设置</string>
+    </property>
+   </widget>
+   <widget class="QLineEdit" name="lineEdit_TransIp">
+    <property name="geometry">
+     <rect>
+      <x>133</x>
+      <y>650</y>
+      <width>216</width>
+      <height>32</height>
+     </rect>
+    </property>
+   </widget>
+   <widget class="QLineEdit" name="lineEdit_TransPort">
+    <property name="geometry">
+     <rect>
+      <x>133</x>
+      <y>690</y>
+      <width>216</width>
+      <height>32</height>
+     </rect>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label_t2_3">
+    <property name="geometry">
+     <rect>
+      <x>10</x>
+      <y>698</y>
+      <width>120</width>
+      <height>21</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>发射机服务端口:</string>
+    </property>
+    <property name="alignment">
+     <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label_t2_1">
+    <property name="geometry">
+     <rect>
+      <x>10</x>
+      <y>658</y>
+      <width>120</width>
+      <height>21</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>发射机服务IP:</string>
+    </property>
+    <property name="alignment">
+     <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+    </property>
+   </widget>
+   <widget class="QLineEdit" name="lineEdit_monPort">
+    <property name="geometry">
+     <rect>
+      <x>133</x>
+      <y>295</y>
+      <width>216</width>
+      <height>32</height>
+     </rect>
+    </property>
+    <property name="readOnly">
+     <bool>true</bool>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label_t1_1">
+    <property name="geometry">
+     <rect>
+      <x>10</x>
+      <y>260</y>
+      <width>110</width>
+      <height>21</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>监测地址:</string>
+    </property>
+    <property name="alignment">
+     <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label_t1_2">
+    <property name="geometry">
+     <rect>
+      <x>10</x>
+      <y>300</y>
+      <width>110</width>
+      <height>21</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>监测端口:</string>
+    </property>
+    <property name="alignment">
+     <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+    </property>
+   </widget>
+   <widget class="QLineEdit" name="lineEdit_monIp">
+    <property name="geometry">
+     <rect>
+      <x>133</x>
+      <y>255</y>
+      <width>216</width>
+      <height>32</height>
+     </rect>
+    </property>
+    <property name="readOnly">
+     <bool>true</bool>
+    </property>
+   </widget>
+   <widget class="QLineEdit" name="lineEdit_monAddr">
+    <property name="geometry">
+     <rect>
+      <x>133</x>
+      <y>335</y>
+      <width>216</width>
+      <height>32</height>
+     </rect>
+    </property>
+    <property name="readOnly">
+     <bool>false</bool>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label_t1_3">
+    <property name="geometry">
+     <rect>
+      <x>10</x>
+      <y>343</y>
+      <width>110</width>
+      <height>21</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>设备地址码:</string>
+    </property>
+    <property name="alignment">
+     <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+    </property>
+   </widget>
+   <widget class="QListWidget" name="listWidget">
+    <property name="geometry">
+     <rect>
+      <x>0</x>
+      <y>47</y>
+      <width>350</width>
+      <height>200</height>
+     </rect>
+    </property>
+    <property name="focusPolicy">
+     <enum>Qt::NoFocus</enum>
+    </property>
+    <property name="editTriggers">
+     <set>QAbstractItemView::NoEditTriggers</set>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label_t1_4">
+    <property name="geometry">
+     <rect>
+      <x>10</x>
+      <y>388</y>
+      <width>110</width>
+      <height>21</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>主发射机:</string>
+    </property>
+    <property name="alignment">
+     <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label_t1_5">
+    <property name="geometry">
+     <rect>
+      <x>10</x>
+      <y>425</y>
+      <width>110</width>
+      <height>21</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>备发射机:</string>
+    </property>
+    <property name="alignment">
+     <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label_t1_6">
+    <property name="geometry">
+     <rect>
+      <x>10</x>
+      <y>465</y>
+      <width>110</width>
+      <height>21</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>应急发射机:</string>
+    </property>
+    <property name="alignment">
+     <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+    </property>
+   </widget>
+   <widget class="CustomComboBox" name="comboBox_1">
+    <property name="geometry">
+     <rect>
+      <x>133</x>
+      <y>380</y>
+      <width>216</width>
+      <height>32</height>
+     </rect>
+    </property>
+   </widget>
+   <widget class="CustomComboBox" name="comboBox_2">
+    <property name="geometry">
+     <rect>
+      <x>133</x>
+      <y>420</y>
+      <width>216</width>
+      <height>32</height>
+     </rect>
+    </property>
+   </widget>
+   <widget class="CustomComboBox" name="comboBox_3">
+    <property name="geometry">
+     <rect>
+      <x>133</x>
+      <y>460</y>
+      <width>216</width>
+      <height>32</height>
+     </rect>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label_t2_4">
+    <property name="geometry">
+     <rect>
+      <x>10</x>
+      <y>545</y>
+      <width>110</width>
+      <height>21</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>是否服务多频率:</string>
+    </property>
+    <property name="alignment">
+     <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+    </property>
+   </widget>
+   <widget class="QWidget" name="widget_border" native="true">
+    <property name="geometry">
+     <rect>
+      <x>133</x>
+      <y>576</y>
+      <width>216</width>
+      <height>32</height>
+     </rect>
+    </property>
+    <layout class="QHBoxLayout" name="horizontalLayout">
+     <property name="spacing">
+      <number>0</number>
+     </property>
+     <property name="leftMargin">
+      <number>0</number>
+     </property>
+     <property name="topMargin">
+      <number>0</number>
+     </property>
+     <property name="rightMargin">
+      <number>0</number>
+     </property>
+     <property name="bottomMargin">
+      <number>0</number>
+     </property>
+     <item>
+      <widget class="QLineEdit" name="lineEdit_wait"/>
+     </item>
+     <item>
+      <widget class="QLabel" name="label">
+       <property name="minimumSize">
+        <size>
+         <width>30</width>
+         <height>0</height>
+        </size>
+       </property>
+       <property name="maximumSize">
+        <size>
+         <width>30</width>
+         <height>16777215</height>
+        </size>
+       </property>
+       <property name="text">
+        <string>秒</string>
+       </property>
+       <property name="alignment">
+        <set>Qt::AlignCenter</set>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </widget>
+   <widget class="QLabel" name="name_8">
+    <property name="geometry">
+     <rect>
+      <x>10</x>
+      <y>580</y>
+      <width>110</width>
+      <height>21</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>关机等待时长:</string>
+    </property>
+    <property name="alignment">
+     <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+    </property>
+   </widget>
+   <widget class="QLabel" name="name_1">
+    <property name="geometry">
+     <rect>
+      <x>10</x>
+      <y>504</y>
+      <width>110</width>
+      <height>21</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string>是否启用监测:</string>
+    </property>
+    <property name="alignment">
+     <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+    </property>
+   </widget>
+   <widget class="CustomComboBox" name="comboBox">
+    <property name="geometry">
+     <rect>
+      <x>133</x>
+      <y>500</y>
+      <width>216</width>
+      <height>32</height>
+     </rect>
+    </property>
+   </widget>
+   <widget class="Line" name="line">
+    <property name="geometry">
+     <rect>
+      <x>10</x>
+      <y>630</y>
+      <width>330</width>
+      <height>3</height>
+     </rect>
+    </property>
+    <property name="frameShadow">
+     <enum>QFrame::Plain</enum>
+    </property>
+    <property name="orientation">
+     <enum>Qt::Horizontal</enum>
+    </property>
+   </widget>
+   <widget class="CustomComboBox" name="comboBox_4">
+    <property name="geometry">
+     <rect>
+      <x>133</x>
+      <y>540</y>
+      <width>216</width>
+      <height>32</height>
+     </rect>
+    </property>
+   </widget>
+  </widget>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>CustomComboBox</class>
+   <extends>QComboBox</extends>
+   <header>comboBox/customcombobox.h</header>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>

BIN
demo/LHCoaxialSwitchSetInfo/deep/dropdown.png


+ 234 - 0
demo/LHCoaxialSwitchSetInfo/deep/lhcoaxialswitchsetinfo.qss

@@ -0,0 +1,234 @@
+QWidget#widget_bg
+{
+    background: #1D1D2C;
+}
+
+QWidget#widget_border
+{
+	background: transparent;
+	border-radius: 4px;
+	border: 1px solid rgba(255,255,255,0.15);
+}
+QWidget#widget_border:hover
+{
+	background: transparent;
+	border-radius: 4px;
+	border: 1px solid #4458FE;
+}
+QWidget#widget_border:focus
+{
+	background: transparent;
+	border-radius: 4px;
+	border: 1px solid #4458FE;
+}
+
+QListWidget
+{
+	background: #1D1D2C;
+	border:1px solid rgba(255,255,255,0.2);
+	font-size: 14px;
+	font-weight: 400;
+	color: #D2D2D2; 
+}
+QListWidget::item
+{
+	border:none;
+	background: #1D1D2C;
+	font-size: 14px;
+	font-weight: 400;
+	color: #D2D2D2; 
+	height:30px;
+}
+QListWidget::item:hover
+{
+	border:none;
+	background: #438EFF;
+	height:30px;
+}
+QListWidget::item:selected
+{
+	border:none;
+	background: #438EFF;
+	height:30px;
+}
+
+QLabel
+{
+	font-size: 14px;
+	font-weight: 400;
+	color: #D2D2D2;
+}
+
+QFrame#line
+{
+	color: rgba(255,255,255,0.15);
+}
+
+QLineEdit
+{
+    background: #1D1D2C;
+    border-radius: 4px;
+    border: 1px solid rgba(255,255,255,0.15);
+    font-weight: 400;
+    font-size: 14px;
+    color: #D2D2D2;
+    padding-left: 12px;
+}
+QLineEdit:hover
+{
+    border: 1px solid #4458FE;
+}
+QLineEdit:focus
+{
+    border: 1px solid #4458FE;
+}
+
+QLineEdit#lineEdit_wait
+{
+    background: transparent;
+    border:none;
+    font-weight: 400;
+    font-size: 14px;
+    color: #D2D2D2;
+    padding-left: 12px;
+}
+
+QComboBox
+{
+    font-size: 14px;
+    color: #D2D2D2;
+    line-height: 20px;
+    background: transparent;
+    border-radius: 4px;
+    border: 1px solid rgba(255,255,255,0.15);
+    padding-left:12px;
+}
+QComboBox:hover
+{
+    border: 1px solid #4458FE;
+}
+QComboBox::down-arrow
+{
+    image: url(:/deep/dropdown.png);
+    height:16px;
+    width:16px;
+}
+QComboBox::drop-down
+{
+    background: transparent;
+    padding-right:8px;
+}
+QComboBox QAbstractItemView
+{
+    font-size: 14px;
+    background: #5C5E61;
+    border: 1px solid rgba(255,255,255,0.2);
+    border-radius: 4px;
+    outline:0px;
+}
+
+QComboBox QAbstractItemView::item
+{
+    color: #D2D2D2;
+    font-size: 14px;
+    background: #1D1D2C;
+    padding-left:12px;
+    border:none;
+    height:40px;
+}
+QComboBox QAbstractItemView::item:hover
+{
+    font-weight: 500;
+    color: #D2D2D2;
+    background: #438EFF;
+}
+QComboBox QAbstractItemView::item:selected
+{
+    font-weight: 500;
+    color: #D2D2D2;
+    background: #438EFF;
+}
+
+
+QPushButton
+{
+    font-size: 14px;
+    font-weight: 400;
+    color: #FFFFFF;
+    background: qlineargradient(x1:0, y1:0, x2:1, y2:0, stop:0 rgba(79, 138, 255, 1), stop:1 rgba(75, 94, 255, 1));
+    border-radius: 16px;
+}
+
+QPushButton:hover
+{
+    font-size: 14px;
+    font-weight: 500;
+    color: #FFFFFF;
+    line-height: 21px;
+    border: none;
+    border-radius: 16px;
+    background: rgba(79, 138, 255, 220);
+}
+QPushButton:disabled
+{
+    font-size: 14px;
+    font-weight: 500;
+    color: rgba(255,255,255,115);
+    line-height: 21px;
+    border: none;
+    border-radius: 16px;
+    background: qlineargradient(x1:0, y1:0, x2:1, y2:0,stop: 0 rgb(79, 138, 255),stop: 1 rgb(75, 94, 255));
+}
+
+QScrollArea
+{
+background: #1D1D2C;
+}
+QWidget#scrollAreaWidgetContents
+{
+background: #1D1D2C;
+}
+
+QScrollBar:horizontal,QScrollBar:vertical
+{
+    border:none;
+    background-color: transparent;
+    margin: 0px 0px 0px 0px;
+}
+QScrollBar:horizontal
+{
+    padding-left:0px;
+    height: 4px;
+}
+QScrollBar:vertical
+{
+    padding-top:0px;
+    width: 4px;
+}
+QScrollBar::handle:horizontal,QScrollBar::handle:vertical
+{
+    background: #797B7E;
+    border-radius: 2px;
+    min-width: 20px;
+}
+QScrollBar::handle:horizontal
+{
+    min-width: 60px;
+}
+QScrollBar::handle:vertical
+{
+    min-height: 60px;
+}
+QScrollBar::add-line:horizontal, QScrollBar::sub-line:horizontal,
+QScrollBar::add-line:vertical, QScrollBar::sub-line:vertical
+{
+    background-color: transparent;
+    border: none;
+}
+QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal,
+QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical
+{
+    background-color: transparent;
+    background: none;
+}
+

+ 335 - 0
demo/LHCoaxialSwitchSetInfo/devicemanager.cpp

@@ -0,0 +1,335 @@
+#include "devicemanager.h"
+
+
+DeviceManager::DeviceManager(QObject *parent) : QObject(parent)
+{
+}
+
+bool DeviceManager::DoLoadDeviceData()
+{
+    m_deviceDataList.clear();
+    lhhttpapi* httpApi = singletonWork::instance()->LhHttpAPI();
+    if(httpApi == nullptr)
+    {
+        return false;
+    }
+
+    //加载发射机监测点配置数据
+    QJsonObject jsParam
+    {
+        {"nchnid", 0},
+        {"typecode_1", TZ_PT_CODE_1},
+        {"typecode_2", TZ_PT_CODE_2}
+    };
+    QJsonObject jsRoot
+    {
+        {"opName", "TZCJ_GetMonitorPinByChannel"},
+        {"paramList", jsParam}
+    };
+
+    QJsonDocument doc;
+    doc.setObject(jsRoot);
+    QByteArray post_Array = doc.toJson(QJsonDocument::Compact);
+
+    QString strRetJson;
+    QString strtoken = singletonWork::instance()->GetServerToken();
+    if(RERUNSUCCESS != httpApi->DBDoInterface(strtoken, DBDOTYPE_SELECT, QString::fromUtf8(post_Array), strRetJson))
+    {
+        LH_WRITE_ERROR("获取频率参数信息失败!");
+        return false;
+    }
+
+    QByteArray baJson = strRetJson.toUtf8();
+    QJsonParseError jsonError;
+    QJsonDocument doucment = QJsonDocument::fromJson(baJson, &jsonError);
+    if(jsonError.error != QJsonParseError::NoError)
+    {
+        LH_WRITE_ERROR(jsonError.errorString());
+    }
+    QJsonObject rootObj = doucment.object();
+    if(!rootObj.contains("result"))
+    {
+        LH_WRITE_ERROR(QString("获取结果无效:%1").arg(strRetJson));
+    }
+
+    QJsonArray jsResult = rootObj.value("result").toArray();
+    for(int i = 0; i < jsResult.count(); i++)
+    {
+        QJsonValue jsValue = jsResult.at(i);
+        QJsonObject jsObject = jsValue.toObject();
+
+        tDeviceData dev;
+        dev.nChnID = jsObject.value("chnid").toInt();
+        dev.nMPID = jsObject.value("mpid").toInt();
+        dev.nDeviceID = jsObject.value("did").toInt();
+        dev.strDevName = jsObject.value("dname").toString();
+        dev.strChnName = jsObject.value("chnname").toString();
+        dev.strMPName = jsObject.value("mname").toString();
+        dev.strMaddress = jsObject.value("maddress").toString();
+
+        m_deviceDataList.append(dev);
+    }
+
+    if(m_deviceDataList.size() < 1)
+    {
+        return false;
+    }
+
+    return DoLoadTranPin();
+}
+
+bool DeviceManager::DoLoadTranPin()
+{
+    lhhttpapi* httpApi = singletonWork::instance()->LhHttpAPI();
+    if(httpApi == nullptr)
+    {
+        return false;
+    }
+
+    //加载发射机监测点配置数据
+    QJsonObject jsParam
+    {
+        {"nchnid", 0},
+        {"typecode_1", TRANSMITTER_PT_CODE_1},
+        {"typecode_2", TRANSMITTER_PT_CODE_2}
+    };
+    QJsonObject jsRoot
+    {
+        {"opName", "TZCJ_GetMonitorPinByChannel"},
+        {"paramList", jsParam}
+    };
+
+    QJsonDocument doc;
+    doc.setObject(jsRoot);
+    QByteArray post_Array = doc.toJson(QJsonDocument::Compact);
+
+    QString strRetJson;
+    QString strtoken = singletonWork::instance()->GetServerToken();
+    if(RERUNSUCCESS != httpApi->DBDoInterface(strtoken, DBDOTYPE_SELECT, QString::fromUtf8(post_Array), strRetJson))
+    {
+        LH_WRITE_ERROR("获取频率参数信息失败!");
+        return false;
+    }
+
+    QByteArray baJson = strRetJson.toUtf8();
+    QJsonParseError jsonError;
+    QJsonDocument doucment = QJsonDocument::fromJson(baJson, &jsonError);
+    if(jsonError.error != QJsonParseError::NoError)
+    {
+        LH_WRITE_ERROR(jsonError.errorString());
+    }
+    QJsonObject rootObj = doucment.object();
+    if(!rootObj.contains("result"))
+    {
+        LH_WRITE_ERROR(QString("获取结果无效:%1").arg(strRetJson));
+    }
+
+    QJsonArray jsResult = rootObj.value("result").toArray();
+    for(int i = 0; i < jsResult.count(); i++)
+    {
+        QJsonValue jsValue = jsResult.at(i);
+        QJsonObject jsObject = jsValue.toObject();
+
+        tMPinData pin;
+        pin.nChnID = jsObject.value("chnid").toInt();
+        pin.nMPID = jsObject.value("mpid").toInt();
+        pin.nDeviceID = jsObject.value("did").toInt();
+        pin.nFlags = jsObject.value("dclass").toInt();
+        pin.strDevName = jsObject.value("dname").toString();
+        pin.strMPName = jsObject.value("mname").toString();
+        pin.strMaddress = jsObject.value("maddress").toString();
+
+        m_transDataList.append(pin);
+    }
+    return true;
+}
+
+bool DeviceManager::DoLoadServiceConfig(int nServiceID)
+{
+    lhhttpapi* httpApi = singletonWork::instance()->LhHttpAPI();
+    if(httpApi == nullptr)
+    {
+        return false;
+    }
+
+    //加载发射机监测点配置数据
+    QJsonObject jsParam
+    {
+        {"id", nServiceID}
+    };
+    QJsonObject jsRoot
+    {
+        {"opName", "EQM_GetServiceConfigById"},
+        {"paramList", jsParam}
+    };
+
+    QJsonDocument doc;
+    doc.setObject(jsRoot);
+    QByteArray post_Array = doc.toJson(QJsonDocument::Compact);
+
+    QString strRetJson;
+    QString strtoken = singletonWork::instance()->GetServerToken();
+    if(RERUNSUCCESS != httpApi->DBDoInterface(strtoken, DBDOTYPE_SELECT, QString::fromUtf8(post_Array), strRetJson))
+    {
+        LH_WRITE_ERROR("获取频率参数信息失败!");
+        return false;
+    }
+
+    QByteArray baJson = strRetJson.toUtf8();
+    QJsonParseError jsonError;
+    QJsonDocument doucment = QJsonDocument::fromJson(baJson, &jsonError);
+    if(jsonError.error != QJsonParseError::NoError)
+    {
+        LH_WRITE_ERROR(jsonError.errorString());
+    }
+    QJsonObject rootObj = doucment.object();
+    if(!rootObj.contains("result"))
+    {
+        LH_WRITE_ERROR(QString("获取结果无效:%1").arg(strRetJson));
+    }
+
+    QJsonArray serverList = rootObj.value(QLatin1String("result")).toArray();
+    QJsonObject jsSetinginfo = serverList.at(0).toObject();
+    QString strSetInfo = jsSetinginfo.value("setinginfo").toString();
+    QJsonDocument jsonDoc(QJsonDocument::fromJson(strSetInfo.toStdString().data(), &jsonError));
+    if(!jsonDoc.isNull() && jsonError.error == QJsonParseError::NoError)
+    {
+        QJsonObject jObj = jsonDoc.object();
+        m_transServerIP = jObj.value("transserverip").toString();
+        m_transServerPort = jObj.value("transserverport").toInt();
+        QJsonArray array = jObj.value("montzdevice").toArray();
+        for(int i = 0; i < array.count(); i++)
+        {
+            QJsonObject mpjson = array.at(i).toObject();
+
+            tTZConfig temp;
+            temp.mpid = mpjson.value("mpid").toInt();
+            temp.enable = mpjson.value("enable").toBool();
+            temp.address = mpjson.value("address").toString();
+            temp.port = mpjson.value("port").toInt();
+            temp.slaveid = mpjson.value("slaveid").toInt();
+            temp.hosttransmpid = mpjson.value("hosttransmpid").toInt();
+            temp.backtransmpid = mpjson.value("backtransmpid").toInt();
+            temp.emergencympid = mpjson.value("emergencympid").toInt();
+            temp.enablemutilchannel = mpjson.value("enablemutilchannel").toBool();
+            temp.powerofftime = mpjson.value("powerofftime").toInt();
+            m_tzConfigList.append(temp);
+        }
+    }
+    return true;
+}
+
+void DeviceManager::GetDeviceConfig(int nMPID, tTZConfig& config)
+{
+    for(int i = 0; i < m_tzConfigList.size(); i++)
+    {
+        if(m_tzConfigList.at(i).mpid == nMPID)
+        {
+            config = m_tzConfigList.at(i);
+            break;
+        }
+    }
+}
+
+void DeviceManager::SetDeviceConfig(int nMPID, tTZConfig &config)
+{
+    bool bFind = false;
+    for(int i = 0; i < m_tzConfigList.size(); i++)
+    {
+        if(m_tzConfigList.at(i).mpid == nMPID)
+        {
+            bFind = true;
+            m_tzConfigList[i] = config;
+            break;
+        }
+    }
+    if(!bFind)
+    {
+        m_tzConfigList.append(config);
+    }
+}
+
+void DeviceManager::GetMonitorByID(int nMPID, tMPinData& pin)
+{
+    for(int i = 0; i < m_transDataList.size(); i++)
+    {
+        if(m_transDataList.at(i).nMPID == nMPID)
+        {
+            pin = m_transDataList.at(i);
+            break;
+        }
+    }
+}
+
+bool DeviceManager::DoSaveServiceConfig(int nServiceID)
+{
+    lhhttpapi* httpApi = singletonWork::instance()->LhHttpAPI();
+    if(httpApi == nullptr)
+    {
+        return false;
+    }
+
+    QJsonArray devArray;
+    for(int i = 0; i < m_tzConfigList.size(); i++)
+    {
+        QJsonObject mpObj
+        {
+            {"mpid", m_tzConfigList.at(i).mpid},
+            {"enable", m_tzConfigList.at(i).enable},
+            {"address", m_tzConfigList.at(i).address},
+            {"port", m_tzConfigList.at(i).port},
+            {"slaveid", m_tzConfigList.at(i).slaveid},
+            {"hosttransmpid", m_tzConfigList.at(i).hosttransmpid},
+            {"backtransmpid", m_tzConfigList.at(i).backtransmpid},
+            {"emergencympid", m_tzConfigList.at(i).emergencympid},
+            {"enablemutilchannel", m_tzConfigList.at(i).enablemutilchannel},
+            {"powerofftime", m_tzConfigList.at(i).powerofftime},
+        };
+        devArray.append(mpObj);
+    }
+    QJsonObject rootObj
+    {
+        {"transserverip", m_transServerIP},
+        {"transserverport", m_transServerPort},
+        {"montzdevice", devArray}
+    };
+
+    QJsonObject jsParam
+    {
+        {"setinfo", QString::fromUtf8(QJsonDocument(rootObj).toJson(QJsonDocument::Compact))},
+        {"id", nServiceID}
+    };
+    QJsonObject jsRoot
+    {
+        {"opName", "EQM_UpdateServerSetInfo"},
+        {"paramList", jsParam}
+    };
+
+    QJsonDocument doc;
+    doc.setObject(jsRoot);
+    QByteArray post_Array = doc.toJson(QJsonDocument::Compact);
+    QString strtoken = singletonWork::instance()->GetServerToken();
+    QString strRetJson;
+    if(RERUNSUCCESS != httpApi->DBDoInterface(strtoken, DBDOTYPE_UPDATE, QString::fromUtf8(post_Array), strRetJson))
+    {
+        LH_WRITE_ERROR("保存配置信息失败!");
+        return false;
+    }
+
+    //
+    QByteArray baJson = strRetJson.toUtf8();
+    QJsonParseError jsonError;
+    QJsonDocument doucment = QJsonDocument::fromJson(baJson, &jsonError);
+    if(jsonError.error != QJsonParseError::NoError)
+    {
+        LH_WRITE_ERROR(jsonError.errorString());
+    }
+    QJsonObject obj = doucment.object();
+    if (!obj.contains(QLatin1String("result")))
+    {
+        LH_WRITE_ERROR(QString("%1 数据解析失败, Json:%2").arg(Q_FUNC_INFO).arg(strRetJson));
+        return false;
+    }
+
+    return true;
+}

+ 125 - 0
demo/LHCoaxialSwitchSetInfo/devicemanager.h

@@ -0,0 +1,125 @@
+#ifndef DEVICEMANAGER_H
+#define DEVICEMANAGER_H
+
+#include <QObject>
+#include <QJsonDocument>
+#include <QJsonObject>
+#include <QJsonArray>
+
+#include "common/Singletonwork/singletonwork.h"
+
+//MQTT链接超时设置
+#define MQTT_CONNECT_TIMEOUT    30000
+// mqtt webapi的topic
+#define MQTTWEBNAME     "LH_WEBINFO"
+//服务类型本地显示
+#define APPTYPE         "LH_EQM_ANALYSE"
+//数据库操作类型定义
+#define DBDOTYPE_SELECT     1
+#define DBDOTYPE_UPDATE     2
+#define DBDOTYPE_DELETE     3
+#define DBDOTYPE_INSERT     4
+#define DBDOTYPE_PROCEDURE  5
+
+#define TRANSMITTER_PT_CODE_1 955
+#define TRANSMITTER_PT_CODE_2 960
+#define TZ_PT_CODE_1 961
+#define TZ_PT_CODE_2 963
+#define ANT_PT_CODE_1 984
+#define ANT_PT_CODE_2 985
+
+struct tMPinData
+{
+    int nMPID;
+    int nDeviceID;
+    int nFlags;
+    int nChnID;
+    QString strMPName;
+    QString strDevName;
+    QString strMaddress;
+
+    tMPinData()
+    {
+        nMPID = 0; nDeviceID = 0;
+        nFlags = -1;
+    }
+};
+Q_DECLARE_METATYPE(tMPinData);
+
+struct tDeviceData
+{
+    //同轴设备
+    int nChnID;
+    int nMPID;
+    int nDeviceID;
+    QString strChnName;
+    QString strMPName;
+    QString strDevName;
+    QString strMaddress;
+
+    //发射机设备
+    tMPinData hostTransData;
+    tMPinData backTransData;
+    tMPinData emergencyTransData;
+
+    tDeviceData()
+    {
+        nChnID = 0; nMPID = 0;
+        nDeviceID = 0;
+    }
+};
+Q_DECLARE_METATYPE(tDeviceData);
+
+struct tTZConfig
+{
+    int mpid = 0;           //同轴监测点MPID
+    bool enable = true;     //是否启用监测
+    bool enablemutilchannel = false;//启用多频率 没有为false
+    QString address;        //同轴设备地址
+    int port = 0;			//同轴设备端口
+    int slaveid = 1;		//同轴设备机器码,全部设为1即可
+    int hosttransmpid = 0;	//同轴关联主发射机MPID
+    int backtransmpid = 0;	//同轴关联备发射机MPID
+    int emergencympid = 0;	//同轴关联应急发射机MPID,没有为0
+    int powerofftime = 2;	//发射机关机延时
+    QString strhosttransName;
+    QString strbacktransName;
+    QString stremergencyName;
+
+    bool isValid()
+    {
+        return (mpid == 0);
+    }
+};
+
+
+class DeviceManager : public QObject
+{
+    Q_OBJECT
+public:
+    explicit DeviceManager(QObject *parent = nullptr);
+
+    bool DoLoadTranPin();
+    bool DoLoadDeviceData();
+    bool DoLoadServiceConfig(int nServiceID);
+    bool DoSaveServiceConfig(int nServiceID);
+
+    void GetDeviceConfig(int nMPID, tTZConfig& config);
+    void SetDeviceConfig(int nMPID, tTZConfig& config);
+    void GetMonitorByID(int nMPID, tMPinData& pin);
+
+
+public:
+    //发射机设备列表
+    QList<tMPinData> m_transDataList;
+    //同轴设备列表
+    QList<tDeviceData> m_deviceDataList;
+    //发射机采集服务ip
+    QString m_transServerIP;
+    //发射机采集服务port
+    int m_transServerPort = 0;
+    //同轴监测设备列表
+    QList<tTZConfig> m_tzConfigList;
+};
+
+#endif // DEVICEMANAGER_H

+ 99 - 0
demo/LHCoaxialSwitchSetInfo/lhcoaxialconfig.cpp

@@ -0,0 +1,99 @@
+#include "lhcoaxialconfig.h"
+
+#include <QNetworkInterface>
+#include <QLayout>
+
+LHCoaxialConfig g_lhCoaxialConfigObj;
+
+LHCoaxialConfig::LHCoaxialConfig(QObject *parent) : QObject(parent)
+{
+    m_pParentWidget = nullptr;
+    m_pWidget = nullptr;
+}
+
+int LHCoaxialConfig::InitInfo(const InitData* stdata)
+{
+    m_stinfo.strMqttUrl = stdata->strMqttUrl;
+    m_stinfo.nMqttPort = stdata->nMqttPort;
+    m_stinfo.strWebAddr = stdata->strWebAddr;
+    m_stinfo.strDBID = stdata->strDBID;
+
+    //登录webapi获取token
+    QString strtoken="";
+    lhhttpapi* httpApi = singletonWork::instance()->LhHttpAPI();
+    if(httpApi == nullptr)
+    {
+        LH_WRITE_ERROR("webApi接口加载失败!");
+        return -1;
+    }
+
+    QByteArray baWebAddr = m_stinfo.strWebAddr.toUtf8();
+    QByteArray baDBID = m_stinfo.strDBID.toUtf8();
+    if( RERUNSUCCESS != httpApi->DBInit(baWebAddr.data()))
+    {
+        LH_WRITE_ERROR("webapi 初始化失败!");
+        return -2;
+    }
+    if( RERUNSUCCESS != httpApi->DBLogin(baWebAddr.data(), baDBID.data(), WEBAPPTYPE, strtoken))
+    {
+        LH_WRITE_ERROR("webapi接口登录失败!");
+        return -3;
+    }
+
+    singletonWork::instance()->SetServerUrl(m_stinfo.strWebAddr);
+    singletonWork::instance()->SetServerDBID(m_stinfo.strDBID);
+    singletonWork::instance()->SetServerToken(strtoken);
+
+    LH_WRITE_COMMON("开始获取WebApi接口信息");
+    return 0;
+}
+
+int LHCoaxialConfig::DoCreate(int skintype, QWidget* pwind)
+{
+    //设置皮肤
+    if(!m_pWidget)
+    {
+        GlobalMsgMgr::Instance()->SetRootWidget(pwind);
+        m_pWidget = new ConfigWidget(skintype, pwind);
+        if(pwind->layout())
+        {
+            pwind->layout()->addWidget(m_pWidget);
+        }
+        m_pParentWidget = pwind;
+    }
+
+    return 0;
+}
+
+int LHCoaxialConfig::DoRelease()
+{
+    if(m_pWidget)
+    {
+        delete m_pWidget;
+        m_pWidget = nullptr;
+    }
+    return 0;
+}
+
+int LHCoaxialConfig::DoSave(int serviceid)
+{
+    if(m_pWidget)
+    {
+       return m_pWidget->DoSave(serviceid) ? 0 : 1;
+    }
+    return 0;
+}
+
+int LHCoaxialConfig::DoShowWindow(int skintype, int serviceid, bool showWindow)
+{
+    if(m_pWidget)
+    {
+        //设置皮肤
+        m_pWidget->DoSetStyleSheet(skintype);
+        //设置服务ID
+        m_pWidget->GetInfoFromDb(serviceid);
+        m_pWidget->setVisible(showWindow);
+    }
+    return 0;
+}
+

+ 42 - 0
demo/LHCoaxialSwitchSetInfo/lhcoaxialconfig.h

@@ -0,0 +1,42 @@
+#ifndef LHCOAXIALCONFIG_H
+#define LHCOAXIALCONFIG_H
+
+#include "LHCoaxialSwitchSetInfo_global.h"
+#include "common/Singletonwork/singletonwork.h"
+#include "common/GlobalMsgMgr/globalmsgmgr.h"
+#include "configwidget.h"
+
+struct InitData
+{
+    QString strMqttUrl; //mqtt访问路径
+    int nMqttPort;      //mqtt访问端口
+    QString strWebAddr; //数据库访问接口
+    QString strDBID;    //数据库id
+};
+
+class LHCoaxialConfig : public QObject
+{
+    Q_OBJECT
+public:
+    explicit LHCoaxialConfig(QObject *parent = nullptr);
+
+    int InitInfo(const InitData* stdata);//所有信息初始化, 包括MQTT, webapi等
+    int DoCreate(int skintype,QWidget* pwind);
+    int DoShowWindow(int skintype, int serviceid, bool showWindow);
+
+    int DoSave(int serviceid);
+    int DoRelease();
+
+private:
+    InitData m_stinfo; //初始化信息
+
+    QWidget* m_pParentWidget;
+
+    ConfigWidget* m_pWidget;
+
+    int m_npkid; // 数据库中保存行的id
+};
+
+extern LHCoaxialConfig g_lhCoaxialConfigObj;
+
+#endif // LHCOAXIALCONFIG_H

+ 104 - 0
demo/LHCoaxialSwitchSetInfo/lhcoaxialswitchsetinfo.cpp

@@ -0,0 +1,104 @@
+#include "lhcoaxialswitchsetinfo.h"
+
+bool g_bInited = false;
+
+//------------------------------------------------------------------------
+//函    数: DoInit()
+//
+//说    明: 初始化dll
+//
+//参    数: pData: 初始化数据
+//
+//返 回 值:0:成功; 其他:失败(详见返回码定义)
+//------------------------------------------------------------------------
+int DoInit(const InitData* pData)
+{
+    if(!g_bInited)
+    {
+        g_bInited = true;
+    }
+    return g_lhCoaxialConfigObj.InitInfo(pData);
+}
+
+
+//------------------------------------------------------------------------
+//函    数: DoCreateWindow(int skintype, QWidget* parent)
+//
+//说    明: 创建窗口
+//
+//参    数: skintype:皮肤类型 0 白色风格  1 黑色风格
+//             parent 父窗口指针(父窗口隐藏子窗口也会隐藏,这里是必填)
+//
+//返 回 值:0:成功; 其他:失败(详见返回码定义)
+//------------------------------------------------------------------------
+int DoCreateWindow(int skintype, QWidget* parent)
+{
+    return g_lhCoaxialConfigObj.DoCreate(skintype,parent);
+}
+
+//------------------------------------------------------------------------
+//函    数: DoShowWindow(int skintype, int serviceid, bool showWindow)
+//
+//说    明: 设置窗口显示状态、加载配置信息
+//
+//参    数: skintype 皮肤类型
+//         serviceid: 服务id唯一标识,如果小于0界面显示默认值,大于0获取对应的配置数据
+//         showWindow: true 显示 false 隐藏
+//
+//返 回 值:0:成功; 其他:失败(详见返回码定义)
+//------------------------------------------------------------------------
+int DoShowWindow(int skintype, int serviceid, bool showWindow)
+{
+    return g_lhCoaxialConfigObj.DoShowWindow(skintype,serviceid,showWindow);
+}
+
+//------------------------------------------------------------------------
+//函    数: DoGetChangedData
+//
+//说    明: 获取数据修改信息
+//
+//参    数: data 数据变化信息,没变化返回"", 用来保存日志
+//
+//返 回 值:0:成功; 其他:失败(详见返回码定义)
+//------------------------------------------------------------------------
+int DoGetChangedData(QString& data)
+{
+    data = "修改了配置";
+    return 0;
+}
+
+//------------------------------------------------------------------------
+//函    数: DoSave(int serviceid)
+//
+//说    明: 保存数据配置信息
+//
+//参    数: serviceid 服务id唯一标识
+//
+//返 回 值:0:成功; 其他:失败(详见返回码定义)
+//------------------------------------------------------------------------
+int DoSave(int serviceid)
+{
+    if(!g_bInited)
+    {
+       return -1;
+    }
+    return g_lhCoaxialConfigObj.DoSave(serviceid);
+}
+
+//------------------------------------------------------------------------
+//函    数: DoRelease()
+//
+//说    明: 释放资源
+//
+//参    数: void
+//
+//返 回 值:0:成功; 其他:失败(详见返回码定义)
+//------------------------------------------------------------------------
+int DoRelease()
+{
+    if(!g_bInited)
+    {
+       return -1;
+    }
+    return g_lhCoaxialConfigObj.DoRelease();
+}

+ 96 - 0
demo/LHCoaxialSwitchSetInfo/lhcoaxialswitchsetinfo.h

@@ -0,0 +1,96 @@
+#ifndef LHCOAXIALSWITCHSETINFO_H
+#define LHCOAXIALSWITCHSETINFO_H
+
+#include "LHCoaxialSwitchSetInfo_global.h"
+#include "lhcoaxialconfig.h"
+
+//------------------------------------------------------------------------
+//函    数: DoInit()
+//
+//说    明:初始化dll
+//
+//参    数:
+//       pData: 初始化数据
+//返 回 值:0:成功; 其他:失败(详见返回码定义)
+//------------------------------------------------------------------------
+extern "C"
+{
+   int LHCOAXIALSWITCHSETINFO_EXPORT DoInit(const InitData* pData);
+}
+
+//------------------------------------------------------------------------
+//函    数: DoCreateWindow(int skintype, QWidget* parent)
+//
+//说    明: 创建窗口
+//
+//参    数: skintype:皮肤类型 0 白色风格  1 黑色风格
+//             parent 父窗口指针(父窗口隐藏子窗口也会隐藏,这里是必填)
+//
+//返 回 值:0:成功; 其他:失败(详见返回码定义)
+//------------------------------------------------------------------------
+extern "C"
+{
+   int LHCOAXIALSWITCHSETINFO_EXPORT DoCreateWindow(int skintype, QWidget* parent);
+}
+
+//------------------------------------------------------------------------
+//函    数: DoShowWindow(int skintype, int serviceid, bool showWindow)
+//
+//说    明: 设置窗口显示状态、加载配置信息
+//
+//参    数: skintype 皮肤类型
+// serviceid: 服务id唯一标识,如果小于0界面显示默认值,大于0获取对应的配置数据
+// showWindow: true 显示 false 隐藏
+//
+//返 回 值:0:成功; 其他:失败(详见返回码定义)
+//------------------------------------------------------------------------
+extern "C"
+{
+   int LHCOAXIALSWITCHSETINFO_EXPORT DoShowWindow(int skintype, int serviceid, bool showWindow);
+}
+
+//------------------------------------------------------------------------
+//函    数: DoGetChangedData
+//
+//说    明: 获取数据修改信息
+//
+//参    数: data 数据变化信息,没变化返回"", 用来保存日志
+//
+//返 回 值:0:成功; 其他:失败(详见返回码定义)
+
+//------------------------------------------------------------------------
+extern "C"
+{
+   int LHCOAXIALSWITCHSETINFO_EXPORT DoGetChangedData(QString& data);
+}
+
+//------------------------------------------------------------------------
+//函    数: DoSave(int serviceid)
+//
+//说    明: 保存数据配置信息
+//
+//参    数: serviceid 服务id唯一标识
+//
+//返 回 值:0:成功; 其他:失败(详见返回码定义)
+
+//------------------------------------------------------------------------
+extern "C"
+{
+   int LHCOAXIALSWITCHSETINFO_EXPORT DoSave(int serviceid);
+}
+
+//------------------------------------------------------------------------
+//函    数: DoRelease()
+//
+//说    明: 释放资源
+//
+//参    数: void
+//
+//返 回 值:0:成功; 其他:失败(详见返回码定义)
+//------------------------------------------------------------------------
+extern "C"
+{
+   int LHCOAXIALSWITCHSETINFO_EXPORT DoRelease();
+}
+
+#endif // LHCOAXIALSWITCHSETINFO_H

BIN
demo/LHCoaxialSwitchSetInfo/light/dropdown.png


+ 232 - 0
demo/LHCoaxialSwitchSetInfo/light/lhcoaxialswitchsetinfo.qss

@@ -0,0 +1,232 @@
+QWidget#widget_bg
+{
+	background: rgba(255,255,255,1);
+}
+
+QWidget#widget_border
+{
+	background: transparent;
+	border-radius: 4px;
+	border: 1px solid #E6E9F4;
+}
+QWidget#widget_border:hover
+{
+	background: transparent;
+	border-radius: 4px;
+	border: 1px solid #4458FE;
+}
+QWidget#widget_border:focus
+{
+	background: transparent;
+	border-radius: 4px;
+	border: 1px solid #4458FE;
+}
+
+QListWidget
+{
+	background: #F9F9F9;
+	border:1px solid #E6E9F4;
+	font-size: 14px;
+	font-weight: 400;
+	color: #3A3F63; 
+}
+QListWidget::item
+{
+	border:none;
+	background: #F9F9F9;
+	font-size: 14px;
+	font-weight: 400;
+	color: #3A3F63; 
+	height:30px;
+}
+QListWidget::item:hover
+{
+	border:none;
+	background: #EEF2FF;
+	height:30px;
+}
+QListWidget::item:selected
+{
+	border:none;
+	background: #EEF2FF;
+	height:30px;
+}
+
+QLabel
+{
+	font-size: 14px;
+	font-weight: 400;
+	color: #3A3F63;
+}
+
+QFrame#line
+{
+	color: #E6E9F4;
+}
+
+QLineEdit
+{
+    background: #FFFFFF;
+    border-radius: 4px;
+    border: 1px solid #E6E9F4;
+    font-weight: 400;
+    font-size: 14px;
+    color: #3A3F63;
+    padding-left: 12px;
+}
+QLineEdit:hover
+{
+    border: 1px solid #4458FE;
+}
+QLineEdit:focus
+{
+    border: 1px solid #4458FE;
+}
+
+QLineEdit#lineEdit_wait
+{
+    background: transparent;
+    border:none;
+    font-weight: 400;
+    font-size: 14px;
+    color: #3A3F63;
+    padding-left: 12px;
+}
+
+QComboBox
+{
+    font-size: 14px;
+    color: #3A3F63;
+    line-height: 20px;
+    background: transparent;
+    border-radius: 4px;
+    border: 1px solid #E6E9F4;
+    padding-left:12px;
+}
+QComboBox:hover
+{
+    border: 1px solid #4458FE;
+}
+QComboBox::down-arrow
+{
+    image: url(:/light/dropdown.png);
+    height:16px;
+    width:16px;
+}
+QComboBox::drop-down
+{
+    background: transparent;
+    padding-right:8px;
+}
+QComboBox QAbstractItemView
+{
+    font-size: 14px;
+    background: #F9F9F9;
+    border: 1px solid #F9F9F9;
+    border-radius: 4px;
+    outline:0px;
+}
+
+QComboBox QAbstractItemView::item
+{
+    color: #3A3F63;
+    font-size: 14px;
+    background: #F9F9F9;
+    padding-left:12px;
+    border:none;
+    height:40px;
+}
+QComboBox QAbstractItemView::item:hover
+{
+    font-weight: 500;
+    color: #3A3F63;
+    background: #EEF2FF;
+}
+QComboBox QAbstractItemView::item:selected
+{
+    font-weight: 500;
+    color: #3A3F63;
+    background: #EEF2FF;
+}
+
+QPushButton
+{
+    font-size: 14px;
+    font-weight: 400;
+    color: #FFFFFF;
+    background: qlineargradient(x1:0, y1:0, x2:1, y2:0, stop:0 rgba(79, 138, 255, 1), stop:1 rgba(75, 94, 255, 1));
+    border-radius: 16px;
+}
+
+QPushButton:hover
+{
+    font-size: 14px;
+    font-weight: 500;
+    color: #FFFFFF;
+    line-height: 21px;
+    border: none;
+    border-radius: 16px;
+    background: rgba(79, 138, 255, 220);
+}
+QPushButton:disabled
+{
+    font-size: 14px;
+    font-weight: 500;
+    color: rgba(255,255,255,115);
+    line-height: 21px;
+    border: none;
+    border-radius: 16px;
+    background: qlineargradient(x1:0, y1:0, x2:1, y2:0,stop: 0 rgb(79, 138, 255),stop: 1 rgb(75, 94, 255));
+}
+
+QScrollArea
+{
+background: rgba(255,255,255,1);
+}
+QWidget#scrollAreaWidgetContents
+{
+background: rgba(255,255,255,1);
+}
+
+QScrollBar:horizontal,QScrollBar:vertical
+{
+    border:none;
+    background-color: transparent;
+    margin: 0px 0px 0px 0px;
+}
+QScrollBar:horizontal
+{
+    padding-left:0px;
+    height: 4px;
+}
+QScrollBar:vertical
+{
+    padding-top:0px;
+    width: 4px;
+}
+QScrollBar::handle:horizontal,QScrollBar::handle:vertical
+{
+    background: #E2E2E2;
+    border-radius: 2px;
+    min-width: 20px;
+}
+QScrollBar::handle:horizontal
+{
+    min-width: 60px;
+}
+QScrollBar::handle:vertical
+{
+    min-height: 60px;
+}
+QScrollBar::add-line:horizontal, QScrollBar::sub-line:horizontal,
+QScrollBar::add-line:vertical, QScrollBar::sub-line:vertical
+{
+    background-color: transparent;
+    border: none;
+}
+QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal,
+QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical
+{
+    background-color: transparent;
+    background: none;
+}

+ 8 - 0
demo/LHCoaxialSwitchSetInfo/resource.qrc

@@ -0,0 +1,8 @@
+<RCC>
+    <qresource prefix="/">
+        <file>light/dropdown.png</file>
+        <file>deep/dropdown.png</file>
+        <file>light/lhcoaxialswitchsetinfo.qss</file>
+        <file>deep/lhcoaxialswitchsetinfo.qss</file>
+    </qresource>
+</RCC>

+ 39 - 0
demo/LHCoaxialSwitchSetInfo/version.rc

@@ -0,0 +1,39 @@
+//IDI_ICON1 ICON "TKMonitorClient.ico"
+#if defined(UNDER_CE)
+#include <winbase.h>
+#else
+#include <winver.h>
+#endif
+ 
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 6,0,0,0
+ PRODUCTVERSION 6,0,0,0
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+    BLOCK "StringFileInfo"
+    BEGIN
+        BLOCK "080404b0"
+        BEGIN
+            VALUE "CompanyName", "TODO: <联汇科技>"
+            VALUE "FileDescription", "LHCoaxialSwitchSetInfo"
+            VALUE "FileVersion", "6.0.0.0"
+            VALUE "InternalName", "LHCoaxialSwitchSetInfo"
+            VALUE "LegalCopyright", "TODO: (C) <联汇科技>。保留所有权利。"
+            VALUE "OriginalFilename", "LHCoaxialSwitchSetInfo"
+            VALUE "ProductName", "同轴采集服务配置模块"
+            VALUE "ProductVersion", "6.0.0.0"
+        END
+    END
+    BLOCK "VarFileInfo"
+    BEGIN
+        VALUE "Translation", 0x804, 1200
+    END
+END

+ 52 - 47
show1/CMakeLists.txt

@@ -9,31 +9,33 @@ file(GLOB LOCAL_SRC
     ${CMAKE_CURRENT_SOURCE_DIR}/*.ui
     ${CMAKE_CURRENT_SOURCE_DIR}/*.qrc
 
-    ${CMAKE_CURRENT_SOURCE_DIR}/StyleManager/*.cpp
-
-    ${CMAKE_SOURCE_DIR}/External/common/Thread/*.cpp
-    ${CMAKE_SOURCE_DIR}/TransmitterSwitch/*.cpp
-    ${CMAKE_SOURCE_DIR}/TransmitterSwitch/WebAPI/*.cpp
-    ${CMAKE_SOURCE_DIR}/TransmitterSwitch/Resource/*.qrc
-    ${CMAKE_SOURCE_DIR}/TransmitterSwitch/WidgetItems/*.cpp
-    ${CMAKE_SOURCE_DIR}/TransmitterSwitch/UserData/*.cpp
-    ${CMAKE_SOURCE_DIR}/TransmitterSwitch/AddItem/*.cpp
-    ${CMAKE_SOURCE_DIR}/TransmitterSwitch/ItemData/*.cpp
-    ${CMAKE_SOURCE_DIR}/TransmitterSwitch/Template/*.cpp
-    ${CMAKE_SOURCE_DIR}/TransmitterSwitch/warnning/*.cpp
-
-    ${CMAKE_SOURCE_DIR}/TransmitterSwitch/common/Shadow/*.cpp
-    ${CMAKE_SOURCE_DIR}/TransmitterSwitch/common/ImageBlur/*.cpp
-    ${CMAKE_SOURCE_DIR}/TransmitterSwitch/common/combobox/*.cpp
-    ${CMAKE_SOURCE_DIR}/TransmitterSwitch/common/SelectTime/*.cpp
-    ${CMAKE_SOURCE_DIR}/TransmitterSwitch/common/date/*.cpp
-    ${CMAKE_SOURCE_DIR}/TransmitterSwitch/common/date/*.qrc
-    ${CMAKE_SOURCE_DIR}/TransmitterSwitch/common/DropShadow/*.cpp
-    ${CMAKE_SOURCE_DIR}/TransmitterSwitch/common/PaintHelper/*.cpp
-    ${CMAKE_SOURCE_DIR}/TransmitterSwitch/common/warning/*.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/LHTransmitterSwitchAPI/*.cpp
+
+    # ${CMAKE_CURRENT_SOURCE_DIR}/StyleManager/*.cpp
+
+    # ${CMAKE_SOURCE_DIR}/External/common/Thread/*.cpp
+    # ${CMAKE_SOURCE_DIR}/TransmitterSwitch/*.cpp
+    # ${CMAKE_SOURCE_DIR}/TransmitterSwitch/WebAPI/*.cpp
+    # ${CMAKE_SOURCE_DIR}/TransmitterSwitch/Resource/*.qrc
+    # ${CMAKE_SOURCE_DIR}/TransmitterSwitch/WidgetItems/*.cpp
+    # ${CMAKE_SOURCE_DIR}/TransmitterSwitch/UserData/*.cpp
+    # ${CMAKE_SOURCE_DIR}/TransmitterSwitch/AddItem/*.cpp
+    # ${CMAKE_SOURCE_DIR}/TransmitterSwitch/ItemData/*.cpp
+    # ${CMAKE_SOURCE_DIR}/TransmitterSwitch/Template/*.cpp
+    # ${CMAKE_SOURCE_DIR}/TransmitterSwitch/warnning/*.cpp
+
+    # ${CMAKE_SOURCE_DIR}/TransmitterSwitch/common/Shadow/*.cpp
+    # ${CMAKE_SOURCE_DIR}/TransmitterSwitch/common/ImageBlur/*.cpp
+    # ${CMAKE_SOURCE_DIR}/TransmitterSwitch/common/combobox/*.cpp
+    # ${CMAKE_SOURCE_DIR}/TransmitterSwitch/common/SelectTime/*.cpp
+    # ${CMAKE_SOURCE_DIR}/TransmitterSwitch/common/date/*.cpp
+    # ${CMAKE_SOURCE_DIR}/TransmitterSwitch/common/date/*.qrc
+    # ${CMAKE_SOURCE_DIR}/TransmitterSwitch/common/DropShadow/*.cpp
+    # ${CMAKE_SOURCE_DIR}/TransmitterSwitch/common/PaintHelper/*.cpp
+    # ${CMAKE_SOURCE_DIR}/TransmitterSwitch/common/warning/*.cpp
 
     # ${LHQLog_SOURCE_DIRS}/*.cpp
-    ${LHHTTPAPI_SOURCE_DIRS}/*.cpp
+    # ${LHHTTPAPI_SOURCE_DIRS}/*.cpp
 )
 
 # message(STATUS "LHQLog_SOURCE_DIRS: ${LHQLog_SOURCE_DIRS}")
@@ -46,32 +48,35 @@ add_executable(${execName1} ${LOCAL_SRC})
 #添加头文件
 target_include_directories(${execName1} PRIVATE
     ${CMAKE_CURRENT_SOURCE_DIR}
-    ${CMAKE_CURRENT_SOURCE_DIR}/LHLog
-
-    ${CMAKE_CURRENT_SOURCE_DIR}/StyleManager
-
-    ${CMAKE_SOURCE_DIR}/External/common/Thread
-
-    ${CMAKE_SOURCE_DIR}/TransmitterSwitch
-    ${CMAKE_SOURCE_DIR}/TransmitterSwitch/WebAPI
-    ${CMAKE_SOURCE_DIR}/TransmitterSwitch/WidgetItems
-    ${CMAKE_SOURCE_DIR}/TransmitterSwitch/UserData
-    ${CMAKE_SOURCE_DIR}/TransmitterSwitch/AddItem
-    ${CMAKE_SOURCE_DIR}/TransmitterSwitch/ItemData
-    ${CMAKE_SOURCE_DIR}/TransmitterSwitch/Template
-    ${CMAKE_SOURCE_DIR}/TransmitterSwitch/warnning
-
-    ${CMAKE_SOURCE_DIR}/TransmitterSwitch/common
-    ${CMAKE_SOURCE_DIR}/TransmitterSwitch/common/nlohmann
-    ${CMAKE_SOURCE_DIR}/TransmitterSwitch/common/Shadow
-    ${CMAKE_SOURCE_DIR}/TransmitterSwitch/common/ImageBlur
-    ${CMAKE_SOURCE_DIR}/TransmitterSwitch/common/combobox
-    ${CMAKE_SOURCE_DIR}/TransmitterSwitch/common/SelectTime
-    ${CMAKE_SOURCE_DIR}/TransmitterSwitch/common/date
-    ${CMAKE_SOURCE_DIR}/TransmitterSwitch/common/warning
+
+    ${CMAKE_CURRENT_SOURCE_DIR}/LHTransmitterSwitchAPI
+
+    # ${CMAKE_SOURCE_DIR}/TransmitterSwitch
+
+    # ${CMAKE_CURRENT_SOURCE_DIR}/StyleManager
+
+    # ${CMAKE_SOURCE_DIR}/External/common/Thread
+
+    # ${CMAKE_SOURCE_DIR}/TransmitterSwitch
+    # ${CMAKE_SOURCE_DIR}/TransmitterSwitch/WebAPI
+    # ${CMAKE_SOURCE_DIR}/TransmitterSwitch/WidgetItems
+    # ${CMAKE_SOURCE_DIR}/TransmitterSwitch/UserData
+    # ${CMAKE_SOURCE_DIR}/TransmitterSwitch/AddItem
+    # ${CMAKE_SOURCE_DIR}/TransmitterSwitch/ItemData
+    # ${CMAKE_SOURCE_DIR}/TransmitterSwitch/Template
+    # ${CMAKE_SOURCE_DIR}/TransmitterSwitch/warnning
+
+    # ${CMAKE_SOURCE_DIR}/TransmitterSwitch/common
+    # ${CMAKE_SOURCE_DIR}/TransmitterSwitch/common/nlohmann
+    # ${CMAKE_SOURCE_DIR}/TransmitterSwitch/common/Shadow
+    # ${CMAKE_SOURCE_DIR}/TransmitterSwitch/common/ImageBlur
+    # ${CMAKE_SOURCE_DIR}/TransmitterSwitch/common/combobox
+    # ${CMAKE_SOURCE_DIR}/TransmitterSwitch/common/SelectTime
+    # ${CMAKE_SOURCE_DIR}/TransmitterSwitch/common/date
+    # ${CMAKE_SOURCE_DIR}/TransmitterSwitch/common/warning
 
     # ${LHQLog_INCLUDE_DIRS}
-    ${LHHTTPAPI_INCLUDE_DIRS}
+    # ${LHHTTPAPI_INCLUDE_DIRS}
     ${spdlog_INCLUDE_DIR}
 )
 #链接Qt库

+ 83 - 0
show1/LHTransmitterSwitchAPI/lhtransmitterswitchapi.cpp

@@ -0,0 +1,83 @@
+#include "lhtransmitterswitchapi.h"
+
+#include <QLibrary>
+#include <QApplication>
+#include <QDebug>
+
+LHTransmitterSwitchAPI::LHTransmitterSwitchAPI()
+{
+
+}
+
+LHTransmitterSwitchAPI::~LHTransmitterSwitchAPI()
+{
+
+}
+
+/* 加载动态库 */
+bool LHTransmitterSwitchAPI::loadLibrary()
+{
+#ifdef Q_OS_WIN
+    QString libPath = QApplication::applicationDirPath() + "/libLHTransmitterSwitch.dll";
+#elif defined(Q_OS_LINUX)
+    QString libPath = QApplication::applicationDirPath() + "/libLHTransmitterSwitch.so";
+#endif
+    QLibrary lib(libPath);
+    if(!lib.load())
+    {
+        qDebug() << "load 《LHTransmitterSwitch》 library failed, path: " << libPath;
+        return false;
+    }
+    m_pInit = (pInit)lib.resolve("DoInit");
+    m_pCreateWindow = (pCreateWindow)lib.resolve("DoCreateWindow");
+    m_pShowWindow = (pShowWindow)lib.resolve("DoShowWindow");
+    m_pGetExecPlanFromEQM = (pGetExecPlanFromEQM)lib.resolve("DoGetExecPlanFromEQM");
+    m_pSaveExecPlanToEQM = (pSaveExecPlanToEQM)lib.resolve("DoSaveExecPlanToEQM");
+    m_pRelease = (pRelease)lib.resolve("DoRelease");
+
+    if(m_pInit == nullptr || m_pCreateWindow == nullptr || m_pShowWindow == nullptr || 
+        m_pGetExecPlanFromEQM == nullptr || m_pSaveExecPlanToEQM == nullptr || m_pRelease == nullptr)
+    {
+        return false;
+    }
+
+    return true;
+}
+
+int LHTransmitterSwitchAPI::DoInit(const InitData* pData)
+{
+    if(pData == nullptr)
+    {
+        return -1;
+    }
+    return m_pInit(pData);
+}
+
+int LHTransmitterSwitchAPI::DoCreateWindow(int skintype, QWidget* parent)
+{
+    if(parent == nullptr)
+    {
+        return -1;
+    }
+    return m_pCreateWindow(skintype, parent);
+}
+
+int LHTransmitterSwitchAPI::DoShowWindow(int skintype, bool showWindow)
+{
+    return m_pShowWindow(skintype, showWindow);
+}
+
+int LHTransmitterSwitchAPI::DoGetExecPlanFromEQM()
+{
+    return m_pGetExecPlanFromEQM();
+}
+
+int LHTransmitterSwitchAPI::DoSaveExecPlanToEQM()
+{
+    return m_pSaveExecPlanToEQM();
+}
+
+int LHTransmitterSwitchAPI::DoRelease()
+{
+    return m_pRelease();
+}

+ 47 - 0
show1/LHTransmitterSwitchAPI/lhtransmitterswitchapi.h

@@ -0,0 +1,47 @@
+#ifndef LHTRANSMITTERSWITCHAPI_H
+#define LHTRANSMITTERSWITCHAPI_H
+
+#include <QString>
+#include <QWidget>
+
+struct InitData
+{
+    QString url;
+    QString serverID;
+    QString serverKey;
+};
+
+class LHTransmitterSwitchAPI
+{
+    using pInit = int(*)(const InitData*);
+    using pCreateWindow = int(*)(int, QWidget*);
+    using pShowWindow = int(*)(int, bool);
+    using pGetExecPlanFromEQM = int(*)();
+    using pSaveExecPlanToEQM = int(*)();
+    using pRelease = int(*)();
+
+public:
+    LHTransmitterSwitchAPI();
+    ~LHTransmitterSwitchAPI();
+
+    /* 加载动态库 */
+    bool loadLibrary();
+
+    int DoInit(const InitData* pData);
+    int DoCreateWindow(int skintype, QWidget* parent);
+    int DoShowWindow(int skintype, bool showWindow);
+    int DoGetExecPlanFromEQM();
+    int DoSaveExecPlanToEQM();
+    int DoRelease();
+
+private:
+    pInit m_pInit = nullptr;
+    pCreateWindow m_pCreateWindow = nullptr;
+    pShowWindow m_pShowWindow = nullptr;
+    pGetExecPlanFromEQM m_pGetExecPlanFromEQM = nullptr;
+    pSaveExecPlanToEQM m_pSaveExecPlanToEQM = nullptr;
+    pRelease m_pRelease = nullptr;
+
+};
+
+#endif /* LHTRANSMITTERSWITCHAPI_H */

+ 3 - 4
show1/main.cpp

@@ -7,7 +7,6 @@
 
 #include "widget.h"
 #include "spdlog/spdlog.h"
-#include "TransmitterSwitchInfo.h"
 
 void addFont();
 
@@ -47,9 +46,9 @@ void addFont()
     // SPDLOG_DEBUG("id2 = {}", QFontDatabase::applicationFontFamilies(id2));
     // SPDLOG_DEBUG("id3 = {}", QFontDatabase::applicationFontFamilies(id3));
     QFont font_main;
-    // font_main.setFamily("思源黑体M");
-    // font_main.setPixelSize(14);
-    // QApplication::setFont(font_main);
+    font_main.setFamily("思源黑体R");
+    font_main.setPixelSize(14);
+    QApplication::setFont(font_main);
 }
 
 

+ 72 - 62
show1/widget.cpp

@@ -1,53 +1,61 @@
 #include "widget.h"
-#include "TransmitterSwitchInfo.h"
 #include "ui_widget.h"
 
-#include "LHQLogAPI.h"
-#include "lhstylemanager.h"
+// #include "LHQLogAPI.h"
+// #include "lhstylemanager.h"
+#include "spdlog/spdlog.h"
 
-#include "TransmitterswitchInfo.h"
+// #include "TransmitterswitchInfo.h"
+// #include "lhtranmitterswitch.h"
 
 Widget::Widget(QWidget *parent) :
     QWidget(parent),
     ui(new Ui::Widget)
 {
     ui->setupUi(this);
-    /* 设置暗色 */
-    // LHStyleMgr->SetSkinStyle("Dark");
 
-    m_tSwitch = new TransmitterSwitch();
+
+    m_tSwitch = new LHTransmitterSwitchAPI();
+    if(m_tSwitch->loadLibrary())
+    {
+        SPDLOG_INFO("load library success");
+    }else {
+        SPDLOG_ERROR("load library failed");
+    }
     /* 设置一个布局 */
-    m_layout = new QVBoxLayout(ui->widget_content);
-    m_layout->addWidget(m_tSwitch);
-    ui->widget_content->setLayout(m_layout);
+    // m_layout = new QVBoxLayout(ui->widget_content);
+    // m_layout->addWidget(m_tSwitch);
+    // ui->widget_content->setLayout(m_layout);
     /* 设置边距为0 */
-    m_layout->setMargin(20);
-    m_layout->setSpacing(0);
-
-    /* 设置参数 */
-    QString qssPath = QApplication::applicationDirPath();
-    m_tSwitch->setQSSPath(qssPath);
+    // m_layout->setMargin(20);
+    // m_layout->setSpacing(0);
 
     /* 初始化WebAPI */
-    m_tSwitch->setWebAPIInfo("http://192.1.3.133:31000/v6/", "2e36b53ccd2a433b9a803b98d683ed91", "TMS");
+    InitData initData;
+    initData.url = "http://192.1.3.133:31000/v6/";
+    initData.serverID = "2e36b53ccd2a433b9a803b98d683ed91";
+    initData.serverKey = "TMS";
+    m_tSwitch->DoInit(&initData);
+    m_tSwitch->DoCreateWindow(0, ui->widget_content);
+    // m_tSwitch->setWebAPIInfo("http://192.1.3.133:31000/v6/", "2e36b53ccd2a433b9a803b98d683ed91", "TMS");
 
     /* 添加设备信息,测试用 */
     // addTestDevice();
-
+    SPDLOG_INFO("Widget init success");
 }
 
 Widget::~Widget()
 {
-    if(m_tSwitch != nullptr)
-    {
-        delete m_tSwitch;
-        m_tSwitch = nullptr;
-    }
-    if(m_layout != nullptr)
-    {
-        delete m_layout;
-        m_layout = nullptr;
-    }
+//     if(m_tSwitch != nullptr)
+//     {
+//         delete m_tSwitch;
+//         m_tSwitch = nullptr;
+//     }
+//     if(m_layout != nullptr)
+//     {
+//         delete m_layout;
+//         m_layout = nullptr;
+//     }
     delete ui;
 }
 
@@ -57,10 +65,10 @@ void Widget::on_pBtn_getData_clicked()
 {
     if(m_tSwitch == nullptr)
     {
-        LH_WRITE_ERROR("TransmitterSwitch is nullptr");
+        SPDLOG_DEBUG("TransmitterSwitch is nullptr");
         return;
     }
-    m_tSwitch->getExecPlanFromEQM();
+    m_tSwitch->DoGetExecPlanFromEQM();
 }
 
 /* 导出数据按钮 */
@@ -68,10 +76,10 @@ void Widget::on_pBtn_saveData_clicked()
 {
     if(m_tSwitch == nullptr)
     {
-        LH_WRITE_ERROR("TransmitterSwitch is nullptr");
+        SPDLOG_DEBUG("TransmitterSwitch is nullptr");
         return;
     }
-    m_tSwitch->saveExecPlanToEQM();
+    m_tSwitch->DoSaveExecPlanToEQM();
 }
 
 /* 切换亮色/暗色的按钮 */
@@ -79,42 +87,44 @@ void Widget::on_pBtn_light_dark_clicked()
 {
     if(m_tSwitch == nullptr)
     {
-        LH_WRITE_ERROR("TransmitterSwitch is nullptr");
+        SPDLOG_DEBUG("TransmitterSwitch is nullptr");
         return;
     }
-    if(LHStyleManager::Instance()->GetCurSkinStyle() == SkinStyle::eWhiteStyle)
+    if(m_style == 0)
     {
-        LHStyleManager::Instance()->SetSkinStyle(SkinStyle::eBlackStyle);
-        LH_WRITE_LOG_DEBUG("切换为暗色");
-    }else {
-        LHStyleManager::Instance()->SetSkinStyle(SkinStyle::eWhiteStyle);
-        LH_WRITE_LOG_DEBUG("切换为亮色");
+        m_style = 1;
+        /* 当前是亮色,设置为暗色 */
+        m_tSwitch->DoShowWindow(m_style, true);
+    }else 
+    {
+        m_style = 0;
+        m_tSwitch->DoShowWindow(m_style, true);
     }
 }
 
 /* 添加测试用的设备信息 */
-void Widget::addTestDevice()
-{
-    auto devType = DevTypeContainer.getDevType(955);
-    if(devType.PTTypeCode == -1)
-    {
-        return;
-    }
-    DeviceInfo devInfo;
-    devInfo.devName = "衢州台主发射机";
-    devInfo.PTTypeCode = 955;
-    devInfo.DTID = 1;
-    devInfo.DID = 1;
-    devInfo.ChannelID = 1;
-    devInfo.DevType = devType;
-    DeviceContainer.addDevice(devInfo);
+// void Widget::addTestDevice()
+// {
+//     auto devType = DevTypeContainer.getDevType(955);
+//     if(devType.PTTypeCode == -1)
+//     {
+//         return;
+//     }
+//     DeviceInfo devInfo;
+//     devInfo.devName = "衢州台主发射机";
+//     devInfo.PTTypeCode = 955;
+//     devInfo.DTID = 1;
+//     devInfo.DID = 1;
+//     devInfo.ChannelID = 1;
+//     devInfo.DevType = devType;
+//     DeviceContainer.addDevice(devInfo);
 
-    devInfo.devName = "衢州台备发射机";
-    devInfo.PTTypeCode = 955;
-    devInfo.DTID = 1;
-    devInfo.DID = 2;
-    devInfo.ChannelID = 2;
-    devInfo.DevType = devType;
-    DeviceContainer.addDevice(devInfo);
+//     devInfo.devName = "衢州台备发射机";
+//     devInfo.PTTypeCode = 955;
+//     devInfo.DTID = 1;
+//     devInfo.DID = 2;
+//     devInfo.ChannelID = 2;
+//     devInfo.DevType = devType;
+//     DeviceContainer.addDevice(devInfo);
     
-}
+// }

+ 3 - 2
show1/widget.h

@@ -6,7 +6,7 @@
 #include <QMouseEvent>
 #include <QDebug>
 
-#include "transmitterswitch.h"
+#include "lhtransmitterswitchapi.h"
 
 namespace Ui {
 class Widget;
@@ -35,8 +35,9 @@ private:
 private:
     Ui::Widget *ui;
 
-    TransmitterSwitch* m_tSwitch;           /* 开关页面 */
+    LHTransmitterSwitchAPI* m_tSwitch;           /* 开关页面 */
     QVBoxLayout* m_layout;                  /* 布局 */
+    int m_style = 0;                        /* 亮色/暗色 */
 };