mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-25 22:50:25 -05:00
Snapshot work in progress
This commit is contained in:
1 parent
361b4bc3db
commit
52df6fd283
20 files changed
+103
-89
No files matched your search
@@ -55,6 +55,8 @@ message ExportSnapshotsRequest {
|
||||
int32 viewId = 4;
|
||||
string exportFolder = 5;
|
||||
PlotOutputFormat plotOutputFormat = 6;
|
||||
int32 width = 7;
|
||||
int32 height = 8;
|
||||
}
|
||||
|
||||
message ExportPropertyRequest {
|
||||
|
||||
@@ -15,7 +15,7 @@ export_folder = tempfile.mkdtemp()
|
||||
print("Exporting to: " + export_folder)
|
||||
|
||||
for plot in plots:
|
||||
plot.export_snapshot(export_folder=export_folder)
|
||||
plot.export_snapshot(export_folder=export_folder, width=1024, height=768)
|
||||
plot.export_snapshot(export_folder=export_folder, output_format="PDF")
|
||||
if isinstance(plot, rips.WellLogPlot):
|
||||
plot.export_data_as_las(export_folder=export_folder)
|
||||
|
||||
@@ -10,7 +10,7 @@ resinsight = rips.Instance.find()
|
||||
cases = resinsight.project.cases()
|
||||
|
||||
# Set main window size
|
||||
resinsight.set_main_window_size(width=800, height=500)
|
||||
# resinsight.set_main_window_size(width=1280, height=900)
|
||||
|
||||
n = 5 # every n-th time_step for snapshot
|
||||
property_list = ["SOIL", "PRESSURE"] # list of parameter for snapshot
|
||||
@@ -42,4 +42,4 @@ for case in cases:
|
||||
)
|
||||
for time_step in range(0, len(time_steps), 10):
|
||||
view.set_time_step(time_step=time_step)
|
||||
view.export_snapshot()
|
||||
view.export_snapshot(width=1024, height=768)
|
||||
@@ -9,13 +9,15 @@ from .resinsight_classes import PlotWindow as PlotWindow, Plot as Plot
|
||||
|
||||
|
||||
@add_method(PlotWindow)
|
||||
def export_snapshot(self, export_folder="", file_prefix="", output_format="PNG"):
|
||||
def export_snapshot(self, export_folder="", file_prefix="", output_format="PNG", width=-1, height=-1):
|
||||
"""Export snapshot for the current plot
|
||||
|
||||
Arguments:
|
||||
export_folder(str): The path to export to. By default will use the global export folder
|
||||
prefix (str): Exported file name prefix
|
||||
output_format(str): Enum string. Can be 'PNG' or 'PDF'.
|
||||
width (int): The width of the exported snapshot. By default will use the existing size.
|
||||
height (int): The height of the exported snapshot. By default will use the existing size.
|
||||
|
||||
"""
|
||||
return self._execute_command(
|
||||
@@ -25,5 +27,7 @@ def export_snapshot(self, export_folder="", file_prefix="", output_format="PNG")
|
||||
viewId=self.id,
|
||||
exportFolder=export_folder,
|
||||
plotOutputFormat=output_format,
|
||||
width=width,
|
||||
height=height,
|
||||
)
|
||||
)
|
||||
@@ -245,7 +245,7 @@ def visible_cells(self, time_step=0):
|
||||
|
||||
|
||||
@add_method(ViewWindow)
|
||||
def export_snapshot(self, prefix="", export_folder=""):
|
||||
def export_snapshot(self, prefix="", export_folder="", width=-1, height=-1):
|
||||
"""Export snapshot for the current view
|
||||
|
||||
Arguments:
|
||||
@@ -260,5 +260,7 @@ def export_snapshot(self, prefix="", export_folder=""):
|
||||
caseId=case_id,
|
||||
viewId=self.id,
|
||||
exportFolder=export_folder,
|
||||
width=width,
|
||||
height=height
|
||||
)
|
||||
)
|
||||
Reference in new issue
Block a user