mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2021 LAS file. Drop down for selecting well flow condition. Display date as well
This commit is contained in:
parent
e7c0d6d59a
commit
23536c1dec
@ -21,6 +21,9 @@
|
||||
#include "RimWellLogFileChannel.h"
|
||||
#include "RimWellPath.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
#include "RimTools.h"
|
||||
#include "RimWellPltPlot.h"
|
||||
#include "RiaDateStringParser.h"
|
||||
|
||||
#include "RigWellLogFile.h"
|
||||
|
||||
@ -29,10 +32,21 @@
|
||||
#include <QStringList>
|
||||
#include <QFileInfo>
|
||||
#include <QMessageBox>
|
||||
#include "cafPdmUiLineEditor.h"
|
||||
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimWellLogFile, "WellLogFile");
|
||||
|
||||
namespace caf
|
||||
{
|
||||
template<>
|
||||
void caf::AppEnum< RimWellLogFile::WellFlowCondition>::setUp()
|
||||
{
|
||||
addItem(RimWellLogFile::WELL_FLOW_COND_RESERVOIR, "RESERVOIR", "Reservoir");
|
||||
addItem(RimWellLogFile::WELL_FLOW_COND_STANDARD, "STANDARD", "Standard");
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -45,9 +59,9 @@ RimWellLogFile::RimWellLogFile()
|
||||
m_wellName.uiCapability()->setUiHidden(true);
|
||||
m_wellName.xmlCapability()->setIOWritable(false);
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_date, "Date", "", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&m_date, "Date", "Date", "", "", "");
|
||||
m_date.uiCapability()->setUiReadOnly(true);
|
||||
m_date.uiCapability()->setUiHidden(true);
|
||||
//m_date.uiCapability()->setUiEditorTypeName(caf::PdmUiLineEditor::uiEditorTypeName());
|
||||
m_date.xmlCapability()->setIOWritable(false);
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_fileName, "FileName", "Filename", "", "", "");
|
||||
@ -62,6 +76,8 @@ RimWellLogFile::RimWellLogFile()
|
||||
m_wellLogChannelNames.uiCapability()->setUiHidden(true);
|
||||
m_wellLogChannelNames.xmlCapability()->setIOWritable(false);
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_wellFlowCondition, "WellFlowCondition", "", "", "", "");
|
||||
|
||||
m_wellLogDataFile = NULL;
|
||||
}
|
||||
|
||||
@ -189,3 +205,49 @@ std::vector<RimWellLogFileChannel*> RimWellLogFile::wellLogChannels() const
|
||||
}
|
||||
return channels;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogFile::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
||||
{
|
||||
uiOrdering.add(&m_fileName);
|
||||
uiOrdering.add(&m_date);
|
||||
|
||||
if (RimWellPltPlot::hasFlowData(this))
|
||||
{
|
||||
uiOrdering.add(&m_wellFlowCondition);
|
||||
}
|
||||
|
||||
uiOrdering.skipRemainingFields(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QList<caf::PdmOptionItemInfo> RimWellLogFile::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly)
|
||||
{
|
||||
QList<caf::PdmOptionItemInfo> options;
|
||||
|
||||
if (fieldNeedingOptions == &m_date)
|
||||
{
|
||||
QString dateString = formatDate(date());
|
||||
options.push_back(caf::PdmOptionItemInfo(!dateString.isEmpty() ? dateString : "Invalid or no date", date()));
|
||||
}
|
||||
return options;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimWellLogFile::formatDate(const QString dateString)
|
||||
{
|
||||
QDateTime timeStep = RiaDateStringParser::parseDateString(dateString);
|
||||
if (timeStep.isValid())
|
||||
{
|
||||
const QString dateFormatString = RimTools::createTimeFormatStringFromDates({ timeStep });
|
||||
auto ddd = timeStep.toString(dateFormatString);
|
||||
return timeStep.toString(dateFormatString);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
@ -39,6 +39,12 @@ class RimWellLogFile : public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
enum WellFlowCondition
|
||||
{
|
||||
WELL_FLOW_COND_RESERVOIR,
|
||||
WELL_FLOW_COND_STANDARD
|
||||
};
|
||||
|
||||
public:
|
||||
RimWellLogFile();
|
||||
virtual ~RimWellLogFile();
|
||||
@ -57,8 +63,13 @@ public:
|
||||
std::vector<RimWellLogFileChannel*> wellLogChannels() const;
|
||||
|
||||
private:
|
||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override;
|
||||
|
||||
virtual caf::PdmFieldHandle* userDescriptionField() { return &m_name; }
|
||||
|
||||
static QString formatDate(const QString dateString);
|
||||
|
||||
caf::PdmChildArrayField<RimWellLogFileChannel*> m_wellLogChannelNames;
|
||||
|
||||
private:
|
||||
@ -67,4 +78,5 @@ private:
|
||||
caf::PdmField<QString> m_fileName;
|
||||
caf::PdmField<QString> m_name;
|
||||
caf::PdmField<QString> m_date;
|
||||
caf::PdmField<caf::AppEnum<WellFlowCondition>> m_wellFlowCondition;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user