diff --git a/ApplicationCode/Application/Tools/RiaStatisticsTools.cpp b/ApplicationCode/Application/Tools/RiaStatisticsTools.cpp index 618c382d8a..b927db933f 100644 --- a/ApplicationCode/Application/Tools/RiaStatisticsTools.cpp +++ b/ApplicationCode/Application/Tools/RiaStatisticsTools.cpp @@ -22,6 +22,8 @@ #include "RifEclipseSummaryAddress.h" +#include + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/Application/Tools/RiaStatisticsTools.h b/ApplicationCode/Application/Tools/RiaStatisticsTools.h index 169d71a936..25467e626a 100644 --- a/ApplicationCode/Application/Tools/RiaStatisticsTools.h +++ b/ApplicationCode/Application/Tools/RiaStatisticsTools.h @@ -20,9 +20,9 @@ #pragma once -#include -#include -#include +#include + +class QString; //================================================================================================== // @@ -33,4 +33,19 @@ class RiaStatisticsTools { public: static const QString replacePercentileByPValueText(const QString& percentile); + + + template static bool isInvalidNumber(NumberType value) + { + return !isValidNumber(value); + } + + template static bool isValidNumber(NumberType value) + { + if (std::isinf(value)) return false; + if (std::isnan(value)) return false; + + return true; + } }; + diff --git a/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp b/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp index 9926175c38..c0eb5cba36 100644 --- a/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp +++ b/ApplicationCode/Commands/CompletionExportCommands/RicWellPathExportCompletionDataFeatureImpl.cpp @@ -325,23 +325,32 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions(const std::ve { for (auto wellPath : usedWellPaths) { - std::vector wellCompletions; + std::vector completionsForWell; for (const auto& completion : completions) { if (completion.wellName() == wellPath->completions()->wellNameForExport()) { - wellCompletions.push_back(completion); + completionsForWell.push_back(completion); } } - if (wellCompletions.empty()) continue; + if (completionsForWell.empty()) continue; + + std::vector reportItemsForWell; + for (const auto& fracItem : fractureDataReportItems) + { + if (fracItem.wellPathNameForExport() == wellPath->completions()->wellNameForExport()) + { + reportItemsForWell.push_back(fracItem); + } + } QString fileName = QString("%1_unifiedCompletions_%2").arg(wellPath->name()).arg(eclipseCaseName); sortAndExportCompletionsToFile(exportSettings.caseToApply, exportSettings.folder, fileName, - wellCompletions, - fractureDataReportItems, + completionsForWell, + reportItemsForWell, exportSettings.compdatExport); progress.incrementProgress(); } @@ -357,17 +366,17 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions(const std::ve { for (auto wellPath : usedWellPaths) { - std::vector wellCompletions; + std::vector completionsForWell; for (const auto& completion : completions) { if (completion.wellName() == wellPath->completions()->wellNameForExport() && completionType == completion.completionType()) { - wellCompletions.push_back(completion); + completionsForWell.push_back(completion); } } - if (wellCompletions.empty()) continue; + if (completionsForWell.empty()) continue; { QString completionTypeText; @@ -378,11 +387,20 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions(const std::ve QString fileName = QString("%1_%2_%3").arg(wellPath->name()).arg(completionTypeText).arg(eclipseCaseName); if (completionType == RigCompletionData::FRACTURE) { + std::vector reportItemsForWell; + for (const auto& fracItem : fractureDataReportItems) + { + if (fracItem.wellPathNameForExport() == wellPath->completions()->wellNameForExport()) + { + reportItemsForWell.push_back(fracItem); + } + } + sortAndExportCompletionsToFile(exportSettings.caseToApply, exportSettings.folder, fileName, - wellCompletions, - fractureDataReportItems, + completionsForWell, + reportItemsForWell, exportSettings.compdatExport); } else @@ -391,7 +409,7 @@ void RicWellPathExportCompletionDataFeatureImpl::exportCompletions(const std::ve sortAndExportCompletionsToFile(exportSettings.caseToApply, exportSettings.folder, fileName, - wellCompletions, + completionsForWell, emptyReportItemVector, exportSettings.compdatExport); } diff --git a/ApplicationCode/Commands/CompletionExportCommands/RicWellPathFractureReportItem.cpp b/ApplicationCode/Commands/CompletionExportCommands/RicWellPathFractureReportItem.cpp index c194586137..70022f4a93 100644 --- a/ApplicationCode/Commands/CompletionExportCommands/RicWellPathFractureReportItem.cpp +++ b/ApplicationCode/Commands/CompletionExportCommands/RicWellPathFractureReportItem.cpp @@ -25,11 +25,11 @@ //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RicWellPathFractureReportItem::RicWellPathFractureReportItem(const QString& wellPathName, +RicWellPathFractureReportItem::RicWellPathFractureReportItem(const QString& wellPathNameForExport, const QString& fractureName, const QString& fractureTemplateName, double measuredDepth) - : m_wellPathNameForExport(wellPathName) + : m_wellPathNameForExport(wellPathNameForExport) , m_wellPathFracture(fractureName) , m_wellPathFractureTemplate(fractureTemplateName) , m_mesuredDepth(measuredDepth) diff --git a/ApplicationCode/Commands/CompletionExportCommands/RicWellPathFractureTextReportFeatureImpl.cpp b/ApplicationCode/Commands/CompletionExportCommands/RicWellPathFractureTextReportFeatureImpl.cpp index e87e143a02..a9b38bce1b 100644 --- a/ApplicationCode/Commands/CompletionExportCommands/RicWellPathFractureTextReportFeatureImpl.cpp +++ b/ApplicationCode/Commands/CompletionExportCommands/RicWellPathFractureTextReportFeatureImpl.cpp @@ -80,24 +80,39 @@ QString RicWellPathFractureTextReportFeatureImpl::wellPathFractureReport( textStream << lineStart << "\n"; - auto proj = RiaApplication::instance()->project(); - auto fractureTemplates = proj->activeOilField()->fractureDefinitionCollection()->fractureTemplates(); std::vector stimPlanTemplates; std::vector ellipseTemplates; + - for (const auto fracTemplate : fractureTemplates) { - auto stimPlanTemplate = dynamic_cast(fracTemplate); - if (stimPlanTemplate) + auto proj = RiaApplication::instance()->project(); + auto fractureTemplates = proj->activeOilField()->fractureDefinitionCollection()->fractureTemplates(); + + std::set usedFractureTemplateNames; + for (const auto& item : wellPathFractureReportItems) { - stimPlanTemplates.push_back(stimPlanTemplate); + usedFractureTemplateNames.insert(item.fractureTemplateName()); } - auto ellipseTemplate = dynamic_cast(fracTemplate); - if (ellipseTemplate) + for (const auto fracTemplate : fractureTemplates) { - ellipseTemplates.push_back(ellipseTemplate); + if (usedFractureTemplateNames.find(fracTemplate->name()) == usedFractureTemplateNames.end()) + { + continue; + } + + auto stimPlanTemplate = dynamic_cast(fracTemplate); + if (stimPlanTemplate) + { + stimPlanTemplates.push_back(stimPlanTemplate); + } + + auto ellipseTemplate = dynamic_cast(fracTemplate); + if (ellipseTemplate) + { + ellipseTemplates.push_back(ellipseTemplate); + } } } @@ -136,7 +151,11 @@ QString RicWellPathFractureTextReportFeatureImpl::wellPathFractureReport( } { - QString tableText = createFractureText(fractureTemplates); + std::vector fracTemplates; + fracTemplates.insert(fracTemplates.end(), ellipseTemplates.begin(), ellipseTemplates.end()); + fracTemplates.insert(fracTemplates.end(), stimPlanTemplates.begin(), stimPlanTemplates.end()); + + QString tableText = createFractureText(fracTemplates); textStream << tableText; textStream << lineStart << "\n"; } @@ -623,7 +642,7 @@ QString RicWellPathFractureTextReportFeatureImpl::createFractureCompletionSummar RifEclipseOutputTableColumn(meanText, RifEclipseOutputTableDoubleFormatting(RIF_FLOAT, 1), RIGHT), // KfWf RifEclipseOutputTableColumn(meanText, RifEclipseOutputTableDoubleFormatting(RIF_FLOAT, 1), RIGHT), // Kf floatNumberColumn(meanText), // wf - RifEclipseOutputTableColumn(meanText, RifEclipseOutputTableDoubleFormatting(RIF_FLOAT, 1), RIGHT), //xf + RifEclipseOutputTableColumn(meanText, RifEclipseOutputTableDoubleFormatting(RIF_FLOAT, 1), RIGHT), // xf RifEclipseOutputTableColumn(meanText, RifEclipseOutputTableDoubleFormatting(RIF_FLOAT, 1), RIGHT), // H floatNumberColumn(meanText), // Km }; @@ -698,7 +717,8 @@ QString RicWellPathFractureTextReportFeatureImpl::createFractureCompletionSummar //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -QString RicWellPathFractureTextReportFeatureImpl::createFracturePressureDepletionSummaryText(const std::vector& wellPathFractureReportItems) const +QString RicWellPathFractureTextReportFeatureImpl::createFracturePressureDepletionSummaryText( + const std::vector& wellPathFractureReportItems) const { QString tableText; @@ -706,13 +726,11 @@ QString RicWellPathFractureTextReportFeatureImpl::createFracturePressureDepletio RifEclipseDataTableFormatter formatter(stream); configureFormatter(&formatter); - std::vector header = { - RifEclipseOutputTableColumn("Well"), - RifEclipseOutputTableColumn("Fracture"), - RifEclipseOutputTableColumn("Actual WBHP"), - RifEclipseOutputTableColumn("Min Pressure Drop"), - RifEclipseOutputTableColumn("Max Pressure Drop") - }; + std::vector header = {RifEclipseOutputTableColumn("Well"), + RifEclipseOutputTableColumn("Fracture"), + RifEclipseOutputTableColumn("Actual WBHP"), + RifEclipseOutputTableColumn("Min Pressure Drop"), + RifEclipseOutputTableColumn("Max Pressure Drop")}; bool createdTable = false; diff --git a/ApplicationCode/ModelVisualization/RivWellConnectionFactorPartMgr.cpp b/ApplicationCode/ModelVisualization/RivWellConnectionFactorPartMgr.cpp index 4de04da521..b7dc4a96cf 100644 --- a/ApplicationCode/ModelVisualization/RivWellConnectionFactorPartMgr.cpp +++ b/ApplicationCode/ModelVisualization/RivWellConnectionFactorPartMgr.cpp @@ -29,6 +29,7 @@ #include "RimEclipseCase.h" #include "RimEclipseView.h" +#include "RimFracture.h" #include "RimRegularLegendConfig.h" #include "RimSimWellInViewCollection.h" #include "RimVirtualPerforationResults.h" @@ -121,16 +122,30 @@ void RivWellConnectionFactorPartMgr::appendDynamicGeometryPartsToModel(cvf::Mode } } + bool showConnectionFactorOnWellPath = true; + { + for (const auto& completion : completionsForCell.second) + { + auto fracture = dynamic_cast(completion.sourcePdmObject()); + if (fracture) + { + showConnectionFactorOnWellPath = false; + } + } + } + size_t reservoirCellIndex = completionsForCell.first; const RigCell& rigCell = mainGrid->cell(reservoirCellIndex); cvf::Vec3d locationInDomainCoord = rigCell.center(); cvf::Vec3d direction = cvf::Vec3d::X_AXIS; - bool foundLocation = false; + if (showConnectionFactorOnWellPath) { - size_t i = 0; + size_t i = 0; + bool foundLocation = false; + while (!foundLocation && (i < wellPathCellIntersections.size())) { const WellPathCellIntersectionInfo& intersectionInfo = wellPathCellIntersections[i]; diff --git a/ApplicationCode/ResultStatisticsCache/RigStatisticsMath.cpp b/ApplicationCode/ResultStatisticsCache/RigStatisticsMath.cpp index 3ad923335c..08c16ad958 100644 --- a/ApplicationCode/ResultStatisticsCache/RigStatisticsMath.cpp +++ b/ApplicationCode/ResultStatisticsCache/RigStatisticsMath.cpp @@ -42,7 +42,7 @@ void RigStatisticsMath::calculateBasicStatistics(const std::vector& valu for (size_t i = 0; i < values.size(); i++) { double val = values[i]; - if (val == HUGE_VAL) continue; + if (RiaStatisticsTools::isInvalidNumber(val)) continue; validValueCount++; @@ -57,7 +57,6 @@ void RigStatisticsMath::calculateBasicStatistics(const std::vector& valu { m_mean = m_sum / validValueCount; - // http://en.wikipedia.org/wiki/Standard_deviation#Rapid_calculation_methods // Running standard deviation @@ -91,7 +90,7 @@ std::vector RigStatisticsMath::calculateNearestRankPercentiles(const std for (size_t i = 0; i < inputValues.size(); ++i) { - if (inputValues[i] != HUGE_VAL) + if (RiaStatisticsTools::isValidNumber(inputValues[i])) { sortedValues.push_back(inputValues[i]); } @@ -130,7 +129,7 @@ std::vector RigStatisticsMath::calculateInterpolatedPercentiles(const st for (size_t i = 0; i < inputValues.size(); ++i) { - if (inputValues[i] != HUGE_VAL) + if (RiaStatisticsTools::isValidNumber(inputValues[i])) { sortedValues.push_back(inputValues[i]); } @@ -195,10 +194,7 @@ RigHistogramCalculator::RigHistogramCalculator(double min, double max, size_t nB //-------------------------------------------------------------------------------------------------- void RigHistogramCalculator::addValue(double value) { - if (value == HUGE_VAL || value != value) - { - return; - } + if (RiaStatisticsTools::isInvalidNumber(value)) return; size_t index = 0; @@ -262,5 +258,6 @@ double RigHistogramCalculator::calculatePercentil(double pVal) } } assert(false); + return HUGE_VAL; } diff --git a/ApplicationCode/ResultStatisticsCache/RigStatisticsMath.h b/ApplicationCode/ResultStatisticsCache/RigStatisticsMath.h index e583533b9c..042c058c27 100644 --- a/ApplicationCode/ResultStatisticsCache/RigStatisticsMath.h +++ b/ApplicationCode/ResultStatisticsCache/RigStatisticsMath.h @@ -17,6 +17,8 @@ ///////////////////////////////////////////////////////////////////////////////// #pragma once +#include "RiaStatisticsTools.h" + #include #include #include @@ -82,19 +84,17 @@ public: void addValue(double value) { - if (value == HUGE_VAL) // TODO + if (RiaStatisticsTools::isValidNumber(value)) { - return; - } + if (value < min) + { + min = value; + } - if (value < min) - { - min = value; - } - - if (value > max) - { - max = value; + if (value > max) + { + max = value; + } } } @@ -126,19 +126,17 @@ public: void addValue(double value) { - if (value == HUGE_VAL) + if (RiaStatisticsTools::isValidNumber(value)) { - return; - } + if (value < pos && value > 0) + { + pos = value; + } - if (value < pos && value > 0) - { - pos = value; - } - - if (value > neg && value < 0) - { - neg = value; + if (value > neg && value < 0) + { + neg = value; + } } } @@ -170,13 +168,11 @@ public: void addValue(double value) { - if (value == HUGE_VAL || value != value) + if (RiaStatisticsTools::isValidNumber(value)) { - return; + valueSum += value; + ++sampleCount; } - - valueSum += value; - ++sampleCount; } double valueSum; @@ -208,7 +204,10 @@ public: void addValue(double value) { - uniqueValues.insert(static_cast(value)); + if (RiaStatisticsTools::isValidNumber(value)) + { + uniqueValues.insert(static_cast(value)); + } } std::set uniqueValues; diff --git a/ApplicationCode/UnitTests/RigStatisticsMath-Test.cpp b/ApplicationCode/UnitTests/RigStatisticsMath-Test.cpp index d441785fa8..bdca2ba252 100644 --- a/ApplicationCode/UnitTests/RigStatisticsMath-Test.cpp +++ b/ApplicationCode/UnitTests/RigStatisticsMath-Test.cpp @@ -44,7 +44,7 @@ TEST(RigStatisticsMath, BasicTest) values.push_back(80720.4378655615000); values.push_back(-98649.8109937874000); values.push_back(99372.9362079615000); - values.push_back(HUGE_VAL); + values.push_back(-HUGE_VAL); values.push_back(-57020.4389966513000); double min, max, sum, range, mean, stdev; @@ -65,7 +65,7 @@ TEST(RigStatisticsMath, BasicTest) TEST(RigStatisticsMath, RankPercentiles) { std::vector values; - values.push_back(HUGE_VAL); + values.push_back(-HUGE_VAL); values.push_back(2788.2723335651900); values.push_back(-22481.0927881701000); values.push_back(68778.6851686236000); @@ -113,8 +113,8 @@ TEST(RigStatisticsMath, HistogramPercentiles) values.push_back(6391.97999909729003); values.push_back(65930.1200169780000); values.push_back(-27696.2320267235000); - values.push_back(HUGE_VAL); - values.push_back(HUGE_VAL); + values.push_back(-HUGE_VAL); + values.push_back(-HUGE_VAL); values.push_back(96161.7546348456000); values.push_back(73875.6716288563000); values.push_back(80720.4378655615000); @@ -179,3 +179,52 @@ TEST(RigStatisticsMath, InterpolatedPercentiles) EXPECT_DOUBLE_EQ( 6391.9799990972897, pVals[2]); EXPECT_DOUBLE_EQ( 93073.49128098879, pVals[3]); } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +TEST(RigStatisticsMath, Accumulators) +{ + std::vector values; + + const double v1 = 2788.2723335651900; + const double v2 = 68778.6851686236000; + const double v3 = -98649.8109937874000; + const double v4 = -57020.4389966513000; + + values.push_back(HUGE_VAL); + values.push_back(v1); + values.push_back(v2); + values.push_back(-HUGE_VAL); + values.push_back(v3); + values.push_back(HUGE_VAL); + values.push_back(v4); + + { + MinMaxAccumulator acc; + acc.addData(values); + + EXPECT_DOUBLE_EQ(v3, acc.min); + EXPECT_DOUBLE_EQ(v2, acc.max); + } + + { + PosNegAccumulator acc; + acc.addData(values); + + EXPECT_DOUBLE_EQ(v1, acc.pos); + EXPECT_DOUBLE_EQ(v4, acc.neg); + } + + { + SumCountAccumulator acc; + acc.addData(values); + + const double sum = v1 + v2 + v3 + v4; + + EXPECT_FALSE(std::isinf(acc.valueSum)); + + EXPECT_DOUBLE_EQ(sum, acc.valueSum); + EXPECT_EQ(4u, acc.sampleCount); + } +} \ No newline at end of file diff --git a/Fwk/AppFwk/cafUserInterface/cafPdmUiTreeSelectionEditor.cpp b/Fwk/AppFwk/cafUserInterface/cafPdmUiTreeSelectionEditor.cpp index ebcffa0ac0..318af8448a 100644 --- a/Fwk/AppFwk/cafUserInterface/cafPdmUiTreeSelectionEditor.cpp +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiTreeSelectionEditor.cpp @@ -43,6 +43,7 @@ #include #include +#include #include #include #include @@ -89,6 +90,21 @@ public: m_heightHint = heightHint; } + //-------------------------------------------------------------------------------------------------- + /// + //-------------------------------------------------------------------------------------------------- + void keyPressEvent(QKeyEvent *event) + { + QTreeView::keyPressEvent(event); + + if (event->key() == Qt::Key_Down || event->key() == Qt::Key_Up || + event->key() == Qt::Key_Home || event->key() == Qt::Key_End || + event->key() == Qt::Key_PageDown || event->key() == Qt::Key_PageUp) + { + emit clicked(currentIndex()); + } + } + private: int m_heightHint; }; @@ -244,8 +260,8 @@ void PdmUiTreeSelectionEditor::configureAndUpdateUi(const QString& uiConfigName) m_treeView->setModel(m_proxyModel); - connect(m_treeView->selectionModel(), SIGNAL(currentChanged(QModelIndex, QModelIndex)), - this, SLOT(slotCurrentChanged(QModelIndex, QModelIndex))); + connect(m_treeView->selectionModel(), SIGNAL(currentChanged(QModelIndex, QModelIndex)), this, SLOT(slotCurrentChanged(QModelIndex, QModelIndex)), Qt::UniqueConnection); + } bool optionsOnly = true; @@ -291,7 +307,7 @@ void PdmUiTreeSelectionEditor::configureAndUpdateUi(const QString& uiConfigName) m_treeView->setSelectionMode(QAbstractItemView::ExtendedSelection); } - connect(m_treeView, SIGNAL(clicked(QModelIndex)), this, SLOT(slotClicked(QModelIndex))); + connect(m_treeView, SIGNAL(clicked(QModelIndex)), this, SLOT(slotClicked(QModelIndex)), Qt::UniqueConnection); if (!m_attributes.showTextFilter) { @@ -471,6 +487,14 @@ void PdmUiTreeSelectionEditor::customMenuRequested(const QPoint& pos) } } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void PdmUiTreeSelectionEditor::slotCurrentChanged(const QModelIndex& current, const QModelIndex& previous) +{ + currentChanged(current); +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -574,7 +598,27 @@ void PdmUiTreeSelectionEditor::slotTextFilterChanged() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void PdmUiTreeSelectionEditor::slotCurrentChanged(const QModelIndex& current, const QModelIndex& previous) +void PdmUiTreeSelectionEditor::slotClicked(const QModelIndex& index) +{ + if (m_attributes.setCurrentIndexWhenItemIsChecked && index.isValid()) + { + QModelIndexList selectedIndexes = m_treeView->selectionModel()->selectedIndexes(); + if (selectedIndexes.size() < 2) + { + QVariant v = m_proxyModel->data(index, Qt::CheckStateRole); + if (v == Qt::Checked) + { + m_treeView->setCurrentIndex(index); + } + } + } + currentChanged(index); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void PdmUiTreeSelectionEditor::currentChanged(const QModelIndex& current) { if (m_attributes.singleSelectionMode) { @@ -593,25 +637,6 @@ void PdmUiTreeSelectionEditor::slotCurrentChanged(const QModelIndex& current, co } } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void PdmUiTreeSelectionEditor::slotClicked(const QModelIndex& index) -{ - if (m_attributes.setCurrentIndexWhenItemIsChecked && index.isValid()) - { - QModelIndexList selectedIndexes = m_treeView->selectionModel()->selectedIndexes(); - if (selectedIndexes.size() < 2) - { - QVariant v = m_proxyModel->data(index, Qt::CheckStateRole); - if (v == Qt::Checked) - { - m_treeView->setCurrentIndex(index); - } - } - } -} - //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- diff --git a/Fwk/AppFwk/cafUserInterface/cafPdmUiTreeSelectionEditor.h b/Fwk/AppFwk/cafUserInterface/cafPdmUiTreeSelectionEditor.h index d6eb3c42eb..5cb9fa88c3 100644 --- a/Fwk/AppFwk/cafUserInterface/cafPdmUiTreeSelectionEditor.h +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiTreeSelectionEditor.h @@ -103,6 +103,7 @@ protected: private slots: void customMenuRequested(const QPoint& pos); + void slotCurrentChanged(const QModelIndex& current, const QModelIndex& previous); void slotSetSelectedOn(); void slotSetSelectedOff(); void slotSetSubItemsOn(); @@ -112,10 +113,11 @@ private slots: void slotTextFilterChanged(); - void slotCurrentChanged(const QModelIndex& current, const QModelIndex& previous); void slotClicked(const QModelIndex& index); private: + void currentChanged(const QModelIndex& current); + void setCheckedStateOfSelected(bool checked); void setCheckedStateForSubItemsOfSelected(bool checked); void checkAllItems(); diff --git a/Fwk/AppFwk/cafUserInterface/cafPdmUiTreeSelectionQModel.cpp b/Fwk/AppFwk/cafUserInterface/cafPdmUiTreeSelectionQModel.cpp index 6024804843..6dc9496bb0 100644 --- a/Fwk/AppFwk/cafUserInterface/cafPdmUiTreeSelectionQModel.cpp +++ b/Fwk/AppFwk/cafUserInterface/cafPdmUiTreeSelectionQModel.cpp @@ -46,6 +46,7 @@ #include +#include //-------------------------------------------------------------------------------------------------- /// @@ -485,7 +486,7 @@ bool caf::PdmUiTreeSelectionQModel::setData(const QModelIndex &index, const QVar } PdmUiCommandSystemProxy::instance()->setUiValueToField(m_uiFieldHandle->uiField(), fieldValueSelection); - + emit dataChanged(index, index); return true; } }