Blame view

js/app/views/PlotTabResultUI.js 27.1 KB
16035364   Benjamin Renard   First commit
1
2
3
/**
 * Project   : AMDA-NG
 * Name      : PlotTabResultUI.js
18d4a11e   Benjamin Renard   Save and load plo...
4
5
 * @class    amdaUI.PlotTabResultUI
 * @extends  Ext. panel.Panel
16035364   Benjamin Renard   First commit
6
7
 * @brief    Plot Tab Result UI definition (View)
 * @author    
bab90f22   Elena.Budnik   format + #5668
8
 * @version  $Id: PlotTabResultUI.js benjamin 
16035364   Benjamin Renard   First commit
9
10
11
 */

Ext.define('amdaUI.PlotTabResultUI', {
bab90f22   Elena.Budnik   format + #5668
12
	extend: 'Ext.panel.Panel',
16035364   Benjamin Renard   First commit
13

bab90f22   Elena.Budnik   format + #5668
14
15
16
17
18
	alias: 'widget.plotTabResult',

	requires: [
		'amdaPlotComp.PlotZoomPlug',
		'amdaPlotComp.PlotExtendShiftPlug',
bab90f22   Elena.Budnik   format + #5668
19
20
21
		'amdaPlotComp.PlotContextManager',
		'amdaPlotComp.PlotResultImage'
	],
8c88a270   Erdogan Furkan   10312 - Navigatio...
22
23
24
25
26
27
28

	panelImage: null,
	crtContext: null,
	interactiveId: '',
	navToolBar: null,
	isTTNavBar: false,
	crtTTFileIndex: 0,
bab90f22   Elena.Budnik   format + #5668
29
	disableSynchronize: false,
27a055f4   Benjamin Renard   Multiplot (#8314)
30
	multiplot: false,
55b10506   Benjamin Renard   Update correctly ...
31
	plotName: '',
6e1e1bf4   Benjamin Renard   Fix some bugs wit...
32
	//listParams: [],
8c88a270   Erdogan Furkan   10312 - Navigatio...
33

bab90f22   Elena.Budnik   format + #5668
34
	hiddenForm: null,
8c88a270   Erdogan Furkan   10312 - Navigatio...
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49

	constructor: function (config) {
		this.addEvents({ 'pagesize': true });

		this.init(config);
		this.callParent(arguments);
	},

	updateConfig: function (name, multiplot) {
		this.multiplot = multiplot;
		this.plotName = name;
		this.findParentByType('window').setTitle(this.plotName + (this.multiplot ? ' - Synchronized to Multiplot' : ''));
	},

	getImageSize: function () {
bab90f22   Elena.Budnik   format + #5668
50
51
		if (!this.crtContext)
			return {
8c88a270   Erdogan Furkan   10312 - Navigatio...
52
53
				width: 0,
				height: 0
bab90f22   Elena.Budnik   format + #5668
54
			};
8c88a270   Erdogan Furkan   10312 - Navigatio...
55
56
57
58
59

		return {
			width: this.crtContext.page.width * this.sliderPage.getValue() / 100.,
			height: this.crtContext.page.height * this.sliderPage.getValue() / 100.
		}
bab90f22   Elena.Budnik   format + #5668
60
	},
8c88a270   Erdogan Furkan   10312 - Navigatio...
61
62
63

	getImageUrl: function (resultFolder, plotFile) {
		return 'data/' + sessionID + '/RES/' + resultFolder + '/' + plotFile;
bab90f22   Elena.Budnik   format + #5668
64
	},
8c88a270   Erdogan Furkan   10312 - Navigatio...
65
66
67

	toPixelOnSourceImage: function (value) {
		return value * 100 / this.sliderPage.getValue();
d0b61b72   Benjamin Renard   Show coordinates ...
68
	},
8c88a270   Erdogan Furkan   10312 - Navigatio...
69
70
71

	toPixelOnResultImage: function (value) {
		return value * this.sliderPage.getValue() / 100;
d0b61b72   Benjamin Renard   Show coordinates ...
72
	},
8c88a270   Erdogan Furkan   10312 - Navigatio...
73
74

	createZoomItemsForPanel: function (panelId) {
6e1e1bf4   Benjamin Renard   Fix some bugs wit...
75
		var zoomPlugin = this.getPlugin('plot-zoom-plugin-id-'+this.interactiveId);
9f08f4eb   Benjamin Renard   Zoom in interacti...
76
77
		if (zoomPlugin == null)
			return;
8c88a270   Erdogan Furkan   10312 - Navigatio...
78

9f08f4eb   Benjamin Renard   Zoom in interacti...
79
		var panelContext = amdaPlotComp.PlotContextManager.getPanelById(this.crtContext, panelId);
caff798e   Benjamin Renard   Fix zoom bar for ...
80
		var size = this.getImageSize();
1f9f9178   Menouard AZIB   I have created a ...
81
		// We need a list of parameters to compute the number of points needed to apply FFT
6e1e1bf4   Benjamin Renard   Fix some bugs wit...
82
83
		//this.listParams = panelContext["parameters"];
		//zoomPlugin.setParameters(this.listParams);
8c88a270   Erdogan Furkan   10312 - Navigatio...
84

bd8d75af   Menouard AZIB   Disable paramter ...
85

9f08f4eb   Benjamin Renard   Zoom in interacti...
86
		var me = this;
8b11b1af   Benjamin Renard   Insert intervals ...
87
		var insertIntervalItem = null;
a54cfb3f   Benjamin Renard   Merge amdadev int...
88
		var plotFunctionItem = null;
9f08f4eb   Benjamin Renard   Zoom in interacti...
89
90
91
92
93
94
95
		Ext.each(panelContext.plotArea.axes, function (axis) {
			//Events for zoom on a time axis
			var onMinTimeSelection = function (posX) {
				//Panel and axis context must be retrieved by using the crtContext
				var panelContext = amdaPlotComp.PlotContextManager.getPanelById(me.crtContext, panelId);
				var axisContext = amdaPlotComp.PlotContextManager.getPanelAxisById(panelContext, axis.id);
				var sourceXPos = me.toPixelOnSourceImage(posX);
8c88a270   Erdogan Furkan   10312 - Navigatio...
96
97
				var crtTimestamp = amdaPlotComp.PlotContextManager.toAxisValue(axisContext, panelContext.plotArea.x, panelContext.plotArea.x + panelContext.plotArea.width, sourceXPos);
				var crtTime = new Date(crtTimestamp * 1000);
9f08f4eb   Benjamin Renard   Zoom in interacti...
98
99
100
				crtTime = Ext.Date.add(crtTime, Ext.Date.MINUTE, crtTime.getTimezoneOffset());
				zoomPlugin.setMinValue(crtTime);
			};
8c88a270   Erdogan Furkan   10312 - Navigatio...
101

9f08f4eb   Benjamin Renard   Zoom in interacti...
102
103
104
105
106
			var onMaxTimeSelection = function (posX) {
				//Panel and axis context must be retrieved by using the crtContext
				var panelContext = amdaPlotComp.PlotContextManager.getPanelById(me.crtContext, panelId);
				var axisContext = amdaPlotComp.PlotContextManager.getPanelAxisById(panelContext, axis.id);
				var sourceXPos = me.toPixelOnSourceImage(posX);
8c88a270   Erdogan Furkan   10312 - Navigatio...
107
108
				var crtTimestamp = amdaPlotComp.PlotContextManager.toAxisValue(axisContext, panelContext.plotArea.x, panelContext.plotArea.x + panelContext.plotArea.width, sourceXPos);
				var crtTime = new Date(crtTimestamp * 1000);
9f08f4eb   Benjamin Renard   Zoom in interacti...
109
110
111
				crtTime = Ext.Date.add(crtTime, Ext.Date.MINUTE, crtTime.getTimezoneOffset());
				zoomPlugin.setMaxValue(crtTime);
			};
8c88a270   Erdogan Furkan   10312 - Navigatio...
112

9f08f4eb   Benjamin Renard   Zoom in interacti...
113
			//Events for zoom on a Y axis
8c88a270   Erdogan Furkan   10312 - Navigatio...
114
			var onMinYValueSelection = function (posY) {
9f08f4eb   Benjamin Renard   Zoom in interacti...
115
116
117
118
				//Panel and axis context must be retrieved by using the crtContext
				var panelContext = amdaPlotComp.PlotContextManager.getPanelById(me.crtContext, panelId);
				var axisContext = amdaPlotComp.PlotContextManager.getPanelAxisById(panelContext, axis.id);
				var sourceYPos = me.toPixelOnSourceImage(posY);
8c88a270   Erdogan Furkan   10312 - Navigatio...
119
				var crtValue = amdaPlotComp.PlotContextManager.toAxisValue(axisContext, panelContext.plotArea.y + panelContext.plotArea.height, panelContext.plotArea.y, sourceYPos);
9f08f4eb   Benjamin Renard   Zoom in interacti...
120
121
				zoomPlugin.setMinValue(crtValue);
			};
8c88a270   Erdogan Furkan   10312 - Navigatio...
122
123

			var onMaxYValueSelection = function (posY) {
9f08f4eb   Benjamin Renard   Zoom in interacti...
124
125
126
127
				//Panel and axis context must be retrieved by using the crtContext
				var panelContext = amdaPlotComp.PlotContextManager.getPanelById(me.crtContext, panelId);
				var axisContext = amdaPlotComp.PlotContextManager.getPanelAxisById(panelContext, axis.id);
				var sourceYPos = me.toPixelOnSourceImage(posY);
8c88a270   Erdogan Furkan   10312 - Navigatio...
128
				var crtValue = amdaPlotComp.PlotContextManager.toAxisValue(axisContext, panelContext.plotArea.y + panelContext.plotArea.height, panelContext.plotArea.y, sourceYPos);
9f08f4eb   Benjamin Renard   Zoom in interacti...
129
130
				zoomPlugin.setMaxValue(crtValue);
			};
8c88a270   Erdogan Furkan   10312 - Navigatio...
131

9f08f4eb   Benjamin Renard   Zoom in interacti...
132
			//Events for zoom on X axis
8c88a270   Erdogan Furkan   10312 - Navigatio...
133
			var onMinXValueSelection = function (posX) {
9f08f4eb   Benjamin Renard   Zoom in interacti...
134
135
136
137
138
139
140
				//Panel and axis context must be retrieved by using the crtContext
				var panelContext = amdaPlotComp.PlotContextManager.getPanelById(me.crtContext, panelId);
				var axisContext = amdaPlotComp.PlotContextManager.getPanelAxisById(panelContext, axis.id);
				var sourceXPos = me.toPixelOnSourceImage(posX);
				var crtValue = amdaPlotComp.PlotContextManager.toAxisValue(axisContext, panelContext.plotArea.x, panelContext.plotArea.x + panelContext.plotArea.width, sourceXPos);
				zoomPlugin.setMinValue(crtValue);
			};
8c88a270   Erdogan Furkan   10312 - Navigatio...
141
142

			var onMaxXValueSelection = function (posX) {
9f08f4eb   Benjamin Renard   Zoom in interacti...
143
144
145
146
147
148
149
				//Panel and axis context must be retrieved by using the crtContext
				var panelContext = amdaPlotComp.PlotContextManager.getPanelById(me.crtContext, panelId);
				var axisContext = amdaPlotComp.PlotContextManager.getPanelAxisById(panelContext, axis.id);
				var sourceXPos = me.toPixelOnSourceImage(posX);
				var crtValue = amdaPlotComp.PlotContextManager.toAxisValue(axisContext, panelContext.plotArea.x, panelContext.plotArea.x + panelContext.plotArea.width, sourceXPos);
				zoomPlugin.setMaxValue(crtValue);
			};
8c88a270   Erdogan Furkan   10312 - Navigatio...
150
151
152
153
154
155
156
157
158
159
160
161

			switch (axis.id) {
				case 'timeAxis':
					me.contextualMenu.add({
						text: 'Zoom on Time Axis',
						handler: function (item, e) {
							zoomPlugin.show(me.interactiveId, axis.id, panelContext.id);
							zoomPlugin.resetMinMaxValue();
							me.panelImage.startZoom(true, 0/*me.toPixelOnResultImage(panelContext.y)*/, size.height /*me.toPixelOnResultImage(panelContext.height)*/, onMinTimeSelection, onMaxTimeSelection);
						},
						scope: this
					});
535d7638   Menouard AZIB   I have added a co...
162
					//plotFunction Menu
d0692c05   Menouard AZIB   Everthing works well
163
					plotFunctionItem = {
f401b3c7   Benjamin Renard   Fix
164
						text: 'Apply a Function on Interval',
535d7638   Menouard AZIB   I have added a co...
165
166
167
168
169
170
						handler: function (item, e) {
							zoomPlugin.show(me.interactiveId, axis.id, panelContext.id, true);
							zoomPlugin.resetMinMaxValue();
							me.panelImage.startZoom(true, 0, size.height, onMinTimeSelection, onMaxTimeSelection);
						},
						scope: this
d0692c05   Menouard AZIB   Everthing works well
171
					};
8c88a270   Erdogan Furkan   10312 - Navigatio...
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
					insertIntervalItem = {
						text: 'Insert Interval in TimeTable or Catalog',
						handler: function (item, e) {
							zoomPlugin.show(me.interactiveId, axis.id, panelContext.id);
							zoomPlugin.resetMinMaxValue();
							me.panelImage.startZoom(true, 0/*me.toPixelOnResultImage(panelContext.y)*/, size.height /*me.toPixelOnResultImage(panelContext.height)*/, onMinTimeSelection, onMaxTimeSelection);
						},
						scope: this
					};
					break;
				case 'y-left':
					me.contextualMenu.add({
						text: 'Zoom on Y Left Axis',
						handler: function (item, e) {
							zoomPlugin.show(me.interactiveId, axis.id, panelContext.id);
							zoomPlugin.resetMinMaxValue();
							me.panelImage.startZoom(false, me.toPixelOnResultImage(panelContext.x), me.toPixelOnResultImage(panelContext.width), onMinYValueSelection, onMaxYValueSelection);
						}
					});
					break;
				case 'y-right':
					me.contextualMenu.add({
						text: 'Zoom on Y Right Axis',
						handler: function (item, e) {
							zoomPlugin.show(me.interactiveId, axis.id, panelContext.id);
							zoomPlugin.resetMinMaxValue();
							me.panelImage.startZoom(false, me.toPixelOnResultImage(panelContext.x), me.toPixelOnResultImage(panelContext.width), onMinYValueSelection, onMaxYValueSelection);
						}
					});
					break;
				case 'xaxis_id':
					me.contextualMenu.add({
						text: 'Zoom on X Axis',
						handler: function (item, e) {
							zoomPlugin.show(me.interactiveId, axis.id, panelContext.id);
							zoomPlugin.resetMinMaxValue();
							me.panelImage.startZoom(true, me.toPixelOnResultImage(panelContext.y), me.toPixelOnResultImage(panelContext.height), onMinXValueSelection, onMaxXValueSelection);
						}
					});
					break;
				case 'epochAxis':
					//Nothing to add
					break;
9f08f4eb   Benjamin Renard   Zoom in interacti...
215
			}
8c88a270   Erdogan Furkan   10312 - Navigatio...
216

9f08f4eb   Benjamin Renard   Zoom in interacti...
217
		});
8b11b1af   Benjamin Renard   Insert intervals ...
218
219
220
221
222

		if (insertIntervalItem != null) {
			me.contextualMenu.add('-');
			me.contextualMenu.add(insertIntervalItem);
		}
da1cb3af   Benjamin Renard   Add panel highlig...
223
		if (plotFunctionItem != null) { // #9016 & #6018 - Hide - Not fully tested
bd8d75af   Menouard AZIB   Disable paramter ...
224
			me.contextualMenu.insert(0, '-');
f401b3c7   Benjamin Renard   Fix
225
			me.contextualMenu.insert(0, plotFunctionItem);
da1cb3af   Benjamin Renard   Add panel highlig...
226
		}
9f08f4eb   Benjamin Renard   Zoom in interacti...
227
	},
2ea6eb0d   Benjamin Renard   Fix decimal preci...
228

8c88a270   Erdogan Furkan   10312 - Navigatio...
229
230
231
232
233
	getAxisValue: function (axis, pixelMin, pixelMax, pixelVal) {
		var val = amdaPlotComp.PlotContextManager.toAxisValue(axis, pixelMin, pixelMax, pixelVal);
		return parseFloat(val).toPrecision(5);
	},

c6ee3ae0   Erdogan Furkan   Z values are show...
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
	stringToRgbArray : function (str) {
		var rgbArray = Ext.Array.map(str.split("|"), function(val) {
			var rgb = val.replace(/\[|\]/g, "").split(",");
			return [parseInt(rgb[0]), parseInt(rgb[1]), parseInt(rgb[2])];
		});
		rgbArray.pop();
		return rgbArray;
	},
	  
	getZAxisValue: function(image, x,y, size, axis, bgColor ){

		var me = this;
		if(bgColor==="[-1,-1,-1]")
			bgColor="[255,255,255]"; // More readable for IHM part

		// Get the color under the cursor
		var imgEl = image.getEl();
		var canvas = document.createElement('canvas');
		var context = canvas.getContext('2d');
		canvas.width = size.width;
		canvas.height = size.height;
		context.drawImage(imgEl.dom, 0, 0, canvas.width, canvas.height);
		var imageData = context.getImageData(x, y, 1, 1);
		var r = imageData.data[0];
		var g = imageData.data[1];
		var b = imageData.data[2];
		var cursorColor = "["+r+","+g+","+b+"]";

		// Now we'll transform the color information to values

		if(cursorColor !== bgColor){
			var colorListArray = me.stringToRgbArray(axis.colorsList);

			// Creating the value scale
			var interval = (axis.max - axis.min) / ( colorListArray.length- 1);
			valuesListArray = new Array(colorListArray.length+1);

			for(var i=0;i< colorListArray.length+1; i++)
				valuesListArray[i] = axis.min + i * interval;
			
			// Computation of the closest r,g,b values to the cursorColor
			lowestChi = new Array(2);
			for(var i=0;i< colorListArray.length; i++){
				var chi =  Math.sqrt(Math.pow(colorListArray[i][0]-r, 2) + 
									 Math.pow(colorListArray[i][1]-g, 2) + 
									 Math.pow(colorListArray[i][2]-b, 2) );

				if (i == 0)
					lowestChi = [i,chi];
				else if (chi < lowestChi[1])
					lowestChi = [i,chi];
			}

			// Returning values

			if(axis.logarithmic)
				return "[1e"+valuesListArray[lowestChi[0]].toFixed(3)+",1e"+valuesListArray[lowestChi[0]+1].toFixed(4)+"]";
			return "["+valuesListArray[lowestChi[0]].toFixed(4)+","+valuesListArray[lowestChi[0]+1].toFixed(4)+"]";	
		}
		return "";
	},

8c88a270   Erdogan Furkan   10312 - Navigatio...
296
297
298
299
300
301
302
	createPlotImage: function (resultFolder, plotFile) {
		var me = this;
		var size = this.getImageSize();
		this.panelImage = Ext.create('amdaPlotComp.PlotResultImage', {
			src: this.getImageUrl(resultFolder, plotFile),
			width: size.width,
			height: size.height,
da1cb3af   Benjamin Renard   Add panel highlig...
303
304
305
306
307
308
309
310
311
312
313
314
315
			showPanelMarker: function (panelId) {
				var panel = amdaPlotComp.PlotContextManager.getPanelById(me.crtContext, panelId);
				if (panel) {
					me.panelImage.updatePanel(
						me.toPixelOnResultImage(panel.x),
						me.toPixelOnResultImage(panel.y),
						me.toPixelOnResultImage(panel.width),
						me.toPixelOnResultImage(panel.height));
				}
			},
			hidePanelMarker: function () {
				me.panelImage.resetPanel();
			},
8c88a270   Erdogan Furkan   10312 - Navigatio...
316
			onMouseMove: function (x, y) {
d0b61b72   Benjamin Renard   Show coordinates ...
317
318
				if (!me.crtContext)
					return;
8c88a270   Erdogan Furkan   10312 - Navigatio...
319

d0b61b72   Benjamin Renard   Show coordinates ...
320
321
322
				var sourceXPos = me.toPixelOnSourceImage(x);
				var sourceYPos = me.toPixelOnSourceImage(y);
				var panel = amdaPlotComp.PlotContextManager.getPanel(me.crtContext, sourceXPos, sourceYPos);
2cd12bf9   Erdogan Furkan   #9326 - Showing T...
323

d0b61b72   Benjamin Renard   Show coordinates ...
324
				var text = '';
8c88a270   Erdogan Furkan   10312 - Navigatio...
325
326
				if (me.panelImage) {
					if (!panel) {
d0b61b72   Benjamin Renard   Show coordinates ...
327
328
329
						me.panelImage.resetCursor();
						text += 'No panel';
					}
8c88a270   Erdogan Furkan   10312 - Navigatio...
330
					else {
d0b61b72   Benjamin Renard   Show coordinates ...
331
332
						text += 'Panel Id : ';
						text += panel.id;
8c88a270   Erdogan Furkan   10312 - Navigatio...
333
						if (amdaPlotComp.PlotContextManager.isInPlotArea(panel, sourceXPos, sourceYPos)) {
d0b61b72   Benjamin Renard   Show coordinates ...
334
335
336
337
338
339
340
							/*me.panelImage.updateCursor(
								me.toPixelOnResultImage(panel.plotArea.x),
								me.toPixelOnResultImage(panel.plotArea.y),
								me.toPixelOnResultImage(panel.plotArea.width),
								me.toPixelOnResultImage(panel.plotArea.height),
								x, y);*/
							me.panelImage.updateCursor(
8c88a270   Erdogan Furkan   10312 - Navigatio...
341
342
343
344
345
346
								me.toPixelOnResultImage(0),
								me.toPixelOnResultImage(0),
								me.toPixelOnResultImage(me.crtContext.page.width),
								me.toPixelOnResultImage(me.crtContext.page.height),
								x, y);

d0b61b72   Benjamin Renard   Show coordinates ...
347
348
							var xText = '';
							var yLeftText = '';
c6ee3ae0   Erdogan Furkan   Z values are show...
349
							var colorText = '';
d0b61b72   Benjamin Renard   Show coordinates ...
350
							var yRightText = '';
2cd12bf9   Erdogan Furkan   #9326 - Showing T...
351
							var intervalText = '';
c6ee3ae0   Erdogan Furkan   Z values are show...
352
							var image=this;
d0b61b72   Benjamin Renard   Show coordinates ...
353
							Ext.each(panel.plotArea.axes, function (axis) {
8c88a270   Erdogan Furkan   10312 - Navigatio...
354
355
356
357
								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);
c2cc7749   Erdogan Furkan   #10098 - Modifica...
358
										intervalText = amdaPlotComp.PlotContextManager.getIntervalCoordInfo(me.crtContext, panel, crtTimestamp);
8c88a270   Erdogan Furkan   10312 - Navigatio...
359
										xText = crtTime.toJSON();
8c88a270   Erdogan Furkan   10312 - Navigatio...
360
361
362
363
364
365
366
										break;
									case 'y-left':
										yLeftText = me.getAxisValue(axis, panel.plotArea.y + panel.plotArea.height, panel.plotArea.y, sourceYPos);
										break;
									case 'y-right':
										yRightText = me.getAxisValue(axis, panel.plotArea.y + panel.plotArea.height, panel.plotArea.y, sourceYPos);
										break;
c6ee3ae0   Erdogan Furkan   Z values are show...
367
368
369
									case 'colorAxis':
										colorText = me.getZAxisValue(image, x,y, size,axis,panel.plotArea.plotAreaBackgroundColor );
										break;
8c88a270   Erdogan Furkan   10312 - Navigatio...
370
371
372
373
374
375
									case 'xaxis_id':
										xText = me.getAxisValue(axis, panel.plotArea.x, panel.plotArea.x + panel.plotArea.width, sourceXPos);
										break;
									case 'epochAxis':
										xText = me.getAxisValue(axis, panel.plotArea.x, panel.plotArea.x + panel.plotArea.width, sourceXPos);
										break;
d0b61b72   Benjamin Renard   Show coordinates ...
376
								}
8c88a270   Erdogan Furkan   10312 - Navigatio...
377

d0b61b72   Benjamin Renard   Show coordinates ...
378
							});
8c88a270   Erdogan Furkan   10312 - Navigatio...
379

d0b61b72   Benjamin Renard   Show coordinates ...
380
							if (xText != '')
8c88a270   Erdogan Furkan   10312 - Navigatio...
381
								text += (', X : ' + xText);
d0b61b72   Benjamin Renard   Show coordinates ...
382
							if (yLeftText != '')
8c88a270   Erdogan Furkan   10312 - Navigatio...
383
								text += (', Y Left : ' + yLeftText);
d0b61b72   Benjamin Renard   Show coordinates ...
384
							if (yRightText != '')
8c88a270   Erdogan Furkan   10312 - Navigatio...
385
								text += (', Y Right : ' + yRightText);
2cd12bf9   Erdogan Furkan   #9326 - Showing T...
386
							if (intervalText != '')
c2cc7749   Erdogan Furkan   #10098 - Modifica...
387
								text += (', ' + intervalText);
c6ee3ae0   Erdogan Furkan   Z values are show...
388
389
							if (colorText != '')
								text += (', Z : '+ colorText);
d0b61b72   Benjamin Renard   Show coordinates ...
390
391
392
393
394
395
396
						}
						else
							me.panelImage.resetCursor();
					}
				}
				me.coordinatesField.setText(text);
			},
8c88a270   Erdogan Furkan   10312 - Navigatio...
397
			onContextMenu: function (absoluteX, absoluteY, imageX, imageY) {
9f08f4eb   Benjamin Renard   Zoom in interacti...
398
399
				if (!me.crtContext)
					return;
8c88a270   Erdogan Furkan   10312 - Navigatio...
400

87658ba0   Benjamin Renard   TT Navigation in ...
401
				me.contextualMenu.removeAll(true);
8c88a270   Erdogan Furkan   10312 - Navigatio...
402

9f08f4eb   Benjamin Renard   Zoom in interacti...
403
404
405
				var sourceXPos = me.toPixelOnSourceImage(imageX);
				var sourceYPos = me.toPixelOnSourceImage(imageY);
				var panel = amdaPlotComp.PlotContextManager.getPanel(me.crtContext, sourceXPos, sourceYPos);
c2cc7749   Erdogan Furkan   #10098 - Modifica...
406
				var timeAxisContext = amdaPlotComp.PlotContextManager.getPanelAxisById(panel, 'timeAxis');
119bba35   Benjamin Renard   Fix regression on...
407
408
409
				var crtTimestamp = null;
				if (timeAxisContext != null)
					crtTimestamp = amdaPlotComp.PlotContextManager.toAxisValue(timeAxisContext, panel.plotArea.x, panel.plotArea.x + panel.plotArea.width, sourceXPos);
8c88a270   Erdogan Furkan   10312 - Navigatio...
410
411
412

				if (panel != null) {
					if (panel.plotArea.hasSpectro) {
c9071a43   Benjamin Renard   Add instant plot ...
413
						me.contextualMenu.add([
bab90f22   Elena.Budnik   format + #5668
414
							{
8c88a270   Erdogan Furkan   10312 - Navigatio...
415
416
								text: 'Instant cut at this position',
								handler: function () {
c2cc7749   Erdogan Furkan   #10098 - Modifica...
417

8c88a270   Erdogan Furkan   10312 - Navigatio...
418
									var crtTime = new Date(crtTimestamp * 1000);
3afa41ee   Erdogan Furkan   #10663 - Fixed bug
419
									//crtTime = Ext.Date.add(crtTime, Ext.Date.MINUTE, crtTime.getTimezoneOffset());
592d7b65   Menouard AZIB   Merge develop int...
420
									me.callInteractivePlot({ 'action': 'instant', 'interactiveId': this.interactiveId, 'panelId': panel.id, 'time': crtTime.toISOString() });
bab90f22   Elena.Budnik   format + #5668
421
422
423
								},
								scope: me
							},
8c88a270   Erdogan Furkan   10312 - Navigatio...
424
							'-'
c9071a43   Benjamin Renard   Add instant plot ...
425
426
						]);
					}
9f08f4eb   Benjamin Renard   Zoom in interacti...
427
428
					if (amdaPlotComp.PlotContextManager.isInPlotArea(panel, sourceXPos, sourceYPos))
						me.createZoomItemsForPanel(panel.id);
c2cc7749   Erdogan Furkan   #10098 - Modifica...
429
430


9f08f4eb   Benjamin Renard   Zoom in interacti...
431
				}
8b11b1af   Benjamin Renard   Insert intervals ...
432

9f08f4eb   Benjamin Renard   Zoom in interacti...
433
434
				if (me.contextualMenu.items.getCount() > 0)
					me.contextualMenu.add('-');
8c88a270   Erdogan Furkan   10312 - Navigatio...
435

37e81bff   Benjamin Renard   Direct save of pl...
436
				me.contextualMenu.add([
bab90f22   Elena.Budnik   format + #5668
437
					{
8c88a270   Erdogan Furkan   10312 - Navigatio...
438
439
440
						text: 'Extend/Shift Time interval',
						disabled: me.isTTNavBar,
						handler: function () {
6e1e1bf4   Benjamin Renard   Fix some bugs wit...
441
							var extendShiftPlugin = this.getPlugin('plot-extendshift-plugin-id-'+this.interactiveId);
b39c9d1d   Benjamin Renard   Fix interactive n...
442
							extendShiftPlugin.show(me.interactiveId);
bab90f22   Elena.Budnik   format + #5668
443
444
445
446
447
448
						},
						scope: me
					},
					'-',
					{
						text: 'Save Plot',
8c88a270   Erdogan Furkan   10312 - Navigatio...
449
						handler: function () {
bab90f22   Elena.Budnik   format + #5668
450
451
							if (me.hiddenForm == null)
								me.hiddenForm = Ext.create('Ext.form.Panel', {
8c88a270   Erdogan Furkan   10312 - Navigatio...
452
									title: 'hiddenForm',
bab90f22   Elena.Budnik   format + #5668
453
454
455
456
									renderTo: Ext.getBody(),
									standardSubmit: true,
									url: 'php/downloadPlot.php',
									timeout: 120000,
8c88a270   Erdogan Furkan   10312 - Navigatio...
457
									height: 100,
bab90f22   Elena.Budnik   format + #5668
458
									width: 100,
8c88a270   Erdogan Furkan   10312 - Navigatio...
459
460
									hidden: true,
									items: []
bab90f22   Elena.Budnik   format + #5668
461
								});
37e81bff   Benjamin Renard   Direct save of pl...
462

bab90f22   Elena.Budnik   format + #5668
463
464
465
							me.hiddenForm.getForm().submit({
								params: {
									sessionId: sessionID,
8c88a270   Erdogan Furkan   10312 - Navigatio...
466
									interactiveId: me.interactiveId
bab90f22   Elena.Budnik   format + #5668
467
								},
8c88a270   Erdogan Furkan   10312 - Navigatio...
468
469
								success: function (form, action) { },
								failure: function (form, action) { }
bab90f22   Elena.Budnik   format + #5668
470
471
472
							});
						}
					}
37e81bff   Benjamin Renard   Direct save of pl...
473
				]);
8c88a270   Erdogan Furkan   10312 - Navigatio...
474

119bba35   Benjamin Renard   Fix regression on...
475
				if (timeAxisContext && amdaPlotComp.PlotContextManager.isInterval(me.crtContext, panel, crtTimestamp)) {
c2cc7749   Erdogan Furkan   #10098 - Modifica...
476
477
478
479
480
					var allintervalParams = amdaPlotComp.PlotContextManager.getAllIntervalParams(me.crtContext, panel, crtTimestamp);
					if (allintervalParams.length > 0) {

						var links = amdaPlotComp.PlotContextManager.getIntervalLinks(allintervalParams);
						if (links.length > 0) {
1be6ea03   Erdogan Furkan   #10098 - Final co...
481
482
							var menu = Ext.create('Ext.menu.Menu', { plain: true });
							var realLinks = amdaPlotComp.PlotContextManager.setIntervalsRef(links, menu);
c2cc7749   Erdogan Furkan   #10098 - Modifica...
483
484
485
							me.contextualMenu.add('-');
							me.contextualMenu.add([
								{
1be6ea03   Erdogan Furkan   #10098 - Final co...
486
487
									text: 'Open references (' + realLinks.length + ')',
									menu: menu,
c2cc7749   Erdogan Furkan   #10098 - Modifica...
488
489
490
491
492
493
									scope: me
								}]);
						}
					}
				}

9f08f4eb   Benjamin Renard   Zoom in interacti...
494
495
				me.contextualMenu.showAt(absoluteX, absoluteY);
			}
bab90f22   Elena.Budnik   format + #5668
496
		});
16035364   Benjamin Renard   First commit
497

bab90f22   Elena.Budnik   format + #5668
498
499
		return this.panelImage;
	},
8c88a270   Erdogan Furkan   10312 - Navigatio...
500
501

	updatePlotImage: function (configResult, newPlot) {
bab90f22   Elena.Budnik   format + #5668
502
		this.crtContext = configResult.context;
8c88a270   Erdogan Furkan   10312 - Navigatio...
503

43ec9f7a   Erdogan Furkan   #11349 - Done
504
505
506
		var zoomPlugin = this.getPlugin('plot-zoom-plugin-id-'+this.interactiveId);
		if (zoomPlugin)
			zoomPlugin.close();
8c88a270   Erdogan Furkan   10312 - Navigatio...
507

bab90f22   Elena.Budnik   format + #5668
508
		this.crtTTFileIndex = configResult.ttFileIndex;
8c88a270   Erdogan Furkan   10312 - Navigatio...
509
510

		if (this.isTTNavBar != (!configResult.isInterval) || (this.isSuperposeMode != this.crtContext.page.superposeMode)) {
bab90f22   Elena.Budnik   format + #5668
511
512
513
			//Update navigation bar
			this.updateNavToolBar(!configResult.isInterval, this.crtContext.page.superposeMode);
		}
8c88a270   Erdogan Furkan   10312 - Navigatio...
514

bab90f22   Elena.Budnik   format + #5668
515
		this.updateTimeTableInfo();
8c88a270   Erdogan Furkan   10312 - Navigatio...
516

bab90f22   Elena.Budnik   format + #5668
517
		this.panelImage.setSrc(this.getImageUrl(configResult.folder, configResult.plotFile));
8c88a270   Erdogan Furkan   10312 - Navigatio...
518

bab90f22   Elena.Budnik   format + #5668
519
520
		var size = this.getImageSize();
		this.panelImage.setSize(size.width, size.height);
8c88a270   Erdogan Furkan   10312 - Navigatio...
521

bab90f22   Elena.Budnik   format + #5668
522
523
		this.panelImage.refreshMe();
	},
8c88a270   Erdogan Furkan   10312 - Navigatio...
524
525

	updateTimeTableInfo: function () {
bab90f22   Elena.Budnik   format + #5668
526
527
		if (!this.navToolBar)
			return;
8c88a270   Erdogan Furkan   10312 - Navigatio...
528
529

		var ttNameField = this.navToolBar.items.get('tt-table-' + this.interactiveId);
bab90f22   Elena.Budnik   format + #5668
530
531
		if (ttNameField)
			ttNameField.setValue(this.crtContext.page.ttName);
8c88a270   Erdogan Furkan   10312 - Navigatio...
532
533

		var ttNumberField = this.navToolBar.items.get('tt-number-' + this.interactiveId);
bab90f22   Elena.Budnik   format + #5668
534
535
		if (ttNumberField)
			ttNumberField.setValue(this.crtContext.page.ttIndex + 1);
8c88a270   Erdogan Furkan   10312 - Navigatio...
536
537

		var ttTotalField = this.navToolBar.items.get('tt-total-' + this.interactiveId);
bab90f22   Elena.Budnik   format + #5668
538
539
540
		if (ttTotalField)
			ttTotalField.setValue(this.crtContext.page.ttNbIntervals);
	},
8c88a270   Erdogan Furkan   10312 - Navigatio...
541

bd8d75af   Menouard AZIB   Disable paramter ...
542
	callInteractivePlot: function (obj, postProcess = () => null) {
bab90f22   Elena.Budnik   format + #5668
543
		loadMask.show(true);
8c88a270   Erdogan Furkan   10312 - Navigatio...
544

bab90f22   Elena.Budnik   format + #5668
545
		var plotModule = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.plot.id);
27a055f4   Benjamin Renard   Multiplot (#8314)
546
		obj['multiplot'] = this.multiplot;
8c88a270   Erdogan Furkan   10312 - Navigatio...
547

b0a1c31b   Benjamin Renard   Remove multi-plot...
548
		AmdaAction.interactivePlot(obj, function (result, e) {
bab90f22   Elena.Budnik   format + #5668
549
550
			loadMask.hide();
			var t = e.getTransaction();
8c88a270   Erdogan Furkan   10312 - Navigatio...
551
552
			if (e.status) {
				if (result) {
8c88a270   Erdogan Furkan   10312 - Navigatio...
553
					if (result.success) {
a0db7984   Erdogan Furkan   #10663 - Done
554
						plotModule.updateInteractiveSession(result, false, obj['panelId'], obj['time']);
9f08f4eb   Benjamin Renard   Zoom in interacti...
555
556
					}
					else
8c88a270   Erdogan Furkan   10312 - Navigatio...
557
						myDesktopApp.errorMsg('Interactive action error - ' + result.message);
9f08f4eb   Benjamin Renard   Zoom in interacti...
558
559
560
561
				}
				else
					myDesktopApp.errorMsg('Cannot execute interactive action');
			}
8c88a270   Erdogan Furkan   10312 - Navigatio...
562
			else {
9f08f4eb   Benjamin Renard   Zoom in interacti...
563
				// FAILURE
8c88a270   Erdogan Furkan   10312 - Navigatio...
564
565
566
				myDesktopApp.errorMsg('Error System - ' + e.message);
			}
		}, this);
bab90f22   Elena.Budnik   format + #5668
567
	},
8c88a270   Erdogan Furkan   10312 - Navigatio...
568
569

	updateNavToolBar: function (isTimeTable, isSuperposeMode) {
bab90f22   Elena.Budnik   format + #5668
570
571
		if (this.navToolBar)
			this.navToolBar.removeAll(true);
8c88a270   Erdogan Furkan   10312 - Navigatio...
572

bab90f22   Elena.Budnik   format + #5668
573
		var commonItemsCfg = [
8c88a270   Erdogan Furkan   10312 - Navigatio...
574
575
576
577
578
579
			'-',
			{
				xtype: 'tbspacer',
				width: 20
			},
			'->',
bab90f22   Elena.Budnik   format + #5668
580
			{
8c88a270   Erdogan Furkan   10312 - Navigatio...
581
				text: 'Get HST Data',
bab90f22   Elena.Budnik   format + #5668
582
				scope: this,
8c88a270   Erdogan Furkan   10312 - Navigatio...
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
				menu: [
					{
						text: 'Giant Planet Auroral Emissions',
						scope: this,
						handler: function () {
							var me = this;
							myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.astro.id, true, function (module) {
								var startTime = new Date(me.crtContext.page.startTime * 1000);
								startTime = Ext.Date.add(startTime, Ext.Date.MINUTE, startTime.getTimezoneOffset());

								var stopTime = new Date(me.crtContext.page.stopTime * 1000);
								stopTime = Ext.Date.add(stopTime, Ext.Date.MINUTE, stopTime.getTimezoneOffset());

								module.createWindow(startTime, stopTime);
							});
						}
					}]
			}];

		if (isTimeTable) {
bab90f22   Elena.Budnik   format + #5668
603
604
605
			var navigationItemsCfg = [{
				text: 'Previous',
				scope: this,
8c88a270   Erdogan Furkan   10312 - Navigatio...
606
				handler: function () {
bab90f22   Elena.Budnik   format + #5668
607
608
					var ttFileIndex = this.crtTTFileIndex;
					var ttintervalIndex = this.crtContext.page.ttIndex;
8c88a270   Erdogan Furkan   10312 - Navigatio...
609
610
611

					if (ttintervalIndex <= 0 && ttFileIndex > 0) {
						--ttFileIndex;
bab90f22   Elena.Budnik   format + #5668
612
613
614
					}
					else
						--ttintervalIndex;
8c88a270   Erdogan Furkan   10312 - Navigatio...
615
616
					this.callInteractivePlot({ 'action': 'goto', 'interactiveId': this.interactiveId, 'ttFileIndex': ttFileIndex, 'intIndex': ttintervalIndex });
				}
bab90f22   Elena.Budnik   format + #5668
617
			},
8c88a270   Erdogan Furkan   10312 - Navigatio...
618
				'-',
bab90f22   Elena.Budnik   format + #5668
619
620
621
			{
				text: 'Next',
				scope: this,
8c88a270   Erdogan Furkan   10312 - Navigatio...
622
				handler: function () {
bab90f22   Elena.Budnik   format + #5668
623
624
					var ttFileIndex = this.crtTTFileIndex;
					var ttintervalIndex = this.crtContext.page.ttIndex;
8c88a270   Erdogan Furkan   10312 - Navigatio...
625
626
627

					if (ttintervalIndex >= this.crtContext.page.ttNbIntervals - 1) {

bab90f22   Elena.Budnik   format + #5668
628
629
630
631
632
633
						++ttFileIndex;
						ttintervalIndex = 0;
					}
					else
						++ttintervalIndex;

8c88a270   Erdogan Furkan   10312 - Navigatio...
634
					this.callInteractivePlot({ 'action': 'goto', 'interactiveId': this.interactiveId, 'ttFileIndex': ttFileIndex, 'intIndex': ttintervalIndex });
bab90f22   Elena.Budnik   format + #5668
635
636
				}
			},
535d7638   Menouard AZIB   I have added a co...
637
				'-',
8c88a270   Erdogan Furkan   10312 - Navigatio...
638
			{
46bd4591   Hacene SI HADJ MOHAND   us ok
639
640
				text: 'Use This Time Inteval',
				scope: this,
535d7638   Menouard AZIB   I have added a co...
641
642
643
644
645
646
647
				handler: function () {
					var timeObj = new Object();
					var startTime = new Date(this.crtContext.page.startTime * 1000);
					timeObj.start = Ext.Date.add(startTime, Ext.Date.MINUTE, startTime.getTimezoneOffset());

					var stopTime = new Date(this.crtContext.page.stopTime * 1000);
					timeObj.stop = Ext.Date.add(stopTime, Ext.Date.MINUTE, stopTime.getTimezoneOffset());
46bd4591   Hacene SI HADJ MOHAND   us ok
648
649

					var plotModule = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.plot.id);
535d7638   Menouard AZIB   I have added a co...
650
					plotModule.setTimeInterval(timeObj);
46bd4591   Hacene SI HADJ MOHAND   us ok
651
652
				}
			},
535d7638   Menouard AZIB   I have added a co...
653
654
655
				'-',
			{
				text: 'Go to Interval #',
bab90f22   Elena.Budnik   format + #5668
656
				scope: this,
8c88a270   Erdogan Furkan   10312 - Navigatio...
657
658
				handler: function (bt) {
					var ttGotoNumberField = this.navToolBar.items.get('tt-goto-number-' + this.interactiveId);
bab90f22   Elena.Budnik   format + #5668
659
660
661
662
					var goToIndex = ttGotoNumberField.getValue() - 1;
					if ((goToIndex < 0) || (goToIndex >= this.crtContext.page.ttNbIntervals))
						myDesktopApp.errorMsg('This interval number is outside of the current timeTable');
					else
8c88a270   Erdogan Furkan   10312 - Navigatio...
663
						this.callInteractivePlot({ 'action': 'goto', 'interactiveId': this.interactiveId, 'ttFileIndex': this.crtTTFileIndex, 'intIndex': goToIndex });
bab90f22   Elena.Budnik   format + #5668
664
665
666
667
				}
			},
			{
				xtype: 'numberfield',
8c88a270   Erdogan Furkan   10312 - Navigatio...
668
669
670
				id: 'tt-goto-number-' + this.interactiveId,
				hideTrigger: true,
				width: 50,
bab90f22   Elena.Budnik   format + #5668
671
672
				minValue: 1
			},
8c88a270   Erdogan Furkan   10312 - Navigatio...
673
674
675
676
				' ',
				' ',
				' ',
			{
bab90f22   Elena.Budnik   format + #5668
677
				xtype: 'textfield',
8c88a270   Erdogan Furkan   10312 - Navigatio...
678
				id: 'tt-table-' + this.interactiveId,
bab90f22   Elena.Budnik   format + #5668
679
680
681
682
				labelAlign: 'right',
				labelWidth: 30,
				fieldLabel: 'Table',
				width: 130,
8c88a270   Erdogan Furkan   10312 - Navigatio...
683
				disabled: true
bab90f22   Elena.Budnik   format + #5668
684
			},
8c88a270   Erdogan Furkan   10312 - Navigatio...
685
			{
bab90f22   Elena.Budnik   format + #5668
686
				xtype: 'textfield',
8c88a270   Erdogan Furkan   10312 - Navigatio...
687
				id: 'tt-number-' + this.interactiveId,
bab90f22   Elena.Budnik   format + #5668
688
689
690
691
				labelAlign: 'right',
				labelWidth: 30,
				fieldLabel: 'Int #',
				width: 90,
8c88a270   Erdogan Furkan   10312 - Navigatio...
692
				disabled: true
bab90f22   Elena.Budnik   format + #5668
693
			},
8c88a270   Erdogan Furkan   10312 - Navigatio...
694
695
696
			{
				xtype: 'textfield',
				id: 'tt-total-' + this.interactiveId,
bab90f22   Elena.Budnik   format + #5668
697
698
699
700
				labelAlign: 'right',
				labelWidth: 30,
				fieldLabel: 'Total',
				width: 90,
8c88a270   Erdogan Furkan   10312 - Navigatio...
701
				disabled: true
bab90f22   Elena.Budnik   format + #5668
702
703
			}];
		}
