diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index f603881..9db4553 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -1,7 +1,103 @@ - - + + \ No newline at end of file diff --git a/src/BaseCppLibrary/Cpp11UpCpp17.h b/src/BaseCppLibrary/Cpp11UpCpp17.h index fb65af8..090c515 100644 --- a/src/BaseCppLibrary/Cpp11UpCpp17.h +++ b/src/BaseCppLibrary/Cpp11UpCpp17.h @@ -26,7 +26,5 @@ namespace stdlamp { }; // BASECPPLIBRARYAPI void LAMPnothing(void); - - } #endif // LAMPCAE_CPP11UPCPP17_H diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 38066a0..fa609b1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -29,7 +29,7 @@ file(TO_NATIVE_PATH "${_rpath}/${INSTALL_LIBDIR}" _lib_rpath) # 遗漏两个,临时解决方案 list(APPEND LAMPCAE_Runtimes_Libraries VTK::loguru VTK::gl2ps Qt5::DBus VTK::IOChemistry ) -list(APPEND LAMPCAE_Runtimes_Libraries Qt5::Qml Qt5::Network ) +list(APPEND LAMPCAE_Runtimes_Libraries Qt5::Qml Qt5::Network Qt5::Sql) list(APPEND LAMPCAE_Runtimes_Libraries OpenCASCADE::TKOpenGl OpenCASCADE::TKOffset OpenCASCADE::TKSTL OpenCASCADE::Freetype OpenCASCADE::TKBO OpenCASCADE::TKBRep OpenCASCADE::TKBool OpenCASCADE::TKCAF OpenCASCADE::TKCDF OpenCASCADE::TKG2d OpenCASCADE::TKG3d OpenCASCADE::TKGeomAlgo OpenCASCADE::TKGeomBase OpenCASCADE::TKHLR OpenCASCADE::TKIGES OpenCASCADE::TKLCAF OpenCASCADE::TKMath OpenCASCADE::TKMesh OpenCASCADE::TKPrim OpenCASCADE::TKSTEP OpenCASCADE::TKSTEP209 OpenCASCADE::TKSTEPAttr OpenCASCADE::TKSTEPBase OpenCASCADE::TKService OpenCASCADE::TKShHealing OpenCASCADE::TKTopAlgo OpenCASCADE::TKV3d OpenCASCADE::TKVCAF OpenCASCADE::TKXCAF OpenCASCADE::TKXDEIGES OpenCASCADE::TKXSBase OpenCASCADE::TKernel Qt5::Widgets Qt5::Xml VTK::CommonColor VTK::CommonComputationalGeometry VTK::CommonCore VTK::CommonDataModel VTK::CommonExecutionModel VTK::CommonMath VTK::CommonMisc VTK::CommonSystem VTK::CommonTransforms VTK::FiltersCore VTK::FiltersExtraction VTK::FiltersGeneral VTK::FiltersGeometry VTK::FiltersSources VTK::FiltersStatistics VTK::IOCore VTK::IOLegacy VTK::IOXML VTK::IOXMLParser VTK::ImagingCore VTK::ImagingFourier VTK::ImagingMath VTK::InteractionStyle VTK::ParallelCore VTK::ParallelDIY VTK::RenderingCore VTK::RenderingFreeType VTK::RenderingOpenGL2 VTK::RenderingUI VTK::RenderingVolume VTK::RenderingVolumeOpenGL2 VTK::doubleconversion VTK::expat VTK::freetype VTK::glew VTK::lz4 VTK::lzma VTK::sys VTK::zlib VTK::IOGeometry VTK::CommonColor VTK::CommonComputationalGeometry VTK::CommonCore VTK::CommonDataModel VTK::CommonExecutionModel VTK::CommonMath VTK::CommonMisc VTK::CommonSystem VTK::CommonTransforms VTK::FiltersCore VTK::FiltersExtraction VTK::FiltersGeneral VTK::FiltersGeometry VTK::FiltersSources VTK::FiltersStatistics VTK::IOCore VTK::IOLegacy VTK::IOXML VTK::IOXMLParser VTK::ImagingCore VTK::ImagingFourier VTK::ImagingMath VTK::InteractionStyle VTK::ParallelCore VTK::ParallelDIY VTK::RenderingCore VTK::RenderingFreeType VTK::RenderingOpenGL2 VTK::RenderingUI VTK::RenderingVolume VTK::RenderingVolumeOpenGL2 VTK::doubleconversion VTK::expat VTK::freetype VTK::glew VTK::lz4 VTK::lzma VTK::sys VTK::zlib VTK::IOGeometry @@ -82,8 +82,6 @@ foreach(_TestPlugin ${_TestPlugins}) endforeach() - - #----------------------------------------------------------------------------- # 安装LAMPCAE,定义项目的安装目录 #----------------------------------------------------------------------------- @@ -93,7 +91,7 @@ install( LIBRARY DESTINATION ${INSTALL_LIBDIR} COMPONENT lib ) -list(APPEND _plugins PluginAddTree PluginLAMPScatterProcess PluginCustomizer PluginMeshDataExchange PluginWBFZExchangePlugin PluginMotorBike PluginRasterTool ) +list(APPEND _plugins PluginAddTree PluginRCSDBManager PluginCustomizer PluginMeshDataExchange PluginWBFZExchangePlugin PluginMotorBike PluginRasterTool ) foreach(_plugin ${_plugins}) list(APPEND LAMPCAE_Runtimes_Libraries ${LAMPCAE_${_plugin}_Runtimes_Libraries}) diff --git a/src/Common/DebugLogger.cpp b/src/Common/DebugLogger.cpp index c3dc5ee..67393a2 100644 --- a/src/Common/DebugLogger.cpp +++ b/src/Common/DebugLogger.cpp @@ -9,7 +9,10 @@ #include #include #include - +#include +#include +#include +#include #if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__) @@ -25,6 +28,17 @@ namespace Common { std::cout << boost::stacktrace::stacktrace() << std::endl; } + std::string getCurrentTimeInHex() { + // 获取当前时间点,系统时钟,精确到毫秒 + auto now = std::chrono::time_point_cast(std::chrono::system_clock::now()); + auto value = now.time_since_epoch().count(); + + // 将时间戳转换为16进制字符串 + std::stringstream ss; + ss << std::hex << value; // 转换为16进制 + + return ss.str(); + } void DebugLogger::info(const char* file, int line, const char* format, ...) diff --git a/src/Common/DebugLogger.h b/src/Common/DebugLogger.h index bfecd58..a6b1cd5 100644 --- a/src/Common/DebugLogger.h +++ b/src/Common/DebugLogger.h @@ -25,7 +25,7 @@ #include "CommonAPI.h" - +#include #include @@ -47,6 +47,9 @@ namespace Common { static void output(const char* file, int line, const char* format, int level, va_list args); }; void COMMONAPI function_to_trace(); + + std::string COMMONAPI getCurrentTimeInHex(); + } // namespace Common // 用宏OUTPUT_DEBUG_INFO控制调试信息是否输出的开关 diff --git a/src/MainWindow/MainWindow.cpp b/src/MainWindow/MainWindow.cpp index 674e757..cc035f0 100644 --- a/src/MainWindow/MainWindow.cpp +++ b/src/MainWindow/MainWindow.cpp @@ -557,6 +557,11 @@ namespace GUI { connect(_ui->actionForestScaneStructMeasurement,SIGNAL(triggered()), this,SIGNAL(onactionForestScaneStructMeasurement_SIGNAL ())); connect(_ui->actionForestScanePhysicochemicalMeasurement,SIGNAL(triggered()), this,SIGNAL(onactionForestScanePhysicochemicalMeasurement_SIGNAL ())); + connect(_ui->actionImportRCSData,SIGNAL(triggered()), this,SIGNAL(on_actionImportRCSDataSIGNAL())); + + connect(_ui->actionShowRCSTable,SIGNAL(triggered()), this,SIGNAL(on_actionShowRCSTableSIGNAL())); + + connect(_ui->actionQueryRCSData,SIGNAL(triggered()), this,SIGNAL(on_actionactionQueryRCSDataSIGNAL())); } diff --git a/src/MainWindow/MainWindow.h b/src/MainWindow/MainWindow.h index 6f3db7d..ba1a621 100644 --- a/src/MainWindow/MainWindow.h +++ b/src/MainWindow/MainWindow.h @@ -165,7 +165,9 @@ namespace GUI { void on_actionLine2FaceSIGNAL(); - + void on_actionImportRCSDataSIGNAL(); + void on_actionShowRCSTableSIGNAL(); + void on_actionactionQueryRCSDataSIGNAL(); // 网格操作 void on_deleteMeshSIGNAL(GUI::MainWindow* m); void on_copyMeshSIGNAL(GUI::MainWindow* m); diff --git a/src/MainWindow/MainWindow.ui b/src/MainWindow/MainWindow.ui index e214322..7a37ee3 100644 --- a/src/MainWindow/MainWindow.ui +++ b/src/MainWindow/MainWindow.ui @@ -9,8 +9,8 @@ 0 0 - 1294 - 734 + 881 + 644 @@ -272,8 +272,8 @@ 0 0 - 1294 - 23 + 881 + 22 @@ -908,6 +908,14 @@ + + + RCS数据库管理 + + + + + @@ -922,6 +930,7 @@ + @@ -945,9 +954,6 @@ - @@ -962,9 +968,6 @@ - @@ -979,9 +982,6 @@ - @@ -996,8 +996,6 @@ - @@ -1013,9 +1011,6 @@ - @@ -1031,9 +1026,6 @@ - @@ -1050,8 +1042,6 @@ - @@ -1067,8 +1057,6 @@ - @@ -1083,8 +1071,6 @@ - @@ -1099,8 +1085,6 @@ - @@ -1123,9 +1107,6 @@ - @@ -1141,9 +1122,6 @@ - @@ -1166,9 +1144,6 @@ - @@ -1701,6 +1676,8 @@ + + @@ -3679,6 +3656,26 @@ 导入测量后向散射系数数据 + + + 启动CAE编辑器 + + + + + 导入RCS数据 + + + + + 展示RCS数据 + + + + + 查询RCS数据 + + diff --git a/src/PluginRCSDBManager/CMakeLists.txt b/src/PluginRCSDBManager/CMakeLists.txt new file mode 100644 index 0000000..8c013e2 --- /dev/null +++ b/src/PluginRCSDBManager/CMakeLists.txt @@ -0,0 +1,196 @@ +#----------------------------------------------------------------------------- +# 插件RCS数据库管理模块 +# +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +# 头文件搜索路径 +#----------------------------------------------------------------------------- +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..) + +# boost +include_directories(D:/vcpkg/installed/x64-windows/include) + +## qt5 +#include_directories(C:/Qt/5.15.2/msvc2019_64/include/QtQml) + +# json +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../json) + +# qscintilla2 +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../qscintilla2) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../qscintilla2/lexers) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../qscintilla2/include) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../qscintilla2/lexlib) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../qscintilla2/Qt4Qt5) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../qscintilla2/src) + + +# qcustomplot +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../qcustomplot) + +# qhexedit +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../qhexedit) +# opencv +include_directories(${OpenCV_INCLUDE_DIRS}) + +# qtpropertybrowser +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/qt) + + + + +#----------------------------------------------------------------------------- +# 链接库 +#----------------------------------------------------------------------------- + + +#----------------------------------------------------------------------------- +# 自动添加include目录 +#----------------------------------------------------------------------------- +set(CMAKE_INCLUDE_CURRENT_DIR ON) +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) + + + +#----------------------------------------------------------------------------- +# 添加资源文件 +#----------------------------------------------------------------------------- +set(_qrc "${CMAKE_CURRENT_SOURCE_DIR}/../qrc/qianfan.qrc") +set(_lang "${CMAKE_CURRENT_SOURCE_DIR}/../qrc/translations.qrc") +qt5_add_resources(_resource ${_qrc} ${_lang}) + +#----------------------------------------------------------------------------- +# 源码扫描 +#----------------------------------------------------------------------------- +file(GLOB_RECURSE _ui "*.ui") +file(GLOB_RECURSE _header "*.h" ) +file(GLOB_RECURSE _source "*.cpp") +qt5_wrap_ui(_interface ${_ui}) +qt5_wrap_cpp(MOC_SOURCES ${_header}) + +# 将生成的 MOC 文件添加到源文件列表中 +list(APPEND SOURCES ${MOC_SOURCES}) +#----------------------------------------------------------------------------- +# 添加动态库目标 +#----------------------------------------------------------------------------- +add_library(PluginRCSDBManager + ${_resource} + ${_interface} + ${_header} + ${_source} + ${SOURCES} + RCSDBManagerClass.cpp + RCSDBManagerClass.h +) + + +#----------------------------------------------------------------------------- +# 链接库 +#----------------------------------------------------------------------------- + + +#gdal +find_package(GDAL REQUIRED) +include_directories(${GDAL_INCLUDE_DIRS}) +link_directories(${GDAL_LIBRARIES}) + +# boost +include_directories(D:/vcpkg/installed/x64-windows/include) + + +include_directories(${PCL_INCLUDE_DIRS}) +link_directories(${PCL_LIBRARY_DIRS}) +add_definitions(${PCL_DEFINITIONS}) + +# qwt +include_directories(${Qwt_INCLUDE_DIRS}) +link_directories(${Qwt_LIBRARY_DIRS}) + +# gdal +include_directories(${GDAL_INCLUDE_DIRS}) +message("qwt dir ${Qwt_INCLUDE_DIRS}") + +#----------------------------------------------------------------------------- +# 添加接口声明宏 +#----------------------------------------------------------------------------- +target_compile_definitions(PluginRCSDBManager PRIVATE "NOMINMAX") # 禁用vc++ 中的min max 定义,避免与 pcl 的中 std::min,pcl::max 函数冲突 +target_compile_definitions(PluginRCSDBManager PRIVATE "PLUGINRCSDBMANAGER_API") + +#----------------------------------------------------------------------------- +# 安装Qt的依赖文件 +#----------------------------------------------------------------------------- +get_target_property(_qmake_executable Qt5::qmake IMPORTED_LOCATION) +get_filename_component(_qt_bin_dir "${_qmake_executable}" DIRECTORY) + + + + +list(APPEND _depend_library + PluginWBFZExchangePlugin qtpropertybrowser qcustomplot qhexedit qscintilla2 Common Settings PythonModule DataProperty MeshData Material Geometry BCBase ConfigOptions SelfDefObject ModelData ModuleBase PluginManager GeometryCommand GeometryWidgets IO MainWidgets MainWindow +) + + + +list(APPEND _runtimes_libraries + LAMPCAE::CGNS Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Xml LAMPCAE::QWT LAMPCAE::QWTPOLAR +) + + +list(APPEND _runtimes_libraries + Qt5::Network Qt5::Core Qt5::Gui Qt5::Widgets Qt5::DBus Qt5::Core Qt5::Xml Qt5::OpenGL Qt5::Gui Qt5::Svg Qt5::Widgets Qt5::Qml Qt5::DataVisualization Qt5::Charts Qt5::PrintSupport Qt5::Test Qt5::Sql +) + +list(APPEND _runtimes_libraries + OpenCASCADE::TKOpenGl OpenCASCADE::TKOffset OpenCASCADE::TKSTL OpenCASCADE::TKFillet OpenCASCADE::Freetype OpenCASCADE::TKBO OpenCASCADE::TKBRep OpenCASCADE::TKBool OpenCASCADE::TKCAF OpenCASCADE::TKCDF OpenCASCADE::TKG2d OpenCASCADE::TKG3d OpenCASCADE::TKGeomAlgo OpenCASCADE::TKGeomBase OpenCASCADE::TKHLR OpenCASCADE::TKIGES OpenCASCADE::TKLCAF OpenCASCADE::TKMath OpenCASCADE::TKMesh OpenCASCADE::TKPrim OpenCASCADE::TKSTEP OpenCASCADE::TKSTEP209 OpenCASCADE::TKSTEPAttr OpenCASCADE::TKSTEPBase OpenCASCADE::TKService OpenCASCADE::TKShHealing OpenCASCADE::TKTopAlgo OpenCASCADE::TKV3d OpenCASCADE::TKVCAF OpenCASCADE::TKXCAF OpenCASCADE::TKXDEIGES OpenCASCADE::TKXSBase OpenCASCADE::TKernel Qt5::Widgets Qt5::Xml VTK::CommonColor VTK::CommonComputationalGeometry VTK::CommonCore VTK::CommonDataModel VTK::CommonExecutionModel VTK::CommonMath VTK::CommonMisc VTK::CommonSystem VTK::CommonTransforms VTK::FiltersCore VTK::FiltersExtraction VTK::FiltersGeneral VTK::FiltersGeometry VTK::FiltersSources VTK::FiltersStatistics VTK::IOCore VTK::IOLegacy VTK::IOXML VTK::IOXMLParser VTK::ImagingCore VTK::ImagingFourier VTK::ImagingMath VTK::InteractionStyle VTK::ParallelCore VTK::ParallelDIY VTK::RenderingCore VTK::RenderingFreeType VTK::RenderingOpenGL2 VTK::RenderingUI VTK::RenderingVolume VTK::RenderingVolumeOpenGL2 VTK::doubleconversion VTK::expat VTK::freetype VTK::glew VTK::lz4 VTK::lzma VTK::sys VTK::zlib VTK::IOGeometry +) + +list(APPEND _runtimes_libraries + VTK::CommonColor VTK::CommonComputationalGeometry VTK::CommonCore VTK::CommonDataModel VTK::CommonExecutionModel VTK::CommonMath VTK::CommonMisc VTK::CommonSystem VTK::CommonTransforms VTK::DICOMParser VTK::FiltersCore VTK::FiltersGeneral VTK::FiltersGeometry VTK::FiltersHybrid VTK::FiltersModeling VTK::FiltersSources VTK::IOCore VTK::IOChemistry VTK::IOGeometry VTK::IOImage VTK::IOLegacy VTK::ImagingCore VTK::ImagingSources VTK::RenderingCore VTK::RenderingLOD VTK::doubleconversion VTK::jpeg VTK::jsoncpp VTK::lz4 VTK::lzma VTK::metaio VTK::png VTK::pugixml VTK::sys VTK::tiff VTK::zlib +) + +message("OpenCV_LIBRARIES ${OpenCV_LIBRARIES}") + +target_include_directories(PluginRCSDBManager PRIVATE ${Qwt_INCLUDE_DIRS}) +#----------------------------------------------------------------------------- +# 链接依赖库 +#----------------------------------------------------------------------------- +target_link_libraries(PluginRCSDBManager PRIVATE + ${_runtimes_libraries} + ${_depend_library} + ${PCL_LIBRARIES} + ${OpenCV_LIBRARIES} + ${OpenCV_LIBS} + + unofficial::sqlite3::sqlite3 + GDAL::GDAL + FFTW3::fftw3 + GSL::gsl GSL::gslcblas + +) + +#----------------------------------------------------------------------------- +# 添加依赖关系 +#----------------------------------------------------------------------------- +add_dependencies(PluginRCSDBManager ${_depend_library}) + +#----------------------------------------------------------------------------- +# 添加运行时依赖关系 +#----------------------------------------------------------------------------- +set(LAMPCAE_PluginRCSDBManager_Runtimes_Libraries ${_runtimes_libraries} PARENT_SCOPE) + +#----------------------------------------------------------------------------- +# 设置插件的输出目录 +#----------------------------------------------------------------------------- +set_target_properties(PluginRCSDBManager + PROPERTIES + ARCHIVE_OUTPUT_DIRECTORY_RELEASE $/plugins + LIBRARY_OUTPUT_DIRECTORY_RELEASE $/plugins + RUNTIME_OUTPUT_DIRECTORY_RELEASE $/plugins + ARCHIVE_OUTPUT_DIRECTORY_DEBUG $/plugins + LIBRARY_OUTPUT_DIRECTORY_DEBUG $/plugins + RUNTIME_OUTPUT_DIRECTORY_DEBUG $/plugins +) + diff --git a/src/PluginRCSDBManager/PluginRCSDBManagerAPI.h b/src/PluginRCSDBManager/PluginRCSDBManagerAPI.h new file mode 100644 index 0000000..9308b05 --- /dev/null +++ b/src/PluginRCSDBManager/PluginRCSDBManagerAPI.h @@ -0,0 +1,13 @@ +#ifndef _PLUGINRCSDBMANAGERAPI_H_ +#define _PLUGINRCSDBMANAGERAPI_H_ + +#include + + +#if defined(PLUGINRCSDBMANAGER_API) +#define PLUGINRCSDBMANAGERAPI Q_DECL_EXPORT +#else +#define PLUGINRCSDBMANAGERAPI Q_DECL_IMPORT +#endif + +#endif diff --git a/src/PluginRCSDBManager/RCSDBManagerClass.cpp b/src/PluginRCSDBManager/RCSDBManagerClass.cpp new file mode 100644 index 0000000..8baac5c --- /dev/null +++ b/src/PluginRCSDBManager/RCSDBManagerClass.cpp @@ -0,0 +1,604 @@ +// +// Created by 30453 on 25-6-25. +// + +#include "RCSDBManagerClass.h" +#include "QDebug" +#include "Settings/BusAPI.h" +#include "QErrorMessage" +#include "QFile" +#include "QFileInfo" +#include "QDir" +#include "PluginWBFZExchangePlugin/FEKOBaseToolClass.h" + + + +namespace RCSDBManagerTool { + RCSDBManagerClass* RCSDBManagerClass::_ins = nullptr; + + RCSDBManagerClass::RCSDBManagerClass(const std::string& dbPath) : _db(nullptr), _dbPath(dbPath) { + this->initializeDatabase(dbPath); + qDebug() <initialize(); + } + + RCSDBManagerClass::~RCSDBManagerClass() { + closeDatabase(); + } + + bool RCSDBManagerClass::initialize() { + if (!_db) { + qDebug() < RCSDBManagerClass::queryRCSDataRecords(int projectId, double freq, + double az, double inc, double transpolar) { + std::vector results; + + std::string sql = "SELECT * FROM RCSDataTable WHERE 1=1"; + if (projectId != -1) sql += " AND ProjectID = ?"; + if (freq != -1.0) sql += " AND freq = ?"; + if (az != -1.0) sql += " AND az = ?"; + if (inc != -1.0) sql += " AND inc = ?"; + if (transpolar != -1.0) sql += " AND Transpolar = ?"; + + sqlite3_stmt* stmt; + if (sqlite3_prepare_v2(_db, sql.c_str(), -1, &stmt, nullptr) != SQLITE_OK) { + qDebug() <(sqlite3_column_text(stmt, i)); + + if (colName && colValue) { + if (strcmp(colName, "projectID") == 0) record.projectID = atoi(colValue); + else if (strcmp(colName, "fileType") == 0) record.fileType = colValue; + else if (strcmp(colName, "fileFormat") == 0) record.fileFormat = colValue; + else if (strcmp(colName, "source") == 0) record.source = colValue; + else if (strcmp(colName, "date") == 0) record.date = colValue; + else if (strcmp(colName, "radiusStr") == 0) record.radiusStr = colValue; + else if (strcmp(colName, "thetaStr") == 0) record.thetaStr = colValue; + else if (strcmp(colName, "phiStr") == 0) record.phiStr = colValue; + else if (strcmp(colName, "frequencyStr") == 0) record.frequencyStr = colValue; + else if (strcmp(colName, "radius") == 0) record.radius = atof(colValue); + else if (strcmp(colName, "theta") == 0) record.theta = atof(colValue); + else if (strcmp(colName, "phi") == 0) record.phi = atof(colValue); + else if (strcmp(colName, "reEr") == 0) record.reEr = atof(colValue); + else if (strcmp(colName, "imEr") == 0) record.imEr = atof(colValue); + else if (strcmp(colName, "reEtheta") == 0) record.reEtheta = atof(colValue); + else if (strcmp(colName, "imEtheta") == 0) record.imEtheta = atof(colValue); + else if (strcmp(colName, "reEphi") == 0) record.reEphi = atof(colValue); + else if (strcmp(colName, "imEphi") == 0) record.imEphi = atof(colValue); + else if (strcmp(colName, "RCS_Theta") == 0) record.RCS_Theta = atof(colValue); + else if (strcmp(colName, "RCS_Phi") == 0) record.RCS_Phi = atof(colValue); + else if (strcmp(colName, "RCS_Tatol") == 0) record.RCS_Tatol = atof(colValue); + else if (strcmp(colName, "TransPolar") == 0) record.TransPolar = atof(colValue); + else if (strcmp(colName, "configurationName") == 0) record.configurationName = colValue; + else if (strcmp(colName, "requestName") == 0) record.requestName = colValue; + else if (strcmp(colName, "frequency") == 0) record.frequency = atof(colValue); + else if (strcmp(colName, "coordinateSystem") == 0) record.coordinateSystem = colValue; + else if (strcmp(colName, "numRadiusSamples") == 0) record.numRadiusSamples = atoi(colValue); + else if (strcmp(colName, "numThetaSamples") == 0) record.numThetaSamples = atoi(colValue); + else if (strcmp(colName, "numPhiSamples") == 0) record.numPhiSamples = atoi(colValue); + else if (strcmp(colName, "resultType") == 0) record.resultType = colValue; + else if (strcmp(colName, "numHeaderLines") == 0) record.numHeaderLines = atoi(colValue); + } + } + results.push_back(record); + } + + sqlite3_finalize(stmt); + return results; + } + + void RCSDBManagerClass::closeDatabase() { + if (_db) { + sqlite3_close(_db); + _db = nullptr; + } + } + + bool RCSDBManagerClass::initializeDatabase(const std::string& dbFilePath) { + // 检查数据库文件是否存在 + FILE* file = fopen(dbFilePath.c_str(), "r"); + bool dbExists = (file != nullptr); + if (file) fclose(file); + + if (!dbExists) { + qDebug() <getRcsdbFilePath().toUtf8().constData(); + std::string sqldbpath(datastr); + _ins = new RCSDBManagerClass(sqldbpath); + } + return _ins; + } + + int RCSDBManagerClass::insertProject(const std::string& projectName, const std::string& projectFolder, + const std::string& desc) { + if (!_db) { + qDebug() <(sqlite3_last_insert_rowid(_db)); + sqlite3_finalize(stmt); + return id; + } + + std::vector RCSDBManagerClass::queryProjects(int projectId, + const std::string& projectName) { + std::vector results; + if (!_db) return results; + + std::string sql = "SELECT * FROM RCSProjectFolderTable WHERE 1=1"; + if (projectId != -1) sql += " AND ProjectID = ?"; + if (!projectName.empty()) sql += " AND projectname LIKE ?"; + + sqlite3_stmt* stmt; + if (sqlite3_prepare_v2(_db, sql.c_str(), -1, &stmt, nullptr) != SQLITE_OK) { + qDebug() <(sqlite3_column_text(stmt, i)); + + if (colName && colValue) { + if (strcmp(colName, "projectID") == 0) record.projectID = atoi(colValue); + else if (strcmp(colName, "fileType") == 0) record.fileType = colValue; + else if (strcmp(colName, "fileFormat") == 0) record.fileFormat = colValue; + else if (strcmp(colName, "source") == 0) record.source = colValue; + else if (strcmp(colName, "date") == 0) record.date = colValue; + else if (strcmp(colName, "radiusStr") == 0) record.radiusStr = colValue; + else if (strcmp(colName, "thetaStr") == 0) record.thetaStr = colValue; + else if (strcmp(colName, "phiStr") == 0) record.phiStr = colValue; + else if (strcmp(colName, "frequencyStr") == 0) record.frequencyStr = colValue; + else if (strcmp(colName, "radius") == 0) record.radius = atof(colValue); + else if (strcmp(colName, "theta") == 0) record.theta = atof(colValue); + else if (strcmp(colName, "phi") == 0) record.phi = atof(colValue); + else if (strcmp(colName, "reEr") == 0) record.reEr = atof(colValue); + else if (strcmp(colName, "imEr") == 0) record.imEr = atof(colValue); + else if (strcmp(colName, "reEtheta") == 0) record.reEtheta = atof(colValue); + else if (strcmp(colName, "imEtheta") == 0) record.imEtheta = atof(colValue); + else if (strcmp(colName, "reEphi") == 0) record.reEphi = atof(colValue); + else if (strcmp(colName, "imEphi") == 0) record.imEphi = atof(colValue); + else if (strcmp(colName, "RCS_Theta") == 0) record.RCS_Theta = atof(colValue); + else if (strcmp(colName, "RCS_Phi") == 0) record.RCS_Phi = atof(colValue); + else if (strcmp(colName, "RCS_Tatol") == 0) record.RCS_Tatol = atof(colValue); + else if (strcmp(colName, "TransPolar") == 0) record.TransPolar = atof(colValue); + else if (strcmp(colName, "configurationName") == 0) record.configurationName = colValue; + else if (strcmp(colName, "requestName") == 0) record.requestName = colValue; + else if (strcmp(colName, "frequency") == 0) record.frequency = atof(colValue); + else if (strcmp(colName, "coordinateSystem") == 0) record.coordinateSystem = colValue; + else if (strcmp(colName, "numRadiusSamples") == 0) record.numRadiusSamples = atoi(colValue); + else if (strcmp(colName, "numThetaSamples") == 0) record.numThetaSamples = atoi(colValue); + else if (strcmp(colName, "numPhiSamples") == 0) record.numPhiSamples = atoi(colValue); + else if (strcmp(colName, "resultType") == 0) record.resultType = colValue; + else if (strcmp(colName, "numHeaderLines") == 0) record.numHeaderLines = atoi(colValue); + } + } + results.push_back(record); + } + + sqlite3_finalize(stmt); + return results; + } + + bool RCSDBManagerClass::deleteProject(int projectId) { + if (!_db) return false; + + const char* sql = "DELETE FROM RCSProjectFolderTable WHERE ProjectID = ?"; + + sqlite3_stmt* stmt; + if (sqlite3_prepare_v2(_db, sql, -1, &stmt, nullptr) != SQLITE_OK) { + qDebug() < 0; + } + + bool RCSDBManagerClass::insertRCSDataRecords(std::vector& records, + int32_t projectID, double transpolarAngle) { + if (records.empty()) { + qDebug() < +#include +#include "PluginWBFZExchangePlugin/FEKOBaseToolClass.h" +#include "QString" + +namespace RCSDBManagerTool { + + struct RCSRecord { + int projectID; + QString fileType; + QString fileFormat; + QString source; + QString date; + QString radiusStr; + QString thetaStr; + QString phiStr; + QString frequencyStr; + + double radius; + double theta; + double phi; + + double reEr; + double imEr; + double reEtheta; // vertical 垂直 v + double imEtheta; + double reEphi; // horizontal 水平 H + double imEphi; + double RCS_Theta; + double RCS_Phi; + double RCS_Tatol; + + double TransPolar; + + QString configurationName; + QString requestName; + double frequency; + QString coordinateSystem; + Point_3d origin; + int numRadiusSamples; + int numThetaSamples; + int numPhiSamples; + QString resultType; + int numHeaderLines; + size_t prfidx = -1; // 脉冲计数,>0 + + + }; + + + class PLUGINRCSDBMANAGERAPI RCSDBManagerClass { + public: + static RCSDBManagerClass* instance(); + + ~RCSDBManagerClass(); + + bool initialize(); + bool createTables(); + bool insertRCSDataRecord(int projectId, double freq, double az, double inc, + double transpolar, double eHReal, double eHImag, + double eVReal, double eVImag, double rcsH, double rcsV); + bool deleteRCSDataRecord(int projectId, double freq, double az, + double inc, double transpolar); + bool updateRCSDataRecord(int projectId, double freq, double az, double inc, + double transpolar, double newEHReal, double newEHImag, + double newEVReal, double newEVImag, double newRCSH, double newRCSV); + + std::vector queryRCSDataRecords(int projectId, double freq, + double az, double inc, double transpolar); + + void closeDatabase(); + + int insertProject(const std::string& projectName, const std::string& projectFolder, + const std::string& desc); + std::vector queryProjects(int projectId, + const std::string& projectName); + bool deleteProject(int projectId); + + bool insertRCSDataRecords(std::vector& records, + int32_t projectID, double transpolarAngle); + + private: + RCSDBManagerClass(const std::string& dbPath); + bool initializeDatabase(const std::string& dbFilePath); + bool checkAndCreateTables(); + + static RCSDBManagerClass* _ins; + sqlite3* _db; + std::string _dbPath; + + bool executeSQL(const std::string& sql); + bool executeSQLWithParams(const std::string& sql, + const std::vector>& params); + }; + + QString writeUTF8StringFile(QString path,QString unicodeString); + bool copyDirectory(const QString &sourcePath, const QString &targetPath, bool coverFileIfExist = false); + QFileInfoList findFilePath(const QString& dirPath, const QString& pattern, QDirIterator::IteratorFlag flag= QDirIterator::IteratorFlag::Subdirectories); + +} // namespace RCSDBManagerTool + +#endif // LAMPCAE_RCSDBMANAGERCLASS_H diff --git a/src/PluginRCSDBManager/RCSDBManagerPlugin.cpp b/src/PluginRCSDBManager/RCSDBManagerPlugin.cpp new file mode 100644 index 0000000..9a0baac --- /dev/null +++ b/src/PluginRCSDBManager/RCSDBManagerPlugin.cpp @@ -0,0 +1,66 @@ +#include "RCSDBManagerPlugin.h" +//#include "ll_qgis_base_lib.h" +#include +#include +#include +#include +#include "RCSImportDialog.h" + + +GUI::MainWindow* RCSDBManagerTool::RCSDBManagerPlugin::_mainwindow = nullptr; + +bool RCSDBManagerTool::RCSDBManagerPlugin::install() +{ + return false; +} +bool RCSDBManagerTool::RCSDBManagerPlugin::uninstall() +{ + return false; +} + +GUI::MainWindow* RCSDBManagerTool::RCSDBManagerPlugin::getMWpt() +{ + return _mainwindow; +} + +RCSDBManagerTool::RCSDBManagerPlugin::RCSDBManagerPlugin(GUI::MainWindow* m) { + _describe = "RasterToolPlugin Installed Successfully"; + _mainwindow = m; + connect(_mainwindow,SIGNAL(on_actionImportRCSDataSIGNAL()),this,SLOT(onImportRCSDBTableSlot())); + connect(_mainwindow,SIGNAL(on_actionShowRCSTableSIGNAL()),this,SLOT(onShowRCSDBTableSlot())); + connect(_mainwindow,SIGNAL(on_actionactionQueryRCSDataSIGNAL()),this,SLOT(onQueryRCSDBTableSlot())); + +} +void RCSDBManagerTool::RCSDBManagerPlugin::reTranslate(QString){} + + +void RCSDBManagerTool::RCSDBManagerPlugin::onImportRCSDBTableSlot() { + RCSImportDialog* dialog=new RCSImportDialog(_mainwindow); + dialog->show(); +} +void RCSDBManagerTool::RCSDBManagerPlugin::onShowRCSDBTableSlot() { + +} +void RCSDBManagerTool::RCSDBManagerPlugin::onQueryRCSDBTableSlot() { + +} + +namespace RCSDBManagerTool{ + + +} + + + +void Register(GUI::MainWindow* m, QList* ps) +{ + qDebug()<<"RasterToolPlugin install RasterToolPlugin::install start Register"; + Plugins::PluginBase* p_meshdataExchangeplugin = new RCSDBManagerTool::RCSDBManagerPlugin(m); + ps->append(p_meshdataExchangeplugin); + qDebug()<<"RasterToolPlugin install RasterToolPlugin::install finish Register"; + +} + + + + diff --git a/src/PluginRCSDBManager/RCSDBManagerPlugin.h b/src/PluginRCSDBManager/RCSDBManagerPlugin.h new file mode 100644 index 0000000..7e4f5ac --- /dev/null +++ b/src/PluginRCSDBManager/RCSDBManagerPlugin.h @@ -0,0 +1,35 @@ +#ifndef _RASTERTOOLPLUGIN_H_ +#define _RASTERTOOLPLUGIN_H_ + +#include "PluginRCSDBManagerAPI.h" +#include "PluginManager/pluginBase.h" +#include "MainWindow/MainWindow.h" + +namespace RCSDBManagerTool { + + + class PLUGINRCSDBMANAGERAPI RCSDBManagerPlugin : public Plugins::PluginBase { + Q_OBJECT + public: + RCSDBManagerPlugin(GUI::MainWindow* m); + ~RCSDBManagerPlugin() = default; + + bool install(); + bool uninstall(); + void reTranslate(QString); + static GUI::MainWindow* getMWpt(); + public slots: + void onImportRCSDBTableSlot(); + void onShowRCSDBTableSlot(); + void onQueryRCSDBTableSlot(); + private: + static GUI::MainWindow* _mainwindow; + }; +} + +extern "C" +{ +void PLUGINRCSDBMANAGERAPI Register(GUI::MainWindow* m, QList* plugs); +} + +#endif \ No newline at end of file diff --git a/src/PluginRCSDBManager/RCSImportDialog.cpp b/src/PluginRCSDBManager/RCSImportDialog.cpp new file mode 100644 index 0000000..9ff7b9c --- /dev/null +++ b/src/PluginRCSDBManager/RCSImportDialog.cpp @@ -0,0 +1,364 @@ +// +// Created by 30453 on 25-6-25. +// + +// You may need to build the project (run Qt uic code generator) to get "ui_RCSImportDialog.h" +// resolved + +#include "RCSImportDialog.h" +#include "Settings/BusAPI.h" +#include "Common/DebugLogger.h" +#include "QFileInfo" +#include "QDir" +#include "QDebug" +#include "QStandardItem" +#include +#include +#include "QFileDialog" +#include "PluginWBFZExchangePlugin/CMDExcuteApp.h" +#include "PluginWBFZExchangePlugin/BaseTool.h" +#include "PluginWBFZExchangePlugin/FileOperator.h" +#include "RCSDBManagerClass.h" +#include "PluginWBFZExchangePlugin/FEKOFarFieldFileClass.h" +#include "PluginWBFZExchangePlugin/FEKOBaseToolClass.h" +#include "ui_RCSImportDialog.h" + +namespace RCSDBManagerTool { + RCSImportDialog::RCSImportDialog(QWidget* parent) + : QDialog(parent) + , ui(new Ui::RCSImportDialog) + { + ui->setupUi(this); + + this->CheckRCSDBFolder(); + // 事件绑定 + QObject::connect(ui->SelectFilepushButton,SIGNAL(clicked()),this,SLOT(onSelectPreFolderPushBtn())); + QObject::connect(ui->AddPushBtn,SIGNAL(clicked()),this,SLOT(AddFekoResultClick())); + QObject::connect(ui->deletePushBtn,SIGNAL(clicked()),this,SLOT(DeleteFekoResultClick())); + QObject::connect(ui->ImportpushButton,SIGNAL(clicked()),this,SLOT(onImportpushButtonClicked())); + QObject::connect(ui->CancelpushButton,SIGNAL(clicked()),this,SLOT(onCancelpushButtonClicked())); + + + // 近场结果 + // this->ui->NearradioBtn->setEnabled(false); + // this->ui->NearradioBtn->setHidden(true); + // this->ui->NearradioBtn->setCheckable(false); + // this->ui->NearradioBtn->setChecked(false); + + // 初始化 + this->ListViewmodel = new QStandardItemModel(this); + this->ui->listView->setModel(this->ListViewmodel); + this->selectListViewmodel = new QStandardItemModel(this); + this->selectListViewmodel->clear(); + this->ListViewmodel->clear(); + this->p = nullptr; + + + } + + RCSImportDialog::~RCSImportDialog() + { + + delete ui; + } + void RCSImportDialog::CheckRCSDBFolder() { + QString RCSDbFilePath=Setting::BusAPI::instance()->getRcsdbFilePath(); + QString RCSDbRootPath=Setting::BusAPI::instance()->getRcsdbFoler(); + QString RCSProjectFolerPath=Setting::BusAPI::instance()->getRcsProjectPath(); + + this->CheckRCSDBFolder(RCSDbRootPath); + this->CheckRCSDBFolder(RCSProjectFolerPath); + + + + } + + void RCSImportDialog::CheckRCSDBFolder(const QString &rcsDbRootPath) { + // 检查路径是否存在 + QDir dir(rcsDbRootPath); + if (!dir.exists()) { + // 如果路径不存在,则尝试创建 + if (dir.mkpath(u8".")) { + qDebug() << u8"路径已成功创建:" << rcsDbRootPath; + } else { + qDebug() << u8"无法创建路径:" << rcsDbRootPath; + } + } else { + qDebug() << u8"路径已存在:" << rcsDbRootPath; + } + } + + void RCSImportDialog::onSelectPreFolderPushBtn() { + //打开单个文件 + QString lastpath=Setting::BusAPI::instance()->getLastSelectPath(); + QString prefileNamePath = QFileDialog::getOpenFileName( + this, + QString::fromUtf8(u8"选择.pre 文件"), + lastpath, + u8"pre文件 (*.pre)");//多组扩展名用双分号";;"隔开 + + Setting::BusAPI::instance()->setRcsdbFilePath(QFileInfo(prefileNamePath).absolutePath()); + + if (prefileNamePath.isEmpty()) { + return; + } + + this->FEKOProjectFolderPath = getParantFromPath(prefileNamePath); + this->FEKOPreFileName = getFileNameFromPath(prefileNamePath); + this->farFieldNames = getFilelist(this->FEKOProjectFolderPath, ".ffe"); + this->nearFieldNames = getFilelist(this->FEKOProjectFolderPath, ".efe"); + qDebug()<FEKOPreFileName; + // 修改显示 + this->ListViewmodel->clear(); + qDebug()<FEKOPreFileName; + + this->ui->FolderPathtextEdit->setText(this->FEKOProjectFolderPath); + this->ui->PreFileNametextEdit->setText(this->FEKOPreFileName); + qDebug() << u8"RCSimportDialog debug: 98 add farfield in listview "<FEKOPreFileName; + + if (this->ui->FarradioBtn->isChecked()) { + qDebug() << u8"RCSimportDialog debug: 99 add farfield in listview "<FEKOPreFileName; + for (int i = 0; i < this->farFieldNames.size(); i++) { + QStandardItem* item = new QStandardItem(QString::QString(this->farFieldNames[i])); + this->ListViewmodel->appendRow(item); + } + } + else { + // this->ui->NearradioBtn->setChecked(true); + // for (int i = 0; i < this->nearFieldNames.size(); i++) { + // QStandardItem* item = new QStandardItem(QString::QString(this->nearFieldNames[i])); + // this->ListViewmodel->appendRow(item); + // } + } + + qDebug()<FEKOPreFileName; + + this->ui->listView->setModel(this->ListViewmodel); + qDebug()<<(u8"farField Number:"+QString::number(this->farFieldNames.size()) + "\n" + u8"NearField Number:" + QString::number(this->nearFieldNames.size()) + "\n"); + + } + + void RCSImportDialog::AddFekoResultClick() { + QModelIndexList sourcelist=this->ui->listView->selectionModel()->selectedIndexes(); + std::vector deleteRowids(0); + for (int i = 0; i < sourcelist.count(); i++) { + deleteRowids.push_back(sourcelist[i].row()); + // qDebug() << ("deletaRowids add :"+QString::number(sourcelist[i].row())+"\n"); + } + std::sort(deleteRowids.begin(), deleteRowids.end()); + for (int i = deleteRowids.size() - 1; i >= 0; i--) { + int select_Idx = deleteRowids[i]; + QList listItem = this->ListViewmodel->takeRow(select_Idx); + int nRightCount = this->selectListViewmodel->rowCount(); + this->selectListViewmodel->insertRow(nRightCount, listItem); + // qDebug() << ("selectListViewmodel insertRow : "+ QString::number(select_Idx) +"-->" + QString::number(nRightCount) + "\n"); + } + + this->ui->listView->setModel(this->ListViewmodel); + this->ui->SelectlistView->setModel(this->selectListViewmodel); + } + + void RCSImportDialog::DeleteFekoResultClick() { + QModelIndexList sourcelist = this->ui->SelectlistView->selectionModel()->selectedIndexes(); + std::vector deleteRowids(0); + for (int i = 0; i < sourcelist.count(); i++) { + deleteRowids.push_back(sourcelist[i].row()); + } + std::sort(deleteRowids.begin(), deleteRowids.end()); + for (int i = deleteRowids.size() - 1; i >= 0; i--) { + int select_Idx = deleteRowids[i]; + QList listItem = this->selectListViewmodel->takeRow(select_Idx); + int nRightCount = this->ListViewmodel->rowCount(); + this->ListViewmodel->insertRow(nRightCount, listItem); + // qDebug() << ("ListViewmodel insertRow : " + QString::number(select_Idx) + "-->" + QString::number(nRightCount) + "\n"); + } + this->ui->listView->setModel(this->ListViewmodel); + this->ui->SelectlistView->setModel(this->selectListViewmodel); + } + + void RCSImportDialog::onCancelpushButtonClicked() { + this->close(); + } + + void RCSImportDialog::FEKOResultImportButtonClick(QString outcsvPath) { + this->FEKOResultCSVPath=outcsvPath; + if (isExists(this->FEKOResultCSVPath)) { + QFile file(this->FEKOResultCSVPath); + if (!file.open(QIODevice::ReadWrite)) { + QMessageBox::information(nullptr, u8"文件被占用", this->FEKOResultCSVPath); + } + else { + file.close(); + removeFile(this->FEKOResultCSVPath); + } + + } + + QString csvpramarPath = this->FEKOResultCSVPath; + csvpramarPath= csvpramarPath.replace(this->FEKOResultCSVPath.size() - 4, 4, ".params"); + // 获取选择文件 + std::vector selectfiles = this->getSelectFieldNames(); + QString parmas_text = this->FEKOResultCSVPath +"\n";// 输出路径 + for (int i = 0; i < selectfiles.size(); i++) { + parmas_text = parmas_text + selectfiles[i] + "\n"; + } + if (isExists(csvpramarPath)) { + removeFile(csvpramarPath); + } + + + writeUTF8StringFile(csvpramarPath, (parmas_text)); + // 拼接命令行 + QString cmdtext = u8""; + if (false) { + cmdtext = cmdtext + u8"NearField2csvTool.exe"; + } + else { + cmdtext = cmdtext + u8"FarField2csvTool.exe"; + } + if (nullptr != this->p) { + this->p->close(); + delete this->p; + this->p = nullptr; + } + this->p = new CMDExcuteApp(); + QObject::connect(this->p, SIGNAL(callbackExcuteResult()), this, SLOT(waitCMDExcute())); + this->p->setAttribute(Qt::WA_DeleteOnClose);; + this->p->show(); + this->p->excuteCmd(cmdtext, csvpramarPath); + } + + void RCSImportDialog::waitCMDExcute() { + qDebug() << u8"转换程序执行结束"; + if (isExists(this->FEKOResultCSVPath)) { + qDebug()<FEKOResultCSVPath; + this->saveSucessfully = true; + this->p->close(); + delete p; + this->p = nullptr; + } + else { + qDebug()<FEKOResultCSVPath; + this->saveSucessfully = false; + } + + // 触发结果时间 + qDebug() << u8"准备执行转换结果编辑功能"; + this->RCSDataImport(); + } + + // 数据入库 + void RCSImportDialog::RCSDataImport() { + // csv数据文件 + + QString csvpath=this->FEKOResultCSVPath; + QString fekoprename=this->FEKOPreFileName; + QString fekofolderpath=this->inRCSDataProjectFolderPath; + + RCSDBManagerClass* sqldb=RCSDBManagerClass::instance(); + QString descStr=this->ui->plainTextEditDesc->toPlainText(); + double transpolarangle=this->ui->doubleSpinBoxPolar->value(); + if (sqldb->initialize()) { + int32_t projectID=sqldb->insertProject(this->FEKOPreFileName.toUtf8().constData(), + this->FEKOProjectFolderPath.toUtf8().constData(), + descStr.toUtf8().constData()); + + // 检查数据 + FEKOBase::RCSEchoDataComputer rsccomputer; + rsccomputer.ComputerFromFile(csvpath); + std::vector datalist=rsccomputer.dataList; + + std::vector records(datalist.size()); + + for (int32_t i=0;iinsertRCSDataRecords(records,projectID,transpolarangle)) { + QMessageBox::information(nullptr,u8"提示",u8"数据入库成功"); + }else { + QMessageBox::warning(nullptr,u8"警告",u8"数据插入失败"); + } + + }else { + QMessageBox::warning(nullptr,u8"警告",u8"数据库连接错误"); + } + } + + + void RCSImportDialog::onImportpushButtonClicked() { + // 执行解析并处理逻辑 + QString fekoprename=QFileInfo(this->FEKOPreFileName).completeBaseName(); + qDebug()<getRcsProjectPath(); + QString RCSDb_rootFolder=Setting::BusAPI::instance()->getRcsdbFoler(); + + QString prefoldername=QString(u8"%1_%2").arg(fekoprename).arg(QString::fromStdString( Common::getCurrentTimeInHex())); + QString fekofolderpath=JoinPath(RCSDb_PreSaveFolder,prefoldername); + QDir dir; + dir.mkpath(fekofolderpath); + + // 工程文件复制 + copyDirectory(this->FEKOProjectFolderPath,fekofolderpath); + this->inRCSDataProjectFolderPath=fekofolderpath; + + QString outcsvpath=JoinPath(fekofolderpath,QString(u8"%1.csv").arg(prefoldername)); + + // 开始处理解析并生成结果文档 + this->FEKOResultImportButtonClick(outcsvpath); + } + + std::vector RCSImportDialog::getSelectFieldNames() { + std::vector result(0); + this->selectListViewmodel = (QStandardItemModel*)(this->ui->SelectlistView->model()); + int selectCount = this->ui->SelectlistView->model()->rowCount(); + for (int i = 0; i < selectCount; i++) { + QStandardItem* listItem = this->selectListViewmodel->item(i); + result.push_back(listItem->text()); + } + return result; + } + + + +} // namespace RCSDBManagerTool diff --git a/src/PluginRCSDBManager/RCSImportDialog.h b/src/PluginRCSDBManager/RCSImportDialog.h new file mode 100644 index 0000000..b465a07 --- /dev/null +++ b/src/PluginRCSDBManager/RCSImportDialog.h @@ -0,0 +1,73 @@ +// +// Created by 30453 on 25-6-25. +// + +#ifndef LAMPCAE_RCSIMPORTDIALOG_H +#define LAMPCAE_RCSIMPORTDIALOG_H + +#include +#include +#include +#include + +class QStandardItemModel; +class CMDExcuteApp; + + +namespace RCSDBManagerTool { + QT_BEGIN_NAMESPACE + namespace Ui { + class RCSImportDialog; + } + QT_END_NAMESPACE + + class RCSImportDialog : public QDialog { + Q_OBJECT + + public: + explicit RCSImportDialog(QWidget* parent = nullptr); + ~RCSImportDialog() override; + + public: + void CheckRCSDBFolder(); + void CheckRCSDBFolder(const QString &rcsDbRootPath); + + std::vector getSelectFieldNames(); + + public slots: + void onSelectPreFolderPushBtn(); + + void AddFekoResultClick(); + void DeleteFekoResultClick(); + + void onImportpushButtonClicked(); + void onCancelpushButtonClicked(); + void waitCMDExcute(); + + void RCSDataImport(); + + public: + QString FEKOProjectFolderPath; + QString FEKOPreFileName; + std::vector nearFieldNames; + std::vector farFieldNames; + QString FEKOResultCSVPath; + + QString inRCSDataProjectFolderPath; + + + private : + QStandardItemModel* ListViewmodel; + QStandardItemModel* selectListViewmodel; + bool saveSucessfully; + CMDExcuteApp* p; + + public: + void FEKOResultImportButtonClick(QString outcsvPath); + + private: + Ui::RCSImportDialog* ui; + }; +} // namespace RCSDBManagerTool + +#endif // LAMPCAE_RCSIMPORTDIALOG_H diff --git a/src/PluginRCSDBManager/RCSImportDialog.ui b/src/PluginRCSDBManager/RCSImportDialog.ui new file mode 100644 index 0000000..e8aa65f --- /dev/null +++ b/src/PluginRCSDBManager/RCSImportDialog.ui @@ -0,0 +1,341 @@ + + + RCSDBManagerTool::RCSImportDialog + + + + 0 + 0 + 690 + 492 + + + + RCSImportDialog + + + + + + 0 + + + QLayout::SetDefaultConstraint + + + + + + 16777215 + 30 + + + + pre工程路径: + + + + + + + false + + + + 16777215 + 30 + + + + + + + + + + + + + + + + 16777215 + 30 + + + + 打开 + + + + + + + + + 0 + + + + + + 16777215 + 30 + + + + .pre文件名 + + + + + + + false + + + + 16777215 + 30 + + + + + + + + + + + + + + + FarField + + + true + + + + + + + + + + + + 0 + 30 + + + + + 60 + 16777215 + + + + 发射极化角 + + + + + + + + 0 + 30 + + + + <html><head/><body><p>水平极化 H:极化发射角值 0 <br/>垂直极化 V: 极化发射角值 180</p></body></html> + + + -361.000000000000000 + + + 361.000000000000000 + + + 1.000000000000000 + + + + + + + + + + + + 0 + 200 + + + + QAbstractItemView::MultiSelection + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + >> + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + << + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + 0 + 200 + + + + QAbstractItemView::MultiSelection + + + + + + + + + 工程描述 + + + + + + + 0 + 80 + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + 导入FEKO结果 + + + + + + + + 16777215 + 30 + + + + 取消 + + + + + + + + + + diff --git a/src/PluginWBFZExchangePlugin/CMDExcuteApp.h b/src/PluginWBFZExchangePlugin/CMDExcuteApp.h index c5c1ba9..c14845e 100644 --- a/src/PluginWBFZExchangePlugin/CMDExcuteApp.h +++ b/src/PluginWBFZExchangePlugin/CMDExcuteApp.h @@ -21,7 +21,7 @@ public: namespace Ui{ class cmdExcuteWindows; } -class CMDExcuteApp : public QMainWindow +class WBFZAPI CMDExcuteApp : public QMainWindow { Q_OBJECT diff --git a/src/PluginWBFZExchangePlugin/FEKOBaseToolClass.h b/src/PluginWBFZExchangePlugin/FEKOBaseToolClass.h index d3393c7..0728006 100644 --- a/src/PluginWBFZExchangePlugin/FEKOBaseToolClass.h +++ b/src/PluginWBFZExchangePlugin/FEKOBaseToolClass.h @@ -196,9 +196,9 @@ namespace FEKOBase { double reEr; double imEr; - double reEtheta; + double reEtheta; // vertical 垂直 v double imEtheta; - double reEphi; + double reEphi; // horizontal 水平 H double imEphi; double RCS_Theta; double RCS_Phi; @@ -230,11 +230,11 @@ namespace FEKOBase { std::vector electricFieldDataList; // 单频点信息 }; - bool compareElectricFieldDataInFreq(const ElectricFieldData& a, const ElectricFieldData& b); - bool comparePRFPluseDataInPRFIdx(const PRFPluseData& a, const PRFPluseData& b); - ElectricFieldData NearField2FarField(ElectricFieldData indata); // 近场转远场 - std::complex NearElectricField2FarElectricField(std::complex inEcho,double Radius,double freq); - double RCSFromEField(std::complex EFile); + bool WBFZAPI compareElectricFieldDataInFreq(const ElectricFieldData& a, const ElectricFieldData& b); + bool WBFZAPI comparePRFPluseDataInPRFIdx(const PRFPluseData& a, const PRFPluseData& b); + ElectricFieldData WBFZAPI NearField2FarField(ElectricFieldData indata); // 近场转远场 + std::complex WBFZAPI NearElectricField2FarElectricField(std::complex inEcho,double Radius,double freq); + double WBFZAPI RCSFromEField(std::complex EFile); @@ -242,7 +242,7 @@ namespace FEKOBase { // 近场 - class NearFieldEchoCSVParser { + class WBFZAPI NearFieldEchoCSVParser { public: NearFieldEchoCSVParser(); ~NearFieldEchoCSVParser(); @@ -272,7 +272,7 @@ namespace FEKOBase { // 远场 - class FarFieldEchoCSVParser { + class WBFZAPI FarFieldEchoCSVParser { public: FarFieldEchoCSVParser(); ~FarFieldEchoCSVParser(); @@ -301,7 +301,7 @@ namespace FEKOBase { }; - class RCSEchoDataComputer{ + class WBFZAPI RCSEchoDataComputer{ public: RCSEchoDataComputer(); ~RCSEchoDataComputer(); diff --git a/src/PluginWBFZExchangePlugin/FEKOResultImport.cpp b/src/PluginWBFZExchangePlugin/FEKOResultImport.cpp index 623b15a..137adc7 100644 --- a/src/PluginWBFZExchangePlugin/FEKOResultImport.cpp +++ b/src/PluginWBFZExchangePlugin/FEKOResultImport.cpp @@ -20,6 +20,10 @@ #include #include #include + + + + #include "ui_FEKOResultImport.h" FEKOResultImport::FEKOResultImport(QWidget* parent) { @@ -277,7 +281,6 @@ int FEKOResultImport::OpenPrejectFolderPath() { } - void FEKOResultImport::waitCMDExcute() { qDebug() << u8"转换程序执行结束"; @@ -334,7 +337,6 @@ int FEKOResultImport::FEKOResultImportButtonClick() file.close(); removeFile(this->FEKOResultCSVPath); } - } QString csvpramarPath = this->FEKOResultCSVPath; diff --git a/src/PluginWBFZExchangePlugin/FEKOResultImport.h b/src/PluginWBFZExchangePlugin/FEKOResultImport.h index edfb107..9a3dfee 100644 --- a/src/PluginWBFZExchangePlugin/FEKOResultImport.h +++ b/src/PluginWBFZExchangePlugin/FEKOResultImport.h @@ -15,6 +15,7 @@ #include #include #include + class QObject; class QMainWindow; diff --git a/src/PluginWBFZExchangePlugin/FileOperator.h b/src/PluginWBFZExchangePlugin/FileOperator.h index 9dc383a..e1dfb2b 100644 --- a/src/PluginWBFZExchangePlugin/FileOperator.h +++ b/src/PluginWBFZExchangePlugin/FileOperator.h @@ -4,6 +4,7 @@ #define FILEOPERATOR_H #include "referenceHeader.h" +#include "WBFZExchangePluginAPI.h" #include #include #include @@ -19,32 +20,32 @@ #include -bool isDirectory(const QString& path); -bool isExists(const QString& path); -bool isFile(const QString& path); -void removeFile(const QString& filePath); -unsigned long convertToULong(const QString& input); +bool WBFZAPI isDirectory(const QString& path); +bool WBFZAPI isExists(const QString& path); +bool WBFZAPI isFile(const QString& path); +void WBFZAPI removeFile(const QString& filePath); +unsigned long WBFZAPI convertToULong(const QString& input); /// /// 获取文件(绝对路径) /// /// /// /// -std::vector getFilelist(const QString& folderpath, const QString& FilenameExtension = ".*",int (*logfun)(QString logtext,int value)=nullptr); +std::vector WBFZAPI getFilelist(const QString& folderpath, const QString& FilenameExtension = ".*",int (*logfun)(QString logtext,int value)=nullptr); -QString getParantFolderNameFromPath(const QString& path); +QString WBFZAPI getParantFolderNameFromPath(const QString& path); -QString getFileNameFromPath(const QString& path); +QString WBFZAPI getFileNameFromPath(const QString& path); -int write_binfile(char* filepath, char* data, size_t data_len); +int WBFZAPI write_binfile(char* filepath, char* data, size_t data_len); - char* read_textfile(char* text_path, int* length); +WBFZAPI char* read_textfile(char* text_path, int* length); -bool exists_test(const QString& name); +bool WBFZAPI exists_test(const QString& name); -size_t fsize(FILE* fp); +size_t WBFZAPI fsize(FILE* fp); -QString getParantFromPath(const QString& path); -void copyFile(const QString& sourcePath, const QString& destinationPath); +QString WBFZAPI getParantFromPath(const QString& path); +void WBFZAPI copyFile(const QString& sourcePath, const QString& destinationPath); // QT FileOperator #endif \ No newline at end of file diff --git a/src/Settings/BusAPI.cpp b/src/Settings/BusAPI.cpp index 57d4e4a..8eccaaa 100644 --- a/src/Settings/BusAPI.cpp +++ b/src/Settings/BusAPI.cpp @@ -81,8 +81,7 @@ namespace Setting QSettings settingwriter(path + "/LAMPCAE.ini", QSettings::IniFormat); _mainSetting->writeINI(&settingwriter); - // _solveOption->writeINI(&settingwriter); - _graphOption->writeINI(&settingwriter); + _graphOption->writeINI(&settingwriter); _messageSetting->writeINI(&settingwriter); } void BusAPI::readINI() @@ -300,4 +299,34 @@ namespace Setting void BusAPI::removeTask(TaskDesc* task) { _taskDescManager->removeTask(task); } + void BusAPI::setRcsdbFoler(const QString& rcsdbFoler) { + return _mainSetting->setRcsdbFoler(rcsdbFoler); + + } + void BusAPI::setRcsdbFilePath(const QString& rcsdbFilePath) { + return _mainSetting->setRcsdbFilePath(rcsdbFilePath); + } + void BusAPI::setRcsProjectPath(const QString& rcsProjectPath) { + return _mainSetting->setRcsProjectPath(rcsProjectPath); + } + const QString& BusAPI::getRcsdbFoler() const + { + return _mainSetting->getRcsdbFoler(); + } + const QString& BusAPI::getRcsdbFilePath() const + { + return _mainSetting->getRcsdbFilePath(); + } + const QString& BusAPI::getRcsProjectPath() const + { + return _mainSetting->getRcsProjectPath(); + } + const QString & BusAPI::getLastSelectPath() const { + return _mainSetting->getLastSelectPath(); + } + + void BusAPI::setLastSelectPath(const QString &LastSelectPath) { + _mainSetting->setLastSelectPath(LastSelectPath); + } + } \ No newline at end of file diff --git a/src/Settings/BusAPI.h b/src/Settings/BusAPI.h index 1d002d4..d081e81 100644 --- a/src/Settings/BusAPI.h +++ b/src/Settings/BusAPI.h @@ -210,6 +210,7 @@ namespace Setting void setMessageBkColor(const QColor &bkColor); + // FEKO const QString& getFekoInstallPath() const; void setFekoInstallPath(const QString& fekoInstallPath); const QString& getFekocadPath() const; @@ -219,6 +220,18 @@ namespace Setting const QString& getPreFekoPath() const; void setPreFekoPath(const QString& preFekoPath); + //RCSDB + void setRcsdbFoler(const QString& rcsdbFoler); + void setRcsdbFilePath(const QString& rcsdbFilePath); + void setRcsProjectPath(const QString& rcsProjectPath); + const QString& getRcsdbFoler() const; + const QString& getRcsdbFilePath() const; + const QString& getRcsProjectPath() const; + + // 上个选择的文件地址 + const QString &getLastSelectPath() const; + void setLastSelectPath(const QString &_LastSelectPath); + // 任务描述管理 TaskDescManager* getTaskDescManager(); TaskDesc* getNewTask(); diff --git a/src/Settings/DialogGraphOption.cpp b/src/Settings/DialogGraphOption.cpp index 3bd2ddc..c099951 100644 --- a/src/Settings/DialogGraphOption.cpp +++ b/src/Settings/DialogGraphOption.cpp @@ -40,6 +40,7 @@ namespace Setting _ui->setupUi(this); connect(this, SIGNAL(updateGraph()), mainwindow, SIGNAL(updateGraphOptionsSig())); connect(_ui->pushButtonSelectFekoInstallPath, SIGNAL(clicked()), this, SLOT(on_PushButtonSelectPath())); + connect(_ui->RCSDbFileSelectBtn, SIGNAL(clicked()), this, SLOT(on_PushButtonRCSDataBaseSelectFilePath())); init(); } GraphOptionDialog::~GraphOptionDialog() @@ -150,10 +151,47 @@ namespace Setting int trans = _graphOption->getTransparency(); _ui->TranspSlider->setValue(trans); - _ui->lineEditFEKOPath->setText(BusAPI::instance()->getFekoInstallPath()); - _ui->lineEdit_CADFeko->setText(BusAPI::instance()->getFekocadPath()); - _ui->lineEditPreFEKO->setText(BusAPI::instance()->getPreFekoPath()); - _ui->lineEdit_RunFeko->setText(BusAPI::instance()->getRunFekoPath()); + // 处理FEKO部分功能 + QString fekobingInstallerPath=BusAPI::instance()->getFekoInstallPath(); + if(fekobingInstallerPath.isEmpty()||!QFileInfo(fekobingInstallerPath).exists()){ + QString applicationexeDirpath=QFileInfo(BusAPI::instance()->getApplicationExePath()).absoluteFilePath(); // 目录 + QString fekorootdirpath=QDir(applicationexeDirpath).filePath("FEKO2020"); + fekorootdirpath=QDir(fekorootdirpath).filePath(u8"feko"); + fekobingInstallerPath=QDir(fekorootdirpath).filePath(u8"bin"); + qDebug()<FindFEKOSetttingParams(fekobingInstallerPath); + }else{ + _ui->lineEditFEKOPath->setText(BusAPI::instance()->getFekoInstallPath()); + _ui->lineEdit_CADFeko->setText(BusAPI::instance()->getFekocadPath()); + _ui->lineEditPreFEKO->setText(BusAPI::instance()->getPreFekoPath()); + _ui->lineEdit_RunFeko->setText(BusAPI::instance()->getRunFekoPath()); + } + // 处理RCSDB功能文件部分 + QString RCSDBFolderPath=BusAPI::instance()->getRcsdbFoler(); + if(RCSDBFolderPath.isEmpty()||!QFileInfo(RCSDBFolderPath).exists()){ + QString applicationexeDirpath=QFileInfo(BusAPI::instance()->getApplicationExePath()).absoluteFilePath(); // 目录 + QString RCSDBrootdirpath=QDir(applicationexeDirpath).filePath(u8"RCSDbFoler"); + QString RCSDBFilePath=QDir(RCSDBrootdirpath).filePath(u8"rcsdq.sqlite3"); + QString RCSProjectFolder=QDir(RCSDBrootdirpath).filePath(u8"ProjectSetFolder"); + // 检查并创建对应的文件是否存在 + if(!QFileInfo(RCSDBrootdirpath).exists()){ + QDir dir; + dir.mkpath(RCSDBrootdirpath); + } + if(!QFileInfo(RCSProjectFolder).exists()){ + QDir dir; + dir.mkpath(RCSProjectFolder); + } + // 设置参数 + BusAPI::instance()->setRcsProjectPath(RCSProjectFolder); + BusAPI::instance()->setRcsdbFoler(RCSDBrootdirpath); + BusAPI::instance()->setRcsdbFilePath(RCSDBFilePath); + }else{ + + } + _ui->lineEditRCSDbFolderPath->setText(BusAPI::instance()->getRcsdbFoler()); + _ui->lineEditRCSDBFilePath->setText(BusAPI::instance()->getRcsdbFilePath()); + _ui->lineEditProjectFolder->setText(BusAPI::instance()->getRcsProjectPath()); } void GraphOptionDialog::accept() { @@ -191,6 +229,28 @@ namespace Setting void GraphOptionDialog::on_PushButtonSelectPath() { QString FEKOBinPath = QFileDialog::getExistingDirectory( this, tr("Select FEKO Install Path"), BusAPI::instance()->getApplicationExePath()); + this->FindFEKOSetttingParams(FEKOBinPath); + } + + QMap GraphOptionDialog::checkFEKOExecutablesAndReturnPaths(const QString& directoryPath) { + QStringList fekoExecutables = {"cadfeko.exe", "prefeko.exe", "runfeko.exe"}; + QMap executablePaths; + qDebug()<lineEditFEKOPath->setText(FEKOBinPath); BusAPI::instance()->setFekoInstallPath(FEKOBinPath); @@ -237,22 +297,10 @@ namespace Setting QMessageBox::warning(this, u8"警告", "检查Feko安装,runfeko"); } } + void GraphOptionDialog::on_PushButtonRCSDataBaseSelectFilePath() { + // 获取sqllite的dB数据库文件 + QString RCSDbFolerPath = QFileDialog::getExistingDirectory( + this, tr("Select RCS Database Foler Path"), BusAPI::instance()->getApplicationExePath()); - QMap GraphOptionDialog::checkFEKOExecutablesAndReturnPaths(const QString& directoryPath) { - QStringList fekoExecutables = {"cadfeko.exe", "prefeko.exe", "runfeko.exe"}; - QMap executablePaths; - qDebug()< - 3 + 4 @@ -498,6 +498,130 @@ + + + RCS数据库管理 + + + + + + false + + + + + + + + + + + + + 0 + 30 + + + + 实体文件夹: + + + + + + + + 0 + 30 + + + + + + + + + + + + + 0 + 30 + + + + RCS数据文件: + + + + + + + + 0 + 30 + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + 0 + 30 + + + + RCS数据文件夹: + + + + + + + + 0 + 30 + + + + + + + + + 0 + 30 + + + + 选择 + + + + + + + diff --git a/src/Settings/GraphOption.cpp b/src/Settings/GraphOption.cpp index ddb2a97..24fba20 100644 --- a/src/Settings/GraphOption.cpp +++ b/src/Settings/GraphOption.cpp @@ -74,6 +74,8 @@ namespace Setting _showMeshNode = settings->value("/MeshDisplay/ShowNode").toBool(); _showMeshEdge = settings->value("/MeshDisplay/ShowEdge").toBool(); _showMeshFace = settings->value("/MeshDisplay/ShowFace").toBool(); + + } void GraphOption::setBackgroundTopColor(QColor c) { diff --git a/src/Settings/MainSetting.cpp b/src/Settings/MainSetting.cpp index dbbbbd6..bbb56b2 100644 --- a/src/Settings/MainSetting.cpp +++ b/src/Settings/MainSetting.cpp @@ -40,9 +40,20 @@ namespace Setting setting->setValue("/Feko/FekocadPath", _FEKOCADPath); setting->setValue("/Feko/RunFekoPath", _RunFEKOPath); setting->setValue("/Feko/preFekoPath", _preFEKOPath); + setting->setValue("/RCSDataBase/RCSDBFolder", _RCSDBFoler); + setting->setValue("/RCSDataBase/RCSDBFile", _RCSDBFilePath); + setting->setValue("/RCSDataBase/RCSProjectFolder", _RCSProjectPath); + setting->setValue("/Path/LastSelectPath", _LastSelectPath); + + + + + } void MainSetting::readINI(QSettings *setting) { + _LastSelectPath=setting->value("/Path/LastSelectPath").toString(); + _workingDir = setting->value("/Path/WorkingDir").toString(); _language = setting->value("/Language/Language").toString(); _recentFiles = setting->value("/Recent/RecentFile").toStringList(); @@ -54,7 +65,9 @@ namespace Setting _FEKOCADPath=setting->value("/Feko/FekocadPath" ).toString(); _RunFEKOPath=setting->value("/Feko/RunFekoPath" ).toString(); _preFEKOPath=setting->value("/Feko/preFekoPath" ).toString(); - + _RCSDBFoler=setting->value("/RCSDataBase/RCSDBFolder").toString(); + _RCSDBFilePath=setting->value("/RCSDataBase/RCSDBFile" ).toString(); + _RCSProjectPath=setting->value("/RCSDataBase/RCSProjectFolder").toString(); QDir dir(_workingDir); @@ -157,6 +170,15 @@ namespace Setting { return _plugins; } + + const QString & MainSetting::getLastSelectPath() const { + return _LastSelectPath; + } + + void MainSetting::setLastSelectPath(const QString &LastSelectPath) { + this->_LastSelectPath = LastSelectPath; + } + const QString& MainSetting::getFekoInstallPath() const { return _FEKOInstallPath; @@ -189,5 +211,29 @@ namespace Setting { _preFEKOPath = preFekoPath; } + const QString& MainSetting::getRcsdbFoler() const + { + return _RCSDBFoler; + } + const QString& MainSetting::getRcsdbFilePath() const + { + return _RCSDBFilePath; + } + const QString& MainSetting::getRcsProjectPath() const + { + return _RCSProjectPath; + } + void MainSetting::setRcsdbFoler(const QString& rcsdbFoler) + { + _RCSDBFoler = rcsdbFoler; + } + void MainSetting::setRcsdbFilePath(const QString& rcsdbFilePath) + { + _RCSDBFilePath = rcsdbFilePath; + } + void MainSetting::setRcsProjectPath(const QString& rcsProjectPath) + { + _RCSProjectPath = rcsProjectPath; + } } \ No newline at end of file diff --git a/src/Settings/MainSetting.h b/src/Settings/MainSetting.h index f348931..8ace39c 100644 --- a/src/Settings/MainSetting.h +++ b/src/Settings/MainSetting.h @@ -70,6 +70,12 @@ namespace Setting QString _licensePath; QStringList _plugins{}; QString _FEKOInstallPath; + QString _LastSelectPath; + + public: + const QString &getLastSelectPath() const; + void setLastSelectPath(const QString &_LastSelectPath); + public: const QString& getFekoInstallPath() const; @@ -82,13 +88,26 @@ namespace Setting private: QString _FEKOCADPath; QString _RunFEKOPath; + QString _preFEKOPath; + + private: // RCSDB + QString _RCSDBFoler; + QString _RCSDBFilePath; + QString _RCSProjectPath; + public: + void setRcsdbFoler(const QString& rcsdbFoler); + void setRcsdbFilePath(const QString& rcsdbFilePath); + void setRcsProjectPath(const QString& rcsProjectPath); + const QString& getRcsdbFoler() const; + const QString& getRcsdbFilePath() const; + const QString& getRcsProjectPath() const; public: const QString& getPreFekoPath() const; void setPreFekoPath(const QString& preFekoPath); private: - QString _preFEKOPath; + bool _showUserGuidance{true}; bool _useRibbon{true}; };