refactoring producsPanels for layersPanel
This commit is contained in:
1 parent
9719b6df33
commit
3c76d4f654
5 files changed
+15
-14
No files matched your search
@@ -23,7 +23,7 @@ function newPlottersManager () {
|
||||
|
||||
let initializationReady = false
|
||||
|
||||
let productsPanel
|
||||
let layersPanel
|
||||
let exchange
|
||||
let market
|
||||
|
||||
@@ -58,7 +58,7 @@ function newPlottersManager () {
|
||||
}
|
||||
productPlotters = []
|
||||
|
||||
productsPanel = undefined
|
||||
layersPanel = undefined
|
||||
|
||||
thisObject.container.finalize()
|
||||
thisObject.container = undefined
|
||||
@@ -67,16 +67,16 @@ function newPlottersManager () {
|
||||
|
||||
function initialize (pProductsPanel, pExchange, pMarket) {
|
||||
try {
|
||||
/* Remember the Products Panel */
|
||||
productsPanel = pProductsPanel
|
||||
/* Remember the Layers Panel */
|
||||
layersPanel = pProductsPanel
|
||||
exchange = pExchange
|
||||
market = pMarket
|
||||
/* Listen to the event of change of status */
|
||||
productsPanel.container.eventHandler.listenToEvent('Product Card Status Changed', onProductCardStatusChanged)
|
||||
layersPanel.container.eventHandler.listenToEvent('Product Card Status Changed', onProductCardStatusChanged)
|
||||
|
||||
/* Lets get all the cards that needs to be loaded. */
|
||||
|
||||
let loadingProductCards = productsPanel.getLoadingProductCards()
|
||||
let loadingProductCards = layersPanel.getLoadingProductCards()
|
||||
|
||||
for (let i = 0; i < loadingProductCards.length; i++) {
|
||||
/* For each one, we will initialize the associated plotter. */
|
||||
|
||||
@@ -15,6 +15,7 @@ function newTimelineChart () {
|
||||
rateScale: undefined,
|
||||
timeFrameScale: undefined,
|
||||
payload: undefined,
|
||||
layersManager: undefined,
|
||||
plotterManager: undefined,
|
||||
upstreamTimeFrame: undefined,
|
||||
setTimeFrame: setTimeFrame,
|
||||
@@ -30,12 +31,12 @@ function newTimelineChart () {
|
||||
let timeMachineCoordinateSystem
|
||||
let timelineChartCoordinateSystem = newCoordinateSystem()
|
||||
|
||||
let productsPanel
|
||||
let layersPanel
|
||||
|
||||
let exchange = DEFAULT_EXCHANGE
|
||||
let market = DEFAULT_MARKET
|
||||
|
||||
let productsPanelHandle
|
||||
let layersPanelHandle
|
||||
|
||||
let onOffsetChangedEventSuscriptionId
|
||||
let onZoomChangedEventSuscriptionId
|
||||
@@ -93,7 +94,7 @@ function newTimelineChart () {
|
||||
thisObject.plotterManager = undefined
|
||||
thisObject.layersManager = undefined
|
||||
|
||||
canvas.panelsSpace.destroyPanel(productsPanelHandle)
|
||||
canvas.panelsSpace.destroyPanel(layersPanelHandle)
|
||||
}
|
||||
|
||||
function finalizeTimeFrameScale () {
|
||||
@@ -142,8 +143,8 @@ function newTimelineChart () {
|
||||
|
||||
function initializeLayersManager () {
|
||||
let panelOwner = exchange + ' ' + market.quotedAsset + '/' + market.baseAsset
|
||||
productsPanelHandle = canvas.panelsSpace.createNewPanel('Products Panel', undefined, panelOwner)
|
||||
thisObject.layersManager = canvas.panelsSpace.getPanel(productsPanelHandle, panelOwner)
|
||||
layersPanelHandle = canvas.panelsSpace.createNewPanel('Layers Panel', undefined, panelOwner)
|
||||
thisObject.layersManager = canvas.panelsSpace.getPanel(layersPanelHandle, panelOwner)
|
||||
thisObject.layersManager.initialize(exchange, market)
|
||||
thisObject.layersManager.payload = thisObject.payload.node.layersManager.payload
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
function newProductsPanel () {
|
||||
let thisObject = {
|
||||
name: 'Products Panel',
|
||||
name: 'Layers Panel',
|
||||
fitFunction: undefined,
|
||||
container: undefined,
|
||||
productCards: [],
|
||||
+1
-1
@@ -156,7 +156,7 @@
|
||||
<Compile Include="EventHandler.js" />
|
||||
<Compile Include="Spaces\FloatingSpace.js" />
|
||||
<Compile Include="Frame.js" />
|
||||
<Compile Include="Panels\ProductsPanel.js" />
|
||||
<Compile Include="Panels\LayersPanel.js" />
|
||||
<Compile Include="Panels\TimeControlPanel.js" />
|
||||
<Compile Include="TimeLineCoordinateSystem.js" />
|
||||
<Compile Include="SplashScreen.js">
|
||||
|
||||
@@ -39,7 +39,7 @@ function newPanelsSpace () {
|
||||
|
||||
switch (pType) {
|
||||
|
||||
case 'Products Panel':
|
||||
case 'Layers Panel':
|
||||
{
|
||||
panel = newProductsPanel()
|
||||
panel.fitFunction = canvas.chartSpace.fitFunction
|
||||
|
||||
Reference in new issue
Block a user