From: pascale.noyret Date: Tue, 21 Jul 2015 08:30:38 +0000 (+0200) Subject: modif PSEN X-Git-Tag: PSEN_V1~11 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d58ab8e3a458ae7a121d555c8f4daa235a590aa2;p=tools%2Feficas.git modif PSEN --- diff --git a/InterfaceQT4/composimp.py b/InterfaceQT4/composimp.py index decf7062..802a188d 100644 --- a/InterfaceQT4/composimp.py +++ b/InterfaceQT4/composimp.py @@ -142,6 +142,7 @@ class Node(browser.JDCNode,typeNode.PopUpMenuNodeMinimal): # Gestion d'une seule valeur (eventuellement un tuple ou un complexe) if maDefinition.max == 1 : + # A verifier if maDefinition.into != [] and maDefinition.into != None: if len(maDefinition.into) < 4 : from monWidgetRadioButton import MonWidgetRadioButton @@ -218,7 +219,12 @@ class Node(browser.JDCNode,typeNode.PopUpMenuNodeMinimal): # Gestion des listes else : - if maDefinition.into != [] and maDefinition.into != None: + #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(): + from monWidgetPlusieursInto import MonWidgetPlusieursInto + widget=MonWidgetPlusieursInto(self,maDefinition,monNom,monObjet,parentQt,maCommande) + elif self.item.has_into(): if self.item.is_list_SansOrdreNiDoublon(): from monWidgetPlusieursInto import MonWidgetPlusieursInto widget=MonWidgetPlusieursInto(self,maDefinition,monNom,monObjet,parentQt,maCommande) diff --git a/InterfaceQT4/feuille.py b/InterfaceQT4/feuille.py index 1b11cbf0..8eef0582 100644 --- a/InterfaceQT4/feuille.py +++ b/InterfaceQT4/feuille.py @@ -79,30 +79,16 @@ class Feuille(QWidget,ContientIcones,SaisieValeur,FacultatifOuOptionnel): # self.debutToolTip=nomTraduit+"\n" longueur=QFontMetrics(self.label.font()).width(nomTraduit) if longueur >= nomMax : - print "je formate" nouveauNom=self.formate(nomTraduit) - print"________" - print nouveauNom - print"________" - print self - #self.label.setTextFormat(Qt.AutoText) self.label.setText(nouveauNom) - #self.agrandit() else : self.label.setText(nomTraduit) def agrandit(self): # inutile pour certains widgets if self.height() < 40 : - print "j agrandis" self.setMinimumHeight(50) - #self.setMaximumHeight(50) self.resize(self.width(),200) - #self.principalLayout.setAlignment(Qt.AlignTop) - #self.label.resize(self.label.width(),200) - print self.label.height() - print self.height() - print "__________" def setValeurs(self): @@ -120,7 +106,7 @@ class Feuille(QWidget,ContientIcones,SaisieValeur,FacultatifOuOptionnel): def setCommentaire(self): c = self.debutToolTip - if self.node.item.definition.validators : c+=self.node.item.definition.validators.aide() + #if self.node.item.definition.validators : c+=self.node.item.definition.validators.aide() self.aide=c if self.objSimp.get_fr() != None and self.objSimp.get_fr() != "": c2 = '

'+c+str(self.objSimp.get_fr())+"

