Bladeren bron

V0.9.1
1、修改了item的日期选择框,不再用弹框的形式弹出来

Apple 9 maanden geleden
bovenliggende
commit
d912c1ca9f
65 gewijzigde bestanden met toevoegingen van 193 en 8519 verwijderingen
  1. 0 3
      .vscode/settings.json
  2. 16 0
      TransmitterSwitch/AddItem/addspecialitem.cpp
  3. 2 0
      TransmitterSwitch/AddItem/addspecialitem.h
  4. 34 0
      TransmitterSwitch/ItemData/oneitem.cpp
  5. 2 0
      TransmitterSwitch/ItemData/oneitem.h
  6. 25 0
      TransmitterSwitch/ItemData/oneitem.ui
  7. 40 0
      TransmitterSwitch/Resource/QSS/black/oneitem.qss
  8. 43 1
      TransmitterSwitch/Resource/QSS/white/oneitem.qss
  9. 8 0
      TransmitterSwitch/WebAPI/FromWebAPI.cpp
  10. 1 1
      TransmitterSwitch/common/date/calendarwidgetex.cpp
  11. 22 21
      TransmitterSwitch/transmitterswitch.cpp
  12. 0 1597
      demo/ExecPlan.cpp
  13. 0 134
      demo/ExecPlan.h
  14. 0 384
      demo/ExecPlanItem.cpp
  15. 0 89
      demo/ExecPlanItem.h
  16. 0 67
      demo/LHCoaxialSwitchSetInfo/LHCoaxialSwitchSetInfo.pro
  17. 0 422
      demo/LHCoaxialSwitchSetInfo/LHCoaxialSwitchSetInfo.pro.user
  18. 0 12
      demo/LHCoaxialSwitchSetInfo/LHCoaxialSwitchSetInfo_global.h
  19. 0 40
      demo/LHCoaxialSwitchSetInfo/comboBox/customcombobox.cpp
  20. 0 20
      demo/LHCoaxialSwitchSetInfo/comboBox/customcombobox.h
  21. BIN
      demo/LHCoaxialSwitchSetInfo/common/GlobalMsgMgr/error.png
  22. 0 208
      demo/LHCoaxialSwitchSetInfo/common/GlobalMsgMgr/globalmsgmgr.cpp
  23. 0 94
      demo/LHCoaxialSwitchSetInfo/common/GlobalMsgMgr/globalmsgmgr.h
  24. BIN
      demo/LHCoaxialSwitchSetInfo/common/GlobalMsgMgr/normal.png
  25. 0 8
      demo/LHCoaxialSwitchSetInfo/common/GlobalMsgMgr/resglobalmsg.qrc
  26. BIN
      demo/LHCoaxialSwitchSetInfo/common/GlobalMsgMgr/success.png
  27. BIN
      demo/LHCoaxialSwitchSetInfo/common/GlobalMsgMgr/warn.png
  28. 0 201
      demo/LHCoaxialSwitchSetInfo/common/LHHTTPAPI/lhhttpapi.cpp
  29. 0 85
      demo/LHCoaxialSwitchSetInfo/common/LHHTTPAPI/lhhttpapi.h
  30. 0 64
      demo/LHCoaxialSwitchSetInfo/common/LHQLogAPI/LHQLogAPI.cpp
  31. 0 63
      demo/LHCoaxialSwitchSetInfo/common/LHQLogAPI/LHQLogAPI.h
  32. 0 186
      demo/LHCoaxialSwitchSetInfo/common/PaintHelper/painthelper.cpp
  33. 0 75
      demo/LHCoaxialSwitchSetInfo/common/PaintHelper/painthelper.h
  34. 0 129
      demo/LHCoaxialSwitchSetInfo/common/Singletonwork/singletonwork.cpp
  35. 0 62
      demo/LHCoaxialSwitchSetInfo/common/Singletonwork/singletonwork.h
  36. 0 85
      demo/LHCoaxialSwitchSetInfo/common/UpdateSkinStyle/lhstylemanager.cpp
  37. 0 49
      demo/LHCoaxialSwitchSetInfo/common/UpdateSkinStyle/lhstylemanager.h
  38. 0 297
      demo/LHCoaxialSwitchSetInfo/configwidget.cpp
  39. 0 44
      demo/LHCoaxialSwitchSetInfo/configwidget.h
  40. 0 424
      demo/LHCoaxialSwitchSetInfo/configwidget.ui
  41. BIN
      demo/LHCoaxialSwitchSetInfo/deep/dropdown.png
  42. 0 234
      demo/LHCoaxialSwitchSetInfo/deep/lhcoaxialswitchsetinfo.qss
  43. 0 335
      demo/LHCoaxialSwitchSetInfo/devicemanager.cpp
  44. 0 125
      demo/LHCoaxialSwitchSetInfo/devicemanager.h
  45. 0 99
      demo/LHCoaxialSwitchSetInfo/lhcoaxialconfig.cpp
  46. 0 42
      demo/LHCoaxialSwitchSetInfo/lhcoaxialconfig.h
  47. 0 104
      demo/LHCoaxialSwitchSetInfo/lhcoaxialswitchsetinfo.cpp
  48. 0 96
      demo/LHCoaxialSwitchSetInfo/lhcoaxialswitchsetinfo.h
  49. BIN
      demo/LHCoaxialSwitchSetInfo/light/dropdown.png
  50. 0 232
      demo/LHCoaxialSwitchSetInfo/light/lhcoaxialswitchsetinfo.qss
  51. 0 8
      demo/LHCoaxialSwitchSetInfo/resource.qrc
  52. 0 39
      demo/LHCoaxialSwitchSetInfo/version.rc
  53. 0 237
      demo/addnormalitem.cpp
  54. 0 45
      demo/addnormalitem.h
  55. 0 300
      demo/addnormalitem.ui
  56. 0 285
      demo/addspecialitem.cpp
  57. 0 57
      demo/addspecialitem.h
  58. 0 347
      demo/addspecialitem.ui
  59. 0 232
      demo/qss/AddNormalItem.qss
  60. 0 269
      demo/qss/AddSpecialItem.qss
  61. 0 219
      demo/qss/ExecPlanItem.qss
  62. 0 66
      demo/qss/PageExecPlan.qss
  63. 0 160
      demo/换肤/alarmrecordwidget.qss
  64. 0 77
      demo/换肤/lhstylemanager.cpp
  65. 0 46
      demo/换肤/lhstylemanager.h

+ 0 - 3
.vscode/settings.json

@@ -1,3 +0,0 @@
-{
-    "C_Cpp.intelliSenseEngine": "disabled"
-}

+ 16 - 0
TransmitterSwitch/AddItem/addspecialitem.cpp

@@ -72,11 +72,14 @@ AddSpecialItem::AddSpecialItem(QWidget *parent) :
     /* 打开时间选择器 */
     connect(ui->pBtn_selectTime, &QPushButton::clicked, this, &AddSpecialItem::do_selectTime);
     connect(ui->pBtn_iconTime, &QPushButton::clicked, this, &AddSpecialItem::do_selectTime);
+
+    connect(ui->dateEdit, &CalendarDTEdit::dateChanged, this, &AddSpecialItem::do_selectDate);
     
     /* 设置事件过滤器 */
     ui->comBox_actionSelect->installEventFilter(this);
     ui->comBox_devSelect->installEventFilter(this);
     ui->pBtn_Close->installEventFilter(this);
+    ui->dateEdit->installEventFilter(this);
 }
 
 AddSpecialItem::~AddSpecialItem()
@@ -230,6 +233,12 @@ void AddSpecialItem::do_selectTime()
     ui->pBtn_selectTime->setText(m_time.toString("hh:mm:ss"));
 }
 
+/* 修改了日期 */
+void AddSpecialItem::do_selectDate(const QDate &date)
+{
+    // LH_WRITE_LOG_DEBUG(QString("选择日期:%1").arg(date.toString("yyyy-MM-dd")));
+}
+
 /* 设置选择框报警 */
 void AddSpecialItem::setComboBoxWarning(QComboBox* bo, bool flag)
 {
@@ -295,6 +304,13 @@ bool AddSpecialItem::eventFilter(QObject *watched, QEvent *event)
             return true;
         }
     }
+    else if(watched == ui->dateEdit)
+    {
+        if(event->type() == QEvent::Wheel)
+        {
+            return true;
+        }
+    }
     else if(watched == ui->pBtn_Close)
     {
         if(event->type() == QEvent::Enter)

+ 2 - 0
TransmitterSwitch/AddItem/addspecialitem.h

@@ -62,6 +62,8 @@ private slots:
     void do_selectAction();
     /* 点击了时间选择按钮,打开时间选择器 */
     void do_selectTime();
+    /* 修改了日期 */
+    void do_selectDate(const QDate &date);
 
 private:
     /* 设置选择框报警 */

+ 34 - 0
TransmitterSwitch/ItemData/oneitem.cpp

@@ -69,6 +69,14 @@ void OneItem::init()
     /* 根据是否是特殊日移动位置 */
     layoutInit();
 
+    /* 隐藏时间选择按钮 */
+    ui->pBtn_execDate->hide();
+    ui->pBtn_iconDate->hide();
+    /* 设置日期格式 */
+    ui->dateEdit->setDisplayFormat("yyyy-MM-dd");
+    /* 日期栏禁止滚轮滚动 */
+    ui->dateEdit->installEventFilter(this);
+
     /* 设置下拉框背景 */
     ui->comboBox_devName->setViewShadowEffect();
     ui->comboBox_action->setViewShadowEffect();
@@ -86,6 +94,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(ui->dateEdit, &QDateEdit::dateChanged, this, &OneItem::do_dateChanged);
     /* 连接切换样式表的信号和槽 */
     connect(&EPConfig, &ExecPlanGlobalConfig::signal_oneItemQssChanged, this, &OneItem::do_setQSS);
 }
@@ -108,6 +118,7 @@ void OneItem::setDate(const QDate& date)
 {
     m_date = date;
     ui->pBtn_execDate->setText(date.toString("yyyy-MM-dd"));
+    ui->dateEdit->setDate(date);
 }
 
 /* 获取日期 */
@@ -203,6 +214,10 @@ void OneItem::setWarningText(QString str, int ms)
     ui->pBtn_execDate->setProperty("Warn",true);
     ui->pBtn_execDate->style()->unpolish(ui->pBtn_execDate);
     ui->pBtn_execDate->style()->polish(ui->pBtn_execDate);
+
+    ui->dateEdit->setProperty("Warn", true);
+    ui->dateEdit->style()->unpolish(ui->dateEdit);
+    ui->dateEdit->style()->polish(ui->dateEdit);
 }
 
 /* 隐藏警告 */
@@ -216,6 +231,10 @@ void OneItem::hideWarn()
     ui->pBtn_execDate->setProperty("Warn", false);
     ui->pBtn_execDate->style()->unpolish(ui->pBtn_execDate);
     ui->pBtn_execDate->style()->polish(ui->pBtn_execDate);
+
+    ui->dateEdit->setProperty("Warn", false);
+    ui->dateEdit->style()->unpolish(ui->dateEdit);
+    ui->dateEdit->style()->polish(ui->dateEdit);
 }
 
 /* 获取执行时间的位置 */
@@ -293,6 +312,14 @@ void OneItem::do_pBtn_close_clicked()
     emit signal_OneItemDelete(m_weekDay, m_num);
 }
 
+/* 修改了执行日期 */
+void OneItem::do_dateChanged(const QDate date)
+{
+    LH_WRITE_LOG_DEBUG(QString("日期改变了:%1").arg(date.toString("yyyy-MM-dd")));
+    m_date = date;
+    emit signal_dateClicked(m_date);
+}
+
 
 /* 根据日期类型布局 */
 void OneItem::layoutInit()
@@ -355,6 +382,13 @@ bool OneItem::eventFilter(QObject *watched, QEvent *event)
             return true;
         }
     }
+    else if (watched == ui->dateEdit)
+    {
+        if(event->type() == QEvent::Wheel)
+        {
+            return true;
+        }
+    }
     else if(watched == ui->pBtn_close)
     {
         if(event->type() == QEvent::Enter)

+ 2 - 0
TransmitterSwitch/ItemData/oneitem.h

@@ -94,6 +94,8 @@ private slots:
     void do_pBtn_execDate_clicked();
     /* 关闭按钮被点击了 */
     void do_pBtn_close_clicked();
+    /* 修改了执行日期 */
+    void do_dateChanged(const QDate date);
 
 private:
     /* 根据日期类型布局 */

+ 25 - 0
TransmitterSwitch/ItemData/oneitem.ui

@@ -279,6 +279,25 @@
           <string/>
          </property>
         </widget>
+        <widget class="CalendarDTEdit" name="dateEdit">
+         <property name="geometry">
+          <rect>
+           <x>390</x>
+           <y>0</y>
+           <width>132</width>
+           <height>32</height>
+          </rect>
+         </property>
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="calendarPopup">
+          <bool>true</bool>
+         </property>
+        </widget>
         <zorder>label_num</zorder>
         <zorder>comboBox_devName</zorder>
         <zorder>pBtn_close</zorder>
@@ -287,6 +306,7 @@
         <zorder>pBtn_execTime</zorder>
         <zorder>pBtn_iconTime</zorder>
         <zorder>pBtn_iconDate</zorder>
+        <zorder>dateEdit</zorder>
        </widget>
       </item>
       <item>
@@ -319,6 +339,11 @@
    <extends>QComboBox</extends>
    <header location="global">customcombobox.h</header>
   </customwidget>
+  <customwidget>
+   <class>CalendarDTEdit</class>
+   <extends>QDateEdit</extends>
+   <header location="global">calendardtedit.h</header>
+  </customwidget>
  </customwidgets>
  <resources/>
  <connections/>

+ 40 - 0
TransmitterSwitch/Resource/QSS/black/oneitem.qss

@@ -183,3 +183,43 @@ QPushButton#pBtn_execTime[Warn=true], #pBtn_execDate[Warn=true]
 
     border: 1px solid #D21F21;
 }
+
+/* ==========================================================
+ *  日期选择器
+ * ========================================================== */
+CalendarDTEdit
+{
+	background-color: #313539;
+    border-radius: 4px;
+    padding-left:12px;
+    border: 1px solid rgba(255,255,255,0.15);
+}
+
+CalendarDTEdit:hover
+{
+	background-color: #313539;
+    border-radius: 4px;
+    padding-left:12px;
+    border: 1px solid #438EFF;
+}
+
+CalendarDTEdit[Warn=true]
+{
+	background-color: #313539;
+    border-radius: 4px;
+    padding-left:12px;
+    border: 1px solid #D21F21;
+}
+
+CalendarDTEdit:!enabled/* 或者disable */
+{
+    background: rgba(0,0,0,0.04);
+    border: 1px solid #E6E9F4;
+}
+
+CalendarDTEdit::drop-down
+{
+ 	padding-right:8px;
+	width: 16px;
+    image: url(:/ICON/ICON/date_light.png);
+}

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

@@ -180,9 +180,51 @@ QLabel#label_warnning
 
 QPushButton#pBtn_execTime[Warn=true], #pBtn_execDate[Warn=true]
 {
-    background-color: #313539;
+    background-color: #FFFFFF;
     border-radius: 2px 2px 2px 2px;
     padding-left: 12px;
 
     border: 1px solid #D21F21;
 }
+
+/* ==========================================================
+ *  日期选择器
+ * ========================================================== */
+
+CalendarDTEdit
+{
+	background: #FFFFFF;
+    border-radius: 4px;
+    padding-left:12px;
+    border: 1px solid #E6E9F4;
+}
+
+CalendarDTEdit:hover
+{
+	background: #FFFFFF;
+    border-radius: 4px;
+    padding-left:12px;
+    border: 1px solid #4458FE;
+}
+
+CalendarDTEdit[Warn=true]
+{
+	background: #FFFFFF;
+    border-radius: 4px;
+    padding-left:12px;
+    border: 1px solid #D21F21;
+}
+
+CalendarDTEdit:!enabled/* 或者disable */
+{
+    background: rgba(0,0,0,0.04);
+    border: 1px solid #E6E9F4;
+}
+
+CalendarDTEdit::drop-down
+{
+ 	padding-right:8px;
+	width: 16px;
+    image: url(:/ICON/ICON/date_light.png);
+}
+

+ 8 - 0
TransmitterSwitch/WebAPI/FromWebAPI.cpp

@@ -32,9 +32,17 @@ bool FromWebAPI::initWebApi(const QString& url, const QString& serverID, const Q
         m_httpApi = new lhhttpapi;
     }
 #if defined(Q_OS_WIN)
+    #ifdef QT_DEBUG
+    QString libFile = QString("%1/LHSqlWebInterfaced.dll").arg(QApplication::applicationDirPath());
+    #else
     QString libFile = QString("%1/LHSqlWebInterface.dll").arg(QApplication::applicationDirPath());
+    #endif
 #elif defined(Q_OS_LINUX)
+    #ifdef QT_DEBUG
+    QString libFile = QString("%1/libLHSqlWebInterfaced.so").arg(QApplication::applicationDirPath());
+    #else
     QString libFile = QString("%1/libLHSqlWebInterface.so").arg(QApplication::applicationDirPath());
