From 6af8d758e8161d4dcec1147cbdf92967f95f0953 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Mon, 30 Apr 2018 10:30:27 +0200 Subject: [PATCH] Refactoring --- .vs/AAWeb/v15/.suo | Bin 67072 -> 67072 bytes Files/{FileCursorCache.js => DailyFiles.js} | 4 ++-- ProductStorage.js | 19 +++++++++---------- Project.njsproj | 2 +- index.html | 2 +- 5 files changed, 13 insertions(+), 14 deletions(-) rename Files/{FileCursorCache.js => DailyFiles.js} (98%) diff --git a/.vs/AAWeb/v15/.suo b/.vs/AAWeb/v15/.suo index 10c8790d8eb8d329c564435866d6d8d014657a4b..5a616276cb9b6003e8a4bdac3b92d04efa62166e 100644 GIT binary patch delta 629 zcmZqZVQJ`L*^tA;nsC7XSIp)@CU!0t3lfTbQV|7W)%&DBrGuvQtyWisQO#K{Y0 z&DqQ}mzj|C(AD0y!q%x3#Q2rS0+u~yIp&8@3La{$&E9VH!Eye z!zjoHR0{z@2Lyo(uE}?|DolPjO=_~i94=g@v9n;+r#$&XKkH<}eg2aVY-8UXw`~#g zL!~crWqQhn5S4;Cf1T~ aup;B+z!HPa24^lXP8K|pvN`449CHACD(`Us delta 653 zcmZqZVQJ`L*^tA;+VJY^o9NAjOzez|I-4t*KQpl^JkIz96k&siu>TihEZSTt_urDS zc5`Kfm@MOo$rDNo7{ewrDmYF4@lRxOW?8790RspaAmHY`WtRjPPi&shUcf|zT4!di zS}_I&VW1)043iV5%$Z!UV&>%Y{f3hh7A8(koTo=UfkBM=?$KjOCrANA1Cp*qmAm1QX#>s&t2Ad7eTwt7RcUo%lx5LSsYtJ>C F0{{*~?qL7` diff --git a/Files/FileCursorCache.js b/Files/DailyFiles.js similarity index 98% rename from Files/FileCursorCache.js rename to Files/DailyFiles.js index 30e6fd6a9..0e2dd4571 100644 --- a/Files/FileCursorCache.js +++ b/Files/DailyFiles.js @@ -1,7 +1,7 @@  -function newFileCursorCache() { +function newDailyFiles() { - const MODULE_NAME = "File Cursor Cache"; + const MODULE_NAME = "Daily Files"; const INFO_LOG = false; const logger = newDebugLog(); logger.fileName = MODULE_NAME; diff --git a/ProductStorage.js b/ProductStorage.js index 062db1e4b..41d5ae797 100644 --- a/ProductStorage.js +++ b/ProductStorage.js @@ -15,13 +15,12 @@ function newProductStorage(pName) { At the same time it will raise an event for each underlaying file being loaded, so that the UI can reflect the progress to the end user. Product Storage - | | |-----> File | |-----> FileSequence | - |-----> FileCursorCache -----> FileCursor + |-----> DailyFiles -----> FileCursor | |-----> MarketFiles @@ -30,7 +29,7 @@ function newProductStorage(pName) { let thisObject = { marketFiles: [], - fileCursorCache: [], + dailyFiles: [], file: [], fileSequence: [], @@ -86,9 +85,9 @@ function newProductStorage(pName) { if (INFO_LOG === true) { logger.write("[INFO] initialize -> Daily Files -> key = " + pDevTeam.codeName + "-" + pBot.codeName + "-" + pProduct.codeName); } - let fileCursorCache = newFileCursorCache(); - fileCursorCache.initialize(pDevTeam, pBot, pProduct, thisSet, pExchange, pMarket, pDatetime, pTimePeriod, onFileCursorReady); - thisObject.fileCursorCache.push(fileCursorCache); + let dailyFiles = newDailyFiles(); + dailyFiles.initialize(pDevTeam, pBot, pProduct, thisSet, pExchange, pMarket, pDatetime, pTimePeriod, onFileCursorReady); + thisObject.dailyFiles.push(dailyFiles); dataSetsToLoad++; } break; @@ -395,9 +394,9 @@ function newProductStorage(pName) { if (timePeriod <= _1_HOUR_IN_MILISECONDS) { - for (let i = 0; i < thisObject.fileCursorCache.length; i++) { + for (let i = 0; i < thisObject.dailyFiles.length; i++) { - thisObject.fileCursorCache[i].setDatetime(pDatetime); + thisObject.dailyFiles[i].setDatetime(pDatetime); } } } @@ -416,9 +415,9 @@ function newProductStorage(pName) { if (timePeriod <= _1_HOUR_IN_MILISECONDS) { - for (let i = 0; i < thisObject.fileCursorCache.length; i++) { + for (let i = 0; i < thisObject.dailyFiles.length; i++) { - thisObject.fileCursorCache[i].setTimePeriod(pTimePeriod, datetime); + thisObject.dailyFiles[i].setTimePeriod(pTimePeriod, datetime); } } } diff --git a/Project.njsproj b/Project.njsproj index cedfb0756..4eb805a34 100644 --- a/Project.njsproj +++ b/Project.njsproj @@ -68,7 +68,7 @@ Code - + Code diff --git a/index.html b/index.html index d0ea570e3..68ec64a90 100644 --- a/index.html +++ b/index.html @@ -69,7 +69,7 @@ - +