#4736 System python command refactor (#4743)

* Move case loading commands from Commands to project and case
* Major refactor
* Fix problems with Python examples
* Add ability to export snapshot from just one view + fixup
* Case comments and black
* Make all modules pass pylint test
This commit is contained in:
Gaute Lindkvist
2019-09-23 11:50:33 +02:00
committed by GitHub
parent 00eb02ccec
commit a2bad82391
54 changed files with 1753 additions and 1432 deletions

View File

@@ -35,6 +35,7 @@ CAF_PDM_SOURCE_INIT( RicfSetTimeStep, "setTimeStep" );
RicfSetTimeStep::RicfSetTimeStep()
{
RICF_InitField( &m_caseId, "caseId", -1, "Case ID", "", "", "" );
RICF_InitField( &m_viewId, "viewId", -1, "View ID", "", "", "" );
RICF_InitField( &m_timeStepIndex, "timeStep", -1, "Time Step Index", "", "", "" );
}
@@ -46,6 +47,14 @@ void RicfSetTimeStep::setCaseId( int caseId )
m_caseId = caseId;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicfSetTimeStep::setViewId( int viewId )
{
m_viewId = viewId;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -93,8 +102,11 @@ RicfCommandResponse RicfSetTimeStep::execute()
for ( Rim3dView* view : eclipseCase->views() )
{
view->setCurrentTimeStepAndUpdate( m_timeStepIndex );
view->createDisplayModelAndRedraw();
if ( m_viewId() == -1 || view->id() == m_viewId() )
{
view->setCurrentTimeStepAndUpdate( m_timeStepIndex );
view->createDisplayModelAndRedraw();
}
}
return RicfCommandResponse();