From 6f2170559d81cd3d61799944c4c204f40392da1b Mon Sep 17 00:00:00 2001 From: HwangKC Date: Sat, 12 Oct 2024 14:00:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=B7=A5=E5=85=B7=E6=A0=8F?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- applications/emsConfigurer/datafetcher.cpp | 9 + applications/emsConfigurer/datafetcher.h | 2 + applications/emsConfigurer/emsConfigurer.pro | 2 + applications/emsConfigurer/emscfgres.qrc | 3 + .../emsConfigurer/images/icons8-add-64.png | Bin 0 -> 2937 bytes .../emsConfigurer/images/icons8-close-64.png | Bin 0 -> 2636 bytes .../images/icons8-refresh-64.png | Bin 0 -> 2515 bytes applications/emsConfigurer/kutilities.cpp | 116 +++++ applications/emsConfigurer/kutilities.h | 19 + applications/emsConfigurer/main.cpp | 10 +- applications/emsConfigurer/maindialog.cpp | 29 +- applications/emsConfigurer/maindialog.h | 5 +- applications/emsConfigurer/mainwindow.cpp | 41 +- applications/emsConfigurer/mainwindow.h | 2 + applications/emsConfigurer/mainwindow.ui | 14 +- applications/emsConfigurer/mysqlutils.cpp | 70 ++- applications/emsConfigurer/mysqlutils.h | 6 +- applications/emsConfigurer/mytablemodel.cpp | 59 ++- applications/emsConfigurer/mytablemodel.h | 5 +- .../qdarkstyle/bingle/binglestyle.qrc | 40 +- .../qdarkstyle/bingle/material-blue.qss | 426 ++++++++++++++++++ applications/emsConfigurer/singleton.h | 5 +- applications/emsConfigurer/ziputils.h | 2 + 23 files changed, 766 insertions(+), 99 deletions(-) create mode 100644 applications/emsConfigurer/images/icons8-add-64.png create mode 100644 applications/emsConfigurer/images/icons8-close-64.png create mode 100644 applications/emsConfigurer/images/icons8-refresh-64.png create mode 100644 applications/emsConfigurer/kutilities.cpp create mode 100644 applications/emsConfigurer/kutilities.h create mode 100644 applications/emsConfigurer/qdarkstyle/bingle/material-blue.qss diff --git a/applications/emsConfigurer/datafetcher.cpp b/applications/emsConfigurer/datafetcher.cpp index 4be0b91..5ba3949 100644 --- a/applications/emsConfigurer/datafetcher.cpp +++ b/applications/emsConfigurer/datafetcher.cpp @@ -1,5 +1,7 @@ #include "datafetcher.h" #include "globalparameters.h" +#include "mysqlutils.h" +#include DataFetcher::DataFetcher() { @@ -13,6 +15,13 @@ DataFetcher::~DataFetcher() bool DataFetcher::Fetch(TableData& tbl_data) { + int rows = MysqlUtils::getInstance()->RetrieveTableData(tbl_data); + if (rows < 0) + { + hloge("Failed to retrieve signal data"); + return false; + } + return true; } diff --git a/applications/emsConfigurer/datafetcher.h b/applications/emsConfigurer/datafetcher.h index 35a07f4..c356884 100644 --- a/applications/emsConfigurer/datafetcher.h +++ b/applications/emsConfigurer/datafetcher.h @@ -1,6 +1,8 @@ #ifndef DATAFETCHER_H #define DATAFETCHER_H +#pragma execution_character_set("utf-8") + #include "globalparameters.h" class DataFetcher diff --git a/applications/emsConfigurer/emsConfigurer.pro b/applications/emsConfigurer/emsConfigurer.pro index 0ef8460..13abf6b 100644 --- a/applications/emsConfigurer/emsConfigurer.pro +++ b/applications/emsConfigurer/emsConfigurer.pro @@ -77,6 +77,7 @@ SOURCES += \ datafetcher.cpp \ devicepropertypage.cpp \ globalparameters.cpp \ + kutilities.cpp \ main.cpp \ maindialog.cpp \ mainwindow.cpp \ @@ -88,6 +89,7 @@ HEADERS += \ datafetcher.h \ devicepropertypage.h \ globalparameters.h \ + kutilities.h \ maindialog.h \ mainwindow.h \ mysqlutils.h \ diff --git a/applications/emsConfigurer/emscfgres.qrc b/applications/emsConfigurer/emscfgres.qrc index 8fe5920..30372c2 100644 --- a/applications/emsConfigurer/emscfgres.qrc +++ b/applications/emsConfigurer/emscfgres.qrc @@ -12,5 +12,8 @@ images/PageSetting.png images/PageSwitch.png images/PageUps.png + images/icons8-add-64.png + images/icons8-close-64.png + images/icons8-refresh-64.png diff --git a/applications/emsConfigurer/images/icons8-add-64.png b/applications/emsConfigurer/images/icons8-add-64.png new file mode 100644 index 0000000000000000000000000000000000000000..8effa474949ba87c7b024e77ecdfb5af2ff7ce17 GIT binary patch literal 2937 zcmV-<3x@QGP)HFqDXr6(tZ7i3tP)N@@i})J6Z;QWtTxL|sIJS|Tj3 z`fYtZJ(XF?EtpILx|LJ)RrNWy@42TZx4Un;Tc;buAOUe!b9fwEOabiRrXQkBb!_qdgjwWT_sRZbL$q1;!=vT{9|5}dt*TR6RhR^+KSR!7! zUj`TwR83}34f}#>z+Hhg91X0dC9sC+fwiOtRS{sQ14%T&cjCMPG1PR>fnw#mtd zrYbsRAET2r>ErG%UdAeB8l8Nlj&a`TWVzpc4AosrggNmGb8;};31O2s8|I|3|G*g% z<|Hl5No$ys)3T2@rSzG^Ch>4jd-+kqoGg~H)P4SDu4dFVIrzv)#6&pgi>!o*N)AO# zBFxk8 znH^oh@4X(Qio2p6JZy3Bh1<{KU`IqHBbD}2hFk1(s%BA) zevEMttGkl0mf@FBPG3R=B$V^4``k>ZV1c5!s%30Bw`)H3MDDn^oXzfW?k#7&tA!y6 z6|7UV3ciU~XNcyo+8LHu%E81kNGzp8etpr$l(I_E$~c!)POa_=V@w%SWh@zUOc_rp z*{obYrj$-K+dDFAG#_|u2`iFIVQeXf($sT4xs)eFOD^Tq*b=gIR|(@Lk}YGZd6b!u zY~z;XQVy%y5={q8DZ!jl!uiyRoK2hHy4t5speVHjL{BRvU(*3EFH=@(3Fp)dCGMQ6 zc5Yk=p&AXvkn~~>WK4kc2{ek5R?Mi3V!l_kD?aW27t)KFCK)m&@Ljfz5vsOK)%I#K zNX`T@vx_0Ch%d*fi=6BtdK9gg7Tq;Qb`e`7OLh_6O5Pl9&MxL(qGcA5>hl13HumKe zL5__X3NNNWcy1BL^YXO6+ItI|jo;?kI3bzxipfl$_%^C>d=wZYn6`glPHsgbdiYsF0<_ zg-}$;D&fV2q^tah&BsN~L;Jw9eDO+4V`xz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w;;_+70Bi8#pL!YF%hEaG>45qILu0 zw;C|C26LO7t7_f0B?P0iwHaw>Gw`iJV^aQ~;Son~(6)RWQ~OnsN0 zj?Q2{=+x8KrRR*4Y>TG0)yqLkA9sK8>eMrTbXAVOXXpmA3KpS>0c z11agdE08C}OZQ7g?-Fc1T7A3yIV5eePj3KK(&t*| j9>gF9F^ECv{?G9rcE>eVHc`i|00000NkvXXu0mjf=he9k literal 0 HcmV?d00001 diff --git a/applications/emsConfigurer/images/icons8-close-64.png b/applications/emsConfigurer/images/icons8-close-64.png new file mode 100644 index 0000000000000000000000000000000000000000..9f53969fc4f03d94c93f90f7c1f9da849864afe1 GIT binary patch literal 2636 zcmV-S3bXZzP)q537gAH*mbS)9V-t*RS4-oZx)p8gHnyXv;BXTJguXM#YUZ(sWv=K(ENfpx3)QpsMNTXg zVQX|FtZQH*|P#Sf&zOf>YO{3N1pDt_`7eQ3+$}X|*+BZ82!e$S%8@L?^Vt(1hKOi+`>b|LMnY9mW*<= zZ56Psg6Y(1{%8n!a}4FpaWML*BqYm0WJU!Zv6oSSFTH&3ZwHw(qnxR&Wx=2JbKq3x z!+F=rDZ!HY0$OG{Y%gaz$MIVTz?#-El()tp(6`NkGRyIZz07ia*>eyib7e~A=fw2_ z>b-E?Qwd?&WoX%DkX339;rJNJ+hY*u5MkM+c*I_I>D`5yILesHmCVn^kyVB|7mfv0 zP6?J>rD(fKVOK~9ZKEh{w?S%?z+KPd5qmqI4=+&0-ub-Q{A}1eOHuEJy{J`Cf+epQ zEw2P}OUxmh97Q=f3R0Vd=9b_QdwIq9@*P2;GG<Z^&B-r5~vcQ4Izo!e9u?maL=4ZnybfC&u5zAQ)2T?_P@fPicJ$q4w zAVc`+VVtK&!01!MoIiFfC|t~oJ$*kc#;IWx8RPT_9lwVmv_#yGDk;EHT!dCq1SLi0 zlh8hl^Mhe9x;-R>k|I3%9wmF2DwCdk`!I^U`@yi;eDNMsu~%G#&#~N3K3oW8yV1&a zLusKogfqi9ox>otD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V(kx$+o3lANU?iuWs`p)z9lyL3e~T|!$CNs2wqE3GJBeu19u zy>Llzm(yiXnwA<-(yO>`S{lkTj7_;U^v0ZYOwUKmGMnPrN@Q=Z@k=$j| zJ~ou@^%iCvd7h>tt(>yO?zfwVUcy#J@r2bolHU$GAB|#dB;T)%zakQRYuZR z8AX3ZES{3HR7Fs?J_4#DhF_L$h(Kx6_H2%}zXou+hgjUJ7ID(*t+oGzSsy{W(5#R6 z?M(k%9C*F0UWnSJKf6UspfpN0hoPws=UjCd=QoF= z8cJIwaqXrsj#Y=l{aTh)hf^#*i!m`b;wH9)@z+0u!Im&G9n?Q)(|@vAJM!(RYAv^I zS;%KruZ527^=%2IQ0OlSr#4o8Ky4_cwV_a}aqK#((lV)5!+vW{D4*7Z5F|NCO(-F? z8a@*qHKDXR`WHmvnwn55YBYRN8_MUkp=0pPQB4T$^$X~$)6l<7IcHk!jcqGs~0K#uGRgvZqO-`oGMd0frxC+2eU$$9X^ zJgTH0BTvm`@lyeue|j!FJ(rae)yE5J`}+>#PLm%+&-&B9+aI3wyZmQDlOOAz_2)#h z?>Kx9=qP*qDB9!8`DQ=Z<404|2yTqd@?;QGoBeoN)NJSNfSwnH;Y@nIoaw1 zE#7?aobL!19S+dyOLVI@Cq%7QA9_V?=}Mr@o7sE4c;iKHu*LIjD&~%r|MNchz39br z1OB4cUKI-IO5&iFNo}62YFBZ(T?K6_`rB3PYxiVn({$(mu~FRM{-PqY&69SU7dG#^ zn!JYJpPVrE`!KD`lLtDL^mciIHI$s`QnIg8$?v=7pzlhQu{{30S=^uB+krV)UYf&eFU_I +#include +#include +#include + +Kutilities::Kutilities() {} + + +// 函数用于将内存块转换为十六进制字符串 +std::string Kutilities::printHex(const void* data, size_t size) +{ + std::ostringstream oss; + std::ostringstream oss2; + std::ostringstream ossrow; + + // 每行输出的字节数 + const size_t lineSize = 16; + const unsigned char* p = static_cast(data); + + int ic = 0; + int row = 0; + + ossrow << std::setw(8) << std::setfill('0') << std::hex << row++ << "h : "; + oss << ossrow.str().c_str(); + + for( size_t i = 0; i < size; ++i ) + { + ic++; + // 每个字节之间用空格分隔 + oss << std::setw(2) << std::setfill('0') << std::hex << std::uppercase << static_cast(p[i]); + + char ch = (isprint(p[i]) != 0) ? p[i] : '.'; + + oss2 << ch; + + //每lineSize个字节换行 + if( (i + 1) % lineSize == 0 ) + { + ossrow.clear(); + ossrow.str(""); + + oss << " [" << oss2.str().c_str() << "]" << std::endl; + oss2.clear(); + oss2.str(""); + + ossrow << std::setw(8) << std::setfill('0') << std::hex << row++ << "h : "; + oss << ossrow.str().c_str(); + + ic = 0; + } + else if( i == size - 1 ) + { + if( (i + 1) % lineSize != 0 ) + { + if( i % 2 != 0 ) + { + for( size_t j = 0; j < (lineSize - ic); j++ ) + { + oss << " --"; + } + } + else + { + for( size_t j = 0; j < (lineSize - ic); j++ ) + { + oss << " --"; + } + } + } + oss << " [" << oss2.str().c_str(); + + if( (i + 1) % lineSize != 0 ) + { + for( size_t j = 0; j < (lineSize - ic); j++ ) + { + oss << " "; + } + } + + oss << "]" << std::endl; + oss2.clear(); + oss2.str(""); + + ic = 0; + } +#if 0 + else if( (i + 1) % 8 == 0 ) + { + oss << " "; + oss2 << " "; + } +#endif + else + { + oss << " "; + } + } + return oss.str(); +} + + +std::string Kutilities::get_current_timestamp() +{ + auto now = std::chrono::system_clock::now(); + //通过不同精度获取相差的毫秒数 + uint64_t dis_millseconds = std::chrono::duration_cast(now.time_since_epoch()).count() + - std::chrono::duration_cast(now.time_since_epoch()).count() * 1000; + time_t tt = std::chrono::system_clock::to_time_t(now); + auto time_tm = localtime(&tt); + char strTime[25] = { 0 }; + sprintf(strTime, "%d-%02d-%02d %02d:%02d:%02d.%03d", time_tm->tm_year + 1900, + time_tm->tm_mon + 1, time_tm->tm_mday, time_tm->tm_hour, + time_tm->tm_min, time_tm->tm_sec, (int)dis_millseconds); + return std::string(strTime); +} diff --git a/applications/emsConfigurer/kutilities.h b/applications/emsConfigurer/kutilities.h new file mode 100644 index 0000000..840e496 --- /dev/null +++ b/applications/emsConfigurer/kutilities.h @@ -0,0 +1,19 @@ +#ifndef KUTILITIES_H +#define KUTILITIES_H +#pragma execution_character_set("utf-8") + +#include + +class Kutilities +{ +public: + Kutilities(); + + //获取当前精确到毫秒的时间戳,返回字符串格式YYYY-MM-DD HH:MI:SS.MMM + static std::string get_current_timestamp(); + + // 函数用于将内存块转换为十六进制字符串 + static std::string printHex(const void* data, size_t size); +}; + +#endif // KUTILITIES_H diff --git a/applications/emsConfigurer/main.cpp b/applications/emsConfigurer/main.cpp index 5338be9..9eb1bbd 100644 --- a/applications/emsConfigurer/main.cpp +++ b/applications/emsConfigurer/main.cpp @@ -43,11 +43,11 @@ int main(int argc, char *argv[]) hlog_fsync(); //若是系统自带的QStyle风格,则需要先创建为QStyleFactory::create(""),然后设置qApp->setStyle() - QStringList listStyle = QStyleFactory::keys(); - foreach(QString val, listStyle) //打印当前系统支持的系统风格,,且打印出来 - { - qDebug()<addItem(spacer); // Create actions for the toolbar - QAction *action1 = new QAction(QIcon(":/images/icon.png"), "Button 1", this); - QAction *action2 = new QAction(QIcon(":/images/icon.png"), "Button 2", this); - QAction *action3 = new QAction(QIcon(":/images/icon.png"), "About...", this); + QAction *action1 = new QAction(QIcon(":/images/icons8-add-64.png"), tr("Add Device"), this); + action1->setToolTip(tr("Add a new device")); + + QAction *action2 = new QAction(QIcon(":/images/icons8-close-64.png"), tr("Remove Device"), this); + action2->setToolTip(tr("Remove a device")); + + QAction *action4 = new QAction(QIcon(":/images/icons8-refresh-64.png"), tr("Refresh"), this); + action4->setToolTip(tr("Refresh")); + + QAction *action3 = new QAction(QIcon(":/images/icon.png"), tr("About..."), this); + action3->setToolTip(tr("Show information about EMU Configurer toolkit")); // Add actions to the toolbar m_pMainToolBar->addAction(action1); m_pMainToolBar->addAction(action2); + m_pMainToolBar->addAction(action4); + m_pMainToolBar->addSeparator(); m_pMainToolBar->addAction(action3); // 将工具栏的 widget 设置为包含图标和占位符的 widget @@ -134,7 +144,8 @@ void MainDialog::CreateToolbar() // Connect actions to slots connect(action1, &QAction::triggered, this, &MainDialog::onToolButton1Clicked); - connect(action2, &QAction::triggered, this, &MainDialog::onToolButton1Clicked); + connect(action2, &QAction::triggered, this, &MainDialog::onToolButton2Clicked); + connect(action4, &QAction::triggered, this, &MainDialog::onToolRefreshClicked); connect(action3, &QAction::triggered, this, &MainDialog::onAboutButtonClicked); } @@ -159,7 +170,7 @@ void MainDialog::CreateTablePage() m_pDevicestackedWidget->addWidget(new QPushButton("Page 5")); m_pDevicestackedWidget->addWidget(new QPushButton("Page 6")); #endif - // setLayout(stackedWidgetLayout); + // setLayout(stackedWidgetLayout); } void MainDialog::CreateIcon(const QIcon& icon,QString text) @@ -200,18 +211,26 @@ void MainDialog::loadWindowState() restoreState(settings.value("windowState").toByteArray()); } +//增加设备 void MainDialog::onToolButton1Clicked() { QMessageBox::information(this, "Button Clicked", "Button 1 was clicked!"); } +//删除设备 void MainDialog::onToolButton2Clicked() { QMessageBox::information(this, "Button Clicked", "Button 2 was clicked!"); } +//关于 void MainDialog::onAboutButtonClicked() { QMessageBox::information(this, "Button Clicked", "About"); } +//刷新 +void MainDialog::onToolRefreshClicked() +{ + QMessageBox::information(this, "Refresh Button Clicked", "Refresh"); +} diff --git a/applications/emsConfigurer/maindialog.h b/applications/emsConfigurer/maindialog.h index 885658e..bce63ef 100644 --- a/applications/emsConfigurer/maindialog.h +++ b/applications/emsConfigurer/maindialog.h @@ -1,5 +1,6 @@ #ifndef MAINDIALOG_H #define MAINDIALOG_H +#pragma execution_character_set("utf-8") #include #include @@ -8,7 +9,8 @@ #include #include -namespace Ui { +namespace Ui +{ class MainDialog; } @@ -31,6 +33,7 @@ public slots: private slots: void onToolButton1Clicked(); void onToolButton2Clicked(); + void onToolRefreshClicked(); void onAboutButtonClicked(); private: diff --git a/applications/emsConfigurer/mainwindow.cpp b/applications/emsConfigurer/mainwindow.cpp index 22775d6..2a05a71 100644 --- a/applications/emsConfigurer/mainwindow.cpp +++ b/applications/emsConfigurer/mainwindow.cpp @@ -29,7 +29,7 @@ MainWindow::MainWindow(QWidget *parent) QRegularExpressionValidator* ipValidator = new QRegularExpressionValidator(rx, this); ui->serverIp->setValidator(ipValidator); //setIp("127.0.0.1"); - setIp("192.168.4.254"); + setIp("192.168.10.254"); } MainWindow::~MainWindow() @@ -47,15 +47,7 @@ void MainWindow::setIp(const QString &ip) ui->serverIp->setText(ip); } -void MainWindow::on_pb_Logon_clicked() -{ - m_pMainDialog = new MainDialog(); - m_pMainDialog->show(); - this->close(); -} - - -void MainWindow::on_pb_Test_clicked() +bool MainWindow::testDatabase() { QString svr = ui->serverIp->text(); std::string dbserver = svr.toStdString(); //"tcp://192.168.4.254"; @@ -67,12 +59,33 @@ void MainWindow::on_pb_Test_clicked() if (!dbok) { hloge("failed to open database, exit now..."); - QMessageBox::critical(this, tr("Critical Message"),tr("Failed to connect to device!")); - return; + return false; } hlogi("database connection test successfully!"); - - QMessageBox::information(this, tr("Successfully"),tr("Connect to device successfully!")); + return true; +} + +void MainWindow::on_pb_Logon_clicked() +{ + if (testDatabase()) + { + m_pMainDialog = new MainDialog(); + m_pMainDialog->show(); + this->close(); + } + else + { + QMessageBox::critical(this, tr("Critical Message"),tr("Failed to retrieve device data!")); + } +} + + +void MainWindow::on_pb_Test_clicked() +{ + if (testDatabase()) + QMessageBox::information(this, tr("Successfully"),tr("Connect to device successfully!")); + else + QMessageBox::critical(this, tr("Critical Message"),tr("Failed to connect to device!")); } diff --git a/applications/emsConfigurer/mainwindow.h b/applications/emsConfigurer/mainwindow.h index 679c4a3..ebda528 100644 --- a/applications/emsConfigurer/mainwindow.h +++ b/applications/emsConfigurer/mainwindow.h @@ -1,5 +1,6 @@ #ifndef MAINWINDOW_H #define MAINWINDOW_H +#pragma execution_character_set("utf-8") #include @@ -22,6 +23,7 @@ public: protected: void setIp(const QString &ip); + bool testDatabase(); private slots: void on_pb_Logon_clicked(); diff --git a/applications/emsConfigurer/mainwindow.ui b/applications/emsConfigurer/mainwindow.ui index 62f991d..63ba472 100644 --- a/applications/emsConfigurer/mainwindow.ui +++ b/applications/emsConfigurer/mainwindow.ui @@ -26,9 +26,9 @@ - 160 + 120 183 - 61 + 101 21 @@ -63,7 +63,7 @@ 250 180 - 124 + 121 23 @@ -182,9 +182,9 @@ - 160 + 120 207 - 68 + 111 30 @@ -195,9 +195,9 @@ - 160 + 120 240 - 56 + 101 21 diff --git a/applications/emsConfigurer/mysqlutils.cpp b/applications/emsConfigurer/mysqlutils.cpp index 341a566..7c53fb4 100644 --- a/applications/emsConfigurer/mysqlutils.cpp +++ b/applications/emsConfigurer/mysqlutils.cpp @@ -2,6 +2,8 @@ #include #include +#include "ziputils.h" +#include "kutilities.h" #ifdef _USING_MYSQL_CONNECTOR_ #include @@ -37,7 +39,7 @@ bool MysqlUtils::OpenDatabase(const std::string& server, int dbport, const std:: { bool ok = false; #ifdef _USING_QT_MYSQL_CONNECTOR_ - // 打开数据库 + //打开数据库 if (m_DbConnection.isOpen() && m_DbConnection.isValid()) { hlogd("database already connected."); @@ -54,7 +56,7 @@ bool MysqlUtils::OpenDatabase(const std::string& server, int dbport, const std:: #endif #ifdef _USING_MYSQL_CONNECTOR_ - // 创建连接 + //创建连接 sql::Driver *driver = nullptr; driver = get_driver_instance(); @@ -78,7 +80,7 @@ bool MysqlUtils::OpenDatabase(const std::string& server, int dbport, const std:: #ifdef _USING_MYSQL_51_LIB_ m_DbConnection = mysql_init(NULL); - // 连接到MySQL服务器 + //连接到MySQL服务器 if (!mysql_real_connect(m_DbConnection, server.c_str(), dbuser.c_str(), dbpasswd.c_str(), database.c_str(), dbport, NULL, 0)) { hloge("MySQL connection error: %s",mysql_error(m_DbConnection)); @@ -100,7 +102,7 @@ bool MysqlUtils::OpenDatabase(const std::string& server, int dbport, const std:: #if 0 MYSQL_RES* res; MYSQL_ROW row; - // 执行 SQL 查询 + //执行SQL查询 if (mysql_query(m_DbConnection, "SELECT * FROM tbl_device")) { qDebug() << "Error: " << mysql_error(m_DbConnection) ; @@ -108,7 +110,7 @@ bool MysqlUtils::OpenDatabase(const std::string& server, int dbport, const std:: return 1; } - res = mysql_use_result(m_DbConnection); // 获取结果集 + res = mysql_use_result(m_DbConnection); while ((row = mysql_fetch_row(res)) != NULL) { @@ -119,7 +121,7 @@ bool MysqlUtils::OpenDatabase(const std::string& server, int dbport, const std:: qDebug() << "\r\n"; } - mysql_free_result(res); // 释放结果集资源 + mysql_free_result(res); #endif } @@ -142,6 +144,60 @@ void MysqlUtils::CloseDatabase() #endif #ifdef _USING_MYSQL_51_LIB_ - mysql_close(m_DbConnection); // 关闭连接 + mysql_close(m_DbConnection); #endif } + +int MysqlUtils::RetrieveTableData(TableData& tbl_data) +{ +#if 1 + MYSQL_RES* res; + MYSQL_ROW row; + //执行SQL 查询 + if (mysql_query(m_DbConnection, "SELECT * FROM `hjems`.`tbl_data` ORDER BY data_timestamp LIMIT 0,100")) + { + hloge( "Error: %s", mysql_error(m_DbConnection) ) ; + return -1; + } + + res = mysql_use_result(m_DbConnection); + + while ((row = mysql_fetch_row(res)) != NULL) + { + ModelItem item; + // item.status = STATUS_WARN; + // item.ParameterName= "Visual Leak Detector detected 1 memory leak (84 bytes)"; + // item.sampleTime = "2024-9-10 11:22:33.444"; + // item.unit = "C"; + // item.value = "100"; + // tbl_data.append(item); + + std::string buf; + for (unsigned int i = 0; i < mysql_num_fields(res); ++i) + { + qDebug() << mysql_fetch_field_direct(res,i)->name ; + QString field_name (mysql_fetch_field_direct(res,i)->name); + if (field_name == "data_timestamp") + { + item.sampleTime = row[i]; + qDebug() << row[i]; + } + else if (field_name == "data_content") + { + std::string v(row[i]); + qDebug() << Kutilities::printHex(v.c_str(),v.length()).c_str(); + ZipUtils::DecompressString(v.c_str(),v.length(),buf); + qDebug() << buf.c_str(); + } + } + qDebug() << "\r\n"; + } + + unsigned long row_count = res->row_count; + + mysql_free_result(res); + + return row_count; +#endif +} + diff --git a/applications/emsConfigurer/mysqlutils.h b/applications/emsConfigurer/mysqlutils.h index 82b8313..0cedc6f 100644 --- a/applications/emsConfigurer/mysqlutils.h +++ b/applications/emsConfigurer/mysqlutils.h @@ -1,5 +1,6 @@ #ifndef MYSQLUTILS_H #define MYSQLUTILS_H +#pragma execution_character_set("utf-8") #include @@ -13,9 +14,11 @@ #ifdef _USING_MYSQL_51_LIB_ #include -#include // MySQL C API 头文件 +#include //MySQL C API include file #endif +#include "globalparameters.h" + class MysqlUtils { protected: @@ -28,6 +31,7 @@ public: void CloseDatabase(); bool OpenDatabase(const std::string& server = "127.0.0.1", int dbport = 3306, const std::string& dbuser = "root", const std::string& dbpasswd = "Hj57471000", const std::string& database="hjems"); + int RetrieveTableData(TableData& tbl_data); private: #ifdef _USING_QT_MYSQL_CONNECTOR_ diff --git a/applications/emsConfigurer/mytablemodel.cpp b/applications/emsConfigurer/mytablemodel.cpp index 1e7d268..37c8923 100644 --- a/applications/emsConfigurer/mytablemodel.cpp +++ b/applications/emsConfigurer/mytablemodel.cpp @@ -5,16 +5,6 @@ MyTableModel::MyTableModel(QObject* parent) :QAbstractTableModel(parent) { - for(int i=0;i<100;i++) - { - ModelItem item; - item.status = STATUS_WARN; - item.ParameterName= "Visual Leak Detector detected 1 memory leak (84 bytes)"; - item.sampleTime = "2024-9-10 11:22:33.444"; - item.unit = "C"; - item.value = "100"; - m_modelData.append(item); - } } int MyTableModel::rowCount(const QModelIndex & /*parent*/) const @@ -37,20 +27,23 @@ QVariant MyTableModel::data(const QModelIndex& index, int role) const const int row = index.row(); switch (index.column()) { - case 0: - { - if (m_modelData.at(row).status == STATUS_NORMAL) return tr("Normal"); - if (m_modelData.at(row).status == STATUS_INFO) return tr("INFO"); - if (m_modelData.at(row).status == STATUS_WARN) return tr("WARN"); - if (m_modelData.at(row).status == STATUS_ERROR) return tr("ERROR"); - } - case 1: - { - return m_modelData.at(row).ParameterName.c_str(); - } - case 2: return m_modelData.at(row).value.c_str(); - case 3: return m_modelData.at(row).unit.c_str(); - case 4: return m_modelData.at(row).sampleTime.c_str(); + case 0: + { + if (m_modelData.at(row).status == STATUS_NORMAL) return tr("Normal"); + if (m_modelData.at(row).status == STATUS_INFO) return tr("INFO"); + if (m_modelData.at(row).status == STATUS_WARN) return tr("WARN"); + if (m_modelData.at(row).status == STATUS_ERROR) return tr("ERROR"); + } + case 1: + { + return m_modelData.at(row).ParameterName.c_str(); + } + case 2: + return m_modelData.at(row).value.c_str(); + case 3: + return m_modelData.at(row).unit.c_str(); + case 4: + return m_modelData.at(row).sampleTime.c_str(); } } @@ -79,14 +72,14 @@ QVariant MyTableModel::data(const QModelIndex& index, int role) const const int row = index.row(); switch (index.column()) { - case 0: //状态 - case 2: //数值 - { - if (m_modelData.at(row).status == STATUS_WARN) - return QVariant(QColor(Qt::yellow)); - else if (m_modelData.at(row).status == STATUS_ERROR) - return QVariant(QColor(Qt::red)); - } + case 0: //状态 + case 2: //数值 + { + if (m_modelData.at(row).status == STATUS_WARN) + return QVariant(QColor(Qt::yellow)); + else if (m_modelData.at(row).status == STATUS_ERROR) + return QVariant(QColor(Qt::red)); + } } } @@ -132,7 +125,7 @@ void MyTableModel::setModelData(TableData data) beginResetModel(); //通过这个告诉我要开始修改model了 m_modelData.clear(); - for (int i = 0;i < data.count();++i) + for (int i = 0; i < data.count(); ++i) { m_modelData.append(data[i]); } diff --git a/applications/emsConfigurer/mytablemodel.h b/applications/emsConfigurer/mytablemodel.h index 6a35812..7d2b610 100644 --- a/applications/emsConfigurer/mytablemodel.h +++ b/applications/emsConfigurer/mytablemodel.h @@ -1,7 +1,6 @@ -#pragma execution_character_set("utf-8") - -#ifndef MYTABLEMODEL_H +#ifndef MYTABLEMODEL_H #define MYTABLEMODEL_H +#pragma execution_character_set("utf-8") #include #include diff --git a/applications/emsConfigurer/qdarkstyle/bingle/binglestyle.qrc b/applications/emsConfigurer/qdarkstyle/bingle/binglestyle.qrc index 2cc7ef2..53ccfb6 100644 --- a/applications/emsConfigurer/qdarkstyle/bingle/binglestyle.qrc +++ b/applications/emsConfigurer/qdarkstyle/bingle/binglestyle.qrc @@ -1,21 +1,21 @@ - - - - QSS_IMG/go-down-symbolic.symbolic.png - QSS_IMG/go-next-symbolic.symbolic.png - QSS_IMG/go-previous-symbolic.symbolic.png - QSS_IMG/go-up-symbolic.symbolic.png - QSS_IMG/object-select-symbolic.symbolic.png - - - AMOLED.qss - Aqua.qss - ConsoleStyle.qss - ElegantDark.qss - MacOS.qss - ManjaroMix.qss - MaterialDark.qss - NeonButtons.qss - Ubuntu.qss - + + + QSS_IMG/go-down-symbolic.symbolic.png + QSS_IMG/go-next-symbolic.symbolic.png + QSS_IMG/go-previous-symbolic.symbolic.png + QSS_IMG/go-up-symbolic.symbolic.png + QSS_IMG/object-select-symbolic.symbolic.png + + + AMOLED.qss + Aqua.qss + ConsoleStyle.qss + ElegantDark.qss + MacOS.qss + ManjaroMix.qss + MaterialDark.qss + NeonButtons.qss + Ubuntu.qss + material-blue.qss + diff --git a/applications/emsConfigurer/qdarkstyle/bingle/material-blue.qss b/applications/emsConfigurer/qdarkstyle/bingle/material-blue.qss new file mode 100644 index 0000000..186f257 --- /dev/null +++ b/applications/emsConfigurer/qdarkstyle/bingle/material-blue.qss @@ -0,0 +1,426 @@ +QWidget:window { /* Borders around the code editor and debug window */ + border: 0px solid #263238; + background-color: #263238; +} + +QToolTip { + background-color: #80CBC4; + color: black; + padding: 5px; + border-radius: 0; + opacity: 200; +} + +/* ==================== Dialog ==================== */ +QLabel { + background: transparent; + color: #CFD8DC; /* Not sure about this one */ +} + +QDialog, QListView { + background-color: #263238; + color: #546E7A; + outline: 0; + border: 2px solid transparent; +} + +QListView::item:hover { + color: #AFBDC4; + background: transparent; +} + + +QListView::item:selected { + color: #ffffff; + background: transparent; +} + +/* === QTabBar === */ +QTabBar { + background: #263238; +} + +QTabWidget::pane { + background: transparent; /* Only at the very bottom of the tabs */ +} + +QTabBar::tab { + background: transparent; + border: 0px solid transparent; + border-bottom: 2px solid transparent; + color: #546E7A; + padding-left: 10px; + padding-right: 10px; + padding-top: 3px; + padding-bottom: 3px; +} + +QTabBar::tab:hover { + background-color: transparent; + border: 0px solid transparent; + border-bottom: 2px solid #80CBC4; + color: #AFBDC4; +} + +QTabBar::tab:selected { + background-color: transparent; + border: 0px solid transparent; + border-top: none; + border-bottom: 2px solid #80CBC4; + color: #FFFFFF; +} + +QStackedWidget { + background: #263238; /* This covers a bunch of things, I was thinking about making it transparent, */ + /* but I would have to find all the other elements... but QTabWidget::pane may be it */ +} + + +/* === QGroupBox === */ +QGroupBox { + border: 1px solid transparent; + margin-top: 1em; +} + +QGroupBox::title { + color: #80CBC4; + subcontrol-origin: margin; + left: 6px; + padding: 0 3px 0 3px; +} + +QComboBox { + color: #546E7A; + background-color: transparent; + selection-background-color: transparent; + outline: 0; +} + +QComboBox QAbstractItemView +{ + selection-background-color: transparent; + outline: 0; +} + +/* === QCheckBox === */ +QCheckBox, QRadioButton { + color: #AFBDC4; +} + +QCheckBox::indicator::unchecked { + background-color: #263238; + border: 1px solid #536D79; +} + +QRadioButton::indicator::unchecked { + background-color: #263238; + border: 1px solid #536D79; + border-radius: 4px; +} + +QCheckBox::indicator::checked, QTreeView::indicator::checked { + background-color: qradialgradient(cx:0.5, cy:0.5, fx:0.25, fy:0.15, radius:0.3, stop:0 #80CBC4, stop:1 #263238); + border: 1px solid #536D79; +} + +QRadioButton::indicator::checked { + background-color: qradialgradient(cx:0.5, cy:0.5, fx:0.25, fy:0.15, radius:0.3, stop:0 #80CBC4, stop:1 #263238); + border: 1px solid #536D79; + border-radius: 4px; +} + +QCheckBox::indicator:disabled, QRadioButton::indicator:disabled, QTreeView::indicator:disabled { + background-color: #444444; /* Not sure what this looks like */ +} + +QCheckBox::indicator::checked:disabled, QRadioButton::indicator::checked:disabled, QTreeView::indicator::checked:disabled { + background-color: qradialgradient(cx:0.5, cy:0.5, fx:0.25, fy:0.15, radius:0.3, stop:0 #BBBBBB, stop:1 #444444); /* Not sure what this looks like */ +} + +QTreeView { + background-color: transparent; + color: #546E7A; + outline: 0; + border: 0; +} + +QTreeView::item:hover { + background-color: transparent; + color: #AFBDC4; +} + +QTreeView::item:selected { + background-color: transparent; + color: #FFFFFF; +} + +QTreeView QHeaderView:section { + background-color: #263238; + color: #CFD8DC; + border: 0; +} + +QTreeView::indicator:checked { + background-color: qradialgradient(cx:0.5, cy:0.5, fx:0.25, fy:0.15, radius:0.3, stop:0 #80CBC4, stop:1 #263238); + border: 1px solid #536D79; + selection-background-color: transparent; +} + +QTreeView::indicator:unchecked { /* This and the one above style the checkbox in the Options -> Keyboard */ + background-color: #263238; /* This is still a hover over in blue I can't get rid of */ + border: 1px solid #536D79; + selection-background-color: transparent; +} + +/*QTreeView QScrollBar { + background-color: #263238 +}*/ + +QTreeView::branch { + /* Skip - applies to everything */ +} + +QTreeView::branch:has-siblings:adjoins-item { + /* Skip - files */ +} + +QTreeView::branch:has-siblings:!adjoins-item { + /* Skip - applies to almost all on the left side */ +} + +QTreeView::branch:closed:has-children:has-siblings { + background: url('./images/rightarrowgray.png') center center no-repeat; +} + +QTreeView::branch:has-children:!has-siblings:closed { + background: url('./images/rightarrowgray.png') center center no-repeat; +} + +QTreeView::branch:!has-children:!has-siblings:adjoins-item { + /* Skip - files */ +} + +QTreeView::branch:open:has-children:has-siblings { + background: url('./images/downarrowgray.png') center center no-repeat; +} + +QTreeView::branch:open:has-children:!has-siblings { + background: url('./images/downarrowgray.png') center center no-repeat; +} + +/* === QScrollBar:horizontal === */ +QScrollBar:horizontal { + background: #263238; /* Background where slider is not */ + height: 10px; + margin: 0; +} + +QScrollBar:vertical { + background: #263238; /* Background where slider is not */ + width: 10px; + margin: 0; +} + +QScrollBar::handle:horizontal { + background: #37474F; /* Slider color */ + min-width: 16px; + border-radius: 5px; +} + +QScrollBar::handle:vertical { + background: #37474F; /* Slider color */ + min-height: 16px; + border-radius: 5px; +} + +QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal, +QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical { + background: none; /* Removes the dotted background */ +} + +QScrollBar::add-line:horizontal, QScrollBar::sub-line:horizontal, +QScrollBar::add-line:vertical, QScrollBar::sub-line:vertical { /* Hides the slider arrows */ + border: none; + background: none; +} + +QPushButton { + background-color: transparent; + color: #546E7A; + border: 1px solid transparent; + padding: 4px 22px; +} + +QPushButton:hover { + color: #AFBDC4; +} + +QPushButton:pressed { + color: #FFFFFF; +} + +QLineEdit { + background: transparent; + border: 1px solid transparent; + color: #546E7A; +} + +QSpinBox { + background: transparent; + border: 1px solid transparent; + color: #546E7A; +} + +/***************************************************************************** +Main Screen +*****************************************************************************/ +QTreeView { + background-color: #263238; +} + +QMenu { + background-color: #263238; /* File Menu Background color */ + color: #546E7A; +} + +QMenu::item:selected { + color: #AFBDC4; +} + +QMenu::item:pressed { + color: #FFFFFF; +} + +QMenu::separator { + height: 1px; + background: transparent; /* Could change this to #546E7A and reduce the margin top and bottom to 1px */ + margin-left: 10px; + margin-right: 10px; + margin-top: 5px; + margin-bottom: 5px; +} + +/* === QMenuBar === */ +QMenuBar { + background-color: #263238; + color: #546E7A; +} + +QMenuBar::item { + background: transparent; +} + +QMenuBar::item:disabled { + color: gray; +} + +QMenuBar::item:selected { + color: #AFBDC4; +} + +QMenuBar::item:pressed { + color: #FFFFFF; +} + +QToolBar { + background: #263238; + border: 1px solid transparent; +} + +QToolBar:handle { + background: transparent; + border-left: 2px dotted #80CBC4; /* Fix the 4 handle dots so it doesn't look crappy */ + color: transparent; +} + +QToolBar::separator { + border: 0; +} + +/* === QToolButton === */ +QToolButton:hover, QToolButton:pressed { + background-color: transparent; +} + +QToolButton::menu-button { + background: url('./images/downarrowgray.png') center center no-repeat; + background-color: #263238; /* This needs to be set to ensure the other brown arrows don't show */ +} + +QToolButton::menu-button:hover, QToolButton::menu-button:pressed { + background-color: #263238; +} + +QStatusBar { + background-color: #263238; +} + +QLabel { + color: #546E7A; /* Text at the bottom right corner of the screen */ +} + +QToolButton { /* I don't like how the items depress */ + color: #546E7A; +} + +QToolButton:hover, QToolButton:pressed, QToolButton:checked { + background-color: #263238; +} + +QToolButton:hover { + color: #AFBDC4; + +} + +QToolButton:checked, QToolButton:pressed { + color: #FFFFFF; +} + + +QToolButton { + border: 1px solid transparent; + margin: 1px; +} + +QToolButton:hover { + background-color: transparent; /* I don't like how the down arrows in the top menu bar move down when clicked */ + border: 1px solid transparent; +} + +QToolButton[popupMode="1"] { /* only for MenuButtonPopup */ + padding-right: 20px; /* make way for the popup button */ +} + +QToolButton::menu-button { + border-left: 1px solid transparent; + background: transparent; + width: 16px; +} + +QToolButton::menu-button:hover { + border-left: 1px solid transparent; + background: transparent; + width: 16px; +} + +QStatusBar::item { + color: #546E7A; + background-color: #263238; +} + +QAbstractScrollArea { /* Borders around the code editor and debug window */ + border: 0; +} + +/***************************************************************************** +Play around with these settings +*****************************************************************************/ + +/* Force the dialog's buttons to follow the Windows guidelines. */ +QDialogButtonBox { + button-layout: 0; +} + +QTabWidget::tab-bar { + left: 0px; /* Test this out on OS X, it will affect the tabs in the Options Dialog, on OS X they are centered */ +} diff --git a/applications/emsConfigurer/singleton.h b/applications/emsConfigurer/singleton.h index 28fb811..51a9798 100644 --- a/applications/emsConfigurer/singleton.h +++ b/applications/emsConfigurer/singleton.h @@ -1,7 +1,6 @@ #ifndef SINGLETON_H #define SINGLETON_H - -#include +#pragma execution_character_set("utf-8") template class Singleton @@ -17,7 +16,7 @@ public: Singleton& operator =(const Singleton&)=delete; protected: - struct token{}; // helper class + struct token {}; // helper class Singleton() noexcept=default; }; diff --git a/applications/emsConfigurer/ziputils.h b/applications/emsConfigurer/ziputils.h index 89b96a7..449078f 100644 --- a/applications/emsConfigurer/ziputils.h +++ b/applications/emsConfigurer/ziputils.h @@ -1,5 +1,7 @@ #ifndef ZIPUTILS_H #define ZIPUTILS_H +#pragma execution_character_set("utf-8") + #include class ZipUtils