+    #endif
 #endif
     if(!m_httpApi->Load(libFile))
     {

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

@@ -244,7 +244,7 @@ void CalendarWidgetEx::paintEvent(QPaintEvent *)
         //分割线
         QWidget* pNav = vBodyLayout->itemAt(0)->widget();
         if (nullptr != pNav) {
-            int h = pNav->mapTo(this, pNav->rect().bottomRight()).y();
+            int h = pNav->mapTo(this, pNav->rect().bottomRight()).y() + 2;
             // painter.SetPenOnly(QColor(0, 0, 0, 23));
             painter.setPen(m_bgPenColor);
             painter.drawLine(QPoint(0, h), QPoint(width(), h));

+ 22 - 21
TransmitterSwitch/transmitterswitch.cpp

@@ -381,29 +381,30 @@ void TransmitterSwitch::do_editExecDate(QDate d)
     /* 获取信号发送者 */
     auto one = qobject_cast<OneItem*>(sender());
     /* 创建时间选择控件 */
-    std::shared_ptr<CDate> cd = std::make_shared<CDate>(this);
-
-    /* 移动位置,日历弹窗没有编辑栏,只有选择日历的时间,日历弹窗自带16px的阴影 */
-    auto pos = one->mapTo(this, one->getExecDatePos());
-    pos.setY(pos.y() + 32);     /* 去掉时间显示栏的高度 */
-    pos.setX(pos.x() - 16);     /* 去掉阴影的宽度 */
-
-    cd->move(pos);
-    /* 设置默认的日期 */
-    cd->setDate(d);
+    // std::shared_ptr<CDate> cd = std::make_shared<CDate>(this);
+
+    // /* 移动位置,日历弹窗没有编辑栏,只有选择日历的时间,日历弹窗自带16px的阴影 */
+    // auto pos = one->mapTo(this, one->getExecDatePos());
+    // pos.setY(pos.y() + 32);     /* 去掉时间显示栏的高度 */
+    // pos.setX(pos.x() - 16);     /* 去掉阴影的宽度 */
+
+    // cd->move(pos);
+    // /* 设置默认的日期 */
+    // cd->setDate(d);
+
+    // cd->execShow();
+    // /* 获取日期 */
+    // auto date = cd->getDate();
+    // LH_WRITE_LOG_DEBUG(QString("选择日期:%1").arg(date.toString("yyyy-MM-dd")));
+    // /* 判断日期有没有修改 */
+    // if(date == d)
+    // {
+    //     return;
+    // }
 
-    cd->execShow();
-    /* 获取日期 */
-    auto date = cd->getDate();
-    LH_WRITE_LOG_DEBUG(QString("选择日期:%1").arg(date.toString("yyyy-MM-dd")));
-    /* 判断日期有没有修改 */
-    if(date == d)
-    {
-        return;
-    }
-    one->setDate(date);
+    one->setDate(d);
     /* 判断日期时间是否重复 */
-    if(IData.judgeDateTimeRepetitionWithEdit(one->getWeekDay(), one, date, one->getExecTime()))
+    if(IData.judgeDateTimeRepetitionWithEdit(one->getWeekDay(), one, d, one->getExecTime()))
     {
         /* 设置时间报警 */
         one->setWarningText("设备执行日期时间冲突", -1);

+ 0 - 1597
demo/ExecPlan.cpp

@@ -1,1597 +0,0 @@
-#include "ExecPlan.h"
-#include <QVariant>
-#include <QStyle>
-#include <QPainter>
-#include <QPen>
-#include <memory>
-#include <QDebug>
-#include <QSqlError>
-#include <QSqlQuery>
-#include <QSqlRecord>
-#include <QScrollArea>
-#include <QVBoxLayout>
-#include <QEvent>
-#include <QMouseEvent>
-
-#include "lhmaskwidget.h"
-#include "widget.h"
-#include "CustomTimeEdit.h"
-#include "UI/ExecPlan/ExecPlanItem.h"
-#include "UI/ExecPlan/addnormalitem.h"
-#include "UI/ExecPlan/addspecialitem.h"
-#include "Communication/devpacketresolution.h"
-#include "Communication/devicecommunication.h"
-#include "event/OneEvent.h"
-#include "common/globalinfo/globalinfo.h"
-#include "UI/Template/importtemplate.h"
-#include "UI/Template/savetotemplate.h"
-#include "UI/ScrollWidget/scrollwidget.h"
-#include "CommonModule/date/cdate.h"
-#include "CommonModule/TipWidget/tipwidget.h"
-#include "common/warning/warning.h"
-#include "timewidget.h"
-
-
-ExecPlan::ExecPlan(Widget* mainUI,QWidget* mask,QWidget *parent)
-    : QWidget(parent),
-    m_mainUI(mainUI),
-    m_mask(mask)
-{
-    m_logger = spdlog::get("ExecPlan");
-    if(nullptr == m_logger)
-    {
-        qDebug() << "ExecPlan获取logger失败";
-    }
-//    m_first = true;
-    m_leftColumn = new QWidget(this);
-    m_stack = new QStackedWidget(this);
-
-    m_pBtnAddItem = new QPushButton(this);
-    m_pBtnClearExecPlan = new QPushButton(this);
-    m_pBtnImportTemplate = new QPushButton(this);
-    m_pBtnSaveTemplate = new QPushButton(this);
-    m_pBtnGetEQMData = new QPushButton(this);
-
-    m_labelButtomLine = new QLabel(this);
-    m_pBtnDownload = new QPushButton(this);
-    m_pBtnDefault = new QPushButton(this);
-    m_rBtnDoTime = new QRadioButton(this);
-    m_rBtnDoDay = new QRadioButton(this);
-
-    /* 主体框架大小设置 */
-    this->resize(1872,698);
-    m_leftColumn->resize(122,475);
-    m_leftColumn->move(24,70);
-    m_stack->resize(1700,474);
-    m_stack->move(146,71);
-    m_labelButtomLine->resize(1872,1);
-    m_labelButtomLine->move(0,633);
-    QLabel* stackButtomLine = new QLabel(this);
-    stackButtomLine->resize(1822,1);
-    stackButtomLine->move(25,544);
-
-
-    /* 四个功能按钮设置 */
-    m_pBtnAddItem->resize(88,32);
-    m_pBtnAddItem->move(40,561);
-    m_pBtnClearExecPlan->resize(88,32);
-    m_pBtnClearExecPlan->move(144,561);
-    m_pBtnImportTemplate->resize(88,32);
-    m_pBtnImportTemplate->move(248,561);
-    m_pBtnSaveTemplate->resize(88,32);
-    m_pBtnSaveTemplate->move(352,561);
-    m_pBtnAddItem->setText("添加计划");
-    m_pBtnClearExecPlan->setText("清空计划");
-    m_pBtnImportTemplate->setText("导入模版");
-    m_pBtnSaveTemplate->setText("保存为模版");
-    m_pBtnGetEQMData->resize(110,32);
-    m_pBtnGetEQMData->move(456,561);
-    m_pBtnGetEQMData->setText("获取EQM数据");
-
-    /* 下载按钮设置 */
-    m_pBtnDownload->resize(60,32);
-    m_pBtnDownload->move(1788,650);
-    m_pBtnDownload->setText("下载");
-
-    /* 计划和模式按钮设置 */
-    QLabel* labelDefault = new QLabel(this);
-    labelDefault->resize(70,14);
-    labelDefault->move(24,28);
-    labelDefault->setText("默认计划:");
-    m_pBtnDefault->resize(44,22);
-    m_pBtnDefault->move(94,24);
-    m_pBtnDefault->setCheckable(true);
-    m_pBtnDefault->setChecked(true);
-    QLabel* labelExecMode = new QLabel(this);
-    labelExecMode->resize(70,14);
-    labelExecMode->move(186,28);
-    labelExecMode->setText("执行模式:");
-    m_rBtnDoTime->resize(80,16);
-    m_rBtnDoTime->move(256,27);
-    m_rBtnDoTime->setText("按时刻");
-    m_rBtnDoDay->resize(70,16);
-    m_rBtnDoDay->move(354,27);
-    m_rBtnDoDay->setText("按天");
-    m_rBtnDoTime->setChecked(true);
-    /* 创建小提示 */
-    m_labelTip = new QLabel(this);
-    m_labelTip->resize(14,14);
-    m_labelTip->move(423,28);
-    m_TipText = new QLabel(this);
-    m_TipText->resize(936,56);
-    m_TipText->move(448,8);
-    m_TipText->setText(R"(按时刻执行模式:即以时刻点为单位进行执行,若某日既为普通日和特殊日,在某一时刻皆有执行动作,将优先执行特殊日在此时刻所计划的动作。
-按天执行模式:即以天为单位进行执行,若某日既为普通日和特殊日,则当日一整天优先执行特殊日所计划的动作,普通日计划当日不再执行。)");
-    m_TipText->hide();
-
-    /* 设置样式表 */
-    m_leftColumn->setObjectName("LeftColumn");
-    m_labelButtomLine->setObjectName("ButtomLine");
-
-    m_pBtnAddItem->setObjectName("AddTime");
-    m_pBtnClearExecPlan->setObjectName("ClearTime");
-    m_pBtnImportTemplate->setObjectName("Import");
-    m_pBtnSaveTemplate->setObjectName("Save");
-    m_pBtnGetEQMData->setObjectName("GetEQMData");
-
-    m_pBtnDownload->setObjectName("Download");
-    stackButtomLine->setObjectName("stackButtomLine");
-    m_pBtnDefault->setObjectName("Default");
-    m_rBtnDoTime->setObjectName("DoTime");
-    m_rBtnDoDay->setObjectName("DoDay");
-    m_labelTip->setObjectName("Tip");
-    m_TipText->setObjectName("TipText");
-
-    /* 设置样式表 */
-    QFile file(":/qss/qss/PageExecPlan/PageExecPlan.qss");
-    if(file.open(QFile::ReadOnly))
-    {
-        QString styleSheet = file.readAll();
-        this->setStyleSheet(styleSheet);
-        file.close();
-    } else
-    {
-        SPDLOG_LOGGER_ERROR(m_logger,"打开文件失败:{}", file.fileName().toStdString());
-    }
-
-    /* 创建一周8天的按钮和stack页面 */
-    uiSupplement();
-
-    /* 存储每日项的容器初始化 */
-    m_vecItem.clear();
-    for(int k = 0;k < 8;k++)
-    {
-        QList<ExecPlanItem*>* one = new QList<ExecPlanItem*>;
-        one->clear();
-        m_vecItem.push_back(one);
-    }
-    /* 创建数据库连接 */
-    createDataBase();
-
-    /* 注册事件过滤器 */
-    m_labelTip->installEventFilter(this);
-
-    connect(&DevInfo,SIGNAL(signal_addCfgDev()),this,SLOT(do_cfgDevChanged()));
-
-    connect(m_pBtnAddItem,SIGNAL(clicked()),this,SLOT(do_pBtnAddExecPlan()));
-    connect(m_pBtnDownload,SIGNAL(clicked()),this,SLOT(do_download()));
-    connect(m_pBtnClearExecPlan,SIGNAL(clicked()),this,SLOT(do_clearExecPlan()));
-    connect(m_pBtnSaveTemplate,SIGNAL(clicked()),this,SLOT(do_saveTemplate()));
-    connect(m_pBtnImportTemplate,SIGNAL(clicked()),this,SLOT(do_importTemplate()));
-    connect(m_pBtnGetEQMData,SIGNAL(clicked()),this,SLOT(do_pBtnGetEQMData()));
-    /* 这些信号在全局类中定义的 */
-    connect(&DevInfo,SIGNAL(signal_deleteCfgDev(QString)),this,SLOT(do_devDelete(QString)));
-    connect(&DevInfo,SIGNAL(signal_oneDevChanged(QString,QString)),this,SLOT(do_devChanged(QString,QString)));
-}
-
-
-ExecPlan::~ExecPlan()
-{
-    for(auto& it : m_vecItem)
-    {
-        for(auto& it2 : *it)
-        {
-            delete it2;
-        }
-    }
-    delete m_leftColumn;
-    delete m_stack;
-    delete m_pBtnAddItem;
-    delete m_pBtnClearExecPlan;
-    delete m_pBtnImportTemplate;
-    delete m_pBtnSaveTemplate;
-    delete m_labelButtomLine;
-}
-
-/* 补充UI */
-void ExecPlan::uiSupplement()
-{
-    /* 一周8天的8个按钮设置 */
-    for(int i = 0;i < 8;i++)
-    {
-        QPushButton* pBtn = new QPushButton(m_leftColumn);
-        pBtn->resize(120,40);
-        pBtn->move(1,i*40);
-        pBtn->setProperty("Pressed",false);
-        pBtn->setStyleSheet(R"(
-            QPushButton[Pressed=true]{
-                background-color:rgba(68, 88, 254, 0.10);
-                padding-left:20px;
-                border-right:2px solid #4458FE;
-                color:#4458FE;
-            }
-            QPushButton[Pressed=false]{
-                color: #3A3F63;
-                padding-left:20px;
-                background-color: #F5F5FA;
-                border-right:0px solid #4458FE;
-            }
-            )");
-        /* 点击周几按钮 */
-        connect(pBtn,SIGNAL(clicked()),this,SLOT(do_selectDayOfWeeks()));
-        m_vecWeeks.push_back(pBtn);
-    }
-    m_vecWeeks[0]->setText("星期一");
-    m_vecWeeks[1]->setText("星期二");
-    m_vecWeeks[2]->setText("星期三");
-    m_vecWeeks[3]->setText("星期四");
-    m_vecWeeks[4]->setText("星期五");
-    m_vecWeeks[5]->setText("星期六");
-    m_vecWeeks[6]->setText("星期日");
-    m_vecWeeks[7]->setText("特殊日");
-
-    /* 创建8个页面 */
-    for(int j = 0;j < 7;j++)
-    {
-        QWidget* w = new QWidget;
-        w->resize(m_stack->width(),m_stack->height());
-        QLabel* labelNum = new QLabel(w);
-        labelNum->resize(28,14);
-        labelNum->move(16,16);
-        labelNum->setText("序号");
-        QLabel* labelTime = new QLabel(w);
-        labelTime->resize(28,14);
-        labelTime->move(112,16);
-        labelTime->setText("设备");
-        QLabel* execTime = new QLabel(w);
-        execTime->resize(56,14);
-        execTime->move(388,16);
-        execTime->setText("执行时间");
-        QLabel* action = new QLabel(w);
-        action->resize(28,14);
-        action->move(536,16);
-        action->setText("动作");
-        QLabel* operate = new QLabel(w);
-        operate->resize(28,14);
-        operate->move(812,16);
-        operate->setText("操作");
-
-        auto sw = new ScrollWidget(w);
-        sw->move(0,30);
-        m_vecLayout.push_back(sw->Layout());
-        m_stack->addWidget(w);
-        m_vecScrollArea.push_back(sw);
-    }
-    /* 单独创建特殊日页面 */
-    QWidget* w = new QWidget;
-    w->resize(m_stack->width(),m_stack->height());
-    QLabel* labelNum = new QLabel(w);
-    labelNum->resize(28,14);
-    labelNum->move(16,16);
-    labelNum->setText("序号");
-    QLabel* labelTime = new QLabel(w);
-    labelTime->resize(28,14);
-    labelTime->move(112,16);
-    labelTime->setText("设备");
-    QLabel* execDate = new QLabel(w);
-    execDate->resize(56,14);
-    execDate->move(388,16);
-    execDate->setText("执行日期");
-    QLabel* execTime = new QLabel(w);
-    execTime->resize(56,14);
-    execTime->move(536,16);
-    execTime->setText("执行时间");
-    QLabel* action = new QLabel(w);
-    action->resize(28,14);
-    action->move(684,16);
-    action->setText("动作");
-    QLabel* operate = new QLabel(w);
-    operate->resize(28,14);
-    operate->move(960,16);
-    operate->setText("操作");
-
-    auto sw = new ScrollWidget(w);
-    sw->move(0,30);
-    m_vecLayout.push_back(sw->Layout());
-    m_stack->addWidget(w);
-    m_vecScrollArea.push_back(sw);
-
-    /* 默认当日周几 */
-    int day = QDate::currentDate().dayOfWeek() - 1;
-    m_vecWeeks[day]->setProperty("Pressed",true);
-    m_stack->setCurrentIndex(day);
-    /* 需要手动更新控件,使其生效 */
-    m_leftColumn->style()->unpolish(m_vecWeeks[0]);
-    m_leftColumn->style()->polish(m_vecWeeks[0]);
-}
-
-/**
- * @brief 判断时间是否重复
- * @param time
- * @return true:时间重叠
- *         false:不重叠
- */
-bool ExecPlan::judgeTimeRepetition(QList<ExecPlanItem*>& list,const QString& devName,const QTime& time)
-{
-    for(const auto& it : list)
-    {
-        /* 先查设备名称是否重复 */
-        if(it->getDevName() == devName)
-        {
-            /* 名称相等再查时间是否重复 */
-            if(it->getExecTime() == time)
-            {
-                return true;
-            }
-        }
-    }
-    /* 所有设备都判断完了 */
-    return false;
-}
-/**
- * @brief 判断日期是否重复,这里会先将自身移除链表
- * @param list
- * @param item
- * @return
- */
-bool ExecPlan::judgeTimeRepetition(QList<ExecPlanItem *>& list, ExecPlanItem* item)
-{
-    /* 先将自身移除链表 */
-    list.removeOne(item);
-//    SPDLOG_LOGGER_DEBUG(m_logger,"***** 列表中还有{}项",list.count());
-    for(const auto& it : list)
-    {
-        /* 先查设备名称是否重复 */
-        if(it->getDevName() == item->getDevName())
-        {
-            /* 名称相等再查时间是否重复 */
-            if(it->getExecTime() == item->getExecTime())
-            {
-                list.append(item);
-                return true;
-            }
-        }
-    }
-
-    list.append(item);
-    /* 所有设备都判断完了 */
-    return false;
-}
-/**
- * @brief ExecPlan::judgeTimeRepetition
- * @param list
- * @param item
- * @param time
- * @return
- */
-bool ExecPlan::judgeTimeRepetition(QList<ExecPlanItem *>& list, ExecPlanItem *item, const QTime &time)
-{
-    /* 先将自身移除链表 */
-    list.removeOne(item);
-    for(const auto& it : list)
-    {
-        /* 先查设备名称是否重复 */
-        if(it->getDevName() == item->getDevName())
-        {
-            /* 名称相等再查时间是否重复 */
-            if(it->getExecTime() == time)
-            {
-                list.append(item);
-                return true;
-            }
-        }
-    }
-    list.append(item);
-    /* 所有设备都判断完了 */
-    return false;
-}
-/* 判断日期时间是否重复 */
-bool ExecPlan::judgeDateTimeRepetition(QList<ExecPlanItem *> &list, const QString &devName,const QDate& date,const QTime &time)
-{
-    for(const auto& it : list)
-    {
-        if(it->getDevName() == devName)
-        {
-            if(it->getDate() == date)
-            {
-                if(it->getExecTime() == time)
-                {
-                    return true;
-                }
-            }
-        }
-    }
-
-    /* 没有相等的日期 */
-    return false;
-}
-/**
- * @brief 特殊日判断时间重复
- * @param list
- * @param item
- * @param time
- * @return
- */
-bool ExecPlan::judgeDateTimeRepetition(QList<ExecPlanItem *> &list, ExecPlanItem *item, const QTime &time)
-{
-    /* 先将自身移除链表 */
-    list.removeOne(item);
-    for(const auto& it : list)
-    {
-        /* 先查设备名称是否重复 */
-        if(it->getDevName() == item->getDevName())
-        {
-            /* 名称相等再查日期是否重复 */
-            if(it->getDate() == item->getDate())
-            {
-                if(it->getExecTime() == time)
-                {
-                    list.append(item);
-                    return true;
-                }
-            }
-        }
-    }
-    list.append(item);
-    /* 所有设备都判断完了 */
-    return false;
-}
-/**
- * @brief 这个重载是修改了日期后检查是否冲突
- * @param list
- * @param item
- * @param date
- * @return
- */
-bool ExecPlan::judgeDateTimeRepetition(QList<ExecPlanItem *> &list, ExecPlanItem *item,const QDate& date)
-{
-    /* 先将自身移除链表 */
-    list.removeOne(item);
-    for(const auto& it : list)
-    {
-        /* 先查设备名称是否重复 */
-        if(it->getDevName() == item->getDevName())
-        {
-            /* 名称相等再查日期是否重复 */
-            if(it->getDate() == date)
-            {
-                if(it->getExecTime() == item->getExecTime())
-                {
-                    list.append(item);
-                    return true;
-                }
-            }
-        }
-    }
-    list.append(item);
-    /* 所有设备都判断完了 */
-    return false;
-}
-/**
- * @brief 这个重载主要是修改了设备后检查是否冲突
- * @param list
- * @param item
- * @return
- */
-bool ExecPlan::judgeDateTimeRepetition(QList<ExecPlanItem *> &list, ExecPlanItem *item)
-{
-    /* 先将自身移除链表 */
-    list.removeOne(item);
-    for(const auto& it : list)
-    {
-        /* 先查设备名称是否重复 */
-        if(it->getDevName() == item->getDevName())
-        {
-            /* 名称相等再查日期是否重复 */
-            if(it->getDate() == item->getDate())
-            {
-                if(it->getExecTime() == item->getExecTime())
-                {
-                    list.append(item);
-                    return true;
-                }
-            }
-        }
-    }
-    list.append(item);
-    /* 所有设备都判断完了 */
-    return false;
-}
-/* 获取默认计划 */
-char ExecPlan::getDefaultPlan()
-{
-    if(m_pBtnDefault->isChecked())
-    {
-        return 1;
-    }
-    return 0;
-}
-/* 获取执行模式 */
-char ExecPlan::getExecMode()
-{
-    if(m_rBtnDoDay->isChecked())
-    {
-        return 1;
-    }
-    return 0;
-}
-/* 获取计划容器 */
-QVector<QList<ExecPlanItem *> *> &ExecPlan::vecItem()
-{
-    return m_vecItem;
-}
-/* 获取stackWidget的指针 */
-QStackedWidget *ExecPlan::stackWidget()
-{
-    return m_stack;
-}
-
-QVector<QLayout *>& ExecPlan::layout()
-{
-    return m_vecLayout;
-}
-
-/* 刷新一周8天的页面 */
-//void ExecPlan::RefreshUI()
-//{
-//    //    /* 将当前页,按时间升序排序 */
-//    //    qSort(m_vecItem[m_stack->currentIndex()]->begin(),
-//    //          m_vecItem[m_stack->currentIndex()]->end(),
-//    //          timeCompare);
-//    /* 设置序号,刷新UI */
-
-//    int num1 = 0;
-//    for(auto& it : m_vecItem)
-//    {
-//        num1 = 0;
-//        for(auto& it1 : *it)
-//        {
-//            int y = num1*48;
-//            it1->move(0,y);
-//            num1++;
-//        }
-//    }
-//}
-/* 设置默认计划 */
-void ExecPlan::setDefaultPlan(int num)
-{
-    if(0 == num)
-    {
-        m_pBtnDefault->setChecked(false);
-    }else
-    {
-        m_pBtnDefault->setChecked(true);
-    }
-
-}
-/* 按时刻还是按天 */
-void ExecPlan::setTimeOrDay(int num)
-{
-    if(0 == num)
-    {
-        m_rBtnDoTime->setChecked(true);
-    }else
-    {
-        m_rBtnDoDay->setChecked(true);
-    }
-}
-
-/**
- * @brief 检查数据库中有没有这个表格,这里正常日和特殊日分开检查,二者的名称不相关
- *        每个表格名称前面有“正常日-”和“特殊日-”区分,因此显示模板名称的时候需要去掉前缀
- * @param tableName
- * @return
- */
-bool ExecPlan::checkDataBaseTableName(const QString &tableName)
-{
-    /* 取出数据库中表格的名称,根据当前是周几,选择性的插入到list中 */
-    QStringList tabList = m_DB.tables();
-    QStringList normalList;
-    QStringList specialList;
-    for(const auto& it : tabList)
-    {
-        /* 去掉前缀 */
-        QString name = it.mid(4,it.count() - 4);
-        if(it.contains("正常日"))
-        {
-            normalList.append(name);
-        }
-        else if(it.contains("特殊日"))
-        {
-            specialList.append(name);
-        }
-    }
-
-    int day = m_stack->currentIndex();
-    if(day < 7)
-    {
-        for(const auto& it : normalList)
-        {
-            if(it == tableName)
-            {
-                return true;
-            }
-        }
-        return false;
-    }else
-    {
-        for(const auto& it : specialList)
-        {
-            if(it == tableName)
-            {
-                return true;
-            }
-        }
-        return false;
-    }
-
-}
-/* 删除一页,num是周几 */
-void ExecPlan::clearOnePage(int num)
-{
-    /* 先检查时间选择器是否在运行 */
-    if(nullptr != m_timeEdit)
-    {
-        delete m_timeEdit;
-        m_timeEdit = nullptr;
-    }
-    if(nullptr != m_dateEdit)
-    {
-        delete m_dateEdit;
-        m_dateEdit = nullptr;
-    }
-    if(m_loop.isRunning())
-    {
-        m_loop.quit();
-    }
-    int count = m_vecItem[num]->count();
-    for(int i = 0;i < count; i++)
-    {
-        /* 根据序号删除 */
-        delete m_vecItem[num]->at(i);
-    }
-    /* 清空数组 */
-    m_vecItem[num]->clear();
-
-}
-/* 当前页的项是否为空 */
-bool ExecPlan::itemIsEmpty()
-{
-    return m_vecItem[m_stack->currentIndex()]->isEmpty();
-}
-
-/* 选择周几 */
-void ExecPlan::do_selectDayOfWeeks()
-{
-    QPushButton* pBtn = qobject_cast<QPushButton*>(sender());
-    /* 清除所有选中效果 */
-    for(int i = 0;i < 8;i++)
-    {
-        m_vecWeeks[i]->setProperty("Pressed",false);
-        m_leftColumn->style()->unpolish(m_vecWeeks[i]);
-        m_leftColumn->style()->polish(m_vecWeeks[i]);
-        if(m_vecWeeks[i] == pBtn)
-        {
-            m_stack->setCurrentIndex(i);
-        }
-    }
-    pBtn->setProperty("Pressed",true);
-    this->style()->unpolish(pBtn);
-    this->style()->polish(pBtn);
-
-}
-
-
-/* 修改了一个设备,主要是修改了名称,将这里的名字也修改掉 */
-void ExecPlan::do_devChanged(const QString &previous, const QString &now)
-{
-    SPDLOG_LOGGER_DEBUG(m_logger,"设备名由“{}”改为了“{}”",previous.toStdString(),now.toStdString());
-
-    for(auto& it : m_vecItem)
-    {
-        for(auto& it1 : *it)
-        {
-            if(it1->getDevName() == previous)
-            {
-                it1->setDevName(now);
-            }
-        }
-    }
-}
-
-/* 删除了一个设备 */
-void ExecPlan::do_devDelete(const QString& devName)
-{
-    SPDLOG_LOGGER_DEBUG(m_logger,"删除了一个设备:{}",devName.toStdString());
-    for(auto& it : m_vecItem)
-    {
-        /* 特别注意,删除特定的list中的内容只能使用传统的for循环,而且i++也要根据情况判断再++,
-         * 如果删除了i位置的一个项,i+1位置的项就会来到i位置,因此这个时候不能再++ */
-        for(int i = 0;i < it->count();)
-        {
-            auto it1 = it->at(i);
-            if(it1->getDevName() == devName)
-            {
-                it1->setParent(nullptr);
-                delete it1;
-                it->removeOne(it1);
-            }else
-            {
-                i++;
-            }
-        }
-    }
-    /* 刷新设备可选项,重新设置可以选择的设备名 */
-    for(auto& it : m_vecItem)
-    {
-        for(auto& it1 : *it)
-        {
-            it1->setDevName(it1->getDevName());
-        }
-    }
-    SortAndRefreshUI();
-}
-
-/* 从EQM获取计划数据 */
-void ExecPlan::do_pBtnGetEQMData()
-{
-    /* 先判断设备是否连接 */
-    if(!GlobalInfo.getConnectState())
-    {
-        Warning w(this);
-        w.setTextWithOneButton("设备未连接!");
-        /* 创建遮罩 */
-        std::shared_ptr<LHMaskWidget> mask = std::make_shared<LHMaskWidget>();
-        mask->SetMainWidget(m_mask);                /* 设置主窗口(被遮盖的窗口) */
-        mask->SetTrigWidget(&w);                    /* 设置触发的窗口 */
-        mask->SetOpacity(float(0.4));               /* 设置透明度 */
-
-        w.exec();
-        return;
-    }
-    /* 判断是否连接上了EQM数据库 */
-    if(!GlobalInfo.isUsingEQM())
-    {
-        Warning w(this);
-        w.setTextWithOneButton("未使用EQM数据库!");
-        /* 创建遮罩 */
-        std::shared_ptr<LHMaskWidget> mask = std::make_shared<LHMaskWidget>();
-        mask->SetMainWidget(m_mask);                /* 设置主窗口(被遮盖的窗口) */
-        mask->SetTrigWidget(&w);                    /* 设置触发的窗口 */
-        mask->SetOpacity(float(0.4));               /* 设置透明度 */
-        
-        w.exec();
-        return;
-    }
-
-    QList<ExecPlanItemInfo> listInfo;
-    GlobalInfo.toEQM.getExecPlanData(listInfo);
-    /* 清空所有的计划 */
-    for(auto& it : m_vecItem)
-    {
-        for(auto& it1 : *it)
-        {
-            delete it1;
-        }
-        it->clear();
-    }
-    /* 更新计划列表 */
-    EQMToHost(listInfo);
-}
-
-/* 点击添加时段按钮 */
-void ExecPlan::do_pBtnAddExecPlan()
-{
-    /* 创建页面,判断是正常日还是特殊日 */
-    if(m_stack->currentIndex() < 7)
-    {
-        std::shared_ptr<AddNormalItem> atf = std::make_shared<AddNormalItem>(this);
-        int x = (m_mainUI->width() - atf->width())/2 + m_mainUI->x();
-        int y = (m_mainUI->height() - atf->height())/2 + m_mainUI->y() + 24;
-        atf->setGeometry(x,y,atf->width(),atf->height());
-        connect(atf.get(),SIGNAL(signal_addNormalItem(QString,QString,QTime)),this,SLOT(do_addNormalOneItem(QString,QString,QTime)));
-
-        atf->exec();
-        atf->setAttribute(Qt::WA_DeleteOnClose,true);
-    }
-    else        /* 特殊日 */
-    {
-        std::shared_ptr<AddSpecialItem> ast = std::make_shared<AddSpecialItem>(this);
-
-        int x = (m_mainUI->width() - ast->width())/2 + m_mainUI->x();
-        int y = (m_mainUI->height() - ast->height())/2 + m_mainUI->y();
-        ast->setGeometry(x,y,ast->width(),ast->height());
-        connect(ast.get(),SIGNAL(signal_AddSpecialItem(QString,QString,QDate,QTime)),this,SLOT(do_addSpecialOneItem(QString,QString,QDate,QTime)));
-
-        ast->exec();
-//        SPDLOG_LOGGER_DEBUG(m_logger,"特殊日添加了一个项,页面关闭了");
-        ast->setAttribute(Qt::WA_DeleteOnClose,true);
-    }
-
-}
-/**
- * @brief 新增一条项,接收新增页面发送过来的信号
- * @param dev
- * @param action
- * @param time
- */
-void ExecPlan::do_addNormalOneItem(QString dev,QString action,QTime time)
-{
-    SPDLOG_LOGGER_INFO(m_logger,"执行计划:普通日添加了一项");
-    /* 获取是周几 */
-    int num = m_stack->currentIndex();
-
-    ExecPlanItem* one = new ExecPlanItem(num);
-//    SPDLOG_LOGGER_INFO(m_logger,"devName:{}",dev.toStdString());
-    one->setDevName(dev);
-    one->setActionName(action);
-    one->setExecTime(time);
-    /* 连接删除项信号,执行时间改变信号 */
-    connect(one,SIGNAL(signal_OneItemDelete(int)),this,SLOT(do_deleteOneItem(int)));
-    connect(one,SIGNAL(signal_execTimeClicked(QTime)),this,SLOT(do_editExecTime(QTime)));
-    connect(one,SIGNAL(signal_devChanged()),this,SLOT(do_editDev()));
-    one->show();
-    m_vecLayout[num]->addWidget(one);       /* 添加到布局 */
-    m_vecItem[num]->push_back(one);
-    /* 根据时间排序并重新显示 */
-    SortAndRefreshUI();
-}
-
-/* 新增一条特殊日期项 */
-void ExecPlan::do_addSpecialOneItem(QString dev, QString action, QDate date, QTime time)
-{
-    SPDLOG_LOGGER_INFO(m_logger,"执行计划:特殊日添加了一项");
-    /* 获取是周几 */
-    int num = m_stack->currentIndex();
-
-    ExecPlanItem* one = new ExecPlanItem(num);
-    one->setDevName(dev);
-    one->setActionName(action);
-    one->setDate(date);
-    one->setExecTime(time);
-    /* 连接删除项信号,执行时间改变信号 */
-    connect(one,SIGNAL(signal_OneItemDelete(int)),this,SLOT(do_deleteOneItem(int)));
-    connect(one,SIGNAL(signal_execTimeClicked(QTime)),this,SLOT(do_editExecTime(QTime)));
-    connect(one,SIGNAL(signal_devChanged()),this,SLOT(do_editDev()));
-    connect(one,SIGNAL(signal_dateClicked(QDate)),this,SLOT(do_editDate(QDate)));
-
-    one->show();
-    m_vecLayout[num]->addWidget(one);       /* 添加到布局 */
-    m_vecItem[num]->push_back(one);
-    /* 根据时间排序并重新显示 */
-    SortAndRefreshUI();
-}
-/* 下载按钮 */
-void ExecPlan::do_download()
-{
-    /* 先检查计划是否是空的,不需要检查 */
-//    bool isEmpty = true;
-//    for(const auto& it : m_vecItem)
-//    {
-//        if(!it->isEmpty())
-//        {
-//            isEmpty = false;
-//        }
-//    }
-//    if(isEmpty)
-//    {
-//        Warning w(this);
-//        w.setTextWithOneButton("至少设置一个计划内容!");
-//        w.exec();
-//        return;
-//    }
-
-    QByteArray ba;
-    PacketRS::AnalyzeExecPlan aep;
-    aep.HostToDev(m_vecItem, ba, this);
-
-    QList<ExecPlanItemInfo>* listInfo = new QList<ExecPlanItemInfo>;
-    HostToEQMJson(m_vecItem, *listInfo);
-    /* 发送给设备 */
-    OneEvent* oe = new OneEvent(CustomEventType::event_sendExecPlan);
-    oe->setData(ba);
-    QApplication::postEvent(DevC,oe);
-    /* 发送给EQM数据库 */
-    // OneEvent* oe1 = new OneEvent(CustomEventType::event_sendToEQM);
-    // auto p = static_cast<void *>(listInfo);
-    // oe1->setData(QVariant::fromValue(p));
-    // QApplication::postEvent(DevC,oe1);
-    if(GlobalInfo.toEQM.insertData(*listInfo))
-    {
-        SPDLOG_LOGGER_INFO(m_logger,"插入EQM数据库成功");
-        OneEvent* oe1 = new OneEvent(CustomEventType::event_Echo);
-        oe1->setData("计划写入EQM数据库成功");
-        QApplication::postEvent(g_uiObject, oe1);
-    }
-    delete listInfo;
-}
-
-/* 清空计划 */
-void ExecPlan::do_clearExecPlan()
-{
-    SPDLOG_LOGGER_DEBUG(m_logger,"清空了当前页的执行计划");
-    /* 清空当前页 */
-//    for(const auto& it : *m_vecItem[m_stack->currentIndex()])
-//    {
-//        delete it;
-//    }
-//    m_vecItem[m_stack->currentIndex()]->clear();
-    clearOnePage(m_stack->currentIndex());
-}
-
-/* 保存模版 */
-void ExecPlan::do_saveTemplate()
-{
-    std::shared_ptr<SaveToTemplate> stt = std::make_shared<SaveToTemplate>(PageType::PageExecPlan,this);
-    int x = (m_mainUI->width() - stt->width())/2 + m_mainUI->x();
-    int y = (m_mainUI->height() - stt->height())/2 + m_mainUI->y();
-    stt->setGeometry(x,y,stt->width(),stt->height());
-    connect(stt.get(),SIGNAL(signal_templateName(QString)),this,SLOT(do_saveTemplateToSQL(QString)));
-
-    /* 创建遮罩 */
-    std::shared_ptr<LHMaskWidget> mask = std::make_shared<LHMaskWidget>();
-    mask->SetMainWidget(m_mask);                /* 设置主窗口(被遮盖的窗口) */
-    mask->SetTrigWidget(stt.get());             /* 设置触发的窗口 */
-    mask->SetOpacity(float(0.4));
-
-    stt->exec();
-}
-
-/* 导入模板按钮 */
-void ExecPlan::do_importTemplate()
-{
-    /* 取出数据库中表格的名称,根据当前是周几,选择性显示 */
-    QStringList tabList = m_DB.tables();
-    QStringList normalList;
-    QStringList specialList;
-    for(const auto& it : tabList)
-    {
-        /* 去掉前缀 */
-        QString name = it.mid(4,it.count() - 4);
-        if(it.contains("正常日"))
-        {
-            normalList.append(name);
-        }
-        else if(it.contains("特殊日"))
-        {
-            specialList.append(name);
-        }
-    }
-
-    int day = m_stack->currentIndex();
-
-    std::shared_ptr<ImportTemplate> itl = std::make_shared<ImportTemplate>(day < 7 ? normalList : specialList , this);
-    int x = (m_mainUI->width() - itl->width())/2 + m_mainUI->x();
-    int y = (m_mainUI->height() - itl->height())/2 + m_mainUI->y();
-    itl->setGeometry(x,y,itl->width(),itl->height());
-    connect(itl.get(),SIGNAL(signal_templateName(QString)),this,SLOT(do_importTemplateFromSQL(QString)));
-    connect(itl.get(),SIGNAL(signal_deleteTemplate(QString)),this,SLOT(do_deleteTemplateFromSQL(QString)));
-
-    /* 创建遮罩 */
-    std::shared_ptr<LHMaskWidget> mask = std::make_shared<LHMaskWidget>();
-    mask->SetMainWidget(m_mask);                /* 设置主窗口(被遮盖的窗口) */
-    mask->SetTrigWidget(itl.get());             /* 设置触发的窗口 */
-    mask->SetOpacity(float(0.4));
-
-    itl->exec();
-}
-
-/* 将数据保存到数据库中 */
-void ExecPlan::do_saveTemplateToSQL(QString name)
-{
-    SPDLOG_LOGGER_INFO(m_logger,"开始保存数据到数据库:{}",name.toStdString());
-    if(!m_DB.isValid())
-    {
-        SPDLOG_LOGGER_INFO(m_logger,"数据库未打开");
-        return;
-    }
-    /* 创建一个表格 */
-    QSqlQuery query(m_DB);
-    /**
-     * 表格保存一周8天的所有项,使用weekDay表示周几,1-7是周一到周日,8是特殊日
-     * 在这里添加模版名称前缀
-     */
-    int weekDay = m_stack->currentIndex();
-    if(weekDay < 7)
-    {
-        name.insert(0,"正常日-");
-    }else
-    {
-        name.insert(0,"特殊日-");
-    }
-    QString createTable = QString("CREATE TABLE `%1` ("
-                                  "`weekDay` INT,"
-                                  "`num` INT,"
-                                  "`devName` VARCHAR(20),"
-                                  "`devType` INT,"
-                                  "`date` DATE,"
-                                  "`ExecTime` TIME,"
-                                  "`Action` VARCHAR(20))").arg(name);
-
-    if(query.exec(createTable))
-    {
-        SPDLOG_LOGGER_INFO(m_logger,"创建成功");
-    }else
-    {
-        SPDLOG_LOGGER_INFO(m_logger,"创建表格失败:{}",query.lastError().text().toStdString());
-    }
-    /* 将数据存储到表格中 */
-    QString insertData = QString("INSERT INTO `%1` (`weekDay`,`num`,`devName`,`devType`,`date`,`ExecTime`,`Action`)"
-                                 "VALUES (:weekDay,:num,:devName,:devType,:date,:ExecTime,:Action)").arg(name);
-
-    query.prepare(insertData);
-
-    int cfgNum = DevInfo.cfgDevInfo().count();
-    for(auto& it : *m_vecItem[weekDay])
-    {
-        query.bindValue(":weekDay",weekDay);
-        query.bindValue(":num",it->getNum());
-        query.bindValue(":devName",it->getDevName());
-        /* 这里设置为0主要是为了防止没有设置设备,保存模板时会导致程序崩溃 */
-        query.bindValue(":devType",(cfgNum == 0 ? 0 : it->getCfgDev()->DevType.getDevTypeIDToInt()));
-        query.bindValue(":date",it->getDate().toString("yyyy-MM-dd"));
-        query.bindValue(":ExecTime",it->getExecTime().toString("hh:mm:ss"));
-        query.bindValue(":Action",it->getActionName());
-
-        if(!query.exec())
-        {
-            SPDLOG_LOGGER_INFO(m_logger,"数据插入失败:{}",query.lastError().text().toStdString());
-        }
-    }
-    /* 弱提示,保存成功 */
-    TipWidget::display(TipWidget::OPERATOR_OK,"保存模板成功!",m_mainUI);
-}
-/* 导入模板 */
-void ExecPlan::do_importTemplateFromSQL(QString name)
-{
-    SPDLOG_LOGGER_DEBUG(m_logger,"选择的模版:{}",name.toStdString());
-    /* 当前是周几 */
-    int weekDay = m_stack->currentIndex();
-    /* 清空内容 */
-    for(auto& it1 : *m_vecItem[weekDay])
-    {
-        delete it1;
-    }
-    m_vecItem[weekDay]->clear();
-    /* 给名称添加前缀 */
-    if(weekDay < 7)
-    {
-        name.insert(0,"正常日-");
-    }else
-    {
-        name.insert(0,"特殊日-");
-    }
-    QSqlQuery query(m_DB);
-    QString sqliteCmd = QString("SELECT * FROM `%1`").arg(name);
-    if(!query.exec(sqliteCmd))
-    {
-        SPDLOG_LOGGER_INFO(m_logger,"读取表格失败:{}",query.lastError().text().toStdString());
-    }
-    while(query.next())
-    {
-        QSqlRecord rec = query.record();
-        int weekDay = rec.value("weekDay").toInt();
-        if(weekDay < 7)
-        {
-            /* 将weekDay换成真正的周几,前面的if只是判断是不是正常日 */
-            weekDay = m_stack->currentIndex();
-            ExecPlanItem* item = new ExecPlanItem(weekDay, m_stack->widget(weekDay));
-            item->setNum(rec.value("num").toInt());
-
-            QString devName = rec.value("devName").toString();
-            item->setDevName(devName);
-
-            QTime time = QTime::fromString(rec.value("ExecTime").toString());
-            item->setExecTime(time);
-
-            item->setActionName(rec.value("Action").toString());
-//            SPDLOG_LOGGER_DEBUG(m_logger,"Action:{}",rec.value("Action").toString().toStdString());
-
-            QApplication::connect(item,SIGNAL(signal_OneItemDelete(int)),this,SLOT(do_deleteOneItem(int)));
-            QApplication::connect(item,SIGNAL(signal_execTimeClicked(QTime)),this,SLOT(do_editExecTime(QTime)));
-            QApplication::connect(item,SIGNAL(signal_devChanged()),this,SLOT(do_editDev()));
-            m_vecLayout[weekDay]->addWidget(item);
-            m_vecItem[weekDay]->push_back(item);
-        }
-        else
-        {
-            weekDay = m_stack->currentIndex();
-            ExecPlanItem* item = new ExecPlanItem(weekDay, m_stack->widget(weekDay));
-            item->setNum(rec.value("num").toInt());
-
-            item->setDevName(rec.value("devName").toString());
-
-            QDate date = QDate::fromString(rec.value("date").toString(),"yyyy-MM-dd");
-            item->setDate(date);
-
-            QTime time = QTime::fromString(rec.value("ExecTime").toString());
-            item->setExecTime(time);
-
-            item->setActionName(rec.value("Action").toString());
-
-            QApplication::connect(item,SIGNAL(signal_OneItemDelete(int)),this,SLOT(do_deleteOneItem(int)));
-            QApplication::connect(item,SIGNAL(signal_execTimeClicked(QTime)),this,SLOT(do_editExecTime(QTime)));
-            QApplication::connect(item,SIGNAL(signal_devChanged()),this,SLOT(do_editDev()));
-            QApplication::connect(item,SIGNAL(signal_dateClicked(QDate)),this,SLOT(do_editDate(QDate)));
-
-            m_vecLayout[weekDay]->addWidget(item);
-            m_vecItem[weekDay]->push_back(item);
-        }
-    }
-    /* 刷新UI */
-    SortAndRefreshUI();
-    /* 弱提示,导入成功 */
-    TipWidget::display(TipWidget::OPERATOR_OK,"导入模版成功!",m_mainUI);
-}
-
-void ExecPlan::do_deleteTemplateFromSQL(QString name)
-{
-    QSqlQuery query(m_DB);
-    /* 给名称添加前缀 */
-    int weekDay = m_stack->currentIndex();
-    if(weekDay < 7)
-    {
-        name.insert(0,"正常日-");
-    }else
-    {
-        name.insert(0,"特殊日-");
-    }
-    QString cmd = QString("DROP TABLE `%1`").arg(name);
-    if(query.exec(cmd))
-    {
-        SPDLOG_LOGGER_INFO(m_logger,"删除模版 {} 成功",name.toStdString());
-        /* 弱提示,删除成功 */
-        TipWidget::display(TipWidget::OPERATOR_OK,"删除模版成功!",m_mainUI);
-    }else
-    {
-        SPDLOG_LOGGER_INFO(m_logger,"删除模版失败,error:",query.lastError().text().toStdString());
-        /* 弱提示,删除失败 */
-        TipWidget::display(TipWidget::OPERATOR_FAIL,"删除模板失败!",m_mainUI);
-    }
-}
-
-/* 删除一个项 */
-void ExecPlan::do_deleteOneItem(int num)
-{
-    /* 先检查时间选择器是否在运行 */
-    if(nullptr != m_timeEdit)
-    {
-        delete m_timeEdit;
-        m_timeEdit = nullptr;
-    }
-    if(nullptr != m_dateEdit)
-    {
-        delete m_dateEdit;
-        m_dateEdit = nullptr;
-    }
-    if(m_loop.isRunning())
-    {
-        m_loop.quit();
-    }
-
-    /* 根据序号删除 */
-    delete m_vecItem[m_stack->currentIndex()]->at(num-1);
-    m_vecItem[m_stack->currentIndex()]->removeAt(num-1);
-    /* 重新排序 */
-    SortAndRefreshUI();
-}
-/**
- * @brief 修改执行时间,在增加项的地方连接信号
- * @param t 当前现实的时间
- */
-void ExecPlan::do_editExecTime(QTime t)
-{
-    if(m_dateEdit != nullptr)
-    {
-        delete m_dateEdit;
-        m_dateEdit = nullptr;
-    }
-    if(m_timeEdit != nullptr)
-    {
-        delete m_timeEdit;
-        m_timeEdit = nullptr;
-    }
-    if(m_loop.isRunning())
-    {
-        m_loop.quit();
-    }
-
-    SPDLOG_LOGGER_DEBUG(m_logger,"修改执行时间");
-    auto s = dynamic_cast<ExecPlanItem*>(sender());
-    s->hideWarn();
-    m_timeEdit = new TimeWidget(this,TimeWidget::Dialog);
-
-    /* 覆盖住选择框,需要判断是否是特殊日 */
-    QPoint p2 = mapToParent(s->pos());
-    int x = 0;
-    int y = 0;
-    if(m_stack->currentIndex() < 7)
-    {
-        /* 这里的-2是时间选择框比item的框大4,所以可以将其覆盖住 */
-        x = p2.x() + 534 - 2;
-    }else
-    {
-        x = p2.x() + 682 -2;
-    }
-    /* p2是结束时间框,70是当前页面距离ExecPlan顶部的距离,最后一个是滚动条滚动的距离 */
-    y = p2.y() + 116 - 2 - m_vecScrollArea[m_stack->currentIndex()]->scrollBarValue();
-    m_timeEdit->move(x,y);
-    /* 设置样式表 */
-    // m_timeEdit->setStyleSheet(R"(background: transparent;
-    //                         border-radius: 4px;
-    //                         padding-left:12px;
-    //                         border: 1px solid #E6E9F4;)");
-
-    /* 设置当前显示的时间 */
-    m_timeEdit->setTime(t);
-
-    /* 选择结束后的信号和槽 */
-    connect(m_timeEdit,&TimeWidget::signal_nowTime,this,[&](QTime t1){
-        if(s->getDateType() == DateType::NormalDate)
-        {
-            /* 进行时间重复检测 */
-            if(judgeTimeRepetition(*m_vecItem[m_stack->currentIndex()],s,t1))
-            {
-                s->setWarningText("时间冲突");
-
-                delete m_timeEdit;
-                m_timeEdit = nullptr;
-                m_loop.quit();
-                return;
-            }
-            s->setExecTime(t1);
-        }else
-        {
-            if(judgeDateTimeRepetition(*m_vecItem[m_stack->currentIndex()],s,t1))
-            {
-                s->setWarningText("时间冲突");
-
-                delete m_timeEdit;
-                m_timeEdit = nullptr;
-                m_loop.quit();
-                return;
-            }
-            s->setExecTime(t1);
-        }
-        s->hideWarn();
-        /* 重新排序并刷新时间 */
-        SortAndRefreshUI();
-
-        m_loop.quit();
-    });
-
-    m_timeEdit->showTimeEditArea();
-    m_loop.exec();
-    delete m_timeEdit;
-    m_timeEdit = nullptr;
-}
-
-/* 修改日期 */
-void ExecPlan::do_editDate(QDate d)
-{
-    if(m_timeEdit != nullptr)
-    {
-        delete m_timeEdit;
-        m_timeEdit = nullptr;
-    }
-    if(m_dateEdit != nullptr)
-    {
-        delete m_dateEdit;
-        m_dateEdit = nullptr;
-    }
-    if(m_loop.isRunning())
-    {
-        m_loop.quit();
-    }
-
-    auto s = dynamic_cast<ExecPlanItem*>(sender());
-    s->hideWarn();
-    m_dateEdit = new CDate(d,this);
-    /* 移动组件位置,需要判断是否是特殊日 */
-    QPoint p2 = mapToParent(s->pos());
-
-    int x = 0;
-    int y = 0;
-    /* 已经滚动上去的距离 */
-    int scrValue = m_vecScrollArea[m_stack->currentIndex()]->scrollBarValue();
-    /* 这里的-2是时间选择框比item的框大4,所以可以将其覆盖住 */
-    x = p2.x() + 520;
-
-    /* p2是结束时间框,102是当前页面距离Broadcast顶部的距离,最后一个是滚动条滚动的距离 */
-    y = p2.y() + 140 - scrValue;
-    /* 240是当前页面的前六条坐标,日历可以正常显示,后面三条就得设置向上显示了 */
-    if(p2.y() - scrValue > 260)
-    {
-        /* 整体向上抬日立的高度和date窗口的高度 */
-        y = y - m_dateEdit->height() - 16;
-    }
-
-    m_dateEdit->move(x,y);
-    /* 选择结束后的信号和槽 */
-    connect(m_dateEdit,&CDate::signal_DateChanged,[&](QDate d1){
-
-        if(s->getDateType() == DateType::SpecialDate)
-        {
-            /* 进行时间重复检测 */
-            if(judgeDateTimeRepetition(*m_vecItem[m_stack->currentIndex()],s,d1))
-            {
-                s->setWarningText("时间重复");
-                return;
-            }
-            s->setDate(d1);
-        }
-        s->hideWarn();
-        /* 重新排序并刷新时间 */
-        SortAndRefreshUI();
-        m_loop.quit();
-    });
-
-    m_dateEdit->show();
-    m_loop.exec();
-    delete m_dateEdit;
-    m_dateEdit = nullptr;
-}
-/* 修改了设备 */
-void ExecPlan::do_editDev()
-{
-    auto s = qobject_cast<ExecPlanItem*>(sender());
-
-    /* 判断特殊日还是正常日 */
-    if(s->getDateType() == DateType::NormalDate)
-    {
-        if(judgeTimeRepetition(*m_vecItem[m_stack->currentIndex()],s))
-        {
-            s->setWarningText("设备动作时间重复",0);
-            return;
-        }
-    }else
-    {
-        if(judgeDateTimeRepetition(*m_vecItem[m_stack->currentIndex()],s))
-        {
-            s->setWarningText("设备动作时间重复",0);
-            return;
-        }
-    }
-
-    s->hideWarn();
-    /* 重新排序 */
-    SortAndRefreshUI();
-}
-/* 配置完成的设备改变了 */
-void ExecPlan::do_cfgDevChanged()
-{
-    for(const auto& it1 : m_vecItem)
-    {
-        for(const auto& it2 : *it1)
-        {
-            it2->setDevName(it2->getDevName());
-        }
-    }
-}
-/* 绘图事件 */
-void ExecPlan::paintEvent(QPaintEvent *event)
-{
-    /* 绘制外边框 */
-    QPainter painter(this);
-    QPen pen;
-    pen.setColor(QColor(218, 224, 242));
-    pen.setWidth(1);
-    painter.setPen(pen);
-    painter.drawRect(24,70,1824,539);
-}
-
-bool ExecPlan::eventFilter(QObject *watched, QEvent *event)
-{
-    /* 判断是哪个控件 */
-    if(watched == m_labelTip)
-    {
-        if(event->type() == QEvent::Enter)
-        {
-            m_TipText->show();
-            return true;
-        }
-        else if(event->type() == QEvent::Leave)
-        {
-            m_TipText->hide();
-        }
-    }
-    return QWidget::eventFilter(watched,event);
-}
-
-/* 根据时间排序,并刷新UI */
-void ExecPlan::SortAndRefreshUI()
-{
-    /* 将当前页,按时间升序排序 */
-    std::sort(m_vecItem[m_stack->currentIndex()]->begin(),
-        m_vecItem[m_stack->currentIndex()]->end(),
-        [&](ExecPlanItem* t1,ExecPlanItem* t2) {
-            /* 按照日期排序,再按照名称排序 */
-            if(t1->getDate() < t2->getDate())
-            {
-                return true;
-            }
-            else if(t1->getDate() > t2->getDate())
-            {
-                return false;
-            }
-            else
-            {
-                if(t1->getExecTime() < t2->getExecTime())
-                {
-                    return true;
-                }
-                else if(t1->getExecTime() > t2->getExecTime())
-                {
-                    return false;
-                }else
-                {
-                    return t1->getDevName() < t2->getDevName();
-                }
-            }
-        });
-    int index = m_stack->currentIndex();
-    /* 设置序号 */
-    int num1 = 1;
-    for(auto& it : *m_vecItem[index])
-    {
-        it->setNum(num1);
-        num1++;
-    }
-    /* 刷新UI,先清空layout中的所有控件,就是将item的父指针设置为0 */
-    num1 = 0;
-    for(auto& it : *m_vecItem[index])
-    {
-        it->setParent(nullptr);
-    }
-    /* 将item重新加入到layout中 */
-    for(auto& it : *m_vecItem[index])
-    {
-        m_vecLayout[index]->addWidget(it);
-    }
-}
-
-/* 根据时间排序,并刷新UI */
-void ExecPlan::SortAndRefreshUI(int index)
-{
-    if(index > 7)
-    {
-        return;
-    }
-    /* 将当前页,按时间升序排序 */
-    std::sort(m_vecItem[index]->begin(), m_vecItem[index]->end(), [&](ExecPlanItem* t1,ExecPlanItem* t2) 
-        {
-            /* 按照日期排序,再按照名称排序 */
-            if(t1->getDate() < t2->getDate())
-            {
-                return true;
-            }
-            else if(t1->getDate() > t2->getDate())
-            {
-                return false;
-            }
-            else
-            {
-                if(t1->getExecTime() < t2->getExecTime())
-                {
-                    return true;
-                }
-                else if(t1->getExecTime() > t2->getExecTime())
-                {
-                    return false;
-                }else
-                {
-                    return t1->getDevName() < t2->getDevName();
-                }
-            }
-        });
-    /* 设置序号 */
-    int num1 = 1;
-    for(auto& it : *m_vecItem[index])
-    {
-        it->setNum(num1);
-        num1++;
-    }
-    /* 刷新UI,先清空layout中的所有控件,就是将item的父指针设置为0 */
-    num1 = 0;
-    for(auto& it : *m_vecItem[index])
-    {
-        it->setParent(nullptr);
-    }
-    /* 将item重新加入到layout中 */
-    for(auto& it : *m_vecItem[index])
-    {
-        m_vecLayout[index]->addWidget(it);
-    }
-}
-
-void ExecPlan::createDataBase()
-{
-    /* 连接数据库 */
-    QString dataName = GlobalInfo.ExecPath() + GlobalInfo.DataBasePath + "ExecPlan.db";
-    /* 第二个参数ExecPlan应该是数据库在Qt中的名字? */
-    m_DB = QSqlDatabase::addDatabase("QSQLITE","ExecPlan");
-    m_DB.setDatabaseName(dataName);
-
-    if(!m_DB.open())
-    {
-        SPDLOG_LOGGER_INFO(m_logger,"{}打开失败:{}",dataName.toStdString(),m_DB.lastError().text().toStdString());
-        return;
-    }
-}
-
-/* 本地配置转换成发送的结构体 */
-void ExecPlan::HostToEQMJson(QVector<QList<ExecPlanItem*>*>& cfgVec, QList<ExecPlanItemInfo>& listInfo)
-{
-    for(const auto& it : cfgVec)
-    {
-        for(const auto& it1 : *it)
-        {
-            ExecPlanItemInfo info;
-            info.ExecType = getExecMode();
-            info.WeekDay = it1->getWeekDay() + 1;   /* 转换成1-7表示周1-周日 */
-            info.date = it1->getDate();
-            info.execTime = it1->getExecTime();
-            info.devName = it1->getDevName();
-            info.actionID = it1->getActionNum();
-            info.actionName = it1->getActionName();
-            // info.dateType = it1->getDateType();
-            info.cfgDev = it1->getCfgDev();
-
-            listInfo.append(info);
-        }
-    }
-}
-
-
-/**
- * @brief 添加从EQM获取到的数据
- * 
- * @param listInfo 
- */
-void ExecPlan::EQMToHost(QList<ExecPlanItemInfo>& listInfo)
-{
-    for(auto& it : listInfo)
-    {
-        ExecPlanItem* item = nullptr;
-        if(it.WeekDay < 7)
-        {
-            item = new ExecPlanItem(it.WeekDay, this);
-        }else
-        {
-            item = new ExecPlanItem(it.WeekDay, this);
-        }
-        item->setDate(it.date);
-        item->setExecTime(it.execTime);
-        item->setDevName(it.devName);
-        item->setActionName(it.actionName);
-        item->setActionNum(it.actionID);
-
-        connect(item,SIGNAL(signal_OneItemDelete(int)),this,SLOT(do_deleteOneItem(int)));
-        connect(item,SIGNAL(signal_execTimeClicked(QTime)),this,SLOT(do_editExecTime(QTime)));
-        connect(item,SIGNAL(signal_devChanged()),this,SLOT(do_editDev()));
-        connect(item,SIGNAL(signal_dateClicked(QDate)),this,SLOT(do_editDate(QDate)));
-
-        m_vecLayout[it.WeekDay]->addWidget(item);
-        m_vecItem[it.WeekDay]->push_back(item);
-    }
-    /* 排序并添加序号 */
-    for(int i = 0;i < 8;i++)
-    {
-        SortAndRefreshUI(i);
-    }
-    OneEvent* oe = new OneEvent(CustomEventType::event_Echo);
-    oe->setData("获取EQM执行计划成功");
-    QApplication::postEvent(g_uiObject, oe);
-}
-
-

+ 0 - 134
demo/ExecPlan.h

@@ -1,134 +0,0 @@
-#ifndef EXECPLAN_H
-#define EXECPLAN_H
-
-#include <QWidget>
-#include <QStackedWidget>
-#include <QPushButton>
-#include <QLabel>
-#include <QTime>
-#include <QList>
-#include <QDate>
-#include <QRadioButton>
-#include <QEventLoop>
-
-#include "spdlog/spdlog.h"
-#include "UI/ExecPlan/ExecPlanItem.h"
-
-class Widget;
-class AddNormalItem;
-class AddSpecialItem;
-class ScrollWidget;
-class TimeWidget;
-class CDate;
-
-class ExecPlan : public QWidget
-{
-    Q_OBJECT
-    friend AddNormalItem;
-    friend AddSpecialItem;
-public:
-    explicit ExecPlan(Widget* mainUI = nullptr,QWidget* mask = nullptr,QWidget* parent = nullptr);
-    ~ExecPlan();
-
-    bool judgeTimeRepetition(QList<ExecPlanItem*>& list,const QString& devName,const QTime& time);  /* 判断时间是否重复 */
-    bool judgeTimeRepetition(QList<ExecPlanItem*>& list,ExecPlanItem* item);                        /* 判断时间是否重复 */
-    bool judgeTimeRepetition(QList<ExecPlanItem*>& list,ExecPlanItem* item,const QTime& time);      /* 判断时间是否重复 */
-    bool judgeDateTimeRepetition(QList<ExecPlanItem*>& list,const QString& devName,const QDate& date,const QTime& time); /* 判断日期时间是否重复 */
-    bool judgeDateTimeRepetition(QList<ExecPlanItem*>& list,ExecPlanItem* item,const QTime& time);  /* 判断日期时间是否重复 */
-    bool judgeDateTimeRepetition(QList<ExecPlanItem*>& list,ExecPlanItem* item,const QDate& date);  /* 判断日期时间是否重复 */
-    bool judgeDateTimeRepetition(QList<ExecPlanItem*>& list,ExecPlanItem* item);                    /* 判断日期时间是否重复 */
-    char getDefaultPlan();                              /* 获取默认计划 */
-    char getExecMode();                                 /* 获取执行模式 */
-    QVector<QList<ExecPlanItem*>*>& vecItem();          /* 获取计划容器 */
-    QStackedWidget* stackWidget();                      /* 获取stackWidget的指针 */
-    QVector<QLayout*>& layout();                        /* 获取显示项的layout */
-
-    void SortAndRefreshUI();                            /* 根据时间排序,并刷新UI */
-    void SortAndRefreshUI(int index);                   /* 根据时间排序,并刷新UI */
-
-    void setDefaultPlan(int num);                       /* 设置默认计划 */
-    void setTimeOrDay(int num);                         /* 按时刻还是按天 */
-    bool checkDataBaseTableName(const QString& tableName);/* 检查数据库中有没有这个表格 */
-    void clearOnePage(int num);                         /* 删除一页 */
-    bool itemIsEmpty();                                 /* 当前页的项是否为空 */
-
-signals:
-    void signal_refreshUIAgain();
-
-public slots:
-    void do_selectDayOfWeeks();                         /* 选择周几 */
-    void do_devChanged(const QString& previous,const QString& now); /* 修改了一个设备 */
-
-private slots:
-    void do_pBtnAddExecPlan();                          /* 点击添加时段按钮 */
-    void do_addNormalOneItem(QString dev,QString action,QTime time);/* 新增一条正常日期项 */
-    void do_addSpecialOneItem(QString dev,QString action,QDate date,QTime time);/* 新增一条特殊日期项 */
-    void do_download();                                 /* 下载按钮 */
-    void do_clearExecPlan();                            /* 清空计划 */
-    void do_saveTemplate();                             /* 保存模版 */
-    void do_importTemplate();                           /* 导入模板按钮 */
-    void do_saveTemplateToSQL(QString name);            /* 将数据保存到数据库中 */
-    void do_importTemplateFromSQL(QString name);        /* 导入模板 */
-    void do_deleteTemplateFromSQL(QString name);        /* 删除模版 */
-
-
-    void do_deleteOneItem(int num);                     /* 删除一个项 */
-    void do_editExecTime(QTime t);                      /* 修改执行时间 */
-    void do_editDate(QDate d);                          /* 修改日期 */
-    void do_editDev();                                  /* 修改了设备 */
-    void do_cfgDevChanged();                            /* 配置好的设备改变了 */
-    void do_devDelete(const QString& devName);          /* 删除了一个配置好的设备 */
-
-    void do_pBtnGetEQMData();                           /* 从EQM获取计划数据 */
-
-protected:
-    void paintEvent(QPaintEvent *event);
-    bool eventFilter(QObject *watched, QEvent *event);
-
-private:
-    void uiSupplement();                                /* 补充UI */
-    void createDataBase();                              /* 连接SQLite数据库 */
-    /* 本地配置转换成发送的结构体 */
-    void HostToEQMJson(QVector<QList<ExecPlanItem*>*>& cfgVec, QList<ExecPlanItemInfo>& listInfo);
-    /* 添加从EQM获取到的数据 */
-    void EQMToHost(QList<ExecPlanItemInfo>& listInfo);
-
-private:
-    /* UI类 */
-    std::shared_ptr<spdlog::logger> m_logger = nullptr;
-    Widget* m_mainUI = nullptr;                         /* 父窗口指针 */
-    QWidget* m_mask = nullptr;                          /* 遮罩页面 */
-    QWidget* m_leftColumn = nullptr;                    /* 左边栏 */
-    QStackedWidget* m_stack = nullptr;                  /* 内容容器 */
-
-    QPushButton* m_pBtnAddItem = nullptr;               /* 添加时段按钮 */
-    QPushButton* m_pBtnClearExecPlan = nullptr;         /* 清空时段按钮 */
-    QPushButton* m_pBtnImportTemplate = nullptr;        /* 导入模版 */
-    QPushButton* m_pBtnSaveTemplate = nullptr;          /* 保存为模版 */
-    QPushButton* m_pBtnGetEQMData = nullptr;            /* 从EQM获取计划数据 */
-
-    QLabel* m_labelButtomLine = nullptr;                /* 底部分割线 */
-    QPushButton* m_pBtnDownload = nullptr;              /* 下载按钮 */
-    QPushButton* m_pBtnDefault = nullptr;               /* 默认计划 */
-    QRadioButton* m_rBtnDoTime = nullptr;               /* 按时刻 */
-    QRadioButton* m_rBtnDoDay = nullptr;                /* 按天 */
-    QLabel* m_TipText = nullptr;                        /* 提示文本 */
-    QLabel* m_labelTip = nullptr;                       /* 提示的感叹号小图标 */
-
-    /* 容器 */
-    QVector<QPushButton*> m_vecWeeks;                   /* 保存一周8天的按钮 */
-    QVector<QList<ExecPlanItem*>*> m_vecItem;           /* 存储一周8天的列表指针,每个列表存储着这一天的时间段 */
-    QVector<QLayout*> m_vecLayout;                      /* 这个数组里面的widget是真正显示项的Layout,这个Layout会自动出现滚动条 */
-    QSqlDatabase m_DB;
-    QVector<ScrollWidget*> m_vecScrollArea;             /* 存储QScrollArea */
-
-    /* 时间和日历选择相关 */
-    QEventLoop m_loop;                                  /* 阻塞时间选择器 */
-    TimeWidget* m_timeEdit = nullptr;                   /* 时间选择 */
-    CDate* m_dateEdit = nullptr;                        /* 日期选择 */
-
-//    bool m_first;                                       /* 记录是不是第一次进入这个页面 */
-};
-
-
-#endif /* EXECPLAN_H */

+ 0 - 384
demo/ExecPlanItem.cpp

@@ -1,384 +0,0 @@
-#include "ExecPlanItem.h"
-#include <QDebug>
-#include <QEvent>
-#include <QMouseEvent>
-#include <QListView>
-#include <QVariant>
-
-
-ExecPlanItem::ExecPlanItem(int weekDay, QWidget *parent) : QWidget(parent), m_weekDay(weekDay)
-{
-    this->setMinimumHeight(48);
-    if(m_weekDay < 7)
-    {
-        m_dateType = DateType::NormalDate;
-    } else
-    {
-        m_dateType = DateType::SpecialDate;
-    }
-
-    m_logger = spdlog::get("ExecPlan");
-    if(nullptr == m_logger)
-    {
-        qDebug() << "ExecPlan获取logger失败";
-    }
-    /* 变量初始化 */
-    m_date.setDate(0,0,0);
-    m_execTime.setHMS(0,0,0);
-    m_devName.clear();
-    m_actionName.clear();
-
-    /* UI图标初始化 */
-    m_labelWarning = new QLabel(this);
-    m_warnTimer = new QTimer(this);
-    m_labelNum = new QLabel(this);
-    m_labelDate = new QLabel(this);
-    m_labelExecTime = new QLabel(this);
-    m_delete = new QLabel(this);
-    m_labelDateIcon = new QLabel(this);
-    m_labelTimeIcon = new QLabel(this);
-    m_comBoxDev = new CustomComboBox(this);
-    m_comBoxAction = new CustomComboBox(this);
-
-    /* 设置大小和布局 */
-    int w = m_dateType == DateType::NormalDate ? 828 : 976;
-    resize(w,48);
-
-    m_labelNum->resize(80,32);
-    m_comBoxDev->resize(260,32);
-    m_labelDate->resize(132,32);
-    m_labelDateIcon->resize(16,16);
-    m_labelDate->setText("2024-4-22");
-    m_comBoxAction->resize(260,32);
-    m_labelExecTime->resize(132,32);
-    m_labelExecTime->setText("00:00:00");
-    m_labelTimeIcon->resize(16,16);
-    m_delete->resize(32,32);
-    /* 警告label */
-    m_labelWarning->resize(300,16);
-    m_labelWarning->move(96,0);
-    /* 根据是否是特殊日布局 */
-    if(m_dateType == DateType::NormalDate)
-    {
-        m_labelDate->hide();
-        m_labelDateIcon->hide();
-
-        m_labelNum->move(0,16);
-        m_comBoxDev->move(96,16);
-        m_labelExecTime->move(372,16);
-        m_labelTimeIcon->move(480,24);
-        m_comBoxAction->move(520,16);
-        m_delete->move(796,16);
-    }else
-    {
-        m_labelNum->move(0,16);
-        m_comBoxDev->move(96,16);
-        m_labelDate->move(372,16);
-        m_labelDateIcon->move(480,24);
-        m_labelExecTime->move(520,16);
-        m_labelTimeIcon->move(628,24);
-        m_comBoxAction->move(668,16);
-        m_delete->move(944,16);
-    }
-
-    /* 设置样式表 */
-    m_labelNum->setObjectName("Num");
-    m_labelDate->setObjectName("Date");
-    m_labelDateIcon->setObjectName("DateIcon");
-    m_labelExecTime->setObjectName("ExecTime");
-    m_labelTimeIcon->setObjectName("TimeIcon");
-    m_delete->setObjectName("Delete");
-    m_labelWarning->setObjectName("Warning");
-    m_comBoxDev->setObjectName("Dev");
-    m_comBoxAction->setObjectName("Action");
-
-    /* 加载QSS */
-    QFile file(":/qss/qss/PageExecPlan/ExecPlanItem.qss");
-    if(file.open(QFile::ReadOnly))
-    {
-        QString styleSheet = file.readAll();
-        this->setStyleSheet(styleSheet);
-        file.close();
-    }else
-    {
-        SPDLOG_LOGGER_ERROR(m_logger,"打开QSS文件失败");
-    }
-
-    /* 设置comboBox下拉框阴影 */
-    m_comBoxDev->setViewShadowEffect();
-    m_comBoxAction->setViewShadowEffect();
-    
-
-    /* 警告定时器设置 */
-    m_warnTimer->setInterval(5000);
-    m_warnTimer->setSingleShot(true);
-    connect(m_warnTimer,&QTimer::timeout,this,[this](){
-        m_labelWarning->hide();
-    });
-
-    /* 将时间和日期图标设置到底层,不影响点击 */
-    m_labelDateIcon->lower();
-    m_labelTimeIcon->lower();
-
-    /* 注册事件过滤 */
-    m_delete->installEventFilter(this);
-    m_labelDate->installEventFilter(this);
-    m_labelExecTime->installEventFilter(this);
-
-    m_comBoxDev->installEventFilter(this);
-    m_comBoxAction->installEventFilter(this);
-
-    /* 连接信号和槽 */
-    connect(m_comBoxDev,QOverload<const QString&>::of(&QComboBox::textActivated),this, &ExecPlanItem::do_devChanged);
-    connect(m_comBoxAction,QOverload<const QString&>::of(&QComboBox::currentTextChanged),this,&ExecPlanItem::do_actionChanged);
-
-
-
-}
-/* 删除前,取消所有关联的信号和槽 */
-ExecPlanItem::~ExecPlanItem()
-{
-    disconnect(this);
-}
-/* 设置序号 */
-void ExecPlanItem::setNum(int num)
-{
-    m_num = num;
-    m_labelNum->setText(QString::asprintf("%d",num));
-}
-/* 获取序号 */
-int ExecPlanItem::getNum()
-{
-    return m_num;
-}
-/* 设置日期 */
-void ExecPlanItem::setDate(const QDate &date)
-{
-    m_date = date;
-    m_labelDate->setText(m_date.toString("yyyy-MM-dd"));
-}
-/* 获取日期 */
-QDate ExecPlanItem::getDate()
-{
-    return m_date;
-}
-/* 设置开始时间 */
-void ExecPlanItem::setExecTime(const QTime &time)
-{
-    m_execTime = time;
-    m_labelExecTime->setText(m_execTime.toString());
-}
-/* 获取开始时间 */
-QTime ExecPlanItem::getExecTime() const
-{
-    return m_execTime;
-}
-
-/**
- * @brief 设置警告
- * @param str 警告的内容
- * @param ms 如果设置成0,将不启动定时器,一直显示警告内容
- */
-void ExecPlanItem::setWarningText(QString str,int ms)
-{
-    m_labelWarning->setText(str);
-    m_labelWarning->show();
-    if(ms > 0)
-    {
-        m_warnTimer->start(ms);
-    }
-}
-/* 设置设备名称 */
-void ExecPlanItem::setDevName(const QString &dev)
-{
-    m_devName = dev;
-    /* 寻找指向这个名称的设备信息 */
-    // m_cfgDev = DevInfo.cfgDevInfo().value(dev);
-    m_cfgDev = DevInfo.findCfgDev(dev);
-
-    /* 先屏蔽信号,防止添加项的过程中,乱发信号 */
-    QSignalBlocker bl(m_comBoxDev);
-    m_comBoxDev->clear();
-    for(const auto& it : DevInfo.cfgDevInfo())
-    {
-        m_comBoxDev->addItem(it->devName);
-    }
-    m_comBoxDev->setCurrentText(m_devName);
-
-    /* 设置相应的动作 */
-    setActionName();
-//    SPDLOG_LOGGER_INFO(m_logger,"m_devName:{},当前项是:{}",m_devName.toStdString(),m_comBoxDev->currentText().toStdString());
-}
-/* 获取设备名称 */
-QString ExecPlanItem::getDevName() const
-{
-    return m_devName;
-}
-/* 只修改设备名称,不修改设备类型,用于修改了设备名称,同步过来更新 */
-void ExecPlanItem::changeDevName(const QString &name)
-{
-    if(m_cfgDev->devName == name)
-    {
-        m_devName = name;
-        m_comBoxDev->setCurrentText(name);
-    }else
-    {
-        SPDLOG_LOGGER_WARN(m_logger,"修改后的设备名称和配置文件中不同:{}",name.toStdString());
-    }
-}
-
-/**
- * @brief 根据选择的设备设置相应的动作选项
- * @param action
- */
-void ExecPlanItem::setActionName(const QString &action)
-{
-    m_actionName = action;
-    m_comBoxAction->clear();
-    /* 获取这个设备 */
-    auto it = DevInfo.cfgDevInfo().value(m_comBoxDev->currentText(),nullptr);
-    if(nullptr != it)
-    {
-        for(auto it1 = it->DevType.getDevAction().begin(); it1 != it->DevType.getDevAction().end(); it1++)
-        {
-            m_comBoxAction->addItem(it1.value(), static_cast<int>(it1.key()));
-        }
-    }
-//    SPDLOG_LOGGER_DEBUG(m_logger,"当前Action:{}",m_action.toStdString());
-    m_comBoxAction->setCurrentText(action);
-    m_actionID = m_comBoxAction->currentData().toInt();
-}
-
-/* 通过动作类型设置动作 */
-void ExecPlanItem::setActionNum(int action)
-{
-
-}
-
-
-/* 设置动作,只设置可选择的动作类型 */
-void ExecPlanItem::setActionName()
-{
-    QString curAction = m_comBoxAction->currentText();
-    m_comBoxAction->clear();
-    auto it = DevInfo.cfgDevInfo().value(m_comBoxDev->currentText(),nullptr);
-    if(nullptr != it)
-    {
-        for(auto it1 = it->DevType.getDevAction().begin();it1 != it->DevType.getDevAction().end();it1++)
-        {
-            m_comBoxAction->addItem(it1.value(), static_cast<int>(it1.key()));
-        }
-    }
-    m_comBoxAction->setCurrentText(curAction);
-}
-/* 获取动作 */
-QString ExecPlanItem::getActionName()
-{
-    return m_actionName;
-}
-
-/* 获取动作类型 */
-int ExecPlanItem::getActionNum()
-{
-    return m_actionID;
-}
-
-/* 获取日期类型 */
-DateType ExecPlanItem::getDateType()
-{
-    return m_dateType;
-}
-/* 隐藏警告 */
-void ExecPlanItem::hideWarn()
-{
-    m_labelWarning->hide();
-}
-/* 获取设备信息 */
-ConfigurationDevInfo *ExecPlanItem::getCfgDev()
-{
-    return m_cfgDev;
-}
-/* 设备改变了,动作选项也跟着改变 */
-void ExecPlanItem::do_devChanged(QString devName)
-{
-    SPDLOG_LOGGER_DEBUG(m_logger,"更改Action,devName:{}",devName.toStdString());
-    /* 根据选择的设备,设置该设备的动作 */
-    m_comBoxAction->clear();
-    auto it = DevInfo.findCfgDev(devName);
-    // SPDLOG_LOGGER_DEBUG(m_logger,"更改Action,devName:{}, it:{}",devName.toStdString(),it->devName.toStdString());
-    if(nullptr != it)
-    {
-        m_cfgDev = it;
-        /* 将该设备支持的动作设置到选项中 */
-        for(auto it1 = it->DevType.getDevAction().begin();it1 != it->DevType.getDevAction().end();it1++)
-        {
-            m_comBoxAction->addItem(it1.value(), static_cast<int>(it1.key()));
-        }
-    }else
-    {
-        SPDLOG_LOGGER_INFO(m_logger,"没有这个设备:{}",devName.toStdString());
-        return;
-    }
-    m_devName = devName;
-    emit signal_devChanged();
-}
-
-/* 动作改变了 */
-void ExecPlanItem::do_actionChanged(QString action)
-{
-    m_actionName = action;
-    m_actionID = m_comBoxAction->currentData().toInt();
-}
-
-/**
- * @brief 监测点击相关的label
- * @param watched
- * @param event
- * @return
- */
-bool ExecPlanItem::eventFilter(QObject *watched, QEvent *event)
-{
-    /* 关闭图标 */
-    if(watched == m_delete && event->type() == QEvent::MouseButtonPress)
-    {
-        auto e = static_cast<QMouseEvent *>(event);
-        if(e->button() == Qt::LeftButton)
-        {
-            emit signal_OneItemDelete(m_num);
-            return true;
-        }
-    }
-    /* 点击日期 */
-    else if(watched == m_labelDate && event->type() == QEvent::MouseButtonPress)
-    {
-        auto e = static_cast<QMouseEvent *>(event);
-        if(e->button() == Qt::LeftButton)
-        {
-            emit signal_dateClicked(m_date);
-            return true;
-        }
-    }
-    /* 点击执行时间 */
-    else if(watched == m_labelExecTime && event->type() == QEvent::MouseButtonPress)
-    {
-        auto e = static_cast<QMouseEvent *>(event);
-        if(e->button() == Qt::LeftButton)
-        {
-            emit signal_execTimeClicked(m_execTime);
-            return true;
-        }
-    }
-    /* 滚轮事件 */
-    else if(event->type() == QEvent::Wheel)
-    {
-        return true;
-    }
-
-    return QWidget::eventFilter(watched,event);
-}
-/* 禁用这个项中所有的滚轮时间,这个不起效果 */
-//void ExecPlanItem::wheelEvent(QWheelEvent *event)
-//{
-//    return;
-//}
-

+ 0 - 89
demo/ExecPlanItem.h

@@ -1,89 +0,0 @@
-#ifndef EXECPLANITEM_H
-#define EXECPLANITEM_H
-
-#include <QWidget>
-#include <QLabel>
-#include <QTime>
-#include <QDate>
-#include <QTimer>
-#include <QComboBox>
-
-#include "spdlog/spdlog.h"
-#include "common/globalinfo/globalinfo.h"
-#include "customcombobox.h"
-
-struct ConfigurationDevInfo;
-
-class ExecPlanItem : public QWidget
-{
-    Q_OBJECT
-public:
-    
-public:
-    explicit ExecPlanItem(int weekDay = 0, QWidget* parent = nullptr);
-    ~ExecPlanItem();
-    void setNum(int num);                               /* 设置序号 */
-    int getNum();                                       /* 获取序号 */
-    int getWeekDay() {return  m_weekDay;}               /* 获取周几 */
-    void setDate(const QDate& date);                    /* 设置日期 */
-    QDate getDate();                                    /* 获取日期 */
-    void setExecTime(const QTime& time);                /* 设置执行时间 */
-    QTime getExecTime() const;                          /* 获取执行时间 */
-    void setWarningText(QString str,int ms = 3000);     /* 设置警告 */
-    void setDevName(const QString& dev);                /* 设置设备名称 */
-    QString getDevName() const;                         /* 获取设备名称 */
-    void changeDevName(const QString& name);            /* 只修改设备名称,不修改设备类型,用于修改了设备名称,同步过来更新 */
-    void setActionName(const QString &action);          /* 通过动作名称设置动作 */
-    void setActionNum(int action);                      /* 通过动作类型设置动作 */
-    void setActionName();                               /* 设置动作,只设置可选择的动作类型 */
-    QString getActionName();                            /* 获取动作名称 */
-    int getActionNum();                                 /* 获取动作类型 */
-    DateType getDateType();                             /* 获取日期类型 */
-    void hideWarn();                                    /* 隐藏警告 */
-    ConfigurationDevInfo* getCfgDev();                  /* 获取设备信息 */
-
-signals:
-    void signal_OneItemDelete(int num);                 /* 一个OneItem被删除了 */
-    void signal_dateClicked(QDate date);                /* 日期被点击了 */
-    void signal_execTimeClicked(QTime time);            /* 执行时间被点击了 */
-    void signal_devChanged();                           /* 设备改变了 */
-//    void signal_actionChanged();                      /* 动作改变了 */
-
-private slots:
-    void do_devChanged(QString devName);                /* 设备改变了 */
-    void do_actionChanged(QString action);              /* 动作改变了 */
-
-protected:
-    bool eventFilter(QObject *watched, QEvent *event);
-//    void wheelEvent(QWheelEvent *event);
-
-private:
-    std::shared_ptr<spdlog::logger> m_logger = nullptr;
-    int m_num;                                          /* 序号 */
-    int m_weekDay;                                      /* 周几,从0-6是周一到周日,7是特殊日 */
-    QDate m_date;                                       /* 日期 */
-    QTime m_execTime;                                   /* 执行时间 */
-    QString m_devName;                                  /* 设备名称 */
-    int m_actionID;                                     /* 动作类型 */
-    QString m_actionName;                               /* 执行的动作名称 */
-    DateType m_dateType;                                /* 日期类型 */
-    ConfigurationDevInfo* m_cfgDev = nullptr;           /* 指向这个名称的设备信息 */
-
-    QLabel* m_labelNum = nullptr;                       /* 序号 */
-    QLabel* m_labelDate = nullptr;                      /* 日期显示 */
-    CustomComboBox* m_comBoxDev = nullptr;              /* 设备选择框 */
-    QLabel* m_labelExecTime = nullptr;                  /* 执行时间 */
-    CustomComboBox* m_comBoxAction = nullptr;           /* 执行动作 */
-    QLabel* m_delete = nullptr;                         /* 关闭按钮 */
-
-    QLabel* m_labelDateIcon = nullptr;                  /* 日期图标 */
-    QLabel* m_labelTimeIcon = nullptr;                  /* 时间图标 */
-    QLabel* m_labelWarning = nullptr;                   /* 警告、错误 */
-    QTimer* m_warnTimer = nullptr;                      /* 警告时间定时器 */
-
-
-};
-
-
-
-#endif /* EXECPLANITEM_H */

+ 0 - 67
demo/LHCoaxialSwitchSetInfo/LHCoaxialSwitchSetInfo.pro

@@ -1,67 +0,0 @@
-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

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

@@ -1,422 +0,0 @@
-<?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>

+ 0 - 12
demo/LHCoaxialSwitchSetInfo/LHCoaxialSwitchSetInfo_global.h

@@ -1,12 +0,0 @@
-#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

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

@@ -1,40 +0,0 @@
-#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())));
-}

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

@@ -1,20 +0,0 @@
-#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


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

@@ -1,208 +0,0 @@
-#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);
-}

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

@@ -1,94 +0,0 @@
-#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


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

@@ -1,8 +0,0 @@
-<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


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

@@ -1,201 +0,0 @@
-#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();
-}
-
-
-

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

