Legacy Code Reorganized
This commit is contained in:
1 parent
f4113ce2cb
commit
37a7ca9228
39 files changed
+37
-34
No files matched your search
@@ -11,10 +11,8 @@ TASK_SERVER_PATH=./TaskServer
|
||||
# TASK SERVER VARIABLES:
|
||||
|
||||
STORAGE_PATH=./Data-Storage
|
||||
PLOTTERS_PATH=./Legacy-Code
|
||||
|
||||
WRITE_LOGS_TO_FILES=true
|
||||
BOTS_PATH=./Legacy-Code
|
||||
LOG_PATH=./Log-Files
|
||||
WEB_SERVER_URL=localhost
|
||||
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
|
||||
INTER_PROCESS_FILES_PATH=../Inter-Process-Files
|
||||
STORAGE_PATH=../Data-Storage
|
||||
PLOTTERS_PATH=../Legacy-Code
|
||||
|
||||
USE_KEYVAULT=false
|
||||
WRITE_LOGS_TO_FILES=true
|
||||
BOTS_PATH=../Legacy-Code
|
||||
LOG_PATH=../Log-Files
|
||||
|
||||
WEB_SOCKETS_INTERFACE_PORT=18041
|
||||
|
||||
+5
-14
@@ -404,20 +404,11 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE
|
||||
|
||||
case 'Plotters': // This means the plotter folder, not to be confused with the Plotters script!
|
||||
{
|
||||
let dataMine = requestParameters[2]
|
||||
let codeName = requestParameters[3]
|
||||
let moduleName = requestParameters[4]
|
||||
let filePath = process.env.PLOTTERS_PATH + '/' + dataMine + '/plotters/' + codeName + '/' + moduleName
|
||||
respondWithFile(filePath, httpResponse)
|
||||
}
|
||||
break
|
||||
|
||||
case 'PlotterPanels': // This means the PlotterPanels folder, not to be confused with the Plotter Panels scripts!
|
||||
{
|
||||
let dataMine = requestParameters[2]
|
||||
let codeName = requestParameters[3]
|
||||
let moduleName = requestParameters[4]
|
||||
let filePath = process.env.PLOTTERS_PATH + '/' + dataMine + '/plotters/' + codeName + '/' + moduleName
|
||||
let project = requestParameters[2]
|
||||
let dataMine = requestParameters[3]
|
||||
let codeName = requestParameters[4]
|
||||
let moduleName = requestParameters[5]
|
||||
let filePath = process.env.PROJECTS_PATH + '/' + project + '/' + 'Bots-Plotters-Code' + '/' + dataMine + '/plotters/' + codeName + '/' + moduleName
|
||||
respondWithFile(filePath, httpResponse)
|
||||
}
|
||||
break
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,11 +1,9 @@
|
||||
|
||||
INTER_PROCESS_FILES_PATH=../Inter-Process-Files
|
||||
STORAGE_PATH=../Data-Storage
|
||||
PLOTTERS_PATH=../Legacy-Code
|
||||
|
||||
USE_KEYVAULT=false
|
||||
WRITE_LOGS_TO_FILES=true
|
||||
BOTS_PATH=../Legacy-Code
|
||||
LOG_PATH=../Log-Files
|
||||
|
||||
WEB_SOCKETS_INTERFACE_PORT=18041
|
||||
|
||||
@@ -74,7 +74,7 @@ exports.newFileStorage = function newFileStorage(logger, host, port) {
|
||||
let fileLocation
|
||||
let mustBeJason
|
||||
if (filePath.indexOf("/bots/") > 0) {
|
||||
fileLocation = process.env.BOTS_PATH + '/' + filePath
|
||||
fileLocation = process.env.PROJECTS_PATH + '/' + filePath
|
||||
mustBeJason = false
|
||||
} else {
|
||||
fileLocation = process.env.STORAGE_PATH + '/' + filePath
|
||||
|
||||
@@ -36,7 +36,13 @@
|
||||
}
|
||||
|
||||
/* This bot is not ready for taking its code from the UI, then we need to load it from its repo. */
|
||||
let filePath = bot.dataMine + "/" + "bots" + "/" + bot.processNode.referenceParent.parentNode.config.repo + "/" + pProcessConfig.codeName
|
||||
let filePath =
|
||||
bot.processNode.referenceParent.parentNode.parentNode.project + // project
|
||||
'/Bots-Plotters-Code/' +
|
||||
bot.dataMine +
|
||||
"/" + "bots" + "/" +
|
||||
bot.processNode.referenceParent.parentNode.config.repo + "/" +
|
||||
pProcessConfig.codeName
|
||||
filePath += "/User.Bot.js"
|
||||
|
||||
fileStorage.getTextFile(filePath, onBotDownloaded);
|
||||
@@ -54,7 +60,7 @@
|
||||
USER_BOT_MODULE = {}
|
||||
USER_BOT_MODULE.newUserBot = eval(text); // TODO This needs to be changed function
|
||||
|
||||
filePath = bot.dataMine + "/" + "bots" + "/" + bot.processNode.referenceParent.parentNode.config.repo
|
||||
filePath = bot.dataMine + "/" + "bots" + "/" + bot.processNode.referenceParent.parentNode.config.repo
|
||||
filePath += "/Commons.js"
|
||||
|
||||
fileStorage.getTextFile(filePath, onCommonsDownloaded);
|
||||
|
||||
+8
-2
@@ -140,7 +140,13 @@
|
||||
const FILE_STORAGE = require('./FileStorage.js');
|
||||
let fileStorage = FILE_STORAGE.newFileStorage();
|
||||
|
||||
let filePath = global.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.config.codeName + '/bots/' + processInstance.referenceParent.parentNode.config.repo + '/this.bot.config.json';
|
||||
let filePath =
|
||||
global.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.project + // project
|
||||
'/Bots-Plotters-Code/' +
|
||||
global.TASK_NODE.bot.processes[processIndex].referenceParent.parentNode.parentNode.config.codeName + // mine
|
||||
'/bots/' +
|
||||
processInstance.referenceParent.parentNode.config.repo + // bot
|
||||
'/this.bot.config.json'
|
||||
|
||||
fileStorage.getTextFile(filePath, onFileReceived);
|
||||
|
||||
@@ -554,7 +560,7 @@
|
||||
setTimeout(exitProcessInstance, WAIT_TIME_FOR_ALL_PROCESS_INSTANCES_TO_START)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function runLearningBot(pBotConfig, pProcessConfig) {
|
||||
|
||||
global.TOTAL_PROCESS_INSTANCES_CREATED++
|
||||
|
||||
@@ -34,7 +34,13 @@
|
||||
return
|
||||
}
|
||||
|
||||
let filePath = bot.dataMine + "/" + "bots" + "/" + bot.processNode.referenceParent.parentNode.config.repo + "/" + pProcessConfig.codeName
|
||||
let filePath =
|
||||
bot.processNode.referenceParent.parentNode.parentNode.project + // project
|
||||
'/Bots-Plotters-Code/' +
|
||||
bot.dataMine +
|
||||
"/" + "bots" + "/" +
|
||||
bot.processNode.referenceParent.parentNode.config.repo + "/" +
|
||||
pProcessConfig.codeName
|
||||
filePath += "/User.Bot.js"
|
||||
|
||||
fileStorage.getTextFile(filePath, onBotDownloaded);
|
||||
@@ -63,7 +69,7 @@
|
||||
|
||||
function onCommonsDownloaded(err, text) {
|
||||
if (err.result !== global.DEFAULT_OK_RESPONSE.result) {
|
||||
parentLogger.write(MODULE_NAME, "[WARN] initialize -> onBotDownloaded -> onCommonsDownloaded -> Commons not found: " + err.message);
|
||||
parentLogger.write(MODULE_NAME, "[WARN] initialize -> onBotDownloaded -> onCommonsDownloaded -> Commons not found: " + err.message);
|
||||
callBackFunction(global.DEFAULT_OK_RESPONSE);
|
||||
return;
|
||||
}
|
||||
|
||||
+7
-7
@@ -177,13 +177,13 @@ function newAppLoader() {
|
||||
|
||||
function defaultPlotters() {
|
||||
return [
|
||||
'Plotters/Masters/Plotters-Candles-Volumes/Candles.js',
|
||||
'Plotters/Masters/Plotters-Candles-Volumes/CandlePanel.js',
|
||||
'Plotters/Masters/Plotters-Candles-Volumes/Volumes.js',
|
||||
'Plotters/Masters/Plotters-Candles-Volumes/VolumePanel.js',
|
||||
'Plotters/Masters/Plotters-Bollinger-Bands/BollingerBands.js',
|
||||
'Plotters/Masters/Plotters-Bollinger-Bands/BollingerBandsPanel.js',
|
||||
'Plotters/Masters/Plotters-Bollinger-Bands/PercentageBandwidth.js'
|
||||
'Plotters/Superalgos/Masters/Plotters-Candles-Volumes/Candles.js',
|
||||
'Plotters/Superalgos/Masters/Plotters-Candles-Volumes/CandlePanel.js',
|
||||
'Plotters/Superalgos/Masters/Plotters-Candles-Volumes/Volumes.js',
|
||||
'Plotters/Superalgos/Masters/Plotters-Candles-Volumes/VolumePanel.js',
|
||||
'Plotters/Superalgos/Masters/Plotters-Bollinger-Bands/BollingerBands.js',
|
||||
'Plotters/Superalgos/Masters/Plotters-Bollinger-Bands/BollingerBandsPanel.js',
|
||||
'Plotters/Superalgos/Masters/Plotters-Bollinger-Bands/PercentageBandwidth.js'
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user