//-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- void RimWellLogFile::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) { if (changedField == &m_date) { // Due to a possible bug in QDateEdit/PdmUiDateEditor, convert m_date to a QDateTime having UTC timespec m_date = RiaQDateTimeTools::createUtcDateTime(m_date().date(), m_date().time()); } }
//-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- bool RimWellLogFile::readFile(QString* errorMessage) { if (!m_wellLogDataFile.p()) { m_wellLogDataFile = new RigWellLogFile; } m_name = QFileInfo(m_fileName).fileName(); if (!m_wellLogDataFile->open(m_fileName, errorMessage)) { m_wellLogDataFile = nullptr; return false; } m_wellName = m_wellLogDataFile->wellName(); QDateTime date = RiaDateStringParser::parseDateString(m_wellLogDataFile->date()); m_lasFileHasValidDate = isDateValid(date); if (m_lasFileHasValidDate) { m_date = date; } else if(!isDateValid(m_date())) { QMessageBox msgBox; QString message = QString("The LAS-file '%1' contains no recognizable date. Please assign a date in the LAS-file property panel") .arg(m_name()); msgBox.setText(message); msgBox.setStandardButtons(QMessageBox::Ok); msgBox.exec(); m_date = DEFAULT_DATE_TIME; } m_wellLogChannelNames.deleteAllChildObjects(); QStringList wellLogNames = m_wellLogDataFile->wellLogChannelNames(); for (int logIdx = 0; logIdx < wellLogNames.size(); logIdx++) { RimWellLogFileChannel* wellLog = new RimWellLogFileChannel(); wellLog->setName(wellLogNames[logIdx]); m_wellLogChannelNames.push_back(wellLog); } RimWellPath* wellPath; firstAncestorOrThisOfType(wellPath); if (wellPath) { if (wellPath->filepath().isEmpty()) { wellPath->setName(m_wellName); } } return true; }
//-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- bool RimPerforationInterval::isActiveOnDate(const QDateTime& date) const { if (m_startOfHistory()) { return true; } if (!date.isValid()) return false; return m_date() < date; }
//-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- void RimWellLogFile::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) { uiOrdering.add(&m_fileName); uiOrdering.add(&m_date); m_date.uiCapability()->setUiReadOnly(m_lasFileHasValidDate); auto timespec = m_date().timeSpec(); if (!isDateValid(m_date())) { uiOrdering.add(&m_invalidDateMessage); } if (hasFlowData()) { uiOrdering.add(&m_wellFlowCondition); } uiOrdering.skipRemainingFields(true); }