diff --git a/.gitignore b/.gitignore index 3a2b0413..8fe51aac 100644 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,8 @@ HmiFuncDesignerBin/bin/project HmiFuncDesignerBin/bin/QSCADARunTime HmiFuncDesignerBin/bin/RtdbView HmiFuncDesignerBin/bin/SysTagManager +HmiFuncDesignerBin/bin/ProjectManager +HmiFuncDesignerBin/bin/NativeRtdbView HmiRunTimeBin/log/ HmiRunTimeBin/Project/ @@ -51,6 +53,11 @@ HmiRunTimeBin/*.exe HmiRunTimeBin/*.dll HmiRunTimeBin/ViewElements/ +HmiRunTimeBin/AppLauncher +HmiRunTimeBin/FileTransferTool +HmiRunTimeBin/HmiRunTimeData +HmiRunTimeBin/HmiRunTimeView + third/ @@ -72,3 +79,19 @@ delobj.bat *.opensdf *.orig *.autosave +*~ +*.un~ +*.swp +Makefile +.qmake.stash +.moc +*.moc +moc_* +.rcc +.uic +*.so +*.so.* +tags +prj +*.ini +qrc_* diff --git a/HmiFuncDesigner/ProjectManager/ProjectManager/MainWindow.cpp b/HmiFuncDesigner/ProjectManager/ProjectManager/MainWindow.cpp index 50071b4f..d71d0bdb 100644 --- a/HmiFuncDesigner/ProjectManager/ProjectManager/MainWindow.cpp +++ b/HmiFuncDesigner/ProjectManager/ProjectManager/MainWindow.cpp @@ -807,7 +807,11 @@ void MainWindow::onSlotUpLoadProject() ProjectUploadDialog *pDlg = new ProjectUploadDialog(this, QSoftCore::getCore()->getProjectCore()->m_szProjFile); if (pDlg->exec() == QDialog::Accepted) { QString desDir = pDlg->getProjectPath(); +#ifdef Q_OS_WIN QString program = QCoreApplication::applicationDirPath() + "/tar/tar.exe"; +#else + QString program = "tar"; +#endif QFile programFile(program); if (!programFile.exists()) { QMessageBox::information(this, "系统提示", "命令:" + program + "不存在!"); @@ -869,7 +873,11 @@ void MainWindow::onSlotDownloadProject() Helper::CopyRecursively(QSoftCore::getCore()->getProjectCore()->m_szProjPath, desDir); // 打包工程到tmp目录 +#ifdef Q_OS_WIN QString program = QCoreApplication::applicationDirPath() + "/tar/tar.exe"; +#else + QString program = "tar"; +#endif QFile programFile(program); if(!programFile.exists()) { QMessageBox::information(this, "系统提示", "命令:" + program + "不存在!"); diff --git a/HmiFuncDesignerBin/bin/RecentProjectList.ini b/HmiFuncDesignerBin/bin/RecentProjectList.ini index 41393ff0..e554bc0f 100644 --- a/HmiFuncDesignerBin/bin/RecentProjectList.ini +++ b/HmiFuncDesignerBin/bin/RecentProjectList.ini @@ -1,7 +1,2 @@ [RecentProjects] -project-count=5 -project-1=C:/Users/70640/Desktop/123.pdt -project-2=C:/Users/70640/Desktop/demo1.pdt -project-3=D:/HmiFuncDesigner/HmiRunTimeBin/RunProject/ModbusRTU.pdt -project-4=C:/Users/JasonWang/Desktop/ModbusRTU.pdt -project-5=C:/Users/70640/Desktop/HMI_TEST_PROJECT/ModbusRTU.pdt +project-count=0 diff --git a/HmiRunTime/AppLauncher/applauncher.ini b/HmiRunTime/AppLauncher/applauncher.ini index 78d4080d..5136abf4 100644 --- a/HmiRunTime/AppLauncher/applauncher.ini +++ b/HmiRunTime/AppLauncher/applauncher.ini @@ -1,6 +1,4 @@ -[AppDir] -dir=E:/JasonWang/HmiFuncDesigner/HmiRunTimeBin/ [AppName] -FileTransferTool=FileTransferTool.exe -HmiRunTimeData=HmiRunTimeData.exe -HmiRunTimeView=HmiRunTimeView.exe +FileTransferTool=FileTransferTool +HmiRunTimeData=HmiRunTimeData +HmiRunTimeView=HmiRunTimeView diff --git a/HmiRunTime/AppLauncher/main.cpp b/HmiRunTime/AppLauncher/main.cpp index b8b8e3c1..3fa8db01 100644 --- a/HmiRunTime/AppLauncher/main.cpp +++ b/HmiRunTime/AppLauncher/main.cpp @@ -21,9 +21,14 @@ void getApplicationFiles() QFile fileCfg(iniAppLauncher); if(fileCfg.exists()) { QString szDir = ConfigUtils::getCfgStr(iniAppLauncher, "AppDir", "dir", Helper::AppDir() + "/"); - g_szAppFileTransferTool = szDir + ConfigUtils::getCfgStr(iniAppLauncher, "AppName", "FileTransferTool", "FileTransferTool.exe"); - g_szAppHmiRunTimeData = szDir + ConfigUtils::getCfgStr(iniAppLauncher, "AppName", "HmiRunTimeData", "HmiRunTimeData.exe"); - g_szAppHmiRunTimeView = szDir + ConfigUtils::getCfgStr(iniAppLauncher, "AppName", "HmiRunTimeView", "HmiRunTimeView.exe"); + g_szAppFileTransferTool = szDir + ConfigUtils::getCfgStr(iniAppLauncher, "AppName", "FileTransferTool", "FileTransferTool"); + g_szAppHmiRunTimeData = szDir + ConfigUtils::getCfgStr(iniAppLauncher, "AppName", "HmiRunTimeData", "HmiRunTimeData"); + g_szAppHmiRunTimeView = szDir + ConfigUtils::getCfgStr(iniAppLauncher, "AppName", "HmiRunTimeView", "HmiRunTimeView"); +#ifdef Q_OS_WIN + g_szAppFileTransferTool += ".exe"; + g_szAppHmiRunTimeData += ".exe"; + g_szAppHmiRunTimeView += ".exe"; +#endif } } diff --git a/HmiRunTime/FileTransferTool/tcpsocket.cpp b/HmiRunTime/FileTransferTool/tcpsocket.cpp index 935c944a..fdd94400 100644 --- a/HmiRunTime/FileTransferTool/tcpsocket.cpp +++ b/HmiRunTime/FileTransferTool/tcpsocket.cpp @@ -183,7 +183,7 @@ void TcpSocket::unTarProject() #if defined(Q_OS_WIN32) QString program = QCoreApplication::applicationDirPath() + "/tar/tar.exe"; #elif defined(Q_OS_LINUX) - QString program = "/bin/tar"; + QString program = "tar"; #endif QFile programFile(program); @@ -203,7 +203,7 @@ void TcpSocket::unTarProject() tarProc->setWorkingDirectory(QCoreApplication::applicationDirPath() + "/tar"); QStringList arguments; QString strSrc = QCoreApplication::applicationDirPath()+"/Project/RunProject.tar"; - QString strDes = QCoreApplication::applicationDirPath()+"/RunProject"; + QString strDes = QCoreApplication::applicationDirPath(); arguments << "-xvf" << strSrc << "-C"<< strDes; #endif diff --git a/HmiRunTime/HmiRunTime/HmiRunTime/PortThread.cpp b/HmiRunTime/HmiRunTime/HmiRunTime/PortThread.cpp index f7e42d1c..0c9a8942 100644 --- a/HmiRunTime/HmiRunTime/HmiRunTime/PortThread.cpp +++ b/HmiRunTime/HmiRunTime/HmiRunTime/PortThread.cpp @@ -1,8 +1,7 @@ -#include "PortThread.h" +#include "PortThread.h" #include #include - PortThread::PortThread(QString name) { m_name = name; @@ -46,6 +45,7 @@ void PortThread::Start() } } } + state = __Thread_Runing; this->start(); } @@ -64,6 +64,10 @@ void PortThread::Stop() } } } + while(state != __Thread_Stop) + { + this->msleep(5); + } this->wait(); } @@ -82,5 +86,6 @@ void PortThread::run() } this->msleep(5); } + state = __Thread_Stop; } diff --git a/HmiRunTime/HmiRunTime/HmiRunTime/PortThread.h b/HmiRunTime/HmiRunTime/HmiRunTime/PortThread.h index 47d557c7..25980118 100644 --- a/HmiRunTime/HmiRunTime/HmiRunTime/PortThread.h +++ b/HmiRunTime/HmiRunTime/HmiRunTime/PortThread.h @@ -1,4 +1,4 @@ -#ifndef PORTTHREAD_H +#ifndef PORTTHREAD_H #define PORTTHREAD_H #include @@ -8,6 +8,12 @@ #include #include "Vendor.h" +enum __ThreadState +{ + __Thread_Stop, + __Thread_Runing, +}; + class PortThread : public QThread { Q_OBJECT @@ -21,7 +27,7 @@ class PortThread : public QThread void Start(); // 停止 void Stop(); - + __ThreadState state; protected: void run(); diff --git a/HmiRunTimeBin/applauncher.ini b/HmiRunTimeBin/applauncher.ini index e46b02d9..5136abf4 100644 --- a/HmiRunTimeBin/applauncher.ini +++ b/HmiRunTimeBin/applauncher.ini @@ -1,6 +1,4 @@ -[AppDir] -dir=E:/JasonWang/HmiFuncDesigner/HmiRunTimeBin/ [AppName] -FileTransferTool=FileTransferTool.exe -HmiRunTimeData=HmiRunTimeData.exe -HmiRunTimeView=HmiRunTimeView.exe \ No newline at end of file +FileTransferTool=FileTransferTool +HmiRunTimeData=HmiRunTimeData +HmiRunTimeView=HmiRunTimeView