@@ -1,85 +0,0 @@
-#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;  // 设备类型
-};

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

@@ -1,64 +0,0 @@
-#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());
-}

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

@@ -1,63 +0,0 @@
-#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();
-};

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

@@ -1,186 +0,0 @@
-#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();
-}

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

@@ -1,75 +0,0 @@
-#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

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

@@ -1,129 +0,0 @@
-#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;
-}
-

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

@@ -1,62 +0,0 @@
-#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

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

@@ -1,85 +0,0 @@
-#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);
-    }
-}

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

@@ -1,49 +0,0 @@
-#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

+ 0 - 297
demo/LHCoaxialSwitchSetInfo/configwidget.cpp

@@ -1,297 +0,0 @@
-#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;
-        }
-    }
-}
-

+ 0 - 44
demo/LHCoaxialSwitchSetInfo/configwidget.h

@@ -1,44 +0,0 @@
-#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

+ 0 - 424
demo/LHCoaxialSwitchSetInfo/configwidget.ui

@@ -1,424 +0,0 @@
-<?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


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

@@ -1,234 +0,0 @@
-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;
-}
-

+ 0 - 335
demo/LHCoaxialSwitchSetInfo/devicemanager.cpp

@@ -1,335 +0,0 @@
-#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;
-}

+ 0 - 125
demo/LHCoaxialSwitchSetInfo/devicemanager.h

