Barelly Running Again with massive changes
This commit is contained in:
1 parent
89efd12f50
commit
182be1fc21
8 files changed
+347
-249
No files matched your search
+148
-127
@@ -4,7 +4,7 @@ function newPlottersManager () {
|
||||
const logger = newWebDebugLog()
|
||||
logger.fileName = MODULE_NAME
|
||||
|
||||
let productPlotters = []
|
||||
let connectors = []
|
||||
|
||||
let timeFrame = INITIAL_TIME_PERIOD
|
||||
let datetime = NEW_SESSION_INITIAL_DATE
|
||||
@@ -24,8 +24,8 @@ function newPlottersManager () {
|
||||
let initializationReady = false
|
||||
|
||||
let layersPanel
|
||||
let exchange
|
||||
let market
|
||||
|
||||
let onLayerStatusChangedEventSuscriptionId
|
||||
|
||||
setupContainer()
|
||||
return thisObject
|
||||
@@ -36,27 +36,31 @@ function newPlottersManager () {
|
||||
}
|
||||
|
||||
function finalize () {
|
||||
for (let i = 0; i < productPlotters.length; i++) {
|
||||
layersPanel.container.eventHandler.stopListening(onLayerStatusChangedEventSuscriptionId)
|
||||
|
||||
for (let i = 0; i < connectors.length; i++) {
|
||||
let connector = connectors[i]
|
||||
/* Then the panels. */
|
||||
for (let j = 0; j < productPlotters[i].panels.length; j++) {
|
||||
canvas.panelsSpace.destroyPanel(productPlotters[i].panels[j])
|
||||
productPlotters[i].panels[j] = undefined
|
||||
for (let j = 0; j < connector.panels.length; j++) {
|
||||
canvas.panelsSpace.destroyPanel(connector.panels[j])
|
||||
connector.panels[j] = undefined
|
||||
}
|
||||
productPlotters[i].panels = undefined
|
||||
connector.panels = undefined
|
||||
|
||||
/* Finalize the plotters */
|
||||
if (productPlotters[i].plotter.finalize !== undefined) {
|
||||
productPlotters[i].plotter.finalize()
|
||||
if (connector.plotter.finalize !== undefined) {
|
||||
connector.plotter.container.eventHandler.stopListening(connector.plotter.onRecordChangeEventsSubscriptionId)
|
||||
connector.plotter.finalize()
|
||||
}
|
||||
productPlotters[i].plotter = undefined
|
||||
connector.plotter = undefined
|
||||
|
||||
/* Finally the Storage Objects */
|
||||
productPlotters[i].storage.finalize()
|
||||
productPlotters[i].storage = undefined
|
||||
finalizeStorage(connector.storage)
|
||||
connector.storage = undefined
|
||||
|
||||
productPlotters[i] = undefined
|
||||
connector = undefined
|
||||
}
|
||||
productPlotters = []
|
||||
connectors = []
|
||||
|
||||
layersPanel = undefined
|
||||
|
||||
@@ -65,199 +69,216 @@ function newPlottersManager () {
|
||||
setupContainer()
|
||||
}
|
||||
|
||||
function initialize (pProductsPanel, pExchange, pMarket) {
|
||||
function finalizeStorage (storage) {
|
||||
storage.eventHandler.stopListening(storage.onMarketFileLoadedLayerEventsSubscriptionId)
|
||||
storage.eventHandler.stopListening(storage.onDailyFileLoadedLayerEventsSubscriptionId)
|
||||
storage.eventHandler.stopListening(storage.onSingleFileLoadedLayerEventsSubscriptionId)
|
||||
storage.eventHandler.stopListening(storage.onFileSequenceLoadedLayerEventsSubscriptionId)
|
||||
storage.eventHandler.stopListening(storage.onDailyFileLoadedPlotterEventsSubscriptionId)
|
||||
storage.finalize()
|
||||
}
|
||||
|
||||
function initialize (pLayersPanel) {
|
||||
try {
|
||||
/* Remember the Layers Panel */
|
||||
layersPanel = pProductsPanel
|
||||
exchange = pExchange
|
||||
market = pMarket
|
||||
/* Listen to the event of change of status */
|
||||
layersPanel.container.eventHandler.listenToEvent('Layer Status Changed', onLayerStatusChanged)
|
||||
/* Remember the Layers Panel */
|
||||
layersPanel = pLayersPanel
|
||||
|
||||
/* Listen to the event of change of status */
|
||||
onLayerStatusChangedEventSuscriptionId = layersPanel.container.eventHandler.listenToEvent('Layer Status Changed', onLayerStatusChanged)
|
||||
|
||||
/* Lets get all the cards that needs to be loaded. */
|
||||
|
||||
let loadingLayers = layersPanel.getLoadingLayers()
|
||||
|
||||
for (let i = 0; i < loadingLayers.length; i++) {
|
||||
/* For each one, we will initialize the associated plotter. */
|
||||
initializeProductPlotter(loadingLayers[i])
|
||||
/* For each one, we will initialize the associated plotter. */
|
||||
initializePlotter(loadingLayers[i])
|
||||
}
|
||||
} catch (err) {
|
||||
if (ERROR_LOG === true) { logger.write('[ERROR] initialize -> err = ' + err.stack) }
|
||||
}
|
||||
}
|
||||
|
||||
function initializeProductPlotter (pLayer, callBack) {
|
||||
function initializePlotter (layer) {
|
||||
try {
|
||||
/* Before Initializing a Plotter, we need the Storage it will use, loaded with the files it will initially need. */
|
||||
let objName = pLayer.dataMine.codeName + '-' + pLayer.bot.codeName + '-' + pLayer.product.codeName
|
||||
let storage = newProductStorage(objName)
|
||||
/*
|
||||
/* Before Initializing a Plotter, we need the Storage it will use, loaded with the files it will initially need. */
|
||||
let storage = newProductStorage(layer.payload.node.id)
|
||||
|
||||
Before Initializing the Storage, we will put the Layer to listen to the events the storage will raise every time a file is loaded,
|
||||
so that the UI can somehow show this. There are different types of events.
|
||||
/*
|
||||
Before Initializing the Storage, we will put the Layer to listen to the events the storage will raise every time a file is loaded,
|
||||
so that the UI can somehow show this. There are different types of events.
|
||||
*/
|
||||
for (let i = 0; i < layer.definition.referenceParent.referenceParent.datasets.length; i++) {
|
||||
let dataset = layer.definition.referenceParent.referenceParent.datasets[i]
|
||||
|
||||
*/
|
||||
for (let i = 0; i < pLayer.product.dataSets.length; i++) {
|
||||
let thisSet = pLayer.product.dataSets[i]
|
||||
|
||||
switch (thisSet.type) {
|
||||
switch (dataset.type) {
|
||||
case 'Market Files': {
|
||||
storage.eventHandler.listenToEvent('Market File Loaded', pLayer.onMarketFileLoaded)
|
||||
storage.onMarketFileLoadedLayerEventsSubscriptionId = storage.eventHandler.listenToEvent('Market File Loaded', layer.onMarketFileLoaded)
|
||||
}
|
||||
break
|
||||
case 'Daily Files': {
|
||||
storage.eventHandler.listenToEvent('Daily File Loaded', pLayer.onDailyFileLoaded)
|
||||
storage.onDailyFileLoadedLayerEventsSubscriptionId = storage.eventHandler.listenToEvent('Daily File Loaded', layer.onDailyFileLoaded)
|
||||
}
|
||||
break
|
||||
case 'Single File': {
|
||||
storage.eventHandler.listenToEvent('Single File Loaded', pLayer.onSingleFileLoaded)
|
||||
storage.onSingleFileLoadedLayerEventsSubscriptionId = storage.eventHandler.listenToEvent('Single File Loaded', layer.onSingleFileLoaded)
|
||||
}
|
||||
break
|
||||
case 'File Sequence': {
|
||||
storage.eventHandler.listenToEvent('File Sequence Loaded', pLayer.onFileSequenceLoaded)
|
||||
storage.onFileSequenceLoadedLayerEventsSubscriptionId = storage.eventHandler.listenToEvent('File Sequence Loaded', layer.onFileSequenceLoaded)
|
||||
}
|
||||
break
|
||||
default: {
|
||||
if (ERROR_LOG === true) {
|
||||
logger.write('[ERROR] initializePlotter -> Dataset Type Incorrect or Undefined -> dataset.type = ' + dataset.type)
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
storage.initialize(pLayer.dataMine, pLayer.bot, pLayer.session, pLayer.product, exchange, market, datetime, timeFrame, onProductStorageInitialized)
|
||||
let baseAsset = layer.definition.referenceParent.parentNode.referenceParent.baseAsset.referenceParent.code.codeName
|
||||
let quotedAsset = layer.definition.referenceParent.parentNode.referenceParent.quotedAsset.referenceParent.code.codeName
|
||||
let market = baseAsset + '/' + quotedAsset
|
||||
let product = 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 session
|
||||
|
||||
storage.initialize(
|
||||
dataMine,
|
||||
bot,
|
||||
session,
|
||||
product,
|
||||
exchange,
|
||||
market,
|
||||
datetime,
|
||||
timeFrame,
|
||||
onProductStorageInitialized
|
||||
)
|
||||
|
||||
function onProductStorageInitialized (err) {
|
||||
try {
|
||||
if (err.result === GLOBAL.DEFAULT_OK_RESPONSE.result) {
|
||||
/* Now we have all the initial data loaded and ready to be delivered to the new instance of the plotter. */
|
||||
let plotter
|
||||
let productDefinition
|
||||
|
||||
if (pLayer.product.plotter.legacy === false) {
|
||||
if (plotterModule.code.isLegacy !== true) {
|
||||
plotter = newPlotter()
|
||||
|
||||
/* We take a snapwhot of the current product definition to be used by the plotter. */
|
||||
let functionLibraryProtocolNode = newProtocolNode()
|
||||
let lightingPath = '->Product Definition->' +
|
||||
'Record Definition->Record Property->Formula->' +
|
||||
'Data Building Procedure->Procedure Loop->Javascript Code->Procedure Initialization->Javascript Code->' +
|
||||
'Calculations Procedure->Procedure Loop->Javascript Code->Procedure Initialization->Javascript Code->' +
|
||||
'Plotter Module->Shapes->' +
|
||||
'Chart Points->Point->Point Formula->' +
|
||||
'Polygon->Polygon Body->Style->Style Condition->Style->' +
|
||||
'Polygon Border->Style->Style Condition->Style->' +
|
||||
'Polygon Vertex->Point->' +
|
||||
'Plotter Panel->Javascript Code->Panel Data->Data Formula->'
|
||||
productDefinition = functionLibraryProtocolNode.getProtocolNode(pLayer.product.node, false, true, true, false, false, lightingPath)
|
||||
} else {
|
||||
plotter = getNewPlotter(pLayer.product.plotter.dataMine, pLayer.product.plotter.codeName, pLayer.product.plotter.moduleName)
|
||||
plotter = getNewPlotter(dataMine.code.codeName, plotterModule.parentNode.code.codeName, plotterModule.code.codeName)
|
||||
}
|
||||
|
||||
plotter.container.connectToParent(thisObject.container, true, true, false, true, true, true, false, false, true)
|
||||
plotter.container.frame.position.x = thisObject.container.frame.width / 2 - plotter.container.frame.width / 2
|
||||
plotter.container.frame.position.y = thisObject.container.frame.height / 2 - plotter.container.frame.height / 2
|
||||
plotter.fitFunction = thisObject.fitFunction
|
||||
plotter.initialize(storage, exchange, market, datetime, timeFrame, onPlotterInizialized, productDefinition)
|
||||
plotter.initialize(storage, datetime, timeFrame, onPlotterInizialized, product)
|
||||
|
||||
function onPlotterInizialized () {
|
||||
try {
|
||||
let productPlotter = {
|
||||
layer: pLayer,
|
||||
let connector = {
|
||||
layer: layer,
|
||||
plotter: plotter,
|
||||
storage: storage,
|
||||
profile: undefined,
|
||||
notes: undefined
|
||||
storage: storage
|
||||
}
|
||||
/* Let the Plotter listen to the event of Cursor Files loaded, so that it can react recalculating if needed. */
|
||||
storage.eventHandler.listenToEvent('Daily File Loaded', plotter.onDailyFileLoaded)
|
||||
/* Lets load now this plotter panels. */
|
||||
productPlotter.panels = []
|
||||
/* Let the Plotter listen to the event of Cursor Files loaded, so that it can react recalculating if needed. */
|
||||
plotter.onDailyFileLoadedPlotterEventsSubscriptionId = storage.eventHandler.listenToEvent('Daily File Loaded', plotter.onDailyFileLoaded)
|
||||
/* Lets load now this plotter panels. */
|
||||
connector.panels = []
|
||||
|
||||
/* Here is where we instantiate the legacy panels */
|
||||
for (let i = 0; i < pLayer.product.plotter.module.panels.length; i++) {
|
||||
let panelConfig = pLayer.product.plotter.module.panels[i]
|
||||
for (let i = 0; i < plotterModule.panels.length; i++) {
|
||||
let panelConfig = plotterModule.panels[i]
|
||||
|
||||
let parameters = {
|
||||
dataMine: pLayer.product.plotter.dataMine,
|
||||
plotterCodeName: pLayer.product.plotter.codeName,
|
||||
moduleCodeName: pLayer.product.plotter.moduleName,
|
||||
dataMine: layer.product.plotter.dataMine,
|
||||
plotterCodeName: layer.product.plotter.codeName,
|
||||
moduleCodeName: layer.product.plotter.moduleName,
|
||||
panelCodeName: panelConfig.codeName
|
||||
}
|
||||
let panelOwner = exchange + ' ' + market.quotedAsset + '/' + market.baseAsset
|
||||
let plotterPanelHandle = canvas.panelsSpace.createNewPanel('Plotter Panel', parameters, panelOwner, pLayer.session)
|
||||
let plotterPanel = canvas.panelsSpace.getPanel(plotterPanelHandle, panelOwner)
|
||||
|
||||
let plotterPanelHandle = canvas.panelsSpace.createNewPanel('Plotter Panel', parameters, layer.payload.node.id, layer.session)
|
||||
let plotterPanel = canvas.panelsSpace.getPanel(plotterPanelHandle, layer.payload.node.id)
|
||||
/* Connect Panel to the Plotter via an Event. */
|
||||
if (panelConfig.event !== undefined) {
|
||||
productPlotter.plotter.container.eventHandler.listenToEvent(panelConfig.event, plotterPanel.onEventRaised)
|
||||
connector.plotter.onRecordChangeEventsSubscriptionId = connector.plotter.container.eventHandler.listenToEvent(panelConfig.event, plotterPanel.onEventRaised)
|
||||
}
|
||||
productPlotter.panels.push(plotterPanelHandle)
|
||||
connector.panels.push(plotterPanelHandle)
|
||||
}
|
||||
|
||||
/* Here we instantiate the UI Defined Panels. */
|
||||
if (productDefinition !== undefined) {
|
||||
for (let i = 0; i < productDefinition.referenceParent.panels.length; i++) {
|
||||
let panel = productDefinition.referenceParent.panels[i]
|
||||
if (product !== undefined) {
|
||||
for (let i = 0; i < product.referenceParent.panels.length; i++) {
|
||||
let panel = product.referenceParent.panels[i]
|
||||
|
||||
let parameters = {
|
||||
dataMine: pLayer.product.plotter.dataMine,
|
||||
plotterCodeName: pLayer.product.plotter.codeName,
|
||||
moduleCodeName: pLayer.product.plotter.moduleName,
|
||||
dataMine: layer.product.plotter.dataMine,
|
||||
plotterCodeName: layer.product.plotter.codeName,
|
||||
moduleCodeName: layer.product.plotter.moduleName,
|
||||
panelCodeName: panel.id
|
||||
}
|
||||
let panelOwner = exchange + ' ' + market.quotedAsset + '/' + market.baseAsset
|
||||
let plotterPanelHandle = canvas.panelsSpace.createNewPanel('Plotter Panel', parameters, panelOwner, pLayer.session, panel)
|
||||
let plotterPanel = canvas.panelsSpace.getPanel(plotterPanelHandle, panelOwner)
|
||||
|
||||
let plotterPanelHandle = canvas.panelsSpace.createNewPanel('Plotter Panel', parameters, layer.payload.node.id, layer.session, panel)
|
||||
let plotterPanel = canvas.panelsSpace.getPanel(plotterPanelHandle, layer.payload.node.id)
|
||||
|
||||
/* Connect Panel to the Plotter via an Event. */
|
||||
productPlotter.plotter.container.eventHandler.listenToEvent('Current Record Changed', plotterPanel.onRecordChange)
|
||||
productPlotter.panels.push(plotterPanelHandle)
|
||||
connector.plotter.onRecordChangeEventsSubscriptionId = connector.plotter.container.eventHandler.listenToEvent('Current Record Changed', plotterPanel.onRecordChange)
|
||||
connector.panels.push(plotterPanelHandle)
|
||||
}
|
||||
}
|
||||
|
||||
productPlotters.push(productPlotter)
|
||||
connectors.push(connector)
|
||||
} catch (err) {
|
||||
if (ERROR_LOG === true) { logger.write('[ERROR] initializeProductPlotter -> onProductStorageInitialized -> onPlotterInizialized -> err = ' + err.stack) }
|
||||
if (ERROR_LOG === true) { logger.write('[ERROR] initializePlotter -> onProductStorageInitialized -> onPlotterInizialized -> err = ' + err.stack) }
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
if (ERROR_LOG === true) { logger.write('[ERROR] initializeProductPlotter -> onProductStorageInitialized -> err = ' + err.stack) }
|
||||
if (ERROR_LOG === true) { logger.write('[ERROR] initializePlotter -> onProductStorageInitialized -> err = ' + err.stack) }
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
if (ERROR_LOG === true) { logger.write('[ERROR] initializeProductPlotter -> err = ' + err.stack) }
|
||||
if (ERROR_LOG === true) { logger.write('[ERROR] initializePlotter -> err = ' + err.stack) }
|
||||
}
|
||||
}
|
||||
|
||||
function onLayerStatusChanged (pLayer) {
|
||||
if (pLayer.status === PRODUCT_CARD_STATUS.LOADING) {
|
||||
function onLayerStatusChanged (layer) {
|
||||
if (layer.status === PRODUCT_CARD_STATUS.LOADING) {
|
||||
/* Lets see if we can find the Plotter of this card on our Active Plotters list, other wise we will initialize it */
|
||||
let found = false
|
||||
for (let i = 0; i < productPlotters.length; i++) {
|
||||
if (productPlotters[i].layer.code === pLayer.code) {
|
||||
for (let i = 0; i < connectors.length; i++) {
|
||||
let connector = connectors[i]
|
||||
if (connector.layer.code === layer.code) {
|
||||
found = true
|
||||
}
|
||||
}
|
||||
if (found === false) {
|
||||
initializeProductPlotter(pLayer, onProductPlotterInitialized)
|
||||
initializePlotter(layer, onProductPlotterInitialized)
|
||||
function onProductPlotterInitialized (err) {
|
||||
/* There is no policy yet of what to do if this fails. */
|
||||
}
|
||||
}
|
||||
}
|
||||
if (pLayer.status === PRODUCT_CARD_STATUS.OFF) {
|
||||
if (layer.status === PRODUCT_CARD_STATUS.OFF) {
|
||||
/* If the plotter of this card is not on our Active Plotters list, then we remove it. */
|
||||
for (let i = 0; i < productPlotters.length; i++) {
|
||||
if (productPlotters[i].layer.code === pLayer.code) {
|
||||
for (let i = 0; i < connectors.length; i++) {
|
||||
let connector = connectors[i]
|
||||
if (connector.layer.code === layer.code) {
|
||||
/* Then the panels. */
|
||||
for (let j = 0; j < productPlotters[i].panels.length; j++) {
|
||||
canvas.panelsSpace.destroyPanel(productPlotters[i].panels[j])
|
||||
for (let j = 0; j < connector.panels.length; j++) {
|
||||
canvas.panelsSpace.destroyPanel(connector.panels[j])
|
||||
}
|
||||
/* Finally the Storage Objects */
|
||||
|
||||
if (productPlotters[i].plotter.finalize !== undefined) {
|
||||
productPlotters[i].plotter.container.finalize()
|
||||
productPlotters[i].plotter.finalize()
|
||||
if (connector.plotter.finalize !== undefined) {
|
||||
connector.plotter.container.eventHandler.stopListening(connector.plotter.onRecordChangeEventsSubscriptionId)
|
||||
connector.plotter.container.finalize()
|
||||
connector.plotter.finalize()
|
||||
}
|
||||
productPlotters[i].storage.finalize()
|
||||
productPlotters.splice(i, 1) // Delete item from array.
|
||||
finalizeStorage(connector.storage)
|
||||
connectors.splice(i, 1) // Delete item from array.
|
||||
return // We already found the product woth changes and processed it.
|
||||
}
|
||||
}
|
||||
@@ -266,29 +287,29 @@ function newPlottersManager () {
|
||||
|
||||
function setTimeFrame (pTimeFrame) {
|
||||
timeFrame = pTimeFrame
|
||||
for (let i = 0; i < productPlotters.length; i++) {
|
||||
let productPlotter = productPlotters[i]
|
||||
productPlotter.layer.setTimeFrame(timeFrame)
|
||||
productPlotter.storage.setTimeFrame(timeFrame)
|
||||
productPlotter.plotter.setTimeFrame(timeFrame)
|
||||
for (let i = 0; i < connectors.length; i++) {
|
||||
let connector = connectors[i]
|
||||
connector.layer.setTimeFrame(timeFrame)
|
||||
connector.storage.setTimeFrame(timeFrame)
|
||||
connector.plotter.setTimeFrame(timeFrame)
|
||||
}
|
||||
}
|
||||
|
||||
function setDatetime (pDatetime) {
|
||||
datetime = pDatetime
|
||||
for (let i = 0; i < productPlotters.length; i++) {
|
||||
let productPlotter = productPlotters[i]
|
||||
productPlotter.layer.setDatetime(pDatetime)
|
||||
productPlotter.storage.setDatetime(pDatetime)
|
||||
productPlotter.plotter.setDatetime(pDatetime)
|
||||
for (let i = 0; i < connectors.length; i++) {
|
||||
let connector = connectors[i]
|
||||
connector.layer.setDatetime(pDatetime)
|
||||
connector.storage.setDatetime(pDatetime)
|
||||
connector.plotter.setDatetime(pDatetime)
|
||||
}
|
||||
}
|
||||
|
||||
function positionAtDatetime (pDatetime) {
|
||||
for (let i = 0; i < productPlotters.length; i++) {
|
||||
let productPlotter = productPlotters[i]
|
||||
if (productPlotter.plotter.positionAtDatetime !== undefined) {
|
||||
productPlotter.plotter.positionAtDatetime(pDatetime)
|
||||
for (let i = 0; i < connectors.length; i++) {
|
||||
let connector = connectors[i]
|
||||
if (connector.plotter.positionAtDatetime !== undefined) {
|
||||
connector.plotter.positionAtDatetime(pDatetime)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -297,11 +318,11 @@ function newPlottersManager () {
|
||||
}
|
||||
|
||||
function draw () {
|
||||
if (productPlotters === undefined) { return } // We need to wait
|
||||
if (connectors === undefined) { return } // We need to wait
|
||||
/* First the Product Plotters. */
|
||||
for (let i = 0; i < productPlotters.length; i++) {
|
||||
let productPlotter = productPlotters[i]
|
||||
productPlotter.plotter.draw()
|
||||
for (let i = 0; i < connectors.length; i++) {
|
||||
let connector = connectors[i]
|
||||
connector.plotter.draw()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -33,9 +33,6 @@ function newTimelineChart () {
|
||||
|
||||
let layersPanel
|
||||
|
||||
let exchange = DEFAULT_EXCHANGE
|
||||
let market = DEFAULT_MARKET
|
||||
|
||||
let layersPanelHandle
|
||||
|
||||
let onOffsetChangedEventSuscriptionId
|
||||
@@ -143,11 +140,10 @@ function newTimelineChart () {
|
||||
}
|
||||
|
||||
function initializeLayersManager () {
|
||||
let panelOwner = exchange + ' ' + market.quotedAsset + '/' + market.baseAsset
|
||||
layersPanelHandle = canvas.panelsSpace.createNewPanel('Layers Panel', undefined, panelOwner)
|
||||
thisObject.layersManager = canvas.panelsSpace.getPanel(layersPanelHandle, panelOwner)
|
||||
thisObject.layersManager.initialize(exchange, market)
|
||||
layersPanelHandle = canvas.panelsSpace.createNewPanel('Layers Panel', undefined, thisObject.payload.node.id)
|
||||
thisObject.layersManager = canvas.panelsSpace.getPanel(layersPanelHandle, thisObject.payload.node.id)
|
||||
thisObject.layersManager.payload = thisObject.payload.node.layersManager.payload
|
||||
thisObject.layersManager.initialize()
|
||||
|
||||
/* Initialize the Plotter Manager */
|
||||
thisObject.plotterManager = newPlottersManager()
|
||||
@@ -381,7 +377,7 @@ function newTimelineChart () {
|
||||
function drawBackground () {
|
||||
if (thisObject.container.frame.isInViewPort()) {
|
||||
if (window.CHART_ON_FOCUS === '') {
|
||||
window.CHART_ON_FOCUS = exchange + ' ' + market.quotedAsset + '/' + market.baseAsset
|
||||
window.CHART_ON_FOCUS = thisObject.payload.node.id
|
||||
}
|
||||
drawChartsBackground()
|
||||
if (thisObject.plotterManager !== undefined) {
|
||||
|
||||
@@ -101,7 +101,7 @@ function newUiObjectTitle () {
|
||||
}
|
||||
}
|
||||
thisObject.payload.title = nodeToUse.payload.title
|
||||
thisObject.payload.name = thisObject.payload.node.name
|
||||
thisObject.payload.node.name = nodeToUse.payload.node.name
|
||||
title = trimTitle(thisObject.payload.title)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
|
||||
/* User Interface Colors */
|
||||
|
||||
const STORAGE_PROVIDER = 'AAWeb';
|
||||
const CANVAS_APP_NAME = 'Canvas App'
|
||||
|
||||
const SUPPORTED_EXCHANGES = ["Poloniex"];
|
||||
|
||||
+176
-88
@@ -7,12 +7,9 @@ function newLayer () {
|
||||
let thisObject = {
|
||||
container: undefined,
|
||||
status: PRODUCT_CARD_STATUS.OFF,
|
||||
dataMine: undefined,
|
||||
bot: undefined,
|
||||
product: undefined,
|
||||
code: undefined,
|
||||
fitFunction: undefined,
|
||||
payload: undefined,
|
||||
definition: undefined,
|
||||
draw: draw,
|
||||
turnOff: turnOff,
|
||||
turnOn: turnOn,
|
||||
@@ -74,6 +71,7 @@ function newLayer () {
|
||||
|
||||
thisObject.eventHandler = newEventHandler()
|
||||
let imagesLoaded = 0
|
||||
let onMouseClickEventSuscriptionId
|
||||
|
||||
return thisObject
|
||||
|
||||
@@ -83,12 +81,9 @@ function newLayer () {
|
||||
thisObject.container = undefined
|
||||
thisObject.eventHandler = undefined
|
||||
thisObject.status = undefined
|
||||
thisObject.dataMine = undefined
|
||||
thisObject.bot = undefined
|
||||
thisObject.product = undefined
|
||||
thisObject.code = undefined
|
||||
thisObject.fitFunction = undefined
|
||||
thisObject.payload = undefined
|
||||
thisObject.definition = undefined
|
||||
|
||||
timeFrame = undefined
|
||||
datetime = undefined
|
||||
@@ -105,32 +100,21 @@ function newLayer () {
|
||||
dailyFileProgressBar = undefined
|
||||
singleFileProgressBar = undefined
|
||||
fileSequenceProgressBar = undefined
|
||||
|
||||
thisObject.container.eventHandler.stopListening(onMouseClickEventSuscriptionId)
|
||||
}
|
||||
|
||||
function initialize () {
|
||||
/* Create this objects continer */
|
||||
try {
|
||||
thisObject.container = newContainer()
|
||||
thisObject.container.initialize(MODULE_NAME + thisObject.code)
|
||||
thisObject.container.initialize(MODULE_NAME + ' ' + thisObject.payload.node.id)
|
||||
thisObject.container.isDraggeable = false
|
||||
thisObject.container.isClickeable = true
|
||||
|
||||
/* Add information that will later be needed. */
|
||||
|
||||
let dataMine = ecosystem.getDataMine(thisObject.product.plotter.dataMine)
|
||||
let plotter
|
||||
if (dataMine !== undefined) {
|
||||
plotter = ecosystem.getPlotter(dataMine, thisObject.product.plotter.codeName)
|
||||
}
|
||||
|
||||
if (plotter !== undefined) {
|
||||
let plotterModule = ecosystem.getPlotterModule(plotter, thisObject.product.plotter.moduleName)
|
||||
thisObject.product.plotter.module = plotterModule
|
||||
}
|
||||
|
||||
/* Lets set the basic dimensions of this thisObject. */
|
||||
|
||||
var position = {
|
||||
let position = {
|
||||
x: 0,
|
||||
y: 0
|
||||
}
|
||||
@@ -139,9 +123,44 @@ function newLayer () {
|
||||
thisObject.container.frame.width = UI_PANEL.WIDTH.LARGE
|
||||
thisObject.container.frame.height = 100
|
||||
|
||||
/* We retrieve the locally stored status of the Product */
|
||||
let functionLibraryProtocolNode = newProtocolNode()
|
||||
let lightingPath =
|
||||
'->Layer->' +
|
||||
'Data Product->Single Market Data->Market->' +
|
||||
'Market Base Asset->Asset->' +
|
||||
'Market Quoted Asset->Asset->' +
|
||||
'Exchange Markets->Crypto Exchange->' +
|
||||
'Product Definition->' +
|
||||
'Sensor Bot->Indicator Bot->Trading Bot->' +
|
||||
'Data Mine->' +
|
||||
'Dataset Definition->' +
|
||||
'Record Definition->Record Property->Formula->' +
|
||||
'Data Building Procedure->Procedure Loop->Javascript Code->Procedure Initialization->Javascript Code->' +
|
||||
'Calculations Procedure->Procedure Loop->Javascript Code->Procedure Initialization->Javascript Code->' +
|
||||
'Plotter Module->Shapes->' +
|
||||
'Chart Points->Point->Point Formula->' +
|
||||
'Polygon->Polygon Body->Style->Style Condition->Style->' +
|
||||
'Polygon Border->Style->Style Condition->Style->' +
|
||||
'Polygon Vertex->Point->' +
|
||||
'Plotter Panel->Javascript Code->Panel Data->Data Formula->'
|
||||
thisObject.definition = functionLibraryProtocolNode.getProtocolNode(thisObject.payload.node, false, true, true, false, false, lightingPath)
|
||||
|
||||
let storedValue = window.localStorage.getItem(thisObject.code)
|
||||
/* Here we validate that we have all the needed information */
|
||||
if (thisObject.definition.referenceParent === undefined) { return }
|
||||
if (thisObject.definition.referenceParent.parentNode === undefined) { return }
|
||||
if (thisObject.definition.referenceParent.parentNode.referenceParent === undefined) { return }
|
||||
if (thisObject.definition.referenceParent.parentNode.referenceParent.referenceParent === undefined) { return }
|
||||
if (thisObject.definition.referenceParent.parentNode.referenceParent.referenceParent.referenceParent === undefined) { return }
|
||||
if (thisObject.definition.referenceParent.parentNode.referenceParent.baseAsset === undefined) { return }
|
||||
if (thisObject.definition.referenceParent.parentNode.referenceParent.baseAsset.referenceParent === undefined) { return }
|
||||
if (thisObject.definition.referenceParent.parentNode.referenceParent.quotedAsset === undefined) { return }
|
||||
if (thisObject.definition.referenceParent.parentNode.referenceParent.quotedAsset.referenceParent === undefined) { return }
|
||||
if (thisObject.definition.referenceParent.referenceParent === undefined) { return }
|
||||
if (thisObject.definition.referenceParent.referenceParent.parentNode === undefined) { return }
|
||||
if (thisObject.definition.referenceParent.referenceParent.parentNode.parentNode === undefined) { return }
|
||||
|
||||
/* We retrieve the locally stored status of the Product */
|
||||
let storedValue = window.localStorage.getItem(thisObject.payload.node.id)
|
||||
|
||||
if (storedValue !== null) {
|
||||
thisObject.status = storedValue
|
||||
@@ -150,56 +169,27 @@ function newLayer () {
|
||||
changeStatusTo(PRODUCT_CARD_STATUS.LOADING)
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
|
||||
This happens the first time the app is run on a new browser.
|
||||
|
||||
We will start with all product off, except for the candles chart, since something needs to be shown and allow the user to position themselves
|
||||
on the timeline.
|
||||
|
||||
For the time being, we will hard-code the name of the bot we will turn on by default, since we dont see that change in the near future.
|
||||
|
||||
*/
|
||||
|
||||
const DEFAULT_ON_PRODUCT = 'Poloniex-BTC/USDT-AAMasters-AAOlivia-Candles'
|
||||
|
||||
if (thisObject.code === DEFAULT_ON_PRODUCT) {
|
||||
changeStatusTo(PRODUCT_CARD_STATUS.LOADING)
|
||||
} else {
|
||||
changeStatusTo(PRODUCT_CARD_STATUS.OFF)
|
||||
}
|
||||
changeStatusTo(PRODUCT_CARD_STATUS.OFF)
|
||||
}
|
||||
|
||||
/* Lets listen to our own events to react when we have a Mouse Click */
|
||||
|
||||
thisObject.container.eventHandler.listenToEvent('onMouseClick', onMouseClick)
|
||||
onMouseClickEventSuscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseClick', onMouseClick)
|
||||
} catch (err) {
|
||||
if (ERROR_LOG === true) { logger.write('[ERROR] initialize -> err = ' + err.stack) }
|
||||
}
|
||||
}
|
||||
|
||||
function getContainer (point) {
|
||||
var container
|
||||
|
||||
/* First we check if this point is inside this space. */
|
||||
|
||||
if (thisObject.container.frame.isThisPointHere(point, true) === true) {
|
||||
return thisObject.container
|
||||
} else {
|
||||
/* This point does not belong to this space. */
|
||||
|
||||
return undefined
|
||||
}
|
||||
}
|
||||
|
||||
function setDatetime (pDatetime) {
|
||||
/*
|
||||
|
||||
When the datetime changes from one day to another, this forces cursors to potentially load more files, thus we reset this counter and
|
||||
get ready to receive events on files loaded.
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
When the datetime changes from one day to another, this forces cursors to potentially load more files, thus we reset this counter and
|
||||
get ready to receive events on files loaded.
|
||||
*/
|
||||
let currentDate = Math.trunc(datetime.valueOf() / ONE_DAY_IN_MILISECONDS)
|
||||
let newDate = Math.trunc(pDatetime.valueOf() / ONE_DAY_IN_MILISECONDS)
|
||||
|
||||
@@ -213,13 +203,10 @@ function newLayer () {
|
||||
}
|
||||
|
||||
function setTimeFrame (pTimeFrame) {
|
||||
/*
|
||||
|
||||
When the time period below or equal to 1 hour changes, this forces cursors to potentially load more files, thus we reset this counter and
|
||||
get ready to receive events on files loaded.
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
When the time period below or equal to 1 hour changes, this forces cursors to potentially load more files, thus we reset this counter and
|
||||
get ready to receive events on files loaded.
|
||||
*/
|
||||
if (timeFrame !== pTimeFrame) {
|
||||
timeFrame = pTimeFrame
|
||||
|
||||
@@ -337,27 +324,7 @@ function newLayer () {
|
||||
break
|
||||
}
|
||||
|
||||
let label = thisObject.product.displayName
|
||||
|
||||
if (thisObject.session !== undefined) {
|
||||
const MAX_LABEL_LENGTH = 20
|
||||
if (thisObject.session.name.length > MAX_LABEL_LENGTH) {
|
||||
label = thisObject.session.name.substring(0, MAX_LABEL_LENGTH) + '...' + ' - ' + label
|
||||
} else {
|
||||
label = thisObject.session.name + ' - ' + label
|
||||
}
|
||||
}
|
||||
|
||||
let label1 = label
|
||||
let label2 = 'ON'
|
||||
let label3 = ''
|
||||
|
||||
let icon1 = canvas.designerSpace.iconCollection.get('oscillator')
|
||||
let icon2 = canvas.designerSpace.iconCollection.get('poloniex') // canvas.designerSpace.iconByUiObjectType.get(thisObject.payload.node.type)
|
||||
|
||||
let backgroundColor = UI_COLOR.BLACK
|
||||
|
||||
drawScaleDisplay(label1, label2, label3, 0, 0, 0, icon1, icon2, thisObject.container, backgroundColor)
|
||||
drawLayerDisplay()
|
||||
|
||||
/* ------------------- Progress Bars -------------------------- */
|
||||
|
||||
@@ -569,4 +536,125 @@ function newLayer () {
|
||||
browserCanvasContext.setLineDash([2, 5])
|
||||
browserCanvasContext.lineWidth = 10
|
||||
}
|
||||
|
||||
function drawLayerDisplay () {
|
||||
const MAX_LABEL_LENGTH = 20
|
||||
let label = thisObject.payload.node.name
|
||||
if (label > MAX_LABEL_LENGTH) {
|
||||
label = label.substring(0, MAX_LABEL_LENGTH)
|
||||
}
|
||||
|
||||
let label1 = label
|
||||
let label2 = thisObject.status
|
||||
let label3 = ''
|
||||
|
||||
let icon1 = canvas.designerSpace.iconCollection.get('oscillator')
|
||||
let icon2 = canvas.designerSpace.iconCollection.get('poloniex') // canvas.designerSpace.iconByUiObjectType.get(thisObject.payload.node.type)
|
||||
|
||||
let backgroundColor = UI_COLOR.BLACK
|
||||
|
||||
let fontSize1 = 10
|
||||
let fontSize2 = 20
|
||||
let fontSize3 = 10
|
||||
|
||||
const RED_LINE_HIGHT = 4
|
||||
const OPACITY = 1
|
||||
|
||||
let params = {
|
||||
cornerRadius: 15,
|
||||
lineWidth: 2,
|
||||
container: thisObject.container,
|
||||
borderColor: UI_COLOR.RUSTED_RED,
|
||||
castShadow: false,
|
||||
backgroundColor: backgroundColor,
|
||||
opacity: OPACITY
|
||||
}
|
||||
|
||||
roundedCornersBackground(params)
|
||||
|
||||
/* Place the Text */
|
||||
|
||||
label1 = label1.substring(0, 18)
|
||||
let xOffset1 = label1.length * fontSize1 * FONT_ASPECT_RATIO
|
||||
|
||||
let labelPoint1 = {
|
||||
x: thisObject.container.frame.width * 1 / 2 - xOffset1 / 2 - 5,
|
||||
y: thisObject.container.frame.height * 4 / 5
|
||||
}
|
||||
|
||||
labelPoint1 = thisObject.container.frame.frameThisPoint(labelPoint1)
|
||||
let x = labelPoint1.x
|
||||
labelPoint1.x = x
|
||||
|
||||
browserCanvasContext.font = fontSize1 + 'px ' + UI_FONT.PRIMARY
|
||||
browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', 1)'
|
||||
|
||||
browserCanvasContext.fillText(label1, labelPoint1.x, labelPoint1.y)
|
||||
|
||||
label2 = label2.substring(0, 20)
|
||||
let xOffset2 = label2.length * fontSize2 * FONT_ASPECT_RATIO
|
||||
|
||||
let labelPoint2 = {
|
||||
x: thisObject.container.frame.width * 1 / 2 - xOffset2 / 2,
|
||||
y: thisObject.container.frame.height * 2 / 5
|
||||
}
|
||||
|
||||
labelPoint2 = thisObject.container.frame.frameThisPoint(labelPoint2)
|
||||
|
||||
browserCanvasContext.font = fontSize2 + 'px ' + UI_FONT.PRIMARY
|
||||
browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', 1)'
|
||||
|
||||
browserCanvasContext.fillText(label2, labelPoint2.x, labelPoint2.y)
|
||||
|
||||
label3 = label3.substring(0, 20)
|
||||
let xOffset3 = label3.length * fontSize3 * FONT_ASPECT_RATIO
|
||||
|
||||
let labelPoint3 = {
|
||||
x: thisObject.container.frame.width * 1 / 2 - xOffset3 / 2,
|
||||
y: thisObject.container.frame.height * 3 / 5
|
||||
}
|
||||
|
||||
labelPoint3 = thisObject.container.frame.frameThisPoint(labelPoint3)
|
||||
|
||||
browserCanvasContext.font = fontSize3 + 'px ' + UI_FONT.PRIMARY
|
||||
browserCanvasContext.fillStyle = 'rgba(' + UI_COLOR.WHITE + ', 1)'
|
||||
|
||||
browserCanvasContext.fillText(label3, labelPoint3.x, labelPoint3.y)
|
||||
|
||||
/* Images */
|
||||
|
||||
if (icon1 !== undefined) {
|
||||
if (icon1.canDrawIcon === true) {
|
||||
let imageSize = 40
|
||||
let imagePosition = {
|
||||
x: thisObject.container.frame.width * 1 / 8 - imageSize / 2,
|
||||
y: thisObject.container.frame.height / 2 - imageSize / 2
|
||||
}
|
||||
|
||||
imagePosition = thisObject.container.frame.frameThisPoint(imagePosition)
|
||||
browserCanvasContext.drawImage(
|
||||
icon1, imagePosition.x,
|
||||
imagePosition.y,
|
||||
imageSize,
|
||||
imageSize)
|
||||
}
|
||||
}
|
||||
|
||||
if (icon2 !== undefined) {
|
||||
if (icon2.canDrawIcon === true) {
|
||||
let imageSize = 40
|
||||
let imagePosition = {
|
||||
x: thisObject.container.frame.width * 7 / 8 - imageSize / 2,
|
||||
y: thisObject.container.frame.height / 2 - imageSize / 2
|
||||
}
|
||||
|
||||
imagePosition = thisObject.container.frame.frameThisPoint(imagePosition)
|
||||
browserCanvasContext.drawImage(
|
||||
icon2, imagePosition.x,
|
||||
imagePosition.y,
|
||||
imageSize,
|
||||
imageSize)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+6
-12
@@ -27,9 +27,6 @@ function newProductsPanel () {
|
||||
const LAYER_SEPARATION = 5
|
||||
let panelTabButton
|
||||
|
||||
let exchange
|
||||
let market
|
||||
|
||||
let onMouseWheelEventSuscriptionId
|
||||
return thisObject
|
||||
|
||||
@@ -47,11 +44,8 @@ function newProductsPanel () {
|
||||
thisObject = undefined
|
||||
}
|
||||
|
||||
function initialize (pExchange, pMarket) {
|
||||
exchange = pExchange
|
||||
market = pMarket
|
||||
|
||||
thisObject.container.name = 'Layers @ ' + exchange + ' ' + market.quotedAsset + '/' + market.baseAsset
|
||||
function initialize () {
|
||||
thisObject.container.name = thisObject.payload.node.name
|
||||
thisObject.container.frame.containerName = thisObject.container.name
|
||||
thisObject.container.frame.width = UI_PANEL.WIDTH.LARGE
|
||||
thisObject.container.frame.height = UI_PANEL.HEIGHT.LARGE * 1.5 // viewPort.visibleArea.bottomLeft.y - viewPort.visibleArea.topLeft.y // UI_PANEL.HEIGHT.LARGE;
|
||||
@@ -249,7 +243,7 @@ function newProductsPanel () {
|
||||
|
||||
let found = removeFromLocalLayers(layerNode.id)
|
||||
if (found !== true) {
|
||||
layer = addLayer(layerNode.id)
|
||||
layer = addLayer(layerNode)
|
||||
onLayerStatusChanged(layer)
|
||||
}
|
||||
}
|
||||
@@ -270,10 +264,10 @@ function newProductsPanel () {
|
||||
}
|
||||
}
|
||||
|
||||
function removeFromLocalLayers (code) {
|
||||
function removeFromLocalLayers (id) {
|
||||
for (let i = 0; i < localLayers.length; i++) {
|
||||
let layer = localLayers[i]
|
||||
if (layer.code === code) {
|
||||
if (layer.payload.node.id === id) {
|
||||
thisObject.layers.push(layer)
|
||||
localLayers.splice(i, 1)
|
||||
return true
|
||||
@@ -284,7 +278,7 @@ function newProductsPanel () {
|
||||
function turnOffUnusedLayers () {
|
||||
for (let i = 0; i < localLayers.length; i++) {
|
||||
let layer = localLayers[i]
|
||||
removeLayer(layer.code)
|
||||
removeLayer(layer.payload.node.id)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -96,7 +96,7 @@ function newPlotter () {
|
||||
}
|
||||
}
|
||||
|
||||
function initialize (pStorage, pExchange, pMarket, pDatetime, pTimeFrame, callBackFunction, pProductDefinition) {
|
||||
function initialize (pStorage, pDatetime, pTimeFrame, callBackFunction, pProductDefinition) {
|
||||
try {
|
||||
/* Store the information received. */
|
||||
marketFiles = pStorage.marketFiles[0]
|
||||
|
||||
+11
-11
@@ -1,5 +1,5 @@
|
||||
|
||||
function newProductStorage (pName) {
|
||||
function newProductStorage (name) {
|
||||
const MODULE_NAME = 'Product Storage'
|
||||
const ERROR_LOG = true
|
||||
const logger = newWebDebugLog()
|
||||
@@ -40,7 +40,7 @@ function newProductStorage (pName) {
|
||||
|
||||
/* We name the event Handler to easy debugging. */
|
||||
|
||||
thisObject.eventHandler.name = 'Storage-' + pName
|
||||
thisObject.eventHandler.name = 'Storage-' + name
|
||||
|
||||
let datetime
|
||||
let timeFrame
|
||||
@@ -74,7 +74,7 @@ function newProductStorage (pName) {
|
||||
}
|
||||
}
|
||||
|
||||
function initialize (pdataMine, pBot, pSession, pProduct, pExchange, pMarket, pDatetime, pTimeFrame, callBackFunction) {
|
||||
function initialize (dataMine, bot, session, product, exchange, market, pDatetime, pTimeFrame, callBackFunction) {
|
||||
try {
|
||||
datetime = pDatetime
|
||||
timeFrame = pTimeFrame
|
||||
@@ -82,15 +82,15 @@ function newProductStorage (pName) {
|
||||
let dataSetsToLoad = 0
|
||||
let dataSetsLoaded = 0
|
||||
|
||||
for (let i = 0; i < pProduct.dataSets.length; i++) {
|
||||
let thisSet = pProduct.dataSets[i]
|
||||
for (let i = 0; i < product.datasets.length; i++) {
|
||||
let dataset = product.datasets[i]
|
||||
|
||||
switch (thisSet.type) {
|
||||
switch (dataset.type) {
|
||||
case 'Market Files': {
|
||||
dataSetsToLoad++
|
||||
|
||||
let marketFiles = newMarketFiles()
|
||||
marketFiles.initialize(pdataMine, pBot, pSession, pProduct, thisSet, pExchange, pMarket, onMarketFileReady)
|
||||
marketFiles.initialize(dataMine, bot, session, product, dataset, exchange, market, onMarketFileReady)
|
||||
thisObject.marketFiles.push(marketFiles)
|
||||
}
|
||||
break
|
||||
@@ -99,7 +99,7 @@ function newProductStorage (pName) {
|
||||
dataSetsToLoad++
|
||||
|
||||
let dailyFiles = newDailyFiles()
|
||||
dailyFiles.initialize(pdataMine, pBot, pSession, pProduct, thisSet, pExchange, pMarket, pDatetime, pTimeFrame, onDailyFileReady)
|
||||
dailyFiles.initialize(dataMine, bot, session, product, dataset, exchange, market, pDatetime, pTimeFrame, onDailyFileReady)
|
||||
thisObject.dailyFiles.push(dailyFiles)
|
||||
}
|
||||
break
|
||||
@@ -108,7 +108,7 @@ function newProductStorage (pName) {
|
||||
dataSetsToLoad++
|
||||
|
||||
let singleFile = newSingleFile()
|
||||
singleFile.initialize(pdataMine, pBot, pSession, pProduct, thisSet, pExchange, pMarket, onSingleFileReady)
|
||||
singleFile.initialize(dataMine, bot, session, product, dataset, exchange, market, onSingleFileReady)
|
||||
thisObject.singleFile.push(singleFile)
|
||||
}
|
||||
break
|
||||
@@ -117,12 +117,12 @@ function newProductStorage (pName) {
|
||||
dataSetsToLoad++
|
||||
|
||||
let fileSequences = newFileSequence()
|
||||
fileSequences.initialize(pdataMine, pBot, pSession, pProduct, thisSet, pExchange, pMarket, onFileSequenceReady)
|
||||
fileSequences.initialize(dataMine, bot, session, product, dataset, exchange, market, onFileSequenceReady)
|
||||
thisObject.fileSequences.push(fileSequences)
|
||||
}
|
||||
break
|
||||
default:
|
||||
if (ERROR_LOG === true) { logger.write('[WARN] initialize -> initialize -> dataset with no type defined. Data can not be retrieved. -> codeName = ' + thisSet.codeName) }
|
||||
if (ERROR_LOG === true) { logger.write('[WARN] initialize -> initialize -> dataset with no type defined. Data can not be retrieved. -> codeName = ' + dataset.codeName) }
|
||||
}
|
||||
|
||||
function onMarketFileReady (err, pCaller) {
|
||||
|
||||
Reference in new issue
Block a user