From 92d1a971cac0d7011a2519b121eb6c4973ac2fed Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Wed, 29 Jan 2020 10:25:28 +0100 Subject: [PATCH] showPanles functionality implemented --- SimulationExecutionPanel.js | 19 ++++++++++++++++--- TradingSimulationPanel.js | 6 ++++-- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/SimulationExecutionPanel.js b/SimulationExecutionPanel.js index 37f05d7b4..d809b2ef5 100644 --- a/SimulationExecutionPanel.js +++ b/SimulationExecutionPanel.js @@ -5,10 +5,12 @@ function newAAMastersPlottersTradingSimulationSimulationExecutionSimulationExecu let thisObject = { fitFunction: undefined, container: undefined, + isVisible: true, onRecordChange: onRecordChange, draw: draw, getContainer: getContainer, - initialize: initialize + initialize: initialize, + finalize: finalize }; let container = newContainer(); @@ -22,6 +24,17 @@ function newAAMastersPlottersTradingSimulationSimulationExecutionSimulationExecu return thisObject; + function finalize() { + thisObject.container.finalize() + thisObject.container = undefined + thisObject.fitFunction = undefined + thisObject.isVisible = undefined + + currentRecord = undefined + panelTabButton.finalize() + panelTabButton = undefined + } + function initialize() { thisObject.container.frame.width = UI_PANEL.WIDTH.NORMAL; @@ -38,7 +51,7 @@ function newAAMastersPlottersTradingSimulationSimulationExecutionSimulationExecu } function getContainer(point) { - + if (thisObject.isVisible !== true) { return } let container; container = panelTabButton.getContainer(point) @@ -68,7 +81,7 @@ function newAAMastersPlottersTradingSimulationSimulationExecutionSimulationExecu function draw() { - + if (thisObject.isVisible !== true) { return } thisObject.container.frame.draw(false, false, true, thisObject.fitFunction); plot(); diff --git a/TradingSimulationPanel.js b/TradingSimulationPanel.js index e60c48c73..048de40a3 100644 --- a/TradingSimulationPanel.js +++ b/TradingSimulationPanel.js @@ -6,6 +6,7 @@ function newAAMastersPlottersTradingSimulationTradingSimulationTradingSimulation onRecordChange: onRecordChange, container: undefined, session: undefined, + isVisible: true, draw: draw, getContainer: getContainer, initialize: initialize, @@ -48,6 +49,7 @@ function newAAMastersPlottersTradingSimulationTradingSimulationTradingSimulation thisObject.container = undefined thisObject.fitFunction = undefined thisObject.onRecordChange = undefined + thisObject.isVisible = undefined currentRecord = undefined lastRecord = undefined @@ -55,7 +57,7 @@ function newAAMastersPlottersTradingSimulationTradingSimulationTradingSimulation } function getContainer(point) { - + if (thisObject.isVisible !== true) { return } let container; container = panelTabButton.getContainer(point) @@ -86,7 +88,7 @@ function newAAMastersPlottersTradingSimulationTradingSimulationTradingSimulation function draw() { - + if (thisObject.isVisible !== true) { return } thisObject.container.frame.draw(false, false, true, thisObject.fitFunction); plotCurrentRecordInfo();