@@ -1,125 +0,0 @@
-#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

+ 0 - 99
demo/LHCoaxialSwitchSetInfo/lhcoaxialconfig.cpp

@@ -1,99 +0,0 @@
-#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;
-}
-

+ 0 - 42
demo/LHCoaxialSwitchSetInfo/lhcoaxialconfig.h

@@ -1,42 +0,0 @@
-#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

+ 0 - 104
demo/LHCoaxialSwitchSetInfo/lhcoaxialswitchsetinfo.cpp

@@ -1,104 +0,0 @@
-#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();
-}

+ 0 - 96
demo/LHCoaxialSwitchSetInfo/lhcoaxialswitchsetinfo.h

@@ -1,96 +0,0 @@
-#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


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

@@ -1,232 +0,0 @@
-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;
-}

+ 0 - 8
demo/LHCoaxialSwitchSetInfo/resource.qrc

@@ -1,8 +0,0 @@
-<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>

+ 0 - 39
demo/LHCoaxialSwitchSetInfo/version.rc

@@ -1,39 +0,0 @@
-//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

+ 0 - 237
demo/addnormalitem.cpp

@@ -1,237 +0,0 @@
-#include "addnormalitem.h"
-#include "UI/ExecPlan/ui_addnormalitem.h"
-#include "ui_addnormalitem.h"
-
-#include <memory>
-#include <QDebug>
-#include <QListView>
-
-#include "common/globalinfo/globalinfo.h"
-#include "CommonModule/time/CustomTimeEdit.h"
-#include "ExecPlan.h"
-
-#include "customcombobox.h"
-
-AddNormalItem::AddNormalItem(QWidget *parent) :
-    QDialog(parent),
-    ui(new Ui::AddNormalItem)
-{
-    ui->setupUi(this);
-
-    /* 设置无边框 */
-    setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint);
-    /* 设置底层样式表,让最底层的透明 */
-    this->setAttribute(Qt::WA_TranslucentBackground);
-    /* 设置遮罩 */
-    ui->widget->setStyleSheet(R"(Background: rgba(0, 0, 0, 0.4);)");
-
-    m_logger = spdlog::get("ExecPlan");
-    if(nullptr == m_logger)
-    {
-        qDebug() << "ExecPlan获取logger失败";
-    }
-
-    /* 加载QSS */
-    QFile file(":/qss/qss/PageExecPlan/AddNormalItem.qss");
-    if(file.open(QIODevice::ReadOnly))
-    {
-        QString stylesheet = file.readAll();
-        ui->widget_background->setStyleSheet(stylesheet);
-        // this->setStyleSheet(stylesheet);
-        file.close();
-    } else
-    {
-        SPDLOG_LOGGER_ERROR(m_logger,"ExecPlan AddNormalItem加载QSS失败");
-    }
-    /* 设置comboBox阴影 */
-    ui->comBox_devSelect->setViewShadowEffect();
-    ui->comBox_actionSelect->setViewShadowEffect();
-
-
-    /* 获取父指针 */
-    m_p = dynamic_cast<ExecPlan*>(parent);
-
-
-    /* 设置TimeWidget样式 */
-    // ui->timeEdit->setStyleSheet(R"(
-    //     TimeWidget
-    //     {
-    //         background: #FFFFFF;
-    //         border-radius: 4px;
-    //         border: 1px solid #E6E9F4;
-    //         padding-left:12px;
-    //         color: #858EBD;
-    //     }
-    //     )");
-
-    ui->timeEdit->setTimeAreaWidth(132);
-    ui->timeEdit->SetMainWindow(this);
-
-    ui->label_timeWarn->hide();
-    ui->label_devWarn->hide();
-    ui->label_actionWarn->hide();
-
-    /* 添加设备项 */
-    ui->comBox_devSelect->clear();
-    for(const auto& it : DevInfo.cfgDevInfo())
-    {
-        ui->comBox_devSelect->addItem(it->devName);
-        for(auto it1 = it->DevType.getDevAction().begin();it1 != it->DevType.getDevAction().end();it1++)
-        {
-            ui->comBox_actionSelect->addItem(it1.value());
-        }
-    }
-    ui->comBox_devSelect->setCurrentIndex(0);
-    m_devName = ui->comBox_devSelect->currentText();
-    /* 添加动作项 */
-    ui->comBox_actionSelect->clear();
-    auto it = DevInfo.cfgDevInfo().value(ui->comBox_devSelect->currentText(),nullptr);
-    if(it != nullptr )
-    {
-        for(auto it1 = it->DevType.getDevAction().begin();it1 != it->DevType.getDevAction().end();it1++)
-        {
-            ui->comBox_actionSelect->addItem(it1.value());
-        }
-    }
-
-
-    /* 连接信号和槽 */
-    connect(ui->pBtn_Close,&QPushButton::clicked,this,&QDialog::close);
-    connect(ui->pBtn_cancel,&QPushButton::clicked,this,&QDialog::close);
-    connect(ui->pBtn_ok,&QPushButton::clicked,this,&AddNormalItem::do_ok);
-    connect(ui->pBtn_cancel,&QPushButton::clicked,this,&AddNormalItem::close);
-
-    /* 设备选择 */
-    connect(ui->comBox_devSelect,QOverload<const QString&>::of(&QComboBox::currentTextChanged),this,[this](){
-        m_devName = ui->comBox_devSelect->currentText();
-        /* 根据选择的设备,设置该设备的动作 */
-        ui->comBox_actionSelect->clear();
-        auto it = DevInfo.cfgDevInfo().value(ui->comBox_devSelect->currentText(),nullptr);
-        if(it != nullptr )
-        {
-            /* 将该设备支持的动作设置到选项中 */
-            for(auto it1 = it->DevType.getDevAction().begin();it1 != it->DevType.getDevAction().end();it1++)
-            {
-                ui->comBox_actionSelect->addItem(it1.value());
-            }
-        }
-    });
-    /* 动作选择 */
-    connect(ui->comBox_actionSelect,QOverload<const QString&>::of(&QComboBox::currentTextChanged),this,[this](){
-        m_action = ui->comBox_actionSelect->currentText();
-    });
-//    connect(ui->pBtn_selectTime,SIGNAL(clicked()),this,SLOT(do_selectTime()));
-
-    /* 设置默认时间 */
-    ui->timeEdit->setTime("00:00:00");
-}
-
-AddNormalItem::~AddNormalItem()
-{
-    delete ui;
-}
-
-/* 选择时间 */
-//void AddNormalItem::do_selectTime()
-//{
-//    auto ct =std::make_shared<CustomTimeEdit>(this);
-//    /* 设置选择框中的时间 */
-//    ct->setValue(QTime::fromString(ui->pBtn_selectTime->text(),"hh:mm:ss"));
-
-//    /* 出现在框的下面,pBtn_timeStart的坐标是相对于AddNormalTime这个弹框的 */
-//    int x = this->x()+ui->pBtn_selectTime->x();
-//    int y = this->y() + ui->pBtn_selectTime->y()+32;
-//    ct->move(x,y);
-//    /* 设置当前显示的时间 */
-//    ct->setValue(QTime(0,0,0));
-//    /* 选择结束后的信号和槽 */
-//    connect(ct.get(),&CustomTimeEdit::signal_timeChanged,this,[this](QTime t){
-//        ui->pBtn_selectTime->setText(t.toString());
-//        m_time = t;
-//    });
-//    ct->exec();
-//}
-/* 进行查重和关闭页面 */
-void AddNormalItem::do_ok()
-{
-    ui->label_timeWarn->hide();
-    ui->label_devWarn->hide();
-    ui->label_actionWarn->hide();
-    setComboBoxWarning(ui->comBox_devSelect,false);
-    setComboBoxWarning(ui->comBox_actionSelect, false);
-    setTimeEditWarning(false);
-
-    /* 检查设备是否为空 */
-    if(ui->comBox_devSelect->currentText().isEmpty())
-    {
-        ui->label_devWarn->setText("不能为空!");
-        ui->label_devWarn->show();
-        setComboBoxWarning(ui->comBox_devSelect, true);
-        return;
-    }
-    /* 检查动作是否为空 */
-    if(ui->comBox_actionSelect->currentText().isEmpty())
-    {
-        ui->label_actionWarn->setText("不能为空!");
-        ui->label_actionWarn->show();
-        setComboBoxWarning(ui->comBox_actionSelect, true);
-    }
-
-    /* 时间赋值 */
-    m_time = ui->timeEdit->getFormTime();
-    /* 检查时间是否为空 */
-    if(m_time.isNull())
-    {
-        ui->label_timeWarn->setText("不能为空!");
-        ui->label_timeWarn->show();
-        setTimeEditWarning(true);
-        return;
-    }
-    /* 进行设备查重 */
-    bool ret = m_p->judgeTimeRepetition(*m_p->m_vecItem[m_p->m_stack->currentIndex()],m_devName,m_time);
-    if(ret)
-    {
-        ui->label_timeWarn->setText("一个时间点,单个设备仅能执行一个操作!");
-        ui->label_timeWarn->show();
-        setTimeEditWarning(true);
-        return;
-    }
-
-    /* 发送信号 */
-    emit signal_addNormalItem(m_devName,m_action,m_time);
-    close();
-}
-
-/* 设置选择框报警 */
-void AddNormalItem::setComboBoxWarning(QComboBox* bo, bool flag)
-{
-    if(flag)
-    {
-        bo->setProperty("Warn", true);
-    }
-    else
-    {
-        bo->setProperty("Warn", false);
-    }
-
-    bo->style()->unpolish(bo);
-    bo->style()->polish(bo);
-    
-}
-
-/* 设置时间报警 */
-void AddNormalItem::setTimeEditWarning(bool flag)
-{
-    if(flag)
-    {
-        ui->timeEdit->setProperty("Warn", true);
-    }
-    else
-    {
-        ui->timeEdit->setProperty("Warn", false);
-    }
-
-    ui->timeEdit->style()->unpolish(ui->timeEdit);
-    ui->timeEdit->style()->polish(ui->timeEdit);
-}
-

