import { AsyncResource } from 'node:async_hooks';
-import { AuthorizedTagsCache, type ChargingStation, ChargingStationUtils } from './internal';
+import { type ChargingStation, ChargingStationUtils, IdTagsCache } from './internal';
import { BaseError } from '../exception';
// import { PerformanceStatistics } from '../performance';
import { PerformanceStatistics } from '../performance/PerformanceStatistics';
public readonly configuration: AutomaticTransactionGeneratorConfiguration;
public started: boolean;
private readonly chargingStation: ChargingStation;
- private idTagIndex: number;
private constructor(
automaticTransactionGeneratorConfiguration: AutomaticTransactionGeneratorConfiguration,
this.started = false;
this.configuration = automaticTransactionGeneratorConfiguration;
this.chargingStation = chargingStation;
- this.idTagIndex = 0;
this.connectorsStatus = new Map<number, Status>();
this.initializeConnectorsStatus();
}
const measureId = 'StartTransaction with ATG';
const beginId = PerformanceStatistics.beginMeasure(measureId);
let startResponse: StartTransactionResponse;
- if (this.chargingStation.hasAuthorizedTags()) {
- const idTag = AuthorizedTagsCache.getInstance().getIdTag(
+ if (this.chargingStation.hasIdTags()) {
+ const idTag = IdTagsCache.getInstance().getIdTag(
this.configuration?.idTagDistribution,
this.chargingStation,
connectorId
private logPrefix = (connectorId?: number): string => {
return Utils.logPrefix(
` ${this.chargingStation.stationInfo.chargingStationId} | ATG${
- connectorId !== undefined ? ` on connector #${connectorId.toString()}` : ''
+ !Utils.isNullOrUndefined(connectorId) ? ` on connector #${connectorId.toString()}` : ''
}:`
);
};