From: pascale.noyret Date: Mon, 11 Jul 2016 15:27:45 +0000 (+0200) Subject: PSEN X-Git-Tag: V8_1_0~22 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a807dd257c60aab02acc8550766c705edf94dc03;p=tools%2Feficas.git PSEN --- diff --git a/InterfaceQT4/compomacro.py b/InterfaceQT4/compomacro.py index e5e6162e..e04a6da5 100644 --- a/InterfaceQT4/compomacro.py +++ b/InterfaceQT4/compomacro.py @@ -67,7 +67,6 @@ class MACRONode(browser.JDCNode,typeNode.PopUpMenuNode): troisD.envoievisu() - class MACROTreeItem(compooper.EtapeTreeItem): # """ Cette classe hérite d'une grande partie des comportements diff --git a/InterfaceQT4/composimp.py b/InterfaceQT4/composimp.py index 3732351f..9fc5dad9 100644 --- a/InterfaceQT4/composimp.py +++ b/InterfaceQT4/composimp.py @@ -144,6 +144,11 @@ class Node(browser.JDCNode,typeNode.PopUpMenuNodeMinimal): #if maDefinition.into != [] and maDefinition.into != None: # Attention pas fini --> on attend une liste de ASSD avec ordre if self.item.wait_assd() and self.item.is_list_SansOrdreNiDoublon(): + #if self.item.is_list_Chargement(): + #from monWidgetPlusieursTuple2AvecChargement import MonWidgetPlusieursTuple2AvecChargement + #widget=MonWidgetPlusieursTuple2(self,maDefinition,monNom,monObjet,parentQt,maCommande) + # pass + #else : from monWidgetPlusieursInto import MonWidgetPlusieursInto widget=MonWidgetPlusieursInto(self,maDefinition,monNom,monObjet,parentQt,maCommande) elif self.item.wait_assd() : @@ -161,10 +166,10 @@ class Node(browser.JDCNode,typeNode.PopUpMenuNodeMinimal): print "Prevenir la maintenance " elif self.item.has_into(): if self.item.is_list_SansOrdreNiDoublon(): - print 6 - print self.editor.listeDesListesOuvertes - print self.item in self.editor.listeDesListesOuvertes - print self.editor.afficheListesPliees + #print (self.item in self.editor.listeDesListesOuvertes or not(self.editor.afficheListesPliees) ) + #print ( not(self.editor.afficheListesPliees) ) + #print (self.editor.afficheListesPliees) + if self.item in self.editor.listeDesListesOuvertes or not(self.editor.afficheListesPliees) : from monWidgetPlusieursInto import MonWidgetPlusieursInto widget=MonWidgetPlusieursInto(self,maDefinition,monNom,monObjet,parentQt,maCommande) @@ -172,7 +177,6 @@ class Node(browser.JDCNode,typeNode.PopUpMenuNodeMinimal): from monWidgetPlusieursPlie import MonWidgetPlusieursPlie widget=MonWidgetPlusieursPlie(self,maDefinition,monNom,monObjet,parentQt,maCommande) else : - print 7 # tres vite pour le tag mais devra etre gere dans configuration if self.item in self.editor.listeDesListesOuvertes or not(self.editor.afficheListesPliees) : from monWidgetPlusieursIntoOrdonne import MonWidgetPlusieursIntoOrdonne @@ -181,7 +185,7 @@ class Node(browser.JDCNode,typeNode.PopUpMenuNodeMinimal): from monWidgetPlusieursPlie import MonWidgetPlusieursPlie widget=MonWidgetPlusieursPlie(self,maDefinition,monNom,monObjet,parentQt,maCommande) else : - print 8 + #print 8 if self.item in self.editor.listeDesListesOuvertes or not(self.editor.afficheListesPliees) : from monWidgetPlusieursBase import MonWidgetPlusieursBase widget=MonWidgetPlusieursBase(self,maDefinition,monNom,monObjet,parentQt,maCommande) @@ -242,7 +246,11 @@ class SIMPTreeItem(Objecttreeitem.AtomicObjectTreeItem): return is_a_list def is_list_SansOrdreNiDoublon(self): - if self.definition.homo=="SansOrdreNiDoublon": return 1 + if self.definition.homo=="SansOrdreNiDoublon" : return 1 + return 0 + + def is_list_Chargement(self): + if self.definition.docu != "" : return 1 return 0 def has_into(self): diff --git a/InterfaceQT4/editor.py b/InterfaceQT4/editor.py index 512a9316..58c1b577 100755 --- a/InterfaceQT4/editor.py +++ b/InterfaceQT4/editor.py @@ -87,11 +87,11 @@ class JDCEditor(Ui_baseWidget,QWidget): # ces attributs sont mis a jour par definitCode appelee par newEditor self.code = self.appliEficas.CONFIGURATION.code - # tres vite a cause du tag. doit etre pase dans CONFIGURATION #self.afficheListesPliees=False self.afficheListesPliees=True if self.code == "ASTER" or self.code == "monCode" : self.afficheListesPliees =True + if self.code == 'PSEN_N1' : self.afficheListesPliees = False self.mode_nouv_commande=self.appliEficas.CONFIGURATION.mode_nouv_commande self.affiche=self.appliEficas.CONFIGURATION.affiche @@ -241,6 +241,33 @@ class JDCEditor(Ui_baseWidget,QWidget): print out print err + #-------------------# Pour execution avec output et error dans le bash + def runPSEN_N1(self): + #-------------------# + #cmd = os.path.abspath(os.path.join(os.path.abspath(__file__), '../','../','PSEN_N1','run.py')) + #cmd = "from run import runPSEN_N1; dico="+str(dico) + + #textePython=("python "+ cmd + " "+ str(dico)) + #print textePython + #self._viewTextExecute( textePython,"psen_run",".sh") + if generator.plugins.has_key('dicoImbrique'): + self.generator=generator.plugins['dicoImbrique']() + jdc_formate=self.generator.gener(self.jdc) + dico=self.generator.Dico + from variablesPSENN1 import PSEN_N1_Variables + mesVariables= PSEN_N1_Variables() + mesVariables.raz() + mesVariables.setValues(dico) + mesVariables.imprime() + + from eficas_go import getJdcParameters + from run import runPSEN_N1 + res,txt_exception=runPSEN_N1(dico) + if res : QMessageBox.information( self, tr("fin de script run"), txt_exception) + else : QMessageBox.critical( self, tr("Erreur fatale script run"), txt_exception) + + + #--------------------------------# def _newJDC( self ,units = None): #--------------------------------# @@ -255,6 +282,7 @@ class JDCEditor(Ui_baseWidget,QWidget): if self.code == "ZCRACKS" : texte=self._newZCRACKS() if self.code == "TELEMAC" : texte=self._newTELEMAC() if self.code == "PSEN" : texte = self._newPSEN() + if self.code == "PSEN_N1" : texte = self._newPSEN_N1() # texte=self.newTexteCND jdc=self.readercata.cata[0].JdC( procedure =texte, @@ -840,7 +868,9 @@ class JDCEditor(Ui_baseWidget,QWidget): #------------# def run(self): #------------# + print "kkkkkkkkkk" fonction="run"+self.code + print fonction if fonction in JDCEditor.__dict__.keys(): apply(JDCEditor.__dict__[fonction],(self,)) #------------# @@ -1256,27 +1286,40 @@ class JDCEditor(Ui_baseWidget,QWidget): etape.build_includeInclude(texte) self.tree.racine.build_children() + #-------------------------------------# + def deleteMC(self,etape,MCFils): + #-------------------------------------# + monMC=etape.get_child(MCFils,restreint="oui") + if monMC != None : print etape.suppentite(monMC) + + + #-------------------------------------# def ajoutMC(self,etape,MCFils,valeurs): - print etape.nom - #print etape,MCFils,valeurs - print dir(etape) - #print 'etape' , etape - #print MCFils.valeur - #print MCFils.val - print etape.liste_mc_presents() - monMC= etape.addentite('TransfosList') - #print etape.append_child - #monMC=etape.append_child('TransfosList','last') - print etape.liste_mc_presents() - # Attention ne pas faire de setValeurs + #-------------------------------------# + print "je passe dans ajoutMC" + monMC=etape.get_child(MCFils,restreint="oui") + if monMC== None : monMC= etape.addentite(MCFils) monMC.valeur=valeurs monMC.val=valeurs - print monMC.val - #print MCFils.valeur - #print MCFils.val - print etape.liste_mc_presents() - print "________" + #-------------------------------------# + def changeIntoMC(self,etape,MCFils,valeurs): + #-------------------------------------# + print "je passe dans changeIntoMC" + monMC=etape.get_child(MCFils,restreint="oui") + if monMC== None : monMC= etape.addentite(MCFils) + monMC.definition.into=valeurs + + #-------------------------------------# + def changeIntoMCandSet(self,etape,MCFils,into,valeurs): + #-------------------------------------# + monMC=etape.get_child(MCFils,restreint="oui") + if monMC== None : monMC= etape.addentite(MCFils) + monMC.definition.into=into + monMC.valeur=valeurs + monMC.val=valeurs + monMC.state='changed' + monMC.isvalid() #-------------------------------------# def ajoutVersionCataDsJDC(self,txt): @@ -1358,6 +1401,13 @@ class JDCEditor(Ui_baseWidget,QWidget): #texte="" return texte + #---------------------------# + def _newPSEN_N1(self): + #---------------------------# + texte="CASE_SELECTION() ; CONTINGENCY_OPTIONS() ; OUTPUT_OPTIONS() ; " + #texte="" + return texte + #---------------------------# #---------------------------# diff --git a/InterfaceQT4/feuille.py b/InterfaceQT4/feuille.py index d7d564f3..445f038a 100644 --- a/InterfaceQT4/feuille.py +++ b/InterfaceQT4/feuille.py @@ -202,7 +202,7 @@ class Feuille(QWidget,ContientIcones,SaisieValeur,FacultatifOuOptionnel): #self.editor.affiche_infos(info) def reaffiche(self): - print "dans reaffiche de feuille", self.nom + #print "dans reaffiche de feuille", self.nom if self.editor.jdc.aReafficher==True : self.parentQt.reaffiche() diff --git a/InterfaceQT4/gereIcones.py b/InterfaceQT4/gereIcones.py index 5cc481b2..ea71360b 100644 --- a/InterfaceQT4/gereIcones.py +++ b/InterfaceQT4/gereIcones.py @@ -166,11 +166,10 @@ class FacultatifOuOptionnel: def setRun(self): - if hasattr(self.editor.appliEficas, 'mesScripts') : if self.editor.code in self.editor.appliEficas.mesScripts.keys() : self.dict_commandes_mesScripts=self.appliEficas.mesScripts[self.editor.code].dict_commandes - if hasattr(self.editor,'tree') and self.editor.tree.currentItem() and self.editor.tree.currentItem().item and self.editor.tree.currentItem().item.get_nom() in self.dict_commandes_mesScripts.keys() : + if self.obj.nom in self.dict_commandes_mesScripts.keys() : self.ajoutScript() return if hasattr(self,"RBRun"): self.RBRun.close() @@ -206,7 +205,7 @@ class FacultatifOuOptionnel: def ajoutScript(self): self.dictCommandes={} - listeCommandes=self.dict_commandes_mesScripts[self.node.item.get_nom()] + listeCommandes=self.dict_commandes_mesScripts[self.obj.nom] if type(listeCommandes) != types.TupleType: listeCommandes=(listeCommandes,) i=0 for commande in listeCommandes : diff --git a/InterfaceQT4/gereListe.py b/InterfaceQT4/gereListe.py index 3c5e585c..c7b87989 100644 --- a/InterfaceQT4/gereListe.py +++ b/InterfaceQT4/gereListe.py @@ -129,7 +129,6 @@ class GereListe: self.LEFiltre.returnPressed.connect(self.LEFiltreReturnPressed) def filtreListe(self): - print self.alpha l=[] if self.filtre != "" : for i in self.listeAAfficher : diff --git a/InterfaceQT4/monWidgetCBSD.py b/InterfaceQT4/monWidgetCBSD.py index 9af4f98d..14ecd233 100644 --- a/InterfaceQT4/monWidgetCBSD.py +++ b/InterfaceQT4/monWidgetCBSD.py @@ -51,7 +51,7 @@ class MonWidgetCB (Ui_WidgetCB,Feuille): self.parentQt.commandesLayout.insertWidget(-1,self) self.maCommande.listeAffichageWidget.append(self.CBChoix) - print self.objSimp.isoblig() + #print self.objSimp.isoblig() def setValeursApresBouton(self): diff --git a/InterfaceQT4/monWidgetPlusieursInto.py b/InterfaceQT4/monWidgetPlusieursInto.py index 7f75a3ed..01df3ce0 100644 --- a/InterfaceQT4/monWidgetPlusieursInto.py +++ b/InterfaceQT4/monWidgetPlusieursInto.py @@ -222,6 +222,8 @@ class MonWidgetPlusieursInto (Ui_WidgetPlusieursInto,Feuille,GerePlie,GereListe) if self.listeValeursCourantes== [] : self.node.item.set_valeur(None) else : self.node.item.set_valeur(self.listeValeursCourantes) + # Exception pour PSEN + if self.editor.code == 'PSEN_N1' and self.nom==('Onglets') and self.listeValeursCourantes== []: self.node.item.set_valeur([]) self.setValide() self.reaffiche() diff --git a/InterfaceQT4/qtEficas.py b/InterfaceQT4/qtEficas.py index afaa9d73..f28aff25 100755 --- a/InterfaceQT4/qtEficas.py +++ b/InterfaceQT4/qtEficas.py @@ -351,6 +351,9 @@ class Appli(Ui_Eficas,QMainWindow): self.ajoutHelpPSEN() self.ajoutIcones() + def PSEN_N1(self): + self.ajoutExecution() + def TELEMAC(self): self.enleverActionsStructures() self.enleverNewInclude() diff --git a/InterfaceQT4/typeNode.py b/InterfaceQT4/typeNode.py index 07ca9cac..036ae114 100644 --- a/InterfaceQT4/typeNode.py +++ b/InterfaceQT4/typeNode.py @@ -148,7 +148,7 @@ class PopUpMenuNodeMinimal : listeCommandes=self.dict_commandes_mesScripts[nomCmd] commande=listeCommandes[numero] conditionValid=commande[4] - if (self.tree.currentItem().item.isvalid() == 0 and conditionValid == True): + if (nodeTraite.item.isvalid() == 0 and conditionValid == True): QMessageBox.warning( None, tr("item invalide"), tr("l item doit etre valide"),) @@ -160,9 +160,15 @@ class PopUpMenuNodeMinimal : if hasattr(nodeTraite,p): listeparam.append(getattr(nodeTraite,p)) if p=="self" : listeparam.append(self) + print listeparam + try : - #if 1 : - fonction(listeparam,self.appliEficas) + res, commentaire= fonction(listeparam) + if not res : + QMessageBox.warning( None, + tr("echec de la fonction"), + tr(commentaire),) + return except : fonction(listeparam) diff --git a/PSEN_Eficas/ExtractGeneratorLoadLineandTransfoDico.py b/PSEN_Eficas/ExtractGeneratorLoadLineandTransfoDico.py index ea220de6..9427e18c 100755 --- a/PSEN_Eficas/ExtractGeneratorLoadLineandTransfoDico.py +++ b/PSEN_Eficas/ExtractGeneratorLoadLineandTransfoDico.py @@ -164,4 +164,10 @@ def ExtractGeneratorLoadLineandTransfoDico2(NetworkFile,PSSE_PATH): LoadDico={'C1':'C1','C2':'C2','C3':'C3','C4':'C4'} LineDico={'L1':'L1','L2':'L2','L3':'L3','L4':'L4'} TfoDico={'T1':'T1','T2':'T2','T3':'T3','T4':'T4'} - return MachineDico, LoadDico, LineDico, TfoDico + MDico={'MZ1':'MZ1','MZ2':'MZ2','MZ3':'MZ3','MZ4':'MZ4'} + if NetworkFile == '/home/A96028/PSEN/PSEN_V8/Code/PSEN_Eficas/faux2.sav': + print "sans T1" + TfoDico={'T2':'T2','T3':'T3','T4':'T4'} + + + return MachineDico, LoadDico, LineDico, TfoDico, MDico diff --git a/PSEN_Eficas/PSEN_Cata.py b/PSEN_Eficas/PSEN_Cata.py old mode 100755 new mode 100644 index c754ed51..d74d7e4a --- a/PSEN_Eficas/PSEN_Cata.py +++ b/PSEN_Eficas/PSEN_Cata.py @@ -32,6 +32,7 @@ class sd_charge ( ASSD ) : pass class sd_generateur ( ASSD ) : pass class sd_ligne ( ASSD ) : pass class sd_transfo ( ASSD ) : pass +class sd_moteur (ASSD) : pass #class sd_busbar ( sd_generateur,sd_charge ) : pass import types @@ -89,8 +90,9 @@ JdC = JDC_CATA ( code = 'PSEN', AU_PLUS_UN ( 'N_1_GENERATORS' ), AU_PLUS_UN ( 'N_1_LINES' ), AU_PLUS_UN ( 'N_1_LOADS' ), + AU_PLUS_UN ( 'N_1_MOTORS' ), AU_PLUS_UN ( 'N_1_TRANSFORMERS' ), - + ), ) # Fin JDC_CATA @@ -108,6 +110,15 @@ MONGENER = OPER ( nom = "MONGENER", ID = SIMP ( statut = 'o', typ = "TXM", fr = "num bus", ang = "num bus",), ) +MONMOTEUR = OPER ( nom = "MONMOTEUR", + sd_prod = sd_moteur, + UIinfo = {"groupes": ("CACHE")}, + op = None, + fr = "Moteur", + ang = "Motor", + + ID = SIMP ( statut = 'o', typ = "TXM", fr = "num bus", ang = "num bus",), +) MACHARGE = OPER ( nom = "MACHARGE", sd_prod = sd_charge, UIinfo = {"groupes": ("CACHE")}, @@ -141,6 +152,22 @@ MONTRANSFO = OPER ( nom = "MONTRANSFO", PSSE_PARAMETERS = PROC ( nom = "PSSE_PARAMETERS", op=None, docu = "", + ALGORITHM = SIMP ( statut = "o", + typ='TXM', + into=["Optimum Power Flow","Economic Dispatch and Power Flow"], + defaut="Optimum Power Flow", + ), + I_MAX = SIMP ( statut = "o", + typ='TXM', + into=['RateA','RateB','RateC'], + defaut='RateA', + ), + LOCK_TAPS = SIMP ( statut = "o", + typ=bool, + defaut=True, + ), + + b_OPF = BLOC (condition = "ALGORITHM == 'Optimum Power Flow'", FUEL_COST = SIMP ( statut = "o", typ=bool, defaut=True, @@ -153,15 +180,29 @@ PSSE_PARAMETERS = PROC ( nom = "PSSE_PARAMETERS", typ=bool, defaut=False, ), - I_MAX = SIMP ( statut = "o", - typ='TXM', - into=['RateA','RateB','RateC'], - defaut='RateA', - ), - LOCK_TAPS = SIMP ( statut = "o", - typ=bool, - defaut=True, - ), + ITERATION_LIMIT = SIMP ( statut = "o", + typ = "I", + val_min=1, + defaut=20, + ), + QGEN_CONTROL = SIMP ( statut = "o", + typ = bool, + defaut = True, + ), + b_QgenControl = BLOC (condition = "QGEN_CONTROL == True", + SAVE_CASE_BEFORE_QCONTROL = SIMP ( statut = "o", + typ = bool, + defaut = False, + fr = "Sauvegarder des fichiers de cas avant d'avoir deconnecte les groupes ne produisant pas de la puissance active", + ang = "Save network case files before having disconnected groups that dont generate active power.", + ), + ), + ), + + b_ECD = BLOC (condition = "ALGORITHM == 'Economic Dispatch and Power Flow'", + ecd_file=SIMP(statut="o", typ = ('Fichier', 'Economic Dispatch Files (*.ecd);;All Files (*)',),), + ), + ## P_MIN= SIMP ( statut = "o", ## typ=bool, ## defaut=True, @@ -171,8 +212,8 @@ PSSE_PARAMETERS = PROC ( nom = "PSSE_PARAMETERS", SIMULATION = PROC ( nom = "SIMULATION", op = None, docu = "", - regles =(EXCLUS('NUMBER_PACKAGE','CONVERGENCE'),), - + regles =(EXCLUS('NUMBER_PACKAGE','CONVERGENCE'), UN_PARMI('NUMBER_PACKAGE','CONVERGENCE'),), + SIZE_PACKAGE = SIMP ( statut = "o", typ = "I", val_min=10, @@ -193,8 +234,8 @@ SIMULATION = PROC ( nom = "SIMULATION", ## max=5, ## fr = "Affichage du niveau de wrapper de la bibliotheque Open TURNS", ## ang = "Open TURNS library debug level print", -## ), -) +## ), +) #================================ @@ -218,7 +259,7 @@ CORRELATION = PROC ( nom = 'CORRELATION', #### ), ## ## # Matrix = BLOC ( condition = "Copula in ( 'Normal', )", -## +## CorrelationMatrix = SIMP ( statut = "o", typ = Matrice(nbLigs=None, nbCols=None, @@ -232,7 +273,7 @@ CORRELATION = PROC ( nom = 'CORRELATION', ## #), # Fin BLOC Matrix ## ## -) +) DIRECTORY = MACRO ( nom = 'DIRECTORY', op=None, @@ -248,9 +289,9 @@ DIRECTORY = MACRO ( nom = 'DIRECTORY', results_folder=SIMP(statut="o",typ='Repertoire'), #lines_file=SIMP(statut="o" ,typ = ('Fichier', 'Wrapper Files (*.csv);;All Files (*)',),), #groups_file=SIMP(statut="o", typ = ('Fichier', 'Wrapper Files (*.csv);;All Files (*)',),), - #generationsystem_file=SIMP(statut="o" ,typ = ('Fichier', 'Wrapper Files (*.csv);;All Files (*)',),), - -) + #generationsystem_file=SIMP(statut="o" ,typ = ('Fichier', 'Wrapper Files (*.csv);;All Files (*)',),), + +) @@ -313,6 +354,24 @@ N_1_GENERATORS = PROC( nom="N_1_GENERATORS", ang = "Probability that the generator is not available", validators=VerifTypeTuple((sd_generateur,'R')),), ) +N_1_MOTORS = PROC( nom="N_1_MOTORS", + op = None, + docu = "", + fr = "N-1 moteurs", + ang = "N-1 motors", + Activated = SIMP ( statut='o', typ=bool, defaut=True), +## FileName = SIMP ( statut = "o", +## typ = ('Fichier', 'Wrapper Files (*.csv);;All Files (*)',), +## fr = "chemin du fichier csv des probabilites des defauts generateurs", +## ang = "csv file path with probabilities of generator outages", +## ), + Probability = SIMP ( statut = 'o', + typ = Tuple(2), + max = '**', + fr = "Probabilite d'indisponibilite du moteur", + ang = "Probability that the motor is not available", + validators=VerifTypeTuple((sd_moteur,'R')),), + ) N_1_LOADS = PROC( nom="N_1_LOADS", op = None, docu = "", @@ -344,7 +403,7 @@ N_1_LOADS = PROC( nom="N_1_LOADS", DISTRIBUTION = OPER ( nom = "DISTRIBUTION", sd_prod = loi, op = 68, - fr = "Definitions des lois marginales utilisees par les variables d'entree", + fr = "Definitions des lois marginales utilisees par les variables d'entree", #==== # Choisir generateur ou charge @@ -355,22 +414,29 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", ## ), Activated = SIMP ( statut='o', typ=bool, defaut=True), ComponentType = SIMP (statut='o', typ='TXM', - into = ('Generator','Load','Line','Transformer'),), + into = ('Generator','Load','Motor','Line','Transformer'),), b_gener = BLOC (condition = "ComponentType == 'Generator'", - + Type = SIMP (statut= "o", typ = "TXM", into = ("Generator Power Level", "Generator Availability"), - fr = "Choisir si c'est le niveau de puissance ou la disponibilité du generateur qui sera tiree", + fr = "Choisir si c'est le niveau de puissance ou la disponibilit� du generateur qui sera tiree", ang= "Choose whether the power level or the availability of the generator will be set by the law", defaut = "Generator Power Level", ), - - Generator = SIMP(statut='o',typ=sd_generateur,max="**", homo="SansOrdreNiDoublon"), + + Sampling = SIMP (statut= "o", typ = "TXM", + into = ("Same sample for all generators", "One sample per generator"), + fr = "Choisir si une seule tirage sera fait pour tous les generateurs ou si des tirages differents seront faits pour chaque generateur", + ang= "Choose whether one drawing/sample will be performed for all of the generators or whether a different drawing/sample will be performed for each generator.", + defaut = "Same sample for all generators", + ), + + Generator = SIMP(statut='o',typ=sd_generateur,max="**", homo="SansOrdreNiDoublon",docu="sd_generateur"), #==== # Type de distribution #==== - + b_gener_level = BLOC (condition= "Type == 'Generator Power Level'", Law = SIMP ( statut = "o", typ = "TXM", @@ -389,7 +455,7 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", ang = "1D marginal distribution", ), - + #==== # Definition des parametres selon le type de la loi #==== @@ -424,10 +490,10 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", ang = "Support lower bound", ), - # Il faut definir une collection de couples ( x,p ) + # Il faut definir une collection de couples ( x,p ) Values = SIMP ( statut = 'o', typ = Tuple(2), - max = '**', + max = '**', fr = "Liste de couples : largeur de classe, hauteur de classe", ang = "Class bandwidth, class height couple list", validators=VerifTypeTuple(('R','R')), @@ -474,14 +540,14 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", ), # Fin BLOC RAYLEIGH PDF = BLOC ( condition = " Law in ( 'PDF_from_file', ) ", - + FileName = SIMP ( statut = "o", typ = ('Fichier', 'Wrapper Files (*.csv);;All Files (*)',), fr = "Nom du fichier .csv", ang = ".csv file name", ), ), - + TRUNCATEDNORMAL = BLOC ( condition = " Law in ( 'TruncatedNormal', ) ", @@ -489,7 +555,7 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", MuN = SIMP ( statut = "o", typ = "R", max = 1, - fr = "Moyenne de la loi Normale non tronquée", + fr = "Moyenne de la loi Normale non tronqu�e", ang = "Mean value of the associated non truncated normal distribution", ), @@ -497,7 +563,7 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", typ = "R", max = 1, val_min = 0., - fr = "Ecart-type de la loi Normale non tronquée", + fr = "Ecart-type de la loi Normale non tronqu�e", ang = "Standard deviation of the associated non truncated normal distribution", ), @@ -519,7 +585,7 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", TimeSeries = BLOC ( condition = " Law in ( 'TimeSeries_from_file', ) ", - + FileName = SIMP ( statut = "o", typ = ('Fichier', 'Wrapper Files (*.csv);;All Files (*)',), fr = "Fichier CSV d'une serie temporelle", @@ -549,10 +615,10 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", USERDEFINED = BLOC ( condition = " Law in ( 'UserDefined', ) ", - # Il faut definir une collection de couples ( x,p ) + # Il faut definir une collection de couples ( x,p ) Values = SIMP ( statut = 'o', typ = Tuple(2), - max = '**', + max = '**', fr = "Liste de couples : (valeur, prob.)", ang = "List of pairs : (value, prob.)", validators=VerifTypeTuple(('R','R')), @@ -623,10 +689,10 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", Transfer_Function = FACT(statut='f', - + TF_Input = SIMP ( statut='o', typ = 'TXM', - fr = 'Entrer une fonction de transfert à partir d''un fichier .pow (vitesse de vent - puissance eolienne)\n \ + fr = 'Entrer une fonction de transfert � partir d''un fichier .pow (vitesse de vent - puissance eolienne)\n \ ou entrer une liste de tuples (valeur tiree - puissance normalisee)', ang = 'Enter wind speed - turbine production transfer function as a .pow file, \n \ or enter a generic list of (law output value, normalized power output) tuples', @@ -644,7 +710,7 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", fr = 'Hauteur (en metres) a laquelle les mesures de vitesse du vent ont ete prises', ang = 'Height of wind speed measurements (m)', sug = 10, - val_min = 0, + val_min = 0, ), Hub_Height = SIMP (statut = 'o', typ = "R", @@ -652,7 +718,7 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", ang = 'wind turbine hub height', sug = 80, val_min = 0,), - Alpha = SIMP (statut = 'o', + AlphaWS = SIMP (statut = 'o', typ = "R", fr = 'l''alpha pour extrapoler les mesures de vitesse du vent a la hauteur du moyeu ', ang = 'alpha used to extrapolate wind speed measurements to hub height', @@ -667,7 +733,7 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", defaut = 5, val_min = 0, val_max = 100, - ), + ), ), #fin du bloc FileName b_tuples = BLOC(condition = "TF_Input == 'tuples list'", @@ -681,7 +747,7 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", validators=VerifTypeTuple(('R','R')), ), ), #fin du block Tuples List - + ), #fin du FACT Transfer Function ), #fin du bloc generator level @@ -706,14 +772,14 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", defaut="UserDefined", ), - + #==== # Definition des parametres selon le type de la loi #==== TimeSeries = BLOC ( condition = " Law in ( 'TimeSeries_from_file', ) ", - + FileName = SIMP ( statut = "o", typ = ('Fichier', 'Wrapper Files (*.csv);;All Files (*)',), fr = "Fichier CSV d'une serie temporelle", @@ -724,10 +790,10 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", USERDEFINED = BLOC ( condition = " Law in ( 'UserDefined', ) ", - # Il faut definir une collection de couples ( x,p ) + # Il faut definir une collection de couples ( x,p ) Values = SIMP ( statut = 'o', typ = Tuple(2), - max = '**', + max = '**', fr = "Liste de couples : (valeur, prob.)", ang = "List of pairs : (value, prob.)", validators=VerifTypeTuple(('R','R')), @@ -735,32 +801,40 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", ), ), # Fin BLOC USERDEFINED - + ), #fin du bloc generator avail - + ), #fin du bloc generateur - + +#Bloc Charge b_charge = BLOC (condition = "ComponentType == 'Load'", - + #==== # Type de distribution #==== - + Type = SIMP (statut= "o", typ = "TXM", into = ("Load Level", "Load Availability"), - fr = "Choisir si c'est le niveau de charge ou la disponibilité de la charge qui sera tiree", + fr = "Choisir si c'est le niveau de charge ou la disponibilit� de la charge qui sera tiree", ang= "Choose whether the power level or the availability of the load will be set by the law", defaut = "Load Level", ), + Sampling = SIMP (statut= "o", typ = "TXM", + into = ("Same sample for all loads", "One sample per load"), + fr = "Choisir si une seule tirage sera fait pour tous les charges ou si des tirages differents seront faits pour chaque charge", + ang= "Choose whether one drawing/sample will be performed for all of the loads or whether a different drawing/sample will be performed for each load.", + defaut = "Same sample for all loads", + ), + Load = SIMP(statut='o',typ=sd_charge,max="**", homo="SansOrdreNiDoublon",), b_charge_level = BLOC (condition = "Type == 'Load Level'", - + Law = SIMP ( statut = "o", typ = "TXM", into = ( "Exponential", "Histogram", @@ -777,7 +851,7 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", ang = "1D marginal distribution", ), - + #==== # Definition des parametres selon le type de la loi #==== @@ -812,10 +886,10 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", ang = "Support lower bound", ), - # Il faut definir une collection de couples ( x,p ) + # Il faut definir une collection de couples ( x,p ) Values = SIMP ( statut = 'o', typ = Tuple(2), - max = '**', + max = '**', fr = "Liste de couples : largeur de classe, hauteur de classe", ang = "Class bandwidth, class height couple list", validators=VerifTypeTuple(('R','R')), @@ -862,14 +936,14 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", ), # Fin BLOC RAYLEIGH PDF = BLOC ( condition = " Law in ( 'PDF_from_file', ) ", - + FileName = SIMP ( statut = "o", typ = ('Fichier', 'Wrapper Files (*.csv);;All Files (*)',), fr = "Nom du fichier .csv", ang = ".csv file name", ), ), - + TRUNCATEDNORMAL = BLOC ( condition = " Law in ( 'TruncatedNormal', ) ", @@ -877,7 +951,7 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", MuN = SIMP ( statut = "o", typ = "R", max = 1, - fr = "Moyenne de la loi Normale non tronquée", + fr = "Moyenne de la loi Normale non tronqu�e", ang = "Mean value of the associated non truncated normal distribution", ), @@ -885,7 +959,7 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", typ = "R", max = 1, val_min = 0., - fr = "Ecart-type de la loi Normale non tronquée", + fr = "Ecart-type de la loi Normale non tronqu�e", ang = "Standard deviation of the associated non truncated normal distribution", ), @@ -907,7 +981,7 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", TimeSeries = BLOC ( condition = " Law in ( 'TimeSeries_from_file', ) ", - + FileName = SIMP ( statut = "o", typ = ('Fichier', 'Wrapper Files (*.csv);;All Files (*)',), fr = "Fichier CSV d'une serie temporelle", @@ -937,10 +1011,10 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", USERDEFINED = BLOC ( condition = " Law in ( 'UserDefined', ) ", - # Il faut definir une collection de couples ( x,p ) + # Il faut definir une collection de couples ( x,p ) Values = SIMP ( statut = 'o', typ = Tuple(2), - max = '**', + max = '**', fr = "Liste de couples : (valeur, probabilite)", ang = "List of pairs : (value, probability)", validators=VerifTypeTuple(('R','R')), @@ -1013,7 +1087,7 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", b_charge_avail = BLOC (condition = "Type == 'Load Availability'", - + Law = SIMP ( statut = "o", typ = "TXM", into = ( #"Exponential", #"Histogram", @@ -1031,13 +1105,13 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", defaut = "UserDefined", ), - + #==== # Definition des parametres selon le type de la loi #==== TimeSeries = BLOC ( condition = " Law in ( 'TimeSeries_from_file', ) ", - + FileName = SIMP ( statut = "o", typ = ('Fichier', 'Wrapper Files (*.csv);;All Files (*)',), fr = "Fichier CSV d'une serie temporelle", @@ -1049,10 +1123,10 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", USERDEFINED = BLOC ( condition = " Law in ( 'UserDefined', ) ", - # Il faut definir une collection de couples ( x,p ) + # Il faut definir une collection de couples ( x,p ) Values = SIMP ( statut = 'o', typ = Tuple(2), - max = '**', + max = '**', fr = "Liste de couples : (valeur, probabilite)", ang = "List of pairs : (value, probability)", validators=VerifTypeTuple(('R','R')), @@ -1063,18 +1137,353 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", ), #fin du block Load Avail - + ), #fin du bloc charge - + + + +#Bloc Moteur + b_moteur = BLOC (condition = "ComponentType == 'Motor'", + + +#==== +# Type de distribution +#==== + + Type = SIMP (statut= "o", typ = "TXM", + into = ("Motor Level", "Motor Availability"), + fr = "Choisir si c'est le niveau de charge du moteur ou la disponibilit� du moteur qui sera tiree", + ang= "Choose whether the power level or the availability of the motor will be set by the law", + defaut = "Motor Level", + ), + + Sampling = SIMP (statut= "o", typ = "TXM", + into = ("Same sample for all motors", "One sample per motor"), + fr = "Choisir si une seule tirage sera fait pour tous les moteurs ou si des tirages differents seront faits pour chaque moteur", + ang= "Choose whether one drawing/sample will be performed for all of the motors or whether a different drawing/sample will be performed for each motor.", + defaut = "Same sample for all motors", + ), + + Motor = SIMP(statut='o',typ=sd_moteur,max="**", homo="SansOrdreNiDoublon",), + + + b_moteur_level = BLOC (condition = "Type == 'Motor Level'", + + Law = SIMP ( statut = "o", typ = "TXM", + into = ( "Exponential", + "Histogram", + "Normal", + #"Rayleigh", + "PDF_from_file", + "TruncatedNormal", + "TimeSeries_from_file", + "Uniform", + "UserDefined", + "Weibull", + ), + fr = "Choix du type de la loi marginale", + ang = "1D marginal distribution", + ), + + +#==== +# Definition des parametres selon le type de la loi +#==== + + + EXPONENTIAL = BLOC ( condition = " Law in ( 'Exponential', ) ", + + Lambda = SIMP ( statut = "o", + typ = "R", + max = 1, + val_min = 0., + fr = "Parametre Lambda | Lambda > 0", + ang = "Lambda parameter | Lambda > 0", + ), + + Gamma = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Borne inferieure du support de la loi", + ang = "Support lower bound", + ), + + ), # Fin BLOC EXPONENTIAL + + + HISTOGRAM = BLOC ( condition = " Law in ( 'Histogram', ) ", + + First = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Borne inferieure du supoport de la loi", + ang = "Support lower bound", + ), + + # Il faut definir une collection de couples ( x,p ) + Values = SIMP ( statut = 'o', + typ = Tuple(2), + max = '**', + fr = "Liste de couples : largeur de classe, hauteur de classe", + ang = "Class bandwidth, class height couple list", + validators=VerifTypeTuple(('R','R')), + ), + + ), # Fin BLOC HISTOGRAM + + + NORMAL = BLOC ( condition = " Law in ( 'Normal', ) ", + + Mu = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Moyenne de la loi", + ang = "Mean value", + ), + + Sigma = SIMP ( statut = "o", + typ = "R", + max = 1, + val_min = 0., + fr = "Ecart type de la loi", + ang = "Standard deviation", + ), + + ), # Fin BLOC NORMAL + + + RAYLEIGH = BLOC ( condition = " Law in ( 'Rayleigh', ) ", + + Sigma = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Parametre Sigma de la loi | Sigma > 0", + ang = "Sigma parameter | Sigma > 0", + ), + + Gamma = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Borne inferieure du support de la loi", + ang = "Support lower bound", + ), + ), # Fin BLOC RAYLEIGH + + PDF = BLOC ( condition = " Law in ( 'PDF_from_file', ) ", + + FileName = SIMP ( statut = "o", + typ = ('Fichier', 'Wrapper Files (*.csv);;All Files (*)',), + fr = "Nom du fichier .csv", + ang = ".csv file name", + ), + ), + + + + TRUNCATEDNORMAL = BLOC ( condition = " Law in ( 'TruncatedNormal', ) ", + + MuN = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Moyenne de la loi Normale non tronqu�e", + ang = "Mean value of the associated non truncated normal distribution", + ), + + SigmaN = SIMP ( statut = "o", + typ = "R", + max = 1, + val_min = 0., + fr = "Ecart-type de la loi Normale non tronqu�e", + ang = "Standard deviation of the associated non truncated normal distribution", + ), + + A = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Borne inferieure de la loi | A < B", + ang = "Lower bound | A < B", + ), + + B = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Borne superieure de la loi | A < B", + ang = "Upper bound | A < B", + ), + + ), # Fin BLOC TRUNCATEDNORMAL + + + TimeSeries = BLOC ( condition = " Law in ( 'TimeSeries_from_file', ) ", + + FileName = SIMP ( statut = "o", + typ = ('Fichier', 'Wrapper Files (*.csv);;All Files (*)',), + fr = "Fichier CSV d'une serie temporelle", + ang = "CSV file of a time series", + ), + ), + + + UNIFORM = BLOC ( condition = " Law in ( 'Uniform', ) ", + + A = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Borne inferieure du support de la loi | A < B", + ang = "Support lower bound | A < B", + ), + + B = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Borne superieure du support de la loi | A < B", + ang = "Support upper bound | A < B", + ), + + ), # Fin BLOC UNIFORM + + + USERDEFINED = BLOC ( condition = " Law in ( 'UserDefined', ) ", + + # Il faut definir une collection de couples ( x,p ) + Values = SIMP ( statut = 'o', + typ = Tuple(2), + max = '**', + fr = "Liste de couples : (valeur, probabilite)", + ang = "List of pairs : (value, probability)", + validators=VerifTypeTuple(('R','R')), + ), + + ), # Fin BLOC USERDEFINED + + + WEIBULL = BLOC ( condition = " Law in ( 'Weibull', ) ", + + Settings = SIMP ( statut = "o", + typ = "TXM", + max = 1, + into = ( "AlphaBeta", "MuSigma" ), + defaut = "AlphaBeta", + fr = "Parametrage de la loi weibull", + ang = "Weibull distribution parameter set", + ), + + AlphaBeta_Parameters = BLOC ( condition = " Settings in ( 'AlphaBeta', ) ", + + Alpha = SIMP ( statut = "o", + typ = "R", + max = 1, + val_min = 0., + fr = "Parametre Alpha de la loi | Alpha > 0", + ang = "Alpha parameter | Alpha > 0", + ), + + Beta = SIMP ( statut = "o", + typ = "R", + max = 1, + val_min = 0., + fr = "Parametre Beta de la loi | Beta > 0", + ang = "Beta parameter | Beta > 0", + ), + + ), # Fin BLOC AlphaBeta_Parameters + + + MuSigma_Parameters = BLOC ( condition = " Settings in ( 'MuSigma', ) ", + + Mu = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Moyenne de la loi", + ang = "Mean value", + ), + + Sigma = SIMP ( statut = "o", + typ = "R", + max = 1, + val_min = 0., + fr = "Ecart type de la loi", + ang = "Standard deviation", + ), + + ), # Fin BLOC MuSigma_Parameters + + Gamma = SIMP ( statut = "o", + typ = "R", + max = 1, + fr = "Borne inferieure du support de la loi", + ang = "Support lower bound", + ), + + ), # Fin BLOC WEIBULL + + ), #fin du block Load Level + + + b_moteur_avail = BLOC (condition = "Type == 'Motor Availability'", + + Law = SIMP ( statut = "o", typ = "TXM", + into = ( #"Exponential", + #"Histogram", + #"Normal", + #"Rayleigh", + #"PDF_from_file", + #"TruncatedNormal", + "TimeSeries_from_file", + #"Uniform", + "UserDefined", + #"Weibull", + ), + fr = "Choix du type de la loi marginale", + ang = "1D marginal distribution", + defaut = "UserDefined", + ), + + +#==== +# Definition des parametres selon le type de la loi +#==== + + TimeSeries = BLOC ( condition = " Law in ( 'TimeSeries_from_file', ) ", + + FileName = SIMP ( statut = "o", + typ = ('Fichier', 'Wrapper Files (*.csv);;All Files (*)',), + fr = "Fichier CSV d'une serie temporelle", + ang = "CSV file of a time series", + ), + ), + + + + USERDEFINED = BLOC ( condition = " Law in ( 'UserDefined', ) ", + + # Il faut definir une collection de couples ( x,p ) + Values = SIMP ( statut = 'o', + typ = Tuple(2), + max = '**', + fr = "Liste de couples : (valeur, probabilite)", + ang = "List of pairs : (value, probability)", + validators=VerifTypeTuple(('R','R')), + defaut=((0,0.0),(1,1.0)), + ), + + ), # Fin BLOC USERDEFINED + + + ), #fin du block Load Avail + + + ), #fin du bloc moteur + b_ligne = BLOC (condition = "ComponentType == 'Line'", - + #==== # Type de distribution #==== - + Type = SIMP (statut= "o", typ = "TXM", into = ("Line Availability",), fr = "La disponibilite de la ligne sera tiree", @@ -1082,6 +1491,13 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", defaut = "Line Availability", ), + Sampling = SIMP (statut= "o", typ = "TXM", + into = ("Same sample for all lines", "One sample per line"), + fr = "Choisir si une seule tirage sera fait pour tous les lignes ou si des tirages differents seront faits pour chaque ligne", + ang= "Choose whether one drawing/sample will be performed for all of the lines or whether a different drawing/sample will be performed for each line.", + defaut = "Same sample for all lines", + ), + Line = SIMP(statut='o',typ=sd_ligne,max="**", homo="SansOrdreNiDoublon"), Law = SIMP ( statut = "o", typ = "TXM", @@ -1101,7 +1517,7 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", ang = "1D marginal distribution", ), - + #==== # Definition des parametres selon le type de la loi #==== @@ -1136,10 +1552,10 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", ang = "Support lower bound", ), - # Il faut definir une collection de couples ( x,p ) + # Il faut definir une collection de couples ( x,p ) Values = SIMP ( statut = 'o', typ = Tuple(2), - max = '**', + max = '**', fr = "Liste de couples : largeur de classe, hauteur de classe", ang = "Class bandwidth, class height couple list", validators=VerifTypeTuple(('R','R')), @@ -1186,14 +1602,14 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", ), # Fin BLOC RAYLEIGH PDF = BLOC ( condition = " Law in ( 'PDF_from_file', ) ", - + FileName = SIMP ( statut = "o", typ = ('Fichier', 'Wrapper Files (*.csv);;All Files (*)',), fr = "Nom du fichier .csv", ang = ".csv file name", ), ), - + TRUNCATEDNORMAL = BLOC ( condition = " Law in ( 'TruncatedNormal', ) ", @@ -1201,7 +1617,7 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", MuN = SIMP ( statut = "o", typ = "R", max = 1, - fr = "Moyenne de la loi Normale non tronquée", + fr = "Moyenne de la loi Normale non tronqu�e", ang = "Mean value of the associated non truncated normal distribution", ), @@ -1209,7 +1625,7 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", typ = "R", max = 1, val_min = 0., - fr = "Ecart-type de la loi Normale non tronquée", + fr = "Ecart-type de la loi Normale non tronqu�e", ang = "Standard deviation of the associated non truncated normal distribution", ), @@ -1231,7 +1647,7 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", TimeSeries = BLOC ( condition = " Law in ( 'TimeSeries_from_file', ) ", - + FileName = SIMP ( statut = "o", typ = ('Fichier', 'Wrapper Files (*.csv);;All Files (*)',), fr = "Fichier CSV d'une serie temporelle", @@ -1261,10 +1677,10 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", USERDEFINED = BLOC ( condition = " Law in ( 'UserDefined', ) ", - # Il faut definir une collection de couples ( x,p ) + # Il faut definir une collection de couples ( x,p ) Values = SIMP ( statut = 'o', typ = Tuple(2), - max = '**', + max = '**', fr = "Liste de couples : (valeur, probabilite)", ang = "List of pairs : (value, probability)", validators=VerifTypeTuple(('R','R')), @@ -1335,14 +1751,14 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", ), # Fin BLOC WEIBULL ), #fin du bloc ligne - + b_transfo = BLOC (condition = "ComponentType == 'Transformer'", - + #==== # Type de distribution #==== - + Type = SIMP (statut= "o", typ = "TXM", into = ("Transformer Availability",), fr = "La disponibilite du transformateur sera tiree", @@ -1350,10 +1766,17 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", defaut = "Transformer Availability" ), + Sampling = SIMP (statut= "o", typ = "TXM", + into = ("Same sample for all transformers", "One sample per transformer"), + fr = "Choisir si une seule tirage sera fait pour tous les transforamteurs ou si des tirages differents seront faits pour chaque transformateur", + ang= "Choose whether one drawing/sample will be performed for all of the tranformers or whether a different drawing/sample will be performed for each transformer.", + defaut = "Same sample for all transformers", + ), + Transformer = SIMP(statut='o',typ=sd_transfo,max="**", homo="SansOrdreNiDoublon"), Law = SIMP ( statut = "o", typ = "TXM", - into = ( #"Beta", + into = ( #"Beta", #"Exponential", #"Gamma", #"Geometric", @@ -1381,13 +1804,13 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", ang = "1D marginal distribution", ), - + #==== # Definition des parametres selon le type de la loi #==== ## NONPARAM = BLOC ( condition = " Law in ( 'NonParametrique', ) ", -## +## ## FileName = SIMP ( statut = "o", ## typ = ('Fichier', 'Wrapper Files (*.csv);;All Files (*)',), ## fr = "Nom du modele physique", @@ -1629,10 +2052,10 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", ang = "Support lower bound", ), - # Il faut definir une collection de couples ( x,p ) + # Il faut definir une collection de couples ( x,p ) Values = SIMP ( statut = 'o', typ = Tuple(2), - max = '**', + max = '**', fr = "Liste de couples : largeur de classe, hauteur de classe", ang = "Class bandwidth, class height couple list", validators=VerifTypeTuple(('R','R')), @@ -1651,7 +2074,7 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", # fr = "Parametre Lambda | Lambda > 0", # ang = "Lambda parameter | Lambda > 0", # ), -# +# # Mu = SIMP ( statut = "o", # typ = "R", # max = 1, @@ -1726,7 +2149,7 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", # fr = "Ecart type du log", # ang = "Log standard deviation", # ), -# +# # ), # Fin BLOC MuSigmaLog_Parameters # # Gamma = SIMP ( statut = "o", @@ -1762,7 +2185,7 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", # # # MULTINOMIAL = BLOC ( condition = " Law in ( 'MultiNomial', ) ", -# +# # N = SIMP ( statut = "o", # typ = "I", # max = 1, @@ -1770,11 +2193,11 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", # ang = "N parameter | N > 0", # ), # -# # Il faut definir une collection de couples ( x,p ) +# # Il faut definir une collection de couples ( x,p ) # Values = SIMP ( statut = 'o', # typ = "R", # max = '**', -# fr = "Liste de probabilités", +# fr = "Liste de probabilit�s", # ang = "Probability list", # validators=VerifTypeTuple(('R','R')), # ), @@ -1797,7 +2220,7 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", # fr = "Parametre Delta de la loi | Delta > 0", # ang = "Delta parameter | Delta > 0", # ), -# +# # Gamma = SIMP ( statut = "o", # typ = "R", # max = 1, @@ -1861,14 +2284,14 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", # ), # Fin BLOC RAYLEIGH PDF = BLOC ( condition = " Law in ( 'PDF_from_file', ) ", - + FileName = SIMP ( statut = "o", typ = ('Fichier', 'Wrapper Files (*.csv);;All Files (*)',), fr = "Nom du fichier .csv", ang = ".csv file name", ), ), - + # STUDENT = BLOC ( condition = " Law in ( 'Student', ) ", # # Mu = SIMP ( statut = "o", @@ -1929,7 +2352,7 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", MuN = SIMP ( statut = "o", typ = "R", max = 1, - fr = "Moyenne de la loi Normale non tronquée", + fr = "Moyenne de la loi Normale non tronqu�e", ang = "Mean value of the associated non truncated normal distribution", ), @@ -1937,7 +2360,7 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", typ = "R", max = 1, val_min = 0., - fr = "Ecart-type de la loi Normale non tronquée", + fr = "Ecart-type de la loi Normale non tronqu�e", ang = "Standard deviation of the associated non truncated normal distribution", ), @@ -1959,7 +2382,7 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", TimeSeries = BLOC ( condition = " Law in ( 'TimeSeries_from_file', ) ", - + FileName = SIMP ( statut = "o", typ = ('Fichier', 'Wrapper Files (*.csv);;All Files (*)',), fr = "Fichier CSV d'une serie temporelle", @@ -1989,10 +2412,10 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", USERDEFINED = BLOC ( condition = " Law in ( 'UserDefined', ) ", - # Il faut definir une collection de couples ( x,p ) + # Il faut definir une collection de couples ( x,p ) Values = SIMP ( statut = 'o', typ = Tuple(2), - max = '**', + max = '**', fr = "Liste de couples : (valeur, probabilite)", ang = "List of pairs : (value, probability)", validators=VerifTypeTuple(('R','R')), @@ -2064,21 +2487,12 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", - ), #fin du bloc transformer - + ), #fin du bloc transformer -) + +) Classement_Commandes_Ds_Arbre=('DIRECTORY', 'DISTRIBUTION', 'CORRELATION',) Ordre_Des_Commandes = ( 'DIRECTORY', 'PSSE_PARAMETERS', 'SIMULATION', 'DISTRIBUTION', 'CORRELATION', 'N_1_GENERATORS', 'N_1_LINES', 'N_1_TRANSFORMERS', 'N_1_LOADS',) - - - - - - - - - diff --git a/PSEN_Eficas/mesScripts_PSEN.py b/PSEN_Eficas/mesScripts_PSEN.py index a64083aa..3e795416 100644 --- a/PSEN_Eficas/mesScripts_PSEN.py +++ b/PSEN_Eficas/mesScripts_PSEN.py @@ -1,14 +1,95 @@ -def exportToCsv(editor,cmd) : - #from PyQt4.QtGui import QFileDialog - # selection fichier - #fn = QFileDialog.getOpenFileName() - #if not fn : return - #FichieraTraduire=str(fn) - print "je suis la" - print editor - print cmd +def exportToCsv(listeparam) : + texte="" + editor= listeparam[0] + item = listeparam[1] + fn=None + try : + from PyQt4.QtGui import QFileDialog, QMessageBox + fichier = QFileDialog.getOpenFileName() + if fichier == None : return + except : + try : + from PyQt5.QtWidgets import QFileDialog, QMessageBox + fichier = QFileDialog.getOpenFileName() + if fichier[0] == None : return + fichier=fichier[0] + except: + pass -def importFromCsv(editor,cmd) : + nouvelleVal=[] + prob=item.object.get_child('Probability') + valeur=prob.get_valeur() + texte="" + for v in valeur : + texte+=v[0].nom+";"+str(v[1]).replace('.',',')+"\n" + + try : + fn=open(fichier,'wb') + fn.write(texte) + fn.close() + except Exception, why: + QMessageBox.critical(editor, ("Save file failed"), + ('unable to save ')+str(fn) + str(why)) + + +def importFromCsv(listeparam) : + texte="" + editor= listeparam[0] + item = listeparam[1] + node = listeparam[2] + fn=None + try : + from PyQt4.QtGui import QFileDialog + fichier = QFileDialog.getOpenFileName() + if fichier == None : return + fn=open(fichier) + except : + try : + from PyQt5.QtWidgets import QFileDialog + fichier = QFileDialog.getOpenFileName() + if fichier[0] == None : return + fn=open(fichier[0]) + except: + pass + #fn=open('Classeur1.csv') + if not fn : return + nouvelleVal=[] + prob=item.object.get_child('Probability') + monType=prob.definition.validators.typeDesTuples[0] + listeObjet=item.object.etape.parent.get_sd_avant_du_bon_type(item.object.etape,(monType,)) + for ligne in fn.readlines(): + try : + nom,valeur = ligne.split(';') + except : + texte += "not able to process: "+ ligne + continue + if nom not in listeObjet : + texte += nom + " : ignored (not known in Eficas) \n " + continue + try : + concept=item.jdc.get_concept(nom) + except : + texte += nom + ": ignored (not known in Eficas) \n " + continue + try : + valNum=valeur.replace (',','.') + valeur=eval (valNum, {}) + except : + texte += valeur + " : unable to eval \n " + continue + nouvelleVal.append((concept,valeur)) + # exec nom in self.jdc + + if nouvelleVal != [] : prob.set_valeur(nouvelleVal) + if texte != "" : + try : + from PyQt5.QtWidgets import QMessageBox + except : + from PyQt4.QtGui import QMessageBox + QMessageBox.information( None,'unable to append values',texte,) + + node.affichePanneau() + print "et ici" # le dictionnaire des commandes a la structure suivante : @@ -22,7 +103,11 @@ def importFromCsv(editor,cmd) : # - toolTip dict_commandes={ 'N_1_GENERATORS':( - (exportToCsv,"exportToCsv",('editor','self'),False,False,"export values to cvs File"), - (importFromToCsv,"importFromToCsv",('editor','self'),False,False,"import values from cvs File"), + (exportToCsv,"exportToCsv",('editor','item'),False,False,"export values to cvs File"), + (importFromCsv,"importFromCsv",('editor','item','self'),False,False,"import values from cvs File"), + ), + 'N_1_LINES':( + (exportToCsv,"exportToCsv",('editor','item'),False,False,"export values to cvs File"), + (importFromCsv,"importFromCsv",('editor','item','self'),False,False,"import values from cvs File"), ) } diff --git a/PSEN_Eficas/opsPSEN.py b/PSEN_Eficas/opsPSEN.py index 1e641cfd..09c331f4 100755 --- a/PSEN_Eficas/opsPSEN.py +++ b/PSEN_Eficas/opsPSEN.py @@ -28,15 +28,21 @@ def INCLUDE(self,PSSE_path,sav_file,**args): if sav_file==None: return reevalue=0 + listeADeTruire=[] + listeNouveau=[] + toClean=False if hasattr(self,'fichier_ini'): reevalue=1 if self.fichier_ini == sav_file : return + self.fichier_ini=sav_file if hasattr(self,'old_context_fichier_init' ): + toClean=True for concept in self.old_context_fichier_init.values(): - self.jdc.delete_concept(concept) + #self.jdc.delete_concept(concept) + listeADeTruire.append(concept) self.jdc_aux=None self.contexte_fichier_init={} - self.reevalue_sd_jdc() + #self.reevalue_sd_jdc() self.jdc.reset_context() self.fichier_ini=sav_file @@ -47,11 +53,11 @@ def INCLUDE(self,PSSE_path,sav_file,**args): unite = 999 - try : - #if 1: - MachineDico,LoadDico,LineDico,TransfoDico = ExtractGeneratorLoadLineandTransfoDico2(sav_file,PSSE_path) - #else : - except : + #try : + if 1: + MachineDico,LoadDico,LineDico,TransfoDico, MotorDico = ExtractGeneratorLoadLineandTransfoDico2(sav_file,PSSE_path) + else : + #except : if self.jdc.appli is not None: self.jdc.appli.affiche_alerte("Error", 'An error happened in ExtractGeneratorandLoadList execution ') self.g_context = {} @@ -60,17 +66,26 @@ def INCLUDE(self,PSSE_path,sav_file,**args): self.fichier_err = str(exc) self.contexte_fichier_init = {} + for nom in MachineDico.keys(): self.fichier_text += "%s=MONGENER(ID='%s',);\n" % (nom, 'a') + listeNouveau.append(nom) for nom in LoadDico.keys(): self.fichier_text += "%s=MACHARGE(ID='%s',);\n" % (nom, 'a') + listeNouveau.append(nom) for nom in LineDico.keys(): self.fichier_text += "%s=MALIGNE(ID='%s',);\n" % (nom,'a') + listeNouveau.append(nom) for nom in TransfoDico.keys(): self.fichier_text += "%s=MONTRANSFO(ID='%s',);\n" % (nom,'a') + listeNouveau.append(nom) + + for nom in MotorDico.keys(): + self.fichier_text += "%s=MONMOTEUR(ID='%s',);\n" % (nom,'a') + listeNouveau.append(nom) import Extensions.jdc_include self.JdC_aux = Extensions.jdc_include.JDC_CATA_INCLUDE(code='PSEN', execmodul=None) @@ -82,6 +97,12 @@ def INCLUDE(self,PSSE_path,sav_file,**args): self.jdc.LoadDico=LoadDico self.jdc.LineDico=LineDico self.jdc.TransfoDico=TransfoDico + self.jdc.MotorDico = MotorDico + + if toClean: + for concept in listeADeTruire : + if concept.nom not in listeNouveau: self.jdc.delete_concept(concept) + self.reevalue_sd_jdc() def INCLUDE_context(self,d): """ diff --git a/PSEN_N1/PSEN_Cata_N1.py b/PSEN_N1/PSEN_Cata_N1.py new file mode 100644 index 00000000..6d926367 --- /dev/null +++ b/PSEN_N1/PSEN_Cata_N1.py @@ -0,0 +1,199 @@ +# -*- coding: iso-8859-1 -*- +# Copyright (C) 2007-2013 EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library 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 +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +# -------------------------------------------------- +# debut entete +# -------------------------------------------------- + +#from Accas import ASSD, JDC_CATA, AU_MOINS_UN, PROC, SIMP, FACT, OPER, MACRO, BLOC, A_VALIDATOR +from Accas import * +import opsPSEN_N1 +# +#class loi ( ASSD ) : pass +#class variable ( ASSD ) : pass +class sd_charge ( ASSD ) : pass +class sd_generateur ( ASSD ) : pass +class sd_ligne ( ASSD ) : pass +class sd_transfo ( ASSD ) : pass +class sd_moteur ( ASSD ) : pass +# + +# import types +class Tuple: + def __init__(self,ntuple): + self.ntuple=ntuple + + def __convert__(self,valeur): + if type(valeur) == types.StringType: + return None + if len(valeur) != self.ntuple: + return None + return valeur + + def info(self): + return "Tuple de %s elements" % self.ntuple + + __repr__=info + __str__=info + +# class Matrice: +# def __init__(self,nbLigs=None,nbCols=None,methodeCalculTaille=None,formatSortie="ligne",valSup=None,valMin=None,structure=None): +# self.nbLigs=nbLigs +# self.nbCols=nbCols +# self.methodeCalculTaille=methodeCalculTaille +# self.formatSortie=formatSortie +# self.valSup=valSup +# self.valMin=valMin +# self.structure=structure +# +# def __convert__(self,valeur): +# # Attention ne verifie pas grand chose +# if type(valeur) != types.ListType : +# return None +# return valeur +# +# def info(self): +# return "Matrice %s x %s" % (self.nbLigs, self.nbCols) +# +# __repr__=info +# __str__=info + + +#CONTEXT.debug = 1 +JdC = JDC_CATA ( code = 'PSEN', + execmodul = None, + regles = ( AU_MOINS_UN ( 'CASE_SELECTION' ), + # AU_MOINS_UN ( 'DIRECTORY' ), + # AU_MOINS_UN ( 'DISTRIBUTION' ), + # AU_MOINS_UN ( 'SIMULATION' ), + # AU_PLUS_UN ( 'PSSE_PARAMETERS' ), + # AU_PLUS_UN ( 'DIRECTORY' ), + # AU_PLUS_UN ( 'SIMULATION' ), + # AU_PLUS_UN ( 'CORRELATION' ), + # AU_PLUS_UN ( 'N_1_GENERATORS' ), + # AU_PLUS_UN ( 'N_1_LINES' ), + # AU_PLUS_UN ( 'N_1_LOADS' ), + # AU_PLUS_UN ( 'N_1_TRANSFORMERS' ), + + ), + ) # Fin JDC_CATA + + +# -------------------------------------------------- +# fin entete +# -------------------------------------------------- +## TODO : RUN +CASE_SELECTION = MACRO ( nom = "CASE_SELECTION", + sd_prod = opsPSEN_N1.INCLUDE, + op_init = opsPSEN_N1.INCLUDE_context, + regles = (UN_PARMI('FromFile', 'AllCases', 'WorstCases'),), + fichier_ini = 1, + op = None, + fr = "Sélectionnez les cas à analyser", + ang = 'Select the cases to analyze', + PSSE_path = SIMP(statut="o",typ='Repertoire',defaut='C:\Program Files (x86)\PTI\PSSE33\PSSBIN'), + output_folder = SIMP(statut="o", typ="Repertoire"), + + FromFile = FACT( + statut = 'f', + input_path = SIMP(statut="f",typ='Repertoire'), + branch_cases = SIMP(statut='o', typ='TXM'), + transfo_cases = SIMP(statut='o', typ='TXM'), + high_cases = SIMP(statut='o', typ='TXM'), + low_cases = SIMP(statut='o', typ='TXM'), + ), + + AllCases = FACT( + statut='f', + all_cases = SIMP(statut='o', typ=bool, defaut = True), + ), + + WorstCases = FACT( + regles = (UN_PARMI('AvgBranchLoad', 'AvgBranchLoadPercent'), UN_PARMI('AvgTransfoLoad', 'AvgTransfoLoadPercent'), UN_PARMI('AvgHighVoltage', 'AvgHighVoltagePercent'), UN_PARMI('AvgLowVoltage', 'AvgLowVoltagePercent'),), + statut = 'f', + AvgBranchLoad = SIMP(statut = 'f', typ = 'I', defaut = 0, val_min = 0), + AvgBranchLoadPercent = SIMP(statut = 'f', typ = 'I', defaut = 0, val_min = 0, val_max = 100), + AvgTransfoLoad = SIMP(statut = 'f', typ = 'I', defaut = 0, val_min = 0), + AvgTransfoLoadPercent = SIMP(statut = 'f', typ = 'I', defaut = 0, val_min = 0, val_max = 100), + AvgHighVoltage = SIMP(statut = 'f', typ = 'I', defaut = 0, val_min = 0), + AvgHighVoltagePercent = SIMP(statut = 'f', typ = 'I', defaut = 0, val_min = 0, val_max = 100), + AvgLowVoltage = SIMP(statut = 'f', typ = 'I', defaut = 0, val_min = 0), + AvgLowVoltagePercent = SIMP(statut = 'f', typ = 'I', defaut = 0, val_min = 0, val_max = 100), + ), + + MaxDepth = SIMP(statut = 'o', typ = 'I', defaut = 5), + Consigne = SIMP(statut = "o",homo = 'information',typ = "TXM", defaut = "complete CASE SELECTION"), + + BusesList = SIMP(statut = 'f', typ = 'R', min = 0, max = '**', defaut = (), homo = 'SansOrdreNiDoublon'), + + optionsLF = FACT ( + statut = 'o', + AdjTaps = SIMP(statut = 'o', typ = 'TXM', into = ['0 - Lock', '1 - Stepping', '2 - Direct'], defaut = '1 - Stepping'), + AdjDCtaps = SIMP(statut = 'o', typ = 'TXM', into = ['0 - Disable', '1 - Enable'], defaut = '1 - Enable'), + SolutionMethod = SIMP(statut = 'o', typ = 'TXM', into = ['0 - FDNS', '1 - FNSL', '2 - Optimized FDNS'], defaut = '1 - FNSL'), + AdjSwitchedShunts = SIMP(statut = 'o', typ = 'TXM', into = ['0 - Disable', '1 - Enable', '2 - Enable continuous mode'], defaut = '1 - Enable'), + DispatchMode = SIMP(statut = 'o', typ = 'TXM', into = ['0 - Disable', '1 - Reserve', '2 - Pmax', '3 - Inertia', '4 - Droop'], defaut = '1 - Reserve'), + FlatStart = SIMP(statut = 'o', typ = bool, defaut = False), + VarLimits = SIMP(statut = 'o', typ = 'I', defaut = 99), + ), + ) + +CONTINGENCY_OPTIONS = PROC ( nom = 'CONTINGENCY_OPTIONS', + op = None, + fr = "Definitions des lois marginales utilisees par les variables d'entree", + ang = 'Nyu', + Vmin = SIMP(statut = 'o', typ = 'R', defaut = 0.9, val_min = 0), + Vmax = SIMP(statut = 'o', typ = 'R', defaut = 1.1, val_min = 0), + ContRate = SIMP(statut = 'o', typ = 'TXM', defaut = 'a', into=['a', 'b']), + FlowLimitLines = SIMP(statut = 'o', typ = 'I', defaut = 110, val_min = 0), + FloLimitTransfos = SIMP(statut = 'o', typ = 'I', defaut = 100, val_min = 0), + Tolance = SIMP(statut = 'o', typ = 'I', defaut = 10, val_min = 0), + RadialLinesOnly = SIMP(statut = 'o', typ = bool, defaut = False), + TripTransfos = SIMP(statut = 'o', typ = bool, defaut = True), + TripGenerators = SIMP(statut = 'o', typ = bool, defaut = True), + TripN_2 = SIMP(statut = 'o', typ = bool, defaut = False), + IsolatedGen = SIMP(statut = 'o', typ = bool, defaut = True), + ) + +OUTPUT_OPTIONS = PROC ( nom = 'OUTPUT_OPTIONS', + op = None, + fr = "Definitions des lois marginales utilisees par les variables d'entree", + ang = 'Nyu', + TrNoGSUorGNDOutput = SIMP(statut = 'o', typ = bool, defaut = True), + TestBusName = SIMP(statut = 'o', typ = bool, defaut = True), + ReportSpaces = SIMP(statut = 'o', typ = bool, defaut = True), + RepeatComponentAllLines = SIMP(statut = 'o', typ = bool, defaut = True), + MultipleContingencyReport = SIMP(statut = 'o', typ = bool, defaut = True), + WriteIndivExcels = SIMP(statut = 'o', typ = bool, defaut = True), + WriteFlowDifs = SIMP(statut = 'o', typ = bool, defaut = True), + ) + +DATA_PROCESSING = MACRO ( nom = 'DATA_PROCESSING', + sd_prod = opsPSEN_N1.PROCESS, + op_init = opsPSEN_N1.PROCESS_context, + fichier_ini = 1, + op = None, + fr = "Sélectionnez les cas à analyser", + ang = 'Select the cases to analyze', + XLS_file = SIMP(statut="o", typ = ('Fichier', 'XLS file (*.xls);;All Files (*)',),), + Onglets = SIMP(statut = 'f', typ = 'TXM', min = 0, max = '**', homo = 'SansOrdreNiDoublon',into=(),), + BusList = SIMP(statut = 'f', typ = 'TXM', min = 0, max = '**', homo = 'SansOrdreNiDoublon',into=(),), + ContList = SIMP(statut = 'f', typ = 'TXM', min = 0, max = '**', homo = 'SansOrdreNiDoublon',into=(),), + ) diff --git a/PSEN_N1/configuration_PSEN_N1.py b/PSEN_N1/configuration_PSEN_N1.py new file mode 100644 index 00000000..4ab64b85 --- /dev/null +++ b/PSEN_N1/configuration_PSEN_N1.py @@ -0,0 +1,43 @@ +# -*- 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. +# +# +# ====================================================================== +""" + Ce module sert pour charger les paramètres de configuration d'EFICAS +""" +# Modules Python +from InterfaceQT4 import configuration +import os + + +class CONFIG(configuration.CONFIG_BASE): + + #----------------------------------- + def __init__(self,appli,repIni): + #----------------------------------- + + self.labels_user=['catalogues','lang'] + self.labels_eficas=['lang','rep_cata','catalogues'] + + configuration.CONFIG_BASE.__init__(self,appli,'.Eficas_monCode') + + +def make_config(appli,rep): + return CONFIG(appli,rep) + diff --git a/PSEN_N1/opsPSEN_N1.py b/PSEN_N1/opsPSEN_N1.py new file mode 100644 index 00000000..9ea600a6 --- /dev/null +++ b/PSEN_N1/opsPSEN_N1.py @@ -0,0 +1,112 @@ +# -*- coding: iso-8859-1 -*- +# Copyright (C) 2007-2013 EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library 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 +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +#from ExtractGeneratorLoadLineandTransfoDico import * +#from ExtractGeneratorLoadLineandTransfoDico import ExtractGeneratorLoadLineandTransfoDico2 + +def INCLUDE(self,PSSE_path,**args): + """ + Fonction sd_prod pour la macro INCLUDE + """ + #print('in INCLUDE') + #print args + CaseFolder = args['output_folder'] + if CaseFolder==None: return + reevalue=0 + if hasattr(self,'fichier_ini'): + reevalue=1 + if self.fichier_ini == CaseFolder : return + if hasattr(self,'old_context_fichier_init' ): + for concept in self.old_context_fichier_init.values(): + self.jdc.delete_concept(concept) + self.jdc_aux=None + self.contexte_fichier_init={} + self.reevalue_sd_jdc() + self.jdc.reset_context() + + self.fichier_ini=CaseFolder + self.contexte_fichier_init = {} + self.fichier_unite = 999 + self.fichier_err = None + self.fichier_text="" + + unite = 999 + + BusList = [138, 77, 69] + self.jdc.appli.changeIntoMC(self,'BusesList',BusList) + + + +def INCLUDE_context(self,d): + """ + Fonction op_init pour macro INCLUDE + """ + for k,v in self.g_context.items(): + d[k]=v + + +def PROCESS_context(self,d): + print "dans le init du Process" + +def PROCESS(self,XLS_file,**args): + if XLS_file == "" or XLS_file == None: return + if not (hasattr(self,'dico')) : + from Processor import getXLS + self.dico=getXLS(XLS_file) + self.jdc.appli.changeIntoMC(self,'Onglets',self.dico.keys()) + self.OngletsValeurs=[] + else : + # On teste si on a modifie la liste des onglets + OngletsValeurs= self.get_child('Onglets').getval() + + + if not (hasattr(self,'OngletsValeurs')) : self.OngletsValeurs=OngletsValeurs + elif self.OngletsValeurs == OngletsValeurs : print 'return' ;return + else : self.OngletsValeurs=OngletsValeurs + + if OngletsValeurs==() or OngletsValeurs == []: + self.jdc.appli.deleteMC(self,'BusList') + self.jdc.appli.deleteMC(self,'ContList') + self.OngletsValeurs=[] + return + + OldBusValeurs= self.get_child('BusList').getval() + OldContValeurs= self.get_child('ContList').getval() + if OldBusValeurs == None : OldBusValeurs=[] + if OldContValeurs == None : OldContValeurs=[] + + listeBus=[] + listeCont=[] + listeBusCoches=[] + listeContCoches=[] + for o in OngletsValeurs : + for b in self.dico[o][0]: + texte=b+" ("+ str(o) +" )" + listeBus.append(str(texte)) + if texte in OldBusValeurs : listeBusCoches.append(str(texte)) + for c in self.dico[o][1]: + texte=c+" ("+ str(o) +" )" + listeCont.append(str(texte)) + if texte in OldContValeurs : listeContCoches.append(str(texte)) + + self.jdc.appli.changeIntoMCandSet(self,'BusList',listeBus,listeBusCoches) + self.jdc.appli.changeIntoMCandSet(self,'ContList',listeCont,listeContCoches) + + diff --git a/PSEN_N1/prefs.py b/PSEN_N1/prefs.py new file mode 100644 index 00000000..647d0ae9 --- /dev/null +++ b/PSEN_N1/prefs.py @@ -0,0 +1,22 @@ +# Copyright (C) 2007-2012 EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library 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 +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# +code="PSEN_N1" +import sys, os +if os.path.dirname(os.path.abspath(__file__)) not in sys.path : + sys.path.insert(0,os.path.dirname(os.path.abspath(__file__))) diff --git a/PSEN_N1/prefs_PSEN_N1.py b/PSEN_N1/prefs_PSEN_N1.py new file mode 100644 index 00000000..00992868 --- /dev/null +++ b/PSEN_N1/prefs_PSEN_N1.py @@ -0,0 +1,41 @@ +# -*- 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 +# repIni sert a localiser le fichier editeur.ini +# Obligatoire +repIni=os.path.dirname(os.path.abspath(__file__)) +INSTALLDIR=os.path.join(repIni,'..') +sys.path[:0]=[INSTALLDIR] + + +# lang indique la langue utilisee pour les chaines d'aide : fr ou ang +lang='en' #'fr' + +# Codage des strings qui accepte les accents (en remplacement de 'ascii') +encoding='iso-8859-1' +docPath=repIni + + +# +catalogues=( + ('PSEN_N1','default',os.path.join(repIni,'PSEN_Cata_N1.py'),'python','python'), +) diff --git a/PSEN_N1/properties.py b/PSEN_N1/properties.py new file mode 100644 index 00000000..1d328a46 --- /dev/null +++ b/PSEN_N1/properties.py @@ -0,0 +1,24 @@ +#@ MODIF properties Accas DATE 11/06/2008 AUTEUR aster M.ADMINISTRATEUR +# RESPONSABLE D6BHHHH J-P.LEFEBVRE +# ====================================================================== +# COPYRIGHT (C) 1991 - 2001 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. +# ====================================================================== +# IDENTIFICATION DU GESTIONNAIRE DE COMMANDE ACCAS A PARTIR +# DE LA VERSION DU CODE_ASTER ASSOCIE +#---------------------------------------------------------------------- +version = "1.2" +date = "25/05/2010" +exploit = False diff --git a/PSEN_N1/qtEficas_PSEN_N1.py b/PSEN_N1/qtEficas_PSEN_N1.py new file mode 100755 index 00000000..6863fe03 --- /dev/null +++ b/PSEN_N1/qtEficas_PSEN_N1.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Copyright (C) 2007-2012 EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library 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 +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# +""" + Ce module sert a lancer EFICAS configure pour Code_Aster +""" +# Modules Python +# Modules Eficas + +import sys,os +#sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)),'..')) +import prefs +name='prefs_'+prefs.code +__import__(name) + +from InterfaceQT4 import eficas_go +eficas_go.lance_eficas(code=prefs.code) diff --git a/PSEN_N1/run.py b/PSEN_N1/run.py new file mode 100644 index 00000000..4a660891 --- /dev/null +++ b/PSEN_N1/run.py @@ -0,0 +1,15 @@ +import sys + +def runPSEN_N1(dico) : + try : + for k in dico.keys() : + print k + except : + pass + print dico + return 1,'hhhh' + +if __name__ == "__main__": + if dico == None : dico={} + runPSEN_N1(dico) + diff --git a/UiQT5/desWidgetPlusieursInto.ui b/UiQT5/desWidgetPlusieursInto.ui index ebe22329..9d63c15b 100644 --- a/UiQT5/desWidgetPlusieursInto.ui +++ b/UiQT5/desWidgetPlusieursInto.ui @@ -39,7 +39,7 @@ 0 - 2 + 5 @@ -231,6 +231,22 @@ + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 5 + 20 + + + + @@ -317,7 +333,7 @@ 0 0 300 - 95 + 92 @@ -423,7 +439,10 @@ background : rgb(247,247,247) - QFrame::Box + QFrame::NoFrame + + + QFrame::Plain 1 @@ -439,8 +458,8 @@ 0 0 - 422 - 194 + 424 + 193 diff --git a/UiQT5/makefile b/UiQT5/makefile index 881ae82a..b0964354 100644 --- a/UiQT5/makefile +++ b/UiQT5/makefile @@ -13,7 +13,7 @@ PY_FILES = myMain.py desBaseWidget.py desChoixCata.py desChoixCode.py desChoixCo desWidgetMatrice.py desWidgetParam.py desWidgetPlusieursBase.py desWidgetPlusieursInto.py \ desWidgetPlusieursIntoOrdonne.py desWidgetPlusieursTuple.py desWidgetRadioButton.py \ desWidget4a6RadioButton.py desWidgetSimpBase.py desWidgetSDCOInto.py desWidgetSimpBool.py \ - desWidgetSimpSalome.py \ + desWidgetSimpSalome.py toto.py\ desWidgetSimpComplexe.py desWidgetSimpFichier.py desWidgetSimpTxt.py desWidgetTuple2.py \ desWidgetTuple3.py desWidgetVide.py desWidgetUniqueSDCO.py desWidgetPlusieursPlie.py