From 100eb21689e871e5af920f987a1c96c5bfb2a95e Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sun, 11 Mar 2018 19:33:36 +0100 Subject: [PATCH] Product Storage born --- .vs/AAWebPlatform/v15/.suo | Bin 75776 -> 79360 bytes AAWebPlatform.njsproj | 2 +- FileCloud.js | 6 ++- Storage.js => ProductStorage.js | 2 +- TimelineChart.js | 2 +- index.html | 2 +- server.js | 68 +++++++++++++++++++------------- 7 files changed, 49 insertions(+), 33 deletions(-) rename Storage.js => ProductStorage.js (99%) diff --git a/.vs/AAWebPlatform/v15/.suo b/.vs/AAWebPlatform/v15/.suo index 137ffc25e9b38a9a0af6b30709497761a014a015..9d90c68614354ceb8c02294dcdc21a86f7dd65df 100644 GIT binary patch delta 3247 zcmds3Yfw{16ux_N14&4bNO%bf1khw4n9Cy&v>G7bqxhg|$6BmL6G5tALqrg;;Ezu2 z6F9cosgIDVV;!6k?ho2O5>cpHP^U$#oz|kYRXg_a!#edxOV5Tx0kNZYrayY%%|)4?%M=UeBQqMnoW9 zgn8Vwh>aL&5Wb!%7;6!8VF#DHJ|Cmm2nB+^u@XHUJIdRpxg2jChd$36&qS~G#?PWx zB2F!atU|xl`$mm7_o}x|dn97q%x(xg_N{%!_zpj>7l zC_8e50gRGJEsqgphB7h@y$mrOF$>}2H5_9S+MBRIgETCA`E zxiZKN=LJX7TgqmW!*3Zr+M^VErp)_;qc6kATiB4AbZAY#S+}|a+HFFDQ0Y7cNPg>IW_*S z?X2qv8?Xm87mTk;m;=z*yAhIB1cB*lqNC602trP!8ST2WhD!>3vK z45NY9t+S=`x->(YRcGXRUbi;QvX1Ai8CIjwQn#0O7gyNql{RQPmn3r%bCw=|YEpd* zCJ<8{34{ANA$s2$qPXK-1fBN%h4>{iWlSkj-!mJ&YfXS-ePUSII~^{6Rt&#s{jtqK zz?nqY(lgKV+}SUOfPM}1cWV_DD11AvyOeSRohwS9+WCS^&(I%g!z3JG!PyhzEiQwC zoUC);#tdDyF)v@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mI)LOfZp%7Gmd@(7*u;&Dm>WjP6a}K)d`) z^$x*-BhVbm_kMef{GKR(D$=%Fty27h{>avh?NlZH_68>J6v@5Is#y12W?2j$jm}37 zuDo~v)W@FicZ9=egLnZZG=ppHsiS)*AF?2++ z)BeC~1!ZxSUw zIMQrLlF9g4K6wU8T+dM9krRbkkq=@sK4E1-IhOmp$VUOC_a2!2c-e(bLcOp`m@KRl z-V)ls*yp!y-P=|bI`NmXS7()V_)Sbr7s3Ww_0juJDxqp^{VI~KI>`O|Aal^1Kl*_!BCode - + Code diff --git a/FileCloud.js b/FileCloud.js index 9462d17a6..030e63e72 100644 --- a/FileCloud.js +++ b/FileCloud.js @@ -18,14 +18,16 @@ function newFileCloud() { } - function getFile(pSet, pDevTeam, pBot, pExchange, pMarket, pPeriodName, pDatetime, callBackFunction) { + function getFile(pDevTeam, pBot, pSet, pExchange, pMarket, pPeriodName, pDatetime, callBackFunction) { let fileName = pSet.fileName; let filePath = pSet.filePath; if (fileName === undefined) { - console.log("Inconsistant data. Check the following. "); + console.log("Inconsistant data. Check the following: "); + console.log(JSON.stringify(pDevTeam)); + console.log(JSON.stringify(pBot)); console.log(JSON.stringify(pSet)); console.log(JSON.stringify(pExchange)); console.log(JSON.stringify(pMarket)); diff --git a/Storage.js b/ProductStorage.js similarity index 99% rename from Storage.js rename to ProductStorage.js index deabab773..7e5266058 100644 --- a/Storage.js +++ b/ProductStorage.js @@ -1,5 +1,5 @@  -function newStorage(pName) { +function newProductStorage(pName) { const CONSOLE_LOG = false; diff --git a/TimelineChart.js b/TimelineChart.js index acf8e51bd..10604b9a8 100644 --- a/TimelineChart.js +++ b/TimelineChart.js @@ -112,7 +112,7 @@ function newTimelineChart() { /* Before Initializing a Plotter, we need the Storage it will use, loaded with the files it will initially need. */ let objName = pProductCard.devTeam.codeName + "-" + pProductCard.bot.codeName + "-" + pProductCard.product.codeName; - let storage = newStorage(objName); + let storage = newProductStorage(objName); /* diff --git a/index.html b/index.html index 07c4f451b..67f0c3930 100644 --- a/index.html +++ b/index.html @@ -7,7 +7,7 @@ - + diff --git a/server.js b/server.js index 840ac4d98..32033320a 100644 --- a/server.js +++ b/server.js @@ -375,29 +375,36 @@ function onBrowserRequest(request, response) { ' break;' + '\n' + '\n' let devTeams = ecosystemObject.devTeams; + let competitionHosts = ecosystemObject.competitionHosts; - for (let i = 0; i < devTeams.length; i++) { + addToFileContent(devTeams); + addToFileContent(competitionHosts); - let devTeam = devTeams[i]; + function addToFileContent(pDevTeamsOrCompetitionHosts) { - for (let j = 0; j < devTeam.plotters.length; j++) { + for (let i = 0; i < pDevTeamsOrCompetitionHosts.length; i++) { - let plotter = devTeam.plotters[j]; + let devTeam = pDevTeamsOrCompetitionHosts[i]; - let caseStringCopy = caseString; + for (let j = 0; j < devTeam.plotters.length; j++) { - let newFunctionName = devTeam.codeName + plotter.repo + plotter.moduleName; - newFunctionName = newFunctionName.replace(/-/g, ""); + let plotter = devTeam.plotters[j]; - let stringToInsert; - stringToInsert = caseStringCopy.replace('@newFunctionName@', newFunctionName); - stringToInsert = stringToInsert.replace('newPlotterName', 'new' + newFunctionName); + let caseStringCopy = caseString; - let firstPart = fileContent.substring(0,fileContent.indexOf('// Cases')); - let secondPart = fileContent.substring(fileContent.indexOf('// Cases')); + let newFunctionName = devTeam.codeName + plotter.repo + plotter.moduleName; + newFunctionName = newFunctionName.replace(/-/g, ""); - fileContent = firstPart + stringToInsert + secondPart; - + let stringToInsert; + stringToInsert = caseStringCopy.replace('@newFunctionName@', newFunctionName); + stringToInsert = stringToInsert.replace('newPlotterName', 'new' + newFunctionName); + + let firstPart = fileContent.substring(0, fileContent.indexOf('// Cases')); + let secondPart = fileContent.substring(fileContent.indexOf('// Cases')); + + fileContent = firstPart + stringToInsert + secondPart; + + } } } @@ -516,29 +523,36 @@ function onBrowserRequest(request, response) { ' ' let devTeams = ecosystemObject.devTeams; + let competitionHosts = ecosystemObject.competitionHosts; - for (let i = 0; i < devTeams.length; i++) { + addScript(devTeams); + addScript(competitionHosts); - let devTeam = devTeams[i]; + function addScript(pDevTeamsOrCompetitionHosts) { - for (let j = 0; j < devTeam.plotters.length; j++) { + for (let i = 0; i < pDevTeamsOrCompetitionHosts.length; i++) { - let plotter = devTeam.plotters[j]; + let devTeam = pDevTeamsOrCompetitionHosts[i]; - /* Now each of these layers has a plotter that we need to define on the Plotter.js file. */ + for (let j = 0; j < devTeam.plotters.length; j++) { - let htmlLineCopy = htmlLine; + let plotter = devTeam.plotters[j]; - let stringToInsert; - stringToInsert = htmlLineCopy.replace('@devTeam@', devTeam.codeName); - stringToInsert = stringToInsert.replace('@repo@', plotter.repo); - stringToInsert = stringToInsert.replace('@module@', plotter.moduleName); + /* Now each of these layers has a plotter that we need to define on the Plotter.js file. */ - let firstPart = fileContent.substring(0, fileContent.indexOf('') + 15); - let secondPart = fileContent.substring(fileContent.indexOf('') + 15); + let htmlLineCopy = htmlLine; - fileContent = firstPart + stringToInsert + secondPart; + let stringToInsert; + stringToInsert = htmlLineCopy.replace('@devTeam@', devTeam.codeName); + stringToInsert = stringToInsert.replace('@repo@', plotter.repo); + stringToInsert = stringToInsert.replace('@module@', plotter.moduleName); + let firstPart = fileContent.substring(0, fileContent.indexOf('') + 15); + let secondPart = fileContent.substring(fileContent.indexOf('') + 15); + + fileContent = firstPart + stringToInsert + secondPart; + + } } }