else: self.parent=None
- self.labels=("OpenTURNS_path","rep_user","INSTALLDIR","path_doc","exec_acrobat","rep_cata","initialdir","savedir")
+ self.labels_user=('exec_acrobat', 'catalogues','savedir','path_doc','OpenTURNS_path')
+ self.labels_eficas=("OpenTURNS_path","rep_user","INSTALLDIR","path_doc","exec_acrobat","rep_cata","initialdir","savedir","catalogues")
+ #self.labels=("OpenTURNS_path","rep_user","INSTALLDIR","path_doc","exec_acrobat","rep_cata","initialdir","savedir")
# Valeurs par defaut
self.rep_user = os.path.join(os.environ['HOME'],'.Eficas_Openturns')
name='prefs_'+prefs.code
prefsCode=__import__(name)
self.prefsUser=name+".py"
- for k in self.labels :
+ for k in self.labels_eficas :
try :
valeur=getattr(prefsCode,k)
setattr(self,k,valeur)
QMessageBox.critical( None, "Import du fichier de Configuration",
"Erreur à la lecture du fichier de configuration " + self.fic_ini_utilisateur )
sys.exit(0)
- for k in self.labels :
+ for k in self.labels_user :
try :
setattr(self,k,d[k])
except :
# sauvegarde
# les nouveaux paramètres dans le fichier de configuration utilisateur
#
- print "a ecrire PNPNPN"
+ texte=""
+ for clef in self.labels_user :
+ if hasattr(self,clef):
+ valeur=getattr(self,clef)
+ texte= texte + clef+" = " + repr(valeur) +"\n"
+ f=open(self.fic_ini_utilisateur,'w+')
+ print self.fic_ini_utilisateur
+ f.write(texte)
+ f.close()
+# print "a ecrire PNPNPN"
# l_param=('exec_acrobat', 'repIni','catalogues','rep_travail','rep_mat','path_doc')
# texte=""
# for clef in l_param :
'''
txt = "# Definit la copule de la loi jointe\n"
- if ( self.DictMCVal.has_key( 'Copula' ) ):
- if ( self.DictMCVal[ 'Copula' ] in ( 'Independent', ) ):
- txt += "%s = IndependentCopula( %s )\n" % (self.variable["copula"], self.variable["n"])
- elif ( self.DictMCVal[ 'Copula' ] in ( 'Normal', ) ):
- varList = self.DictMCVal[ 'CorrelationMatrix' ][0]
- dimension = len(varList)
- txt += "%s = {}\n" % self.variable["correlation"]
- for i in range( dimension ):
- txt += "%s['%s'] = {}\n" % (self.variable["correlation"], varList[i])
- for j in range ( dimension ):
- txt += "%s['%s']['%s'] = %g\n" % (self.variable["correlation"], varList[i], varList[j], self.DictMCVal[ 'CorrelationMatrix' ][i+1][j])
- txt += "%s = getCorrelationMatrixFromMap( %s.getVariableList(), %s )\n" % (self.variable["R"], self.variable["wrapperdata"], self.variable["correlation"])
- txt += "%s = NormalCopula( %s )\n" % (self.variable["copula"], self.variable["R"])
+ if ( not self.DictMCVal.has_key( 'Copula' ) ):
+ self.DictMCVal[ 'Copula' ] = 'Independent'
+
+ if ( self.DictMCVal[ 'Copula' ] in ( 'Independent', ) ):
+ txt += "%s = IndependentCopula( %s )\n" % (self.variable["copula"], self.variable["n"])
+ elif ( self.DictMCVal[ 'Copula' ] in ( 'Normal', ) ):
+ varList = self.DictMCVal[ 'CorrelationMatrix' ][0]
+ dimension = len(varList)
+ txt += "%s = {}\n" % self.variable["correlation"]
+ for i in range( dimension ):
+ txt += "%s['%s'] = {}\n" % (self.variable["correlation"], varList[i])
+ for j in range ( dimension ):
+ txt += "%s['%s']['%s'] = %g\n" % (self.variable["correlation"], varList[i], varList[j], self.DictMCVal[ 'CorrelationMatrix' ][i+1][j])
+ txt += "%s = getCorrelationMatrixFromMap( %s.getVariableList(), %s )\n" % (self.variable["R"], self.variable["wrapperdata"], self.variable["correlation"])
+ txt += "%s = NormalCopula( %s )\n" % (self.variable["copula"], self.variable["R"])
txt += "\n"
return txt
"""
Les paramètres sont transcrits sous la forme d'un dictionnaire nom=valeur.
"""
- from Sous_epaisseur import properties
+ from Sep import properties
self.texteTubePy="# -*- coding: utf-8 -*-\n"
self.texteTubePy+="# ======================================================================================\n"
self.texteTubePy+="# FICHIER GENERE PAR EFICAS - OUTIL MÉTIER SOUS-EPAISSEUR - "