+ 0 - 45
demo/addnormalitem.h

@@ -1,45 +0,0 @@
-#ifndef ADDNORMALITEM_H
-#define ADDNORMALITEM_H
-
-#include <QDialog>
-#include <QTime>
-#include <QComboBox>
-
-#include "spdlog/spdlog.h"
-
-class ExecPlan;
-class TimeWidget;
-
-namespace Ui {
-class AddNormalItem;
-}
-
-class AddNormalItem : public QDialog
-{
-    Q_OBJECT
-
-public:
-    explicit AddNormalItem(QWidget *parent = nullptr);
-    ~AddNormalItem();
-
-signals:
-    void signal_addNormalItem(QString dev,QString action,QTime time);/* 添加正常日期的项 */
-
-private slots:
-//    void do_selectTime();                           /* 选择时间 */
-    void do_ok();                                   /* 进行查重和关闭页面 */
-
-private:
-    void setComboBoxWarning(QComboBox* bo,bool flag);/* 设置选择框报警 */
-    void setTimeEditWarning(bool flag);             /* 设置时间报警 */
-
-private:
-    Ui::AddNormalItem *ui;
-    std::shared_ptr<spdlog::logger> m_logger = nullptr;
-    ExecPlan* m_p = nullptr;                        /* 设置父类指针 */
-    QString m_devName;                              /* 选择的设备 */
-    QString m_action;                               /* 选择的动作 */
-    QTime m_time;                                   /* 执行的时间 */
-};
-
-#endif // ADDNORMALITEM_H

