#%====================Stage4: Opening a new study and Med file import====================%
-print "**** Stage4: Opening a new study and Med file import"
+# Opening a new study tempoparily commented due to a problem
+# with python initialization. To be restored after bug 10000 fixing.
-print "Creating a new study..................",
-newStudy = salome.myStudyManager.NewStudy('newStudy')
-myVisu.SetCurrentStudy(newStudy)
+#print "**** Stage4: Opening a new study and Med file import"
+print "**** Stage4: Med file import"
+
+#print "Creating a new study..................",
+#newStudy = salome.myStudyManager.NewStudy('newStudy')
+newStudy = salome.myStudy # temporarily
+#myVisu.SetCurrentStudy(newStudy)
myViewManager = myVisu.GetViewManager()
myView = myViewManager.Create3DView()
if myView is None : print "Error"
salome.myStudyManager.SaveAs(file, salome.myStudy, 0)
study_id = salome.myStudy._get_StudyId()
-#salome.sg.CloseStudy(study_id)
-#salome.myStudyManager.Close(salome.myStudy)
-#salome.myStudy.Close()
print "OK"
-print "Opening just saved study..............",
+file_new = str+'/VISU_005_new.hdf'
+command = "mv " + file + " " + file_new
+os.system(command)
+file = file_new
-openedStudy = salome.myStudyManager.Open(file)
-myVisu.SetCurrentStudy(openedStudy)
+# Opening a study tempoparily commented due to a problem
+# with python initialization. To be restored after bug 10000 fixing.
+
+#print "Opening just saved study..............",
+#
+#openedStudy = salome.myStudyManager.Open(file)]
+openedStudy = salome.myStudy # temporarily
+#myVisu.SetCurrentStudy(openedStudy)
myViewManager = myVisu.GetViewManager()
myView1 = myViewManager.Create3DView()
if myView1 is None : print "Error"
else : print "OK"
+import time
+time.sleep(1)
+
print "Restoring first view parameters.......",
aRestoreRes = myView1.RestoreViewParams(aViewParamsName1)
if aRestoreRes != 1 : print "Error"
else : print "OK"
Builder = openedStudy.NewBuilder()
-SCom = openedStudy.FindComponent("VISU")
-Builder.LoadWith(SCom ,myVisu)
+#SCom = openedStudy.FindComponent("VISU")
+#Builder.LoadWith(SCom ,myVisu)
print "Displaying Scalar Map.................",
SObj = openedStudy.FindObject('ScalarMap')
if aRestoreRes != 1 : print "Error"
else : print "OK"
+# Remove the study file
+command = "rm -r " + file
+os.system(command)