This commit is contained in:
Luis Fernando Molina committed 2020-10-19 20:03:49 +02:00
1 parent 550cde5661
commit 159697d309
6 files changed
+24 -24

No files matched your search

@@ -57,7 +57,7 @@ function newChartingSpaceFunctions() {
let layer = allLayers[j]
layer.payload.floatingObject.angleToParent = ANGLE_TO_PARENT.RANGE_45
let plotterModule = findNodeInNodeMesh(layer, 'Plotter Module', undefined, true, false, false, true)
let plotterModule = UI.projects.superalgos.utilities.meshes.findNodeInNodeMesh(layer, 'Plotter Module', undefined, true, false, false, true)
if (plotterModule === undefined) {
functionLibraryNodeDeleter.deleteUIObject(layer, rootNodes)
}
@@ -96,10 +96,10 @@ function newChartingSpaceFunctions() {
function scanSessionArray(sessionsArray) {
for (let i = 0; i < sessionsArray.length; i++) {
let session = sessionsArray[i]
let environment = findNodeInNodeMesh(session, node.payload.referenceParent.type, undefined, true, false, true, false)
let environment = UI.projects.superalgos.utilities.meshes.findNodeInNodeMesh(session, node.payload.referenceParent.type, undefined, true, false, true, false)
if (environment === undefined) { continue }
if (environment.id !== node.payload.referenceParent.id) { continue }
let market = findNodeInNodeMesh(session, 'Market Trading Tasks', undefined, true, false, true, false)
let market = UI.projects.superalgos.utilities.meshes.findNodeInNodeMesh(session, 'Market Trading Tasks', undefined, true, false, true, false)
if (market.payload.referenceParent === undefined) { continue }
if (UI.projects.superalgos.utilities.children.isMissingChildren(node, session, true) === true) {
createTimeMachine(node, session, market.payload.referenceParent, networkNode, rootNodes, functionLibraryUiObjectsFromNodes, functionLibraryNodeDeleter)
@@ -201,7 +201,7 @@ function newChartingSpaceFunctions() {
}
}
function deleteNodeByName(nodeName) {
let nodeToDelete = findNodeInNodeMesh(timelineChart.layerManager, undefined, nodeName, true, true, false, false)
let nodeToDelete = UI.projects.superalgos.utilities.meshes.findNodeInNodeMesh(timelineChart.layerManager, undefined, nodeName, true, true, false, false)
if (nodeToDelete === undefined) { return }
functionLibraryNodeDeleter.deleteUIObject(nodeToDelete, rootNodes)
}
@@ -209,7 +209,7 @@ function newCryptoEcosystemFunctions() {
function installMarket(node, rootNodes, functionLibraryUiObjectsFromNodes, functionLibraryNodeDeleter, functionLibraryChartingSpaceFunctions, functionLibraryDataStorageFunctions) {
let market = node
let cryptoExchange = findNodeInNodeMesh(node, 'Crypto Exchange', undefined, true, false, true, false)
let cryptoExchange = UI.projects.superalgos.utilities.meshes.findNodeInNodeMesh(node, 'Crypto Exchange', undefined, true, false, true, false)
if (cryptoExchange === undefined) {
node.payload.uiObject.setErrorMessage('Market must be a descendant of a Crypto Exchange')
return
@@ -370,7 +370,7 @@ function newCryptoEcosystemFunctions() {
functionLibraryNodeDeleter.deleteUIObject(timeMachine, rootNodes)
continue
}
let marketTradingTasks = findNodeInNodeMesh(session, 'Market Trading Tasks', undefined, true, false, true, false)
let marketTradingTasks = UI.projects.superalgos.utilities.meshes.findNodeInNodeMesh(session, 'Market Trading Tasks', undefined, true, false, true, false)
if (marketTradingTasks === undefined) { continue }
if (marketTradingTasks.payload === undefined) { continue }
if (marketTradingTasks.payload.referenceParent === undefined) { continue }
@@ -406,7 +406,7 @@ function newCryptoEcosystemFunctions() {
let timeMachine = timeMachines[i]
let session = timeMachine.payload.referenceParent
if (session === undefined) { continue }
let marketTradingTasks = findNodeInNodeMesh(session, 'Market Trading Tasks', undefined, true, false, true, false)
let marketTradingTasks = UI.projects.superalgos.utilities.meshes.findNodeInNodeMesh(session, 'Market Trading Tasks', undefined, true, false, true, false)
if (marketTradingTasks === undefined) { continue }
if (marketTradingTasks.payload === undefined) { continue }
if (marketTradingTasks.payload.referenceParent === undefined) { continue }
@@ -85,7 +85,7 @@ function newDataStorageFunctions() {
}
function addMissingSessionReferences(node, rootNodes, functionLibraryUiObjectsFromNodes) {
let networkNode = findNodeInNodeMesh(node, 'Network Node', undefined, true, false, true, false)
let networkNode = UI.projects.superalgos.utilities.meshes.findNodeInNodeMesh(node, 'Network Node', undefined, true, false, true, false)
if (networkNode === undefined) { return }
let backtestingSessionsArray = UI.projects.superalgos.utilities.branches.nodeBranchToArray(networkNode, 'Backtesting Session')
@@ -102,7 +102,7 @@ function newDataStorageFunctions() {
for (let i = 0; i < sessionsArray.length; i++) {
let session = sessionsArray[i]
/* We will filter out all the sessions that does not belong to the market we are in */
let marketTradingTasks = findNodeInNodeMesh(session, 'Market Trading Tasks', undefined, true, false, true, false)
let marketTradingTasks = UI.projects.superalgos.utilities.meshes.findNodeInNodeMesh(session, 'Market Trading Tasks', undefined, true, false, true, false)
if (node.payload.referenceParent.id !== marketTradingTasks.payload.referenceParent.id) { continue }
if (UI.projects.superalgos.utilities.children.isMissingChildren(node, session, true) === true) {
createSessionReference(node, session, functionLibraryUiObjectsFromNodes)
@@ -144,7 +144,7 @@ function newPlottersManager() {
A layer can be referencing a Data Product in two different branches of the Network hiriatchy.
In one of those braches we can get the Session node, at the other we Cannot.
*/
let sessionReference = findNodeInNodeMesh(layer.definition, 'Session Reference', undefined, false, true, true, true)
let sessionReference = UI.projects.superalgos.utilities.meshes.findNodeInNodeMesh(layer.definition, 'Session Reference', undefined, false, true, true, true)
if (sessionReference !== undefined) {
session = sessionReference.referenceParent
+13 -13
View File
@@ -206,49 +206,49 @@ function newLayer() {
}
/* Here we validate that we have all the needed information */
if (findNodeInNodeMesh(thisObject.definition, 'Data Product', undefined, false, true, true, true) === undefined) {
if (UI.projects.superalgos.utilities.meshes.findNodeInNodeMesh(thisObject.definition, 'Data Product', undefined, false, true, true, true) === undefined) {
thisObject.payload.uiObject.setErrorMessage('Data Product not Found')
return
}
if (findNodeInNodeMesh(thisObject.definition, 'Market', undefined, false, true, true, true) === undefined) {
if (UI.projects.superalgos.utilities.meshes.findNodeInNodeMesh(thisObject.definition, 'Market', undefined, false, true, true, true) === undefined) {
thisObject.payload.uiObject.setErrorMessage('Market not Found')
return
}
thisObject.productDefinition = findNodeInNodeMesh(thisObject.definition, 'Product Definition', undefined, false, true, true, true)
thisObject.productDefinition = UI.projects.superalgos.utilities.meshes.findNodeInNodeMesh(thisObject.definition, 'Product Definition', undefined, false, true, true, true)
if (thisObject.productDefinition === undefined) {
thisObject.payload.uiObject.setErrorMessage('Product Definition not Found')
return
}
thisObject.bot = findNodeInNodeMesh(thisObject.definition, 'Sensor Bot', undefined, false, true, true, true)
thisObject.bot = UI.projects.superalgos.utilities.meshes.findNodeInNodeMesh(thisObject.definition, 'Sensor Bot', undefined, false, true, true, true)
if (thisObject.bot === undefined) {
thisObject.bot = findNodeInNodeMesh(thisObject.definition, 'Indicator Bot', undefined, false, true, true, true)
thisObject.bot = UI.projects.superalgos.utilities.meshes.findNodeInNodeMesh(thisObject.definition, 'Indicator Bot', undefined, false, true, true, true)
}
if (thisObject.bot === undefined) {
thisObject.bot = findNodeInNodeMesh(thisObject.definition, 'Trading Bot', undefined, false, true, true, true)
thisObject.bot = UI.projects.superalgos.utilities.meshes.findNodeInNodeMesh(thisObject.definition, 'Trading Bot', undefined, false, true, true, true)
}
if (thisObject.bot === undefined) {
thisObject.payload.uiObject.setErrorMessage('Bot not Found')
return
}
thisObject.dataMine = findNodeInNodeMesh(thisObject.definition, 'Data Mine', undefined, false, true, true, true)
thisObject.dataMine = UI.projects.superalgos.utilities.meshes.findNodeInNodeMesh(thisObject.definition, 'Data Mine', undefined, false, true, true, true)
if (thisObject.dataMine === undefined) {
thisObject.dataMine = findNodeInNodeMesh(thisObject.definition, 'Trading Mine', undefined, false, true, true, true)
thisObject.dataMine = UI.projects.superalgos.utilities.meshes.findNodeInNodeMesh(thisObject.definition, 'Trading Mine', undefined, false, true, true, true)
if (thisObject.dataMine === undefined) {
thisObject.payload.uiObject.setErrorMessage('Data Mine or Trading Mine not Found')
return
}
}
thisObject.exchange = findNodeInNodeMesh(thisObject.definition, 'Crypto Exchange', undefined, false, true, true, true)
thisObject.exchange = UI.projects.superalgos.utilities.meshes.findNodeInNodeMesh(thisObject.definition, 'Crypto Exchange', undefined, false, true, true, true)
if (thisObject.exchange === undefined) {
thisObject.payload.uiObject.setErrorMessage('Crypto Exchange not Found')
return
}
thisObject.baseAsset = findNodeInNodeMesh(thisObject.definition, 'Market Base Asset', undefined, false, true, true, true)
thisObject.baseAsset = UI.projects.superalgos.utilities.meshes.findNodeInNodeMesh(thisObject.definition, 'Market Base Asset', undefined, false, true, true, true)
if (thisObject.baseAsset !== undefined) {
thisObject.baseAsset = thisObject.baseAsset.referenceParent
}
@@ -257,7 +257,7 @@ function newLayer() {
return
}
thisObject.quotedAsset = findNodeInNodeMesh(thisObject.definition, 'Market Quoted Asset', undefined, false, true, true, true)
thisObject.quotedAsset = UI.projects.superalgos.utilities.meshes.findNodeInNodeMesh(thisObject.definition, 'Market Quoted Asset', undefined, false, true, true, true)
if (thisObject.quotedAsset !== undefined) {
thisObject.quotedAsset = thisObject.quotedAsset.referenceParent
}
@@ -266,13 +266,13 @@ function newLayer() {
return
}
thisObject.plotterModule = findNodeInNodeMesh(thisObject.definition, 'Plotter Module', undefined, false, false, false, true)
thisObject.plotterModule = UI.projects.superalgos.utilities.meshes.findNodeInNodeMesh(thisObject.definition, 'Plotter Module', undefined, false, false, false, true)
if (thisObject.plotterModule === undefined) {
thisObject.payload.uiObject.setErrorMessage('Plotter Module not Found')
return
}
thisObject.networkNode = findNodeInNodeMesh(thisObject.definition, 'Network Node', undefined, false, true, true, true)
thisObject.networkNode = UI.projects.superalgos.utilities.meshes.findNodeInNodeMesh(thisObject.definition, 'Network Node', undefined, false, true, true, true)
if (thisObject.networkNode === undefined) {
thisObject.payload.uiObject.setErrorMessage('Network Node not Found')
return
+1 -1
View File
@@ -55,7 +55,7 @@ function newSuperalgosBranches() {
/*
This function finds a node in a brach and reports an error if it could not be found.
*/
let nodeFound = findNodeInNodeMesh(startingNode, nodeType, undefined, connectedViaPayload, true, false, false)
let nodeFound = UI.projects.superalgos.utilities.meshes.findNodeInNodeMesh(startingNode, nodeType, undefined, connectedViaPayload, true, false, false)
if (nodeFound === undefined) {
errorNode.payload.uiObject.setErrorMessage('Could not find ' + nodeType + ' at ' + startingNode.type + ' ' + startingNode.name)
return