|
|
|
|
@ -117,6 +117,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.mAction3DPlantPhenotypeScenario, SIGNAL(triggered()), this, SLOT(create3DPlantPhenotypeScenario()));
|
|
|
|
|
connect(this->ui.mActionMicroscopicMotionControlScenario, SIGNAL(triggered()), this, SLOT(createMicroscopicMotionControlScenario()));
|
|
|
|
|
|
|
|
|
|
delete ui.centralWidget;
|
|
|
|
|
@ -1015,41 +1016,48 @@ void HPPA::removeLayerByTreeIndex()
|
|
|
|
|
LayerTreeNode* node = static_cast<LayerTreeNode*>(currentIndexTmp.internalPointer());
|
|
|
|
|
if (!node || node->type() != LayerTreeNode::Type::Layer) return;
|
|
|
|
|
|
|
|
|
|
auto* layerNode = static_cast<LayerTreeLayer*>(node);
|
|
|
|
|
MapLayer* mapLayer = layerNode->mapLayer();
|
|
|
|
|
removeLayerByNode(node);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!mapLayer || !m_MapLayerStore) return;
|
|
|
|
|
void HPPA::removeLayerByNode(LayerTreeNode* node)
|
|
|
|
|
{
|
|
|
|
|
if (!node || node->type() != LayerTreeNode::Type::Layer) return;
|
|
|
|
|
|
|
|
|
|
// 获取该 mapLayer 对应的所有 widget 并从 tab 中移除
|
|
|
|
|
std::vector<QWidget*> widgets = m_MapLayerStore->widgetsForMapLayer(mapLayer);
|
|
|
|
|
for (QWidget* widget : widgets)
|
|
|
|
|
{
|
|
|
|
|
if (widget && m_imageViewerTabWidget)
|
|
|
|
|
{
|
|
|
|
|
const int tabIndex = m_imageViewerTabWidget->indexOf(widget);
|
|
|
|
|
if (tabIndex >= 0)
|
|
|
|
|
{
|
|
|
|
|
if (m_recordFrameCounter)
|
|
|
|
|
{
|
|
|
|
|
m_recordFrameCounter->removeCounter(widget);
|
|
|
|
|
}
|
|
|
|
|
m_imageViewerTabWidget->removeTab(tabIndex);
|
|
|
|
|
}
|
|
|
|
|
widget->deleteLater();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
auto* layerNode = static_cast<LayerTreeLayer*>(node);
|
|
|
|
|
MapLayer* mapLayer = layerNode->mapLayer();
|
|
|
|
|
|
|
|
|
|
// 删除 MapLayerStore 中的 mapLayer
|
|
|
|
|
m_MapLayerStore->removeLayer(mapLayer);
|
|
|
|
|
if (!mapLayer || !m_MapLayerStore) return;
|
|
|
|
|
|
|
|
|
|
// 删除树模型中的节点
|
|
|
|
|
LayerTreeNode* parent = node->parentNode();
|
|
|
|
|
int row = node->rowInParent();
|
|
|
|
|
LayerTreeNode* removed = model->removeNode(parent, row);
|
|
|
|
|
if (removed)
|
|
|
|
|
{
|
|
|
|
|
delete removed;
|
|
|
|
|
}
|
|
|
|
|
// 获取该 mapLayer 对应的所有 widget 并从 tab 中移除
|
|
|
|
|
std::vector<QWidget*> widgets = m_MapLayerStore->widgetsForMapLayer(mapLayer);
|
|
|
|
|
for (QWidget* widget : widgets)
|
|
|
|
|
{
|
|
|
|
|
if (widget && m_imageViewerTabWidget)
|
|
|
|
|
{
|
|
|
|
|
const int tabIndex = m_imageViewerTabWidget->indexOf(widget);
|
|
|
|
|
if (tabIndex >= 0)
|
|
|
|
|
{
|
|
|
|
|
if (m_recordFrameCounter)
|
|
|
|
|
{
|
|
|
|
|
m_recordFrameCounter->removeCounter(widget);
|
|
|
|
|
}
|
|
|
|
|
m_imageViewerTabWidget->removeTab(tabIndex);
|
|
|
|
|
}
|
|
|
|
|
widget->deleteLater();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 删除 MapLayerStore 中的 mapLayer
|
|
|
|
|
m_MapLayerStore->removeLayer(mapLayer);
|
|
|
|
|
|
|
|
|
|
// 删除树模型中的节点
|
|
|
|
|
LayerTreeNode* parent = node->parentNode();
|
|
|
|
|
int row = node->rowInParent();
|
|
|
|
|
LayerTreeNode* removed = m_LayerTreeModel->removeNode(parent, row);
|
|
|
|
|
if (removed)
|
|
|
|
|
{
|
|
|
|
|
delete removed;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void HPPA::showColorImageByTreeIndex()
|
|
|
|
|
@ -1130,46 +1138,7 @@ void HPPA::removeAllLayersInRasterGroup()
|
|
|
|
|
pending.pop_back();
|
|
|
|
|
if (!node) continue;
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < node->childCount(); ++i)
|
|
|
|
|
{
|
|
|
|
|
pending.push_back(node->childAt(i));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (node->type() != LayerTreeNode::Type::Layer) continue;
|
|
|
|
|
|
|
|
|
|
auto* layerNode = static_cast<LayerTreeLayer*>(node);
|
|
|
|
|
MapLayer* mapLayer = layerNode->mapLayer();
|
|
|
|
|
QWidget* layerWidget = nullptr;
|
|
|
|
|
|
|
|
|
|
if (mapLayer && m_MapLayerStore)
|
|
|
|
|
{
|
|
|
|
|
layerWidget = m_MapLayerStore->widgetForLayer(mapLayer);
|
|
|
|
|
m_MapLayerStore->removeLayer(mapLayer);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (layerWidget && m_imageViewerTabWidget)
|
|
|
|
|
{
|
|
|
|
|
const int tabIndex = m_imageViewerTabWidget->indexOf(layerWidget);
|
|
|
|
|
if (tabIndex >= 0)
|
|
|
|
|
{
|
|
|
|
|
if (m_recordFrameCounter)
|
|
|
|
|
{
|
|
|
|
|
m_recordFrameCounter->removeCounter(layerWidget);
|
|
|
|
|
}
|
|
|
|
|
m_imageViewerTabWidget->removeTab(tabIndex);
|
|
|
|
|
}
|
|
|
|
|
layerWidget->deleteLater();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
while (m_RasterGroup->childCount() > 0)
|
|
|
|
|
{
|
|
|
|
|
const int row = m_RasterGroup->childCount() - 1;
|
|
|
|
|
LayerTreeNode* removed = m_LayerTreeModel->removeNode(m_RasterGroup, row);
|
|
|
|
|
if (removed)
|
|
|
|
|
{
|
|
|
|
|
delete removed;
|
|
|
|
|
}
|
|
|
|
|
removeLayerByNode(node);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -1265,6 +1234,7 @@ void HPPA::createScenarioActionGroup()
|
|
|
|
|
m_ScenarioActionGroup = new QActionGroup(this);
|
|
|
|
|
m_ScenarioActionGroup->addAction(ui.mActionOneMotorScenario);
|
|
|
|
|
m_ScenarioActionGroup->addAction(ui.mActionPlantPhenotypeScenario);
|
|
|
|
|
m_ScenarioActionGroup->addAction(ui.mAction3DPlantPhenotypeScenario);
|
|
|
|
|
m_ScenarioActionGroup->addAction(ui.mActionMicroscopicMotionControlScenario);
|
|
|
|
|
|
|
|
|
|
// 读取上次选择的结果
|
|
|
|
|
@ -1282,6 +1252,11 @@ void HPPA::createScenarioActionGroup()
|
|
|
|
|
ui.mActionPlantPhenotypeScenario->setChecked(true);
|
|
|
|
|
ui.mActionPlantPhenotypeScenario->trigger();
|
|
|
|
|
}
|
|
|
|
|
else if (lastSelectedAction == "mAction3DPlantPhenotypeScenario")
|
|
|
|
|
{
|
|
|
|
|
ui.mAction3DPlantPhenotypeScenario->setChecked(true);
|
|
|
|
|
ui.mAction3DPlantPhenotypeScenario->trigger();
|
|
|
|
|
}
|
|
|
|
|
else if (lastSelectedAction == "mActionMicroscopicMotionControlScenario")
|
|
|
|
|
{
|
|
|
|
|
ui.mActionMicroscopicMotionControlScenario->setChecked(true);
|
|
|
|
|
@ -1317,14 +1292,10 @@ void HPPA::createOneMotorScenario()
|
|
|
|
|
ui.mAction_1AxisMotor->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_tmc);
|
|
|
|
|
m_tabManager->hideAllTabs();
|
|
|
|
|
|
|
|
|
|
m_tabManager->showTab(m_hic);
|
|
|
|
|
m_tabManager->showTab(m_ic);
|
|
|
|
|
m_tabManager->showTab(m_omc);
|
|
|
|
|
|
|
|
|
|
m_view3DModelManager->switchScenario(View3DModelManager::ScenarioType::OneMotor);
|
|
|
|
|
@ -1352,12 +1323,37 @@ void HPPA::createPlantPhenotypeScenario()
|
|
|
|
|
ui.mAction_2AxisMotor_new->setChecked(true);
|
|
|
|
|
|
|
|
|
|
//右下角控制tab
|
|
|
|
|
m_tabManager->hideTab(m_rac);
|
|
|
|
|
m_tabManager->hideTab(m_omc);
|
|
|
|
|
m_tabManager->hideAllTabs();
|
|
|
|
|
|
|
|
|
|
m_tabManager->showTab(m_hic);
|
|
|
|
|
m_tabManager->showTab(m_ic);
|
|
|
|
|
m_tabManager->showTab(m_rgbCameraControlWindow);
|
|
|
|
|
m_tabManager->showTab(m_adt);
|
|
|
|
|
m_tabManager->showTab(m_pc);
|
|
|
|
|
m_tabManager->showTab(m_tmc);
|
|
|
|
|
|
|
|
|
|
m_view3DModelManager->switchScenario(View3DModelManager::ScenarioType::PlantPhenotype);
|
|
|
|
|
|
|
|
|
|
//右上角轮播
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void HPPA::create3DPlantPhenotypeScenario()
|
|
|
|
|
{
|
|
|
|
|
//if (ui.mAction3DPlantPhenotypeScenario->isChecked())
|
|
|
|
|
// return;
|
|
|
|
|
|
|
|
|
|
//在菜单中选择移动平台
|
|
|
|
|
ui.mAction_2AxisMotor_new->setChecked(true);
|
|
|
|
|
|
|
|
|
|
//右下角控制tab
|
|
|
|
|
m_tabManager->hideAllTabs();
|
|
|
|
|
|
|
|
|
|
m_tabManager->showTab(m_hic);
|
|
|
|
|
m_tabManager->showTab(m_ic);
|
|
|
|
|
m_tabManager->showTab(m_depthCameraWindow);
|
|
|
|
|
m_tabManager->showTab(m_singleLensReflexCameraWindow);
|
|
|
|
|
m_tabManager->showTab(m_rgbCameraControlWindow);
|
|
|
|
|
//m_tabManager->showTab(m_rgbCameraControlWindow);
|
|
|
|
|
m_tabManager->showTab(m_adt);
|
|
|
|
|
m_tabManager->showTab(m_pc);
|
|
|
|
|
m_tabManager->showTab(m_tmc);
|
|
|
|
|
@ -1377,14 +1373,10 @@ void HPPA::createMicroscopicMotionControlScenario()
|
|
|
|
|
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->hideAllTabs();
|
|
|
|
|
|
|
|
|
|
m_tabManager->showTab(m_hic);
|
|
|
|
|
m_tabManager->showTab(m_ic);
|
|
|
|
|
m_tabManager->showTab(m_tmc);
|
|
|
|
|
|
|
|
|
|
m_view3DModelManager->switchScenario(View3DModelManager::ScenarioType::MicroscopicMotionControl);
|
|
|
|
|
@ -2413,6 +2405,9 @@ void HPPA::onPlotHyperspectralImageRgbImage(int fileNumber, int frameNumber, QSt
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (ui.mAction3DPlantPhenotypeScenario->isChecked())
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
//return;
|
|
|
|
|
//获取绘图控件
|
|
|
|
|
QWidget* currentWidget = m_MapLayerStore->widgetForLayer(filePath);
|
|
|
|
|
@ -2606,7 +2601,15 @@ void WorkerThread3::run()
|
|
|
|
|
void HPPA::onLayerCreatedFromFile(const QString& baseName, const QString& filePath, int fileIndex)
|
|
|
|
|
{
|
|
|
|
|
if (!m_LayerTreeModel || !m_RasterGroup) return;
|
|
|
|
|
addLayer(baseName, filePath, false);
|
|
|
|
|
|
|
|
|
|
if (ui.mAction3DPlantPhenotypeScenario->isChecked())
|
|
|
|
|
{
|
|
|
|
|
addLayer(baseName, filePath, false, false);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
addLayer(baseName, filePath, false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void HPPA::addLayer(const QString& baseName, const QString& filePath,bool refresh, bool isAddImage)
|
|
|
|
|
|