From: Pascale Noyret Date: Fri, 19 Jun 2009 07:58:22 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: V1_16a5~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=37a3d538435646cce28835b5ce0c880ebf763f9f;p=tools%2Feficas.git *** empty log message *** --- diff --git a/InterfaceQT4/browser.py b/InterfaceQT4/browser.py index d4914409..785633a0 100644 --- a/InterfaceQT4/browser.py +++ b/InterfaceQT4/browser.py @@ -134,6 +134,7 @@ class JDCNode(QTreeWidgetItem): ind=ind+1 def affichePanneau(self) : + print self if self.item.isactif(): panel=self.getPanel() else: diff --git a/InterfaceQT4/componiveau.py b/InterfaceQT4/componiveau.py index 02743c71..3b9539b0 100644 --- a/InterfaceQT4/componiveau.py +++ b/InterfaceQT4/componiveau.py @@ -5,7 +5,14 @@ from Extensions import commentaire import browser class Node(browser.JDCNode): - pass + + def getPanel(self): + from monRacinePanel import MonRacinePanel + return MonRacinePanel(self,parent=self.editor) + + + def createPopUpMenu(self): + typeNode.PopUpMenuNode.createPopUpMenu(self) class NIVEAUTreeItem(Objecttreeitem.ObjectTreeItem): itemNode=Node @@ -22,11 +29,7 @@ class NIVEAUTreeItem(Objecttreeitem.ObjectTreeItem): - la fonte dans laquelle afficher ce texte - la couleur du texte """ - if self.isactif(): - fonte = Fonte_Niveau - else : - fonte = Fonte_Niveau_inactif - return self.labeltext,fonte,'#00008b' + return self.labeltext,None,None def GetIconName(self): if self.isactif(): diff --git a/InterfaceQT4/editor.py b/InterfaceQT4/editor.py index 57071890..0e885a69 100644 --- a/InterfaceQT4/editor.py +++ b/InterfaceQT4/editor.py @@ -74,7 +74,9 @@ class JDCEditor(QSplitter): self.liste_simp_reel=[] self.ihm="QT" - import configuration + import prefs + nameConf='configuration_'+prefs.code + configuration=__import__(nameConf) self.CONFIGURATION = self.appliEficas.CONFIGURATION self.CONFIGStyle = self.appliEficas.CONFIGStyle @@ -93,10 +95,12 @@ class JDCEditor(QSplitter): if not hasattr( readercata, 'reader' ) : readercata.reader = readercata.READERCATA( self, self.appliEficas ) self.readercata = readercata.reader + self.Commandes_Ordre_Catalogue =self.readercata.Commandes_Ordre_Catalogue #------- construction du jdc -------------- jdc_item = None + self.mode_nouv_commande=self.readercata.mode_nouv_commande nouveau=0 if self.fichier is not None: # fichier jdc fourni @@ -494,6 +498,12 @@ class JDCEditor(QSplitter): return "" + #-----------------------------------------# + def cherche_Groupes(self): + liste=self.get_text_JDC("GroupMA") + return liste + #-----------------------------------------# + #-----------------------------------------# def saveFile(self, path = None, saveas= 0): #-----------------------------------------# @@ -571,16 +581,16 @@ class JDCEditor(QSplitter): pass - #try : - if 1 : + try : + #if 1 : self.tubePy=self.generator.getTubePy() fileTube = '/tmp/tube.py' if self.tubePy != '' : f=open(fileTube,'w') f.write(self.tubePy) f.close() - #except : - else : + except : + #else : pass if self.salome : @@ -648,7 +658,10 @@ class JDCEditor(QSplitter): if __name__=='__main__': import prefs # dans main - if hasattr(prefs,'encoding'): + name='prefs_'+prefs.code + prefsCode=__import__(name) + + if hasattr(prefsCode,'encoding'): # Hack pour changer le codage par defaut des strings import sys reload(sys) diff --git a/InterfaceQT4/eficas_go.py b/InterfaceQT4/eficas_go.py index d4e0c6f1..1b2168c6 100644 --- a/InterfaceQT4/eficas_go.py +++ b/InterfaceQT4/eficas_go.py @@ -64,5 +64,5 @@ def lance_eficas_ssIhm(code=None,fichier=None): readercata = READERCATA( parent, Eficas ) from editor import JDCEditor - monEditeur=JDCEditor(Eficas,"/home/noyret/Eficas_Aster/zz.comm") - print monEditeur.jdc.cherche_Groupes() + monEditeur=JDCEditor(Eficas,fichier) + print monEditeur.cherche_Groupes() diff --git a/InterfaceQT4/monCommandePanel.py b/InterfaceQT4/monCommandePanel.py index 69637804..210ffe59 100644 --- a/InterfaceQT4/monCommandePanel.py +++ b/InterfaceQT4/monCommandePanel.py @@ -71,8 +71,8 @@ class MonCommandePanel(DComm,QTPanelTBW1,QTPanelTBW2,QTPanelTBW3): self.connect(self.LEFiltre,SIGNAL("returnPressed()"),self.LEfiltreReturnPressed) self.connect(self.bOk,SIGNAL("clicked()"),self.BOkPressed) self.connect(self.LENomConcept,SIGNAL("returnPressed()"),self.LENomConceptReturnPressed) - self.connect(self.RBGroupe,SIGNAL("clicked()"),self.BuildTabCommand) - self.connect(self.RBalpha,SIGNAL("clicked()"),self.BuildTabCommand) + self.connect(self.RBGroupe,SIGNAL("clicked()"),self.BuildTabCommandChanged) + self.connect(self.RBalpha,SIGNAL("clicked()"),self.BuildTabCommandChanged) self.connect(self.BNext,SIGNAL("pressed()"),self.BNextPressed) def BOkPressed(self): @@ -81,8 +81,8 @@ class MonCommandePanel(DComm,QTPanelTBW1,QTPanelTBW2,QTPanelTBW3): def BNextPressed(self): QTPanelTBW2.BNextPressed(self) - def BuildTabCommand(self): - QTPanelTBW2.BuildLBNouvCommande(self) + def BuildTabCommandChanged(self): + QTPanelTBW2.BuildLBNouvCommandChanged(self) def LEFiltreTextChanged(self): QTPanelTBW2.LEFiltreTextChanged(self) diff --git a/InterfaceQT4/monCommentairePanel.py b/InterfaceQT4/monCommentairePanel.py index 9d78ac3d..4bb85c4e 100644 --- a/InterfaceQT4/monCommentairePanel.py +++ b/InterfaceQT4/monCommentairePanel.py @@ -70,8 +70,8 @@ class MonCommentairePanel(DComment,QTPanelTBW2,QTPanel): self.connect(self.LEFiltre,SIGNAL("textChanged(const QString&)"),self.LEFiltreTextChanged) self.connect(self.LEFiltre,SIGNAL("returnPressed()"),self.LEfiltreReturnPressed) self.connect(self.bOk,SIGNAL("clicked()"),self.BOkPressed) - self.connect(self.RBGroupe,SIGNAL("clicked()"),self.BuildTabCommand) - self.connect(self.RBalpha,SIGNAL("clicked()"),self.BuildTabCommand) + self.connect(self.RBGroupe,SIGNAL("clicked()"),self.BuildTabCommandChanged) + self.connect(self.RBalpha,SIGNAL("clicked()"),self.BuildTabCommandChanged) self.connect(self.BNext,SIGNAL("pressed()"),self.BNextPressed) self.connect(self.textCommentaire,SIGNAL("textChanged()"),self.TexteCommentaireEntre) @@ -85,9 +85,6 @@ class MonCommentairePanel(DComment,QTPanelTBW2,QTPanel): self.node.item.set_valeur(texte) self.node.onValid() - def BuildTabCommand(self): - QTPanelTBW2.BuildLBNouvCommande(self) - def LEFiltreTextChanged(self): QTPanelTBW2.LEFiltreTextChanged(self) @@ -103,3 +100,6 @@ class MonCommentairePanel(DComment,QTPanelTBW2,QTPanel): def BOkPressed(self): QTPanel.BOkPressed(self) + def BuildTabCommandChanged(self): + QTPanelTBW2.BuildLBNouvCommandChanged(self) + diff --git a/InterfaceQT4/monFormulePanel.py b/InterfaceQT4/monFormulePanel.py index f5ba6dce..4a74051a 100644 --- a/InterfaceQT4/monFormulePanel.py +++ b/InterfaceQT4/monFormulePanel.py @@ -78,8 +78,8 @@ class MonFormulePanel(DFormule,QTPanelTBW2): self.connect(self.LEFiltre,SIGNAL("textChanged(const QString&)"),self.LEFiltreTextChanged) self.connect(self.LEFiltre,SIGNAL("returnPressed()"),self.LEfiltreReturnPressed) self.connect(self.bOk,SIGNAL("clicked()"),self.BOkPressed) - self.connect(self.RBalpha,SIGNAL("clicked()"),self.BuildTabCommand) - self.connect(self.RBGroupe,SIGNAL("clicked()"),self.BuildTabCommand) + self.connect(self.RBalpha,SIGNAL("clicked()"),self.BuildTabCommandChanged) + self.connect(self.RBGroupe,SIGNAL("clicked()"),self.BuildTabCommandChanged) self.connect(self.BNext,SIGNAL("clicked()"),self.BNextPressed) self.connect(self.LENomFormule,SIGNAL("returnPressed()"),self.NomFormuleSaisi) self.connect(self.LENomsArgs,SIGNAL("returnPressed()"),self.argsSaisis) @@ -92,8 +92,9 @@ class MonFormulePanel(DFormule,QTPanelTBW2): def BNextPressed(self): QTPanelTBW2.BNextPressed(self) - def BuildTabCommand(self): - QTPanelTBW2.BuildLBNouvCommande(self) + def BuildTabCommandChanged(self): + QTPanelTBW2.BuildLBNouvCommandChanged(self) + def LEFiltreTextChanged(self): QTPanelTBW2.LEFiltreTextChanged(self) diff --git a/InterfaceQT4/monIncludePanel.py b/InterfaceQT4/monIncludePanel.py index ccd8db96..79aa092d 100644 --- a/InterfaceQT4/monIncludePanel.py +++ b/InterfaceQT4/monIncludePanel.py @@ -155,8 +155,8 @@ class MonIncludePanel(DInc,QTPanelTBW1,QTPanelTBW2,QTPanelTBW3): self.connect(self.LEFiltre,SIGNAL("textChanged(const QString&)"),self.LEFiltreTextChanged) self.connect(self.LEFiltre,SIGNAL("returnPressed()"),self.LEfiltreReturnPressed) self.connect(self.bOk,SIGNAL("clicked()"),self.BOkPressed) - self.connect(self.RBGroupe,SIGNAL("clicked()"),self.BuildTabCommand) - self.connect(self.RBalpha,SIGNAL("clicked()"),self.BuildTabCommand) + self.connect(self.RBGroupe,SIGNAL("clicked()"),self.BuildTabCommandChanged) + self.connect(self.RBalpha,SIGNAL("clicked()"),self.BuildTabCommandChanged) self.connect(self.BNext,SIGNAL("pressed()"),self.BNextPressed) self.connect(self.BBrowse,SIGNAL("clicked()"),self.BBrowsePressed) try : @@ -172,8 +172,8 @@ class MonIncludePanel(DInc,QTPanelTBW1,QTPanelTBW2,QTPanelTBW3): def BNextPressed(self): QTPanelTBW2.BNextPressed(self) - def BuildTabCommand(self): - QTPanelTBW2.BuildLBNouvCommande(self) + def BuildTabCommandChanged(self): + QTPanelTBW2.BuildLBNouvCommandChanged(self) def LEFiltreTextChanged(self): QTPanelTBW2.LEFiltreTextChanged(self) diff --git a/InterfaceQT4/monMacroPanel.py b/InterfaceQT4/monMacroPanel.py index f6477a34..19f9f871 100644 --- a/InterfaceQT4/monMacroPanel.py +++ b/InterfaceQT4/monMacroPanel.py @@ -73,8 +73,8 @@ class MonMacroPanel(DMacro,QTPanelTBW1,QTPanelTBW2,QTPanelTBW3): self.connect(self.LEFiltre,SIGNAL("returnPressed()"),self.LEfiltreReturnPressed) self.connect(self.bOk,SIGNAL("clicked()"),self.BOkPressed) self.connect(self.LENomConcept,SIGNAL("returnPressed()"),self.LENomConceptReturnPressed) - self.connect(self.RBGroupe,SIGNAL("clicked()"),self.BuildTabCommand) - self.connect(self.RBalpha,SIGNAL("clicked()"),self.BuildTabCommand) + self.connect(self.RBGroupe,SIGNAL("clicked()"),self.BuildTabCommandChanged) + self.connect(self.RBalpha,SIGNAL("clicked()"),self.BuildTabCommandChanged) self.connect(self.BNext,SIGNAL("pressed()"),self.BNextPressed) @@ -84,8 +84,8 @@ class MonMacroPanel(DMacro,QTPanelTBW1,QTPanelTBW2,QTPanelTBW3): def BNextPressed(self): QTPanelTBW2.BNextPressed(self) - def BuildTabCommand(self): - QTPanelTBW2.BuildLBNouvCommande(self) + def BuildTabCommandChanged(self): + QTPanelTBW2.BuildLBNouvCommandChanged(self) def LEFiltreTextChanged(self): QTPanelTBW2.LEFiltreTextChanged(self) diff --git a/InterfaceQT4/monOptionsEditeur.py b/InterfaceQT4/monOptionsEditeur.py index 728acd0f..f1365093 100644 --- a/InterfaceQT4/monOptionsEditeur.py +++ b/InterfaceQT4/monOptionsEditeur.py @@ -153,7 +153,10 @@ class Options(desOptions): old_fic_ini_util=fic_ini_util+"_old" commande="mv "+fic_ini_util+" "+old_fic_ini_util os.system(commande) - import configuration + import prefs + nameConf='configuration_'+prefs.code + configuration=__import__(nameConf) + configNew=configuration.CONFIG(appli,repIni) self.configuration=configNew appli.CONFIGURATION=configNew diff --git a/InterfaceQT4/monParamPanel.py b/InterfaceQT4/monParamPanel.py index fedd2600..1a043712 100644 --- a/InterfaceQT4/monParamPanel.py +++ b/InterfaceQT4/monParamPanel.py @@ -65,8 +65,8 @@ class MonParamPanel(DParam,QTPanelTBW2,QTPanel): self.connect(self.LEFiltre,SIGNAL("textChanged(const QString&)"),self.LEFiltreTextChanged) self.connect(self.LEFiltre,SIGNAL("returnPressed()"),self.LEfiltreReturnPressed) self.connect(self.bOk,SIGNAL("clicked()"),self.BOkPressed) - self.connect(self.RBGroupe,SIGNAL("clicked()"),self.BuildTabCommand) - self.connect(self.RBalpha,SIGNAL("clicked()"),self.BuildTabCommand) + self.connect(self.RBGroupe,SIGNAL("clicked()"),self.BuildTabCommandChanged) + self.connect(self.RBalpha,SIGNAL("clicked()"),self.BuildTabCommandChanged) self.connect(self.BNext,SIGNAL("pressed()"),self.BNextPressed) self.connect(self.lineEditVal,SIGNAL("returnPressed()"),self.BOkPressed) @@ -139,8 +139,8 @@ class MonParamPanel(DParam,QTPanelTBW2,QTPanel): commentaire="Les noms de parametre doivent commencer par une lettre ou un souligne" return None,commentaire - def BuildTabCommand(self): - QTPanelTBW2.BuildLBNouvCommande(self) + def BuildTabCommandChanged(self): + QTPanelTBW2.BuildLBNouvCommandChanged(self) def LEFiltreTextChanged(self): QTPanelTBW2.LEFiltreTextChanged(self) diff --git a/InterfaceQT4/monRacinePanel.py b/InterfaceQT4/monRacinePanel.py index 46aed2c5..a614405e 100644 --- a/InterfaceQT4/monRacinePanel.py +++ b/InterfaceQT4/monRacinePanel.py @@ -68,8 +68,8 @@ class MonRacinePanel(DRac,QTPanelTBW2): self.connect(self.LEFiltre,SIGNAL("textChanged(const QString&)"),self.LEFiltreTextChanged) self.connect(self.LEFiltre,SIGNAL("returnPressed()"),self.LEfiltreReturnPressed) self.connect(self.bOk,SIGNAL("clicked()"),self.BOkPressed) - self.connect(self.RBalpha,SIGNAL("clicked()"),self.BuildTabCommand) - self.connect(self.RBGroupe,SIGNAL("clicked()"),self.BuildTabCommand) + self.connect(self.RBalpha,SIGNAL("clicked()"),self.BuildTabCommandChanged) + self.connect(self.RBGroupe,SIGNAL("clicked()"),self.BuildTabCommandChanged) self.connect(self.BNext,SIGNAL("clicked()"),self.BNextPressed) def BOkPressed(self): @@ -78,8 +78,8 @@ class MonRacinePanel(DRac,QTPanelTBW2): def BNextPressed(self): QTPanelTBW2.BNextPressed(self) - def BuildTabCommand(self): - QTPanelTBW2.BuildLBNouvCommande(self) + def BuildTabCommandChanged(self): + QTPanelTBW2.BuildLBNouvCommandChanged(self) def LEFiltreTextChanged(self): QTPanelTBW2.LEFiltreTextChanged(self) diff --git a/InterfaceQT4/qtCommun.py b/InterfaceQT4/qtCommun.py index b317169e..5e50d0e4 100644 --- a/InterfaceQT4/qtCommun.py +++ b/InterfaceQT4/qtCommun.py @@ -154,11 +154,16 @@ class QTPanelTBW2(QTPanel): self.LBNouvCommande.clear() jdc=self.node.item.object.get_jdc_root() - if self.RBalpha.isChecked(): + if self.editor.mode_nouv_commande == "alpha": + self.RBalpha.setChecked(True) + self.RBGroupe.setChecked(False) listeCmd = jdc.get_liste_cmd() for aCmd in listeCmd: self.LBNouvCommande.addItem( aCmd ) - else : + elif self.editor.mode_nouv_commande== "groupe" : + self.RBGroupe.setChecked(True) + self.RBalpha.setChecked(False) + listeGroupes,dictGroupes=jdc.get_groups() for grp in listeGroupes: if grp == "CACHE":continue @@ -169,9 +174,23 @@ class QTPanelTBW2(QTPanel): for aCmd in listeCmd: self.LBNouvCommande.addItem( aCmd) self.LBNouvCommande.addItem( " " ) + elif self.editor.mode_nouv_commande== "initial" : + listeCmd = self.editor.Commandes_Ordre_Catalogue + listeCmd2=jdc.get_liste_cmd() + if len(listeCmd) != len(listeCmd2): + listeCmd = listeCmd2 + for aCmd in listeCmd: + self.LBNouvCommande.addItem( aCmd ) #QObject.connect( self.LBNouvCommande, SIGNAL("itemClicked(QListWidgetItem*)"),self.DefCmd ) QObject.connect( self.LBNouvCommande, SIGNAL("itemDoubleClicked(QListWidgetItem*)"),self.DefCmd ) + def BuildLBNouvCommandChanged(self) : + if self.RBalpha.isChecked(): + self.editor.mode_nouv_commande="alpha" + else : + self.editor.mode_nouv_commande="groupe" + self.BuildLBNouvCommande() + def DefCmd(self): if self.LBNouvCommande.currentItem()== 0 : return if self.LBNouvCommande.currentItem()== None : return diff --git a/InterfaceQT4/qtEficas.py b/InterfaceQT4/qtEficas.py index b60eac1a..5d27974e 100644 --- a/InterfaceQT4/qtEficas.py +++ b/InterfaceQT4/qtEficas.py @@ -26,30 +26,23 @@ class Appli(Ui_Eficas,QMainWindow): self.top = self #(pour CONFIGURATION) self.QWParent=None #(Pour lancement sans IHM) - #PN pour Salome ( on passe d un code a l autre) + import prefs if salome : - import imp - pathEficas=os.path.dirname(os.path.abspath(__file__)) - pathCode="../"+code[0]+code[1:].lower() - prefFile=pathCode+"/prefs.py" - confFile=pathCode+"/configuration.py" - prefs=imp.load_source("prefs",os.path.join(pathEficas,prefFile)) - configuration=imp.load_source("configuration",os.path.join(pathEficas,confFile)) - print "_____________________________________" - print prefs - print configuration - else : - import prefs - import configuration - - self.REPINI=prefs.REPINI - self.RepIcon=prefs.INSTALLDIR+"/Editeur/icons" - self.CONFIGURATION = configuration.make_config(self,prefs.REPINI) - self.CONFIGStyle = configuration.make_config_style(self,prefs.REPINI) - if hasattr(prefs,'encoding'): + import sys + prefs.code=code + name='prefs_'+prefs.code + prefsCode=__import__(name) + nameConf='configuration_'+prefs.code + configuration=__import__(nameConf) + + self.REPINI=prefsCode.REPINI + self.RepIcon=prefsCode.INSTALLDIR+"/Editeur/icons" + self.CONFIGURATION = configuration.make_config(self,prefsCode.REPINI) + self.CONFIGStyle = configuration.make_config_style(self,prefsCode.REPINI) + if hasattr(prefsCode,'encoding'): import sys reload(sys) - sys.setdefaultencoding(prefs.encoding) + sys.setdefaultencoding(prefsCode.encoding) QMainWindow.__init__(self) Ui_Eficas.__init__(self) @@ -322,12 +315,12 @@ if __name__=='__main__': # Modules Eficas sys.path.append(INSTALLDIR+"/Aster") - from Aster import prefs - if hasattr(prefs,'encoding'): + from Aster import prefsCode + if hasattr(prefsCode,'encoding'): # Hack pour changer le codage par defaut des strings import sys reload(sys) - sys.setdefaultencoding(prefs.encoding) + sys.setdefaultencoding(prefsCode.encoding) del sys.setdefaultencoding # Fin hack diff --git a/InterfaceQT4/readercata.py b/InterfaceQT4/readercata.py index a35dce25..7c11bbfe 100644 --- a/InterfaceQT4/readercata.py +++ b/InterfaceQT4/readercata.py @@ -35,6 +35,7 @@ from Noyau.N_CR import CR from Editeur.utils import init_rep_cata_dev import analyse_catalogue +import analyse_catalogue_initial import autre_analyse_cata import uiinfo from monChoixCata import MonChoixCata @@ -52,6 +53,10 @@ class READERCATA: self.appliEficas=self.QWParent.appliEficas self.code=self.QWParent.code self.appliEficas.format_fichier='python' + if hasattr(self.appliEficas,'mode_nouv_commande'): + self.mode_nouv_commande=self.appliEficas.mode_nouv_commande + else : + self.mode_nouv_commande='alpha' self.version_code=self.QWParent.version_code self.version_cata=None self.fic_cata=None @@ -124,6 +129,10 @@ class READERCATA: # remplacé par Retrouve_Ordre_Cata_Standard_autre qui utilise une numerotation # des mots clés a la création self.Retrouve_Ordre_Cata_Standard_autre() + if self.mode_nouv_commande== "initial" : + self.Retrouve_Ordre_Cata_Standard() + else: + self.Commandes_Ordre_Catalogue=[] # # analyse des données liées a  l'IHM : UIinfo @@ -182,52 +191,11 @@ class READERCATA: def Retrouve_Ordre_Cata_Standard(self): """ Retrouve l'ordre des mots-clés dans le catalogue, cad : - - si ce dernier a été modifié, relance l'analyse du catalogue pour déterminer - l'ordre des mots-clés dans le catalogue - - s'il n'a pas été modifié, relie le fichier pickle + Attention s appuie sur les commentaires """ - time1 = os.path.getmtime(self.fic_cata) - try : - time2 = os.path.getmtime(self.fic_cata_p) - except: - time2 = 0 - if time2 > time1 : - # l'objet catalogue n'a pas été modifié depuis le dernier "pickle" - self.Get_Ordre_Cata() - else : - # le catalogue a été modifié depuis le dernier "pickle" : - # il faut retrouver l'ordre du catalogue et refaire pickle - self.Get_Ordre_Cata(mode='cata') - self.appliEficas.affiche_infos("Catalogue standard chargé") - - - def Get_Ordre_Cata(self,mode='pickle'): - """ - Retrouve l'ordre du catalogue : - - mode='pickle ': tente de relire le fichier pickle et sinon lance l'analyse du catalogue - - mode='cata' : force l'analyse du catalogue directement sans relire le pickle - """ - if mode == 'pickle' : - try: - f = open(self.fic_cata_p) - u = cPickle.Unpickler(f) - self.cata_ordonne_dico = u.load() - f.close() - except : - # on peut ne pas arriver a  relire le fichier pickle s'il a été altéré - # ou (le plus probable) s'il a été créé sous un autre OS - self.Get_Ordre_Cata(mode='cata') - elif mode == 'cata': - cata_ordonne = analyse_catalogue.analyse_catalogue(self,self.fic_cata) - self.cata_ordonne_cr = cata_ordonne.cr - self.cata_ordonne_dico = cata_ordonne.entites - f = open(self.fic_cata_p,'w+') - p = cPickle.Pickler(f) - p.dump(self.cata_ordonne_dico) - f.close() - else : - raise Exception("Appel a  un mode inconnu de Get_Ordre_Cata : %s" % mode) - return + nom_cata = os.path.splitext(os.path.basename(self.fic_cata))[0] + rep_cata = os.path.dirname(self.fic_cata) + self.Commandes_Ordre_Catalogue = analyse_catalogue_initial.analyse_catalogue(self.fic_cata) def ask_choix_catalogue(self): """ @@ -276,46 +244,6 @@ class READERCATA: sys.exit(0) - def compile_cata(self,cata,catac): - """ - Teste si le catalogue a bien besoin d'etre recompilé et si oui, le compile et - affiche un message dans le splash . Retourne 1 si la compilation s'est bien déroulée, - 0 sinon. - """ - time1 = os.path.getmtime(cata) - try: - time2 = os.path.getmtime(catac) - except: - time2 = 0 - if time1 > time2: - try: - # le catalogue doit etre recompilé avant d'etre importé - if self.QWParent.test == 0 : - splash._splash.configure(text="Compilation du catalogue\nCela peut prendre plusieurs secondes ...") - py_compile.compile(cata) - except: - return 0 - return 1 - - - - def visuCRCATA(self): - """ - Méthode permettant l'affichage du rapport de validation - """ - cr = CR( debut = "Début rapport de validation du catalogue", - fin = "Fin rapport de validation du catalogue") - titre="rapport de validation du catalogue" - if hasattr(self,'cata_ordonne_cr') : - cr.add(self.cata_ordonne_cr) - if hasattr(self,'cata_dev_ordonne_cr') : - cr.add(self.cata_dev_ordonne_cr) - for cata in self.cata: - if hasattr(cata,'JdC'): - cr.add(cata.JdC.report()) - texte_cr = str(cr) - self.visu_texte_cr = Fenetre(self.appliEficas,titre=titre,texte=texte_cr) - def traite_clefs_documentaires(self): try: diff --git a/Openturns_Study/OpenTURNS_Cata_Study_V4.py b/Openturns_Study/OpenTURNS_Cata_Study_V4.py index bea8eb75..05fdd221 100644 --- a/Openturns_Study/OpenTURNS_Cata_Study_V4.py +++ b/Openturns_Study/OpenTURNS_Cata_Study_V4.py @@ -4,6 +4,10 @@ # debut entete # -------------------------------------------------- +# Les commentaires du style # Ordre Catalogue MOTCLEF sont utilises pour +# retrouver l ordre du catalogue + + #from Accas import ASSD, JDC_CATA, AU_MOINS_UN, PROC, SIMP, FACT, OPER, MACRO, BLOC, A_VALIDATOR from Accas import * @@ -32,7 +36,8 @@ class Tuple: #CONTEXT.debug = 1 JdC = JDC_CATA ( code = 'OPENTURNS_STUDY', execmodul = None, - regles = ( AU_MOINS_UN ( 'CRITERIA' ), AU_MOINS_UN ( 'MODEL' ), ), + regles = ( AU_MOINS_UN ( 'CRITERIA' ), AU_MOINS_UN ( 'MODEL' ), + A_CLASSER(('LOG','DETERMINISTICVARIABLE'),'VARIABLE'),) ) # Fin JDC_CATA # -------------------------------------------------- @@ -92,6 +97,7 @@ LOG = PROC ( nom = "LOG", ), ) # Fin PROC LOG +# Ordre Catalogue LOG @@ -129,17 +135,17 @@ DETERMINISTICVARIABLE = OPER ( nom = "DETERMINISTICVARIABLE", ), ) # Fin OPER DETERMINISTICVARIABLE +# Ordre Catalogue DETERMINISTICVARIABLE - -import ops +import opsOT MODEL = MACRO ( nom = "MODEL", op = None, UIinfo = { "groupes" : ( "Gestion du travail", ) }, fr = "Chargement du wrapper du modele physique", ang = "Physical model wrapper load", - sd_prod = ops.INCLUDE, - op_init = ops.INCLUDE_context, + sd_prod = opsOT.INCLUDE, + op_init = opsOT.INCLUDE_context, fichier_ini = 1, FileName = SIMP ( statut = "o", @@ -149,6 +155,7 @@ MODEL = MACRO ( nom = "MODEL", ), ) # Fin PROC MODEL +# Ordre Catalogue MODEL @@ -168,6 +175,7 @@ VARIABLE = PROC ( nom = "VARIABLE", ), ) # Fin PROC VARIABLE +# Ordre Catalogue VARIABLE @@ -794,6 +802,7 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", ), # Fin BLOC WEIBULL ) # Fin OPER DISTRIBUTION +# Ordre Catalogue DISTRIBUTION @@ -1611,6 +1620,7 @@ CRITERIA = PROC ( nom = "CRITERIA", ) # Fin PROC CRITERIA +# Ordre Catalogue CRITERIA diff --git a/Openturns_Study/catalogues_openturns.ini b/Openturns_Study/catalogues_openturns.ini index 8185a163..7592ca46 100644 --- a/Openturns_Study/catalogues_openturns.ini +++ b/Openturns_Study/catalogues_openturns.ini @@ -7,6 +7,7 @@ catalogues = ( # (code,version,catalogue,formatIn,formatOut) #('OPENTURNS_WRAPPER','V1',os.path.join(rep_cata,'OpenTURNS_Cata_Wrapper_V1.py'),'openturns_wrapper','wrapper'), ('OPENTURNS_STUDY','V4',os.path.join(rep_cata,'OpenTURNS_Cata_Study_V4.py'),'openturns_study','wrapper'), + #('OPENTURNS_STUDY','V4',os.path.join(rep_cata,'OpenTURNS_Cata_Study_VPN.py'),'openturns_study','wrapper'), #('OPENTURNS','Wrapper',os.path.join(rep_cata,'OpenTURNS_Cata_Wrapper_V1.py'),'openturns'), ) diff --git a/Openturns_Study/prefs.py b/Openturns_Study/prefs.py index 9b2440e0..84f4d9a3 100644 --- a/Openturns_Study/prefs.py +++ b/Openturns_Study/prefs.py @@ -1,55 +1 @@ -# -*- coding: utf-8 -*- -# 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 os, sys -# Les variables pouvant positionnees sont : -# "CODE_PATH_SURCHARGE","DTDDirectory","rep_user","INSTALLDIR","path_doc","exec_acrobat","rep_cata" -print "import des prefs de OPENTURNS_STUDY" - -code = "OPENTURNS_STUDY" - -# REPINI sert à localiser le fichier -# initialdir sert comme directory initial des QFileDialog -# positionnee a repin au debut mise a jour dans configuration -REPINI=os.path.dirname(os.path.abspath(__file__)) -initialdir=REPINI - -# INSTALLDIR sert à localiser l'installation d'Eficas -INSTALLDIR=os.path.join(REPINI,'..') - - -# Codage des strings qui accepte les accents (en remplacement de 'ascii') -# lang indique la langue utilisée pour les chaines d'aide : fr ou ang -lang='fr' -encoding='iso-8859-1' - -# Acces a la documentation -rep_cata = INSTALLDIR -path_doc = os.path.join(rep_cata,'Doc') -exec_acrobat = "/usr/bin/xpdf" - - -# OpenTURNS Python module -OpenTURNS_path="/opt/OpenTURNS/install/lib/python2.4/site-packages" -# Choix des catalogues -sys.path[:0]=[INSTALLDIR] -sys.path.append( OpenTURNS_path ) - +code='OPENTURNS_STUDY' diff --git a/Openturns_Study/qtEficas_openturns_study.py b/Openturns_Study/qtEficas_openturns_study.py index 76e0ad8a..5c865492 100755 --- a/Openturns_Study/qtEficas_openturns_study.py +++ b/Openturns_Study/qtEficas_openturns_study.py @@ -27,7 +27,9 @@ # Modules Eficas import prefs -prefs.code="OPENTURNS_STUDY" -from InterfaceQT4 import eficas_go +name='prefs_'+prefs.code +__import__(name) +import sys +from InterfaceQT4 import eficas_go eficas_go.lance_eficas(code=prefs.code) diff --git a/Sous_epaisseur/SEP_Cata_V0.py b/Sous_epaisseur/SEP_Cata_V0.py index 5058d078..c4bc8914 100644 --- a/Sous_epaisseur/SEP_Cata_V0.py +++ b/Sous_epaisseur/SEP_Cata_V0.py @@ -10,7 +10,7 @@ from Accas import * JdC = JDC_CATA ( code = 'SEP', execmodul = None, # regles = ( AU_MOINS_UN ( 'M_TUBE','MAILLAGE_COUDE','CHARGE_LIMITE ), ), - regles = ( AU_MOINS_UN ( 'M_TUBE',), ), + regles = ( AU_MOINS_UN ( 'M_TUBE','M_JJJJJ'),EXCLUS('M_TUBE','M_JJJJJ') ), ) # Fin JDC_CATA # @@ -28,6 +28,14 @@ M_TUBE= MACRO (nom = 'M_TUBE', unite=SIMP(statut='o', typ='TXM', defaut='mm',into=('mm',),), ep_nominale=SIMP(statut='o', typ='R', defaut=22.000), ), + ) +M_JJJJJ= MACRO (nom = 'M_JJJJJ', + op = None, + sd_prod = None, + reentrant = 'n', + UIinfo = {"groupes":("Outils métier",)}, + fr = "Parametres pour Le tube ", + dir_name = SIMP(statut='o', typ='TXM',), + methode = SIMP(statut='o', typ='TXM',into=('generatrices','tortue',),), ) - diff --git a/Sous_epaisseur/sdistSEP.py b/Sous_epaisseur/sdistSEP.py index 72ae2004..e94077f3 100644 --- a/Sous_epaisseur/sdistSEP.py +++ b/Sous_epaisseur/sdistSEP.py @@ -46,6 +46,7 @@ def main(): copyfiles('../convert',os.path.join(path_distrib,'convert'),['*.py']) os.system("rm -rf .././convert/Parserv5 ") + os.system("rm -rf .././convert/convert_asterv5.py ") copyfiles('../generator',os.path.join(path_distrib,'generator'),['*.py']) copyfiles('../Editeur/icons',os.path.join(path_distrib,'Editeur','icons'),['*.gif']) copyfiles('../Editeur/icons',os.path.join(path_distrib,'Editeur','icons'),['*.png']) diff --git a/UiQT4/desChoixCata.py b/UiQT4/desChoixCata.py index 56eed314..4e7eecd6 100644 --- a/UiQT4/desChoixCata.py +++ b/UiQT4/desChoixCata.py @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'desChoixCata.ui' # -# Created: Tue Jan 27 12:25:36 2009 +# Created: Tue Jun 9 14:49:19 2009 # by: PyQt4 UI code generator 4.4.3 # # WARNING! All changes made in this file will be lost! @@ -12,7 +12,7 @@ from PyQt4 import QtCore, QtGui class Ui_DChoixCata(object): def setupUi(self, DChoixCata): DChoixCata.setObjectName("DChoixCata") - DChoixCata.resize(547, 192) + DChoixCata.resize(547, 215) DChoixCata.setSizeGripEnabled(True) self.gridLayout = QtGui.QGridLayout(DChoixCata) self.gridLayout.setObjectName("gridLayout") @@ -36,19 +36,16 @@ class Ui_DChoixCata(object): self.frame3.setFrameShape(QtGui.QFrame.StyledPanel) self.frame3.setFrameShadow(QtGui.QFrame.Raised) self.frame3.setObjectName("frame3") - self.horizontalLayout = QtGui.QHBoxLayout(self.frame3) - self.horizontalLayout.setObjectName("horizontalLayout") self.buttonOk = QtGui.QPushButton(self.frame3) + self.buttonOk.setGeometry(QtCore.QRect(11, 13, 91, 41)) self.buttonOk.setAutoDefault(True) self.buttonOk.setDefault(True) self.buttonOk.setObjectName("buttonOk") - self.horizontalLayout.addWidget(self.buttonOk) - spacerItem = QtGui.QSpacerItem(334, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - self.horizontalLayout.addItem(spacerItem) self.buttonCancel = QtGui.QPushButton(self.frame3) + self.buttonCancel.setGeometry(QtCore.QRect(437, 13, 81, 41)) + self.buttonCancel.setMinimumSize(QtCore.QSize(81, 41)) self.buttonCancel.setAutoDefault(True) self.buttonCancel.setObjectName("buttonCancel") - self.horizontalLayout.addWidget(self.buttonCancel) self.gridLayout.addWidget(self.frame3, 2, 0, 1, 2) self.retranslateUi(DChoixCata) @@ -56,7 +53,11 @@ class Ui_DChoixCata(object): def retranslateUi(self, DChoixCata): DChoixCata.setWindowTitle(QtGui.QApplication.translate("DChoixCata", "Choix d\'une version du code Aster", None, QtGui.QApplication.UnicodeUTF8)) - self.TLNb.setText(QtGui.QApplication.translate("DChoixCata", "2 versions sont disponibles", None, QtGui.QApplication.UnicodeUTF8)) + self.TLNb.setText(QtGui.QApplication.translate("DChoixCata", "\n" +"\n" +"

2 versions sont disponibles

", None, QtGui.QApplication.UnicodeUTF8)) self.textLabel1_2.setText(QtGui.QApplication.translate("DChoixCata", "\n" "