Update GUI editor if a new summary vector is set created

Make sure the user interface is updated when summary data is set from Python using summary_case.set_summary_values
This commit is contained in:
Magne Sjaastad 2024-03-21 11:29:59 +01:00
parent c1b44e0d51
commit 78759feb15

View File

@ -18,7 +18,6 @@
#include "RimcSummaryCase.h"
#include "RiaQDateTimeTools.h"
#include "RiaSummaryTools.h"
#include "RifSummaryReaderInterface.h"
@ -276,7 +275,27 @@ caf::PdmObjectHandle* RimSummaryCase_setSummaryVectorValues::execute()
auto* fileSummaryCase = dynamic_cast<RimFileSummaryCase*>( summaryCase );
if ( fileSummaryCase )
{
bool rebuildUserInterface = true;
if ( auto reader = fileSummaryCase->summaryReader() )
{
auto allAddr = reader->allResultAddresses();
for ( auto adr : allAddr )
{
if ( adr.uiText() == m_addressString().toStdString() )
{
rebuildUserInterface = false;
break;
}
}
}
fileSummaryCase->setSummaryData( m_addressString().toStdString(), m_unitString().toStdString(), m_values() );
if ( rebuildUserInterface )
{
fileSummaryCase->refreshMetaData();
}
}
return nullptr;