)
break
default: {
- const errMsg = `MeterValues measurand ${
+ const errorMsg = `MeterValues measurand ${
powerTemplate.measurand ?? MeterValueMeasurand.ENERGY_ACTIVE_IMPORT_REGISTER
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
}: Unknown ${chargingStation.stationInfo?.currentOutType} currentOutType in template file ${
}, cannot calculate ${
powerTemplate.measurand ?? MeterValueMeasurand.ENERGY_ACTIVE_IMPORT_REGISTER
} measurand value`
- logger.error(`${chargingStation.logPrefix()} ${errMsg}`)
- throw new OCPPError(ErrorType.INTERNAL_ERROR, errMsg, RequestCommand.METER_VALUES)
+ logger.error(`${chargingStation.logPrefix()} ${errorMsg}`)
+ throw new OCPPError(ErrorType.INTERNAL_ERROR, errorMsg, RequestCommand.METER_VALUES)
}
}
: getRandomFloatRounded(connectorMaximumAmperage, connectorMinimumAmperage)
break
default: {
- const errMsg = `MeterValues measurand ${
+ const errorMsg = `MeterValues measurand ${
currentTemplate.measurand ?? MeterValueMeasurand.ENERGY_ACTIVE_IMPORT_REGISTER
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
}: Unknown ${chargingStation.stationInfo?.currentOutType} currentOutType in template file ${
}, cannot calculate ${
currentTemplate.measurand ?? MeterValueMeasurand.ENERGY_ACTIVE_IMPORT_REGISTER
} measurand value`
- logger.error(`${chargingStation.logPrefix()} ${errMsg}`)
- throw new OCPPError(ErrorType.INTERNAL_ERROR, errMsg, RequestCommand.METER_VALUES)
+ logger.error(`${chargingStation.logPrefix()} ${errorMsg}`)
+ throw new OCPPError(ErrorType.INTERNAL_ERROR, errorMsg, RequestCommand.METER_VALUES)
}
}
measurandType: MeterValueMeasurand | undefined
): void => {
if (chargingStation.powerDivider == null) {
- const errMsg = `MeterValues measurand ${
+ const errorMsg = `MeterValues measurand ${
measurandType ?? MeterValueMeasurand.ENERGY_ACTIVE_IMPORT_REGISTER
}: powerDivider is undefined`
- logger.error(`${chargingStation.logPrefix()} ${errMsg}`)
- throw new OCPPError(ErrorType.INTERNAL_ERROR, errMsg, RequestCommand.METER_VALUES)
+ logger.error(`${chargingStation.logPrefix()} ${errorMsg}`)
+ throw new OCPPError(ErrorType.INTERNAL_ERROR, errorMsg, RequestCommand.METER_VALUES)
} else if (chargingStation.powerDivider <= 0) {
- const errMsg = `MeterValues measurand ${
+ const errorMsg = `MeterValues measurand ${
measurandType ?? MeterValueMeasurand.ENERGY_ACTIVE_IMPORT_REGISTER
}: powerDivider have zero or below value ${chargingStation.powerDivider.toString()}`
- logger.error(`${chargingStation.logPrefix()} ${errMsg}`)
- throw new OCPPError(ErrorType.INTERNAL_ERROR, errMsg, RequestCommand.METER_VALUES)
+ logger.error(`${chargingStation.logPrefix()} ${errorMsg}`)
+ throw new OCPPError(ErrorType.INTERNAL_ERROR, errorMsg, RequestCommand.METER_VALUES)
}
}
public static deleteInstance (objId: string | undefined): boolean {
if (objId == null) {
- const errMsg = 'Cannot delete performance statistics instance without specifying object id'
- logger.error(`${PerformanceStatistics.logPrefix()} ${errMsg}`)
- throw new BaseError(errMsg)
+ const errorMsg = 'Cannot delete performance statistics instance without specifying object id'
+ logger.error(`${PerformanceStatistics.logPrefix()} ${errorMsg}`)
+ throw new BaseError(errorMsg)
}
return PerformanceStatistics.instances.delete(objId)
}
uri: undefined | URL
): PerformanceStatistics | undefined {
if (objId == null) {
- const errMsg = 'Cannot get performance statistics instance without specifying object id'
- logger.error(`${PerformanceStatistics.logPrefix()} ${errMsg}`)
- throw new BaseError(errMsg)
+ const errorMsg = 'Cannot get performance statistics instance without specifying object id'
+ logger.error(`${PerformanceStatistics.logPrefix()} ${errorMsg}`)
+ throw new BaseError(errorMsg)
}
if (objName == null) {
- const errMsg = 'Cannot get performance statistics instance without specifying object name'
- logger.error(`${PerformanceStatistics.logPrefix()} ${errMsg}`)
- throw new BaseError(errMsg)
+ const errorMsg = 'Cannot get performance statistics instance without specifying object name'
+ logger.error(`${PerformanceStatistics.logPrefix()} ${errorMsg}`)
+ throw new BaseError(errorMsg)
}
if (uri == null) {
- const errMsg = 'Cannot get performance statistics instance without specifying object uri'
- logger.error(`${PerformanceStatistics.logPrefix()} ${errMsg}`)
- throw new BaseError(errMsg)
+ const errorMsg = 'Cannot get performance statistics instance without specifying object uri'
+ logger.error(`${PerformanceStatistics.logPrefix()} ${errorMsg}`)
+ throw new BaseError(errorMsg)
}
if (!PerformanceStatistics.instances.has(objId)) {
PerformanceStatistics.instances.set(objId, new PerformanceStatistics(objId, objName, uri))