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
137137 String equipmentId = limitViolation .getSubjectId ();
138138 LoadingLimits .TemporaryLimit tempLimit = null ;
139139
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 );
148143 }
149144 return (tempLimit != null ) ? tempLimit .getAcceptableDuration () : Integer .MAX_VALUE ;
150145 }
@@ -159,7 +154,7 @@ protected static Integer calculateUpcomingOverloadDuration(LimitViolation limitV
159154
160155 private static LoadingLimits .TemporaryLimit getBranchLimitViolationAboveCurrentValue (Branch <?> branch , LimitViolation limitViolation ) {
161156 // 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 () );
163158 if (currentLimits .isEmpty () || limitViolation .getValue () < currentLimits .get ().getPermanentLimit ()) {
164159 return null ;
165160 } else {
You can’t perform that action at this time.
0 commit comments