" diff --git a/InterfaceQT4/monWidgetHeure.py b/InterfaceQT4/monWidgetHeure.py index 35514035..b576b589 100644 --- a/InterfaceQT4/monWidgetHeure.py +++ b/InterfaceQT4/monWidgetHeure.py @@ -26,27 +26,11 @@ from PyQt4.QtCore import * from Extensions.i18n import tr from feuille import Feuille -from monWidgetSimpTuple import MonWidgetSimpTuple +from monWidgetSimpBase import MonWidgetSimpBase from desWidgetHeure import Ui_WidgetHeure -class MonWidgetHeure (Ui_WidgetHeure,MonWidgetSimpTuple): +class MonWidgetHeure (Ui_WidgetHeure,MonWidgetSimpBase): def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande): - self.nbValeurs=3 - MonWidgetSimpTuple.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande) - if self.objSimp.isImmuable() : - self.lineEditVal1.setDisabled(True) - self.lineEditVal2.setDisabled(True) - self.lineEditVal3.setDisabled(True) - self.lineEditVal1.setStyleSheet(QString.fromUtf8("background:rgb(244,244,244);\n" "border:0px;\n")) - self.lineEditVal2.setStyleSheet(QString.fromUtf8("background:rgb(244,244,244);\n" "border:0px;\n")) - self.lineEditVal3.setStyleSheet(QString.fromUtf8("background:rgb(244,244,244);\n" "border:0px;\n")) - self.lineEditVal1.setToolTip(tr("Valeur non modifiable")) - self.lineEditVal2.setToolTip(tr("Valeur non modifiable")) - self.lineEditVal3.setToolTip(tr("Valeur non modifiable")) - else : - self.maCommande.listeAffichageWidget.append(self.lineEditVal1) - #self.maCommande.listeAffichageWidget.append(self.lineEditVal2) - #self.maCommande.listeAffichageWidget.append(self.lineEditVal3) - + MonWidgetSimpBase.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande) diff --git a/InterfaceQT4/monWidgetPlusieursInto.py b/InterfaceQT4/monWidgetPlusieursInto.py index 5f3a5097..d5bdabf7 100644 --- a/InterfaceQT4/monWidgetPlusieursInto.py +++ b/InterfaceQT4/monWidgetPlusieursInto.py @@ -34,18 +34,21 @@ from gereListe import GereListe class MonWidgetPlusieursInto (Ui_WidgetPlusieursInto,Feuille): def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande): - #print "MonWidgetPlusieursInto", nom, self + print "MonWidgetPlusieursInto", nom, self self.index=1 Feuille.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande) self.listeValeursCourantes=self.node.item.GetListeValeurs() self.parentQt.commandesLayout.insertWidget(-1,self) - self.maCommande.listeAffichageWidget.append(self.lineEditVal1) + # try except si la liste des possibles est vide + # prevoir qqchose + try : + self.maCommande.listeAffichageWidget.append(self.lineEditVal1) + except : + pass def setValeurs(self): self.listeValeursCourantes=self.node.item.GetListeValeurs() - #print "dans setValeurs" - #print self.node.item.definition.validators #print self.monSimpDef.into #if len(self.monSimpDef.into)*20 > 400 : self.setMinimumHeight(400) #else : self.setMinimumHeight(len(self.monSimpDef.into)*30) @@ -63,7 +66,14 @@ class MonWidgetPlusieursInto (Ui_WidgetPlusieursInto,Feuille): else: self.listeAAfficher=self.node.item.get_liste_possible([]) else : - self.listeAAfficher=self.monSimpDef.into + self.listeAAfficher=self.node.item.get_liste_possible([]) + + self.PourEtreCoche=self.listeValeursCourantes + if self.objSimp.wait_assd() : + self.listeAAfficher=self.node.item.get_sd_avant_du_bon_type() + self.PourEtreCoche=[] + for concept in self.listeValeursCourantes: + self.PourEtreCoche.append(concept.nom) if len(self.listeAAfficher)*20 > 400 : self.setMinimumHeight(400) else : self.setMinimumHeight(len(self.listeAAfficher)*30) self.adjustSize() @@ -75,7 +85,8 @@ class MonWidgetPlusieursInto (Ui_WidgetPlusieursInto,Feuille): nomCB="lineEditVal"+str(i+1) courant=getattr(self,nomCB) courant.setText(str(self.listeAAfficher[i])) - if self.monSimpDef.into[i] in self.listeValeursCourantes : + #if self.monSimpDef.into[i] in self.listeValeursCourantes : + if self.listeAAfficher[i] in self.PourEtreCoche : courant.setChecked(True) self.connect(courant,SIGNAL("toggled(bool)"),self.changeValeur) self.vScrollBar.triggerAction(QScrollBar.SliderToMinimum) @@ -144,7 +155,7 @@ class MonWidgetPlusieursInto (Ui_WidgetPlusieursInto,Feuille): def changeValeur(self): self.listeValeursCourantesAvant=self.listeValeursCourantes self.listeValeursCourantes = [] - print "changeValeur ____________" , self.monSimpDef.into, len(self.monSimpDef.into) + #print "changeValeur ____________" , self.monSimpDef.into, len(self.monSimpDef.into) for i in range (1,len(self.listeAAfficher)+1): nomLineEdit="lineEditVal"+str(i) courant=getattr(self,nomLineEdit) diff --git a/InterfaceQT4/monWidgetSimpBase.py b/InterfaceQT4/monWidgetSimpBase.py index 9788f9dc..caf27e01 100644 --- a/InterfaceQT4/monWidgetSimpBase.py +++ b/InterfaceQT4/monWidgetSimpBase.py @@ -79,7 +79,9 @@ class MonWidgetSimpBase (Ui_WidgetSimpBase,Feuille): 'Matrice' : tr(u'Une Matrice est attendue. '), 'Fichier' : tr(u'Un fichier est attendu. '), 'FichierNoAbs' : tr(u'Un fichier est attendu. '), - 'Repertoire' : tr(u'Un repertoire est attendu. ')} + 'Repertoire' : tr(u'Un repertoire est attendu. '), + 'Heure' : tr(u'Heure sous la forme HH:MM'), + 'Date' : tr(u'Date sous la forme JJ/MM/AA')} if mc.type[0] != types.ClassType: commentaire = d_aides.get(mc.type[0], tr("Type de base inconnu")) else : commentaire="" diff --git a/Noyau/N_VALIDATOR.py b/Noyau/N_VALIDATOR.py index 13b4ae3f..10b8506d 100644 --- a/Noyau/N_VALIDATOR.py +++ b/Noyau/N_VALIDATOR.py @@ -273,8 +273,7 @@ class IntoProtocol(PProtocol): if obj not in into: raise ValError( ufmt( - _(tr(u"La valeur : %s ne fait pas partie des choix possibles %s")), - repr(obj), into)) + _(tr(u"La valeur : %s ne fait pas partie des choix possibles %s")), repr(obj), into)) else: # on est dans le cas d'un ensemble continu de valeurs possibles # (intervalle) diff --git a/PSEN_Eficas/ExtractGeneratorandLoadList.py b/PSEN_Eficas/ExtractGeneratorandLoadList.py new file mode 100755 index 00000000..e30826d0 --- /dev/null +++ b/PSEN_Eficas/ExtractGeneratorandLoadList.py @@ -0,0 +1,69 @@ +NetworkFile = r"C:\Users\J15773\Documents\GTDosier\PSENdocs\Victoria\JAMAIQUE\2030Conv_HFP2.sav" + +PSSE_PATH = "C:/Program Files/PTI/PSSE33/PSSBIN" #emplacement de PSSE + +def ExtractGeneratorandLoadList(NetworkFile,PSSE_PATH): + + import os + import sys + + sys.path.append(PSSE_PATH) + os.environ['PATH'] += ';' + PSSE_PATH + ';' + + import psspy + import redirect + + ###initialization PSSE + psspy.psseinit(10000) + _i=psspy.getdefaultint() + _f=psspy.getdefaultreal() + _s=psspy.getdefaultchar() + redirect.psse2py() + + # Silent execution of PSSe + islct=6 # 6=no output; 1=standard + psspy.progress_output(islct) + + #open Network File + psspy.case(NetworkFile) + + #Extract Loads + sid = -1 #all buses + flag = 1 #all in service loads/generators (4 all loads/generators) + + + string = ['NUMBER'] + ierr,iarray = psspy.aloadint(sid,flag,string) + + string = ['NAME','ID','EXNAME'] + ierr,carray = psspy.aloadchar(sid,flag,string) + + LoadList = [] # [Bus name, load ID, extended bus name, bus number] + for i in range(len(iarray[0])): + LoadList.append([carray[0][i].strip(),carray[1][i],carray[2][i],iarray[0][i]]) + + #Extract Generators + sid = -1 #all buses + flag = 1 #all in service loads/generators (4 all loads/generators) + + string = ['NUMBER'] + ierr,iarray = psspy.amachint(sid,flag,string) + + string = ['NAME','ID','EXNAME'] + ierr,carray = psspy.amachchar(sid,flag,string) + + MachineList = [] # [Bus name, machine ID, extended bus name, bus number] + for i in range(len(iarray[0])): + MachineList.append([carray[0][i].strip(),carray[1][i],carray[2][i],iarray[0][i]]) + + return MachineList, LoadList + +def ExtractGeneratorandLoadList2(NetworkFile,PSSE_PATH): + MachineList = [['GT 6', '1 ', 'GT 6 11.500', 10], ['GT 7', '1 ', 'GT 7 11.500', 11], ['GT10', '1 ', 'GT10 11.500', 12], ['GT 5', '1 ', 'GT 5 11.500', 13], ['NEWHUNT', '1 ', 'NEWHUNT 11.500', 15], ['BSTMB', '1 ', 'BSTMB 11.500', 23], ['HYD_MAG', '1 ', 'HYD_MAG 6.9000', 25], ['RF1', '1 ', 'RF1 13.800', 37], ['OH2', '1 ', 'OH2 13.800', 41], ['RF2', '1 ', 'RF2 13.800', 42], ['GT3', '1 ', 'GT3 11.500', 43], ['OH3', '1 ', 'OH3 13.800', 47], ['OH4', '1 ', 'OH4 13.800', 50], ['OH6', '1 ', 'OH6 13.800', 52], ['GT 11', '1 ', 'GT 11 11.500', 56], ['B6_BUS13', '1 ', 'B6_BUS13 13.800', 57], ['GT8', '1 ', 'GT8 11.500', 58], ['HYDRR', '1 ', 'HYDRR 6.9000', 59], ['GT9', '1 ', 'GT9 11.500', 63], ['HYD_UWR', '1 ', 'HYD_UWR 6.9000', 64], ['HYD_RIOB', '1 ', 'HYD_RIOB 6.9000', 65], ['HRYD_LW', '1 ', 'HRYD_LW 6.9000', 68], ['GT13B', '1 ', 'GT13B 11.500', 76], ['GT12B', '1 ', 'GT12B 11.500', 77], ['CSPRING', '1 ', 'CSPRING 69.000', 91], ['OLDHARB1', '1 ', 'OLDHARB1 138.00', 114], ['WIGTON', '1 ', 'WIGTON 0.6900', 202], ['JEPWK1', '1 ', 'JEPWK1 11.500', 300], ['JEPWK1', '2 ', 'JEPWK1 11.500', 300], ['JEPWK1', '3 ', 'JEPWK1 11.500', 300], ['JEPWK2', '1 ', 'JEPWK2 11.500', 301], ['JEPWK2', '2 ', 'JEPWK2 11.500', 301], ['JEPWK2', '3 ', 'JEPWK2 11.500', 301], ['W_MUN1', '1 ', 'W_MUN1 69.000', 503], ['HYD_RHORN', '1 ', 'HYD_RHORN 69.000', 711]] + + LoadList= [['TREDEGAR', '1 ', 'TREDEGAR 69.000', 5], ['HOPE', '1 ', 'HOPE 69.000', 16], ['MILCHELT', '1 ', 'MILCHELT 69.000', 17], ['PARADISE', '1 ', 'PARADISE 69.000', 24], ['BLEDGE', '1 ', 'BLEDGE 69.000', 26], ['CANE RIV', '1 ', 'CANE RIV 69.000', 27], ['HIGHGATE', '1 ', 'HIGHGATE 69.000', 29], ['QUEENS D', '1 ', 'QUEENS D 69.000', 30], ['OCHO', '1 ', 'OCHO 69.000', 32], ['BOGUE_69', '1 ', 'BOGUE_69 69.000', 33], ['ROSE HAL', '1 ', 'ROSE HAL 69.000', 35], ['OH1', '1 ', 'OH1 13.800', 36], ['RF1', '1 ', 'RF1 13.800', 37], ['CEMENT C', '1 ', 'CEMENT C 69.000', 38], ['OBAY69', '1 ', 'OBAY69 69.000', 39], ['DUNCANS6', '1 ', 'DUNCANS6 69.000', 40], ['OH2', '1 ', 'OH2 13.800', 41], ['RF2', '1 ', 'RF2 13.800', 42], ['3MLS69', '1 ', '3MLS69 69.000', 45], ['WBLVD69', '1 ', 'WBLVD69 69.000', 46], ['OH3', '1 ', 'OH3 13.800', 47], ['PORT ANT', '1 ', 'PORT ANT 69.000', 48], ['OH4', '1 ', 'OH4 13.800', 50], ['B6_BUS13', '1 ', 'B6_BUS13 13.800', 57], ['GREENWOO', '1 ', 'GREENWOO 69.000', 60], ['LYSSONS', '1 ', 'LYSSONS 69.000', 61], ['PORUS', '1 ', 'PORUS 69.000', 62], ['R RIVER', '1 ', 'R RIVER 69.000', 66], ['MARTHA B', '1 ', 'MARTHA B 69.000', 67], ['WKH69', '1 ', 'WKH69 69.000', 69], ['PNASUS69', '1 ', 'PNASUS69 69.000', 70], ['ANNOTTO', '1 ', 'ANNOTTO 69.000', 71], ['UW RIVER', '1 ', 'UW RIVER 69.000', 74], ['KNDAL 69', '1 ', 'KNDAL 69 69.000', 75], ['MONYMUSK', '1 ', 'MONYMUSK 69.000', 78], ['OROCABES', '1 ', 'OROCABES 69.000', 79], ['MAGGOTTY', '1 ', 'MAGGOTTY 69.000', 80], ['UP PARK', '1 ', 'UP PARK 69.000', 82], ['TWICKENH', '1 ', 'TWICKENH 69.000', 85], ['MAY PEN', '1 ', 'MAY PEN 69.000', 88], ['PAJ', '1 ', 'PAJ 69.000', 89], ['GROAD_69', '1 ', 'GROAD_69 69.000', 90], ['CSPRING', '1 ', 'CSPRING 69.000', 91], ['S_ TREE6', '1 ', 'S_ TREE6 69.000', 92], ['NAGGOS H', '1 ', 'NAGGOS H 69.000', 94], ['GOODYEAR', '1 ', 'GOODYEAR 69.000', 99], ['HBAY_69', '1 ', 'HBAY_69 69.000', 101], ['RFORT69', '1 ', 'RFORT69 69.000', 102], ['RHODEN P', '1 ', 'RHODEN P 69.000', 105], ['DUHANEY6', '1 ', 'DUHANEY6 69.000', 107], ['CARDIFF', '1 ', 'CARDIFF 69.000', 109], ['JAB13.8', '1 ', 'JAB13.8 13.800', 112], ['JAM13.8', '1 ', 'JAM13.8 13.800', 113]] + return MachineList, LoadList + +if __name__ == "__main__": + MachineList,LoadList= ExtractGeneratorandLoadList2(NetworkFile,PSSE_PATH) + print MachineList, LoadList diff --git a/PSEN_Eficas/PSEN_Cata.py b/PSEN_Eficas/PSEN_Cata.py index 1d8328d8..cfa08502 100755 --- a/PSEN_Eficas/PSEN_Cata.py +++ b/PSEN_Eficas/PSEN_Cata.py @@ -24,9 +24,13 @@ #from Accas import ASSD, JDC_CATA, AU_MOINS_UN, PROC, SIMP, FACT, OPER, MACRO, BLOC, A_VALIDATOR from Accas import * +import opsPSEN class loi ( ASSD ) : pass class variable ( ASSD ) : pass +class sd_charge ( ASSD ) : pass +class sd_generateur ( ASSD ) : pass +class sd_busbar ( sd_generateur,sd_charge ) : pass import types class Tuple: @@ -70,15 +74,17 @@ class Matrice: #CONTEXT.debug = 1 -JdC = JDC_CATA ( code = 'OPENTURNS_STUDY', +JdC = JDC_CATA ( code = 'PSEN', execmodul = None, -## regles = ( AU_MOINS_UN ( 'CRITERIA' ), -## AU_MOINS_UN ( 'MODEL' ), -## AVANT ( ('DISTRIBUTION', 'MODEL'), 'VARIABLE' ), -# A_CLASSER ( 'VARIABLE', 'CORRELATION' ), -# A_CLASSER ( 'VARIABLE', 'CRITERIA' ), -# A_CLASSER ( 'CORRELATION', 'CRITERIA' ), - #), + regles = ( AU_MOINS_UN ( 'PARAMETRES_PSSE' ), + AU_MOINS_UN ( 'DIRECTORY' ), + AU_MOINS_UN ( 'DISTRIBUTION' ), + AU_MOINS_UN ( 'SIMULATION' ), + AU_PLUS_UN ( 'PARAMETRES_PSSE' ), + AU_PLUS_UN ( 'DIRECTORY' ), + AU_PLUS_UN ( 'SIMULATION' ), + AU_PLUS_UN ( 'CORRELATION' ), + ), ) # Fin JDC_CATA @@ -86,16 +92,77 @@ JdC = JDC_CATA ( code = 'OPENTURNS_STUDY', # fin entete # -------------------------------------------------- +MONGENER = OPER ( nom = "MONGENER", + sd_prod = sd_generateur, + UIinfo = {"groupes": ("CACHE")}, + op = None, + fr = "Generateur", + ang = "Generator", + + ID = SIMP ( statut = 'o', typ = "TXM", fr = "num bus", ang = "num bus",), +) +MACHARGE = OPER ( nom = "MACHARGE", + sd_prod = sd_charge, + UIinfo = {"groupes": ("CACHE")}, + op = None, + fr = "Charge", + ang = "Load", + + ID = SIMP ( statut = 'o', typ = "TXM", fr = "num bus", ang = "num bus",), +) +MONBUSBAR = OPER ( nom = "MONBUSBAR", + sd_prod = sd_busbar, + UIinfo = {"groupes": ("CACHE")}, + op = None, + fr = "Generateur", + ang = "Generator", + + ID = SIMP ( statut = 'o', typ = "TXM", fr = "num bus", ang = "num bus",), +) + + + +PARAMETRES_PSSE = PROC ( nom = "PARAMETRES_PSSE", + op=None, + docu = "", + COUT_COMBUSTIBLE = SIMP ( statut = "o", + typ=bool, + defaut=True, + ), + COUT_DELESTAGE = SIMP ( statut = "o", + typ=bool, + defaut=False, + ), + COUT_MVAR = SIMP ( statut = "o", + typ=bool, + defaut=False, + ), + IMAP = SIMP ( statut = "o", + typ='TXM', + into=['RateA','RateB','RateC'], + defaut=False, + ), + +) SIMULATION = PROC ( nom = "SIMULATION", op = None, docu = "", + regles =(EXCLUS('NUMBER_PACKAGE','CONVERGENCE'),), - SAMPLE = SIMP ( statut = "o", - typ = "R", - val_min=0, - + SIZE_PACKAGE = SIMP ( statut = "o", + typ = "I", + val_min=10, + defaut=100, ), - + NUMBER_PACKAGE = SIMP ( statut = "f", + typ = "I", + val_min=1, + ), + CONVERGENCE = SIMP ( statut = "f", + typ="I", + into=[1], + ), + STUDY = SIMP ( statut = "o", typ = "TXM", into = ( 'N-1', 'Load', 'Wind-1', 'Wind-2', 'PV' ), @@ -106,55 +173,6 @@ SIMULATION = PROC ( nom = "SIMULATION", ) -OPF_Parameters = PROC ( nom = "OPF_Parameters", - op = None, - docu = "", - - Minimize_fuel_cost = SIMP ( statut = "o", - typ = "TXM", - into=('True','False'), - defaut='False', - fr="Choix cout fuel" - ), - Minimize_adj_bus_shunt = SIMP ( statut = "o", - typ = "TXM", - into=('True','False'), - defaut='False', - fr="Choix minimize bus shunts" - ), - Minimize_adj_bus_loads = SIMP ( statut = "o", - typ = "TXM", - into=('True','False'), - defaut='False', - fr="Choix minimize bus loads" - ), - -) - -PSSe_Irate = PROC ( nom = "PSSe_Irate", - op = None, - docu = "", - - Rate_A = SIMP ( statut = "o", - typ = "TXM", - into=('True','False'), - defaut='False', - fr="Choix rate A" - ), - Rate_B = SIMP ( statut = "o", - typ = "TXM", - into=('True','False'), - defaut='False', - fr="Choix rate B" - ), - Rate_C = SIMP ( statut = "o", - typ = "TXM", - into=('True','False'), - defaut='False', - fr="Choix rate C" - ), - -) #================================ @@ -167,33 +185,46 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", sd_prod = loi, op = 68, fr = "Definitions des lois marginales utilisees par les variables d'entree", - + +#==== +# Choisir generateur ou charge +#==== + + TypeMachine = SIMP ( statut='o', typ='TXM', + into = ('charge','vent1','vent2','pv','N-1',), + ), + TypeComposant = SIMP (statut='o', typ='TXM', + into = ('Generateur','Charge'),), + b_gener = BLOC (condition = "TypeComposant == 'Generateur'", + #Generateur = SIMP(statut='o',typ=sd_generateur),), + Generateur = SIMP(statut='o',typ=sd_generateur,max="**", homo="SansOrdreNiDoublon"),), + b_charge = BLOC (condition = "TypeComposant == 'Charge'", + #charge = SIMP(statut='o',typ=sd_charge,max="**", homo="SansOrdreNiDoublon"),), + charge = SIMP(statut='o',typ=sd_charge),), #==== # Type de distribution #==== - Type_Model = SIMP ( statut='o', typ='TXM', - into = ('type_1','type_2','type_3','type_4', - ), - ), Kind = SIMP ( statut = "o", typ = "TXM", - into = ( "Beta", + into = ( "NonParametrique", + #"Beta", "Exponential", - "Gamma", - "Geometric", - "Gumbel", + #"Gamma", + #"Geometric", + #"Gumbel", "Histogram", - "Laplace", - "Logistic", - "LogNormal", - "MultiNomial", - "NonCentralStudent", + #"Laplace", + #"Logistic", + #"LogNormal", + #"MultiNomial", + #"NonCentralStudent", "Normal", - "Poisson", - "Rayleigh", - "Student", - "Triangular", + #"Poisson", + #"Rayleigh", + #"Student", + "PDF_from_file", + #"Triangular", "TruncatedNormal", "Uniform", "UserDefined", @@ -203,79 +234,89 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", ang = "1D marginal distribution", ), + #==== # Definition des parametres selon le type de la loi #==== - BETA = BLOC ( condition = " Kind in ( 'Beta', ) ", - - Settings = SIMP ( statut = "o", - typ = "TXM", - max = 1, - into = ( "RT", "MuSigma" ), - defaut = "RT", - fr = "Parametrage de la loi beta", - ang = "Beta distribution parameter set", - ), - - RT_Parameters = BLOC ( condition = " Settings in ( 'RT', ) ", - - R = SIMP ( statut = "o", - typ = "R", - max = 1, - val_min = 0., - fr = "Parametre R de la loi | R > 0", - ang = "R parameter | R > 0", - ), - - # T > R - T = SIMP ( statut = "o", - typ = "R", - max = 1, - val_min = 0., - fr = "Parametre T de la loi | T > R", - ang = "T parameter | T > R", - ), - - ), # Fin BLOC RT_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 - - - A = SIMP ( statut = "o", - typ = "R", - max = 1, - fr = "Borne inferieure du support de la loi", - ang = "Support lower bound", - ), - - # B > A - B = SIMP ( statut = "o", - typ = "R", - max = 1, - fr = "Borne superieure du support de la loi", - ang = "Support upper bound", - ), + NONPARAM = BLOC ( condition = " Kind in ( 'NonParametrique', ) ", + + FileName = SIMP ( statut = "o", + typ = ('Fichier', 'Wrapper Files (*.csv);;All Files (*)',), + fr = "Nom du modele physique", + ang = "Physical model identifier", + ), + ), - ), # Fin BLOC BETA +# BETA = BLOC ( condition = " Kind in ( 'Beta', ) ", +# +# Settings = SIMP ( statut = "o", +# typ = "TXM", +# max = 1, +# into = ( "RT", "MuSigma" ), +# defaut = "RT", +# fr = "Parametrage de la loi beta", +# ang = "Beta distribution parameter set", +# ), +# +# RT_Parameters = BLOC ( condition = " Settings in ( 'RT', ) ", +# +# R = SIMP ( statut = "o", +# typ = "R", +# max = 1, +# val_min = 0., +# fr = "Parametre R de la loi | R > 0", +# ang = "R parameter | R > 0", +# ), +# +# # T > R +# T = SIMP ( statut = "o", +# typ = "R", +# max = 1, +# val_min = 0., +# fr = "Parametre T de la loi | T > R", +# ang = "T parameter | T > R", +# ), +# +# ), # Fin BLOC RT_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 +# +# +# A = SIMP ( statut = "o", +# typ = "R", +# max = 1, +# fr = "Borne inferieure du support de la loi", +# ang = "Support lower bound", +# ), +# +# # B > A +# B = SIMP ( statut = "o", +# typ = "R", +# max = 1, +# fr = "Borne superieure du support de la loi", +# ang = "Support upper bound", +# ), +# +# ), # Fin BLOC BETA @@ -300,135 +341,135 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", - GAMMA = BLOC ( condition = " Kind in ( 'Gamma', ) ", - - Settings = SIMP ( statut = "o", - typ = "TXM", - max = 1, - into = ( "KLambda", "MuSigma" ), - defaut = "KLambda", - fr = "Parametrage de la loi gamma", - ang = "Gamma distribution parameter set", - ), - - KLambda_Parameters = BLOC ( condition = " Settings in ( 'KLambda', ) ", - - K = SIMP ( statut = "o", - typ = "R", - max = 1, - val_min = 0., - fr = "Parametre K de la loi | K > 0", - ang = "K parameter | K > 0", - ), - - Lambda = SIMP ( statut = "o", - typ = "R", - max = 1, - val_min = 0., - fr = "Parametre Lambda de la loi | Lambda > 0", - ang = "Lambda parameter | Lambda > 0", - ), - - ), # Fin BLOC KLambda_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 supoport de la loi", - ang = "Support lower bound", - ), - - - ), # Fin BLOC GAMMA - - - - GEOMETRIC = BLOC ( condition = " Kind in ( 'Geometric', ) ", - - P = SIMP ( statut = "o", - typ = "R", - max = 1, - val_min = 0., - val_max = 1., - fr = "Parametre P | 0 < P < 1", - ang = "P parameter | 0 < P < 1", - ), - - ), # Fin BLOC GEOMETRIC - - - - GUMBEL = BLOC ( condition = " Kind in ( 'Gumbel', ) ", - - Settings = SIMP ( statut = "o", - typ = "TXM", - max = 1, - into = ( "AlphaBeta", "MuSigma" ), - defaut = "AlphaBeta", - fr = "Parametrage de la loi gumbel", - ang = "Gumbel 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, - fr = "Parametre Beta de la loi", - ang = "Beta parameter", - ), - - ), # 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", - ), +# GAMMA = BLOC ( condition = " Kind in ( 'Gamma', ) ", +# +# Settings = SIMP ( statut = "o", +# typ = "TXM", +# max = 1, +# into = ( "KLambda", "MuSigma" ), +# defaut = "KLambda", +# fr = "Parametrage de la loi gamma", +# ang = "Gamma distribution parameter set", +# ), +# +# KLambda_Parameters = BLOC ( condition = " Settings in ( 'KLambda', ) ", +# +# K = SIMP ( statut = "o", +# typ = "R", +# max = 1, +# val_min = 0., +# fr = "Parametre K de la loi | K > 0", +# ang = "K parameter | K > 0", +# ), +# +# Lambda = SIMP ( statut = "o", +# typ = "R", +# max = 1, +# val_min = 0., +# fr = "Parametre Lambda de la loi | Lambda > 0", +# ang = "Lambda parameter | Lambda > 0", +# ), +# +# ), # Fin BLOC KLambda_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 supoport de la loi", +# ang = "Support lower bound", +# ), +# +# +# ), # Fin BLOC GAMMA - ), # Fin BLOC MuSigma_Parameters - ), # Fin BLOC GUMBEL +# +# GEOMETRIC = BLOC ( condition = " Kind in ( 'Geometric', ) ", +# +# P = SIMP ( statut = "o", +# typ = "R", +# max = 1, +# val_min = 0., +# val_max = 1., +# fr = "Parametre P | 0 < P < 1", +# ang = "P parameter | 0 < P < 1", +# ), +# +# ), # Fin BLOC GEOMETRIC +# +# +# +# GUMBEL = BLOC ( condition = " Kind in ( 'Gumbel', ) ", +# +# Settings = SIMP ( statut = "o", +# typ = "TXM", +# max = 1, +# into = ( "AlphaBeta", "MuSigma" ), +# defaut = "AlphaBeta", +# fr = "Parametrage de la loi gumbel", +# ang = "Gumbel 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, +# fr = "Parametre Beta de la loi", +# ang = "Beta parameter", +# ), +# +# ), # 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 +# +# ), # Fin BLOC GUMBEL @@ -454,170 +495,170 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", - LAPLACE = BLOC ( condition = " Kind in ( 'Laplace', ) ", - - Lambda = SIMP ( statut = "o", - typ = "R", - max = 1, - val_min = 0., - fr = "Parametre Lambda | Lambda > 0", - ang = "Lambda parameter | Lambda > 0", - ), - - Mu = SIMP ( statut = "o", - typ = "R", - max = 1, - fr = "Moyenne de la loi", - ang = "Mean value", - ), - - ), # Fin BLOC LAPLACE - - LOGNORMAL = BLOC ( condition = " Kind in ( 'LogNormal', ) ", - - Settings = SIMP ( statut = "o", - typ = "TXM", - max = 1, - into = ( "MuSigmaLog", "MuSigma", "MuSigmaOverMu" ), - defaut = "MuSigmaLog", - fr = "Parametrage de la loi lognormale", - ang = "Lognormal distribution parameter set", - ), - - 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 - - MuSigmaOverMu_Parameters = BLOC ( condition = " Settings in ( 'MuSigmaOverMu', ) ", - - Mu = SIMP ( statut = "o", - typ = "R", - max = 1, - fr = "Moyenne de la loi", - ang = "Mean value", - ), - - SigmaOverMu = SIMP ( statut = "o", - typ = "R", - max = 1, - val_min = 0., - fr = "Rapport ecart type / moyenne de la loi", - ang = "Standard deviation / mean value ratio", - ), - - ), # Fin BLOC MuSigmaOverMu_Parameters - - MuSigmaLog_Parameters = BLOC ( condition = " Settings in ( 'MuSigmaLog', ) ", - - MuLog = SIMP ( statut = "o", - typ = "R", - max = 1, - fr = "Moyenne du log", - ang = "Log mean value", - ), - - SigmaLog = SIMP ( statut = "o", - typ = "R", - max = 1, - val_min = 0., - fr = "Ecart type du log", - ang = "Log standard deviation", - ), - - ), # Fin BLOC MuSigmaLog_Parameters - - Gamma = SIMP ( statut = "o", - typ = "R", - max = 1, - fr = "Borne inferieure du support de la loi", - ang = "Support lower bound", - ), - - ), # Fin BLOC LOGNORMAL - - - - LOGISTIC = BLOC ( condition = " Kind in ( 'Logistic', ) ", - - Alpha = SIMP ( statut = "o", - typ = "R", - max = 1, - fr = "Borne inferieure du supoport de la loi", - ang = "Support lower bound", - ), - - 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 LOGISTIC - - - - MULTINOMIAL = BLOC ( condition = " Kind in ( 'MultiNomial', ) ", - - N = SIMP ( statut = "o", - typ = "I", - max = 1, - fr = "Parametre N de la loi | N > 0", - ang = "N parameter | N > 0", - ), - - # Il faut definir une collection de couples ( x,p ) - Values = SIMP ( statut = 'o', - typ = "R", - max = '**', - fr = "Liste de probabilités", - ang = "Probability list", - validators=VerifTypeTuple(('R','R')), - ), - - ), # Fin BLOC MULTINOMIAL - - - NONCENTRALSTUDENT = BLOC ( condition = " Kind in ( 'NonCentralStudent', ) ", - - Nu = SIMP ( statut = "o", - typ = "R", - max = 1, - fr = "Parametre Nu de la loi | Nu > 0", - ang = "Nu parameter | Nu > 0", - ), - - Delta = SIMP ( statut = "o", - typ = "R", - max = 1, - fr = "Parametre Delta de la loi | Delta > 0", - ang = "Delta parameter | Delta > 0", - ), - - Gamma = SIMP ( statut = "o", - typ = "R", - max = 1, - fr = "Parametre Gamma de centrage de la loi", - ang = "Gamma parameter", - ), - - ), # Fin BLOC NONCENTRALSTUDENT +# LAPLACE = BLOC ( condition = " Kind in ( 'Laplace', ) ", +# +# Lambda = SIMP ( statut = "o", +# typ = "R", +# max = 1, +# val_min = 0., +# fr = "Parametre Lambda | Lambda > 0", +# ang = "Lambda parameter | Lambda > 0", +# ), +# +# Mu = SIMP ( statut = "o", +# typ = "R", +# max = 1, +# fr = "Moyenne de la loi", +# ang = "Mean value", +# ), +# +# ), # Fin BLOC LAPLACE +# +# LOGNORMAL = BLOC ( condition = " Kind in ( 'LogNormal', ) ", +# +# Settings = SIMP ( statut = "o", +# typ = "TXM", +# max = 1, +# into = ( "MuSigmaLog", "MuSigma", "MuSigmaOverMu" ), +# defaut = "MuSigmaLog", +# fr = "Parametrage de la loi lognormale", +# ang = "Lognormal distribution parameter set", +# ), +# +# 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 +# +# MuSigmaOverMu_Parameters = BLOC ( condition = " Settings in ( 'MuSigmaOverMu', ) ", +# +# Mu = SIMP ( statut = "o", +# typ = "R", +# max = 1, +# fr = "Moyenne de la loi", +# ang = "Mean value", +# ), +# +# SigmaOverMu = SIMP ( statut = "o", +# typ = "R", +# max = 1, +# val_min = 0., +# fr = "Rapport ecart type / moyenne de la loi", +# ang = "Standard deviation / mean value ratio", +# ), +# +# ), # Fin BLOC MuSigmaOverMu_Parameters +# +# MuSigmaLog_Parameters = BLOC ( condition = " Settings in ( 'MuSigmaLog', ) ", +# +# MuLog = SIMP ( statut = "o", +# typ = "R", +# max = 1, +# fr = "Moyenne du log", +# ang = "Log mean value", +# ), +# +# SigmaLog = SIMP ( statut = "o", +# typ = "R", +# max = 1, +# val_min = 0., +# fr = "Ecart type du log", +# ang = "Log standard deviation", +# ), +# +# ), # Fin BLOC MuSigmaLog_Parameters +# +# Gamma = SIMP ( statut = "o", +# typ = "R", +# max = 1, +# fr = "Borne inferieure du support de la loi", +# ang = "Support lower bound", +# ), +# +# ), # Fin BLOC LOGNORMAL +# +# +# +# LOGISTIC = BLOC ( condition = " Kind in ( 'Logistic', ) ", +# +# Alpha = SIMP ( statut = "o", +# typ = "R", +# max = 1, +# fr = "Borne inferieure du supoport de la loi", +# ang = "Support lower bound", +# ), +# +# 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 LOGISTIC +# +# +# +# MULTINOMIAL = BLOC ( condition = " Kind in ( 'MultiNomial', ) ", +# +# N = SIMP ( statut = "o", +# typ = "I", +# max = 1, +# fr = "Parametre N de la loi | N > 0", +# ang = "N parameter | N > 0", +# ), +# +# # Il faut definir une collection de couples ( x,p ) +# Values = SIMP ( statut = 'o', +# typ = "R", +# max = '**', +# fr = "Liste de probabilités", +# ang = "Probability list", +# validators=VerifTypeTuple(('R','R')), +# ), +# +# ), # Fin BLOC MULTINOMIAL +# +# +# NONCENTRALSTUDENT = BLOC ( condition = " Kind in ( 'NonCentralStudent', ) ", +# +# Nu = SIMP ( statut = "o", +# typ = "R", +# max = 1, +# fr = "Parametre Nu de la loi | Nu > 0", +# ang = "Nu parameter | Nu > 0", +# ), +# +# Delta = SIMP ( statut = "o", +# typ = "R", +# max = 1, +# fr = "Parametre Delta de la loi | Delta > 0", +# ang = "Delta parameter | Delta > 0", +# ), +# +# Gamma = SIMP ( statut = "o", +# typ = "R", +# max = 1, +# fr = "Parametre Gamma de centrage de la loi", +# ang = "Gamma parameter", +# ), +# +# ), # Fin BLOC NONCENTRALSTUDENT NORMAL = BLOC ( condition = " Kind in ( 'Normal', ) ", @@ -640,93 +681,101 @@ DISTRIBUTION = OPER ( nom = "DISTRIBUTION", ), # Fin BLOC NORMAL - - POISSON = BLOC ( condition = " Kind in ( 'Poisson', ) ", - - Lambda = SIMP ( statut = "o", - typ = "R", - max = 1, - val_min = 0., - fr = "Parametre Lambda de la loi | Lambda > 0", - ang = "Lambda parameter | Lambda > 0", - ), - - ), # Fin BLOC POISSON - - - - RAYLEIGH = BLOC ( condition = " Kind 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 - - - STUDENT = BLOC ( condition = " Kind in ( 'Student', ) ", - - Mu = SIMP ( statut = "o", - typ = "R", - max = 1, - fr = "Parametre Mu de la loi", - ang = "Mu parameter", - ), - - Nu = SIMP ( statut = "o", - typ = "R", - max = 1, - val_min = 2., - fr = "Parametre Nu de la loi | Nu > 2", - ang = "Nu parameter | Nu > 2", - ), - - Sigma = SIMP ( statut = "o", - typ = "R", - max = 1, - fr = "Parametre Sigma de la loi", - ang = "Sigma parameter", - ), - - ), # Fin BLOC STUDENT - - - - TRIANGULAR = BLOC ( condition = " Kind in ( 'Triangular', ) ", - - A = SIMP ( statut = "o", - typ = "R", - max = 1, - fr = "Borne inferieure du support de la loi | A < M < B", - ang = "Support lower bound | A < M < B", - ), - - M = SIMP ( statut = "o", - typ = "R", - max = 1, - fr = "Mode de la loi | A < M < B", - ang = "Mode | A < M < B", - ), - - B = SIMP ( statut = "o", - typ = "R", - max = 1, - fr = "Borne superieure du support de la loi | A < M < B", - ang = "Support upper bound | A < M < B", - ), - - ), # Fin BLOC TRIANGULAR - - +# +# POISSON = BLOC ( condition = " Kind in ( 'Poisson', ) ", +# +# Lambda = SIMP ( statut = "o", +# typ = "R", +# max = 1, +# val_min = 0., +# fr = "Parametre Lambda de la loi | Lambda > 0", +# ang = "Lambda parameter | Lambda > 0", +# ), +# +# ), # Fin BLOC POISSON +# +# +# +# RAYLEIGH = BLOC ( condition = " Kind 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 = " Kind in ( 'PDF_from_file', ) ", + + FileName = SIMP ( statut = "o", + typ = ('Fichier', 'Wrapper Files (*.csv);;All Files (*)',), + fr = "Nom du modele physique", + ang = "Physical model identifier", + ), + ), + +# STUDENT = BLOC ( condition = " Kind in ( 'Student', ) ", +# +# Mu = SIMP ( statut = "o", +# typ = "R", +# max = 1, +# fr = "Parametre Mu de la loi", +# ang = "Mu parameter", +# ), +# +# Nu = SIMP ( statut = "o", +# typ = "R", +# max = 1, +# val_min = 2., +# fr = "Parametre Nu de la loi | Nu > 2", +# ang = "Nu parameter | Nu > 2", +# ), +# +# Sigma = SIMP ( statut = "o", +# typ = "R", +# max = 1, +# fr = "Parametre Sigma de la loi", +# ang = "Sigma parameter", +# ), +# +# ), # Fin BLOC STUDENT +# +# +# +# TRIANGULAR = BLOC ( condition = " Kind in ( 'Triangular', ) ", +# +# A = SIMP ( statut = "o", +# typ = "R", +# max = 1, +# fr = "Borne inferieure du support de la loi | A < M < B", +# ang = "Support lower bound | A < M < B", +# ), +# +# M = SIMP ( statut = "o", +# typ = "R", +# max = 1, +# fr = "Mode de la loi | A < M < B", +# ang = "Mode | A < M < B", +# ), +# +# B = SIMP ( statut = "o", +# typ = "R", +# max = 1, +# fr = "Borne superieure du support de la loi | A < M < B", +# ang = "Support upper bound | A < M < B", +# ), +# +# ), # Fin BLOC TRIANGULAR +# +# TRUNCATEDNORMAL = BLOC ( condition = " Kind in ( 'TruncatedNormal', ) ", @@ -894,7 +943,22 @@ CORRELATION = PROC ( nom = 'CORRELATION', ## ) - +DIRECTORY = MACRO ( nom = 'DIRECTORY', + op=None, + fr = "Chargement des generateurs et des charges", + ang = "Physical model wrapper load", + sd_prod = opsPSEN.INCLUDE, + op_init = opsPSEN.INCLUDE_context, + #sd_prod=None, + fichier_ini = 1, + + fichier_sav=SIMP(statut="o", typ = ('Fichier', 'Wrapper Files (*.sav);;All Files (*)',),), + dossier_resultat=SIMP(statut="o",typ='Repertoire'), + fichier_lignes=SIMP(statut="o" ,typ = ('Fichier', 'Wrapper Files (*.csv);;All Files (*)',),), + fichier_groupes=SIMP(statut="o", typ = ('Fichier', 'Wrapper Files (*.csv);;All Files (*)',),), + fichier_parc=SIMP(statut="o" ,typ = ('Fichier', 'Wrapper Files (*.csv);;All Files (*)',),), + chemin_psse=SIMP(statut="o",typ='Repertoire'), +) diff --git a/PSEN_Eficas/opsPSEN.py b/PSEN_Eficas/opsPSEN.py new file mode 100755 index 00000000..894cb715 --- /dev/null +++ b/PSEN_Eficas/opsPSEN.py @@ -0,0 +1,111 @@ +# -*- 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 +# + +import re +#from ExtractGeneratorandLoadList import ExtractGeneratorandLoadList +from ExtractGeneratorandLoadList import ExtractGeneratorandLoadList2 + +def INCLUDE(self,chemin_psse,fichier_sav,**args): + """ + Fonction sd_prod pour la macro INCLUDE + """ + + print "INCLUDE", self + reevalue=0 + if hasattr(self,'fichier_ini'): + reevalue=1 + if self.fichier_ini == fichier_sav : 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=fichier_sav + self.contexte_fichier_init = {} + self.fichier_unite = 999 + self.fichier_err = None + self.fichier_text="" + + unite = 999 + + pattern_debut_ligne = re.compile(r'^[0-9].*') + try: + MachineListOrigin,LoadListOrigin= ExtractGeneratorandLoadList2(fichier_sav,chemin_psse) + except : + if self.jdc.appli is not None: + self.jdc.appli.affiche_alerte("Error", 'An error happened in ExtractGeneratorandLoadList execution ') + self.g_context = {} + self.etapes = [] + self.jdc_aux = None + self.fichier_err = str(exc) + self.contexte_fichier_init = {} + + MachineList=[] + LoadList=[] + BusBarList=[] + for m in MachineListOrigin: + if m in LoadListOrigin : BusBarList.append(m) + else : MachineList.append(m) + + for m in LoadListOrigin: + if m not in MachineListOrigin : LoadList.append(m) + + for m in MachineList: + nouv=m[0].replace(' ','_') + nouveau=nouv.replace('.','_') + nom = nouveau+"__"+str(m[1]) + if pattern_debut_ligne.match(nom): nom='_'+nom + id = str(m[3]) + self.fichier_text += "%s=MONGENER(ID='%s',);\n" % (nom, id) + + for m in BusBarList: + nouv=m[0].replace(' ','_') + nouveau=nouv.replace('.','_') + nom = nouveau+"__"+str(m[1]) + if pattern_debut_ligne.match(nom): nom='_'+nom + id = str(m[3]) + self.fichier_text += "%s=MONBUSBAR(ID='%s',);\n" % (nom, id) + + for m in LoadList: + nouv=m[0].replace(' ','_') + nouveau=nouv.replace('.','_') + nom = nouveau+"__"+str(m[1]) + if pattern_debut_ligne.match(nom): nom='_'+nom + if pattern_debut_ligne.match(nom): print 'match' + id = str(m[3]) + self.fichier_text += "%s=MACHARGE(ID='%s',);\n" % (nom, id) + + import Extensions.jdc_include + self.JdC_aux = Extensions.jdc_include.JDC_CATA_INCLUDE(code='PSEN', execmodul=None) + self.make_contexte_include(None, self.fichier_text) + self.old_context_fichier_init = self.contexte_fichier_init + self.parent.record_unit(unite, self) + + +def INCLUDE_context(self,d): + """ + Fonction op_init pour macro INCLUDE + """ + for k,v in self.g_context.items(): + d[k]=v + diff --git a/PSEN_Eficas/prefs_PSEN.py b/PSEN_Eficas/prefs_PSEN.py index 7f553ed8..e4d94440 100755 --- a/PSEN_Eficas/prefs_PSEN.py +++ b/PSEN_Eficas/prefs_PSEN.py @@ -37,5 +37,5 @@ docPath=repIni # catalogues=( - ('PSEN','default',os.path.join(repIni,'PSEN_Cata.py'),'dico','python'), + ('PSEN','default',os.path.join(repIni,'PSEN_Cata.py'),'PSEN','python'), ) diff --git a/UiQT4/desBaseWidget.ui b/UiQT4/desBaseWidget.ui index b91de3c1..a44c7fa3 100644 --- a/UiQT4/desBaseWidget.ui +++ b/UiQT4/desBaseWidget.ui @@ -29,6 +29,9 @@ + + 3 + 0 diff --git a/UiQT4/desChoixCommandes.ui b/UiQT4/desChoixCommandes.ui index 1b733d10..85802d5e 100644 --- a/UiQT4/desChoixCommandes.ui +++ b/UiQT4/desChoixCommandes.ui @@ -29,6 +29,12 @@ background-color : rgb(248,247,246) + + 0 + + + 0 + @@ -196,8 +202,22 @@ + + + + Qt::Horizontal + + + + 71 + 18 + + + + horizontalSpacer + horizontalSpacer_2 @@ -220,7 +240,7 @@ 0 0 1170 - 512 + 530 @@ -231,22 +251,6 @@ - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 10 - 5 - - - - diff --git a/UiQT4/desWidgetDate.ui b/UiQT4/desWidgetDate.ui index 8d4184d9..873ab4f7 100644 --- a/UiQT4/desWidgetDate.ui +++ b/UiQT4/desWidgetDate.ui @@ -6,8 +6,8 @@ 0 0 - 936 - 60 + 736 + 62 diff --git a/UiQT4/desWidgetHeure.ui b/UiQT4/desWidgetHeure.ui index 7204b0b9..03d5dfba 100644 --- a/UiQT4/desWidgetHeure.ui +++ b/UiQT4/desWidgetHeure.ui @@ -6,8 +6,8 @@ 0 0 - 936 - 60 + 658 + 61 diff --git a/UiQT4/eficas_en.qm b/UiQT4/eficas_en.qm index 0664a220..0cf59ce8 100644 Binary files a/UiQT4/eficas_en.qm and b/UiQT4/eficas_en.qm differ diff --git a/UiQT4/eficas_fr.ts b/UiQT4/eficas_fr.ts index f6200bf1..140c6012 100644 --- a/UiQT4/eficas_fr.ts +++ b/UiQT4/eficas_fr.ts @@ -1824,67 +1824,67 @@ Le fichier associe n'est pas defini - + %s n'est pas un fichier valide - + Nombre d'arguments de %s incorrect (min = %s, max = %s) - + La valeur : %s ne fait pas partie des choix possibles %s - + %s n'est pas de la bonne longueur - + valeur dans l'intervalle %s , %s - + La valeur doit etre comprise entre %s et %s - + %s doit etre inferieur a %s - + longueur de liste comprise entre %s et %s - + Le cardinal de la liste doit etre compris entre %s et %s - + %s devrait etre de longueur inferieure a %s - + %s devrait etre de longueur superieure a %s - + %s contient des valeurs non paires - + %s contient des valeurs hors des choix possibles: %s @@ -1929,208 +1929,350 @@ Le fichier associe n'est pas defini - + %s n'est pas une chaine de longueur comprise entre %s et %s - + TXM de longueur entre %s et %s - + valeur %s obligatoire - + %s ne contient pas les elements obligatoires : %s - + %s absent - + %s est un doublon - + longueur de la chaine entre %s et %s - + Longueur de la chaine incorrecte - + %s n'est pas une chaine - + liste %s - + La liste doit etre en ordre %s - + %s n'est pas par valeurs croissantes - + %s n'est pas par valeurs decroissantes - + %s n'est pas du bon type - + valeur %s pour la somme des cles A et B - + valeur de %s - + valeur d'instance de %s - + %s devrait etre de type %s - + %s n'est pas dans %s - + : verifie les types dans un tuple - + %s ne contient pas les elements devant etre presents ensemble: %s - + %s n'est pas autorise : %s - + %s devrait etre comprise entre %s et %s - - Objet commande commentarisé invalide + + Un concept de nom %s existe déjà ! - - La formule passee à l'interpreteur doit etre sous forme de tuple + + %s n'est pas un repertoire valide - - Début + + Type non encore gere %s - - Un concept de nom %s existe déjà ! + + %s (de type %s) n'est pas d'un type autorise: %s %s - - Pas de nom donné au paramètre + + La valeur : %s est en dehors du domaine de validite [ %s , %s ] - - Le paramètre %s ne peut valoir None + + %s present ensemble - - Format pas implémenté : %s + + unknown keywords : %s - - Impossible de réaliser la vérification de la formule + + Creation Parametre indisponible - - Creation Paramètre indisponible + + La cardinalite n'est pas correcte, la derniere valeur est ignoree - - les paramètres sont liés à un jeu de données + + n est pas un tuple de - - Fichier non encore nommé + + valeurs - - Les types entrés ne sont pas permis + + La Creation de parametre n est possible que dans un jeu de données - - %s n'est pas un repertoire valide + + Valeur incorrecte - - Type non encore gere %s + + n est pas un identifiant correct + - - %s (de type %s) n'est pas d'un type autorise: %s %s + + Entrer un float SVP - - La valeur : %s est en dehors du domaine de validite [ %s , %s ] + + Entrer un float inferieur a - - %s present ensemble + + Entrer un float superieur a - - unknown keywords : %s + + Mauvaise execution + + + + + impossible d executer la methode + + + + + Mauvaise Commande + + + + + Aucune variable connue + + + + + Mauvaise dimension de matrice + + + + + le nombre de ligne n est pas egal a + + + + + le nombre de colonne n est pas egal a + + + + + Mauvaise Valeur + + + + + l element + + + + + n est pas correct + + + + + Modification Impossible + + + + + le parametre n'est pas valide + + + + + n est pas un identifiant correct + + + + + Valeur incorrecte: + + + + + Valeur incorrecte + + + + + Valeur correcte + + + + + impossible d'evaluer : + + + + + Objet commande commentarisee invalide + + + + + La formule passee a l'interpreteur doit etre sous forme de tuple + + + + + Debut + + + + + Pas de nom donne au parametre + + + + + Le parametre %s ne peut valoir None + + + + + Format non implemente : %s + + + + + Impossible de realiser la verification de la formule + + + + + Un concept de nom %s existe deja ! + + + + + existe deja + + + + + + les parametres sont lies a un jeu de donnees + + + + + Fichier non encore nomme + + + + + Les types entres ne sont pas permis @@ -2776,6 +2918,34 @@ p, li { white-space: pre-wrap; } + + WidgetDate + + + Form + + + + + Affiche le rapport de validation du mot-clef + + + + + ... + + + + + <html><head/><body><p>aaa</p><p>dqsklmdqm</p></body></html> + + + + + Détruit le mot-clef + + + WidgetFact @@ -2812,6 +2982,47 @@ p, li { white-space: pre-wrap; } + + WidgetHeure + + + Form + + + + + Affiche le rapport de validation du mot-clef + + + + + ... + + + + + <html><head/><body><p>aaa</p><p>dqsklmdqm</p></body></html> + + + + + <html><head/><body><p><br/></p></body></html> + + + + + Détruit le mot-clef + + + + + WidgetInformative + + + Form + + + WidgetOptionnel @@ -2840,6 +3051,84 @@ p, li { white-space: pre-wrap; } + + WidgetParam + + + DCommandeUnique + + + + + ... + + + + + <html><head/><body><p><span style=" color:#000000;">Paramètre</span></p></body></html> + + + + + Détruit le commentaire + + + + + Affiche les commandes possibles + + + + + &Commandes + + + + + Shift+A, Alt+A, Alt+A, Alt+A + + + + + Affiche le formulaire de la commande précédente + + + + + << + + + + + Affiche le formulaire de la commande suivante + + + + + >> + + + + + <html><head/><body><p>Valeur: </p></body></html> + + + + + <html><head/><body><p>Nom: </p></body></html> + + + + + Verifie la valeur + + + + + <html><head/><body><p><br/></p></body></html> + + + WidgetPlusieursBase @@ -2936,6 +3225,64 @@ p, li { white-space: pre-wrap; } + + WidgetPlusieursIntoOrdonne + + + Form + + + + + Affiche le rapport de validation du mot-clef + + + + + ... + + + + + <html><head/><body><p>aaa</p><p>dqsklmdqm</p></body></html> + + + + + TextLabel + + + + + Remonte d'une ligne + + + + + Descend d'une ligne + + + + + Détruit une ligne + + + + + ajoute une ligne + + + + + visualise l'ensemble des valeurs + + + + + Détruit le mot-clef + + + WidgetRadioButton @@ -2969,6 +3316,44 @@ p, li { white-space: pre-wrap; } + + WidgetSDCOInto + + + Form + + + + + Affiche le rapport de validation du mot-clef + + + + + ... + + + + + <html><head/><body><p>aaa</p><p>dqsklmdqm</p></body></html> + + + + + <html><head/><body><p>Structures de données du type requis </p><p><br/></p></body></html> + + + + + <html><head/><body><p>ou Nom du concept</p></body></html> + + + + + Détruit le mot-clef + + + WidgetSimpBase @@ -3230,6 +3615,62 @@ p, li { white-space: pre-wrap; } + + WidgetUniqueSDCO + + + Form + + + + + Affiche le rapport de validation du mot-clef + + + + + ... + + + + + <html><head/><body><p>aaa</p><p>dqsklmdqm</p></body></html> + + + + + Attend un objet de type CO + + + + + Détruit le mot-clef + + + + + WidgetVide + + + Form + + + + + ... + + + + + <html><head/><body><p><span style=" color:#0055ff;">Label</span></p></body></html> + + + + + Attend un objet de type XXXX. Il faut le créer + + + baseWidget @@ -3274,6 +3715,52 @@ p, li { white-space: pre-wrap; } + + desWidgetCreeParam + + + Gestion des Paramètres + + + + + <html><head/><body><p>Nom: </p></body></html> + + + + + <html><head/><body><p>Valeur: </p></body></html> + + + + + <html><head/><body><p><span style=" text-decoration: underline;">Créer un paramètre</span></p></body></html> + + + + + desWidgetMatrice + + + Dialog + + + + + Affiche le rapport de validation du mot-clef + + + + + ... + + + + + <html><head/><body><p>aaa</p><p>dqsklmdqm</p></body></html> + + + self.appliEficas diff --git a/generator/generator_PSEN.py b/generator/generator_PSEN.py old mode 100644 new mode 100755 index c9df95a4..154a8634 --- a/generator/generator_PSEN.py +++ b/generator/generator_PSEN.py @@ -25,7 +25,9 @@ texte_debut+=' format="med";\n' import traceback import types,string,re,os from Extensions.i18n import tr -from generator_python import PythonGenerator +from generator_dicoImbrique import DicoImbriqueGenerator +import pdb +from numpy import zeros def entryPoint(): """ @@ -40,7 +42,7 @@ def entryPoint(): } -class PSENGenerator(PythonGenerator): +class PSENGenerator(DicoImbriqueGenerator): """ Ce generateur parcourt un objet de type JDC et produit un texte au format eficas et @@ -53,10 +55,15 @@ class PSENGenerator(PythonGenerator): #---------------------------------------------------------------------------------------- def gener(self,obj,format='brut',config=None): + print "je passe dans gener" + #self.MachineDico = obj.MachineDico + #self.LoadDico = obj.LoadDico + #self.LineDico = obj.LineDico + #self.TransfoDico = obj.TransfoDico + self.initDico() - # Cette instruction genere le contenu du fichier de commandes (persistance) - self.text=PythonGenerator.gener(self,obj,format) + self.text=DicoImbriqueGenerator.gener(self,obj,format) return self.text @@ -65,7 +72,12 @@ class PSENGenerator(PythonGenerator): #---------------------------------------------------------------------------------------- def initDico(self) : - self.textePourRun = texte_debut + DicoImbriqueGenerator.initDico(self) + #self.Entete = 'MachineDico = ' + str(self.MachineDico) +'\n' + #self.Entete += 'LoadDico = ' + str(self.LoadDico) +'\n' + #self.Entete += 'LineDico = ' + str(self.LineDico) +'\n' + #self.Entete += 'TransfoDico = ' + str(self.TransfoDico) +'\n' + #self.Entete +='\n' #---------------------------------------------------------------------------------------- @@ -73,40 +85,29 @@ class PSENGenerator(PythonGenerator): #---------------------------------------------------------------------------------------- def writeDefault(self,fn) : - print self.textePourRun - - def ajoutRun(self) : - self.textePourRun+=" write_mesh_crack();\n" - self.textePourRun+=" do_mesh_crack(0);\n" - self.textePourRun+=" nice_cut(20.);\n" - self.textePourRun+=' export_mesh("'+self.cracked_name+'","med");\n' - self.textePourRun+="}" + DicoImbriqueGenerator.writeDefault(self,fn) + return + #---------------------------------------------------------------------------------------- # analyse de chaque noeud de l'arbre #---------------------------------------------------------------------------------------- - def generMCSIMP(self,obj) : - """recuperation de l objet MCSIMP""" - #print dir(obj) - s=PythonGenerator.generMCSIMP(self,obj) - if obj.nom in ListeConcatene : - stringListe="" - for val in obj.val: - stringListe+=str(val)+" " - self.textePourRun+=" "+obj.nom+ "='"+ stringListe[0:-1]+ "';\n" - return s - if obj.nom=="elset_radius" : - self.textePourRun+=" if_must_define_elset=1;\n" - if obj.nom=="sane_name" : - self.textePourRun+=" import_mesh('"+obj.val+"');\n" - if obj.nom=="cracked_name" : self.cracked_name=obj.val - if obj.nom=="repertoire" : - print "PNPNPN a traiter" - return s - self.textePourRun+=" "+obj.nom+ "=" + s[0:-1]+ ";\n" - return s +## def generMCSIMP(self,obj) : +## """recuperation de l objet MCSIMP""" +## #print dir(obj) +## self.dicoMCSIMP[obj.nom]=obj.val +## self.dicoTemp[obj.nom]=obj.val +## s=DicoImbriqueGenerator.generMCSIMP(self,obj) +## return s +## +## def generETAPE(self,obj): +## self.dicoTemp={} +## s=DicoImbriqueGenerator.generETAPE(self,obj) +## if obj.nom=="DISTRIBUTION" : self.dicoLois[obj.sd.nom]=self.dicoTemp +## self.dicoTemp={} +## return s # si repertoire on change tous les noms de fichier diff --git a/generator/generator_dicoImbrique.py b/generator/generator_dicoImbrique.py index 010eb18d..fda9c0a6 100644 --- a/generator/generator_dicoImbrique.py +++ b/generator/generator_dicoImbrique.py @@ -65,6 +65,7 @@ class DicoImbriqueGenerator(PythonGenerator): def initDico(self) : self.Dico={} + self.Entete = '' #---------------------------------------------------------------------------------------- @@ -75,7 +76,7 @@ class DicoImbriqueGenerator(PythonGenerator): print "je passe par writeDefault" fileDico = fn[:fn.rfind(".")] + '.py' f = open( str(fileDico), 'wb') - f.write( str(self.Dico) ) + f.write( self.Entete + "Dico =" + str(self.Dico) ) f.close() #---------------------------------------------------------------------------------------- @@ -84,13 +85,18 @@ class DicoImbriqueGenerator(PythonGenerator): def generMCSIMP(self,obj) : """recuperation de l objet MCSIMP""" + s=PythonGenerator.generMCSIMP(self,obj) liste=obj.get_genealogie() - dicoCourant=self.Dico - for i in liste [0:-1]: - if not(dicoCourant.has_key(i)) : dicoCourant[i]={} - dicoCourant=dicoCourant[i] - dicoCourant[liste[-1]]=obj.valeur + nom=obj.etape.nom + if hasattr(obj.etape,'sdnom') and obj.etape.sdnom != None and obj.etape.sdnom != "" : + nom = nom+ obj.etape.sdnom + if not(self.Dico.has_key(nom)) : dicoCourant={} + else : dicoCourant=self.Dico [nom] + if hasattr(obj.valeur,'nom'):dicoCourant[liste[-1]]=obj.valeur.nom + else : dicoCourant[liste[-1]]=obj.valeurFormatee + self.Dico[nom]=dicoCourant + return s