mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4423 Improve API for setting cell results
This commit is contained in:
@@ -24,20 +24,23 @@ if resInsight is not None:
|
||||
|
||||
for keyword in resInsight.project.keywords():
|
||||
print (keyword + ": " + resInsight.project.getValue(keyword))
|
||||
pdmViews = resInsight.project.descendants(classKeyword="ReservoirView")
|
||||
pdmViews = resInsight.project.views()
|
||||
for view in pdmViews:
|
||||
print ("\n####View####")
|
||||
print(view.classKeyword(), view.address())
|
||||
for viewKeyword in view.keywords():
|
||||
print(viewKeyword + "-> " + str(view.getValue(viewKeyword)))
|
||||
view.setValue("ShowGridBox", not view.getValue("ShowGridBox"))
|
||||
view.setValue("ViewBackgroundColor", "#3388AA")
|
||||
view.setShowGridBox(not view.showGridBox())
|
||||
view.setBackgroundColor("#3388AA")
|
||||
view.update()
|
||||
|
||||
print ("\n####Cell Result####")
|
||||
cellResults = view.children(classKeyword="ResultSlot")
|
||||
for resultKeyword in cellResults[0].keywords():
|
||||
print(resultKeyword + "->" + str(cellResults[0].getValue(resultKeyword)))
|
||||
cellResults[0].setValue("ResultVariable", "SOIL")
|
||||
cellResults[0].setValue("ResultType", "DYNAMIC_NATIVE")
|
||||
cellResults[0].update()
|
||||
print ("\n####Cell Result####")
|
||||
firstView = case.view(id=0)
|
||||
assert(firstView is not None)
|
||||
cellResult = firstView.cellResult()
|
||||
print(cellResult.classKeyword(), cellResult.address())
|
||||
for resultKeyword in cellResult.keywords():
|
||||
print(resultKeyword + "->" + str(cellResult.getValue(resultKeyword)))
|
||||
cellResult.setValue("ResultVariable", "SOIL")
|
||||
cellResult.setValue("ResultType", "DYNAMIC_NATIVE")
|
||||
cellResult.update()
|
||||
Reference in New Issue
Block a user