From 25e1eea4456533bec6c921fe423b53360872d2e0 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Tue, 8 Oct 2019 16:38:45 +0200 Subject: [PATCH] Layers Being Plotted, not in right order though --- ChartsSpace/PlottersManager.js | 2 +- Panels/ProductCard.js | 9 +++++++++ Panels/ProductsPanel.js | 12 ++++++------ 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/ChartsSpace/PlottersManager.js b/ChartsSpace/PlottersManager.js index aef6b2afc..de3d8816b 100644 --- a/ChartsSpace/PlottersManager.js +++ b/ChartsSpace/PlottersManager.js @@ -149,7 +149,7 @@ function newPlottersManager () { } } - storage.initialize(pProductCard.devTeam, pProductCard.bot, undefined, pProductCard.product, exchange, market, datetime, timePeriod, onProductStorageInitialized) + storage.initialize(pProductCard.devTeam, pProductCard.bot, pProductCard.session, pProductCard.product, exchange, market, datetime, timePeriod, onProductStorageInitialized) function onProductStorageInitialized (err) { try { diff --git a/Panels/ProductCard.js b/Panels/ProductCard.js index 1ae7e8a8a..1f31a863a 100644 --- a/Panels/ProductCard.js +++ b/Panels/ProductCard.js @@ -611,6 +611,15 @@ function newProductCard () { /* product */ fontSize = 10 label = thisObject.product.displayName + + if (thisObject.session !== undefined) { + const MAX_LABEL_LENGTH = 30 + if (thisObject.session.name > MAX_LABEL_LENGTH) { + label = thisObject.session.name.substring(0, MAX_LABEL_LENGTH) + '...' + ' - ' + label + } else { + label = thisObject.session.name + ' - ' + label + } + } labelPoint = { x: 65, y: thisObject.container.frame.height / 2 + 15 diff --git a/Panels/ProductsPanel.js b/Panels/ProductsPanel.js index 810322fd2..1bb8708d2 100644 --- a/Panels/ProductsPanel.js +++ b/Panels/ProductsPanel.js @@ -87,7 +87,7 @@ function newProductsPanel () { isInitialized = true } - function addProductCard (devTeam, bot, product, instance) { + function addProductCard (devTeam, bot, product, session) { /* Now we create Product objects */ let productCard = newProductCard() @@ -97,9 +97,10 @@ function newProductsPanel () { productCard.fitFunction = thisObject.fitFunction productCard.code = exchange + '-' + market.assetB + '/' + market.assetA + '-' + devTeam.codeName + '-' + bot.codeName + '-' + product.codeName - if (instance !== undefined) { - productCard.code = productCard.code + '-' + instance + if (session !== undefined) { + productCard.code = productCard.code + '-' + session.id } + productCard.session = session /* Initialize it */ productCard.initialize() @@ -291,11 +292,10 @@ function newProductsPanel () { if (product.codeName === layerCode.product) { /* We have a layer that is matching the current product */ - let instance = process.session.name + '-' + process.session.id - let cardCode = exchange + '-' + market.assetB + '/' + market.assetA + '-' + devTeam.codeName + '-' + bot.codeName + '-' + product.codeName + '-' + instance + let cardCode = exchange + '-' + market.assetB + '/' + market.assetA + '-' + devTeam.codeName + '-' + bot.codeName + '-' + product.codeName + '-' + process.session.id if (cardsMap.get(cardCode) === undefined) { - addProductCard(devTeam, bot, product, instance) + addProductCard(devTeam, bot, product, process.session) } } }