+ 0 - 300
demo/addnormalitem.ui

@@ -1,300 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>AddNormalItem</class>
- <widget class="QDialog" name="AddNormalItem">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>1920</width>
-    <height>1032</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>Dialog</string>
-  </property>
-  <widget class="QWidget" name="widget" native="true">
-   <property name="geometry">
-    <rect>
-     <x>0</x>
-     <y>0</y>
-     <width>1920</width>
-     <height>1032</height>
-    </rect>
-   </property>
-   <widget class="QWidget" name="widget_background" native="true">
-    <property name="geometry">
-     <rect>
-      <x>752</x>
-      <y>352</y>
-      <width>416</width>
-      <height>329</height>
-     </rect>
-    </property>
-    <property name="styleSheet">
-     <string notr="true"/>
-    </property>
-    <widget class="QLabel" name="label_NC1">
-     <property name="geometry">
-      <rect>
-       <x>32</x>
-       <y>18</y>
-       <width>80</width>
-       <height>18</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>添加计划</string>
-     </property>
-    </widget>
-    <widget class="QLabel" name="label_NC2_x">
-     <property name="geometry">
-      <rect>
-       <x>32</x>
-       <y>154</y>
-       <width>7</width>
-       <height>14</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; color:#ff0000;&quot;&gt;*&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-     </property>
-    </widget>
-    <widget class="QLabel" name="label_NC3">
-     <property name="geometry">
-      <rect>
-       <x>40</x>
-       <y>154</y>
-       <width>70</width>
-       <height>14</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>时间选择:</string>
-     </property>
-    </widget>
-    <widget class="QPushButton" name="pBtn_Close">
-     <property name="geometry">
-      <rect>
-       <x>368</x>
-       <y>12</y>
-       <width>32</width>
-       <height>32</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string/>
-     </property>
-    </widget>
-    <widget class="QLabel" name="label_NC4">
-     <property name="geometry">
-      <rect>
-       <x>0</x>
-       <y>56</y>
-       <width>416</width>
-       <height>1</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string/>
-     </property>
-    </widget>
-    <widget class="QPushButton" name="pBtn_cancel">
-     <property name="geometry">
-      <rect>
-       <x>248</x>
-       <y>265</y>
-       <width>60</width>
-       <height>32</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>取消</string>
-     </property>
-    </widget>
-    <widget class="QPushButton" name="pBtn_ok">
-     <property name="geometry">
-      <rect>
-       <x>324</x>
-       <y>265</y>
-       <width>60</width>
-       <height>32</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>确定</string>
-     </property>
-    </widget>
-    <widget class="QLabel" name="label_NC5">
-     <property name="geometry">
-      <rect>
-       <x>359</x>
-       <y>153</y>
-       <width>16</width>
-       <height>16</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string/>
-     </property>
-    </widget>
-    <widget class="QLabel" name="label_timeWarn">
-     <property name="geometry">
-      <rect>
-       <x>110</x>
-       <y>180</y>
-       <width>250</width>
-       <height>18</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>TextLabel</string>
-     </property>
-    </widget>
-    <widget class="QLabel" name="label_NC8_x">
-     <property name="geometry">
-      <rect>
-       <x>32</x>
-       <y>98</y>
-       <width>7</width>
-       <height>14</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; color:#ff0000;&quot;&gt;*&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-     </property>
-    </widget>
-    <widget class="QLabel" name="label_NC9">
-     <property name="geometry">
-      <rect>
-       <x>40</x>
-       <y>98</y>
-       <width>70</width>
-       <height>14</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>设备选择:</string>
-     </property>
-    </widget>
-    <widget class="CustomComboBox" name="comBox_devSelect">
-     <property name="geometry">
-      <rect>
-       <x>110</x>
-       <y>89</y>
-       <width>274</width>
-       <height>32</height>
-      </rect>
-     </property>
-     <property name="currentText">
-      <string/>
-     </property>
-    </widget>
-    <widget class="QLabel" name="label_NC8_x_2">
-     <property name="geometry">
-      <rect>
-       <x>32</x>
-       <y>210</y>
-       <width>7</width>
-       <height>14</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; color:#ff0000;&quot;&gt;*&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-     </property>
-    </widget>
-    <widget class="CustomComboBox" name="comBox_actionSelect">
-     <property name="geometry">
-      <rect>
-       <x>110</x>
-       <y>201</y>
-       <width>274</width>
-       <height>32</height>
-      </rect>
-     </property>
-    </widget>
-    <widget class="QLabel" name="label_NC9_2">
-     <property name="geometry">
-      <rect>
-       <x>40</x>
-       <y>210</y>
-       <width>70</width>
-       <height>14</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>动作选择:</string>
-     </property>
-    </widget>
-    <widget class="TimeWidget" name="timeEdit">
-     <property name="geometry">
-      <rect>
-       <x>110</x>
-       <y>145</y>
-       <width>274</width>
-       <height>32</height>
-      </rect>
-     </property>
-    </widget>
-    <widget class="QLabel" name="label_devWarn">
-     <property name="geometry">
-      <rect>
-       <x>110</x>
-       <y>126</y>
-       <width>250</width>
-       <height>18</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>TextLabel</string>
-     </property>
-    </widget>
-    <widget class="QLabel" name="label_actionWarn">
-     <property name="geometry">
-      <rect>
-       <x>110</x>
-       <y>238</y>
-       <width>250</width>
-       <height>18</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>TextLabel</string>
-     </property>
-    </widget>
-    <zorder>label_NC5</zorder>
-    <zorder>label_NC1</zorder>
-    <zorder>label_NC2_x</zorder>
-    <zorder>label_NC3</zorder>
-    <zorder>pBtn_Close</zorder>
-    <zorder>label_NC4</zorder>
-    <zorder>pBtn_cancel</zorder>
-    <zorder>pBtn_ok</zorder>
-    <zorder>label_timeWarn</zorder>
-    <zorder>label_NC8_x</zorder>
-    <zorder>label_NC9</zorder>
-    <zorder>comBox_devSelect</zorder>
-    <zorder>label_NC8_x_2</zorder>
-    <zorder>comBox_actionSelect</zorder>
-    <zorder>label_NC9_2</zorder>
-    <zorder>label_devWarn</zorder>
-    <zorder>label_actionWarn</zorder>
-    <zorder>timeEdit</zorder>
-   </widget>
-  </widget>
- </widget>
- <customwidgets>
-  <customwidget>
-   <class>TimeWidget</class>
-   <extends>QTimeEdit</extends>
-   <header location="global">timewidget.h</header>
-  </customwidget>
-  <customwidget>
-   <class>CustomComboBox</class>
-   <extends>QComboBox</extends>
-   <header location="global">customcombobox.h</header>
-  </customwidget>
- </customwidgets>
- <resources/>
- <connections/>
-</ui>

+ 0 - 285
demo/addspecialitem.cpp

