1 # -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2013 EDF R&D
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 # --------------------------------------------------
23 # --------------------------------------------------
25 #from Accas import ASSD, JDC_CATA, AU_MOINS_UN, PROC, SIMP, FACT, OPER, MACRO, BLOC, A_VALIDATOR
29 #class loi ( ASSD ) : pass
30 #class variable ( ASSD ) : pass
31 class sd_charge ( ASSD ) : pass
32 class sd_generateur ( ASSD ) : pass
33 class sd_ligne ( ASSD ) : pass
34 class sd_transfo ( ASSD ) : pass
35 class sd_moteur ( ASSD ) : pass
40 def __init__(self,ntuple):
43 def __convert__(self,valeur):
44 if type(valeur) == types.StringType:
46 if len(valeur) != self.ntuple:
51 return "Tuple de %s elements" % self.ntuple
57 # def __init__(self,nbLigs=None,nbCols=None,methodeCalculTaille=None,formatSortie="ligne",valSup=None,valMin=None,structure=None):
60 # self.methodeCalculTaille=methodeCalculTaille
61 # self.formatSortie=formatSortie
64 # self.structure=structure
66 # def __convert__(self,valeur):
67 # # Attention ne verifie pas grand chose
68 # if type(valeur) != types.ListType :
73 # return "Matrice %s x %s" % (self.nbLigs, self.nbCols)
80 JdC = JDC_CATA ( code = 'PSEN',
82 regles = ( AU_MOINS_UN ( 'CASE_SELECTION' ),
83 # AU_MOINS_UN ( 'DIRECTORY' ),
84 # AU_MOINS_UN ( 'DISTRIBUTION' ),
85 # AU_MOINS_UN ( 'SIMULATION' ),
86 # AU_PLUS_UN ( 'PSSE_PARAMETERS' ),
87 # AU_PLUS_UN ( 'DIRECTORY' ),
88 # AU_PLUS_UN ( 'SIMULATION' ),
89 # AU_PLUS_UN ( 'CORRELATION' ),
90 # AU_PLUS_UN ( 'N_1_GENERATORS' ),
91 # AU_PLUS_UN ( 'N_1_LINES' ),
92 # AU_PLUS_UN ( 'N_1_LOADS' ),
93 # AU_PLUS_UN ( 'N_1_TRANSFORMERS' ),
99 # --------------------------------------------------
101 # --------------------------------------------------
103 CASE_SELECTION = MACRO ( nom = "CASE_SELECTION",
104 sd_prod = opsPSEN_N1.INCLUDE,
105 op_init = opsPSEN_N1.INCLUDE_context,
106 regles = (UN_PARMI('FromFile', 'AllCases', 'WorstCases'),),
109 fr = "Sélectionnez les cas à analyser",
110 ang = 'Select the cases to analyze',
111 PSSE_path = SIMP(statut="o",typ='Repertoire',defaut='C:\Program Files (x86)\PTI\PSSE33\PSSBIN'),
112 output_folder = SIMP(statut="o", typ="Repertoire"),
116 input_path = SIMP(statut="f",typ='Repertoire'),
117 branch_cases = SIMP(statut='o', typ='TXM'),
118 transfo_cases = SIMP(statut='o', typ='TXM'),
119 high_cases = SIMP(statut='o', typ='TXM'),
120 low_cases = SIMP(statut='o', typ='TXM'),
125 all_cases = SIMP(statut='o', typ=bool, defaut = True),
129 regles = (UN_PARMI('AvgBranchLoad', 'AvgBranchLoadPercent'), UN_PARMI('AvgTransfoLoad', 'AvgTransfoLoadPercent'), UN_PARMI('AvgHighVoltage', 'AvgHighVoltagePercent'), UN_PARMI('AvgLowVoltage', 'AvgLowVoltagePercent'),),
131 AvgBranchLoad = SIMP(statut = 'f', typ = 'I', defaut = 0, val_min = 0),
132 AvgBranchLoadPercent = SIMP(statut = 'f', typ = 'I', defaut = 0, val_min = 0, val_max = 100),
133 AvgTransfoLoad = SIMP(statut = 'f', typ = 'I', defaut = 0, val_min = 0),
134 AvgTransfoLoadPercent = SIMP(statut = 'f', typ = 'I', defaut = 0, val_min = 0, val_max = 100),
135 AvgHighVoltage = SIMP(statut = 'f', typ = 'I', defaut = 0, val_min = 0),
136 AvgHighVoltagePercent = SIMP(statut = 'f', typ = 'I', defaut = 0, val_min = 0, val_max = 100),
137 AvgLowVoltage = SIMP(statut = 'f', typ = 'I', defaut = 0, val_min = 0),
138 AvgLowVoltagePercent = SIMP(statut = 'f', typ = 'I', defaut = 0, val_min = 0, val_max = 100),
141 MaxDepth = SIMP(statut = 'o', typ = 'I', defaut = 5),
142 Consigne = SIMP(statut = "o",homo = 'information',typ = "TXM", defaut = "complete CASE SELECTION"),
144 BusesList = SIMP(statut = 'f', typ = 'R', min = 0, max = '**', defaut = (), homo = 'SansOrdreNiDoublon'),
148 AdjTaps = SIMP(statut = 'o', typ = 'TXM', into = ['0 - Lock', '1 - Stepping', '2 - Direct'], defaut = '1 - Stepping'),
149 AdjDCtaps = SIMP(statut = 'o', typ = 'TXM', into = ['0 - Disable', '1 - Enable'], defaut = '1 - Enable'),
150 SolutionMethod = SIMP(statut = 'o', typ = 'TXM', into = ['0 - FDNS', '1 - FNSL', '2 - Optimized FDNS'], defaut = '1 - FNSL'),
151 AdjSwitchedShunts = SIMP(statut = 'o', typ = 'TXM', into = ['0 - Disable', '1 - Enable', '2 - Enable continuous mode'], defaut = '1 - Enable'),
152 DispatchMode = SIMP(statut = 'o', typ = 'TXM', into = ['0 - Disable', '1 - Reserve', '2 - Pmax', '3 - Inertia', '4 - Droop'], defaut = '1 - Reserve'),
153 FlatStart = SIMP(statut = 'o', typ = bool, defaut = False),
154 VarLimits = SIMP(statut = 'o', typ = 'I', defaut = 99),
158 CONTINGENCY_OPTIONS = PROC ( nom = 'CONTINGENCY_OPTIONS',
160 fr = "Definitions des lois marginales utilisees par les variables d'entree",
162 Vmin = SIMP(statut = 'o', typ = 'R', defaut = 0.9, val_min = 0),
163 Vmax = SIMP(statut = 'o', typ = 'R', defaut = 1.1, val_min = 0),
164 ContRate = SIMP(statut = 'o', typ = 'TXM', defaut = 'a', into=['a', 'b']),
165 FlowLimitLines = SIMP(statut = 'o', typ = 'I', defaut = 110, val_min = 0),
166 FloLimitTransfos = SIMP(statut = 'o', typ = 'I', defaut = 100, val_min = 0),
167 Tolance = SIMP(statut = 'o', typ = 'I', defaut = 10, val_min = 0),
168 RadialLinesOnly = SIMP(statut = 'o', typ = bool, defaut = False),
169 TripTransfos = SIMP(statut = 'o', typ = bool, defaut = True),
170 TripGenerators = SIMP(statut = 'o', typ = bool, defaut = True),
171 TripN_2 = SIMP(statut = 'o', typ = bool, defaut = False),
172 IsolatedGen = SIMP(statut = 'o', typ = bool, defaut = True),
175 OUTPUT_OPTIONS = PROC ( nom = 'OUTPUT_OPTIONS',
177 fr = "Definitions des lois marginales utilisees par les variables d'entree",
179 TrNoGSUorGNDOutput = SIMP(statut = 'o', typ = bool, defaut = True),
180 TestBusName = SIMP(statut = 'o', typ = bool, defaut = True),
181 ReportSpaces = SIMP(statut = 'o', typ = bool, defaut = True),
182 RepeatComponentAllLines = SIMP(statut = 'o', typ = bool, defaut = True),
183 MultipleContingencyReport = SIMP(statut = 'o', typ = bool, defaut = True),
184 WriteIndivExcels = SIMP(statut = 'o', typ = bool, defaut = True),
185 WriteFlowDifs = SIMP(statut = 'o', typ = bool, defaut = True),
188 DATA_PROCESSING = MACRO ( nom = 'DATA_PROCESSING',
189 sd_prod = opsPSEN_N1.PROCESS,
190 op_init = opsPSEN_N1.PROCESS_context,
193 fr = "Sélectionnez les cas à analyser",
194 ang = 'Select the cases to analyze',
195 XLS_file = SIMP(statut="o", typ = ('Fichier', 'XLS file (*.xls);;All Files (*)',),),
196 Onglets = SIMP(statut = 'f', typ = 'TXM', min = 0, max = '**', homo = 'SansOrdreNiDoublon',into=(),),
197 BusList = SIMP(statut = 'f', typ = 'TXM', min = 0, max = '**', homo = 'SansOrdreNiDoublon',into=(),),
198 ContList = SIMP(statut = 'f', typ = 'TXM', min = 0, max = '**', homo = 'SansOrdreNiDoublon',into=(),),