From e43d60e2641278bd44ad0567fb710c5b4feb397e Mon Sep 17 00:00:00 2001 From: tangchao0503 <735056338@qq.com> Date: Thu, 16 Apr 2026 15:57:28 +0800 Subject: [PATCH] =?UTF-8?q?add=EF=BC=9A=201=E3=80=81=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=98=BE=E5=BE=AE=E9=95=9C=E5=9C=BA=E6=99=AF=EF=BC=9A=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=98=BE=E5=BE=AE=E9=95=9C3D=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=EF=BC=9B=202=E3=80=81=E8=AE=BE=E7=BD=AE=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=A1=AE=E8=AE=A4=E6=8C=89=E9=92=AE=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix: 1、相机看板:(1)帧率*积分时间=999,防止nir崩溃(2)记录帧率和积分时间,下次打开软件后恢复;(3)只能拖动slider改变值,不能点击slider改变值; 2、加入判断,不能多次打开同一个影像; 3、图像控制看板:只能拖动slider改变值,不能点击slider改变值; --- HPPA/AppSettings.cpp | 30 ++++++++++++++++ HPPA/AppSettings.h | 15 ++++++++ HPPA/HPPA.cpp | 48 +++++++++++++++++++++++-- HPPA/HPPA.h | 2 ++ HPPA/HPPA.ui | 9 +++++ HPPA/HPPA.vcxproj | 6 ++-- HPPA/HyperImagerControl.cpp | 8 +++-- HPPA/HyperImagerControl.h | 1 + HPPA/MapLayerStore.cpp | 16 +++++++++ HPPA/MapLayerStore.h | 3 ++ HPPA/QDoubleSlider.cpp | 3 +- HPPA/View3D.cpp | 16 ++++++++- HPPA/View3D.h | 18 ++++++++++ HPPA/View3DModelManager.cpp | 33 +++++++++++++++-- HPPA/View3DModelManager.h | 6 +++- HPPA/about.ui | 2 +- HPPA/imageControl.cpp | 14 ++++---- HPPA/set.ui | 70 +++++++++++++++++++++++++++---------- HPPA/setWindow.cpp | 1 + 19 files changed, 261 insertions(+), 40 deletions(-) diff --git a/HPPA/AppSettings.cpp b/HPPA/AppSettings.cpp index d5d8110..fc8ffae 100644 --- a/HPPA/AppSettings.cpp +++ b/HPPA/AppSettings.cpp @@ -2,6 +2,9 @@ const QString AppSettings::kDefaultDataFolder = QStringLiteral("C:\\HPPA_image"); const QString AppSettings::kDefaultFileName = QStringLiteral("test_image"); +const int AppSettings::kDefaultFrameRate = 20; +const int AppSettings::kDefaultIntegrationTime = 1; +const int AppSettings::kDefaultGain = 0; AppSettings::AppSettings() : m_settings(QSettings::IniFormat, QSettings::UserScope, @@ -33,3 +36,30 @@ void AppSettings::setFileName(const QString& path) { m_settings.setValue("General/FileName", path); } + +int AppSettings::frameRate() const +{ + return m_settings.value("CameraParams/FrameRate", kDefaultFrameRate).toInt(); +} +void AppSettings::setFrameRate(int value) +{ + m_settings.setValue("CameraParams/FrameRate", value); +} + +int AppSettings::integrationTime() const +{ + return m_settings.value("CameraParams/IntegrationTime", kDefaultIntegrationTime).toInt(); +} +void AppSettings::setIntegrationTime(int value) +{ + m_settings.setValue("CameraParams/IntegrationTime", value); +} + +int AppSettings::gain() const +{ + return m_settings.value("CameraParams/Gain", kDefaultGain).toInt(); +} +void AppSettings::setGain(int value) +{ + m_settings.setValue("CameraParams/Gain", value); +} diff --git a/HPPA/AppSettings.h b/HPPA/AppSettings.h index b77b4d2..e25e72a 100644 --- a/HPPA/AppSettings.h +++ b/HPPA/AppSettings.h @@ -14,6 +14,18 @@ public: QString fileName() const; void setFileName(const QString& path); + + // 帧率 + int frameRate() const; + void setFrameRate(int value); + + // 积分时间 + int integrationTime() const; + void setIntegrationTime(int value); + + // 增益 + int gain() const; + void setGain(int value); // 在此处添加更多参数的 getter/setter ... private: @@ -26,4 +38,7 @@ private: // 默认值 static const QString kDefaultDataFolder; static const QString kDefaultFileName; + static const int kDefaultFrameRate; + static const int kDefaultIntegrationTime; + static const int kDefaultGain; }; diff --git a/HPPA/HPPA.cpp b/HPPA/HPPA.cpp index 51b6155..9de49d0 100644 --- a/HPPA/HPPA.cpp +++ b/HPPA/HPPA.cpp @@ -111,6 +111,7 @@ HPPA::HPPA(QWidget* parent) connect(this->ui.action_about, SIGNAL(triggered()), this, SLOT(onAbout())); connect(this->ui.mActionOneMotorScenario, SIGNAL(triggered()), this, SLOT(createOneMotorScenario())); connect(this->ui.mActionPlantPhenotypeScenario, SIGNAL(triggered()), this, SLOT(createPlantPhenotypeScenario())); + connect(this->ui.mActionMicroscopicMotionControlScenario, SIGNAL(triggered()), this, SLOT(createMicroscopicMotionControlScenario())); delete ui.centralWidget; @@ -469,6 +470,7 @@ HPPA::HPPA(QWidget* parent) gridLayout_modelWidgetContainer->addWidget(m_view3DModelManager); connect(m_view3DModelManager, SIGNAL(created3DModelPlantPhenotype()), this, SLOT(onCreated3DModelPlantPhenotype())); + connect(m_view3DModelManager, SIGNAL(created3DModelMicroscopicMotion()), this, SLOT(onCreated3DModelMicroscopicMotion())); connect(m_view3DModelManager, SIGNAL(created3DModelOneMotor()), this, SLOT(onCreated3DModelOneMotor())); ui.mDockWidgetSimulator->setWidget(tmp(modelWidgetContainer)); @@ -1191,6 +1193,7 @@ void HPPA::createScenarioActionGroup() m_ScenarioActionGroup = new QActionGroup(this); m_ScenarioActionGroup->addAction(ui.mActionOneMotorScenario); m_ScenarioActionGroup->addAction(ui.mActionPlantPhenotypeScenario); + m_ScenarioActionGroup->addAction(ui.mActionMicroscopicMotionControlScenario); // 读取上次选择的结果 QSettings settings; @@ -1207,6 +1210,11 @@ void HPPA::createScenarioActionGroup() ui.mActionPlantPhenotypeScenario->setChecked(true); ui.mActionPlantPhenotypeScenario->trigger(); } + else if (lastSelectedAction == "mActionMicroscopicMotionControlScenario") + { + ui.mActionMicroscopicMotionControlScenario->setChecked(true); + ui.mActionMicroscopicMotionControlScenario->trigger(); + } } void HPPA::selectScenario(QAction* selectedAction) @@ -1258,6 +1266,11 @@ void HPPA::onCreated3DModelPlantPhenotype() connect(m_tmc, SIGNAL(broadcastLocationSignal(std::vector)), m_view3DModelManager->m_viewPlant, SLOT(setLoc(std::vector))); } +void HPPA::onCreated3DModelMicroscopicMotion() +{ + connect(m_tmc, SIGNAL(broadcastLocationSignal(std::vector)), m_view3DModelManager->m_viewMicroscopicMotionControlModel, SLOT(setLoc(std::vector))); +} + void HPPA::createPlantPhenotypeScenario() { //if (ui.mActionPlantPhenotypeScenario->isChecked()) @@ -1283,6 +1296,31 @@ void HPPA::createPlantPhenotypeScenario() } +void HPPA::createMicroscopicMotionControlScenario() +{ + //if (ui.mActionMicroscopicMotionControl->isChecked()) + // return; + + //在菜单中选择移动平台 + ui.mAction_2AxisMotor_new->setChecked(true); + + //右下角控制tab + m_tabManager->hideTab(m_singleLensReflexCameraWindow); + m_tabManager->hideTab(m_depthCameraWindow); + m_tabManager->hideTab(m_rgbCameraControlWindow); + m_tabManager->hideTab(m_adt); + m_tabManager->hideTab(m_pc); + m_tabManager->hideTab(m_rac); + m_tabManager->hideTab(m_omc); + + m_tabManager->showTab(m_tmc); + + m_view3DModelManager->switchScenario(View3DModelManager::ScenarioType::MicroscopicMotionControl); + + //右上角轮播 + +} + bool HPPA::testImagerVality() { try @@ -1869,6 +1907,10 @@ void HPPA::onOpenImg() if (uri.isEmpty()) return; + //判断是否已经打开 + if (m_MapLayerStore->containsLayer(uri)) + return; + // 2) 创建 RasterLayer,然后添加到图层管理器 if (!m_LayerTreeModel || !m_RasterGroup) { @@ -2075,9 +2117,9 @@ void HPPA::onconnect() ui.gain_lineEdit->setValidator(new QRegExpValidator(rx));*/ //获取相机参数并显示到界面中 - m_hic->setFrameRate(m_Imager->getFramerate()); - m_hic->setIntegrationTime(m_Imager->getIntegrationTime()); - m_hic->setGain(m_Imager->getGain()); + m_hic->setFrameRate(AppSettings::instance().frameRate()); + m_hic->setIntegrationTime(AppSettings::instance().integrationTime()); + m_hic->setGain(AppSettings::instance().gain()); } catch (std::exception const& e) { diff --git a/HPPA/HPPA.h b/HPPA/HPPA.h index d43a924..2f2058b 100644 --- a/HPPA/HPPA.h +++ b/HPPA/HPPA.h @@ -368,6 +368,8 @@ public Q_SLOTS: void createOneMotorScenario(); void createPlantPhenotypeScenario(); void onCreated3DModelPlantPhenotype(); + void onCreated3DModelMicroscopicMotion(); + void createMicroscopicMotionControlScenario(); void onCreated3DModelOneMotor(); void addLayer(const QString& baseName, const QString& filePath, bool refresh); diff --git a/HPPA/HPPA.ui b/HPPA/HPPA.ui index 1381f97..8d3bf9a 100644 --- a/HPPA/HPPA.ui +++ b/HPPA/HPPA.ui @@ -133,6 +133,7 @@ color:white; + @@ -725,6 +726,14 @@ QPushButton:pressed 光谱 + + + true + + + 显微运动控制台 + + diff --git a/HPPA/HPPA.vcxproj b/HPPA/HPPA.vcxproj index 95c9557..0330060 100644 --- a/HPPA/HPPA.vcxproj +++ b/HPPA/HPPA.vcxproj @@ -60,8 +60,8 @@ Spectral Insight - D:\cpp_library\gdal2.2.3_vs2017\include;C:\Program Files\ResononAPI\include;D:\cpp_library\opencv3.4.11\opencv\build\include;D:\cpp_library\opencv3.4.11\opencv\build\include\opencv;D:\cpp_library\opencv3.4.11\opencv\build\include\opencv2;D:\cpp_project_vs2022\AutoFocus_InspireLinearMotor_DLL\AutoFocus_InspireLinearMotor_DLL\SDKs\PCOMM\Include;D:\cpp_project_vs2022\AutoFocus_InspireLinearMotor_DLL\AutoFocus_InspireLinearMotor_DLL\SDKs\PortControl;D:\cpp_project_vs2022\AutoFocus_InspireLinearMotor_DLL\AutoFocus_InspireLinearMotor_DLL;D:\cpp_project_vs2022\HPPA\HPPA;D:\cpp_library\libconfig-1.7.3\lib;D:\cpp_project_vs2022\HPPA\vincecontrol;C:\XIMEA\API\xiAPI;D:\cpp_project_vs2022\HPPA\IrisMultiMotorController\IrisMultiMotorController;D:\cpp_library\eigen-3.4-rc1;$(IncludePath) - D:\cpp_library\opencv3.4.11\opencv\build\x64\vc15\lib;D:\cpp_library\vincecontrol_vs2017_release;D:\cpp_library\gdal2.2.3_vs2017\lib;C:\Program Files\ResononAPI\lib64;D:\cpp_project_vs2022\AutoFocus_InspireLinearMotor_DLL\x64\Release;D:\cpp_library\libconfig-1.7.3\build\x64;D:\cpp_project_vs2022\IrisMultiMotorController\x64\Release;C:\XIMEA\API\xiAPI;$(LibraryPath) + D:\cpp_library\gdal2.2.3_vs2017\include;C:\Program Files\ResononAPI\include;D:\cpp_library\opencv3.4.11\opencv\build\include;D:\cpp_library\opencv3.4.11\opencv\build\include\opencv;D:\cpp_library\opencv3.4.11\opencv\build\include\opencv2;D:\cpp_project_vs2022\AutoFocus_InspireLinearMotor_DLL\AutoFocus_InspireLinearMotor_DLL\SDKs\PCOMM\Include;D:\cpp_project_vs2022\AutoFocus_InspireLinearMotor_DLL\AutoFocus_InspireLinearMotor_DLL\SDKs\PortControl;D:\cpp_project_vs2022\AutoFocus_InspireLinearMotor_DLL\AutoFocus_InspireLinearMotor_DLL;D:\cpp_project_vs2022\HPPA\HPPA;D:\cpp_library\libconfig-1.7.3\lib;D:\cpp_project_vs2022\HPPA\vincecontrol;C:\XIMEA\API\xiAPI;D:\cpp_project_vs2022\HPPA\IrisMultiMotorController\IrisMultiMotorController;D:\cpp_library\eigen-3.4-rc1;C:\Program Files\OrbbecSDK 2.7.6\include;$(IncludePath) + D:\cpp_library\opencv3.4.11\opencv\build\x64\vc15\lib;D:\cpp_library\vincecontrol_vs2017_release;D:\cpp_library\gdal2.2.3_vs2017\lib;C:\Program Files\ResononAPI\lib64;D:\cpp_project_vs2022\AutoFocus_InspireLinearMotor_DLL\x64\Release;D:\cpp_library\libconfig-1.7.3\build\x64;D:\cpp_project_vs2022\IrisMultiMotorController\x64\Release;C:\XIMEA\API\xiAPI;C:\Program Files\OrbbecSDK 2.7.6\lib;$(LibraryPath) Spectral Insight @@ -75,7 +75,7 @@ - opencv_world3411.lib;vincecontrol.lib;gdal_i.lib;resonon-basler.lib;resonon-allied.lib;AutoFocus_InspireLinearMotor_DLL.lib;libconfig++.lib;xiapi64.lib;IrisMultiMotorController.lib;%(AdditionalDependencies) + opencv_world3411.lib;vincecontrol.lib;gdal_i.lib;resonon-basler.lib;resonon-allied.lib;AutoFocus_InspireLinearMotor_DLL.lib;libconfig++.lib;xiapi64.lib;IrisMultiMotorController.lib;OrbbecSDK.lib;%(AdditionalDependencies) D:\cpp_project_vs2022\HPPA\x64\Release;%(AdditionalLibraryDirectories) diff --git a/HPPA/HyperImagerControl.cpp b/HPPA/HyperImagerControl.cpp index 1d2537d..d413f15 100644 --- a/HPPA/HyperImagerControl.cpp +++ b/HPPA/HyperImagerControl.cpp @@ -83,6 +83,7 @@ void HyperImagerControl::setFrameRate(double frameRate) ui.FramerateSlider->setValue(frameRate); updateIntegrationTimeRange(frameRate); + AppSettings::instance().setFrameRate(frameRate); } void HyperImagerControl::setIntegrationTime(double integrationTime) @@ -91,12 +92,15 @@ void HyperImagerControl::setIntegrationTime(double integrationTime) ui.IntegratioinTimeSlider->setValue(integrationTime); updateFramerateRange(integrationTime); + AppSettings::instance().setIntegrationTime(integrationTime); } void HyperImagerControl::setGain(double gain) { ui.gain_spinBox->setValue(gain); ui.GainSlider->setValue(gain); + + AppSettings::instance().setGain(gain); } void HyperImagerControl::onFramerateSpinBoxEditingFinished() @@ -161,7 +165,7 @@ void HyperImagerControl::onGainSliderReleased() void HyperImagerControl::updateIntegrationTimeRange(double frameRate) { - double maxIntegrationTime = 1.0 / frameRate * 1000.0; // 毫秒 + double maxIntegrationTime = 1.0 / frameRate * 999.0; // 毫秒 ui.IntegratioinTimeSlider->blockSignals(true); ui.IntegratioinTimeSlider->setMaximum(maxIntegrationTime); @@ -176,7 +180,7 @@ void HyperImagerControl::updateIntegrationTimeRange(double frameRate) void HyperImagerControl::updateFramerateRange(double integrationTime) { - double maxFramerate = 1.0 / (integrationTime / 1000.0); // 积分时间(毫秒)转帧率 + double maxFramerate = 1.0 / (integrationTime / 999.0); // 积分时间(毫秒)转帧率 if(maxFramerate > m_frameRateLimit) { diff --git a/HPPA/HyperImagerControl.h b/HPPA/HyperImagerControl.h index 2079d2a..609d6ce 100644 --- a/HPPA/HyperImagerControl.h +++ b/HPPA/HyperImagerControl.h @@ -5,6 +5,7 @@ #include "ui_hyperImagerControl.h" #include "AspectRatioLabel.h" +#include "AppSettings.h" class QDoubleSlider; diff --git a/HPPA/MapLayerStore.cpp b/HPPA/MapLayerStore.cpp index f74ca03..9287383 100644 --- a/HPPA/MapLayerStore.cpp +++ b/HPPA/MapLayerStore.cpp @@ -43,6 +43,22 @@ void MapLayerStore::removeLayerByName(const QString& name) } } +bool MapLayerStore::containsLayer(const QString& url, bool isAbsolutePath) const +{ + QFileInfo fi(url); + QString fileName = fi.completeBaseName(); + + if (!isAbsolutePath) + { + return getLayer(fileName) != nullptr; + } + for (const auto& l : m_layers) { + if (l->dataPath() == url) + return true; + } + return false; +} + MapLayer* MapLayerStore::getLayer(const QString& name) const { for (const auto& l : m_layers) { diff --git a/HPPA/MapLayerStore.h b/HPPA/MapLayerStore.h index 0988eda..35cac75 100644 --- a/HPPA/MapLayerStore.h +++ b/HPPA/MapLayerStore.h @@ -2,6 +2,7 @@ #include #include +#include #include #include #include @@ -20,6 +21,8 @@ public: // Now also accept the associated QWidget so UI widget can be retrieved by layer pointer void addLayer(MapLayer* layer, QWidget* widget = nullptr); + bool containsLayer(const QString& url, bool isAbsolutePath = true) const; + // Remove by pointer or by name. Destruction happens when removed from store. public slots: void removeLayer(MapLayer* layer); diff --git a/HPPA/QDoubleSlider.cpp b/HPPA/QDoubleSlider.cpp index 938558c..0fdc9d5 100644 --- a/HPPA/QDoubleSlider.cpp +++ b/HPPA/QDoubleSlider.cpp @@ -6,7 +6,8 @@ m_Multiplier(100.0) { connect(this, SIGNAL(valueChanged(int)), this, SLOT(notifyValueChanged(int))); - setSingleStep(1); + setSingleStep(0); + setPageStep(0); setRange(1, 500); setOrientation(Qt::Horizontal); diff --git a/HPPA/View3D.cpp b/HPPA/View3D.cpp index 10d08a9..cda2eb5 100644 --- a/HPPA/View3D.cpp +++ b/HPPA/View3D.cpp @@ -372,4 +372,18 @@ void View3DLinearStage::setLoc(std::vector loc) double x = round(loc[0] * 100) / 100; m_armTransform->setTranslation(QVector3D(x, 0, 0)); -} \ No newline at end of file +} + +View3DMicroscopicMotionModel::View3DMicroscopicMotionModel(const QString& baseModelPath, const QString& armModelPath, QWidget* parent) + :View3DBase(baseModelPath, armModelPath, parent) +{ + +} + +void View3DMicroscopicMotionModel::setLoc(std::vector loc) +{ + double x = round(loc[0] * 100) / 100; + double y = round(loc[1] * 100) / 100; + + m_armTransform->setTranslation(QVector3D(x, y, 0)); +} diff --git a/HPPA/View3D.h b/HPPA/View3D.h index c5facaa..419b8c3 100644 --- a/HPPA/View3D.h +++ b/HPPA/View3D.h @@ -106,6 +106,24 @@ private: private: +public Q_SLOTS: + void setLoc(std::vector loc); +}; + +class View3DMicroscopicMotionModel : public View3DBase +{ + Q_OBJECT +public: + View3DMicroscopicMotionModel(const QString& baseModelPath, + const QString& armModelPath, + QWidget* parent = nullptr); + +protected: + +private: + +private: + public Q_SLOTS: void setLoc(std::vector loc); }; diff --git a/HPPA/View3DModelManager.cpp b/HPPA/View3DModelManager.cpp index 28e1552..787f72a 100644 --- a/HPPA/View3DModelManager.cpp +++ b/HPPA/View3DModelManager.cpp @@ -13,15 +13,21 @@ View3DModelManager::View3DModelManager(QWidget* parent) void View3DModelManager::switchScenario(ScenarioType type) { - if (type == ScenarioType::PlantPhenotype) { + if (type == ScenarioType::PlantPhenotype) + { ensurePlantPhenotypeView(); m_stackedWidget->setCurrentWidget(m_viewPlant); } - else { + if (type == ScenarioType::OneMotor) + { ensureOneMotorView(); m_stackedWidget->setCurrentWidget(m_viewMotor); } - + if (type == ScenarioType::MicroscopicMotionControl) + { + ensureMicroscopicMotionControlView(); + m_stackedWidget->setCurrentWidget(m_viewMicroscopicMotionControlModel); + } emit scenarioChanged(type); } @@ -46,6 +52,27 @@ void View3DModelManager::ensurePlantPhenotypeView() emit created3DModelPlantPhenotype(); } +void View3DModelManager::ensureMicroscopicMotionControlView() +{ + if (m_viewMicroscopicMotionControlModel) + return; + + QString basePath = QCoreApplication::applicationDirPath(); + + m_viewMicroscopicMotionControlModel = new View3DMicroscopicMotionModel( + basePath + "/3DModel/MicroscopicMotionModel_static.obj", + basePath + "/3DModel/MicroscopicMotionModel_moving.obj", + m_stackedWidget + ); + + m_viewMicroscopicMotionControlModel->setViewCenter(1000, 1000, -1000); + m_viewMicroscopicMotionControlModel->setDistance(5000); + + m_stackedWidget->addWidget(m_viewMicroscopicMotionControlModel); + + emit created3DModelMicroscopicMotion(); +} + void View3DModelManager::ensureOneMotorView() { if (m_viewMotor) diff --git a/HPPA/View3DModelManager.h b/HPPA/View3DModelManager.h index 6729e39..d288b20 100644 --- a/HPPA/View3DModelManager.h +++ b/HPPA/View3DModelManager.h @@ -16,7 +16,8 @@ class View3DModelManager : public QWidget public: enum class ScenarioType { PlantPhenotype, - OneMotor + OneMotor, + MicroscopicMotionControl }; explicit View3DModelManager(QWidget* parent = nullptr); @@ -25,14 +26,17 @@ public: View3DPlantPhenotype* m_viewPlant = nullptr; View3DLinearStage* m_viewMotor = nullptr; + View3DMicroscopicMotionModel* m_viewMicroscopicMotionControlModel = nullptr; signals: void scenarioChanged(ScenarioType type); void created3DModelPlantPhenotype(); void created3DModelOneMotor(); + void created3DModelMicroscopicMotion(); private: void ensurePlantPhenotypeView(); + void ensureMicroscopicMotionControlView(); void ensureOneMotorView(); private: diff --git a/HPPA/about.ui b/HPPA/about.ui index e2db911..822918d 100644 --- a/HPPA/about.ui +++ b/HPPA/about.ui @@ -288,7 +288,7 @@ QPushButton:pressed } - 版本:3.0.1 + 版本:3.0.2 diff --git a/HPPA/imageControl.cpp b/HPPA/imageControl.cpp index df313ce..6b275e3 100644 --- a/HPPA/imageControl.cpp +++ b/HPPA/imageControl.cpp @@ -8,6 +8,14 @@ ImageControl::ImageControl(QWidget* parent) { ui.setupUi(this); + ui.sliderRed->setPageStep(0); + ui.sliderGreen->setPageStep(0); + ui.sliderBlue->setPageStep(0); + + ui.sliderRed->setSingleStep(0); + ui.sliderGreen->setSingleStep(0); + ui.sliderBlue->setSingleStep(0); + // Spinbox valueChanged: only sync the paired slider (no render) connect(ui.spinRed, QOverload::of(&QDoubleSpinBox::valueChanged), this, &ImageControl::onSpinRedValueChanged); connect(ui.spinGreen, QOverload::of(&QDoubleSpinBox::valueChanged), this, &ImageControl::onSpinGreenValueChanged); @@ -137,16 +145,10 @@ void ImageControl::setActiveLayer(RasterLayer* layer) int maxIdx = static_cast(m_wavelengths.size()) - 1; ui.sliderRed->setMinimum(0); ui.sliderRed->setMaximum(maxIdx); - ui.sliderRed->setSingleStep(1); - ui.sliderRed->setPageStep(1); ui.sliderGreen->setMinimum(0); ui.sliderGreen->setMaximum(maxIdx); - ui.sliderGreen->setSingleStep(1); - ui.sliderGreen->setPageStep(1); ui.sliderBlue->setMinimum(0); ui.sliderBlue->setMaximum(maxIdx); - ui.sliderBlue->setSingleStep(1); - ui.sliderBlue->setPageStep(1); // Set current values from layer's render params auto params = layer->currentRenderParams(); diff --git a/HPPA/set.ui b/HPPA/set.ui index 012d2d1..68120ed 100644 --- a/HPPA/set.ui +++ b/HPPA/set.ui @@ -9,8 +9,8 @@ 0 0 - 486 - 229 + 641 + 320 @@ -234,26 +234,58 @@ QPushButton:pressed - + - - - 数据路径 - + + + + + + 数据路径 + + + + + + + true + + + + + + + ... + + + + - - - - true - - - - - - - ... - + + + + + + + Qt::Horizontal + + + + 411 + 20 + + + + + + + + 确认 + + + + diff --git a/HPPA/setWindow.cpp b/HPPA/setWindow.cpp index 9ed9ad5..62993c1 100644 --- a/HPPA/setWindow.cpp +++ b/HPPA/setWindow.cpp @@ -12,6 +12,7 @@ setWindow::setWindow(QWidget* parent) connect(this->ui.closeBtn, SIGNAL(released()), this, SLOT(onExit())); connect(this->ui.dataFolderBtn, SIGNAL(clicked()), this, SLOT(onSelectDataFolder())); + connect(this->ui.confirmBtn, SIGNAL(clicked()), this, SLOT(onExit())); loadSettings(); }