#4423 Improve API for setting cell results

This commit is contained in:
Gaute Lindkvist
2019-07-15 11:43:39 +02:00
parent b7c4a54d9a
commit dcd3ff6754
7 changed files with 93 additions and 12 deletions

View File

@@ -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()