- for (const connector in this._chargingStation._connectors) {
- if (connector > 0) {
- this.startConnector(connector);
- }
- }
- logger.info(this._logPrefix() + ' ATG started and will stop in ' + Utils.secondstoHHMMSS(this._chargingStation._stationInfo.AutomaticTransactionGenerator.stopAfterHours * 3600));
- }
-
- async stop(reason = '') {
- logger.info(this._logPrefix() + ' ATG OVER => STOPPING ALL TRANSACTIONS');
- for (const connector in this._chargingStation._connectors) {
- if (this._chargingStation.getConnector(connector).transactionStarted) {
+ logger.info(this._logPrefix() + ' ATG started and will stop in ' + Utils.secondstoHHMMSS(this._chargingStation.stationInfo.AutomaticTransactionGenerator.stopAfterHours * 3600));
+ }
+
+ async stop(reason = ''): Promise<void> {
+ logger.info(this._logPrefix() + ' ATG OVER => STOPPING ALL TRANSACTIONS');
+ for (const connector in this._chargingStation.connectors) {
+ if (this._chargingStation.getConnector(Utils.convertToInt(connector)).transactionStarted) {
- } else if (self._stationInfo.powerDivider && self._stationInfo.powerDivider <= 0) {
- const errMsg = `${self._logPrefix()} MeterValues measurand ${meterValuesTemplate[index].measurand ? meterValuesTemplate[index].measurand : 'Energy.Active.Import.Register'}: powerDivider have zero or below value ${self._stationInfo.powerDivider}`;
+ } else if (this._stationInfo.powerDivider && this._stationInfo.powerDivider <= 0) {
+ const errMsg = `${this._logPrefix()} MeterValues measurand ${meterValuesTemplate[index].measurand ? meterValuesTemplate[index].measurand : 'Energy.Active.Import.Register'}: powerDivider have zero or below value ${this._stationInfo.powerDivider}`;
- } else if (self._stationInfo.powerDivider && self._stationInfo.powerDivider <= 0) {
- const errMsg = `${self._logPrefix()} MeterValues measurand ${meterValuesTemplate[index].measurand ? meterValuesTemplate[index].measurand : 'Energy.Active.Import.Register'}: powerDivider have zero or below value ${self._stationInfo.powerDivider}`;
+ } else if (this._stationInfo.powerDivider && this._stationInfo.powerDivider <= 0) {
+ const errMsg = `${this._logPrefix()} MeterValues measurand ${meterValuesTemplate[index].measurand ? meterValuesTemplate[index].measurand : 'Energy.Active.Import.Register'}: powerDivider have zero or below value ${this._stationInfo.powerDivider}`;
- } else if (self._stationInfo.powerDivider && self._stationInfo.powerDivider <= 0) {
- const errMsg = `${self._logPrefix()} MeterValues measurand ${meterValuesTemplate[index].measurand ? meterValuesTemplate[index].measurand : 'Energy.Active.Import.Register'}: powerDivider have zero or below value ${self._stationInfo.powerDivider}`;
+ } else if (this._stationInfo.powerDivider && this._stationInfo.powerDivider <= 0) {
+ const errMsg = `${this._logPrefix()} MeterValues measurand ${meterValuesTemplate[index].measurand ? meterValuesTemplate[index].measurand : 'Energy.Active.Import.Register'}: powerDivider have zero or below value ${this._stationInfo.powerDivider}`;
logger.error(errMsg);
throw Error(errMsg);
}
if (Utils.isUndefined(meterValuesTemplate[index].value)) {
similarity index 79%
rename from src/start.js
rename to src/start.ts
index 0027fbae2dc4dee55e41bf368ada520957eb53a1..baef77d120b6022ec3ecb762bf7aff8de0a22302 100644 (file)
similarity index 93%
rename from src/utils/Constants.js
rename to src/utils/Constants.ts
index 7667738004b954911316a2a7a69793d3038fea6b..cdc4dc75146a6e828d918bc4165ea77f691c50af 100644 (file)
similarity index 77%
rename from src/utils/Logger.js
rename to src/utils/Logger.ts
index 42d9d3076f19c8c661feda26269f851bb4c61fad..736e9b89732f73435683c014fca1fd6b2ce909c4 100644 (file)
similarity index 86%
rename from src/utils/Statistics.js
rename to src/utils/Statistics.ts
index 85165097098354546b4f0eb589f5cd3e276ee3ce..a2e0d030f009221fe5bf69cef6a8aee51353c75e 100644 (file)
similarity index 71%
rename from src/utils/Utils.js
rename to src/utils/Utils.ts
index 9d071a415faabcb5a086ce1a6ab765d8320736bc..c54bb17fa7431c587d21548b6923975d058bb5b4 100644 (file)
+ // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
+ // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
+ // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
+ // "typeRoots": [], /* List of folders to include type definitions from. */
+ // "types": [], /* Type declaration files to be included in compilation. */
+ // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
+ "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
+ // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
+ // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
+ // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
+ // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
+ // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
+
+ /* Experimental Options */
+ // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
+ // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
+
+ /* Advanced Options */
+ "skipLibCheck": true, /* Skip type checking of declaration files. */
+ "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */