mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Merged branch dev into pre-proto
This commit is contained in:
commit
a10b96ba3e
@ -30,7 +30,7 @@
|
|||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
RifReaderEclipseSummary::RifReaderEclipseSummary()
|
RifReaderEclipseSummary::RifReaderEclipseSummary()
|
||||||
: ecl_sum(NULL)
|
: m_ecl_sum(NULL)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -48,7 +48,7 @@ RifReaderEclipseSummary::~RifReaderEclipseSummary()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RifReaderEclipseSummary::open(const std::string& headerFileName, const std::vector<std::string>& dataFileNames)
|
bool RifReaderEclipseSummary::open(const std::string& headerFileName, const std::vector<std::string>& dataFileNames)
|
||||||
{
|
{
|
||||||
assert(ecl_sum == NULL);
|
assert(m_ecl_sum == NULL);
|
||||||
|
|
||||||
if (headerFileName.empty() || dataFileNames.size() == 0) return false;
|
if (headerFileName.empty() || dataFileNames.size() == 0) return false;
|
||||||
|
|
||||||
@ -62,20 +62,17 @@ bool RifReaderEclipseSummary::open(const std::string& headerFileName, const std:
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string itemSeparatorInVariableNames = ":";
|
std::string itemSeparatorInVariableNames = ":";
|
||||||
ecl_sum = ecl_sum_fread_alloc(headerFileName.data(), dataFiles, itemSeparatorInVariableNames.data());
|
m_ecl_sum = ecl_sum_fread_alloc(headerFileName.data(), dataFiles, itemSeparatorInVariableNames.data());
|
||||||
|
|
||||||
stringlist_free(dataFiles);
|
stringlist_free(dataFiles);
|
||||||
|
|
||||||
if (ecl_sum)
|
if (m_ecl_sum)
|
||||||
{
|
{
|
||||||
eclSmSpec = ecl_sum_get_smspec(ecl_sum);
|
m_ecl_SmSpec = ecl_sum_get_smspec(m_ecl_sum);
|
||||||
assert(eclSmSpec != NULL);
|
|
||||||
|
|
||||||
assert(ecl_sum != NULL);
|
|
||||||
|
|
||||||
for ( int time_index = 0; time_index < timeStepCount(); time_index++ )
|
for ( int time_index = 0; time_index < timeStepCount(); time_index++ )
|
||||||
{
|
{
|
||||||
time_t sim_time = ecl_sum_iget_sim_time(ecl_sum, time_index);
|
time_t sim_time = ecl_sum_iget_sim_time(m_ecl_sum, time_index);
|
||||||
m_timeSteps.push_back(sim_time);
|
m_timeSteps.push_back(sim_time);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,10 +87,10 @@ bool RifReaderEclipseSummary::open(const std::string& headerFileName, const std:
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RifReaderEclipseSummary::close()
|
void RifReaderEclipseSummary::close()
|
||||||
{
|
{
|
||||||
if (ecl_sum)
|
if (m_ecl_sum)
|
||||||
{
|
{
|
||||||
ecl_sum_free(ecl_sum);
|
ecl_sum_free(m_ecl_sum);
|
||||||
ecl_sum = NULL;
|
m_ecl_sum = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -248,7 +245,7 @@ const std::vector<RifEclipseSummaryAddress>& RifReaderEclipseSummary::allResultA
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RifReaderEclipseSummary::values(const RifEclipseSummaryAddress& resultAddress, std::vector<double>* values)
|
bool RifReaderEclipseSummary::values(const RifEclipseSummaryAddress& resultAddress, std::vector<double>* values)
|
||||||
{
|
{
|
||||||
assert(ecl_sum != NULL);
|
assert(m_ecl_sum != NULL);
|
||||||
|
|
||||||
int variableIndex = indexFromAddress(resultAddress);
|
int variableIndex = indexFromAddress(resultAddress);
|
||||||
|
|
||||||
@ -258,14 +255,16 @@ bool RifReaderEclipseSummary::values(const RifEclipseSummaryAddress& resultAddre
|
|||||||
int tsCount = timeStepCount();
|
int tsCount = timeStepCount();
|
||||||
values->reserve(timeStepCount());
|
values->reserve(timeStepCount());
|
||||||
|
|
||||||
|
if (m_ecl_SmSpec)
|
||||||
const smspec_node_type * ertSumVarNode = ecl_smspec_iget_node(eclSmSpec, variableIndex);
|
|
||||||
int paramsIndex = smspec_node_get_params_index(ertSumVarNode);
|
|
||||||
|
|
||||||
for(int time_index = 0; time_index < tsCount; time_index++)
|
|
||||||
{
|
{
|
||||||
double value = ecl_sum_iget(ecl_sum, time_index, paramsIndex);
|
const smspec_node_type* ertSumVarNode = ecl_smspec_iget_node(m_ecl_SmSpec, variableIndex);
|
||||||
values->push_back(value);
|
int paramsIndex = smspec_node_get_params_index(ertSumVarNode);
|
||||||
|
|
||||||
|
for(int time_index = 0; time_index < tsCount; time_index++)
|
||||||
|
{
|
||||||
|
double value = ecl_sum_iget(m_ecl_sum, time_index, paramsIndex);
|
||||||
|
values->push_back(value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -276,9 +275,11 @@ bool RifReaderEclipseSummary::values(const RifEclipseSummaryAddress& resultAddre
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
int RifReaderEclipseSummary::timeStepCount() const
|
int RifReaderEclipseSummary::timeStepCount() const
|
||||||
{
|
{
|
||||||
assert(ecl_sum != NULL);
|
assert(m_ecl_sum != nullptr);
|
||||||
|
|
||||||
return ecl_sum_get_data_length(ecl_sum);
|
if (m_ecl_SmSpec == nullptr) return 0;
|
||||||
|
|
||||||
|
return ecl_sum_get_data_length(m_ecl_sum);
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -286,7 +287,7 @@ int RifReaderEclipseSummary::timeStepCount() const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
const std::vector<time_t>& RifReaderEclipseSummary::timeSteps() const
|
const std::vector<time_t>& RifReaderEclipseSummary::timeSteps() const
|
||||||
{
|
{
|
||||||
assert(ecl_sum != NULL);
|
assert(m_ecl_sum != NULL);
|
||||||
|
|
||||||
return m_timeSteps;
|
return m_timeSteps;
|
||||||
}
|
}
|
||||||
@ -328,12 +329,12 @@ int RifReaderEclipseSummary::indexFromAddress(const RifEclipseSummaryAddress& re
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RifReaderEclipseSummary::buildMetaData()
|
void RifReaderEclipseSummary::buildMetaData()
|
||||||
{
|
{
|
||||||
if(m_allResultAddresses.size() == 0)
|
if(m_allResultAddresses.size() == 0 && m_ecl_SmSpec)
|
||||||
{
|
{
|
||||||
int varCount = ecl_smspec_num_nodes(eclSmSpec);
|
int varCount = ecl_smspec_num_nodes(m_ecl_SmSpec);
|
||||||
for(int i = 0; i < varCount; i++)
|
for(int i = 0; i < varCount; i++)
|
||||||
{
|
{
|
||||||
const smspec_node_type * ertSumVarNode = ecl_smspec_iget_node(eclSmSpec, i);
|
const smspec_node_type * ertSumVarNode = ecl_smspec_iget_node(m_ecl_SmSpec, i);
|
||||||
RifEclipseSummaryAddress addr = addressFromErtSmSpecNode(ertSumVarNode);
|
RifEclipseSummaryAddress addr = addressFromErtSmSpecNode(ertSumVarNode);
|
||||||
m_allResultAddresses.push_back(addr);
|
m_allResultAddresses.push_back(addr);
|
||||||
m_resultAddressToErtNodeIdx[addr] = i;
|
m_resultAddressToErtNodeIdx[addr] = i;
|
||||||
@ -358,11 +359,13 @@ bool RifReaderEclipseSummary::hasAddress(const RifEclipseSummaryAddress& resultA
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
std::string RifReaderEclipseSummary::unitName(const RifEclipseSummaryAddress& resultAddress)
|
std::string RifReaderEclipseSummary::unitName(const RifEclipseSummaryAddress& resultAddress)
|
||||||
{
|
{
|
||||||
|
if (!m_ecl_SmSpec) return "";
|
||||||
|
|
||||||
int variableIndex = indexFromAddress(resultAddress);
|
int variableIndex = indexFromAddress(resultAddress);
|
||||||
|
|
||||||
if(variableIndex < 0) return "";
|
if(variableIndex < 0) return "";
|
||||||
|
|
||||||
const smspec_node_type * ertSumVarNode = ecl_smspec_iget_node(eclSmSpec, variableIndex);
|
const smspec_node_type * ertSumVarNode = ecl_smspec_iget_node(m_ecl_SmSpec, variableIndex);
|
||||||
return smspec_node_get_unit(ertSumVarNode);
|
return smspec_node_get_unit(ertSumVarNode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,8 +64,8 @@ private:
|
|||||||
typedef struct ecl_sum_struct ecl_sum_type;
|
typedef struct ecl_sum_struct ecl_sum_type;
|
||||||
typedef struct ecl_smspec_struct ecl_smspec_type;
|
typedef struct ecl_smspec_struct ecl_smspec_type;
|
||||||
|
|
||||||
ecl_sum_type* ecl_sum;
|
ecl_sum_type* m_ecl_sum;
|
||||||
const ecl_smspec_type * eclSmSpec;
|
const ecl_smspec_type * m_ecl_SmSpec;
|
||||||
std::vector<time_t> m_timeSteps;
|
std::vector<time_t> m_timeSteps;
|
||||||
|
|
||||||
std::vector<RifEclipseSummaryAddress> m_allResultAddresses;
|
std::vector<RifEclipseSummaryAddress> m_allResultAddresses;
|
||||||
|
@ -119,7 +119,18 @@ void RimWellFlowRateCurve::updateCurveAppearance()
|
|||||||
m_qwtPlotCurve->setStyle(QwtPlotCurve::Steps);
|
m_qwtPlotCurve->setStyle(QwtPlotCurve::Steps);
|
||||||
QColor curveQColor = QColor (m_curveColor.value().rByte(), m_curveColor.value().gByte(), m_curveColor.value().bByte());
|
QColor curveQColor = QColor (m_curveColor.value().rByte(), m_curveColor.value().gByte(), m_curveColor.value().bByte());
|
||||||
m_qwtPlotCurve->setBrush(QBrush( curveQColor));
|
m_qwtPlotCurve->setBrush(QBrush( curveQColor));
|
||||||
|
|
||||||
|
QLinearGradient gradient;
|
||||||
|
gradient.setCoordinateMode(QGradient::StretchToDeviceMode);
|
||||||
|
gradient.setColorAt(0,curveQColor.darker(110));
|
||||||
|
gradient.setColorAt(0.15,curveQColor);
|
||||||
|
gradient.setColorAt(0.25,curveQColor);
|
||||||
|
gradient.setColorAt(0.4,curveQColor.darker(110));
|
||||||
|
gradient.setColorAt(0.6,curveQColor);
|
||||||
|
gradient.setColorAt(0.8,curveQColor.darker(110));
|
||||||
|
gradient.setColorAt(1,curveQColor);
|
||||||
|
m_qwtPlotCurve->setBrush(gradient);
|
||||||
|
|
||||||
QPen curvePen = m_qwtPlotCurve->pen();
|
QPen curvePen = m_qwtPlotCurve->pen();
|
||||||
curvePen.setColor(curveQColor.darker());
|
curvePen.setColor(curveQColor.darker());
|
||||||
m_qwtPlotCurve->setPen(curvePen);
|
m_qwtPlotCurve->setPen(curvePen);
|
||||||
|
@ -92,6 +92,7 @@ void RiuNightchartsWidget::clear()
|
|||||||
m_chart = Nightcharts();
|
m_chart = Nightcharts();
|
||||||
m_chart.setType(Nightcharts::Pie);
|
m_chart.setType(Nightcharts::Pie);
|
||||||
m_chart.setLegendType(Nightcharts::Vertical);
|
m_chart.setLegendType(Nightcharts::Vertical);
|
||||||
|
m_chart.setShadows(false);
|
||||||
|
|
||||||
m_marginLeft = 10;
|
m_marginLeft = 10;
|
||||||
m_marginTop = 10;
|
m_marginTop = 10;
|
||||||
|
@ -15,14 +15,7 @@ namespace caf
|
|||||||
template<typename DataType>
|
template<typename DataType>
|
||||||
PdmChildArrayField<DataType*>::~PdmChildArrayField()
|
PdmChildArrayField<DataType*>::~PdmChildArrayField()
|
||||||
{
|
{
|
||||||
#ifdef _DEBUG
|
deleteAllChildObjects();
|
||||||
for (size_t index = 0; index < m_pointers.size(); ++index)
|
|
||||||
{
|
|
||||||
assert(m_pointers.at(index).isNull());
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
this->removeThisAsParentField();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -52,11 +52,7 @@ caf::PdmChildField<DataType*>::PdmChildField(const DataTypePtr& fieldValue)
|
|||||||
template<typename DataType >
|
template<typename DataType >
|
||||||
caf::PdmChildField<DataType*>::~PdmChildField()
|
caf::PdmChildField<DataType*>::~PdmChildField()
|
||||||
{
|
{
|
||||||
bool The_object_owned_by_the_child_field_is_deleted = m_fieldValue.isNull();
|
delete m_fieldValue.rawPtr();
|
||||||
assert(The_object_owned_by_the_child_field_is_deleted); // Did you forget ?
|
|
||||||
|
|
||||||
if (!m_fieldValue.isNull()) m_fieldValue.rawPtr()->removeAsParentField(this);
|
|
||||||
m_fieldValue.setRawPtr(NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
8
ThirdParty/nightcharts/nightcharts.cpp
vendored
8
ThirdParty/nightcharts/nightcharts.cpp
vendored
@ -122,7 +122,8 @@ int Nightcharts::draw(QPainter *painter)
|
|||||||
double pdegree = 0;
|
double pdegree = 0;
|
||||||
|
|
||||||
//Options
|
//Options
|
||||||
QLinearGradient gradient(cX+0.5*cW,cY,cX+0.5*cW,cY+cH*2.5);
|
//QLinearGradient gradient(cX + 0.5*cW, cY, cX + 0.5*cW, cY + cH*2.5);
|
||||||
|
QRadialGradient gradient(cX + 0.5*cW, cY+0.5*cH, 0.5*cW);
|
||||||
gradient.setColorAt(1,Qt::black);
|
gradient.setColorAt(1,Qt::black);
|
||||||
|
|
||||||
|
|
||||||
@ -145,6 +146,11 @@ int Nightcharts::draw(QPainter *painter)
|
|||||||
for (int i=0;i<pieces.size();i++)
|
for (int i=0;i<pieces.size();i++)
|
||||||
{
|
{
|
||||||
gradient.setColorAt(0,pieces[i].rgbColor);
|
gradient.setColorAt(0,pieces[i].rgbColor);
|
||||||
|
// Added for radial gradient
|
||||||
|
gradient.setColorAt(0.85,pieces[i].rgbColor);
|
||||||
|
gradient.setColorAt(0.95,pieces[i].rgbColor.darker(120));
|
||||||
|
gradient.setColorAt(1,pieces[i].rgbColor.darker(140));
|
||||||
|
// <--
|
||||||
painter->setBrush(gradient);
|
painter->setBrush(gradient);
|
||||||
pen.setColor(pieces[i].rgbColor);
|
pen.setColor(pieces[i].rgbColor);
|
||||||
painter->setPen(pen);
|
painter->setPen(pen);
|
||||||
|
Loading…
Reference in New Issue
Block a user