Salome HOME
Updated copyright comment
[modules/med.git] / src / MEDCalc / tui / medevents.py
index 2e17a37100f72789bad4db8f17573d8b4490aa74..e7727e86eefb8bb9360a0d02370357ee12eda95b 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2015-2016  CEA/DEN, EDF R&D
+# Copyright (C) 2015-2024  CEA, EDF
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -36,16 +36,16 @@ def connectEventListener():
   try:
     eventListenerIOR = dataManager.getEventListenerIOR()
     __eventListener = salome.orb.string_to_object(eventListenerIOR)
   try:
     eventListenerIOR = dataManager.getEventListenerIOR()
     __eventListener = salome.orb.string_to_object(eventListenerIOR)
-  except SALOME.SALOME_Exception, e:
+  except SALOME.SALOME_Exception as e:
     medcalc.wrn("The event listener is not running yet")
     msg ="When you'll have loaded the MED GUI, "
     medcalc.wrn("The event listener is not running yet")
     msg ="When you'll have loaded the MED GUI, "
-    msg+="call explicitely \"medcalc.medevents.connectEventListener()\" "
+    msg+="call explicitly \"medcalc.medevents.connectEventListener()\" "
     msg+="to connect the GUI event listener"
     medcalc.inf(msg)
     __eventListener = None
     msg+="to connect the GUI event listener"
     medcalc.inf(msg)
     __eventListener = None
-  except Exception, e:
+  except Exception as e:
     medcalc.err("An unknown error occurs. Check if this ior=%s is valid."%eventListenerIOR)
     medcalc.err("An unknown error occurs. Check if this ior=%s is valid."%eventListenerIOR)
-    print e
+    print(e)
 #
 
 def eventListenerIsRunning():
 #
 
 def eventListenerIsRunning():
@@ -56,7 +56,7 @@ def eventListenerIsRunning():
   # Try to define the event listener
   connectEventListener()
   if __eventListener is None:
   # Try to define the event listener
   connectEventListener()
   if __eventListener is None:
-    # it definitly does not work
+    # it definitely does not work
     medcalc.wrn("the GUI is not loaded yet and will not be notified of the modification")
     return False
 
     medcalc.wrn("the GUI is not loaded yet and will not be notified of the modification")
     return False
 
@@ -118,14 +118,23 @@ def notifyGui_addPresentation(fieldId, presId):
 def notifyGui_removePresentation(presId):
   __notifyGui(MEDCALC.EVENT_REMOVE_PRESENTATION, presentationId=presId)
 #
 def notifyGui_removePresentation(presId):
   __notifyGui(MEDCALC.EVENT_REMOVE_PRESENTATION, presentationId=presId)
 #
+def notifyGui_modifyPresentation(presId):
+  __notifyGui(MEDCALC.EVENT_MODIFY_PRESENTATION, presentationId=presId)
+#
+def notifyGui_visibilityChanged(presId):
+  __notifyGui(MEDCALC.EVENT_VISIBILITY_CHANGED, presentationId=presId)
+
 def notifyGui_playQtTestingScenario(filename):
   __notifyGui(MEDCALC.EVENT_PLAY_TEST, filename=filename)
 #
 def notifyGui_termination():
   __notifyGui(MEDCALC.EVENT_QUIT_SALOME)
 def notifyGui_playQtTestingScenario(filename):
   __notifyGui(MEDCALC.EVENT_PLAY_TEST, filename=filename)
 #
 def notifyGui_termination():
   __notifyGui(MEDCALC.EVENT_QUIT_SALOME)
-  
+
 def notifyGui_error(msg):
   __notifyGui(MEDCALC.EVENT_ERROR, msg=msg)
 def notifyGui_error(msg):
   __notifyGui(MEDCALC.EVENT_ERROR, msg=msg)
-  
-def notifyGui_modifyPresentation(presId):
-  __notifyGui(MEDCALC.EVENT_MODIFY_PRESENTATION, presentationId=presId)
+
+def notifyGui_changeUnderlyingMesh(fieldId):
+  __notifyGui(MEDCALC.EVENT_CHANGE_UNDERLYING_MESH, dataId=fieldId)
+
+def notifyGui_interpolateField(fieldId):
+  __notifyGui(MEDCALC.EVENT_INTERPOLATE_FIELD, dataId=fieldId)