From: Jérôme Benoit Date: Mon, 23 Nov 2020 20:55:03 +0000 (+0100) Subject: Make CircularArray class self-contained and an independant module. X-Git-Tag: v1.0.1-0~182 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=53f53d659ec019eeee2957d8542ce54b8ceb9070;p=e-mobility-charging-stations-simulator.git Make CircularArray class self-contained and an independant module. Signed-off-by: Jérôme Benoit --- diff --git a/src/assets/configs-aws b/src/assets/configs-aws index b042164e..c08cc2be 160000 --- a/src/assets/configs-aws +++ b/src/assets/configs-aws @@ -1 +1 @@ -Subproject commit b042164ef7144070be0fe1af2ce310bc512803aa +Subproject commit c08cc2beb3cbed8907a2f1c84ea7bc698131714c diff --git a/src/utils/CircularArray.ts b/src/utils/CircularArray.ts index 12aa2b18..319b6924 100644 --- a/src/utils/CircularArray.ts +++ b/src/utils/CircularArray.ts @@ -1,11 +1,11 @@ -import Constants from './Constants'; export default class CircularArray extends Array { public size: number; + private readonly MAXIMUM_CIRCULAR_ARRAY_SIZE = 2000; - constructor(size: number = Constants.MAXIMUM_MEASUREMENTS_NUMBER) { + constructor(size?: number) { super(); - this.size = size; + this.size = size && size <= this.MAXIMUM_CIRCULAR_ARRAY_SIZE ? size : this.MAXIMUM_CIRCULAR_ARRAY_SIZE; } push(...items: T[]): number { diff --git a/src/utils/Constants.ts b/src/utils/Constants.ts index 56652b37..eab54ea5 100644 --- a/src/utils/Constants.ts +++ b/src/utils/Constants.ts @@ -50,7 +50,5 @@ export default class Constants { static readonly CHARGING_STATION_DEFAULT_RESET_TIME = 60000; // Ms static readonly CHARGING_STATION_ATG_WAIT_TIME = 2000; // Ms - static readonly MAXIMUM_MEASUREMENTS_NUMBER = 2000; - static readonly TRANSACTION_DEFAULT_IDTAG = '00000000'; }