mirror of
https://github.com/OPM/ResInsight.git
synced 2026-09-03 20:53:13 -05:00
First implementation of Headless (#4392)
* Revert "#4377 Octave : Use RiaLogging for error messages instead of QErrorMessage " This reverts commitf758a8edb2. * Revert "#4380 Preferences : Changing scene font size when geo mech view is open causes crash" This reverts commitdf62a41397. * Revert "#4379 Documentation : Update command line parser for import of summary files" This reverts commitd0b5357ed4. * 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 fixdf62a41397by @magnesj on top of Headless code changes * #4379 Reintroduce kode fromd0b5357ed4by @magnesj * #4377 Restoref758a8edb2in new Headless code
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user