From bf07bcc14ecf2405d625639b9fdf2f73e89c9b02 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Fri, 17 Jan 2020 08:52:20 +0100 Subject: [PATCH] Standarizing Names --- BollingerBands.js | 6 +++--- BollingerBandsPanel.js | 25 +++++++++++++++++-------- this.plotter.config.json | 2 +- 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/BollingerBands.js b/BollingerBands.js index ecfb36361..f5a8c14c6 100644 --- a/BollingerBands.js +++ b/BollingerBands.js @@ -336,7 +336,7 @@ if (datetime.valueOf() >= band.begin && datetime.valueOf() <= band.end) { thisObject.currentBand = band; - thisObject.container.eventHandler.raiseEvent("Current Band Changed", thisObject.currentBand); + thisObject.container.eventHandler.raiseEvent("Current Record Changed", thisObject.currentBand); } } @@ -411,7 +411,7 @@ if (datetime.valueOf() >= band.begin && datetime.valueOf() <= band.end) { thisObject.currentBand = band; - thisObject.container.eventHandler.raiseEvent("Current Band Changed", thisObject.currentBand); + thisObject.container.eventHandler.raiseEvent("Current Record Changed", thisObject.currentBand); } } @@ -597,7 +597,7 @@ innerBand: band }; - thisObject.container.eventHandler.raiseEvent("Current Band Changed", currentBand); + thisObject.container.eventHandler.raiseEvent("Current Record Changed", currentBand); } browserCanvasContext.lineWidth = 0.2; diff --git a/BollingerBandsPanel.js b/BollingerBandsPanel.js index 7ca186ff5..a0eaf8ca7 100644 --- a/BollingerBandsPanel.js +++ b/BollingerBandsPanel.js @@ -3,24 +3,33 @@ function newAAMastersPlottersBollingerBandsBollingerBandsBollingerBandsPanel () var thisObject = { fitFunction: undefined, - onEventRaised: onEventRaised, + onRecordChange: onRecordChange, container: undefined, draw: draw, getContainer: getContainer, - initialize: initialize + initialize: initialize, + finalize: finalize }; - var container = newContainer(); - container.initialize(); - thisObject.container = container; - - container.frame.containerName = "Bollinger Band"; + thisObject.container = newContainer(); + thisObject.container.initialize(); + thisObject.container.frame.containerName = "Bollinger Band"; let currentBand; let panelTabButton return thisObject; + function finalize() { + thisObject.container.finalize() + thisObject.container = undefined + thisObject.fitFunction = undefined + + currentBand = undefined + panelTabButton.finalize() + panelTabButton = undefined + } + function initialize() { thisObject.container.frame.width = UI_PANEL.WIDTH.NORMAL; @@ -59,7 +68,7 @@ function newAAMastersPlottersBollingerBandsBollingerBandsBollingerBandsPanel () } - function onEventRaised(lastCurrentBand) { + function onRecordChange(lastCurrentBand) { currentBand = lastCurrentBand; diff --git a/this.plotter.config.json b/this.plotter.config.json index 04b8fe004..19c0016e5 100644 --- a/this.plotter.config.json +++ b/this.plotter.config.json @@ -12,7 +12,7 @@ { "codeName": "BollingerBandsPanel", "moduleName": "BollingerBandsPanel", - "event": "Current Band Changed" + "event": "Current Record Changed" } ] },