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
33 def __init__(self,ntuple):
36 def __convert__(self,valeur):
37 if type(valeur) == types.StringType:
39 if len(valeur) != self.ntuple:
44 return "Tuple de %s elements" % self.ntuple
50 # def __init__(self,nbLigs=None,nbCols=None,methodeCalculTaille=None,formatSortie="ligne",valSup=None,valMin=None,structure=None):
53 # self.methodeCalculTaille=methodeCalculTaille
54 # self.formatSortie=formatSortie
57 # self.structure=structure
59 # def __convert__(self,valeur):
60 # # Attention ne verifie pas grand chose
61 # if type(valeur) != types.ListType :
66 # return "Matrice %s x %s" % (self.nbLigs, self.nbCols)
73 JdC = JDC_CATA ( code = 'PSEN',
75 regles = ( AU_MOINS_UN ( 'CASE_SELECTION' ),
76 # AU_MOINS_UN ( 'DIRECTORY' ),
77 # AU_MOINS_UN ( 'DISTRIBUTION' ),
78 # AU_MOINS_UN ( 'SIMULATION' ),
79 # AU_PLUS_UN ( 'PSSE_PARAMETERS' ),
80 # AU_PLUS_UN ( 'DIRECTORY' ),
81 # AU_PLUS_UN ( 'SIMULATION' ),
82 # AU_PLUS_UN ( 'CORRELATION' ),
83 # AU_PLUS_UN ( 'N_1_GENERATORS' ),
84 # AU_PLUS_UN ( 'N_1_LINES' ),
85 # AU_PLUS_UN ( 'N_1_LOADS' ),
86 # AU_PLUS_UN ( 'N_1_TRANSFORMERS' ),
92 # --------------------------------------------------
94 # --------------------------------------------------
96 CASE_SELECTION = MACRO ( nom = "CASE_SELECTION",
97 sd_prod = opsPSEN_N1.INCLUDE,
98 op_init = opsPSEN_N1.INCLUDE_context,
101 fr = "Sélectionnez les cas à analyser",
102 ang = 'Select the cases to analyze',
103 PSSE_path = SIMP(statut="o",typ='Repertoire',defaut='C:\Program Files (x86)\PTI\PSSE33\PSSBIN'),
104 output_folder = SIMP(statut="o", typ="Repertoire"),
107 BusesList = SIMP(statut = 'f', typ = 'R', min = 0, max = '**', defaut = (), homo = 'SansOrdreNiDoublon'),
108 LinesList = SIMP(statut = 'f', typ = 'R', min = 0, max = '**', defaut = (), homo = 'SansOrdreNiDoublon'),
109 TransformersList = SIMP(statut = 'f', typ = 'TXM', min = 0, max = '**', defaut = (), homo = 'SansOrdreNiDoublon'),
110 MaxDepth = SIMP(statut = 'o', typ = 'I', defaut = 5),
111 OutputNewCsv = SIMP ( statut = "o",typ=bool,defaut=False,),
113 N_PROCESSING_OPTIONS = PROC ( nom = 'N_PROCESSING_OPTIONS',
115 ang = "Select whether the program should be displaying data ablout the different categories. The values displayed will be the min, max, and mean of each item, plus a chart.",
116 Output_bus_values = SIMP(statut = 'o', typ = bool, defaut = True),
117 Output_lines_values = SIMP(statut = 'o', typ = bool, defaut = True),
118 Output_transformer_values = SIMP(statut = 'o', typ = bool, defaut = True),
119 Threshold_selection_for_the_treated_cases = FACT(
121 Branches = SIMP(statut="o",typ=Tuple(3),defaut=(0,0,0),validators=VerifTypeTuple(('R','R','R'),),),
122 Transformers = SIMP(statut="o",typ=Tuple(3),defaut=(0,0,0),validators=VerifTypeTuple(('R','R','R'),),),
123 High_voltage = SIMP(statut="o",typ=Tuple(3),defaut=(0,0,0),validators=VerifTypeTuple(('R','R','R'),),),
124 Low_voltage = SIMP(statut="o",typ=Tuple(3),defaut=(0,0,0),validators=VerifTypeTuple(('R','R','R'),),),
129 CONTINGENCY_OPTIONS = PROC (nom = 'CONTINGENCY_OPTIONS',
132 GeneralOptions = FACT(statut='o',
133 Vmin = SIMP(statut = 'o', typ = 'R', defaut = 0.9, val_min = 0),
134 Vmax = SIMP(statut = 'o', typ = 'R', defaut = 1.1, val_min = 0),
135 ContingencyRate = SIMP(statut = 'o', typ = 'TXM', defaut = 'a', into=['a', 'b']),
136 FlowLimitLines = SIMP(statut = 'o', typ = 'I', defaut = 120, val_min = 0),
137 FlowLimitTransformers = SIMP(statut = 'o', typ = 'I', defaut = 120, val_min = 0),
138 Tolerance = SIMP(statut = 'o', typ = 'R', defaut = 0.5, val_min = 0),
139 TripLines = SIMP(statut = 'o', typ = bool, defaut = True),
140 TripTransfos = SIMP(statut = 'o', typ = bool, defaut = True),
141 TripGenerators = SIMP(statut = 'o', typ = bool, defaut = True),
144 LoadFlowOptions = FACT(statut='o',
145 AdjustTaps = SIMP(statut = 'o', typ = 'TXM', into = ['0 - Lock', '1 - Stepping', '2 - Direct'], defaut = '1 - Stepping'),
146 AdjustDCtaps = SIMP(statut = 'o', typ = 'TXM', into = ['0 - Disable', '1 - Enable'], defaut = '1 - Enable'),
147 SolutionMethod = SIMP(statut = 'o', typ = 'TXM', into = ['0 - FDNS', '1 - FNSL', '2 - Optimized FDNS'], defaut = '1 - FNSL'),
148 AdjustSwitchedShunts = SIMP(statut = 'o', typ = 'TXM', into = ['0 - Disable', '1 - Enable', '2 - Enable continuous mode'], defaut = '1 - Enable'),
149 DispatchMode = SIMP(statut = 'o', typ = 'TXM', into = ['0 - Disable', '1 - Reserve', '2 - Pmax', '3 - Inertia', '4 - Droop'], defaut = '1 - Reserve'),
150 FlatStart = SIMP(statut = 'o', typ = bool, defaut = False),
151 VarLimits = SIMP(statut = 'o', typ = 'I', defaut = 99,ang = 'if set to -1, var limits will not be applied'),
154 OutputOptions = FACT(statut='o',
155 consigne1 = SIMP(statut='o',homo='information',typ = "TXM",defaut = 'Output PSSE multiple contingency report to Shell?'),
156 MultipleContingencyReport = SIMP(statut = 'o', typ = bool, defaut = True, ang = 'Output PSSE multiple contingency report to Shell?'),
157 consigne2 = SIMP(statut='o',homo='information',typ = "TXM",defaut = 'Write an Excel file for the results of each case file?'),
158 WriteIndivExcels = SIMP(statut = 'o', typ = bool, defaut = True),
159 consigne3 = SIMP(statut='o',homo='information',typ = "TXM",defaut = 'Add a tab in Excel results file for the differences between the max flow rate (MVAR) and the actual flow rate in lines and transformers?'),
160 WriteFlowDifs = SIMP(statut = 'o', typ = bool, defaut = True),
167 CONTINGENCY_SELECTION = PROC(nom='CONTINGENCY_SELECTION',op = None,
168 SelectionMethod = SIMP(statut='o',typ='TXM',into=['CaseSelectionFromFile','SelectAllCases','SelectWorstCases'],
171 b_file = BLOC(condition="SelectionMethod=='CaseSelectionFromFile'",
172 CaseSelectionFromFiles = FACT(
174 regles=(AU_MOINS_UN('branch_cases','transformer_cases','high_voltage_cases','low_voltage_cases',),),
175 branch_cases = SIMP(statut='o', defaut='', typ = ('Fichier', 'CSV file (*.csv);;All Files (*)','Sauvegarde'),),
176 transformer_cases = SIMP(statut='o', defaut='', typ = ('Fichier', 'CSV file (*.csv);;All Files (*)','Sauvegarde',),),
177 high_voltage_cases = SIMP(statut='o', defaut='', typ = ('Fichier', 'CSV file (*.csv);;All Files (*)','Sauvegarde'),),
178 low_voltage_cases = SIMP(statut='o', defaut='', typ = ('Fichier', 'CSV file (*.csv);;All Files (*)','Sauvegarde'),),
181 # CaseSelectionFromFile = FACT(
183 # input_path = SIMP(statut="o",typ='Repertoire'),
184 # branch_cases = SIMP(statut='o', typ='TXM'),
185 # transformer_cases = SIMP(statut='o', typ='TXM'),
186 # high_cases = SIMP(statut='o', typ='TXM'),
187 # low_cases = SIMP(statut='o', typ='TXM'),
192 # b_all = BLOC(condition="SelectionMethod=='SelectAllCases'",
193 # SelectAllCases = FACT(
195 # all_cases = SIMP(statut='o', typ=bool, defaut = True),
199 b_worst = BLOC(condition="SelectionMethod=='SelectWorstCases'",
200 SelectWorstCases = FACT(
201 regles = (UN_PARMI('AvgBranchLoad', 'AvgBranchLoadPercent'), UN_PARMI('AvgTransformerLoad', 'AvgTransformerLoadPercent'), UN_PARMI('AvgHighVoltage', 'AvgHighVoltagePercent'), UN_PARMI('AvgLowVoltage', 'AvgLowVoltagePercent'),),
203 consigne = SIMP(statut='o',homo='information',typ = "TXM",defaut = 'Choose at least one of the potential selection criteria from the SelectWorstCases list on the right.'),
204 AvgBranchLoad = SIMP(statut = 'f', typ = 'I', defaut = 0, val_min = 0),
205 AvgBranchLoadPercent = SIMP(statut = 'f', typ = 'I', defaut = 0, val_min = 0, val_max = 100),
206 AvgTransformerLoad = SIMP(statut = 'f', typ = 'I', defaut = 0, val_min = 0),
207 AvgTransformerLoadPercent = SIMP(statut = 'f', typ = 'I', defaut = 0, val_min = 0, val_max = 100),
208 AvgHighVoltage = SIMP(statut = 'f', typ = 'I', defaut = 0, val_min = 0),
209 AvgHighVoltagePercent = SIMP(statut = 'f', typ = 'I', defaut = 0, val_min = 0, val_max = 100),
210 AvgLowVoltage = SIMP(statut = 'f', typ = 'I', defaut = 0, val_min = 0),
211 AvgLowVoltagePercent = SIMP(statut = 'f', typ = 'I', defaut = 0, val_min = 0, val_max = 100),
216 Automatic_N_2_Selection = FACT(statut='f',
218 BusesList = SIMP(statut = 'o', typ = 'R', min = 0, max = '**', defaut = (), homo = 'SansOrdreNiDoublon'),
219 LinesList = SIMP(statut = 'o', typ = 'R', min = 0, max = '**', defaut = (), homo = 'SansOrdreNiDoublon'),
220 TransformersList = SIMP(statut = 'o', typ = 'TXM', min = 0, max = '**', defaut = (), homo = 'SansOrdreNiDoublon'),
223 MultipleContingencyList = FACT (statut='f',
225 ComponentList=SIMP(statut='o', typ = 'TXM', max='**', homo = 'SansOrdreNiDoublon',),
230 CONTINGENCY_PROCESSING = MACRO ( nom = 'CONTINGENCY_PROCESSING',
231 sd_prod = opsPSEN_N1.PROCESS,
232 op_init = opsPSEN_N1.PROCESS_context,
240 XLS_file = SIMP(statut="o", typ = ('Fichier', 'XLS file (*.xls);;All Files (*)',),),
241 TabList = SIMP(statut = 'f', typ = 'TXM', min = 0, max = '**', homo = 'SansOrdreNiDoublon'),
243 # b_highVoltage = BLOC(condition="'High Voltage 0' in TabList",
244 # HighVoltageBuses = SIMP(statut = 'o', typ = 'TXM', min = 0, max = '**', defaut = (), homo = 'SansOrdreNiDoublon'),
245 # HighVoltageContingencies = SIMP(statut = 'o', typ = 'TXM', min = 0, max = '**', defaut = (), homo = 'SansOrdreNiDoublon'),
250 Ordre_Des_Commandes = ('CASE_SELECTION' , 'N_PROCESSING_OPTIONS' , 'CONTINGENCY_OPTIONS' , 'CONTINGENCY_SELECTION',)