Amperage detection threshold
MODIFY
src/utils/Constants.ts
src/utils/Constants.ts
@@ -17,6 +17,7 @@ export default class Constants {
public static readonly DC_CHARGING_STATION_DEFAULT_EFFICIENCY_PERCENT = 80;
public static readonly DC_LIMIT_BUFFER_PERCENT = 10;
public static readonly AC_LIMIT_BUFFER_PERCENT = 10;
+ public static readonly AMPERAGE_DETECTION_THRESHOLD = 0.5;
public static readonly DB_RECORD_COUNT_DEFAULT = 100;
public static readonly DB_RECORD_COUNT_CEIL = 500;

MODIFY
src/utils/Utils.ts
src/utils/Utils.ts
@@ -83,13 +83,13 @@ export default class Utils {
csPhase3: false
};
// Check current consumption
- if (transaction.currentInstantAmpsL1 > 0) {
+ if (transaction.currentInstantAmpsL1 > Constants.AMPERAGE_DETECTION_THRESHOLD) {
cSPhasesUsed.csPhase1 = true;
}
- if (transaction.currentInstantAmpsL2 > 0) {
+ if (transaction.currentInstantAmpsL2 > Constants.AMPERAGE_DETECTION_THRESHOLD) {
cSPhasesUsed.csPhase2 = true;
}
- if (transaction.currentInstantAmpsL3 > 0) {
+ if (transaction.currentInstantAmpsL3 > Constants.AMPERAGE_DETECTION_THRESHOLD) {
cSPhasesUsed.csPhase3 = true;
}
return cSPhasesUsed;
@@ -103,10 +103,10 @@ export default class Utils {
}
public static checkIfPhasesProvidedInTransactionInProgress(transaction: Transaction): boolean {
- return transaction.currentInstantAmps > 0 &&
- (transaction.currentInstantAmpsL1 > 0 ||
- transaction.currentInstantAmpsL2 > 0 ||
- transaction.currentInstantAmpsL3 > 0);
+ return transaction.currentInstantAmps > Constants.AMPERAGE_DETECTION_THRESHOLD &&
+ (transaction.currentInstantAmpsL1 > Constants.AMPERAGE_DETECTION_THRESHOLD ||
+ transaction.currentInstantAmpsL2 > Constants.AMPERAGE_DETECTION_THRESHOLD ||
+ transaction.currentInstantAmpsL3 > Constants.AMPERAGE_DETECTION_THRESHOLD);
}
public static getNumberOfUsedPhasesInTransactionInProgress(chargingStation: ChargingStation, transaction: Transaction): number {

Amperage detection threshold