Skip to content

Commit

Permalink
Update GUI editor if a new summary vector is set created
Browse files Browse the repository at this point in the history
Make sure the user interface is updated when summary data is set from Python using summary_case.set_summary_values
  • Loading branch information
magnesj committed Mar 21, 2024
1 parent c7211a7 commit db9733d
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion ApplicationLibCode/ProjectDataModelCommands/RimcSummaryCase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

#include "RimcSummaryCase.h"

#include "RiaQDateTimeTools.h"
#include "RiaSummaryTools.h"

#include "RifSummaryReaderInterface.h"
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit db9733d

Please sign in to comment.