mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-24 07:16:53 -06:00
Added case name and summary header file
This commit is contained in:
parent
bbf1574feb
commit
0a08e0f545
@ -37,6 +37,15 @@ RimGridSummaryCase::RimGridSummaryCase()
|
||||
{
|
||||
CAF_PDM_InitFieldNoDefault(&m_eclipseCase, "Associated3DCase", "Main View", "", "", "");
|
||||
|
||||
CAF_PDM_InitField(&m_userName, "UserName", QString("User Name"), "Case Name", "", "", "");
|
||||
m_userName.xmlCapability()->setIOReadable(false);
|
||||
m_userName.xmlCapability()->setIOWritable(false);
|
||||
m_userName.uiCapability()->setUiReadOnly(true);
|
||||
|
||||
CAF_PDM_InitField(&m_summaryHeaderFilename, "SummaryHeaderFile", QString("Summary Header File"), "Summary File", "", "", "");
|
||||
m_summaryHeaderFilename.xmlCapability()->setIOReadable(false);
|
||||
m_summaryHeaderFilename.xmlCapability()->setIOWritable(false);
|
||||
m_summaryHeaderFilename.uiCapability()->setUiReadOnly(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -53,6 +62,8 @@ RimGridSummaryCase::~RimGridSummaryCase()
|
||||
void RimGridSummaryCase::setAssociatedEclipseCase(RimEclipseCase* eclipseCase)
|
||||
{
|
||||
m_eclipseCase = eclipseCase;
|
||||
|
||||
updateUiNames();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -69,3 +80,33 @@ QString RimGridSummaryCase::summaryHeaderFilename() const
|
||||
return possibleSumHeaderFileName;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGridSummaryCase::initAfterRead()
|
||||
{
|
||||
updateUiNames();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGridSummaryCase::updateUiNames()
|
||||
{
|
||||
m_summaryHeaderFilename = summaryHeaderFilename();
|
||||
|
||||
m_userName = baseName();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimGridSummaryCase::baseName() const
|
||||
{
|
||||
if (!m_eclipseCase()) return QString();
|
||||
|
||||
QFileInfo gridFileInfo(m_eclipseCase()->gridFileName());
|
||||
|
||||
return gridFileInfo.completeBaseName();
|
||||
}
|
||||
|
||||
|
@ -32,13 +32,24 @@ public:
|
||||
RimGridSummaryCase();
|
||||
virtual ~RimGridSummaryCase();
|
||||
|
||||
void setAssociatedEclipseCase(RimEclipseCase* eclipseCase);
|
||||
RimEclipseCase* associatedEclipseCase() { return m_eclipseCase(); }
|
||||
void setAssociatedEclipseCase(RimEclipseCase* eclipseCase);
|
||||
RimEclipseCase* associatedEclipseCase() { return m_eclipseCase(); }
|
||||
|
||||
virtual QString summaryHeaderFilename() const override;
|
||||
|
||||
virtual caf::PdmFieldHandle* userDescriptionField() { return &m_userName; }
|
||||
virtual void initAfterRead();
|
||||
|
||||
private:
|
||||
void updateUiNames();
|
||||
QString baseName() const;
|
||||
|
||||
virtual QString summaryHeaderFilename() const override;
|
||||
|
||||
private:
|
||||
caf::PdmPtrField<RimEclipseCase*> m_eclipseCase;
|
||||
|
||||
caf::PdmField<QString> m_userName;
|
||||
caf::PdmField<QString> m_summaryHeaderFilename;
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user