Observed Data : Select in tree view and expand imported object

This commit is contained in:
Magne Sjaastad 2017-10-04 07:36:30 +02:00
parent 657f271cd1
commit 132c109ff2
4 changed files with 55 additions and 3 deletions

View File

@ -152,4 +152,4 @@ private:
bool operator==(const RifEclipseSummaryAddress& first, const RifEclipseSummaryAddress& second);
bool operator<(const RifEclipseSummaryAddress& first, const RifEclipseSummaryAddress& second);
bool operator<(const RifEclipseSummaryAddress& first, const RifEclipseSummaryAddress& second);

View File

@ -39,7 +39,7 @@ RimObservedData::RimObservedData()
m_importedSummaryData.uiCapability()->setUiReadOnly(true);
m_importedSummaryData.xmlCapability()->disableIO();
CAF_PDM_InitFieldNoDefault(&m_useCustomIdentifier, "UseCustomIdentifier", "Use Custom Identifier", "", "", "");
CAF_PDM_InitField(&m_useCustomIdentifier, "UseCustomIdentifier", false, "Use Custom Identifier", "", "", "");
CAF_PDM_InitField(&m_summaryCategory, "SummaryType", caf::AppEnum<RifEclipseSummaryAddress::SummaryVarCategory>(RifEclipseSummaryAddress::SUMMARY_WELL), "Summary Type", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_identifierName, "IdentifierName", "Identifier Name", "", "", "");
}

View File

@ -19,14 +19,17 @@
#include "RimObservedDataCollection.h"
#include "RiaApplication.h"
#include "RiaLogging.h"
#include "RifKeywordVectorParser.h"
#include "RimObservedEclipseUserData.h"
#include "RimObservedData.h"
#include "RimObservedEclipseUserData.h"
#include "RimSummaryObservedDataFile.h"
#include "RiuMainPlotWindow.h"
#include "cafUtils.h"
#include <QFile>
@ -115,6 +118,13 @@ RimObservedData* RimObservedDataCollection::createAndAddObservedDataFromFileName
observedData->updateMetaData();
observedData->updateOptionSensitivity();
RiuMainPlotWindow* mainPlotWindow = RiaApplication::instance()->getOrCreateAndShowMainPlotWindow();
if (mainPlotWindow)
{
mainPlotWindow->selectAsCurrentItem(observedData);
mainPlotWindow->setExpanded(observedData, true);
}
this->updateConnectedEditors();
}
}

View File

@ -382,6 +382,48 @@ TEST(RifColumnBasedRsmspecParserTest, TestTableValues)
EXPECT_NE("P-9P", tables.at(1).at(0).summaryAddress.wellName());
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
TEST(RifColumnBasedRsmspecParserTest, TestTableMissingWellNames)
{
QString data;
QTextStream out(&data);
out << "1\n";
out << "---------------------------------------\n";
out << "SUMMARY OF RUN SIP USER FILE DATA VECTORS\n";
out << "---------------------------------------\n";
out << "TIME WLVP WPLT WTEST WFOFF WBUP\n";
out << "DAYS BARSA BARSA BARSA BARSA BARSA\n";
out << "\n";
out << " 1 0.0 0.0 0.0 0.0 0.0\n";
out << " 2 0.0 0.0 0.0 0.0 0.0\n";
out << " 3 0.0 0.0 0.0 0.0 0.0\n";
out << " 4 0.0 0.0 0.0 0.0 0.0\n";
out << " 5 0.0 0.0 0.0 0.0 0.0\n";
out << " 6 0.0 0.0 0.0 0.0 0.0\n";
out << " 7 0.0 0.0 282 0.0 0.0\n";
out << " 8 0.0 0.0 279 0.0 0.0\n";
out << " 9 0.0 0.0 0.0 0.0 0.0\n";
out << " 10 0.0 0.0 0.0 0.0 0.0\n";
out << " 11 0.0 0.0 0.0 0.0 0.0\n";
out << " 12 0.0 0.0 0.0 0.0 0.0\n";
out << " 13 0.0 0.0 0.0 0.0 0.0\n";
out << " 14 0.0 0.0 0.0 0.0 0.0\n";
out << " 15 0.0 0.0 0.0 0.0 0.0\n";
out << " 16 0.0 0.0 0.0 0.0 0.0\n";
out << " 17 0.0 0.0 0.0 0.0 0.0\n";
out << " 18 0.0 0.0 0.0 0.0 0.0\n";
RifColumnBasedUserDataParser parser = RifColumnBasedUserDataParser(data);
std::vector< std::vector<ColumnInfo> > tables = parser.tables();
ASSERT_EQ(tables.size(), 1);
ASSERT_EQ(tables.at(0).size(), 6);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------