Salome HOME
CCAR: mise en coherence de Build_sd de mACRO_ETAPE avec celle de ETAPE
[tools/eficas.git] / Ihm / I_MCSIMP.py
index 840c5934c69b6617ae273bbcda34f514132d1990..ca1bafa3822235bdb54327d4b8200bdbabcc4a1e 100644 (file)
@@ -1,3 +1,22 @@
+#            CONFIGURATION MANAGEMENT OF EDF VERSION
+# ======================================================================
+# COPYRIGHT (C) 1991 - 2002  EDF R&D                  WWW.CODE-ASTER.ORG
+# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
+# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
+# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR
+# (AT YOUR OPTION) ANY LATER VERSION.
+#
+# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT
+# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF
+# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU
+# GENERAL PUBLIC LICENSE FOR MORE DETAILS.
+#
+# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE
+# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER,
+#    1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE.
+#
+#
+# ======================================================================
 import types,string
 import traceback
 from copy import copy
@@ -34,13 +53,17 @@ class MCSIMP(I_OBJECT.OBJECT):
     if self.valeur == None : 
       return None
     elif type(self.valeur) == types.FloatType : 
-      txt = repr_float(self.valeur)
+      #txt = repr_float(self.valeur)
+      # Normalement str fait un travail correct
+      txt = str(self.valeur)
     elif type(self.valeur) in (types.ListType,types.TupleType) :
       txt='('
       i=0
       for val in self.valeur:
         if type(val) == types.FloatType : 
-           txt=txt + i*',' + repr_float(val)
+           # Normalement str fait un travail correct
+           #txt=txt + i*',' + repr_float(val)
+           txt=txt + i*',' + str(val)
         elif type(val) == types.InstanceType and isinstance(val,ASSD): 
            txt = txt + i*',' + val.get_name()
         else: 
@@ -54,8 +77,16 @@ class MCSIMP(I_OBJECT.OBJECT):
         if isinstance(txt,parametre.PARAMETRE):
           return str(txt)
       return repr(txt)
-    # il faut tronquer txt au delà d'un certain nombre de caractères
-    # et avant tout retour chariot (txt peut être une chaîne de caractères
+    # txt peut etre une longue chaine sur plusieurs lignes.
+    # Il est possible de tronquer cette chaine au premier \n et 
+    # de limiter la longueur de la chaine a 30 caracteres. Cependant
+    # ceci provoque une perte d'information pour l'utilisateur
+    # Pour le moment on retourne la chaine telle que
+    return txt
+
+    # Partie de code inaccessible (pour memoire)
+    # txt est tronquee au dela d'un certain nombre de caractères
+    # et avant tout retour chariot (txt peut etre une chaine de caractères
     # sur plusieurs lignes (ex:shell)
     txt = string.split(txt,'\n')[0]
     if len(txt) < 30 :
@@ -348,7 +379,18 @@ class MCSIMP(I_OBJECT.OBJECT):
              self.init_modif()
  
  
+  def get_min_max(self):
+     """
+     Retourne les valeurs min et max admissibles pour la valeur de self
+     """
+     return self.definition.min,self.definition.max
+
+
+  def get_type(self):
+     """
+     Retourne le type attendu par le mot-clé simple
+     """
+     return self.definition.type