Commit 2cd12bf92e81a2b8a1978e7ade154d3bf3f59e07
1 parent
7b86b04f
Exists in
master
and in
59 other branches
#9326 - Showing TT informations on coordinates field
Showing
2 changed files
with
22 additions
and
1 deletions
Show diff stats
js/app/views/PlotComponents/PlotContextManager.js
... | ... | @@ -50,7 +50,19 @@ Ext.define('amdaPlotComp.PlotContextManager', { |
50 | 50 | |
51 | 51 | return resPanel; |
52 | 52 | }, |
53 | - | |
53 | + | |
54 | + getInterval: function (context, panel, crtTimestamp) { | |
55 | + resInterval = null; | |
56 | + Ext.each(panel.intervals, function (interval) { | |
57 | + if (crtTimestamp > interval.startTime && crtTimestamp < interval.stopTime) { | |
58 | + resInterval = interval.name + ', id : ' + interval.id; | |
59 | + } | |
60 | + return; | |
61 | + }); | |
62 | + return resInterval; | |
63 | + }, | |
64 | + | |
65 | + | |
54 | 66 | getPanelAxisById : function(panelContext, axisId) |
55 | 67 | { |
56 | 68 | if (!panelContext || !panelContext.plotArea) |
... | ... |
js/app/views/PlotTabResultUI.js
... | ... | @@ -225,6 +225,7 @@ Ext.define('amdaUI.PlotTabResultUI', { |
225 | 225 | var sourceXPos = me.toPixelOnSourceImage(x); |
226 | 226 | var sourceYPos = me.toPixelOnSourceImage(y); |
227 | 227 | var panel = amdaPlotComp.PlotContextManager.getPanel(me.crtContext, sourceXPos, sourceYPos); |
228 | + | |
228 | 229 | var text = ''; |
229 | 230 | if (me.panelImage) { |
230 | 231 | if (!panel) { |
... | ... | @@ -251,12 +252,18 @@ Ext.define('amdaUI.PlotTabResultUI', { |
251 | 252 | var xText = ''; |
252 | 253 | var yLeftText = ''; |
253 | 254 | var yRightText = ''; |
255 | + var intervalText = ''; | |
254 | 256 | Ext.each(panel.plotArea.axes, function (axis) { |
255 | 257 | switch (axis.id) { |
256 | 258 | case 'timeAxis': |
257 | 259 | var crtTimestamp = amdaPlotComp.PlotContextManager.toAxisValue(axis, panel.plotArea.x, panel.plotArea.x + panel.plotArea.width, sourceXPos); |
258 | 260 | var crtTime = new Date(crtTimestamp * 1000); |
261 | + var interval = amdaPlotComp.PlotContextManager.getInterval(me.crtContext, panel, crtTimestamp); | |
259 | 262 | xText = crtTime.toJSON(); |
263 | + | |
264 | + if (interval != null) { | |
265 | + intervalText = interval; | |
266 | + } | |
260 | 267 | break; |
261 | 268 | case 'y-left': |
262 | 269 | yLeftText = me.getAxisValue(axis, panel.plotArea.y + panel.plotArea.height, panel.plotArea.y, sourceYPos); |
... | ... | @@ -280,6 +287,8 @@ Ext.define('amdaUI.PlotTabResultUI', { |
280 | 287 | text += (', Y Left : ' + yLeftText); |
281 | 288 | if (yRightText != '') |
282 | 289 | text += (', Y Right : ' + yRightText); |
290 | + if (intervalText != '') | |
291 | + text += (', TT : ' + intervalText); | |
283 | 292 | } |
284 | 293 | else |
285 | 294 | me.panelImage.resetCursor(); |
... | ... |