@@ -1,285 +0,0 @@
-#include "addspecialitem.h"
-#include "ui_addspecialitem.h"
-
-#include <memory>
-#include <QDebug>
-#include <QListView>
-
-#include "globalinfo.h"
-#include "ExecPlan.h"
-#include "customcombobox.h"
-
-AddSpecialItem::AddSpecialItem(QWidget *parent) :
-    QDialog(parent),
-    ui(new Ui::AddSpecialItem)
-{
-    ui->setupUi(this);
-
-    /* 设置无边框 */
-    setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint);
-    /* 设置底层样式表,让最底层的透明 */
-    this->setAttribute(Qt::WA_TranslucentBackground);
-
-    m_logger = spdlog::get("ExecPlan");
-    if(nullptr == m_logger)
-    {
-        qDebug() << "ExecPlan获取logger失败";
-    }
-
-    /* 设置QSS */
-    QFile file(":/qss/qss/PageExecPlan/AddSpecialItem.qss");
-    if(file.open(QFile::ReadOnly))
-    {
-        QString styleSheet = tr(file.readAll());
-        ui->widget_background->setStyleSheet(styleSheet);
-        file.close();
-    } else
-    {
-        SPDLOG_LOGGER_ERROR(m_logger,"打开文件失败:{}", file.fileName().toStdString());
-    }
-
-    /* 设置combobox下拉框阴影 */
-    ui->comBox_actionSelect->setViewShadowEffect();
-    ui->comBox_devSelect->setViewShadowEffect();
-
-
-    /* 获取父指针 */
-    m_p = dynamic_cast<ExecPlan*>(parent);
-    m_date = QDate::currentDate();
-
-    m_loop = new QEventLoop(this);
-
-    /* 设置遮罩 */
-    ui->widget->setStyleSheet(R"(Background: rgba(0, 0, 0, 0.4);)");
-
-    /* 设置样式 */
-    // ui->timeEdit->setStyleSheet(R"(
-    //     TimeWidget
-    //     {
-    //         background: #FFFFFF;
-    //         border-radius: 4px;
-    //         border: 1px solid #E6E9F4;
-    //         padding-left:12px;
-    //         color: #858EBD;
-    //     }
-    //     )");
-    // ui->dateEdit->setStyleSheet(R"(
-    //     CalendarDTEdit
-    //         {
-    //             padding-left:8px;
-    //             background: #FFFFFF;
-    //             border-radius: 4px;
-    //             border: 1px solid #E6E9F4;
-    //         }
-    //         CalendarDTEdit::drop-down
-    //         {
-    //             padding-right:8px;
-    //             width: 16px;
-    //             image: url(:/ESM-8C_ICON/Date.png);
-    //         }
-    //     )");
-
-
-    ui->timeEdit->setTimeAreaWidth(132);
-    ui->timeEdit->SetMainWindow(this);
-    ui->timeEdit->setTime("00:00:00");
-    ui->dateEdit->setDisplayFormat("yyyy-MM-dd");
-    ui->dateEdit->setDate(QDate::currentDate());
-
-    // ui->label_dateWarn->hide();
-    ui->label_timeWarn->hide();
-    ui->label_devWarn->hide();
-    ui->label_actionWarn->hide();
-
-    /* 添加设备项 */
-    ui->comBox_devSelect->clear();
-    for(const auto& it : DevInfo.cfgDevInfo())
-    {
-        ui->comBox_devSelect->addItem(it->devName);
-        for(auto it1 = it->DevType.getDevAction().begin();it1 != it->DevType.getDevAction().end();it1++)
-        {
-            ui->comBox_actionSelect->addItem(it1.value());
-        }
-    }
-    ui->comBox_devSelect->setCurrentIndex(0);
-    m_devName = ui->comBox_devSelect->currentText();
-    /* 添加动作项 */
-    ui->comBox_actionSelect->clear();
-    auto it = DevInfo.cfgDevInfo().value(ui->comBox_devSelect->currentText(),nullptr);
-    if(nullptr != it )
-    {
-        for(auto it1 = it->DevType.getDevAction().begin();it1 != it->DevType.getDevAction().end();it1++)
-        {
-            ui->comBox_actionSelect->addItem(it1.value());
-        }
-    }
-
-    /* 连接信号和槽 */
-    connect(ui->pBtn_Close,&QPushButton::clicked,this,&AddSpecialItem::do_close);
-    connect(ui->pBtn_cancel,&QPushButton::clicked,this,&AddSpecialItem::do_close);
-    connect(ui->pBtn_ok,&QPushButton::clicked,this,&AddSpecialItem::do_ok);
-
-    /* 设备选择 */
-    connect(ui->comBox_devSelect,QOverload<const QString&>::of(&QComboBox::currentTextChanged),this,[this](){
-        m_devName = ui->comBox_devSelect->currentText();
-        /* 根据选择的设备,设置该设备的动作 */
-        ui->comBox_actionSelect->clear();
-        auto it = DevInfo.cfgDevInfo().value(ui->comBox_devSelect->currentText(),nullptr);
-        if(nullptr != it )
-        {
-            /* 将该设备支持的动作设置到选项中 */
-            for(auto it1 = it->DevType.getDevAction().begin();it1 != it->DevType.getDevAction().end();it1++)
-            {
-                ui->comBox_actionSelect->addItem(it1.value());
-            }
-        }
-    });
-    /* 动作选择 */
-    connect(ui->comBox_actionSelect,QOverload<const QString&>::of(&QComboBox::currentTextChanged),this,[this](){
-        m_action = ui->comBox_actionSelect->currentText();
-    });
-//    connect(ui->pBtn_selectTime,SIGNAL(clicked()),this,SLOT(do_selectTime()));
-//    connect(ui->pBtn_selectDate,SIGNAL(clicked()),this,SLOT(do_selectDate()));
-
-}
-
-AddSpecialItem::~AddSpecialItem()
-{
-    delete ui;
-}
-
-/* 选择时间 */
-//void AddSpecialItem::do_selectTime()
-//{
-//    auto ct =std::make_shared<CustomTimeEdit>(this);
-
-//    /* 出现在框的下面,pBtn_timeStart的坐标是相对于AddNormalTime这个弹框的 */
-//    int x = this->x()+ui->pBtn_selectTime->x();
-//    int y = this->y() + ui->pBtn_selectTime->y()+32;
-//    ct->move(x,y);
-//    /* 设置当前显示的时间 */
-//    ct->setValue(QTime(0,0,0));
-//    /* 选择结束后的信号和槽 */
-//    connect(ct.get(),&CustomTimeEdit::signal_timeChanged,this,[this](QTime t){
-//        ui->pBtn_selectTime->setText(t.toString());
-//        m_time = t;
-//    });
-//    ct->exec();
-//}
-/* 选择日期 */
-//void AddSpecialItem::do_selectDate()
-//{
-//    CDate ce(this);
-//    /* 设置出现位置 */
-//    int x = this->x() + ui->pBtn_selectDate->x();
-//    int y = this->y() + ui->pBtn_selectDate->y() + 32;
-//    ce.move(x,y);
-
-//    /* 选择结束后的信号和槽 */
-//    connect(&ce,&CDate::signal_DateChanged,[&](QDate date){
-//        ui->pBtn_selectDate->setText(date.toString("yyyy-MM-dd"));
-//        m_date = date;
-//        m_loop->quit();
-//    });
-//    ce.show();
-//    m_loop->exec();
-//}
-/* 进行查重和关闭页面 */
-void AddSpecialItem::do_ok()
-{
-    ui->label_timeWarn->hide();
-    ui->label_devWarn->hide();
-    ui->label_actionWarn->hide();
-    setComboBoxWarning(ui->comBox_devSelect,false);
-    setComboBoxWarning(ui->comBox_actionSelect, false);
-    setTimeEditWarning(false);
-
-    /* 检查设备是否为空 */
-    if(ui->comBox_devSelect->currentText().isEmpty())
-    {
-        ui->label_devWarn->setText("不能为空!");
-        ui->label_devWarn->show();
-        setComboBoxWarning(ui->comBox_devSelect, true);
-        return;
-    }
-    /* 检查动作是否为空 */
-    if(ui->comBox_actionSelect->currentText().isEmpty())
-    {
-        ui->label_actionWarn->setText("不能为空!");
-        ui->label_actionWarn->show();
-        setComboBoxWarning(ui->comBox_actionSelect, false);
-    }
-
-    /* 时间和日期赋值 */
-    m_time = ui->timeEdit->getFormTime();
-    m_date = ui->dateEdit->date();
-    /* 检查时间是否为空 */
-    if(m_time.isNull())
-    {
-        ui->label_timeWarn->setText("时间为空");
-        ui->label_timeWarn->show();
-        setTimeEditWarning(true);
-        return;
-    }
-    /* 进行设备查重 */
-    bool ret = m_p->judgeDateTimeRepetition(*m_p->m_vecItem[m_p->m_stack->currentIndex()],m_devName,m_date,m_time);
-    if(ret)
-    {
-        ui->label_timeWarn->setText("设备和执行时间重复");
-        ui->label_timeWarn->show();
-        setTimeEditWarning(true);
-        return;
-    }
-
-    /* 发送信号 */
-    emit signal_AddSpecialItem(m_devName,m_action,m_date,m_time);
-    if(m_loop->isRunning())
-    {
-        m_loop->quit();
-    }
-    close();
-}
-/* 在这个函数里检查loop否退出 */
-void AddSpecialItem::do_close()
-{
-    if(m_loop->isRunning())
-    {
-        m_loop->quit();
-    }
-    this->close();
-}
-
-/* 设置选择框报警 */
-void AddSpecialItem::setComboBoxWarning(QComboBox* bo, bool flag)
-{
-    if(flag)
-    {
-        bo->setProperty("Warn", true);
-    }
-    else
-    {
-        bo->setProperty("Warn", false);
-    }
-
-    bo->style()->unpolish(bo);
-    bo->style()->polish(bo);
-    
-}
-
-/* 设置时间报警 */
-void AddSpecialItem::setTimeEditWarning(bool flag)
-{
-    if(flag)
-    {
-        ui->timeEdit->setProperty("Warn", true);
-    }
-    else
-    {
-        ui->timeEdit->setProperty("Warn", false);
-    }
-
-    ui->timeEdit->style()->unpolish(ui->timeEdit);
-    ui->timeEdit->style()->polish(ui->timeEdit);
-}
-
-

+ 0 - 57
demo/addspecialitem.h

@@ -1,57 +0,0 @@
-#ifndef ADDSPECIALITEM_H
-#define ADDSPECIALITEM_H
-
-/**
- * 注意事:
- *  1、这里的日期用的提升方式,提升为CalendarTEdit,日期图标
- *     直接设置的箭头图标,如果想显示出来,需要设置setCalendarPopup为true
-*/
-
-#include <QDialog>
-#include <QTime>
-#include <QDate>
-#include <QEventLoop>
-
-#include "spdlog/spdlog.h"
-
-class ExecPlan;
-class QComboBox;
-
-namespace Ui {
-class AddSpecialItem;
-}
-
-class AddSpecialItem : public QDialog
-{
-    Q_OBJECT
-
-public:
-    explicit AddSpecialItem(QWidget *parent = nullptr);
-    ~AddSpecialItem();
-
-signals:
-    void signal_AddSpecialItem(QString dev,QString action,QDate date,QTime time);/* 添加正常日期的项 */
-
-private slots:
-//    void do_selectTime();                           /* 选择时间 */
-//    void do_selectDate();                           /* 选择日期 */
-    void do_ok();                                   /* 进行查重和关闭页面 */
-    void do_close();                                /* 在这个函数里检查loop否退出 */
-
-private:
-    void setComboBoxWarning(QComboBox* bo,bool flag);/* 设置选择框报警 */
-    void setTimeEditWarning(bool flag);             /* 设置时间报警 */
-
-private:
-    Ui::AddSpecialItem *ui;
-    std::shared_ptr<spdlog::logger> m_logger = nullptr;
-    ExecPlan* m_p = nullptr;                        /* 设置父类指针 */
-    QString m_devName;                              /* 选择的设备 */
-    QString m_action;                               /* 选择的动作 */
-    QDate m_date;
-    QTime m_time;                                   /* 执行的时间 */
-
-    QEventLoop* m_loop = nullptr;                   /* 将这个循环放到这里,防止退出时loop没有退出导致程序崩溃,推出时要检查loop是否还在运行 */
-};
-
-#endif // ADDSPECIALITEM_H

+ 0 - 347
demo/addspecialitem.ui

@@ -1,347 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>AddSpecialItem</class>
- <widget class="QDialog" name="AddSpecialItem">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>1920</width>
-    <height>1032</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>Dialog</string>
-  </property>
-  <widget class="QWidget" name="widget" native="true">
-   <property name="geometry">
-    <rect>
-     <x>0</x>
-     <y>0</y>
-     <width>1920</width>
-     <height>1302</height>
-    </rect>
-   </property>
-   <widget class="QWidget" name="widget_background" native="true">
-    <property name="geometry">
-     <rect>
-      <x>752</x>
-      <y>314</y>
-      <width>416</width>
-      <height>385</height>
-     </rect>
-    </property>
-    <property name="styleSheet">
-     <string notr="true"/>
-    </property>
-    <widget class="QLabel" name="label_NC1">
-     <property name="geometry">
-      <rect>
-       <x>32</x>
-       <y>18</y>
-       <width>80</width>
-       <height>18</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>添加计划</string>
-     </property>
-    </widget>
-    <widget class="QLabel" name="label_NC2_x">
-     <property name="geometry">
-      <rect>
-       <x>32</x>
-       <y>210</y>
-       <width>7</width>
-       <height>14</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; color:#ff0000;&quot;&gt;*&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-     </property>
-    </widget>
-    <widget class="QLabel" name="label_NC3">
-     <property name="geometry">
-      <rect>
-       <x>40</x>
-       <y>210</y>
-       <width>70</width>
-       <height>14</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>时间选择:</string>
-     </property>
-    </widget>
-    <widget class="QPushButton" name="pBtn_Close">
-     <property name="geometry">
-      <rect>
-       <x>368</x>
-       <y>12</y>
-       <width>32</width>
-       <height>32</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string/>
-     </property>
-    </widget>
-    <widget class="QLabel" name="label_NC4">
-     <property name="geometry">
-      <rect>
-       <x>0</x>
-       <y>56</y>
-       <width>416</width>
-       <height>1</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string/>
-     </property>
-    </widget>
-    <widget class="QPushButton" name="pBtn_cancel">
-     <property name="geometry">
-      <rect>
-       <x>248</x>
-       <y>321</y>
-       <width>60</width>
-       <height>32</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>取消</string>
-     </property>
-    </widget>
-    <widget class="QPushButton" name="pBtn_ok">
-     <property name="geometry">
-      <rect>
-       <x>324</x>
-       <y>321</y>
-       <width>60</width>
-       <height>32</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>确定</string>
-     </property>
-    </widget>
-    <widget class="QLabel" name="label_NC5">
-     <property name="geometry">
-      <rect>
-       <x>359</x>
-       <y>209</y>
-       <width>16</width>
-       <height>16</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string/>
-     </property>
-    </widget>
-    <widget class="QLabel" name="label_timeWarn">
-     <property name="geometry">
-      <rect>
-       <x>110</x>
-       <y>236</y>
-       <width>250</width>
-       <height>18</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>TextLabel</string>
-     </property>
-    </widget>
-    <widget class="QLabel" name="label_NC8_x">
-     <property name="geometry">
-      <rect>
-       <x>32</x>
-       <y>98</y>
-       <width>7</width>
-       <height>14</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; color:#ff0000;&quot;&gt;*&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-     </property>
-    </widget>
-    <widget class="QLabel" name="label_NC9">
-     <property name="geometry">
-      <rect>
-       <x>40</x>
-       <y>98</y>
-       <width>70</width>
-       <height>14</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>设备选择:</string>
-     </property>
-    </widget>
-    <widget class="CustomComboBox" name="comBox_devSelect">
-     <property name="geometry">
-      <rect>
-       <x>110</x>
-       <y>89</y>
-       <width>274</width>
-       <height>32</height>
-      </rect>
-     </property>
-     <property name="currentText">
-      <string/>
-     </property>
-    </widget>
-    <widget class="QLabel" name="label_NC12_x">
-     <property name="geometry">
-      <rect>
-       <x>32</x>
-       <y>266</y>
-       <width>7</width>
-       <height>14</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; color:#ff0000;&quot;&gt;*&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-     </property>
-    </widget>
-    <widget class="CustomComboBox" name="comBox_actionSelect">
-     <property name="geometry">
-      <rect>
-       <x>108</x>
-       <y>257</y>
-       <width>274</width>
-       <height>32</height>
-      </rect>
-     </property>
-    </widget>
-    <widget class="QLabel" name="label_NC9_2">
-     <property name="geometry">
-      <rect>
-       <x>40</x>
-       <y>266</y>
-       <width>70</width>
-       <height>14</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>动作选择:</string>
-     </property>
-    </widget>
-    <widget class="QLabel" name="label_NC10">
-     <property name="geometry">
-      <rect>
-       <x>40</x>
-       <y>154</y>
-       <width>70</width>
-       <height>14</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>日期选择:</string>
-     </property>
-    </widget>
-    <widget class="QLabel" name="label_NC2_x_2">
-     <property name="geometry">
-      <rect>
-       <x>32</x>
-       <y>154</y>
-       <width>7</width>
-       <height>14</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; color:#ff0000;&quot;&gt;*&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-     </property>
-    </widget>
-    <widget class="TimeWidget" name="timeEdit">
-     <property name="geometry">
-      <rect>
-       <x>110</x>
-       <y>201</y>
-       <width>274</width>
-       <height>32</height>
-      </rect>
-     </property>
-    </widget>
-    <widget class="CalendarDTEdit" name="dateEdit">
-     <property name="geometry">
-      <rect>
-       <x>110</x>
-       <y>145</y>
-       <width>274</width>
-       <height>32</height>
-      </rect>
-     </property>
-     <property name="calendarPopup">
-      <bool>true</bool>
-     </property>
-    </widget>
-    <widget class="QLabel" name="label_devWarn">
-     <property name="geometry">
-      <rect>
-       <x>110</x>
-       <y>126</y>
-       <width>250</width>
-       <height>18</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>TextLabel</string>
-     </property>
-    </widget>
-    <widget class="QLabel" name="label_actionWarn">
-     <property name="geometry">
-      <rect>
-       <x>110</x>
-       <y>296</y>
-       <width>250</width>
-       <height>18</height>
-      </rect>
-     </property>
-     <property name="text">
-      <string>TextLabel</string>
-     </property>
-    </widget>
-    <zorder>label_NC5</zorder>
-    <zorder>label_NC1</zorder>
-    <zorder>label_NC2_x</zorder>
-    <zorder>label_NC3</zorder>
-    <zorder>pBtn_Close</zorder>
-    <zorder>label_NC4</zorder>
-    <zorder>pBtn_cancel</zorder>
-    <zorder>pBtn_ok</zorder>
-    <zorder>label_timeWarn</zorder>
-    <zorder>label_NC8_x</zorder>
-    <zorder>label_NC9</zorder>
-    <zorder>comBox_devSelect</zorder>
-    <zorder>label_NC12_x</zorder>
-    <zorder>comBox_actionSelect</zorder>
-    <zorder>label_NC9_2</zorder>
-    <zorder>label_NC10</zorder>
-    <zorder>label_NC2_x_2</zorder>
-    <zorder>timeEdit</zorder>
-    <zorder>dateEdit</zorder>
-    <zorder>label_devWarn</zorder>
-    <zorder>label_actionWarn</zorder>
-   </widget>
-  </widget>
- </widget>
- <customwidgets>
-  <customwidget>
-   <class>TimeWidget</class>
-   <extends>QTimeEdit</extends>
-   <header location="global">timewidget.h</header>
-  </customwidget>
-  <customwidget>
-   <class>CalendarDTEdit</class>
-   <extends>QDateEdit</extends>
-   <header location="global">calendardtedit.h</header>
-  </customwidget>
-  <customwidget>
-   <class>CustomComboBox</class>
-   <extends>QComboBox</extends>
-   <header location="global">customcombobox.h</header>
-  </customwidget>
- </customwidgets>
- <resources/>
- <connections/>
-</ui>

+ 0 - 232
demo/qss/AddNormalItem.qss

@@ -1,232 +0,0 @@
-
-/* ==========================================================
- *  通用样式
- * ========================================================== */
-QWidget
-{
-    font-family: 思源黑体R;
-    font-weight: 400;
-    font-size: 14px;
-    color: #3A3F63;
-    line-height: 21px;
-    text-align: left;
-    font-style: normal;
-    border-radius: 8px;
-    background: #FFFFFF;
-}
-
-QLabel#label_NC1
-{
-    font-weight: bold;
-    font-size: 18px;
-    color: #3A3F63;
-    line-height: 27px;
-    text-align: left;
-    font-style: normal;
-    text-transform: uppercase;
-}
-QLabel#label_NC4
-{
-    background: #E6E9F4;
-}
-
-QLabel#label_NC5
-{
-	border-image: url(:/ESM-8C_ICON/Time.png);
-}
-/* QLabel#label_NC11
-{
-	border-image: url(:/ESM-8C_ICON/Date.png);
-} */
-
-
-QPushButton
-{
-	text-align: center;
-	font-family: 思源黑体M;
-}
-
-QPushButton#pBtn_Close{
-	image: url(:/ESM-8C_ICON/Dialog_close.png);
-}
-QPushButton#pBtn_Close:hover
-{
-	image: url(:/ESM-8C_ICON/Dialog_close2.png);
-}
-
-/********* 普通方框按钮三种状态效果 *********/
-QPushButton#pBtn_cancel:enabled
-{
-    background: #FFFFFF;
-    border-radius: 16px;
-    border: 1px solid #E6E9F4;
-    color: #3A3F63;
-}
-QPushButton#pBtn_cancel:hover
-{
-    background: #FFFFFF;
-    border-radius: 16px;
-    border: 1px solid #4458FE;
-    color: #4458FE;
-}
-
-
-/********* 带有底色按钮三种状态效果 *********/
-QPushButton#pBtn_ok
-{
-    color:white;
-    background: qlineargradient( x0:1,x1:1,y1:0,y2:0,stop:1 #4F8AFF,stop:0 #4B5EFF);
-    border-radius: 16px;
-}
-
-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;
-}
-
-
-QLabel#label_devWarn,QLabel#label_timeWarn,QLabel#label_actionWarn
-{
-    font-weight: 400;
-    font-size: 14px;
-    color: #D21F21;
-    line-height: 21px;
-    text-align: left;
-    font-style: normal;
-}
-
-/* ==========================================================
- *  QComboBox(这个是在用的)
- * ========================================================== */
-
-QComboBox:enabled
-{
-    background-color:#FFFFFF;
-    border: 1px solid #E6E9F4;
-    border-radius: 4px;
-    font-size:14px;
-    font-weight: 400;
-    color:#3A3F63;
-    padding-left: 12px;
-}
-
-/* 不能编辑的时候的样式,setEnable(false) */
-QComboBox:!enabled
-{
-    background:rgba(0,0,0,0.04);
-	border: 1px solid #E6E9F4;
-    border-radius: 4px;
-    font-size:14px;
-    font-weight: 400;
-    color:rgba(58,63,99,0.65);
-    padding-left: 12px;
-}
-
-QComboBox:hover
-{
-    border: 1px solid #4458FE;
-    border-radius: 4px;
-    background:transparent;
-}
-
-/* 下拉箭头所在的位置方框 */
-QComboBox::drop-down
-{
-    width: 24px;
-    border: none;
-}
-/* 下拉箭头图标 */
-QComboBox::down-arrow
-{
-    image: url(:/ESM-8C_ICON/DownArrow.png);
-    height:16px;
-    width:16px;
-}
-
-/* 下拉条样式,就是view,整个下拉窗体的样式 */
-QComboBox QAbstractItemView
-{
-    background-color: #FFFFFF;
-    margin: 12px;
-    outline:0px;
-    font-size:14px;
-    color: #3A3F63;
-    border-radius: 4px;
-}
-
-/* 使下面两句生效,需要加上如下语句 */
-/* m_comBoxDev->setView(new QListView()); */
-QComboBox QAbstractItemView::item
-{
-    background-color: #FFFFFF;
-    border-radius:4px;
-    color: #3A3F63;
-    padding-left: 12px;
-    height: 32px;
-}
-
-QComboBox QAbstractItemView::item:hover
-{
-    border-radius:4px;
-    background-color: #EEF2FF;
-}
-
-/* QComboBox QAbstractItemView::item:selected
-{
-    border-radius:4px;
-    background-color: #EEF2FF;
-} */
-
-/******** combobox 滚动条  *********/
-QComboBox QScrollBar::vertical{ /*主体部分*/
-    width:8px;
-    background:transparent;
-    border:none;
-    border-radius:5px;
-}
-QComboBox QScrollBar::handle::vertical{ /*滑块主体*/
-    width: 8px;
-    background: #E2E2E2;
-    border-radius: 3px;
-    min-width: 8px;
-}
-QComboBox QScrollBar::handle::vertical::hover{
-    background:transparent;
-}
-QComboBox QScrollBar::add-line::vertical{/*上箭头*/
-    border:none;
-}
-QComboBox QScrollBar::sub-line::vertical{/*下箭头*/
-    border:none;
-}
-
-
-/* ==========================================================
- *  时间报警红框
- * ========================================================== */
-
-
-TimeWidget
-{
-	background: transparent;
-    border-radius: 4px;
-    padding-left:12px;
-    border: 1px solid #E6E9F4;
-}
-
-TimeWidget[Warn=true]
-{
-	background: transparent;
-    border-radius: 4px;
-    padding-left:12px;
-    border: 1px solid #D21F21;
-}
-
-TimeWidget:!enabled/* 或者disable */
-{
-    background: rgba(0,0,0,0.04);
-    border: 1px solid #E6E9F4;
-}
-

