diff --git a/js/app/views/PlotComponents/PlotContextManager.js b/js/app/views/PlotComponents/PlotContextManager.js index 1e6b954..4919b23 100644 --- a/js/app/views/PlotComponents/PlotContextManager.js +++ b/js/app/views/PlotComponents/PlotContextManager.js @@ -50,7 +50,19 @@ Ext.define('amdaPlotComp.PlotContextManager', { return resPanel; }, - + + getInterval: function (context, panel, crtTimestamp) { + resInterval = null; + Ext.each(panel.intervals, function (interval) { + if (crtTimestamp > interval.startTime && crtTimestamp < interval.stopTime) { + resInterval = interval.name + ', id : ' + interval.id; + } + return; + }); + return resInterval; + }, + + getPanelAxisById : function(panelContext, axisId) { if (!panelContext || !panelContext.plotArea) diff --git a/js/app/views/PlotTabResultUI.js b/js/app/views/PlotTabResultUI.js index 3434b89..e56e5a9 100644 --- a/js/app/views/PlotTabResultUI.js +++ b/js/app/views/PlotTabResultUI.js @@ -225,6 +225,7 @@ Ext.define('amdaUI.PlotTabResultUI', { var sourceXPos = me.toPixelOnSourceImage(x); var sourceYPos = me.toPixelOnSourceImage(y); var panel = amdaPlotComp.PlotContextManager.getPanel(me.crtContext, sourceXPos, sourceYPos); + var text = ''; if (me.panelImage) { if (!panel) { @@ -251,12 +252,18 @@ Ext.define('amdaUI.PlotTabResultUI', { var xText = ''; var yLeftText = ''; var yRightText = ''; + var intervalText = ''; Ext.each(panel.plotArea.axes, function (axis) { switch (axis.id) { case 'timeAxis': var crtTimestamp = amdaPlotComp.PlotContextManager.toAxisValue(axis, panel.plotArea.x, panel.plotArea.x + panel.plotArea.width, sourceXPos); var crtTime = new Date(crtTimestamp * 1000); + var interval = amdaPlotComp.PlotContextManager.getInterval(me.crtContext, panel, crtTimestamp); xText = crtTime.toJSON(); + + if (interval != null) { + intervalText = interval; + } break; case 'y-left': yLeftText = me.getAxisValue(axis, panel.plotArea.y + panel.plotArea.height, panel.plotArea.y, sourceYPos); @@ -280,6 +287,8 @@ Ext.define('amdaUI.PlotTabResultUI', { text += (', Y Left : ' + yLeftText); if (yRightText != '') text += (', Y Right : ' + yRightText); + if (intervalText != '') + text += (', TT : ' + intervalText); } else me.panelImage.resetCursor(); -- libgit2 0.21.2