Plotters working with Folders at layers

This commit is contained in:
Luis Fernando Molina committed 2020-08-31 20:04:34 +02:00
1 parent 37df768bb3
commit 30bfc4e3b1
3 files changed
+53 -36

No files matched your search

+17 -19
View File
@@ -125,17 +125,17 @@ function newPlottersManager() {
}
}
let baseAsset = layer.definition.referenceParent.parentNode.referenceParent.baseAsset.referenceParent.config.codeName
let quotedAsset = layer.definition.referenceParent.parentNode.referenceParent.quotedAsset.referenceParent.config.codeName
let baseAsset = layer.baseAsset.config.codeName
let quotedAsset = layer.quotedAsset.config.codeName
let market = {
baseAsset: baseAsset,
quotedAsset: quotedAsset
}
let productDefinition = layer.definition.referenceParent.referenceParent
let bot = layer.definition.referenceParent.referenceParent.parentNode
let dataMine = layer.definition.referenceParent.referenceParent.parentNode.parentNode
let exchange = layer.definition.referenceParent.parentNode.referenceParent.parentNode.parentNode
let plotterModule = layer.definition.referenceParent.referenceParent.referenceParent
let productDefinition = layer.productDefinition
let bot = layer.bot
let dataMine = layer.dataMine
let exchange = layer.exchange
let plotterModule = layer.plotterModule
let session
let tradingSystem
let tradingEngine
@@ -144,19 +144,17 @@ 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.
*/
if (layer.definition.referenceParent.parentNode.parentNode !== undefined) {
if (layer.definition.referenceParent.parentNode.parentNode.type === 'Session Reference') {
if (layer.definition.referenceParent.parentNode.parentNode.referenceParent !== undefined) {
session = layer.definition.referenceParent.parentNode.parentNode.referenceParent
let sessionReference = findNodeInNodeBranch(layer.definition, 'Session Reference')
/* From the session we might be able to reach the Trading System or the Trading Engine */
if (session.tradingSystemReference !== undefined) {
tradingSystem = session.tradingSystemReference.referenceParent
}
if (session.tradingEngineReference !== undefined) {
tradingEngine = session.tradingEngineReference.referenceParent
}
}
if (sessionReference !== undefined) {
session = sessionReference.referenceParent
/* From the session we might be able to reach the Trading System or the Trading Engine */
if (session.tradingSystemReference !== undefined) {
tradingSystem = session.tradingSystemReference.referenceParent
}
if (session.tradingEngineReference !== undefined) {
tradingEngine = session.tradingEngineReference.referenceParent
}
}
@@ -39,7 +39,6 @@ function newTaskFunctions() {
'Process Definition->' +
'Process Output->' +
'Output Dataset Folder->Output Dataset Folder->Output Dataset Folder->Output Dataset Folder->Output Dataset Folder->' +
'Output Dataset Folder->Output Dataset Folder->Output Dataset Folder->Output Dataset Folder->Output Dataset Folder->' +
'Output Dataset->Dataset Definition->Product Definition->' +
'Process Dependencies->' +
'Status Dependency->Status Report->Process Definition->' +
+36 -16
View File
@@ -15,6 +15,9 @@ function newLayer() {
quotedAsset: undefined,
market: undefined,
exchange: undefined,
bot: undefined,
productDefinition: undefined,
dataMine: undefined,
plotterModule: undefined,
exchangeIcon: undefined,
plotterTypeIcon: undefined,
@@ -130,6 +133,9 @@ function newLayer() {
thisObject.baseAssetIcon = undefined
thisObject.quotedAssetIcon = undefined
thisObject.networkNode = undefined
thisObject.bot = undefined
thisObject.productDefinition = undefined
thisObject.dataMine = undefined
}
function initialize(callBackFunction) {
@@ -155,7 +161,6 @@ function newLayer() {
'->Layer->' +
'Data Product->' +
'Data Product Folder->Data Product Folder->Data Product Folder->Data Product Folder->Data Product Folder->' +
'Data Product Folder->Data Product Folder->Data Product Folder->Data Product Folder->Data Product Folder->' +
'Bot Products->Data Mine Products->' +
'Single Market Data->Exchange Data Products->' +
'Session Reference->Session Independent Data->Session Based Data->Exchange Sessions->Session Based Data->Data Storage->Network Node->' +
@@ -167,9 +172,8 @@ function newLayer() {
'Exchange Markets->Crypto Exchange->' +
'Product Definition->' +
'Product Definition Folder->Product Definition Folder->Product Definition Folder->Product Definition Folder->Product Definition Folder->' +
'Product Definition Folder->Product Definition Folder->Product Definition Folder->Product Definition Folder->Product Definition Folder->' +
'Sensor Bot->Indicator Bot->Trading Bot->' +
'Data Mine->' +
'Data Mine->' +
'Dataset Definition->' +
'Record Definition->Record Property->Formula->' +
'Data Building Procedure->Procedure Loop->Javascript Code->Procedure Initialization->Javascript Code->' +
@@ -205,24 +209,40 @@ function newLayer() {
thisObject.payload.uiObject.setErrorMessage('Data Product not Found')
return
}
if (findNodeInNodeBranch(thisObject.definition, 'Product Definition') === undefined) {
thisObject.payload.uiObject.setErrorMessage('Product Definition not Found')
return
}
if (findNodeInNodeBranch(thisObject.definition, 'Data Mine') === undefined) {
thisObject.payload.uiObject.setErrorMessage('Data Mine not Found')
return
}
if (findNodeInNodeBranch(thisObject.definition, 'Market') === undefined) {
thisObject.payload.uiObject.setErrorMessage('Market not Found')
return
}
}
thisObject.productDefinition = findNodeInNodeBranch(thisObject.definition, 'Product Definition')
if (thisObject.productDefinition === undefined) {
thisObject.payload.uiObject.setErrorMessage('Product Definition not Found')
return
}
thisObject.bot = findNodeInNodeBranch(thisObject.definition, 'Sensor Bot')
if (thisObject.bot === undefined) {
thisObject.bot = findNodeInNodeBranch(thisObject.definition, 'Indicator Bot')
}
if (thisObject.bot === undefined) {
thisObject.bot = findNodeInNodeBranch(thisObject.definition, 'Trading Bot')
}
if (thisObject.bot === undefined) {
thisObject.payload.uiObject.setErrorMessage('Bot not Found')
return
}
thisObject.dataMine = findNodeInNodeBranch(thisObject.definition, 'Data Mine')
if (thisObject.dataMine === undefined) {
thisObject.payload.uiObject.setErrorMessage('Data Mine not Found')
return
}
thisObject.exchange = findNodeInNodeBranch(thisObject.definition, 'Crypto Exchange')
if (thisObject.exchange === undefined) {
thisObject.payload.uiObject.setErrorMessage('Crypto Exchange not Found')
return
}
}
thisObject.baseAsset = findNodeInNodeBranch(thisObject.definition, 'Market Base Asset')
if (thisObject.baseAsset !== undefined) {
@@ -240,19 +260,19 @@ function newLayer() {
if (thisObject.quotedAsset === undefined) {
thisObject.payload.uiObject.setErrorMessage('Market Quoted Asset not Found')
return
}
}
thisObject.plotterModule = findNodeInNodeBranch(thisObject.definition, 'Plotter Module')
if (thisObject.plotterModule === undefined) {
thisObject.payload.uiObject.setErrorMessage('Market Quoted Asset not Found')
return
}
}
thisObject.networkNode = findNodeInNodeBranch(thisObject.definition, 'Network Node')
if (thisObject.networkNode === undefined) {
thisObject.payload.uiObject.setErrorMessage('Network Node not Found')
return
}
}
/* Lets listen to our own events to react when we have a Mouse Click */
onMouseClickEventSuscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseClick', onMouseClick)