8c88a270   Erdogan Furkan   10312 - Navigatio...
704
		else {
bab90f22   Elena.Budnik   format + #5668
705
			var navigationItemsCfg = [
8c88a270   Erdogan Furkan   10312 - Navigatio...
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
				{
					text: 'Backward',
					scope: this,
					handler: function () {
						this.callInteractivePlot({ 'action': 'backward', 'interactiveId': this.interactiveId });
					}
				},
				'-',
				{
					text: '1/2 Backward',
					scope: this,
					handler: function () {
						this.callInteractivePlot({ 'action': 'halfbackward', 'interactiveId': this.interactiveId });
					}
				},
				'-',
				{
					text: '1/4 Backward',
					scope: this,
					handler: function () {
						this.callInteractivePlot({ 'action': 'quarterbackward', 'interactiveId': this.interactiveId });
					}
				},
				'-',
				{
					text: '1/4 Forward',
					scope: this,
					handler: function () {
						this.callInteractivePlot({ 'action': 'quarterforward', 'interactiveId': this.interactiveId });
					}
				},
				'-',
				{
					text: '1/2 Forward',
					scope: this,
					handler: function () {
						this.callInteractivePlot({ 'action': 'halfforward', 'interactiveId': this.interactiveId });
					}
				},
				'-',
				{
					text: 'Forward',
					scope: this,
					handler: function () {
						this.callInteractivePlot({ 'action': 'forward', 'interactiveId': this.interactiveId });
					}
				}];
bab90f22   Elena.Budnik   format + #5668
753
754
755
		}

		var toolItemsCfg = navigationItemsCfg;
