Python command for setting plot window size

This commit is contained in:
Gaute Lindkvist 2019-10-16 15:46:31 +02:00
parent 4dcdc2a1ee
commit 3eaf933efc
5 changed files with 23 additions and 4 deletions

View File

@ -16,6 +16,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicfReplaceSourceCases.h
${CMAKE_CURRENT_LIST_DIR}/RicfRunOctaveScript.h
${CMAKE_CURRENT_LIST_DIR}/RicfSetExportFolder.h
${CMAKE_CURRENT_LIST_DIR}/RicfSetMainWindowSize.h
${CMAKE_CURRENT_LIST_DIR}/RicfSetPlotWindowSize.h
${CMAKE_CURRENT_LIST_DIR}/RicfSetStartDir.h
${CMAKE_CURRENT_LIST_DIR}/RicfSetTimeStep.h
${CMAKE_CURRENT_LIST_DIR}/RicfScaleFractureTemplate.h
@ -56,6 +57,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicfReplaceSourceCases.cpp
${CMAKE_CURRENT_LIST_DIR}/RicfRunOctaveScript.cpp
${CMAKE_CURRENT_LIST_DIR}/RicfSetExportFolder.cpp
${CMAKE_CURRENT_LIST_DIR}/RicfSetMainWindowSize.cpp
${CMAKE_CURRENT_LIST_DIR}/RicfSetPlotWindowSize.cpp
${CMAKE_CURRENT_LIST_DIR}/RicfSetStartDir.cpp
${CMAKE_CURRENT_LIST_DIR}/RicfSetTimeStep.cpp
${CMAKE_CURRENT_LIST_DIR}/RicfScaleFractureTemplate.cpp

View File

@ -174,9 +174,11 @@ if (RESINSIGHT_GRPC_PYTHON_EXECUTABLE)
"rips/PythonExamples/command_example.py"
"rips/PythonExamples/case_grid_group.py"
"rips/PythonExamples/case_info_streaming_example.py"
"rips/PythonExamples/create_wbs_plot.py"
"rips/PythonExamples/export_plots.py"
"rips/PythonExamples/export_snapshots.py"
"rips/PythonExamples/error_handling.py"
"rips/PythonExamples/import_well_paths_and_logs.py"
"rips/PythonExamples/soil_porv_async.py"
"rips/PythonExamples/soil_porv_sync.py"
"rips/PythonExamples/selected_cases.py"

View File

@ -165,7 +165,7 @@ message RunOctaveScriptRequest
repeated int32 caseIds = 2;
}
message SetMainWindowSizeParams
message SetWindowSizeParams
{
int32 height = 1;
int32 width = 2;
@ -342,7 +342,7 @@ message CommandParams
ExportVisibleCellsRequest exportVisibleCells = 15;
SetExportFolderRequest setExportFolder = 16;
RunOctaveScriptRequest runOctaveScript = 17;
SetMainWindowSizeParams setMainWindowSize = 18;
SetWindowSizeParams setMainWindowSize = 18;
ComputeCaseGroupStatRequest computeCaseGroupStatistics = 19;
SetTimeStepParams setTimeStep = 20;
ScaleFractureTemplateRequest scaleFractureTemplate = 21;
@ -361,6 +361,7 @@ message CommandParams
ImportWellLogFilesRequest importWellLogFiles = 34;
ImportFormationNamesRequest importFormationNames = 35;
ExportWellLogPlotDataRequest exportWellLogPlotData = 36;
SetWindowSizeParams setPlotWindowSize = 37;
}
}

View File

@ -8,8 +8,10 @@ import rips
# Load instance
resinsight = rips.Instance.find()
# Set window size
# Set window sizes
resinsight.set_main_window_size(width=800, height=500)
resinsight.set_plot_window_size(width=1000, height=1000)
# Retrieve first case
case = resinsight.project.cases()[0]

View File

@ -253,7 +253,19 @@ class Instance:
width | Width in pixels | Integer
height | Height in pixels | Integer
"""
return self.__execute_command(setMainWindowSize=Cmd.SetMainWindowSizeParams(
return self.__execute_command(setMainWindowSize=Cmd.SetWindowSizeParams(
width=width, height=height))
def set_plot_window_size(self, width, height):
"""
Set the plot window size in pixels
Parameter | Description | Type
--------- | ---------------- | -----
width | Width in pixels | Integer
height | Height in pixels | Integer
"""
return self.__execute_command(setPlotWindowSize=Cmd.SetWindowSizeParams(
width=width, height=height))
def major_version(self):