File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
src/main/java/de/rwth/idsg/steve/utils Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -43,10 +43,11 @@ public static boolean checkStartPeriod(Integer[] startPeriod) {
4343 }
4444 last = current ;
4545 }
46- //true = good , false = not good
46+ // true = passes , false = give error message that values are incorrect
4747 return startPeriod != null ;
4848 }
4949
50+ // Check if numberPhases is set and fill the values if needed.
5051 public static List <Integer > setNumberPhases (Integer [] startPeriod , BigDecimal [] limit , List <Integer > numberPhases ) {
5152 if ((numberPhases == null || numberPhases .size () == 0 ) && (startPeriod .length == limit .length )) {
5253 for (int i = 0 ; i < startPeriod .length ; i ++) {
@@ -55,11 +56,14 @@ public static List<Integer> setNumberPhases(Integer[] startPeriod, BigDecimal[]
5556 } else if ((numberPhases .size () == startPeriod .length ) && (startPeriod .length == limit .length )) {
5657 numberPhases = numberPhases ;
5758 } else if ((numberPhases .size () < startPeriod .length ) && (startPeriod .length == limit .length )) {
59+ // If numberPhases has less values than startPeriod, fill numberPhases with the default value,
60+ // "3" as this is the default value according to OCPP 1.6 Specifications
5861 for (int i = numberPhases .size (); i < startPeriod .length ; i ++) {
5962 numberPhases .add (3 );
6063 }
6164 } else {
62- //Dirty work around to give an error message that csp values do not have an equivalent amount of values
65+ // Dirty work around to give an error message that csp values do not have an equivalent amount of values
66+ // When comparing the size of startPeriod and numberPhases.
6367 numberPhases .add (3 );
6468 }
6569 return numberPhases ;
You can’t perform that action at this time.
0 commit comments