8c88a270   Erdogan Furkan   10312 - Navigatio...
756
		Ext.each(commonItemsCfg, function (item) {
bab90f22   Elena.Budnik   format + #5668
757
758
			toolItemsCfg.push(item);
		});
8c88a270   Erdogan Furkan   10312 - Navigatio...
759
760

		if (!this.navToolBar) {
bab90f22   Elena.Budnik   format + #5668
761
762
			var toolConfig = {
				dock: 'top',
8c88a270   Erdogan Furkan   10312 - Navigatio...
763
				items: toolItemsCfg
bab90f22   Elena.Budnik   format + #5668
764
765
			};

8c88a270   Erdogan Furkan   10312 - Navigatio...
766
			this.navToolBar = Ext.create('Ext.toolbar.Toolbar', toolConfig);
bab90f22   Elena.Budnik   format + #5668
767
768
769
770
771
772
773
774
		}
		else
			this.navToolBar.add(toolItemsCfg);

		this.navToolBar.setDisabled(isSuperposeMode);

		this.isTTNavBar = isTimeTable;
		this.isSuperposeMode = isSuperposeMode;
8c88a270   Erdogan Furkan   10312 - Navigatio...
775
776
777
	},

	init: function (configResult) {
bab90f22   Elena.Budnik   format + #5668
778
		this.crtContext = configResult.context;
bd8d75af   Menouard AZIB   Disable paramter ...
779
		this.configResult = configResult;
b39c9d1d   Benjamin Renard   Fix interactive n...
780
		this.interactiveId = configResult.interactiveId;
27a055f4   Benjamin Renard   Multiplot (#8314)
781
		this.multiplot = (configResult.multiplot == true);
bab90f22   Elena.Budnik   format + #5668
782
783
784

		this.coordinatesField = new Ext.toolbar.TextItem({
			width: 300,
8c88a270   Erdogan Furkan   10312 - Navigatio...
785
			text: ''
bab90f22   Elena.Budnik   format + #5668
786
787
788
		});

		this.sliderPage = new Ext.slider.Single({
8c88a270   Erdogan Furkan   10312 - Navigatio...
789
790
791
792
793
794
795
796
797
798
			width: 130,
			value: 75,
			increment: 5,
			minValue: 50,
			maxValue: 100,
			fieldLabel: 'Resize',
			labelWidth: 40,
			listeners: {
				scope: this,
				changecomplete: function (s, v) {
6e1e1bf4   Benjamin Renard   Fix some bugs wit...
799
					var zoomPlugin = this.getPlugin('plot-zoom-plugin-id-'+this.interactiveId);
8c88a270   Erdogan Furkan   10312 - Navigatio...
800
801
802
					zoomPlugin.close();
					var size = this.getImageSize();
					this.panelImage.width = size.width;
bab90f22   Elena.Budnik   format + #5668
803
804
					this.panelImage.height = size.height;
					this.panelImage.doComponentLayout();
8c88a270   Erdogan Furkan   10312 - Navigatio...
805
					this.fireEvent('pagesize', this, v);
bab90f22   Elena.Budnik   format + #5668
806
				}
8c88a270   Erdogan Furkan   10312 - Navigatio...
807
808
809
			}
		});

bab90f22   Elena.Budnik   format + #5668
810
811
812
813
		var mouseToolbar = {
			xtype: 'toolbar',
			height: 25,
			dock: 'bottom',
8c88a270   Erdogan Furkan   10312 - Navigatio...
814
			items: [
bab90f22   Elena.Budnik   format + #5668
815
816
817
818
819
				this.coordinatesField,
				'->',
				this.sliderPage
			]
		};
8c88a270   Erdogan Furkan   10312 - Navigatio...
820

bab90f22   Elena.Budnik   format + #5668
821
822
823
824
825
826
827
828
829
830
		this.contextualMenu = Ext.create('Ext.menu.Menu', {
			width: 200,
			plain: true,
			items: []
		});

		this.updateNavToolBar(!configResult.isInterval, this.crtContext.page.superposeMode);

		this.updateTimeTableInfo();

bab90f22   Elena.Budnik   format + #5668
831
		var plotResultTabPanelConfig = {
8c88a270   Erdogan Furkan   10312 - Navigatio...
832
833
834
			preventHeader: true,
			autoScroll: true,
			items: [this.createPlotImage(configResult.folder, configResult.plotFile)],
bab90f22   Elena.Budnik   format + #5668
835
836
			dockedItems: [this.navToolBar, mouseToolbar],
			plugins: [
8c88a270   Erdogan Furkan   10312 - Navigatio...
837
838
				{
					ptype: 'plotZoomPlugin',
6e1e1bf4   Benjamin Renard   Fix some bugs wit...
839
					pluginId: 'plot-zoom-plugin-id-' + this.interactiveId
8c88a270   Erdogan Furkan   10312 - Navigatio...
840
841
842
				},
				{
					ptype: 'plotExtendShiftPlugin',
6e1e1bf4   Benjamin Renard   Fix some bugs wit...
843
					pluginId: 'plot-extendshift-plugin-id-' + this.interactiveId
8c88a270   Erdogan Furkan   10312 - Navigatio...
844
				}],
bab90f22   Elena.Budnik   format + #5668
845
			listeners: {
8c88a270   Erdogan Furkan   10312 - Navigatio...
846
847
				scope: this,
				destroy: function () {
6e1e1bf4   Benjamin Renard   Fix some bugs wit...
848
					var zoomPlugin = this.getPlugin('plot-zoom-plugin-id-'+this.interactiveId);
bab90f22   Elena.Budnik   format + #5668
849
850
					if (zoomPlugin)
						zoomPlugin.close();
6e1e1bf4   Benjamin Renard   Fix some bugs wit...
851
					var exttendShiftPlugin = this.getPlugin('plot-extendshift-plugin-id-'+this.interactiveId);
bab90f22   Elena.Budnik   format + #5668
852
853
					if (exttendShiftPlugin)
						exttendShiftPlugin.close();
bab90f22   Elena.Budnik   format + #5668
854
855
856
				}
			}
		};
8c88a270   Erdogan Furkan   10312 - Navigatio...
857
858

		Ext.apply(this, plotResultTabPanelConfig);
bab90f22   Elena.Budnik   format + #5668
859
860
	}
});