Skip to content

Commit 55c1316

Browse files
Merge pull request #269 from PauloCarvalhoRJ/NextRelease_20210711
New release: 6.12
2 parents d155519 + 8369bc6 commit 55c1316

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+1776
-285
lines changed

GammaRay.pro

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ SOURCES += main.cpp\
3636
dialogs/faciestransitionmatrixoptionsdialog.cpp \
3737
dialogs/populatewithproportionsfromvpcdialog.cpp \
3838
dialogs/sectiondialog.cpp \
39+
dialogs/subgriddialog.cpp \
3940
domain/auxiliary/verticalproportioncurvemaker.cpp \
4041
domain/section.cpp \
4142
domain/verticalproportioncurve.cpp \
@@ -298,6 +299,7 @@ HEADERS += mainwindow.h \
298299
dialogs/faciestransitionmatrixoptionsdialog.h \
299300
dialogs/populatewithproportionsfromvpcdialog.h \
300301
dialogs/sectiondialog.h \
302+
dialogs/subgriddialog.h \
301303
domain/auxiliary/verticalproportioncurvemaker.h \
302304
domain/project.h \
303305
domain/application.h \
@@ -568,6 +570,7 @@ FORMS += mainwindow.ui \
568570
dialogs/faciestransitionmatrixoptionsdialog.ui \
569571
dialogs/populatewithproportionsfromvpcdialog.ui \
570572
dialogs/sectiondialog.ui \
573+
dialogs/subgriddialog.ui \
571574
gslib/gslibparams/widgets/widgetgslibpardouble.ui \
572575
gslib/gslibparams/widgets/widgetgslibparfile.ui \
573576
gslib/gslibparams/widgets/widgetgslibparinputdata.ui \
@@ -820,7 +823,7 @@ win32 {
820823
# The application version
821824
# Don't forget to update the Util::importSettingsFromPreviousVersion() method to
822825
# enable the import of registry/user settings of previous versions.
823-
VERSION = 6.9
826+
VERSION = 6.12
824827

825828
# Define a preprocessor macro so we can get the application version in application code.
826829
DEFINES += APP_VERSION=\\\"$$VERSION\\\"

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ If you enjoyed this project, you might also enjoy GeostatsPy: https://github.com
1515
Python script to convert Eclipse grids to Paraview-compatible VTU format: https://github.com/BinWang0213/PyGRDECL
1616

1717
VERSION HISTORY:<br>
18+
&nbsp;&nbsp;&nbsp;Version 6.12 - Several new methods to work with grids. Several fixes and enhancements.
1819
&nbsp;&nbsp;&nbsp;Version 6.9 - Export geologic grids as Eclipse grids, multiple other new features, enhancements and fixes.<br>
1920
&nbsp;&nbsp;&nbsp;Version 6.7 - New data type: Geologic section.<br>
2021
&nbsp;&nbsp;&nbsp;Version 6.6 - Mean, median and Gaussian filters, improvements and bug fixes.<br>

dialogs/krigingdialog.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,14 @@ void KrigingDialog::onParameters()
128128
//get the selected grid with secondary data (if any)
129129
CartesianGrid* sec_data_grid = (CartesianGrid*)m_cgSelectorSecondary->getSelectedDataFile();
130130

131+
//if a secondary variable (for LVM or KED) was selected, update the min and max values.
132+
if( sec_data_grid ){
133+
double minSecondary = sec_data_grid->min( m_cgSecondaryVariableSelector->getSelectedVariableGEOEASIndex()-1 );
134+
double maxSecondary = sec_data_grid->max( m_cgSecondaryVariableSelector->getSelectedVariableGEOEASIndex()-1 );
135+
data_min = std::min( data_min, minSecondary );
136+
data_max = std::max( data_max, maxSecondary );
137+
}
138+
131139
//-----------------------------set kt3d parameters---------------------------
132140

133141
if( ! m_gpf_kt3d ){
@@ -399,6 +407,15 @@ void KrigingDialog::preview()
399407
//get the tmp file path created by kte3d with the estimates and kriging variances
400408
QString grid_file_path = m_gpf_kt3d->getParameter<GSLibParFile*>(8)->_path;
401409

410+
//Sanity check
411+
QFile grid_file( grid_file_path );
412+
if( ! grid_file.exists( ) ){
413+
Application::instance()->logError( "KrigingDialog::preview(): output file not generated. "
414+
"Check kt3d parameters and the output message pane for errors"
415+
" issued by kt3d.", true );
416+
return;
417+
}
418+
402419
//create a new grid object corresponding to the file created by kt3d
403420
m_cg_estimation = new CartesianGrid( grid_file_path );
404421

dialogs/subgriddialog.cpp

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
#include "subgriddialog.h"
2+
#include "ui_subgriddialog.h"
3+
4+
#include "domain/cartesiangrid.h"
5+
#include "domain/application.h"
6+
#include "domain/project.h"
7+
#include "imagejockey/widgets/ijquick3dviewer.h"
8+
#include "widgets/variableselector.h"
9+
10+
SubgridDialog::SubgridDialog(CartesianGrid *cg, QWidget *parent) :
11+
QDialog(parent),
12+
ui(new Ui::SubgridDialog),
13+
m_cg( cg )
14+
{
15+
assert( cg && "SubgridDialog::SubgridDialog(): Cartesian grid cannot be null." );
16+
17+
ui->setupUi(this);
18+
19+
//deletes dialog from memory upon user closing it
20+
this->setAttribute(Qt::WA_DeleteOnClose);
21+
22+
this->setWindowTitle( "Make subgrid" );
23+
24+
ui->spinMaxI->setMinimum( 0 );
25+
ui->spinMaxI->setMaximum( cg->getNI()-1 );
26+
ui->spinMaxI->setValue( cg->getNI()-1 );
27+
28+
ui->spinMinI->setMinimum( 0 );
29+
ui->spinMinI->setMaximum( cg->getNI()-1 );
30+
ui->spinMinI->setValue( 0 );
31+
32+
ui->spinMaxJ->setMinimum( 0 );
33+
ui->spinMaxJ->setMaximum( cg->getNJ()-1 );
34+
ui->spinMaxJ->setValue( cg->getNJ()-1 );
35+
36+
ui->spinMinJ->setMinimum( 0 );
37+
ui->spinMinJ->setMaximum( cg->getNJ()-1 );
38+
ui->spinMinJ->setValue( 0 );
39+
40+
ui->spinMaxK->setMinimum( 0 );
41+
ui->spinMaxK->setMaximum( cg->getNK()-1 );
42+
ui->spinMaxK->setValue( cg->getNK()-1 );
43+
44+
ui->spinMinK->setMinimum( 0 );
45+
ui->spinMinK->setMaximum( cg->getNK()-1 );
46+
ui->spinMinK->setValue( 0 );
47+
48+
ui->txtGridName->setText( cg->getName() + "_subgrid" );
49+
50+
m_previewWidget = new IJQuick3DViewer();
51+
ui->frmDisplay->layout()->addWidget( m_previewWidget );
52+
m_previewWidget->hideDismissButton();
53+
54+
//The list with the secondary data grid variables;
55+
m_variableForPreview = new VariableSelector();
56+
ui->frmCmbVariable->layout()->addWidget( m_variableForPreview );
57+
m_variableForPreview->onListVariables( m_cg );
58+
59+
adjustSize();
60+
}
61+
62+
SubgridDialog::~SubgridDialog()
63+
{
64+
delete ui;
65+
}
66+
67+
void SubgridDialog::onSave()
68+
{
69+
CartesianGrid* subgrid = m_cg->makeSubGrid( ui->spinMinI->value(), ui->spinMaxI->value(),
70+
ui->spinMinJ->value(), ui->spinMaxJ->value(),
71+
ui->spinMinK->value(), ui->spinMaxK->value() );
72+
73+
//save the physical files
74+
subgrid->setPath( Application::instance()->getProject()->getPath() +
75+
'/' + ui->txtGridName->text() );
76+
subgrid->updateMetaDataFile();
77+
subgrid->writeToFS();
78+
79+
//adds the new grid to the project
80+
Application::instance()->getProject()->addDataFile( subgrid );
81+
Application::instance()->refreshProjectTree();
82+
83+
//closes the dialog
84+
accept();
85+
}
86+
87+
void SubgridDialog::onPreview()
88+
{
89+
CartesianGrid* subgrid = m_cg->makeSubGrid( ui->spinMinI->value(), ui->spinMaxI->value(),
90+
ui->spinMinJ->value(), ui->spinMaxJ->value(),
91+
ui->spinMinK->value(), ui->spinMaxK->value() );
92+
93+
uint dataColumn = m_variableForPreview->getSelectedVariableGEOEASIndex() - 1;
94+
95+
spectral::array* data = subgrid->createSpectralArray( dataColumn );
96+
97+
double min = subgrid->min( dataColumn );
98+
double max = subgrid->max( dataColumn );
99+
100+
m_previewWidget->display( *data, min, max, subgrid->getDX(), subgrid->getDY(), subgrid->getDZ() );
101+
102+
delete data;
103+
delete subgrid;
104+
}

dialogs/subgriddialog.h

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#ifndef SUBGRIDDIALOG_H
2+
#define SUBGRIDDIALOG_H
3+
4+
#include <QDialog>
5+
6+
class CartesianGrid;
7+
class IJQuick3DViewer;
8+
class VariableSelector;
9+
10+
namespace Ui {
11+
class SubgridDialog;
12+
}
13+
14+
class SubgridDialog : public QDialog
15+
{
16+
Q_OBJECT
17+
18+
public:
19+
explicit SubgridDialog( CartesianGrid* cg, QWidget *parent = nullptr);
20+
~SubgridDialog();
21+
22+
private:
23+
Ui::SubgridDialog *ui;
24+
CartesianGrid* m_cg;
25+
IJQuick3DViewer* m_previewWidget;
26+
VariableSelector* m_variableForPreview;
27+
28+
private Q_SLOTS:
29+
30+
void onSave();
31+
void onPreview();
32+
};
33+
34+
#endif // SUBGRIDDIALOG_H

0 commit comments

Comments
 (0)