From d58ab8e3a458ae7a121d555c8f4daa235a590aa2 Mon Sep 17 00:00:00 2001
From: "pascale.noyret"
'+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 @@