+ 0 - 269
demo/qss/AddSpecialItem.qss

@@ -1,269 +0,0 @@
-
-QWidget
-{
-    background: transparent;
-    border-radius: 8px;
-    font-family: 思源黑体R;
-    font-weight: 400;
-    font-size: 14px;
-    color: #3A3F63;
-    line-height: 21px;
-    text-align: left;
-    font-style: normal;
-}
-QWidget#widget_background
-{
-    border-radius: 8px;
-    background: #FFFFFF;
-}
-QLabel#label_NC1
-{
-    font-weight: bold;
-    font-size: 18px;
-    color: #3A3F63;
-    line-height: 27px;
-    text-align: left;
-    font-style: normal;
-    text-transform: uppercase;
-}
-
-QLabel#label_NC4
-{
-    background: #E6E9F4;
-}
-
-QLabel#label_NC5
-{
-	border-image: url(:/ESM-8C_ICON/Time.png);
-}
-QLabel#label_NC11
-{
-	border-image: url(:/ESM-8C_ICON/Date.png);
-}
-
-QLabel#label_devWarn,QLabel#label_timeWarn,QLabel#label_actionWarn
-{
-font-weight: 400;
-font-size: 14px;
-color: #D21F21;
-line-height: 21px;
-text-align: left;
-font-style: normal;
-}
-
-QPushButton
-{
-	text-align: center;
-	font-family: 思源黑体M;
-}
-
-QPushButton#pBtn_Close{
-	image: url(:/ESM-8C_ICON/Dialog_close.png);
-}
-QPushButton#pBtn_Close:hover
-{
-	image: url(:/ESM-8C_ICON/Dialog_close2.png);
-}
-
-
-/********* 普通方框按钮三种状态效果 *********/
-QPushButton#pBtn_cancel:enabled
-{
-    background: #FFFFFF;
-    border-radius: 16px;
-    border: 1px solid #E6E9F4;
-    color: #3A3F63;
-}
-QPushButton#pBtn_cancel:hover
-{
-    background: #FFFFFF;
-    border-radius: 16px;
-    border: 1px solid #4458FE;
-    color: #4458FE;
-}
-
-
-/********* 带有底色按钮三种状态效果 *********/
-QPushButton#pBtn_ok
-{
-    color:white;
-    background: qlineargradient( x0:1,x1:1,y1:0,y2:0,stop:1 #4F8AFF,stop:0 #4B5EFF);
-    border-radius: 16px;
-}
-
-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;
-}
-
-
-QLabel#label_devWarn,QLabel#label_timeWarn,QLabel#label_actionWarn
-{
-font-weight: 400;
-font-size: 14px;
-color: #D21F21;
-line-height: 21px;
-text-align: left;
-font-style: normal;
-}
-
-/* ==========================================================
- *  QComboBox(这个是在用的)
- * ========================================================== */
-
-QComboBox:enabled
-{
-    background-color:#FFFFFF;
-    border: 1px solid #E6E9F4;
-    border-radius: 4px;
-    font-size:14px;
-    font-weight: 400;
-    color:#3A3F63;
-    padding-left: 12px;
-}
-
-/* 不能编辑的时候的样式,setEnable(false) */
-QComboBox:!enabled
-{
-    background:rgba(0,0,0,0.04);
-	border: 1px solid #E6E9F4;
-    border-radius: 4px;
-    font-size:14px;
-    font-weight: 400;
-    color:rgba(58,63,99,0.65);
-    padding-left: 12px;
-}
-
-QComboBox:hover
-{
-    border: 1px solid #4458FE;
-    border-radius: 4px;
-    background:transparent;
-}
-
-/* 下拉箭头所在的位置方框 */
-QComboBox::drop-down
-{
-    width: 24px;
-    border: none;
-}
-/* 下拉箭头图标 */
-QComboBox::down-arrow
-{
-    image: url(:/ESM-8C_ICON/DownArrow.png);
-    height:16px;
-    width:16px;
-}
-
-/* 下拉条样式,就是view,整个下拉窗体的样式 */
-QComboBox QAbstractItemView
-{
-    background-color: #FFFFFF;
-    margin: 12px;
-    outline:0px;
-    font-size:14px;
-    color: #3A3F63;
-    border-radius: 4px;
-}
-
-/* 使下面两句生效,需要加上如下语句 */
-/* m_comBoxDev->setView(new QListView()); */
-QComboBox QAbstractItemView::item
-{
-    background-color: #FFFFFF;
-    border-radius:4px;
-    color: #3A3F63;
-    padding-left: 12px;
-    height: 32px;
-}
-
-QComboBox QAbstractItemView::item:hover
-{
-    border-radius:4px;
-    background-color: #EEF2FF;
-}
-
-QComboBox QAbstractItemView::item:selected
-{
-    border-radius:4px;
-    background-color: #EEF2FF;
-}
-
-/******** combobox 滚动条  *********/
-QComboBox QScrollBar::vertical{ /*主体部分*/
-    width:8px;
-    background:transparent;
-    border:none;
-    border-radius:5px;
-}
-QComboBox QScrollBar::handle::vertical{ /*滑块主体*/
-    width: 8px;
-    background: #E2E2E2;
-    border-radius: 3px;
-    min-width: 8px;
-}
-QComboBox QScrollBar::handle::vertical::hover{
-    background:transparent;
-}
-QComboBox QScrollBar::add-line::vertical{/*上箭头*/
-    border:none;
-}
-QComboBox QScrollBar::sub-line::vertical{/*下箭头*/
-    border:none;
-}
-
-/****************  时间报警红框  ****************/
-TimeWidget
-{
-	background: transparent;
-    border-radius: 4px;
-    padding-left:12px;
-    border: 1px solid #E6E9F4;
-}
-
-TimeWidget[Warn=true]
-{
-	background: transparent;
-    border-radius: 4px;
-    padding-left:12px;
-    border: 1px solid #D21F21;
-}
-
-TimeWidget:!enabled/* 或者disable */
-{
-    background: rgba(0,0,0,0.04);
-    border: 1px solid #E6E9F4;
-}
-
-/***************	日期选择框	*****************/
-CalendarDTEdit
-{
-	background: #FFFFFF;
-    border-radius: 4px;
-    padding-left:12px;
-    border: 1px solid #E6E9F4;
-}
-
-CalendarDTEdit[Warn=true]
-{
-	background: #FFFFFF;
-    border-radius: 4px;
-    padding-left:12px;
-    border: 1px solid #D21F21;
-}
-
-CalendarDTEdit:!enabled/* 或者disable */
-{
-    background: rgba(0,0,0,0.04);
-    border: 1px solid #E6E9F4;
-}
-
-CalendarDTEdit::drop-down
-{
- 	padding-right:8px;
-	width: 16px;
-    image: url(:/ESM-8C_ICON/Date.png);
-}
-

+ 0 - 219
demo/qss/ExecPlanItem.qss

@@ -1,219 +0,0 @@
-
-QWidget
-{
-    font-family: 思源黑体R;
-    font-weight: 400;
-    font-size: 14px;
-    color: #3A3F63;
-    line-height: 21px;
-    text-align: left;
-    font-style: normal;
-    background: #FFFFFF;
-}
-
-QLabel#Num
-{
-    background: rgba(0,0,0,0.04);
-    border-radius: 4px;
-    border: 1px solid #E6E9F4;
-    padding-left:12px;
-}
-
-QLabel#Date, QLabel#ExecTime
-{
-    /* background: #FFFFFF; */
-    background: transparent;
-    border-radius: 4px;
-    border: 1px solid #E6E9F4;
-    padding-left:12px;
-}
-
-QLabel#DateIcon
-{
-    border-image: url(:/ESM-8C_ICON/Date.png);
-}
-
-QLabel#TimeIcon
-{
-    border-image: url(:/ESM-8C_ICON/Time.png);
-}
-
-QLabel#Delete
-{
-    border-image: url(:/ESM-8C_ICON/Delete.png);
-}
-
-QLabel#Delete:hover
-{
-    border-image: url(:/ESM-8C_ICON/Delete2.png);
-}
-
-QLabel#Warning
-{
-    font-weight: 400;
-    font-size: 14px;
-    color: #D21F21;
-    line-height: 21px;
-    text-align: left;
-    font-style: normal;
-}
-
-
-/* ==========================================================
- *  QComboBox(这个是在用的)
- * ========================================================== */
-
-QComboBox:enabled
-{
-    background-color:#FFFFFF;
-    border: 1px solid #E6E9F4;
-    border-radius: 4px;
-    font-size:14px;
-    font-weight: 400;
-    color:#3A3F63;
-    padding-left: 12px;
-}
-
-/* 不能编辑的时候的样式,setEnable(false) */
-QComboBox:!enabled
-{
-    background:rgba(0,0,0,0.04);
-	border: 1px solid #E6E9F4;
-    border-radius: 4px;
-    font-size:14px;
-    font-weight: 400;
-    color:rgba(58,63,99,0.65);
-    padding-left: 12px;
-}
-
-QComboBox:hover
-{
-    border: 1px solid #4458FE;
-    border-radius: 4px;
-    background:transparent;
-}
-
-/* 下拉箭头所在的位置方框 */
-QComboBox::drop-down
-{
-    width: 24px;
-    border: none;
-}
-/* 下拉箭头图标 */
-QComboBox::down-arrow
-{
-    image: url(:/ESM-8C_ICON/DownArrow.png);
-    height:16px;
-    width:16px;
-}
-
-/* 下拉条样式,就是view,整个下拉窗体的样式 */
-QComboBox QAbstractItemView
-{
-    background-color: #FFFFFF;
-    margin: 12px;
-    outline:0px;
-    font-size:14px;
-    color: #3A3F63;
-    border-radius: 4px;
-}
-
-/* 使下面两句生效,需要加上如下语句 */
-/* m_comBoxDev->setView(new QListView()); */
-QComboBox QAbstractItemView::item
-{
-    background-color: #FFFFFF;
-    border-radius:4px;
-    color: #3A3F63;
-    padding-left: 12px;
-    height: 32px;
-}
-
-QComboBox QAbstractItemView::item:hover
-{
-    border-radius:4px;
-    background-color: #EEF2FF;
-}
-
-/* QComboBox QAbstractItemView::item:selected
-{
-    border-radius:4px;
-    background-color: #EEF2FF;
-} */
-
-/******** combobox 滚动条  *********/
-QComboBox QScrollBar::vertical{ /*主体部分*/
-    width:8px;
-    background:transparent;
-    border:none;
-    border-radius:5px;
-}
-QComboBox QScrollBar::handle::vertical{ /*滑块主体*/
-    width: 8px;
-    background: #E2E2E2;
-    border-radius: 3px;
-    min-width: 8px;
-}
-QComboBox QScrollBar::handle::vertical::hover{
-    background:transparent;
-}
-QComboBox QScrollBar::add-line::vertical{/*上箭头*/
-    border:none;
-}
-QComboBox QScrollBar::sub-line::vertical{/*下箭头*/
-    border:none;
-}
-
-
-/****************  时间报警红框  ****************/
-TimeWidget
-{
-	background: transparent;
-    border-radius: 4px;
-    padding-left:12px;
-    border: 1px solid #E6E9F4;
-}
-
-TimeWidget[Warn=true]
-{
-	background: transparent;
-    border-radius: 4px;
-    padding-left:12px;
-    border: 1px solid #D21F21;
-}
-
-TimeWidget:!enabled/* 或者disable */
-{
-    background: rgba(0,0,0,0.04);
-    border: 1px solid #E6E9F4;
-}
-
-/***************	日期选择框	*****************/
-CalendarDTEdit
-{
-	background: #FFFFFF;
-    border-radius: 4px;
-    padding-left:12px;
-    border: 1px solid #E6E9F4;
-}
-
-CalendarDTEdit[Warn=true]
-{
-	background: #FFFFFF;
-    border-radius: 4px;
-    padding-left:12px;
-    border: 1px solid #D21F21;
-}
-
-CalendarDTEdit:!enabled/* 或者disable */
-{
-    background: rgba(0,0,0,0.04);
-    border: 1px solid #E6E9F4;
-}
-
-CalendarDTEdit::drop-down
-{
- 	padding-right:8px;
-	width: 16px;
-    image: url(:/ESM-8C_ICON/Date.png);
-}

+ 0 - 66
demo/qss/PageExecPlan.qss

@@ -1,66 +0,0 @@
-
-QWidget
-{
-    border-radius: 0px;
-    background-color:#FFFFFF;
-    font-family: 思源黑体R;
-    font-weight: 400;
-    font-size: 14px;
-    color: #3A3F63;
-    line-height: 21px;
-    text-align: left;
-    font-style: normal;
-}
-QWidget#LeftColumn
-{
-    background: #F5F5FA;
-    border: 1px solid #DAE0F2;
-}
-/********* 普通方框按钮三种状态效果 *********/
-QPushButton#AddTime,QPushButton#ClearTime,QPushButton#Import,QPushButton#Save,QPushButton#Download,QPushButton#GetEQMData
-{
-    text-align: center;
-    font-family: 思源黑体M;
-    background: #FFFFFF;
-    border-radius: 4px;
-    border: 1px solid #E6E9F4;
-    color: #3A3F63;
-}
-QPushButton#AddTime::hover,QPushButton#ClearTime::hover,QPushButton#Import::hover,QPushButton#Save::hover,QPushButton#Download::hover,QPushButton#GetEQMData::hover
-{
-    text-align: center;
-    font-family: 思源黑体M;
-    background: #FFFFFF;
-    border-radius: 4px;
-    border: 1px solid #4458FE;
-    color: #4458FE;
-}
-QPushButton#Default:checked{
-    border-image:url(:/ESM-8C_ICON/Switch_Open.png);
-    }
-QPushButton#Default{
-    border-image:url(:/ESM-8C_ICON/Switch_Close.png);
-    }
-QLabel#ButtomLine{
-    background: #E9E9E9;
-    }
-QLabel#stackButtomLine{
-    background: #E9E9E9;
-    }
-QRadioButton#DoTime::indicator:unchecked,QRadioButton#DoDay::indicator:unchecked{
-    border-image: url(:/ESM-8C_ICON/Unchaecked.png);
-    }
-QRadioButton#DoTime::indicator:checked,QRadioButton#DoDay::indicator:checked{
-    border-image: url(:/ESM-8C_ICON/Checked.png);
-    }
-QLabel#Tip{
-    border-image: url(:/ESM-8C_ICON/Tip.png);
-    }
-QLabel#TipText{
-    padding:8px;
-    color: #FFFFFF;
-    line-height: 14px;
-    background: rgba(0,0,0,0.4);
-    border-radius: 4px;
-    border: 0px solid #E6E9F4;
-}

+ 0 - 160
demo/换肤/alarmrecordwidget.qss

@@ -1,160 +0,0 @@
-QLabel#label_alarm_1,
-#label_alarm_2,
-#label_alarm_3
-{
-font-size: 14px;
-font-weight: 400;
-color: #B1B3B4;
-line-height: 22px;
-}
-
-QPushButton#alarm_search
-{
-border-image:url(:/btn/source/search_normal.png);
-font-size: 14px;
-font-weight: 400;
-color: #FFFFFF;
-line-height: 22px;
-padding-left:12px;
-}
-QPushButton#alarm_search:hover
-{
-border-image:url(:/btn/source/search_hover.png);
-font-size: 14px;
-font-weight: 400;
-color: #FFFFFF;
-line-height: 22px;
-padding-left:12px;
-}
-
-QPushButton#alarm_reset
-{
-border-image:url(:/btn/source/reset_normal2.png);
-font-size: 14px;
-font-weight: 400;
-color: #D2D2D2;
-line-height: 22px;
-padding-left:12px;
-}
-QPushButton#alarm_reset:hover
-{
-border-image:url(:/btn/source/reset_hover2.png);
-font-size: 14px;
-font-weight: 400;
-color: #D2D2D2;
-line-height: 22px;
-padding-left:12px;
-}
-
-QPushButton#alarm_export
-{
-border-image:url(:/btn/source/export_normal2.png);
-font-size: 14px;
-font-weight: 400;
-color: #D2D2D2;
-line-height: 22px;
-padding-left:12px;
-}
-QPushButton#alarm_export:hover
-{
-border-image:url(:/btn/source/export_hover2.png);
-font-size: 14px;
-font-weight: 400;
-color: #D2D2D2;
-line-height: 22px;
-padding-left:12px;
-}
-
-QPushButton#alarm_print
-{
-border-image:url(:/btn/source/print_normal2.png);
-font-size: 14px;
-font-weight: 400;
-color: #D2D2D2;
-line-height: 22px;
-padding-left:12px;
-}
-QPushButton#alarm_print:hover
-{
-border-image:url(:/btn/source/print_hover2.png);
-font-size: 14px;
-font-weight: 400;
-color: #D2D2D2;
-line-height: 22px;
-padding-left:12px;
-}
-
-QTableView
-{
-	border:none;
-	background-color: rgba(32, 36, 40, 1);
-	font-weight:400;
-	font-size:14px;
-	min-height:60px;
-}
-QTableView::item::section
-{
-    border-bottom: 1px solid rgb(0, 0, 0);
-	border-color: rgb(222, 225, 230);
-	color: rgb(0, 0, 0);
-}
-QTableView::item:selected 
-{
-	background-color: rgb(0, 120, 215);
-}
-
-QHeaderView
-{
-	border:none;
-	background:rgba(49, 53, 57, 1);
-	qproperty-defaultAlignment: 'AlignHCenter|AlignVCenter';
-	font-size:14px;
-}
-QHeaderView::section
-{
-	border:none;	
-	background:rgba(49, 53, 57, 1);
-	color:rgba(210, 210, 210, 1);
-	min-height:40px;
-}
-
-QScrollBar:horizontal,QScrollBar:vertical
-{
-	border:none;
-	background-color: rgba(255, 255, 255, 0);
-    margin: 0px 0px 0px 0px;
-}
-QScrollBar:horizontal
-{
-    height: 12px;
-}
-QScrollBar:vertical
-{
-    width: 12px;
-}
-QScrollBar::handle:horizontal,QScrollBar::handle:vertical
-{
-    background: rgb(89, 89, 89);
-	border-radius: 6px;
-    min-width: 12px;
-}
-QScrollBar::handle:horizontal
-{
-	min-width: 12px;
-}
-QScrollBar::handle:vertical
-{
-	min-height: 12px;
-}
-QScrollBar::add-line:horizontal, QScrollBar::sub-line:horizontal,
-QScrollBar::add-line:vertical, QScrollBar::sub-line:vertical
-{
-	background-color: rgba(255, 255, 255, 0);
-	border: none;
-}
-QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal,
-QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical
-{
-	background-color: rgba(255, 255, 255, 0);
-    background: none;
-}

+ 0 - 77
demo/换肤/lhstylemanager.cpp

@@ -1,77 +0,0 @@
-#include "lhstylemanager.h"
-
-LHStyleManager* LHStyleManager::m_instance = NULL;
-
-LHStyleManager::LHStyleManager(QObject *parent) : QObject(parent)
-{
-    m_nCurStyle = eBlackStyle;
-}
-
-LHStyleManager::~LHStyleManager()
-{
-    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);
-    }
-}
-
-void LHStyleManager::UpdateWidgetStyle(QWidget *widget)
-{
-    if(widget == NULL)
-    {
-        return;
-    }
-    QString strBasePath = QCoreApplication::applicationDirPath();
-    QString strStylePath;
-    QString strName = widget->objectName().toLower();
-    if(m_nCurStyle == eWhiteStyle)
-    {
-        strStylePath = "white";
-    }
-    else if(m_nCurStyle == eBlackStyle)
-    {
-        strStylePath = "black";
-    }
-    QString strStyleFile = strBasePath + 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(SkinStyle style)
-{
-    if(m_nCurStyle == style)
-    {
-        return;
-    }
-
-    m_nCurStyle = style;
-
-    for(int i = 0; i < m_widgetList.size(); i++)
-    {
-        QWidget* widget = m_widgetList.at(i);
-        if(widget == NULL) continue;
-        UpdateWidgetStyle(widget);
-    }
-}

+ 0 - 46
demo/换肤/lhstylemanager.h

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