diff --git a/CandlePanel.js b/CandlePanel.js index f7927258d..f4e8529ca 100644 --- a/CandlePanel.js +++ b/CandlePanel.js @@ -4,23 +4,32 @@ function newAAMastersPlottersCandlesVolumesCandlesCandlePanel() { let thisObject = { fitFunction: undefined, container: undefined, - onEventRaised: onEventRaised, + onRecordChange: onRecordChange, draw: draw, getContainer: getContainer, - initialize: initialize + initialize: initialize, + finalize: finalize }; - let container = newContainer(); - container.initialize(); - thisObject.container = container; - - container.frame.containerName = "Candle"; + thisObject.container = newContainer(); + thisObject.container.initialize(); + thisObject.container.frame.containerName = "Candle"; let currentCandle; let panelTabButton return thisObject; + function finalize() { + thisObject.container.finalize() + thisObject.container = undefined + thisObject.fitFunction = undefined + + currentCandle = undefined + panelTabButton.finalize() + panelTabButton = undefined + } + function initialize() { thisObject.container.frame.width = UI_PANEL.WIDTH.NORMAL; @@ -59,7 +68,7 @@ function newAAMastersPlottersCandlesVolumesCandlesCandlePanel() { } - function onEventRaised(lastCurrentCandle) { + function onRecordChange(lastCurrentCandle) { currentCandle = lastCurrentCandle; diff --git a/Candles.js b/Candles.js index bbb05fd6b..6abbb632a 100644 --- a/Candles.js +++ b/Candles.js @@ -439,7 +439,7 @@ if (datetime.valueOf() >= candle.begin && datetime.valueOf() <= candle.end) { thisObject.currentCandle = candle; - thisObject.container.eventHandler.raiseEvent("Current Candle Changed", thisObject.currentCandle); + thisObject.container.eventHandler.raiseEvent("Current Record Changed", thisObject.currentCandle); } } @@ -515,7 +515,7 @@ if (datetime.valueOf() >= candle.begin && datetime.valueOf() <= candle.end) { thisObject.currentCandle = candle; - thisObject.container.eventHandler.raiseEvent("Current Candle Changed", thisObject.currentCandle); + thisObject.container.eventHandler.raiseEvent("Current Record Changed", thisObject.currentCandle); } } @@ -785,7 +785,7 @@ period: timeFrame, innerCandle: candle }; - thisObject.container.eventHandler.raiseEvent("Current Candle Changed", currentCandle); + thisObject.container.eventHandler.raiseEvent("Current Record Changed", currentCandle); } } diff --git a/VolumePanel.js b/VolumePanel.js index f460952aa..8df5284bc 100644 --- a/VolumePanel.js +++ b/VolumePanel.js @@ -4,23 +4,32 @@ function newAAMastersPlottersCandlesVolumesVolumesVolumePanel() { let thisObject = { fitFunction: undefined, container: undefined, - onEventRaised: onEventRaised, + onRecordChange: onRecordChange, draw: draw, getContainer: getContainer, - initialize: initialize + initialize: initialize, + finalize: finalize }; - let container = newContainer(); - container.initialize(); - thisObject.container = container; - - container.frame.containerName = "Volume"; + thisObject.container = newContainer(); + thisObject.container.initialize(); + thisObject.container.frame.containerName = "Volume"; let currentVolume; let panelTabButton return thisObject; + function finalize() { + thisObject.container.finalize() + thisObject.container = undefined + thisObject.fitFunction = undefined + + currentVolume = undefined + panelTabButton.finalize() + panelTabButton = undefined + } + function initialize() { thisObject.container.frame.width = UI_PANEL.WIDTH.NORMAL; @@ -59,7 +68,7 @@ function newAAMastersPlottersCandlesVolumesVolumesVolumePanel() { } - function onEventRaised(lastCurrentVolume) { + function onRecordChange(lastCurrentVolume) { currentVolume = lastCurrentVolume; diff --git a/Volumes.js b/Volumes.js index 0eb184145..c8ca9acd5 100644 --- a/Volumes.js +++ b/Volumes.js @@ -346,7 +346,7 @@ if (datetime.valueOf() >= volume.begin && datetime.valueOf() <= volume.end) { - thisObject.container.eventHandler.raiseEvent("Current Volume Changed", thisObject.currentCandle); + thisObject.container.eventHandler.raiseEvent("Current Record Changed", thisObject.currentCandle); } } @@ -417,7 +417,7 @@ if (datetime.valueOf() >= volume.begin && datetime.valueOf() <= volume.end) { - thisObject.container.eventHandler.raiseEvent("Current Volume Changed", thisObject.currentCandle); + thisObject.container.eventHandler.raiseEvent("Current Record Changed", thisObject.currentCandle); } } @@ -791,7 +791,7 @@ innerVolumeBar: volume }; - thisObject.container.eventHandler.raiseEvent("Current Volume Changed", currentVolume); + thisObject.container.eventHandler.raiseEvent("Current Record Changed", currentVolume); } diff --git a/this.plotter.config.json b/this.plotter.config.json index c95e1db35..1f777a5af 100644 --- a/this.plotter.config.json +++ b/this.plotter.config.json @@ -12,7 +12,7 @@ { "codeName": "CandlePanel", "moduleName": "CandlePanel", - "event": "Current Candle Changed" + "event": "Current Record Changed" } ] }, @@ -25,7 +25,7 @@ { "codeName": "VolumePanel", "moduleName": "VolumePanel", - "event": "Current Volume Changed" + "event": "Current Record Changed" } ] }