add:
1、增加显微镜场景:添加显微镜3D模型; 2、设置界面添加确认按钮; fix: 1、相机看板:(1)帧率*积分时间=999,防止nir崩溃(2)记录帧率和积分时间,下次打开软件后恢复;(3)只能拖动slider改变值,不能点击slider改变值; 2、加入判断,不能多次打开同一个影像; 3、图像控制看板:只能拖动slider改变值,不能点击slider改变值;
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
||||
@ -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;
|
||||
};
|
||||
|
||||
@ -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<double>)), m_view3DModelManager->m_viewPlant, SLOT(setLoc(std::vector<double>)));
|
||||
}
|
||||
|
||||
void HPPA::onCreated3DModelMicroscopicMotion()
|
||||
{
|
||||
connect(m_tmc, SIGNAL(broadcastLocationSignal(std::vector<double>)), m_view3DModelManager->m_viewMicroscopicMotionControlModel, SLOT(setLoc(std::vector<double>)));
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -133,6 +133,7 @@ color:white;
|
||||
</property>
|
||||
<addaction name="mActionOneMotorScenario"/>
|
||||
<addaction name="mActionPlantPhenotypeScenario"/>
|
||||
<addaction name="mActionMicroscopicMotionControlScenario"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menu_4">
|
||||
<property name="title">
|
||||
@ -725,6 +726,14 @@ QPushButton:pressed
|
||||
<string>光谱</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="mActionMicroscopicMotionControlScenario">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>显微运动控制台</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<customwidgets>
|
||||
|
||||
@ -60,8 +60,8 @@
|
||||
<TargetName>Spectral Insight</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<IncludePath>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)</IncludePath>
|
||||
<LibraryPath>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)</LibraryPath>
|
||||
<IncludePath>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)</IncludePath>
|
||||
<LibraryPath>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)</LibraryPath>
|
||||
<TargetName>Spectral Insight</TargetName>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
@ -75,7 +75,7 @@
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Link>
|
||||
<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;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<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)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>D:\cpp_project_vs2022\HPPA\x64\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
#include "ui_hyperImagerControl.h"
|
||||
|
||||
#include "AspectRatioLabel.h"
|
||||
#include "AppSettings.h"
|
||||
|
||||
class QDoubleSlider;
|
||||
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include <QFileInfo>
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include <unordered_map>
|
||||
@ -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);
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -373,3 +373,17 @@ void View3DLinearStage::setLoc(std::vector<double> loc)
|
||||
|
||||
m_armTransform->setTranslation(QVector3D(x, 0, 0));
|
||||
}
|
||||
|
||||
View3DMicroscopicMotionModel::View3DMicroscopicMotionModel(const QString& baseModelPath, const QString& armModelPath, QWidget* parent)
|
||||
:View3DBase(baseModelPath, armModelPath, parent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void View3DMicroscopicMotionModel::setLoc(std::vector<double> loc)
|
||||
{
|
||||
double x = round(loc[0] * 100) / 100;
|
||||
double y = round(loc[1] * 100) / 100;
|
||||
|
||||
m_armTransform->setTranslation(QVector3D(x, y, 0));
|
||||
}
|
||||
|
||||
@ -106,6 +106,24 @@ private:
|
||||
|
||||
private:
|
||||
|
||||
public Q_SLOTS:
|
||||
void setLoc(std::vector<double> 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<double> loc);
|
||||
};
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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:
|
||||
|
||||
@ -288,7 +288,7 @@ QPushButton:pressed
|
||||
}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>版本:3.0.1</string>
|
||||
<string>版本:3.0.2</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@ -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<double>::of(&QDoubleSpinBox::valueChanged), this, &ImageControl::onSpinRedValueChanged);
|
||||
connect(ui.spinGreen, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &ImageControl::onSpinGreenValueChanged);
|
||||
@ -137,16 +145,10 @@ void ImageControl::setActiveLayer(RasterLayer* layer)
|
||||
int maxIdx = static_cast<int>(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();
|
||||
|
||||
38
HPPA/set.ui
38
HPPA/set.ui
@ -9,8 +9,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>486</width>
|
||||
<height>229</height>
|
||||
<width>641</width>
|
||||
<height>320</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -234,7 +234,10 @@ QPushButton:pressed
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QWidget" name="widget" native="true">
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<layout class="QGridLayout" name="gridLayout_2" rowstretch="3,2">
|
||||
<item row="0" column="0">
|
||||
<widget class="QWidget" name="widget_2" native="true">
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
@ -259,6 +262,35 @@ QPushButton:pressed
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QWidget" name="widget_3" native="true">
|
||||
<layout class="QGridLayout" name="gridLayout_4" columnstretch="5,2">
|
||||
<item row="0" column="0">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>411</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QPushButton" name="confirmBtn">
|
||||
<property name="text">
|
||||
<string>确认</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user