File tree 1 file changed +6
-2
lines changed
src/main/java/de/rwth/idsg/steve/utils
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) {
43
43
}
44
44
last = current ;
45
45
}
46
- //true = good , false = not good
46
+ // true = passes , false = give error message that values are incorrect
47
47
return startPeriod != null ;
48
48
}
49
49
50
+ // Check if numberPhases is set and fill the values if needed.
50
51
public static List <Integer > setNumberPhases (Integer [] startPeriod , BigDecimal [] limit , List <Integer > numberPhases ) {
51
52
if ((numberPhases == null || numberPhases .size () == 0 ) && (startPeriod .length == limit .length )) {
52
53
for (int i = 0 ; i < startPeriod .length ; i ++) {
@@ -55,11 +56,14 @@ public static List<Integer> setNumberPhases(Integer[] startPeriod, BigDecimal[]
55
56
} else if ((numberPhases .size () == startPeriod .length ) && (startPeriod .length == limit .length )) {
56
57
numberPhases = numberPhases ;
57
58
} 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
58
61
for (int i = numberPhases .size (); i < startPeriod .length ; i ++) {
59
62
numberPhases .add (3 );
60
63
}
61
64
} 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.
63
67
numberPhases .add (3 );
64
68
}
65
69
return numberPhases ;
You can’t perform that action at this time.
0 commit comments