Cleaning unued code

This commit is contained in:
Luis Fernando Molina committed 2020-01-11 09:15:17 +01:00
1 parent 2b1ff19ace
commit 6394fe2619
2 files changed
+20 -17

No files matched your search

+17 -1
View File
@@ -14,6 +14,8 @@ function newTimeMachine () {
const logger = newWebDebugLog()
logger.fileName = MODULE_NAME
let timeFrame = INITIAL_TIME_PERIOD
let thisObject = {
container: undefined,
timeScale: undefined,
@@ -46,9 +48,11 @@ function newTimeMachine () {
let onMouseOverEventSuscriptionId
let onMouseNotOverEventSuscriptionId
let timeScaleEventSuscriptionId
let rateScaleEventSuscriptionId
let timeScaleMouseOverEventSuscriptionId
let rateScaleEventSuscriptionId
let rateScaleMouseOverEventSuscriptionId
let timeFrameScaleEventSuscriptionId
let timeFrameScaleMouseOverEventSuscriptionId
setupContainer()
return thisObject
@@ -73,6 +77,10 @@ function newTimeMachine () {
finalizeRateScale()
}
if (thisObject.timeFrameScale !== undefined) {
finalizeTimeFrameScale()
}
thisObject.container.eventHandler.stopListening(onMouseOverEventSuscriptionId)
thisObject.container.eventHandler.stopListening(onMouseNotOverEventSuscriptionId)
@@ -108,7 +116,15 @@ function newTimeMachine () {
thisObject.rateScale = undefined
}
function finalizeTimeFrameScale () {
thisObject.timeFrameScale.container.eventHandler.stopListening(timeFrameScaleEventSuscriptionId)
thisObject.timeFrameScale.container.eventHandler.stopListening(timeFrameScaleMouseOverEventSuscriptionId)
thisObject.timeFrameScale.finalize()
thisObject.timeFrameScale = undefined
}
function initialize (callBackFunction) {
timeFrame = INITIAL_TIME_PERIOD
recalculateScale()
onMouseOverEventSuscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseOver', onMouseOver)
+3 -16
View File
@@ -17,7 +17,6 @@ function newTimelineChart () {
timeFrameScale: undefined,
payload: undefined,
physics: physics,
setDatetime: setDatetime,
drawBackground: drawBackground,
draw: draw,
getContainer: getContainer,
@@ -91,7 +90,7 @@ function newTimelineChart () {
function initialize (pExchange, pMarket, pTimeLineCoordinateSystem, callBackFunction) {
try {
/* We load the logow we will need for the background. */
/* We load the logow we will need for the background. */
exchange = pExchange
market = pMarket
timeLineCoordinateSystem = pTimeLineCoordinateSystem
@@ -105,13 +104,11 @@ function newTimelineChart () {
timeFrame = INITIAL_TIME_PERIOD
datetime = NEW_SESSION_INITIAL_DATE
/* Event Subscriptions - we need this events to be fired first here and then in active Plotters. */
/* Event Subscriptions - we need this events to be fired first here and then in active Plotters. */
onOffsetChangedEventSuscriptionId = viewPort.eventHandler.listenToEvent('Offset Changed', onOffsetChanged)
onZoomChangedEventSuscriptionId = viewPort.eventHandler.listenToEvent('Zoom Changed', onZoomChanged)
/* Initialize the Plotter Manager */
/* Initialize the Plotter Manager */
plotterManager = newPlottersManager()
plotterManager.container.connectToParent(thisObject.container, true, true, false, true, true, true, false, false, true)
@@ -197,16 +194,6 @@ function newTimelineChart () {
}
}
function setDatetime (pDatetime) {
/* This function is used when the time is changed through the user interface, but without zooming or panning. */
/* No matter if the day changed or not, we need to inform all visible Plotters. */
if (thisObject.container.frame.isInViewPort()) {
plotterManager.setDatetime(pDatetime)
plotterManager.positionAtDatetime(pDatetime)
}
}
function onOffsetChanged () {
if (initializationReady === true) {
if (thisObject.container.frame.isInViewPort()) {