-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMain_crava.cpp
6905 lines (6410 loc) · 290 KB
/
Main_crava.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/***************************************************************************
* Copyright (C) 2010 by Statoil *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include "Main_crava.h"
#include <QtGui>
#include <QObject>
#include "VariogramDialog.h"
#include "VariogramDialog1d.h"
#include "ModeDialog.h"
#include "SettingsDialog.h"
#include <string>
/**
@author Alf Birger Rustad (Statoil R&D) <[email protected]> Øystein Arneson (RD IRE FRM) <[email protected]>, Erik Bakken <[email protected]>, Andreas B. Lindblad <[email protected]>
*/
Main_crava::Main_crava(QWidget *parent, bool existing, const QString &filename) :QMainWindow(parent)
{
setupUi( this );
standard=new StandardStrings();//makes sure that the filepaths are relative to this instance.
setCurrentFile(filename);
setupButtonGroups();
createActions();
//survey information frames
seismicDataFrame->setEnabled(false);
deleteStackPushButton->setEnabled(false);
applyToAllStacksPushButton->setEnabled(false);
formatChangeFrame->setVisible(false);
formatChangeFrame->setEnabled(false);
waveletFrame->setVisible(false);
waveletFrame->setEnabled(false);
localWaveletFrame->setVisible(false);
localWaveletFrame->setEnabled(false);
localNoiseFrame->setVisible(false);
localNoiseFrame->setEnabled(false);
//well frames
wellFrame->setEnabled(false);
deleteWellPushButton->setEnabled(false);
openWellPushButton->setEnabled(false);
useSeparateLogNamesCheckBox->setEnabled(false);
anglePositionlineEdit->setEnabled(false);
weightLineEdit->setEnabled(false);
optimizePositionFrame->setVisible(false);
optimizePositionFrame->setEnabled(false);
xCoordinateRadioButton->setVisible(false);
yCoordinateRadioButton->setVisible(false);
relativeXCoordinateRadioButton->setVisible(false);
relativeYCoordinateRadioButton->setVisible(false);
xCoordinateLineEdit->setVisible(false);
yCoordinateLineEdit->setVisible(false);
relativeXCoordinateLineEdit->setVisible(false);
relativeYCoordinateLineEdit->setVisible(false);
//horizon
velocityFieldLineEdit->setVisible(false);
velocityFieldBrowsePushButton->setVisible(false);
velocityFieldLineEdit->setEnabled(false);
velocityFieldBrowsePushButton->setEnabled(false);
//Prior Model
faciesFrame->setEnabled(false);
deleteFaciesPushButton->setEnabled(false);
//scrolling
QScrollArea *scrollArea=new QScrollArea(this);
scrollArea->setWidget(centralwidget);
scrollArea->setWidgetResizable(true);
setCentralWidget(scrollArea);
setAttribute(Qt::WA_DeleteOnClose);
QList<QWidget*> widgets=QObject::findChildren<QWidget*>();
foreach (QWidget* widget, widgets){//turns all the text of tooltips into rich text so it linebreaks nicely.
if(!widget->toolTip().isEmpty()){
widget->setToolTip(QString("<qt>")+widget->toolTip());//could do ...+ QString("</qt>")
}
}
activateTable();
readGuiSpecificSettings();
bool *pressedOpen = new bool; // a bool that indicates if the user has pressed the open project button
*pressedOpen = false;
QString fileNameOfOpenFile = QString(); // not to be confused with filename
if(!filename.isEmpty()){//used on loading
int r = QMessageBox::warning(this, QString("Overwrite settings"), QString("Do you want to overwrite the settings by loading the settings in the specified file?"),
QMessageBox::Yes | QMessageBox::No);
writeXmlToTree(filename,xmlTreeWidget);//note that xmlTreeWidget is the tree from the Qt ui-file
QDir dir(top_directoryPointer->text(1));
dir.cd(input_directoryPointer->text(1));
standard->StandardStrings::setinputPath(dir.path());
if (r == QMessageBox::Yes) {
writeSettings();
}
else{
readSettings();
}
faciesGui();
forwardGui();
estimationGui();
updateGuiToTree();
if (r == QMessageBox::Yes) {
setCurrentFile(filename);
}
}
else {//used when not loading
readSettings();
if (!mode(false,pressedOpen, existing, fileNameOfOpenFile)){
if(existing){//calling close on the first main window does not close the program
setCurrentFile(filename);
close();
return;
}
}
updateGuiToTree();
setCurrentFile(filename);
setDefaultValues();
}
if (*pressedOpen == true){
if(!fileNameOfOpenFile.isEmpty()){
int r = QMessageBox::warning(this, QString("Overwrite settings"), QString("Do you want to overwrite the settings by loading the settings in the specified file?"),
QMessageBox::Yes | QMessageBox::No);
writeXmlToTree(fileNameOfOpenFile, xmlTreeWidget);
QDir dir(top_directoryPointer->text(1));
dir.cd(input_directoryPointer->text(1));
standard->StandardStrings::setinputPath(dir.path());
if (r == QMessageBox::Yes) {
writeSettings();
}
else{
readSettings();
}
faciesGui();
forwardGui();
estimationGui();
updateGuiToTree();
if (r == QMessageBox::Yes) {
setCurrentFile(fileNameOfOpenFile);
}
}
}
xmlTreeWidget->expandAll();
xmlTreeWidget->resizeColumnToContents(0);
xmlTreeWidget->resizeColumnToContents(1);
xmlTreeWidget->setMinimumWidth(xmlTreeWidget->columnWidth(0)+xmlTreeWidget->columnWidth(1));//makes the treewidget not have to scroll all the time.
tabWidget->setCurrentIndex(0);//survey information
toolBox->setCurrentIndex(1);
delete pressedOpen;
QList<QObject*> fields = getNecessaryFields();
foreach(QObject* field, fields){
field->installEventFilter(this);
}
if(stackListWidget->count()<1) angleLineEdit->setStyleSheet("");
}
Main_crava::~Main_crava()
{//qt automatically deletes all child widgets.
delete standard;
}
void Main_crava::createActions()
{
//this is probably all editable from designer, not the standard sequences though...
modeAction->setShortcut(QString("Ctrl+M"));
newAction->setShortcut(QKeySequence::New);
saveAction->setShortcut(QKeySequence::Save);
openAction->setShortcut(QKeySequence::Open);
quitAction->setShortcut(QString("Ctrl+Q"));
runAction->setShortcut(QString("Ctrl+R"));
manualAction->setShortcut(QString(QKeySequence::HelpContents));
connect(quitAction, SIGNAL(triggered()), this, SLOT(close()));
wellHeaderListWidget->setContextMenuPolicy(Qt::CustomContextMenu);
connect(wellHeaderListWidget, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(showContextMenu(const QPoint&))); //right click on wellHeaderListWidget
}
void Main_crava::setupButtonGroups()
{
//survey
//also sets up non-radiobuttons
//can't check the buttons in the constructor since there is no seismic data stack yet.
QButtonGroup *seismicStackType = new QButtonGroup(seismicDataFrame);
seismicStackType->addButton(ppRadioButton);
seismicStackType->addButton(psRadioButton);
QButtonGroup *headerFormatInformation = new QButtonGroup(seismicDataFrame);
headerFormatInformation->addButton(headerAutoDetectRadioButton);
headerFormatInformation->addButton(headerSeisWorksRadioButton);
headerFormatInformation->addButton(headerIesxRadioButton);
headerFormatInformation->addButton(headerSipRadioButton);
headerFormatInformation->addButton(headerCharismaRadioButton);
headerFormatInformation->addButton(headerUserDefinedRadioButton);
QButtonGroup *waveletType = new QButtonGroup(seismicDataFrame);
waveletType->addButton(wavelet1DRadioButton);
waveletType->addButton(wavelet3DRadioButton);
wavelet1DRadioButton->setChecked(true);//this should be in update gui function, but only 1D is possible currently, when 3D is enabled it needs to be moved.
wavelet3DRadioButton->setEnabled(false);
wavelet3DFrame->setEnabled(false);
wavelet3DFrame->setVisible(false);
//wells
QButtonGroup *vpFormat = new QButtonGroup(wellsTab);
vpFormat->addButton(vpRadioButton);
vpFormat->addButton(dtRadioButton);
QButtonGroup *vsFormat = new QButtonGroup(wellsTab);
vsFormat->addButton(vsRadioButton);
vsFormat->addButton(dtsRadioButton);
QButtonGroup *xcoordinatebuttons = new QButtonGroup(wellsTab);
xcoordinatebuttons->addButton(xCoordinateRadioButton);
xcoordinatebuttons->addButton(relativeXCoordinateRadioButton);
QButtonGroup *ycoordinatebuttons = new QButtonGroup(wellsTab);
ycoordinatebuttons->addButton(yCoordinateRadioButton);
ycoordinatebuttons->addButton(relativeYCoordinateRadioButton);
//horizon
QButtonGroup *singleMultizone = new QButtonGroup(horizonsTab);
singleMultizone->addButton(singleZoneInversionRadioButton);
singleMultizone->addButton(multizoneInversionRadioButton);
QButtonGroup *verticalInterval = new QButtonGroup(horizonsTab);
verticalInterval->addButton(twoSurfaceRadioButton);
verticalInterval->addButton(topSurfaceRadioButton);
verticalInterval->addButton(baseSurfaceRadioButton);
verticalInterval->addButton(correlationSurfaceRadioButton);
verticalInterval->addButton(oneSurfaceRadioButton);
verticalInterval->addButton(constantInversionRadioButton);
QButtonGroup *lateralInterval = new QButtonGroup(horizonsTab);
lateralInterval->addButton(areaSeismicRadioButton);
lateralInterval->addButton(areaFileRadioButton);
lateralInterval->addButton(areaUtmRadioButton);
lateralInterval->addButton(areaInCrossRadioButton);
QButtonGroup *multizoneCorrelationButtons = new QButtonGroup(horizonsTab);
multizoneCorrelationButtons->addButton(topCorrelationRadioButton);
multizoneCorrelationButtons->addButton(baseCorrelationRadioButton);
multizoneCorrelationButtons->addButton(compactionCorrelationRadioButton);
multizoneCorrelationButtons->addButton(singleCorrelationSurfaceRadioButton);
multizoneCorrelationButtons->addButton(twoCorrelationSurfacesRadioButton);
//prior model
QButtonGroup *background = new QButtonGroup(priorModelTab);
background->addButton(estimateBackgroundRadioButton);
background->addButton(backgroundRadioButton);
QButtonGroup *vp1Prior = new QButtonGroup(vpVsRhoFrame);
vp1Prior->addButton(vpConstant1RadioButton);
vp1Prior->addButton(vpFile1RadioButton);
QButtonGroup *vs1Prior = new QButtonGroup(vpVsRhoFrame);
vs1Prior->addButton(vsConstant1RadioButton);
vs1Prior->addButton(vsFile1RadioButton);
QButtonGroup *density1Prior = new QButtonGroup(vpVsRhoFrame);
density1Prior->addButton(densityConstant1RadioButton);
density1Prior->addButton(densityFile1RadioButton);
QButtonGroup *density2Prior = new QButtonGroup(aiVpVsRhoFrame);
density2Prior->addButton(densityConstant2RadioButton);
density2Prior->addButton(densityFile2RadioButton);
QButtonGroup *density3Prior = new QButtonGroup(aiSiRhoFrame);
density3Prior->addButton(densityConstant3RadioButton);
density3Prior->addButton(densityFile3RadioButton);
//QCheckBox:checked:disabled{}; checked and disabled buttons shows as not checked. This is a bug in Qt, using a newer version to compile would fix it
absoluteParametersCheckBox->setVisible(false);//Not wanted functionlity?
absoluteParametersCheckBox->setEnabled(false);//Not wanted functionlity?
matchEnergiesCheckBox->setVisible(false);//Not wanted functionlity
matchEnergiesCheckBox->setEnabled(false);//Not wanted functionlity
topSurfaceRadioButton->setVisible(false);//not working
baseSurfaceRadioButton->setVisible(false);//not working
topSurfaceRadioButton->setEnabled(false);//not working
baseSurfaceRadioButton->setEnabled(false);//not working
wellHeaderPushButton->setEnabled(false);//should only be clickable if there are any items in the well list widget.
}
void Main_crava::readGuiSpecificSettings()
{//makes the program remember how it looked like last time it was ran
QSettings settings("Statoil","CRAVA");
settings.beginGroup("crava");
settings.beginGroup("GUI");
resize(settings.value("size", QSize(1280, 720)).toSize());
move(settings.value("position", QPoint(0, 0)).toPoint());
xmlTreeWidget->setVisible(settings.value(QString("showtree"),true).toBool());
settings.beginGroup("tree");
settings.beginGroup(io_settingsPointer->text(0));//io-settings
//directories , not output directory
top_directoryPointer->setText(1,settings.value(top_directoryPointer->text(0),QString("")).toString());
input_directoryPointer->setText(1,settings.value(input_directoryPointer->text(0),QString("")).toString());
//directories here so having multiple windows open does not potentially cause trouble.
settings.endGroup();
settings.endGroup();
}
void Main_crava::readSettings()
{
//second argument is default
//could have been done dynamically by searching for same name then putting it in there.
QSettings settings("Statoil","CRAVA");
settings.beginGroup("crava");
settings.beginGroup("GUI");
settings.beginGroup("tree");
//iterate over all the various options that can be in settings, if the values in the tree are non-empty and different
//project-settings
settings.beginGroup(io_settingsPointer->text(0));//io-settings
settings.beginGroup(grid_outputPointer->text(0));//grid-output
settings.beginGroup(grid_output_formatPointer->text(0));//format
if(!forwardMode()){
settings.beginGroup(segy_formatPointer->text(0));//segy-format
for(int j=0;j<segy_formatPointer->childCount();++j){
segy_formatPointer->child(j)->setText(1,settings.value(segy_formatPointer->child(j)->text(0),QString("")).toString());
}
settings.endGroup();//end segy-format
}
//grid format
format_segyPointer->setText(1,settings.value(format_segyPointer->text(0),QString("")).toString());
format_stormPointer->setText(1,settings.value(format_stormPointer->text(0),QString("")).toString());
format_cravaPointer->setText(1,settings.value(format_cravaPointer->text(0),QString("")).toString());
format_sgriPointer->setText(1,settings.value(format_sgriPointer->text(0),QString("")).toString());
format_asciiPointer->setText(1,settings.value(format_asciiPointer->text(0),QString("")).toString());
settings.endGroup();//end format
settings.endGroup();//end grid-output
if(!forwardMode()){
settings.beginGroup(well_outputPointer->text(0));//well-output
settings.beginGroup(well_output_formatPointer->text(0));//format
well_output_norsarPointer->setText(1,settings.value(well_output_norsarPointer->text(0),QString("")).toString()); //why only norsar??
settings.endGroup();//end format
settings.endGroup();//end well-output
settings.beginGroup(wavelet_outputPointer->text(0));//wavelet-output
settings.beginGroup(wavelet_output_formatPointer->text(0));//format
wavelet_output_norsarPointer->setText(1,settings.value(wavelet_output_norsarPointer->text(0),QString("")).toString());
settings.endGroup();//end format
settings.endGroup();//end wavelet-output
}
io_settings_log_levelPointer->setText(1,settings.value(io_settings_log_levelPointer->text(0),QString("")).toString());//log-level
settings.endGroup();//end io-settings
if(!forwardMode()){
settings.beginGroup(advanced_settingsPointer->text(0));//advanced-settings
if(estimationMode()){
vp_vs_ratioPointer->setText(1,settings.value(vp_vs_ratioPointer->text(0),QString("")).toString());
vp_vs_ratio_from_wellsPointer->setText(1,settings.value(vp_vs_ratio_from_wellsPointer->text(0),QString("")).toString());
high_cut_seismic_resolutionPointer->setText(1,settings.value(high_cut_seismic_resolutionPointer->text(0),QString("")).toString());
energy_tresholdPointer->setText(1,settings.value(energy_tresholdPointer->text(0),QString("")).toString());
wavelet_tapering_lengthPointer->setText(1,settings.value(wavelet_tapering_lengthPointer->text(0),QString("")).toString());
minimum_relative_wavelet_amplitudePointer->setText(1,settings.value(minimum_relative_wavelet_amplitudePointer->text(0),QString("")).toString());
maximum_wavelet_shiftPointer->setText(1,settings.value(maximum_wavelet_shiftPointer->text(0),QString("")).toString());
white_noise_component_cutPointer->setText(1,settings.value(white_noise_component_cutPointer->text(0),QString("")).toString());
//reflection matrix should not be written, relative path...
kriging_data_limitPointer->setText(1,settings.value(kriging_data_limitPointer->text(0),QString("")).toString());
guard_zonePointer->setText(1,settings.value(guard_zonePointer->text(0),QString("")).toString());
debug_levelPointer->setText(1,settings.value(debug_levelPointer->text(0),QString("")).toString());
smooth_kriged_parametersPointer->setText(1,settings.value(smooth_kriged_parametersPointer->text(0),QString("")).toString());
}
else{
x_fractionPointer->setText(1,settings.value(x_fractionPointer->text(0),QString("")).toString());
y_fractionPointer->setText(1,settings.value(y_fractionPointer->text(0),QString("")).toString());
z_fractionPointer->setText(1,settings.value(z_fractionPointer->text(0),QString("")).toString());
use_intermediate_disk_storagePointer->setText(1,settings.value(use_intermediate_disk_storagePointer->text(0),QString("")).toString());
vp_vs_ratioPointer->setText(1,settings.value(vp_vs_ratioPointer->text(0),QString("")).toString());
vp_vs_ratio_from_wellsPointer->setText(1,settings.value(vp_vs_ratio_from_wellsPointer->text(0),QString("")).toString());
maximum_relative_thickness_differencePointer->setText(1,settings.value(maximum_relative_thickness_differencePointer->text(0),QString("")).toString());
frequency_band_low_cutPointer->setText(1,settings.value(frequency_band_low_cutPointer->text(0),QString("")).toString());
frequency_band_high_cutPointer->setText(1,settings.value(frequency_band_high_cutPointer->text(0),QString("")).toString());
high_cut_seismic_resolutionPointer->setText(1,settings.value(high_cut_seismic_resolutionPointer->text(0),QString("")).toString());
energy_tresholdPointer->setText(1,settings.value(energy_tresholdPointer->text(0),QString("")).toString());
wavelet_tapering_lengthPointer->setText(1,settings.value(wavelet_tapering_lengthPointer->text(0),QString("")).toString());
minimum_relative_wavelet_amplitudePointer->setText(1,settings.value(minimum_relative_wavelet_amplitudePointer->text(0),QString("")).toString());
maximum_wavelet_shiftPointer->setText(1,settings.value(maximum_wavelet_shiftPointer->text(0),QString("")).toString());
white_noise_component_cutPointer->setText(1,settings.value(white_noise_component_cutPointer->text(0),QString("")).toString());
//reflection matrix should not be written, relative path...
kriging_data_limitPointer->setText(1,settings.value(kriging_data_limitPointer->text(0),QString("")).toString());
guard_zonePointer->setText(1,settings.value(guard_zonePointer->text(0),QString("")).toString());
debug_levelPointer->setText(1,settings.value(debug_levelPointer->text(0),QString("")).toString());
smooth_kriged_parametersPointer->setText(1,settings.value(smooth_kriged_parametersPointer->text(0),QString("")).toString());
}
settings.endGroup();//end advanced settings
settings.beginGroup(allowed_parameter_valuesPointer->text(0));//allowed-parameter-values
for(int j=0;j<allowed_parameter_valuesPointer->childCount();++j){
allowed_parameter_valuesPointer->child(j)->setText(1,settings.value(allowed_parameter_valuesPointer->child(j)->text(0),QString("")).toString());
}
maximum_deviation_anglePointer->setText(1,settings.value(maximum_deviation_anglePointer->text(0),QString("")).toString());
maximum_rank_correlationPointer->setText(1,settings.value(maximum_rank_correlationPointer->text(0),QString("")).toString());
maximum_merge_distancePointer->setText(1,settings.value(maximum_merge_distancePointer->text(0),QString("")).toString());
maximum_offsetPointer->setText(1,settings.value(maximum_offsetPointer->text(0),QString("")).toString());
maximum_shiftPointer->setText(1,settings.value(maximum_shiftPointer->text(0),QString("")).toString());
settings.endGroup();
}
settings.endGroup();//end tree
settings.endGroup();//end GUI
settings.endGroup();//end crava
}
void Main_crava::writeSettings()
{
QSettings settings("Statoil","CRAVA");
settings.beginGroup("crava");
settings.beginGroup("GUI");
settings.setValue( QString("openProject"), currentFile() );
settings.setValue("size", size());
settings.setValue("position", pos());
settings.beginGroup("tree");
//iterate over all the various options that can be in settings, if the values in the tree are non-empty and different
settings.beginGroup(io_settingsPointer->text(0));//io-settings
settings.setValue(top_directoryPointer->text(0),top_directoryPointer->text(1));
settings.setValue(input_directoryPointer->text(0),input_directoryPointer->text(1));
settings.beginGroup(grid_outputPointer->text(0));//grid-output
settings.beginGroup(grid_output_formatPointer->text(0));//format
settings.beginGroup(segy_formatPointer->text(0));//segy-format
for(int j=0;j<segy_formatPointer->childCount();++j){
settings.setValue(segy_formatPointer->child(j)->text(0), segy_formatPointer->child(j)->text(1));
}
settings.endGroup();//end segy-format
settings.setValue(format_segyPointer->text(0), format_segyPointer->text(1));
settings.setValue(format_stormPointer->text(0), format_stormPointer->text(1));
settings.setValue(format_cravaPointer->text(0), format_cravaPointer->text(1));
settings.setValue(format_sgriPointer->text(0), format_sgriPointer->text(1));
settings.setValue(format_asciiPointer->text(0), format_asciiPointer->text(1));
settings.endGroup();//end format
settings.endGroup();//end grid-output
if(!forwardMode()){
settings.beginGroup(well_outputPointer->text(0));//well-output
settings.beginGroup(well_output_formatPointer->text(0));//format
settings.setValue(well_output_norsarPointer->text(0), well_output_norsarPointer->text(1));
settings.endGroup();//end format
settings.endGroup();//end well-output
settings.beginGroup(wavelet_outputPointer->text(0));//wavelet-output
settings.beginGroup(wavelet_output_formatPointer->text(0));//format
settings.setValue(wavelet_output_norsarPointer->text(0),wavelet_output_norsarPointer->text(1));
settings.endGroup();//end format
settings.endGroup();//end wavelet-output
}
settings.setValue(io_settings_log_levelPointer->text(0),io_settings_log_levelPointer->text(1));//log-level
settings.endGroup();//end io-settings
if(!forwardMode()){
settings.beginGroup(advanced_settingsPointer->text(0));//advanced-settings
if(estimationMode()){
settings.setValue(vp_vs_ratioPointer->text(0),vp_vs_ratioPointer->text(1));
settings.setValue(vp_vs_ratio_from_wellsPointer->text(0),vp_vs_ratio_from_wellsPointer->text(1));
settings.setValue(high_cut_seismic_resolutionPointer->text(0),high_cut_seismic_resolutionPointer->text(1));
settings.setValue(energy_tresholdPointer->text(0),energy_tresholdPointer->text(1));
settings.setValue(wavelet_tapering_lengthPointer->text(0),wavelet_tapering_lengthPointer->text(1));
settings.setValue(minimum_relative_wavelet_amplitudePointer->text(0),minimum_relative_wavelet_amplitudePointer->text(1));
settings.setValue(maximum_wavelet_shiftPointer->text(0),maximum_wavelet_shiftPointer->text(1));
settings.setValue(white_noise_component_cutPointer->text(0),white_noise_component_cutPointer->text(1));
//reflection matrix should not be written, relative path...
settings.setValue(kriging_data_limitPointer->text(0),kriging_data_limitPointer->text(1));
settings.setValue(guard_zonePointer->text(0),guard_zonePointer->text(1));
settings.setValue(debug_levelPointer->text(0),debug_levelPointer->text(1));
settings.setValue(smooth_kriged_parametersPointer->text(0),smooth_kriged_parametersPointer->text(1));
}
else{
settings.setValue(x_fractionPointer->text(0),x_fractionPointer->text(1));
settings.setValue(y_fractionPointer->text(0),y_fractionPointer->text(1));
settings.setValue(z_fractionPointer->text(0),z_fractionPointer->text(1));
settings.setValue(use_intermediate_disk_storagePointer->text(0),use_intermediate_disk_storagePointer->text(1));
settings.setValue(vp_vs_ratioPointer->text(0),vp_vs_ratioPointer->text(1));
settings.setValue(vp_vs_ratio_from_wellsPointer->text(0),vp_vs_ratio_from_wellsPointer->text(1));
settings.setValue(maximum_relative_thickness_differencePointer->text(0),maximum_relative_thickness_differencePointer->text(1));
settings.setValue(frequency_band_low_cutPointer->text(0),frequency_band_low_cutPointer->text(1));
settings.setValue(frequency_band_high_cutPointer->text(0),frequency_band_high_cutPointer->text(1));
settings.setValue(high_cut_seismic_resolutionPointer->text(0),high_cut_seismic_resolutionPointer->text(1));
settings.setValue(energy_tresholdPointer->text(0),energy_tresholdPointer->text(1));
settings.setValue(wavelet_tapering_lengthPointer->text(0),wavelet_tapering_lengthPointer->text(1));
settings.setValue(minimum_relative_wavelet_amplitudePointer->text(0),minimum_relative_wavelet_amplitudePointer->text(1));
settings.setValue(maximum_wavelet_shiftPointer->text(0),maximum_wavelet_shiftPointer->text(1));
settings.setValue(white_noise_component_cutPointer->text(0),white_noise_component_cutPointer->text(1));
//reflection matrix should not be written, relative path...
settings.setValue(kriging_data_limitPointer->text(0),kriging_data_limitPointer->text(1));
settings.setValue(guard_zonePointer->text(0),guard_zonePointer->text(1));
settings.setValue(debug_levelPointer->text(0),debug_levelPointer->text(1));
settings.setValue(smooth_kriged_parametersPointer->text(0),smooth_kriged_parametersPointer->text(1));
}
settings.endGroup();
settings.beginGroup(allowed_parameter_valuesPointer->text(0));//allowed-parameter-values
for(int j=0;j<allowed_parameter_valuesPointer->childCount();++j){
settings.setValue(allowed_parameter_valuesPointer->child(j)->text(0),allowed_parameter_valuesPointer->child(j)->text(1));
}
settings.setValue(maximum_deviation_anglePointer->text(0),maximum_deviation_anglePointer->text(1));
settings.setValue(maximum_rank_correlationPointer->text(0),maximum_rank_correlationPointer->text(1));
settings.setValue(maximum_merge_distancePointer->text(0),maximum_merge_distancePointer->text(1));
settings.setValue(maximum_offsetPointer->text(0),maximum_offsetPointer->text(1));
settings.setValue(maximum_shiftPointer->text(0),maximum_shiftPointer->text(1));
settings.endGroup();
}
settings.endGroup();
settings.endGroup();
settings.endGroup();
}
void Main_crava::updateGuiToTree()
{
///////////////
//survey //
//////////////
defaultStartTimeLineEdit->setText(survey_segy_start_timePointer->text(1));//segy-start-time
//angle-gather already handled by the slot
//wavlet estimation interval gui set-up
waveletTopLineEdit->setText(survey_top_surface_filePointer->text(1));//wavelet estimation interval
waveletBottomLineEdit->setText(survey_base_surface_filePointer->text(1));
if(!survey_top_surface_valuePointer->text(1).isEmpty()){
waveletTopSurfaceLabel->setEnabled(false);
waveletTopLineEdit->setEnabled(false);
waveletTopBrowsePushButton->setEnabled(false);
topTimeValueWaveletEstimationCheckBox->setChecked(true);
waveletTopValueLineEdit->setText(survey_top_surface_valuePointer->text(1));
}
else{
waveletTopValueLineEdit->setVisible(false);
}
if(!survey_base_surface_valuePointer->text(1).isEmpty()){
waveletBottomSurfaceLabel->setEnabled(false);
waveletBottomLineEdit->setEnabled(false);
waveletBottomBrowsePushButton->setEnabled(false);
baseTimeValueWaveletEstimationCheckBox->setChecked(true);
waveletBaseValueLineEdit->setText(survey_base_surface_valuePointer->text(1));
}
else{
waveletBaseValueLineEdit->setVisible(false);
}
/////////////////
//well-data //
////////////////
//update log names, but only if there are no wells
//recursiveXmlRead will populate these fields if wells are present
if(wellListWidget->currentRow() == -1){
timeLineEdit->setText(log_names_timePointer->text(1));
densityLineEdit->setText(log_names_densityPointer->text(1));
faciesLineEdit->setText(log_names_faciesPointer->text(1));
if(!log_names_dtPointer->text(1).isEmpty()){
dtRadioButton->setChecked(true);
dtLineEdit->setText(log_names_dtPointer->text(1));
on_vpRadioButton_toggled(false);
}
else{//default
vpRadioButton->setChecked(true);
vpLineEdit->setText(log_names_vpPointer->text(1));
}
if(!log_names_dtsPointer->text(1).isEmpty()){
dtsRadioButton->setChecked(true);
dtsLineEdit->setText(log_names_dtsPointer->text(1));
on_vsRadioButton_toggled(false);
}
else{//default
vsRadioButton->setChecked(true);
vsLineEdit->setText(log_names_vsPointer->text(1));
}
}
/*************************************************************************************
* Huge nested ifs check which vertical inversion interval frames should be visible. *
* and fills in all information from the xml-tree in the user interface *
*************************************************************************************/
//constant top and base
if((!top_surface_time_valuePointer->text(1).isEmpty()) ||
(!base_surface_time_valuePointer->text(1).isEmpty())){
singleZoneInversionRadioButton->setChecked(true);
constantInversionRadioButton->setChecked(true);
topTimeValueLineEdit->setText(top_surface_time_valuePointer->text(1));
bottomTimeValueLineEdit->setText(base_surface_time_valuePointer->text(1));
on_oneSurfaceRadioButton_toggled(false);//hide surfaceOneFrame
layersLineEdit->setText(interval_two_surfaces_number_of_layersPointer->text(1) );
}
//check if inversion is defined by one surface and distance to top and base
else if((!(interval_one_surface_reference_surfacePointer->text(1).isEmpty())) ||
(!(interval_one_surface_shift_to_interval_topPointer->text(1).isEmpty() )) ||
(!(interval_one_surface_thicknessPointer->text(1).isEmpty())) ||
(!(interval_one_surface_sample_densityPointer->text(1).isEmpty()))){
singleZoneInversionRadioButton->setChecked(true);
on_constantInversionRadioButton_toggled(false);//do not show user interface
oneSurfaceRadioButton->setChecked(true);
referenceSurfaceFileLineEdit->setText(interval_one_surface_reference_surfacePointer->text(1));
distanceTopLineEdit->setText(interval_one_surface_shift_to_interval_topPointer->text(1));
thicknessLineEdit->setText(interval_one_surface_thicknessPointer->text(1));
layerThicknessLineEdit->setText(interval_one_surface_sample_densityPointer->text(1));
}
//check for two surface inversion, correlation following both
else if(!top_surface_time_filePointer->text(1).isEmpty() &&
correlation_directionPointer->text(1).isEmpty()){
singleZoneInversionRadioButton->setChecked(true);
twoSurfaceRadioButton->setChecked(true);
on_constantInversionRadioButton_toggled(false);//do not show user interface
on_oneSurfaceRadioButton_toggled(false);//do not show user interface
topTimeFileLineEdit->setText(top_surface_time_filePointer->text(1));
bottomTimeFileLineEdit->setText(base_surface_time_filePointer->text(1));
layersLineEdit->setText(interval_two_surfaces_number_of_layersPointer->text(1) );
if(!top_surface_depth_filePointer->text(1).isEmpty()||//check if Time to depth conversion ticked
!base_surface_depth_filePointer->text(1).isEmpty()){
depthSurfacesCheckBox->setChecked(true);
topDepthFileLineEdit->setText(top_surface_depth_filePointer->text(1));
bottomDepthFileLineEdit->setText(base_surface_depth_filePointer->text(1));
}
else{
depthSurfacesCheckBox->setChecked(false);
}
}
//check for two surface inversion, separate correlation surface
else if(!correlation_directionPointer->text(1).isEmpty()){
singleZoneInversionRadioButton->setChecked(true);
correlationSurfaceRadioButton->setChecked(true);
on_constantInversionRadioButton_toggled(false);//do not show user interface
on_oneSurfaceRadioButton_toggled(false);//do not show user interface
topTimeFileLineEdit->setText(top_surface_time_filePointer->text(1));
bottomTimeFileLineEdit->setText(base_surface_time_filePointer->text(1));
layersLineEdit->setText(interval_two_surfaces_number_of_layersPointer->text(1) );
if(!top_surface_depth_filePointer->text(1).isEmpty()||//check if Time to depth conversion ticked
!base_surface_depth_filePointer->text(1).isEmpty()){
depthSurfacesCheckBox->setChecked(true);
topDepthFileLineEdit->setText(top_surface_depth_filePointer->text(1));
bottomDepthFileLineEdit->setText(base_surface_depth_filePointer->text(1));
}
else{
depthSurfacesCheckBox->setChecked(false);
}
}
//check for multizone
else if(zoneListWidget->count()>0 || !top_surface_time_multizone_filePointer->text(1).isEmpty() ||
!top_surface_time_multizone_valuePointer->text(1).isEmpty()){
multizoneInversionRadioButton->setChecked(true);
if(!top_surface_time_multizone_filePointer->text(1).isEmpty()){ //are we using a top surface file?
topSurfaceFileLineEdit->setText(top_surface_time_multizone_filePointer->text(1));
topTimeValueMultizoneLineEdit->setVisible(false);
topTimeValueMultizoneCheckBox->setChecked(false);
}
else if(!top_surface_time_multizone_valuePointer->text(1).isEmpty()){//are we using constant time top?
topTimeValueMultizoneLineEdit->setText(top_surface_time_multizone_valuePointer->text(1));
topSurfaceFileLabel->setEnabled(false);
topSurfaceFileLineEdit->setEnabled(false);
topSurfaceFileBrowsePushButton->setEnabled(false);
topTimeValueMultizoneCheckBox->setChecked(true);
}
else{//no top surface provided yet
topTimeValueMultizoneLineEdit->setVisible(false);
topTimeValueMultizoneCheckBox->setChecked(false);
}
}
else{//if nothing is set-up, we start with default empty two surface inversion
singleZoneInversionRadioButton->setChecked(true);
twoSurfaceRadioButton->setChecked(true);
}
//fill in velocity field information (only relevant when Time to depth is ticked)
if(!interval_two_surfaces_velocity_fieldPointer->text(1).isEmpty()){
depthSurfacesCheckBox->setChecked(true);
velocityFieldFileRadioButton->setChecked(true);
velocityFieldLineEdit->setText(interval_two_surfaces_velocity_fieldPointer->text(1));
}
else if(interval_two_surfaces_velocity_field_from_inversionPointer->text(1)==QString("yes")){
depthSurfacesCheckBox->setChecked(true);
velocityFieldInvesionRadioButton->setChecked(true);
}
else {//default
velocityFieldNoneRadioButton->setChecked(true);
}
/***********************************************************************
* prior-model *
* zone list is handled by the reading of the tree *
***********************************************************************/
//checks whether the estimate background model radio button is checked
if(background_vs_filePointer->text(1).isEmpty() && background_vp_filePointer->text(1).isEmpty() &&
background_density_filePointer->text(1).isEmpty() && background_ai_filePointer->text(1).isEmpty() &&
background_si_filePointer->text(1).isEmpty() && background_vp_vs_ratio_filePointer->text(1).isEmpty() &&
background_vp_constantPointer->text(1).isEmpty() && background_vs_constantPointer->text(1).isEmpty() &&
background_density_constantPointer->text(1).isEmpty()){
estimateBackgroundRadioButton->setChecked(true);
//check if Configure the estimated background is checked
if(background_velocity_fieldPointer->text(1).isEmpty() && background_high_cut_background_modellingPointer->text(1).isEmpty()){
backgroundEstimatedConfigurationCheckBox->setChecked(false);
velocityFieldLabel->setVisible(false);
velocityFieldPriorFileLineEdit->setVisible(false);
velocityFieldPriorFileBrowsePushButton->setVisible(false);
lateralCorrelationLabel->setVisible(false);
lateralCorrelationBackgroundPushButton->setVisible(false);
highCutFrequencyLabel->setVisible(false);
highCutFrequencyLineEdit->setVisible(false);
hzLabel->setVisible(false);
}
else{
backgroundEstimatedConfigurationCheckBox->setChecked(true);
velocityFieldPriorFileLineEdit->setText(background_velocity_fieldPointer->text(1));
highCutFrequencyLineEdit->setText(background_high_cut_background_modellingPointer->text(1));
}
}
else{
backgroundRadioButton->setChecked(true);
if(!background_vp_filePointer->text(1).isEmpty()){
vpVsRhoRadioButton->setChecked(true);
vpFile1RadioButton->setChecked(true);
vpFile1LineEdit->setText(background_vp_filePointer->text(1));
}
else if(!background_vp_constantPointer->text(1).isEmpty()){
vpVsRhoRadioButton->setChecked(true);
vpConstant1RadioButton->setChecked(true);
vpConstant1LineEdit->setText(background_vp_constantPointer->text(1));
}
if(!background_vs_filePointer->text(1).isEmpty()){
vpVsRhoRadioButton->setChecked(true);
vsFile1RadioButton->setChecked(true);
vsFile1LineEdit->setText(background_vs_filePointer->text(1));
}
else if(!background_vs_constantPointer->text(1).isEmpty()){
vpVsRhoRadioButton->setChecked(true);
vsConstant1RadioButton->setChecked(true);
vsConstant1LineEdit->setText(background_vs_constantPointer->text(1));
}
if(!background_vp_vs_ratio_filePointer->text(1).isEmpty()){
aiVpVsRhoRadioButton->setChecked(true);
vpVsFile2LineEdit->setText(background_vp_vs_ratio_filePointer->text(1));
}
if(!background_si_filePointer->text(1).isEmpty()){
aiSiRhoRadioButton->setChecked(true);
siFile3LineEdit->setText(background_si_filePointer->text(1));
}
if(!background_ai_filePointer->text(1).isEmpty()){
if(aiSiRhoRadioButton->isChecked()){
aiFile3LineEdit->setText(background_ai_filePointer->text(1));
}
else{
aiVpVsRhoRadioButton->setChecked(true);
aiFile2LineEdit->setText(background_ai_filePointer->text(1));
}
}
if(!background_density_filePointer->text(1).isEmpty()){
if(aiSiRhoRadioButton->isChecked()){
densityFile3RadioButton->setChecked(true);
densityFile3LineEdit->setText(background_density_filePointer->text(1));
}
else if(aiVpVsRhoRadioButton->isChecked()){
densityFile2RadioButton->setChecked(true);
densityFile2LineEdit->setText(background_density_filePointer->text(1));
}
else{
vpVsRhoRadioButton->setChecked(true);
densityFile1RadioButton->setChecked(true);
densityFile1LineEdit->setText(background_density_filePointer->text(1));
}
}
else if(!background_density_constantPointer->text(1).isEmpty()){
if(aiSiRhoRadioButton->isChecked()){
densityConstant3RadioButton->setChecked(true);
densityConstant3LineEdit->setText(background_density_constantPointer->text(1));
}
else if(aiVpVsRhoRadioButton->isChecked()){
densityConstant2RadioButton->setChecked(true);
densityConstant2LineEdit->setText(background_density_constantPointer->text(1));
}
else{
vpVsRhoRadioButton->setChecked(true);
densityConstant1RadioButton->setChecked(true);
densityConstant1LineEdit->setText(background_density_constantPointer->text(1));
}
}
}
//correlation variograms handled by the appropriate dialogs, the checkboxes must be handled.
bool modified=false;
for(int i=0;i<local_wavelet_lateral_correlationPointer->childCount();++i){//local wavelet variogram background
if(!local_wavelet_lateral_correlationPointer->child(i)->text(1).isEmpty()){
modified=true;
}
}
correlationLocalWaveletCheckBox->setChecked(modified);
on_correlationLocalWaveletCheckBox_toggled(modified);
modified=false;
for(int i=0;i<prior_model_lateral_correlationPointer->childCount();++i){//lateral correlation parameters background.
if(!prior_model_lateral_correlationPointer->child(i)->text(1).isEmpty()){
modified=true;
}
}
temporalCorrelationLineEdit->setText(temporal_correlationPointer->text(1));
parameterCorrelationLineEdit->setText(parameter_correlationPointer->text(1));
if(!temporal_correlationPointer->text(1).isEmpty()||!parameter_correlationPointer->text(1).isEmpty()){
modified=true;
}
correlationElasticParametersCheckBox->setChecked(modified);
on_correlationElasticParametersCheckBox_toggled(modified);
if(!correlation_directionPointer->text(1).isEmpty()){//correlation-direction
correlationSurfaceRadioButton->setChecked(true);
correlationDirectionFileLineEdit->setText(correlation_directionPointer->text(1));
}
else{
on_correlationSurfaceRadioButton_toggled(false); // hide the inputs if the button is not checked.
}
//facies list is handled by the reading to tree
//facies-probabilities=7
if(faciesProbabilitiesOn()){
if(faciesListWidget->count()<=1){//default
faciesEstimateCheckBox->setChecked(true);
}
if(facies_probabilities_use_vsPointer->text(1)!=QString("no")){
vsForFaciesCheckBox->setChecked(true);//default
}
if(facies_probabilities_use_predictionPointer->text(1)==QString("yes")){
predictionFaciesCheckBox->setChecked(true);//not-default
}
if(facies_probabilities_use_absolute_elastic_parametersPointer->text(1)==QString("yes")){
absoluteParametersCheckBox->setChecked(true);//not-default
}
faciesTopLineEdit->setText(facies_probabilities_top_surface_filePointer->text(1));
faciesBottomLineEdit->setText(facies_probabilities_base_surface_filePointer->text(1));
if(!facies_probabilities_top_surface_valuePointer->text(1).isEmpty()){
topValueFaciesEstimationCheckBox->setChecked(true);
topValueFaciesEstimationLineEdit->setText(facies_probabilities_top_surface_valuePointer->text(1));
}
else{
topValueFaciesEstimationLineEdit->setVisible(false);
}
if(!facies_probabilities_base_surface_valuePointer->text(1).isEmpty()){
baseValueFaciesEstimationCheckBox->setChecked(true);
baseValueFaciesEstimationLineEdit->setText(facies_probabilities_base_surface_valuePointer->text(1));
}
else{
baseValueFaciesEstimationLineEdit->setVisible(false);
}
uncertaintyLevelLineEdit->setText(uncertainty_levelPointer->text(1));
}
if(!earth_model_vp_filePointer->text(1).isEmpty()){
vpComboBox->setCurrentIndex(0);
earthVpAiLineEdit->setText(earth_model_vp_filePointer->text(1));//earth model
}
else if(!earth_model_ai_filePointer->text(1).isEmpty()){
vpComboBox->setCurrentIndex(1);
earthVpAiLineEdit->setText(earth_model_ai_filePointer->text(1));//earth model
}
else{
vpComboBox->setCurrentIndex(0);
}
if(!earth_model_vs_filePointer->text(1).isEmpty()){
vsComboBox->setCurrentIndex(0);
earthVsSiVpVsLineEdit->setText(earth_model_vs_filePointer->text(1));//earth model
}
else if(!earth_model_si_filePointer->text(1).isEmpty()){
vsComboBox->setCurrentIndex(1);
earthVsSiVpVsLineEdit->setText(earth_model_si_filePointer->text(1));//earth model
}
else if(!earth_model_vp_vs_ratio_filePointer->text(1).isEmpty()){
vsComboBox->setCurrentIndex(2);
earthVsSiVpVsLineEdit->setText(earth_model_vp_vs_ratio_filePointer->text(1));//earth model
}
else{
vsComboBox->setCurrentIndex(0);
}
densityComboBox->setCurrentIndex(0);
earthDensityLineEdit->setText(earth_model_density_filePointer->text(1));//earth model
//project-settings inversion-area
//ifs check which frames should be visible.
//output-volume
if(!area_from_surface_file_namePointer->text(1).isEmpty() || area_from_surface_snap_to_seismic_dataPointer->text(1)==QString("yes")){//area-from-surface
areaFileRadioButton->setChecked(true);
areaSurfaceLineEdit->setText(area_from_surface_file_namePointer->text(1));
surfaceSnapCheckBox->setChecked(StandardStrings::checkedBool(area_from_surface_snap_to_seismic_dataPointer->text(1)));
on_areaUtmRadioButton_toggled(false);
on_areaInCrossRadioButton_toggled(false);
}
else if(!utm_coordinates_reference_point_xPointer->text(1).isEmpty() || !utm_coordinates_reference_point_yPointer->text(1).isEmpty()
|| !utm_coordinates_length_xPointer->text(1).isEmpty() || !utm_coordinates_length_yPointer->text(1).isEmpty()
|| !utm_coordinates_sample_density_xPointer->text(1).isEmpty() || !utm_coordinates_sample_density_yPointer->text(1).isEmpty()
|| !utm_coordinates_anglePointer->text(1).isEmpty() || utm_coordinates_snap_to_seismic_dataPointer->text(1)==QString("yes")){//utm-coordinates
areaUtmRadioButton->setChecked(true);
on_areaInCrossRadioButton_toggled(false);
on_areaFileRadioButton_toggled(false);
areaXRefLineEdit->setText(utm_coordinates_reference_point_xPointer->text(1));
areaYRefLineEdit->setText(utm_coordinates_reference_point_yPointer->text(1));
areaXLengthLineEdit->setText(utm_coordinates_length_xPointer->text(1));
areaYLengthLineEdit->setText(utm_coordinates_length_yPointer->text(1));
areaXSampleDensityLineEdit->setText(utm_coordinates_sample_density_xPointer->text(1));
areaYSampleDensityLineEdit->setText(utm_coordinates_sample_density_yPointer->text(1));
areaUtmAngleLineEdit->setText(utm_coordinates_anglePointer->text(1));
utmSnapCheckBox->setChecked(StandardStrings::checkedBool(utm_coordinates_snap_to_seismic_dataPointer->text(1)));
}//inline-crossline-numbers
else if(!il_startPointer->text(1).isEmpty() || !il_endPointer->text(1).isEmpty()
|| !xl_startPointer->text(1).isEmpty() || !xl_endPointer->text(1).isEmpty()
|| !il_stepPointer->text(1).isEmpty() || !xl_stepPointer->text(1).isEmpty()){
areaInCrossRadioButton->setChecked(true);
on_areaFileRadioButton_toggled(false);
on_areaUtmRadioButton_toggled(false);
inlineStartLineEdit->setText(il_startPointer->text(1));
inlineEndLineEdit->setText(il_endPointer->text(1));
crosslineStartLineEdit->setText(xl_startPointer->text(1));
crosslineEndLineEdit->setText(xl_endPointer->text(1));
inlineStepLineEdit->setText(il_stepPointer->text(1));
crosslineStepLineEdit->setText(xl_stepPointer->text(1));
}
else {//default is to use area from seismic
areaSeismicRadioButton->setChecked(true);
}
//Everything in the output-tab
if((!forwardMode())&&(!estimationMode())){
toolBox->setVisible(true);
toolBox->setEnabled(true);
oDomainDepthCheckBox->setChecked(StandardStrings::checkedBool(grid_output_depthPointer->text(1)));//depth
oDomainTimeCheckBox->setChecked(StandardStrings::checkedBool(grid_output_timePointer->text(1),QString("yes")));//time
oSeismicOriginalCheckBox->setChecked(StandardStrings::checkedBool(seismic_data_originalPointer->text(1)));//original
oSeismicSyntheticCheckBox->setChecked(StandardStrings::checkedBool(seismic_data_syntheticPointer->text(1)));//synthetic
oSeismicResidualCheckBox->setChecked(StandardStrings::checkedBool(seismic_data_residualsPointer->text(1)));//residual
oSeismicFourierResidualCheckBox->setChecked(StandardStrings::checkedBool(seismic_data_synthetic_residualsPointer->text(1)));//synthetic residual
oVpCheckBox->setChecked(StandardStrings::checkedBool(elastic_parameters_vpPointer->text(1),QString("yes")));//vp
oVsCheckBox->setChecked(StandardStrings::checkedBool(elastic_parameters_vsPointer->text(1),QString("yes")));//vs
oDensityCheckBox->setChecked(StandardStrings::checkedBool(elastic_parameters_densityPointer->text(1),QString("yes")));//density
oLameLamCheckBox->setChecked(StandardStrings::checkedBool(elastic_parameters_lame_lambdaPointer->text(1)));//lame-lambda
oLameMuCheckBox->setChecked(StandardStrings::checkedBool(elastic_parameters_lame_muPointer->text(1)));//lame-mu
oPoissonRatioCheckBox->setChecked(StandardStrings::checkedBool(elastic_parameters_poisson_ratioPointer->text(1)));//poisson-ratio
oAiCheckBox->setChecked(StandardStrings::checkedBool(elastic_parameters_aiPointer->text(1)));//ai
oSiCheckBox->setChecked(StandardStrings::checkedBool(elastic_parameters_siPointer->text(1)));//si
oVpVsRatioCheckBox->setChecked(StandardStrings::checkedBool(elastic_parameters_vp_vs_ratioPointer->text(1)));//vp-vs-ratio
oLambdaRhoCheckBox->setChecked(StandardStrings::checkedBool(elastic_parameters_murhoPointer->text(1)));//murho
oMuRhoCheckBox->setChecked(StandardStrings::checkedBool(elastic_parameters_lambdarhoPointer->text(1)));//lambdarho
oBackgroundCheckBox->setChecked(StandardStrings::checkedBool(elastic_parameters_backgroundPointer->text(1)));//background
oBackgroundTrendCheckBox->setChecked(StandardStrings::checkedBool(elastic_parameters_background_trendPointer->text(1)));//background-trend
if(faciesProbabilitiesOn()){
oFaciesProbabilitiesCheckBox->setChecked(StandardStrings::checkedBool(grid_output_facies_probabilitiesPointer->text(1),QString("yes")));
oFaciesProbabilitiesUndefinedCheckBox->setChecked(StandardStrings::checkedBool(grid_output_facies_probabilities_with_undefPointer->text(1)));//facies-probabilities-with-undefined
oFaciesLikelihoodCheckBox->setChecked(StandardStrings::checkedBool(grid_output_facies_likelihoodPointer->text(1)));//facies-likelihood
oFaciesQualityGridCheckBox->setChecked(StandardStrings::checkedBool(grid_output_seismic_quality_gridPointer->text(1)));//seismic-quality grid
oRockPhysicsCheckBox->setChecked(StandardStrings::checkedBool(io_settings_rock_physics_distributionsPointer->text(1)));//rock-physics-distributions
}
else{
oFaciesProbabilitiesCheckBox->setVisible(false);
oFaciesProbabilitiesUndefinedCheckBox->setVisible(false);
oFaciesLikelihoodCheckBox->setVisible(false);
oFaciesQualityGridCheckBox->setVisible(false);
oRockPhysicsCheckBox->setVisible(false);
oFaciesProbabilitiesCheckBox->setEnabled(false);
oFaciesProbabilitiesUndefinedCheckBox->setEnabled(false);
oFaciesLikelihoodCheckBox->setEnabled(false);
oFaciesQualityGridCheckBox->setEnabled(false);
oRockPhysicsCheckBox->setEnabled(false);
}
oTimeDepthCheckBox->setChecked(StandardStrings::checkedBool(grid_output_time_to_depth_velocityPointer->text(1)));//time-to-depth-velocity
oExtraGridsCheckBox->setChecked(StandardStrings::checkedBool(grid_output_extra_gridsPointer->text(1)));//extra-grids
oCorrelationsCheckBox->setChecked(StandardStrings::checkedBool(grid_output_correlationsPointer->text(1)));//correlations
//well-output
oWellCheckBox->setChecked(StandardStrings::checkedBool(well_output_wellsPointer->text(1)));//wells
oBlockedWellCheckBox->setChecked(StandardStrings::checkedBool(well_output_blocked_wellsPointer->text(1)));//blocked-wells
//blocke-logs does nothing atm
//wavelet-output
oWaveletWellCheckBox->setChecked(StandardStrings::checkedBool(wavelet_output_well_waveletsPointer->text(1)));//well-wavelets
oWaveletGlobalCheckBox->setChecked(StandardStrings::checkedBool(wavelet_output_global_waveletsPointer->text(1)));//global-wavelets
oWaveletLocalCheckBox->setChecked(StandardStrings::checkedBool(wavelet_output_local_waveletsPointer->text(1)));//local-wavelets
//other-output
//extra surface...
oPriorCorrelationCheckBox->setChecked(StandardStrings::checkedBool(io_settings_prior_correlationsPointer->text(1)));//prior-correlations
oLocalNoiseCheckBox->setChecked(StandardStrings::checkedBool(io_settings_local_noisePointer->text(1)));//local-noise
}
else{
toolBox->setVisible(false);
toolBox->setEnabled(false);
}
oPrefixLineEdit->setText(io_settings_file_output_prefixPointer->text(1) );//file-output-prefix
oOutputDirectoryLineEdit->setText(top_directoryPointer->text(1)+output_directoryPointer->text(1));
necessaryFieldGui();
}
void Main_crava::on_aboutAction_triggered()
{
QMessageBox::about(this,QString("About"), QString("<h2>"+StandardStrings::cravaGuiVersion()+"</h2>"
"<p>Copyright © 2010 Statoil"
"<p>CRAVA GUI is a program that defines and edits xml files for running CRAVA in an intuitive and seamless way."
" It is written for " +StandardStrings::cravaVersion()+ "<p>The GUI is created using Qt and C++"
"<p>CRAVA (Condition Reservoir variables on Amplitude Versus Angle) is an seismic AVA inversion software. CRAVA is developed by "
"Norsk Regnesentral together with Statoil R&D."
"<pre>"
" This program is free software: you can redistribute it and/or modify <br>"
" it under the terms of the GNU General Public License as published by <br>"
" the Free Software Foundation, either version 3 of the License, or <br>"
" (at your option) any later version.<br><br>"