mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-07 14:43:10 -06:00
#3428 Text string creation based on date and time : Use toStringUsingApplicationLocale() at relevant places
This commit is contained in:
parent
a083e70ea1
commit
2b1c6e9706
@ -19,6 +19,7 @@
|
||||
#include "RimWellPlotTools.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaQDateTimeTools.h"
|
||||
#include "RiaWellNameComparer.h"
|
||||
|
||||
#include "RifReaderEclipseRft.h"
|
||||
@ -31,6 +32,7 @@
|
||||
#include "RimEclipseResultCase.h"
|
||||
#include "RimOilField.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimTools.h"
|
||||
#include "RimWellLogExtractionCurve.h"
|
||||
#include "RimWellLogFile.h"
|
||||
#include "RimWellLogFileChannel.h"
|
||||
@ -39,7 +41,6 @@
|
||||
#include "RimWellPath.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
|
||||
#include "RimTools.h"
|
||||
#include <regex>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -986,7 +987,8 @@ void RimWellPlotTools::calculateValueOptionsForTimeSteps(
|
||||
|
||||
for (const std::pair<QDateTime, std::set<RifDataSourceForRftPlt>>& timeStepPair : timestepsToShowWithSources)
|
||||
{
|
||||
QString optionText = timeStepPair.first.toString(dateFormatString);
|
||||
QString optionText = RiaQDateTimeTools::toStringUsingApplicationLocale(timeStepPair.first, dateFormatString);
|
||||
|
||||
bool hasObs = false;
|
||||
bool hasRft = false;
|
||||
bool hasGrid = false;
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaColorTables.h"
|
||||
#include "RiaDateStringParser.h"
|
||||
#include "RiaQDateTimeTools.h"
|
||||
#include "RiaWellNameComparer.h"
|
||||
|
||||
#include "RifReaderEclipseRft.h"
|
||||
@ -528,7 +529,8 @@ void RimWellPltPlot::syncCurvesFromUiSelection()
|
||||
curveName += sourceDef.eclCase() ? sourceDef.eclCase()->caseUserDescription() : "";
|
||||
curveName += sourceDef.wellLogFile() ? sourceDef.wellLogFile()->name() : "";
|
||||
if ( sourceDef.sourceType() == RifDataSourceForRftPlt::RFT ) curveName += ", RFT";
|
||||
curveName += ", " + timeStep.toString(dateFormatString);
|
||||
|
||||
curveName += ", " + RiaQDateTimeTools::toStringUsingApplicationLocale(timeStep, dateFormatString);
|
||||
}
|
||||
|
||||
RimEclipseResultCase* rimEclipseResultCase = dynamic_cast<RimEclipseResultCase*>(sourceDef.eclCase());
|
||||
|
@ -20,6 +20,8 @@
|
||||
|
||||
#include "Rim3dOverlayInfoConfig.h"
|
||||
|
||||
#include "RiaQDateTimeTools.h"
|
||||
|
||||
#include "RicGridStatisticsDialog.h"
|
||||
|
||||
#include "RigCaseCellResultsData.h"
|
||||
@ -899,9 +901,12 @@ QString Rim3dOverlayInfoConfig::timeStepText(RimEclipseView* eclipseView)
|
||||
if (currTimeStepIndex >= 0 && currTimeStepIndex < (int)timeSteps.size())
|
||||
{
|
||||
QString dateFormat = RimTools::createTimeFormatStringFromDates(timeSteps);
|
||||
|
||||
QString dateString = RiaQDateTimeTools::toStringUsingApplicationLocale(timeSteps[currTimeStepIndex], dateFormat);
|
||||
|
||||
dateTimeString = QString("Time Step: %1/%2 %3").arg(QString::number(currTimeStepIndex),
|
||||
QString::number(timeSteps.size() - 1),
|
||||
timeSteps[currTimeStepIndex].toString(dateFormat));
|
||||
dateString);
|
||||
}
|
||||
|
||||
return QString("<p><b><center>-- %1 --</center></b>").arg(dateTimeString) +
|
||||
|
@ -18,7 +18,10 @@
|
||||
|
||||
#include "Rim3dWellLogRftCurve.h"
|
||||
|
||||
#include "RiaQDateTimeTools.h"
|
||||
|
||||
#include "RifReaderEclipseRft.h"
|
||||
|
||||
#include "RigWellLogCurveData.h"
|
||||
|
||||
#include "RimWellLogRftCurveNameConfig.h"
|
||||
@ -191,7 +194,9 @@ QList<caf::PdmOptionItemInfo> Rim3dWellLogRftCurve::calculateValueOptions(const
|
||||
std::vector<QDateTime> timeStamps = reader->availableTimeSteps(wellName(), m_wellLogChannelName());
|
||||
for (const QDateTime& dt : timeStamps)
|
||||
{
|
||||
options.push_back(caf::PdmOptionItemInfo(dt.toString(dateFormat), dt));
|
||||
QString dateString = RiaQDateTimeTools::toStringUsingApplicationLocale(dt, dateFormat);
|
||||
|
||||
options.push_back(caf::PdmOptionItemInfo(dateString, dt));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -851,8 +851,10 @@ QString RimEclipseCase::timeStepName(int frameIdx) const
|
||||
if (frameIdx < static_cast<int>(timeStepDates.size()))
|
||||
{
|
||||
QDateTime date = timeStepDates.at(frameIdx);
|
||||
return date.toString(m_timeStepFormatString);
|
||||
|
||||
return RiaQDateTimeTools::toStringUsingApplicationLocale(date, m_timeStepFormatString);
|
||||
}
|
||||
|
||||
return QString("");
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,10 @@
|
||||
|
||||
#include "RimTimeStepFilter.h"
|
||||
|
||||
#include "RiaQDateTimeTools.h"
|
||||
|
||||
#include "RifReaderEclipseOutput.h"
|
||||
|
||||
#include "RigCaseCellResultsData.h"
|
||||
|
||||
#include "RimEclipseResultCase.h"
|
||||
@ -91,10 +94,13 @@ RimTimeStepFilter::RimTimeStepFilter()
|
||||
void RimTimeStepFilter::setTimeStepsFromFile(const std::vector<QDateTime>& timeSteps)
|
||||
{
|
||||
m_dateFormat = RimTools::createTimeFormatStringFromDates(timeSteps);
|
||||
|
||||
std::vector<QString> timeStepStrings;
|
||||
for (const QDateTime& date : timeSteps)
|
||||
{
|
||||
timeStepStrings.push_back(date.toString(m_dateFormat));
|
||||
QString dateString = RiaQDateTimeTools::toStringUsingApplicationLocale(date, m_dateFormat);
|
||||
|
||||
timeStepStrings.push_back(dateString);
|
||||
}
|
||||
|
||||
m_timeStepNamesFromFile = timeStepStrings;
|
||||
@ -128,7 +134,7 @@ void RimTimeStepFilter::setTimeStepsFromFile(const std::vector<std::pair<QString
|
||||
QString stepString = stringDatePair.first;
|
||||
if (stringDatePair.second.isValid())
|
||||
{
|
||||
stepString = stringDatePair.second.toString(m_dateFormat);
|
||||
stepString = RiaQDateTimeTools::toStringUsingApplicationLocale(stringDatePair.second, m_dateFormat);
|
||||
}
|
||||
timeStepStrings.push_back(stepString);
|
||||
}
|
||||
|
@ -21,6 +21,7 @@
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaEclipseUnitTools.h"
|
||||
#include "RiaQDateTimeTools.h"
|
||||
#include "RiaSimWellBranchTools.h"
|
||||
|
||||
#include "RifEclipseRftAddress.h"
|
||||
@ -430,7 +431,9 @@ QList<caf::PdmOptionItemInfo> RimWellLogRftCurve::calculateValueOptions(const ca
|
||||
std::vector<QDateTime> timeStamps = reader->availableTimeSteps(m_wellName, m_wellLogChannelName());
|
||||
for (const QDateTime& dt : timeStamps)
|
||||
{
|
||||
options.push_back(caf::PdmOptionItemInfo(dt.toString(dateFormat), dt));
|
||||
QString dateString = RiaQDateTimeTools::toStringUsingApplicationLocale(dt, dateFormat);
|
||||
|
||||
options.push_back(caf::PdmOptionItemInfo(dateString, dt));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,8 @@
|
||||
|
||||
#include "RiuQwtCurvePointTracker.h"
|
||||
|
||||
#include "RiaQDateTimeTools.h"
|
||||
|
||||
#include "qwt_plot_marker.h"
|
||||
#include "qwt_symbol.h"
|
||||
|
||||
@ -176,7 +178,9 @@ QPointF RiuQwtCurvePointTracker::closestCurvePoint(const QPoint& cursorPosition,
|
||||
if ( dateScaleDraw )
|
||||
{
|
||||
QDateTime date = dateScaleDraw->toDateTime(mainAxisSampleVal);
|
||||
*mainAxisValueString = date.toString("hh:mm dd.MMMM.yyyy");
|
||||
|
||||
QString dateString = RiaQDateTimeTools::toStringUsingApplicationLocale(date, "hh:mm dd.MMMM.yyyy");
|
||||
*mainAxisValueString = dateString;
|
||||
}
|
||||
else if ( mainAxisScaleDraw )
|
||||
{
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include "RiuResultQwtPlot.h"
|
||||
|
||||
#include "RiaCurveDataTools.h"
|
||||
#include "RiaQDateTimeTools.h"
|
||||
|
||||
#include "RimContextCommandBuilder.h"
|
||||
#include "RimCase.h"
|
||||
@ -214,7 +215,10 @@ QString RiuResultQwtPlot::asciiDataForUiSelectedCurves() const
|
||||
}
|
||||
}
|
||||
out += "\n";
|
||||
out += m_timeSteps.at(caseId)[i].toString("yyyy-MM-dd hh:mm:ss ");
|
||||
|
||||
QString dateString = RiaQDateTimeTools::toStringUsingApplicationLocale(m_timeSteps.at(caseId)[i], "yyyy-MM-dd hh:mm:ss ");
|
||||
|
||||
out += dateString;
|
||||
|
||||
for (size_t j = 0; j < m_curveData.at(caseId).size(); j++) // curves
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user