First implementation of Headless (#4392)

* Revert "#4377 Octave : Use RiaLogging for error messages instead of QErrorMessage "

This reverts commit f758a8edb2.

* Revert "#4380 Preferences : Changing scene font size when geo mech view is open causes crash"

This reverts commit df62a41397.

* Revert "#4379 Documentation : Update command line parser for import of summary files"

This reverts commit d0b5357ed4.

* Unfinished WIP

* Builds but crashes

* Refactored code now builds and runs

* ResInsight can now run the unittests headless

* Can run some command files successfully

* Build on Linux

* Extra headless hack header

* Moved PdmUiItem hack to cpp file

* Fix headless crash in RimWellAllocationPlot

* Handle error gracefully if ExportSnapshots command is executed from console

* Add caf::QIconProvider and remove some hacks

* Also made the greying out of disabled icons work for a couple of cases where it didn't.

* Linux build fix

* #4380 Reimplement fix df62a41397 by @magnesj on top of Headless code changes

* #4379 Reintroduce kode from d0b5357ed4 by @magnesj

* #4377 Restore f758a8edb2 in new Headless code
This commit is contained in:
Gaute Lindkvist
2019-05-06 10:36:05 +02:00
committed by GitHub
parent 4c46573fc9
commit 57b33b0d4c
150 changed files with 4001 additions and 2804 deletions
@@ -116,7 +116,6 @@ Rim3dOverlayInfoConfig::Rim3dOverlayInfoConfig()
m_isVisCellStatUpToDate = false;
m_gridStatisticsDialog = std::unique_ptr<RicGridStatisticsDialog>(new RicGridStatisticsDialog(nullptr));
}
//--------------------------------------------------------------------------------------------------
@@ -228,14 +227,27 @@ QString Rim3dOverlayInfoConfig::resultInfoText(const HistogramData& histData)
return "";
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RicGridStatisticsDialog* Rim3dOverlayInfoConfig::getOrCreateGridStatisticsDialog()
{
if (!m_gridStatisticsDialog)
{
m_gridStatisticsDialog.reset(new RicGridStatisticsDialog(nullptr));
}
CVF_ASSERT(m_gridStatisticsDialog);
return m_gridStatisticsDialog.get();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QImage Rim3dOverlayInfoConfig::statisticsDialogScreenShotImage()
{
if (m_gridStatisticsDialog->isVisible())
if (getOrCreateGridStatisticsDialog()->isVisible())
{
return m_gridStatisticsDialog->screenShotImage();
return getOrCreateGridStatisticsDialog()->screenShotImage();
}
return QImage();
}
@@ -862,16 +874,17 @@ void Rim3dOverlayInfoConfig::showStatisticsInfoDialog(bool raise)
{
if (m_viewDef)
{
RicGridStatisticsDialog* dialog = getOrCreateGridStatisticsDialog();
// Show dialog before setting data due to text edit auto height setting
m_gridStatisticsDialog->resize(600, 800);
m_gridStatisticsDialog->show();
dialog->resize(600, 800);
dialog->show();
m_gridStatisticsDialog->setLabel("Grid statistics");
m_gridStatisticsDialog->updateFromRimView(m_viewDef);
dialog->setLabel("Grid statistics");
dialog->updateFromRimView(m_viewDef);
if (raise)
{
m_gridStatisticsDialog->raise();
dialog->raise();
}
}
}
@@ -916,7 +929,7 @@ void Rim3dOverlayInfoConfig::update3DInfo()
updateEclipse3DInfo(reservoirView);
// Update statistics dialog
m_gridStatisticsDialog->updateFromRimView(reservoirView);
getOrCreateGridStatisticsDialog()->updateFromRimView(reservoirView);
}
RimGeoMechView* geoMechView = dynamic_cast<RimGeoMechView*>(m_viewDef.p());
@@ -927,7 +940,7 @@ void Rim3dOverlayInfoConfig::update3DInfo()
updateGeoMech3DInfo(geoMechView);
// Update statistics dialog
m_gridStatisticsDialog->updateFromRimView(geoMechView);
getOrCreateGridStatisticsDialog()->updateFromRimView(geoMechView);
}
update3DInfoIn2dViews();