File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed
src/main/java/org/gridsuite/securityanalysis/server/entities Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -137,14 +137,9 @@ protected static Integer calculateActualOverloadDuration(LimitViolation limitVio
137
137
String equipmentId = limitViolation .getSubjectId ();
138
138
LoadingLimits .TemporaryLimit tempLimit = null ;
139
139
140
- Line line = network .getLine (equipmentId );
141
- if (line != null ) {
142
- tempLimit = getBranchLimitViolationAboveCurrentValue (line , limitViolation );
143
- } else {
144
- TwoWindingsTransformer twoWindingsTransformer = network .getTwoWindingsTransformer (equipmentId );
145
- if (twoWindingsTransformer != null ) {
146
- tempLimit = getBranchLimitViolationAboveCurrentValue (twoWindingsTransformer , limitViolation );
147
- }
140
+ Branch <?> branch = network .getBranch (equipmentId );
141
+ if (branch != null ) {
142
+ tempLimit = getBranchLimitViolationAboveCurrentValue (branch , limitViolation );
148
143
}
149
144
return (tempLimit != null ) ? tempLimit .getAcceptableDuration () : Integer .MAX_VALUE ;
150
145
}
@@ -159,7 +154,7 @@ protected static Integer calculateUpcomingOverloadDuration(LimitViolation limitV
159
154
160
155
private static LoadingLimits .TemporaryLimit getBranchLimitViolationAboveCurrentValue (Branch <?> branch , LimitViolation limitViolation ) {
161
156
// limits are returned from the store by DESC duration / ASC value
162
- Optional <CurrentLimits > currentLimits = limitViolation . getSideAsTwoSides (). equals ( TwoSides . ONE ) ? branch .getCurrentLimits1 () : branch . getCurrentLimits2 ( );
157
+ Optional <CurrentLimits > currentLimits = branch .getCurrentLimits ( limitViolation . getSideAsTwoSides () );
163
158
if (currentLimits .isEmpty () || limitViolation .getValue () < currentLimits .get ().getPermanentLimit ()) {
164
159
return null ;
165
160
} else {
You can’t perform that action at this time.
0 commit comments