Commit 9e70b8ef5767dfde899cfd05f4534db82df3074f

Authored by Menouar AZIB
2 parents ded8189b 86615884

Merge background subtraction dans develop

js/app/models/PlotObjects/PlotObjectConfig.js
@@ -11,488 +11,514 @@ @@ -11,488 +11,514 @@
11 ****************************************************************************** 11 ******************************************************************************
12 * : :21/07/2015: BRE - file creation 12 * : :21/07/2015: BRE - file creation
13 */ 13 */
14 -  
15 - 14 +
  15 +
16 Ext.define('amdaPlotObj.PlotObjectConfig', { 16 Ext.define('amdaPlotObj.PlotObjectConfig', {
17 singleton: true, 17 singleton: true,
18 -  
19 - defaultValues : {  
20 - file : {  
21 - format : 'PNG',  
22 - output : 'INTERACTIVE', 18 +
  19 + defaultValues: {
  20 + file: {
  21 + format: 'PNG',
  22 + output: 'INTERACTIVE',
23 oneFilePerInterval: false 23 oneFilePerInterval: false
24 }, 24 },
25 - tree : {  
26 - fullView : false 25 + tree: {
  26 + fullView: false
27 }, 27 },
28 - page : {  
29 - xMargin : 5.,  
30 - yMargin : 5.,  
31 - mode : 'color', 28 + page: {
  29 + xMargin: 5.,
  30 + yMargin: 5.,
  31 + mode: 'color',
32 orientation: 'landscape', 32 orientation: 'landscape',
33 - dimension : 'ISO A4',  
34 - title : { 33 + dimension: 'ISO A4',
  34 + title: {
35 position: 'top', 35 position: 'top',
36 alignment: ' center', 36 alignment: ' center',
37 color: '#000000' 37 color: '#000000'
38 }, 38 },
39 - font : {  
40 - name : 'sans-serif', 39 + font: {
  40 + name: 'sans-serif',
41 size: '8' 41 size: '8'
42 }, 42 },
43 - layout : {  
44 - type : 'vertical',  
45 - panelHeight : 0.5,  
46 - panelSpacing : 0.,  
47 - expand : false,  
48 - timeAxesLegend : true 43 + layout: {
  44 + type: 'vertical',
  45 + panelHeight: 0.5,
  46 + panelSpacing: 0.,
  47 + expand: false,
  48 + timeAxesLegend: true
49 } 49 }
50 }, 50 },
51 - panel : {  
52 - plotType : 'timePlot',  
53 - isotropic : false,  
54 - title : { 51 + panel: {
  52 + plotType: 'timePlot',
  53 + isotropic: false,
  54 + title: {
55 position: 'top', 55 position: 'top',
56 alignment: ' center', 56 alignment: ' center',
57 color: '#000000' 57 color: '#000000'
58 }, 58 },
59 - font : {  
60 - name : 'sans-serif', 59 + font: {
  60 + name: 'sans-serif',
61 size: '8' 61 size: '8'
62 }, 62 },
63 - backgroundColor : 'none',  
64 - status : {  
65 - position : 'top',  
66 - colorMap : 0 63 + backgroundColor: 'none',
  64 + status: {
  65 + position: 'top',
  66 + colorMap: 0
67 } 67 }
68 }, 68 },
69 - axis : {  
70 - scale : 'linear',  
71 - tickPosition : 'outwards',  
72 - color : '#000000',  
73 - thickness : '1',  
74 - legend : { 69 + axis: {
  70 + scale: 'linear',
  71 + tickPosition: 'outwards',
  72 + color: '#000000',
  73 + thickness: '1',
  74 + legend: {
75 color: '#000000', 75 color: '#000000',
76 - font : {  
77 - name : 'sans-serif', 76 + font: {
  77 + name: 'sans-serif',
78 size: '8' 78 size: '8'
79 } 79 }
80 }, 80 },
81 - timeFormat : 'dd/mm/yy',  
82 - colorMap : '1' 81 + timeFormat: 'dd/mm/yy',
  82 + colorMap: '1'
83 }, 83 },
84 - serie : {  
85 - yAxis : 'y-left',  
86 - resolution : 3000,  
87 - lines : {  
88 - style : 'plain',  
89 - width : 1,  
90 - color : 'auto' 84 + serie: {
  85 + yAxis: 'y-left',
  86 + resolution: 3000,
  87 + lines: {
  88 + style: 'plain',
  89 + width: 1,
  90 + color: 'auto'
91 }, 91 },
92 - symbols : {  
93 - type : 'dot',  
94 - size : 3,  
95 - color : 'auto' 92 + symbols: {
  93 + type: 'dot',
  94 + size: 3,
  95 + color: 'auto'
96 }, 96 },
97 - resamplingMode : 'xparam',  
98 - timetick : { 97 + resamplingMode: 'xparam',
  98 + timetick: {
99 type: 'auto', 99 type: 'auto',
100 step: 3600, 100 step: 3600,
101 - nbmajor : 5,  
102 - nbminor : 5,  
103 - color : '#FF0000',  
104 - symbols : { 101 + nbmajor: 5,
  102 + nbminor: 5,
  103 + color: '#FF0000',
  104 + symbols: {
105 type: 'full-circle', 105 type: 'full-circle',
106 size: 10, 106 size: 10,
107 color: '#FF0000' 107 color: '#FF0000'
108 }, 108 },
109 - firstsymbols : { 109 + firstsymbols: {
110 type: 'triangle', 110 type: 'triangle',
111 size: 4, 111 size: 4,
112 color: '#00FF00' 112 color: '#00FF00'
113 }, 113 },
114 - font : {  
115 - name : 'sans-serif', 114 + font: {
  115 + name: 'sans-serif',
116 size: '8' 116 size: '8'
117 } 117 }
118 }, 118 },
119 - intervaltick : { 119 + intervaltick: {
120 mode: 'start-time', 120 mode: 'start-time',
121 - color : '#FF0000',  
122 - symbols : { 121 + color: '#FF0000',
  122 + symbols: {
123 type: 'full-circle', 123 type: 'full-circle',
124 size: 10, 124 size: 10,
125 color: '#FF0000' 125 color: '#FF0000'
126 }, 126 },
127 - font : {  
128 - name : 'sans-serif', 127 + font: {
  128 + name: 'sans-serif',
129 size: '8' 129 size: '8'
130 } 130 }
131 }, 131 },
132 - errorbar : { 132 + errorbar: {
133 type: 'min-max', 133 type: 'min-max',
134 - lines : {  
135 - style : 'plain',  
136 - width : 1,  
137 - color : 'auto' 134 + lines: {
  135 + style: 'plain',
  136 + width: 1,
  137 + color: 'auto'
138 } 138 }
139 }, 139 },
140 - projection : 'XY',  
141 - 140 + projection: 'XY',
  141 +
142 }, 142 },
143 - spectro : {  
144 - yAxis : 'y-left',  
145 - resolution : 3000 143 + spectro: {
  144 + yAxis: 'y-left',
  145 + resolution: 3000
146 }, 146 },
147 - legends : {  
148 - series : {  
149 - type : 'text-only',  
150 - position : 'outside', 147 + legends: {
  148 + series: {
  149 + type: 'text-only',
  150 + position: 'outside',
151 text: { 151 text: {
152 - color : '#000000' 152 + color: '#000000'
153 }, 153 },
154 border: { 154 border: {
155 - color : '#000000' 155 + color: '#000000'
156 }, 156 },
157 - intervalinfo : {  
158 - type : 'start-stop' 157 + intervalinfo: {
  158 + type: 'start-stop'
159 }, 159 },
160 - font : {  
161 - name : 'sans-serif', 160 + font: {
  161 + name: 'sans-serif',
162 size: '8' 162 size: '8'
163 } 163 }
164 }, 164 },
165 - text : {  
166 - position : 'left',  
167 - color : '#000000',  
168 - font : {  
169 - name : 'sans-serif', 165 + text: {
  166 + position: 'left',
  167 + color: '#000000',
  168 + font: {
  169 + name: 'sans-serif',
170 size: '8' 170 size: '8'
171 } 171 }
172 } 172 }
173 }, 173 },
174 - constants : {  
175 - axisId : 'y-left',  
176 - line : {  
177 - style : 'plain',  
178 - width : 1,  
179 - color : '#000000' 174 + constants: {
  175 + axisId: 'y-left',
  176 + line: {
  177 + style: 'plain',
  178 + width: 1,
  179 + color: '#000000'
180 } 180 }
181 }, 181 },
182 - textObjs : {  
183 - yAxisId : 'y-left',  
184 - xRelative : true,  
185 - yRelative : true,  
186 - align : 'left',  
187 - color : '#000000',  
188 - font : {  
189 - name : 'sans-serif', 182 + textObjs: {
  183 + yAxisId: 'y-left',
  184 + xRelative: true,
  185 + yRelative: true,
  186 + align: 'left',
  187 + color: '#000000',
  188 + font: {
  189 + name: 'sans-serif',
190 size: '8' 190 size: '8'
191 } 191 }
192 }, 192 },
193 - curves : {  
194 - line : {  
195 - style : 'plain',  
196 - width : 1,  
197 - color : '#000000' 193 + curves: {
  194 + line: {
  195 + style: 'plain',
  196 + width: 1,
  197 + color: '#000000'
198 } 198 }
199 }, 199 },
200 - fills : {  
201 - type : 'serie-constant',  
202 - greaterColor : 'none',  
203 - lessColor : 'none' 200 + fills: {
  201 + type: 'serie-constant',
  202 + greaterColor: 'none',
  203 + lessColor: 'none'
204 }, 204 },
205 - filtering:{  
206 - level:1  
207 - } 205 + filtering: {
  206 + level: 1
  207 + }
208 }, 208 },
209 -  
210 - getValueByKey : function(dataList, key)  
211 - { 209 +
  210 + getValueByKey: function (dataList, key) {
212 var value = ''; 211 var value = '';
213 Ext.each(dataList, function (data) { 212 Ext.each(dataList, function (data) {
214 - if (data.key == key)  
215 - { 213 + if (data.key == key) {
216 value = data.value; 214 value = data.value;
217 return; 215 return;
218 } 216 }
219 }); 217 });
220 return value; 218 return value;
221 }, 219 },
222 -  
223 - availableFileFormats : [  
224 - {'key' : 'PNG', 'value' : 'PNG'},  
225 - {'key' : 'PDF', 'value' : 'PDF'},  
226 - {'key' : 'PS', 'value' : 'PS'},  
227 - {'key' : 'SVG', 'value' : 'SVG'}  
228 - ],  
229 -  
230 - availableFileOutputsForPng : [  
231 - {'key' : 'INTERACTIVE', 'value' : 'screen'},  
232 - {'key' : 'TGZ', 'value' : 'tar+gzip archive'},  
233 - {'key' : 'ZIP', 'value' : 'zip archive'}  
234 - ],  
235 -  
236 - availableFileOutputsForOtherFormats : [  
237 - {'key' : 'TGZ', 'value' : 'tar+gzip archive'},  
238 - {'key' : 'ZIP', 'value' : 'zip archive'}  
239 - ],  
240 -  
241 - availablePageModes : [  
242 - {'key' : 'color', 'value' : 'Color'},  
243 - {'key' : 'grayscale', 'value' : 'Grayscale'}  
244 - ],  
245 -  
246 - availablePageOrientations : [  
247 - {'key' : 'landscape', 'value' : 'Landscape'},  
248 - {'key' : 'portrait', 'value' : 'Portrait'}  
249 - ],  
250 -  
251 - availablePageDimensions : [  
252 - {'key' : 'ISO A4', 'value' : 'ISO A4'},  
253 - {'key' : 'US letter', 'value' : 'US letter'}  
254 - ],  
255 -  
256 - availablePlotTypes : [  
257 - {'key' : 'timePlot', value : 'Time Plot'},  
258 - {'key' : 'xyPlot', value : 'Scatter Plot'},  
259 - {'key' : 'epochPlot', value : 'Epoch Plot'},  
260 - {'key' : 'instantPlot', value : 'Instant Plot'},  
261 - {'key' : 'statusPlot', value : 'Status Plot'},  
262 - {'key' : 'tickPlot', value : 'Tick Plot'}  
263 - ],  
264 -  
265 - availableFontNames : [  
266 - {'key' : 'sans-serif', 'value' : 'sans-serif'},  
267 - {'key' : 'serif', 'value' : 'serif'},  
268 - {'key' : 'monospace', 'value' : 'monospace'},  
269 - {'key' : 'script', 'value' : 'script'}  
270 - ],  
271 -  
272 - availableTitlePositions : [  
273 - {'key' : 'top', 'value' : 'Top'},  
274 - {'key' : 'bottom', 'value' : 'Bottom'}  
275 - ],  
276 -  
277 - availableTitleAlignments : [  
278 - {'key' : 'center', 'value' : 'Center'},  
279 - {'key' : 'left', 'value' : 'Left'},  
280 - {'key' : 'right', 'value' : 'Right'}  
281 - ],  
282 -  
283 - availableAxisScales : [  
284 - {'key' : 'linear', 'value' : 'Linear'},  
285 - {'key' : 'logarithmic', 'value' : 'Logarithmic'}  
286 - ],  
287 -  
288 - availableTicksPositions : [  
289 - {'key' : 'inwards', 'value' : 'Inwards'},  
290 - {'key' : 'outwards', 'value' : 'Outwards'}  
291 - ],  
292 -  
293 - availableTimeAxisFormats : [  
294 - {'key' : 'dd/mm/yy', 'value' : 'dd/mm/yy'},  
295 - {'key' : 'ddd/yy', 'value' : 'ddd/yy'},  
296 - {'key' : 'DD/MM/YYYY', 'value' : 'dd/mm/yyyy'},  
297 - {'key' : 'yyyy/dd/mm', 'value' : 'yyyy/dd/mm'},  
298 - {'key' : 'yyyy-dd-mm', 'value' : 'yyyy-dd-mm'}  
299 - ],  
300 -  
301 - availableYAxes : [  
302 - {'key' : 'y-left', 'value' : 'Left'},  
303 - {'key' : 'y-right', 'value' : 'Right'}  
304 - ],  
305 -  
306 - availableResolutions : [  
307 - {'key' : 3000, 'value' : '3000'},  
308 - {'key' : 10000, 'value' : '10000'},  
309 - {'key' : 50000, 'value' : '50000'},  
310 - {'key' : 100000, 'value' : '100000'}  
311 - ],  
312 -  
313 - availableLinesStyles : [  
314 - {'key' : 'plain', 'value' : 'Plain'},  
315 - {'key' : 'dot', 'value' : 'Dot'},  
316 - {'key' : 'long-spaced-dot', 'value' : 'Long spaced dot'},  
317 - {'key' : 'long-short-dot', 'value' : 'Long short dot'}  
318 - ],  
319 -  
320 - availableSymbolsTypes : [  
321 - {'key' : 'dot', 'value' : 'Dot'},  
322 - {'key' : 'plus', 'value' : 'Plus'},  
323 - {'key' : 'wildcard', 'value' : 'Wildcard'},  
324 - {'key' : 'circle', 'value' : 'Circle'},  
325 - {'key' : 'crux', 'value' : 'Crux'},  
326 - {'key' : 'square', 'value' : 'Square'},  
327 - {'key' : 'triangle', 'value' : 'Triangle'},  
328 - {'key' : 'crux-in-circle', 'value' : 'Crux in circle'},  
329 - {'key' : 'dot-in-circle', 'value' : 'Dot in circle'},  
330 - {'key' : 'diamond', 'value' : 'Diamond'},  
331 - {'key' : 'star', 'value' : 'Star'},  
332 - {'key' : 'david-star', 'value' : 'David star'},  
333 - {'key' : 'full-square', 'value' : 'Full square'},  
334 - {'key' : 'full-circle', 'value' : 'Full circle'},  
335 - {'key' : 'full-star', 'value' : 'Full star'}  
336 - ],  
337 -  
338 - availableColorMaps : [  
339 - {'key' : '0', 'value' : 'Blue Red'},  
340 - {'key' : '1', 'value' : 'Default'},  
341 - {'key' : '2', 'value' : 'Blue Yellow'},  
342 - {'key' : '3', 'value' : 'Grayscale'},  
343 - {'key' : '4', 'value' : 'AMDA Default'},  
344 - {'key' : '5', 'value' : 'GeoWhite'},  
345 - {'key' : '6', 'value' : 'GeoBlack'},  
346 - {'key' : '7', 'value' : 'Violet Yellow'},  
347 - {'key' : '8', 'value' : 'Red Blue 4'}  
348 - ],  
349 -  
350 - availableColors : [  
351 - {'key' : 'auto', 'color' : 'auto', 'value' : 'auto'},  
352 - {'key' : '[0,0,0]', 'color' : '#000000', 'value' : 'Black'},  
353 - {'key' : '[0,0,255]', 'color' : '#0000ff', 'value' : 'Blue'},  
354 - {'key' : '[255,0,0]', 'color' : '#ff0000', 'value' : 'Red'},  
355 - {'key' : '[0,255,255]', 'color' : '#00ffff', 'value' : 'Cyan'},  
356 - {'key' : '[255,0,255]', 'color' : '#ff00ff', 'value' : 'Magenta'},  
357 - {'key' : '[0,128,0]', 'color' : '#008000', 'value' : 'Green'},  
358 - {'key' : '[128,128,128]', 'color' : '#808080', 'value' : 'Gray'},  
359 - {'key' : '[0,255,0]', 'color' : '#00ff00', 'value' : 'Lime'},  
360 - {'key' : '[128,0,0]', 'color' : '#800000', 'value' : 'Maroon'},  
361 - {'key' : '[0,0,128]', 'color' : '#000080', 'value' : 'Navy'},  
362 - {'key' : '[128,128,0]', 'color' : '#808000', 'value' : 'Olive'},  
363 - {'key' : '[128,0,128]', 'color' : '#800080', 'value' : 'Purple'},  
364 - {'key' : '[192,192,192]', 'color' : '#c0c0c0', 'value' : 'Silver'},  
365 - {'key' : '[0,128,128]', 'color' : '#008080', 'value' : 'Teal'},  
366 - {'key' : '[255,255,0]', 'color' : '#ffff00', 'value' : 'Yellow'},  
367 - {'key' : '[0,64,64]', 'color' : '#004040', 'value' : 'Cyprus'}  
368 - ],  
369 -  
370 - availableBackgroundColors : [  
371 - {'color' : 'none', 'value' : 'None'},  
372 - {'key' : '[0,0,0]', 'color' : '#000000', 'value' : 'Black'},  
373 - {'key' : '[0,0,255]', 'color' : '#0000FF', 'value' : 'Blue'},  
374 - {'key' : '[255,0,0]', 'color' : '#FF0000', 'value' : 'Red'},  
375 - {'key' : '[0,255,255]', 'color' : '#00FFFF', 'value' : 'Cyan'},  
376 - {'key' : '[255,0,255]', 'color' : '#FF00FF', 'value' : 'Magenta'},  
377 - {'key' : '[0,128,0]', 'color' : '#008000', 'value' : 'Green'},  
378 - {'key' : '[128,128,128]', 'color' : '#808080', 'value' : 'Gray'},  
379 - {'key' : '[0,255,0]', 'color' : '#00FF00', 'value' : 'Lime'},  
380 - {'key' : '[128,0,0]', 'color' : '#800000', 'value' : 'Maroon'},  
381 - {'key' : '[0,0,128]', 'color' : '#000080', 'value' : 'Navy'},  
382 - {'key' : '[128,128,0]', 'color' : '#808000', 'value' : 'Olive'},  
383 - {'key' : '[128,0,128]', 'color' : '#800080', 'value' : 'Purple'},  
384 - {'key' : '[192,192,192]', 'color' : '#C0C0C0', 'value' : 'Silver'},  
385 - {'key' : '[0,128,128]', 'color' : '#008080', 'value' : 'Teal'},  
386 - {'key' : '[255,255,0]', 'color' : '#FFFF00', 'value' : 'Yellow'},  
387 - {'key' : '[0,64,64]', 'color' : '#004040', 'value' : 'Cyprus'}  
388 - ],  
389 -  
390 - availableStatusBarPositions : [  
391 - {'key' : 'top', 'value' : 'Top'},  
392 - {'key' : 'bottom', 'value' : 'Bottom'}  
393 - ],  
394 -  
395 - availableStatusBarColorMaps : [  
396 - {'key' : '0', 'value' : '0'},  
397 - {'key' : '1', 'value' : '1'},  
398 - {'key' : '2', 'value' : '2'}  
399 - ],  
400 -  
401 - availablePageLayouts : [  
402 - {'key' : 'vertical', 'value' : 'Vertical'},  
403 - {'key' : 'auto', 'value' : 'Auto'},  
404 - {'key' : 'manual', 'value' : 'Manual'}  
405 - ],  
406 -  
407 - availableResamplingModes : [  
408 - {'key' : 'xparam', 'value' : 'X Parameter'},  
409 - {'key' : 'yparam', 'value' : 'Y Parameter'}  
410 - ],  
411 -  
412 - availableOrbitSerieProjections : [  
413 - {'key' : 'XY', 'value' : 'XY'},  
414 - {'key' : 'XZ', 'value' : 'XZ'},  
415 - {'key' : 'YZ', 'value' : 'YZ'},  
416 - {'key' : 'XR', 'value' : 'XR'},  
417 - {'key' : 'YR', 'value' : 'YR'},  
418 - {'key' : 'ZR', 'value' : 'ZR'}  
419 - ],  
420 -  
421 - availableDimsOnXAxis : [  
422 - {'key' : '0', 'value' : 'First dimension'},  
423 - {'key' : '1', 'value' : 'Second dimension'}  
424 - ],  
425 -  
426 - availableTimeTickTypes : [  
427 - {'key' : 'auto', 'value' : 'Auto'},  
428 - {'key' : 'time-step', 'value' : 'Time step'},  
429 - {'key' : 'nb-major', 'value' : 'Num. of major symb.'}  
430 - ],  
431 -  
432 - availableIntervalTickModes : [  
433 - {'key' : 'symbol-only', 'value' : 'Symbol only'},  
434 - {'key' : 'interval-index', 'value' : 'Interval index'},  
435 - {'key' : 'start-time', 'value' : 'Start time'},  
436 - {'key' : 'start-stop-time', 'value' : 'Start/Stop times'}  
437 - ],  
438 -  
439 - availableErrorBarTypes : [  
440 - {'key' : 'min-max', 'value' : 'Min./Max. Parameters'},  
441 - {'key' : 'delta', 'value' : 'Delta parameter'}  
442 - ],  
443 -  
444 - availableLegendSeriesTypes : [  
445 - {'key' : 'text-line-symbol', 'value' : 'Text, Line & Symbols'},  
446 - {'key' : 'text-only', 'value' : 'Text only'}  
447 - ],  
448 -  
449 - availableLegendSeriesPositions : [  
450 - {'key' : 'inside', 'value' : 'Inside'},  
451 - {'key' : 'outside', 'value' : 'Outside'}  
452 - ],  
453 -  
454 - availableLegendSeriesIntervalInfoTypes : [  
455 - {'key' : 'index', 'value' : 'Interval Index'},  
456 - {'key' : 'start-stop', 'value' : 'Interval Start/Stop'}  
457 - ],  
458 -  
459 - availableLegendTextPositions : [  
460 - {'key' : 'right', 'value' : 'Right'},  
461 - {'key' : 'left', 'value' : 'Left'},  
462 - {'key' : 'top', 'value' : 'Top'},  
463 - {'key' : 'bottom', 'value' : 'Bottom'}  
464 - ],  
465 -  
466 - availableConstantAxes : [  
467 - {'key' : 'x', 'value' : 'X / Time / Epoch'},  
468 - {'key' : 'y-left', 'value' : 'Y Left'},  
469 - {'key' : 'y-right', 'value' : 'Y Right'}  
470 - ],  
471 -  
472 - availableTextAlignments : [  
473 - {'key' : 'left', 'value' : 'Left'},  
474 - {'key' : 'center', 'value' : 'Center'},  
475 - {'key' : 'right', 'value' : 'Right'}  
476 - ],  
477 -  
478 - availableFillTypes : [  
479 - {'key' : 'serie-constant', 'value' : 'Serie / Constant'},  
480 - {'key' : 'serie-serie', 'value' : 'Serie / Serie'}  
481 - ],  
482 - availableSpectroNormalization : [  
483 - {'key' : 'none', 'value' : 'None'},  
484 - {'key' : 'linear', 'value' : 'Linear'},  
485 - {'key' : 'log', 'value' : 'Logarithmic'}  
486 - ],  
487 -  
488 - availableFilteringLevel : [  
489 - {'key' : 1, 'value' : 'Weak'},  
490 - {'key' : 2, 'value' : 'Intermediate/moderated'},  
491 - {'key' : 3, 'value' : 'Strong'}  
492 - ],  
493 -  
494 - getParamConfig : function(paramId, onParamConfigLoaded) {  
495 - AmdaAction.getParamPlotInit({"paramId" : paramId}, function (result, e) { 220 +
  221 + availableFileFormats: [
  222 + { 'key': 'PNG', 'value': 'PNG' },
  223 + { 'key': 'PDF', 'value': 'PDF' },
  224 + { 'key': 'PS', 'value': 'PS' },
  225 + { 'key': 'SVG', 'value': 'SVG' }
  226 + ],
  227 +
  228 + availableFileOutputsForPng: [
  229 + { 'key': 'INTERACTIVE', 'value': 'screen' },
  230 + { 'key': 'TGZ', 'value': 'tar+gzip archive' },
  231 + { 'key': 'ZIP', 'value': 'zip archive' }
  232 + ],
  233 +
  234 + availableFileOutputsForOtherFormats: [
  235 + { 'key': 'TGZ', 'value': 'tar+gzip archive' },
  236 + { 'key': 'ZIP', 'value': 'zip archive' }
  237 + ],
  238 +
  239 + availablePageModes: [
  240 + { 'key': 'color', 'value': 'Color' },
  241 + { 'key': 'grayscale', 'value': 'Grayscale' }
  242 + ],
  243 +
  244 + availablePageOrientations: [
  245 + { 'key': 'landscape', 'value': 'Landscape' },
  246 + { 'key': 'portrait', 'value': 'Portrait' }
  247 + ],
  248 +
  249 + availablePageDimensions: [
  250 + { 'key': 'ISO A4', 'value': 'ISO A4' },
  251 + { 'key': 'US letter', 'value': 'US letter' }
  252 + ],
  253 +
  254 + availablePlotTypes: [
  255 + { 'key': 'timePlot', value: 'Time Plot' },
  256 + { 'key': 'xyPlot', value: 'Scatter Plot' },
  257 + { 'key': 'epochPlot', value: 'Epoch Plot' },
  258 + { 'key': 'instantPlot', value: 'Instant Plot' },
  259 + { 'key': 'statusPlot', value: 'Status Plot' },
  260 + { 'key': 'tickPlot', value: 'Tick Plot' }
  261 + ],
  262 +
  263 + availableFontNames: [
  264 + { 'key': 'sans-serif', 'value': 'sans-serif' },
  265 + { 'key': 'serif', 'value': 'serif' },
  266 + { 'key': 'monospace', 'value': 'monospace' },
  267 + { 'key': 'script', 'value': 'script' }
  268 + ],
  269 +
  270 + availableTitlePositions: [
  271 + { 'key': 'top', 'value': 'Top' },
  272 + { 'key': 'bottom', 'value': 'Bottom' }
  273 + ],
  274 +
  275 + availableTitleAlignments: [
  276 + { 'key': 'center', 'value': 'Center' },
  277 + { 'key': 'left', 'value': 'Left' },
  278 + { 'key': 'right', 'value': 'Right' }
  279 + ],
  280 +
  281 + availableAxisScales: [
  282 + { 'key': 'linear', 'value': 'Linear' },
  283 + { 'key': 'logarithmic', 'value': 'Logarithmic' }
  284 + ],
  285 +
  286 + availableTicksPositions: [
  287 + { 'key': 'inwards', 'value': 'Inwards' },
  288 + { 'key': 'outwards', 'value': 'Outwards' }
  289 + ],
  290 +
  291 + availableTimeAxisFormats: [
  292 + { 'key': 'dd/mm/yy', 'value': 'dd/mm/yy' },
  293 + { 'key': 'ddd/yy', 'value': 'ddd/yy' },
  294 + { 'key': 'DD/MM/YYYY', 'value': 'dd/mm/yyyy' },
  295 + { 'key': 'yyyy/dd/mm', 'value': 'yyyy/dd/mm' },
  296 + { 'key': 'yyyy-dd-mm', 'value': 'yyyy-dd-mm' }
  297 + ],
  298 +
  299 + availableYAxes: [
  300 + { 'key': 'y-left', 'value': 'Left' },
  301 + { 'key': 'y-right', 'value': 'Right' }
  302 + ],
  303 +
  304 + availableResolutions: [
  305 + { 'key': 3000, 'value': '3000' },
  306 + { 'key': 10000, 'value': '10000' },
  307 + { 'key': 50000, 'value': '50000' },
  308 + { 'key': 100000, 'value': '100000' }
  309 + ],
  310 +
  311 + availableLinesStyles: [
  312 + { 'key': 'plain', 'value': 'Plain' },
  313 + { 'key': 'dot', 'value': 'Dot' },
  314 + { 'key': 'long-spaced-dot', 'value': 'Long spaced dot' },
  315 + { 'key': 'long-short-dot', 'value': 'Long short dot' }
  316 + ],
  317 +
  318 + availableSymbolsTypes: [
  319 + { 'key': 'dot', 'value': 'Dot' },
  320 + { 'key': 'plus', 'value': 'Plus' },
  321 + { 'key': 'wildcard', 'value': 'Wildcard' },
  322 + { 'key': 'circle', 'value': 'Circle' },
  323 + { 'key': 'crux', 'value': 'Crux' },
  324 + { 'key': 'square', 'value': 'Square' },
  325 + { 'key': 'triangle', 'value': 'Triangle' },
  326 + { 'key': 'crux-in-circle', 'value': 'Crux in circle' },
  327 + { 'key': 'dot-in-circle', 'value': 'Dot in circle' },
  328 + { 'key': 'diamond', 'value': 'Diamond' },
  329 + { 'key': 'star', 'value': 'Star' },
  330 + { 'key': 'david-star', 'value': 'David star' },
  331 + { 'key': 'full-square', 'value': 'Full square' },
  332 + { 'key': 'full-circle', 'value': 'Full circle' },
  333 + { 'key': 'full-star', 'value': 'Full star' }
  334 + ],
  335 +
  336 + availableColorMaps: [
  337 + { 'key': '0', 'value': 'Blue Red' },
  338 + { 'key': '1', 'value': 'Default' },
  339 + { 'key': '2', 'value': 'Blue Yellow' },
  340 + { 'key': '3', 'value': 'Grayscale' },
  341 + { 'key': '4', 'value': 'AMDA Default' },
  342 + { 'key': '5', 'value': 'GeoWhite' },
  343 + { 'key': '6', 'value': 'GeoBlack' },
  344 + { 'key': '7', 'value': 'Violet Yellow' },
  345 + { 'key': '8', 'value': 'Red Blue 4' }
  346 + ],
  347 +
  348 + availableColors: [
  349 + { 'key': 'auto', 'color': 'auto', 'value': 'auto' },
  350 + { 'key': '[0,0,0]', 'color': '#000000', 'value': 'Black' },
  351 + { 'key': '[0,0,255]', 'color': '#0000ff', 'value': 'Blue' },
  352 + { 'key': '[255,0,0]', 'color': '#ff0000', 'value': 'Red' },
  353 + { 'key': '[0,255,255]', 'color': '#00ffff', 'value': 'Cyan' },
  354 + { 'key': '[255,0,255]', 'color': '#ff00ff', 'value': 'Magenta' },
  355 + { 'key': '[0,128,0]', 'color': '#008000', 'value': 'Green' },
  356 + { 'key': '[128,128,128]', 'color': '#808080', 'value': 'Gray' },
  357 + { 'key': '[0,255,0]', 'color': '#00ff00', 'value': 'Lime' },
  358 + { 'key': '[128,0,0]', 'color': '#800000', 'value': 'Maroon' },
  359 + { 'key': '[0,0,128]', 'color': '#000080', 'value': 'Navy' },
  360 + { 'key': '[128,128,0]', 'color': '#808000', 'value': 'Olive' },
  361 + { 'key': '[128,0,128]', 'color': '#800080', 'value': 'Purple' },
  362 + { 'key': '[192,192,192]', 'color': '#c0c0c0', 'value': 'Silver' },
  363 + { 'key': '[0,128,128]', 'color': '#008080', 'value': 'Teal' },
  364 + { 'key': '[255,255,0]', 'color': '#ffff00', 'value': 'Yellow' },
  365 + { 'key': '[0,64,64]', 'color': '#004040', 'value': 'Cyprus' }
  366 + ],
  367 +
  368 + availableBackgroundColors: [
  369 + { 'color': 'none', 'value': 'None' },
  370 + { 'key': '[0,0,0]', 'color': '#000000', 'value': 'Black' },
  371 + { 'key': '[0,0,255]', 'color': '#0000FF', 'value': 'Blue' },
  372 + { 'key': '[255,0,0]', 'color': '#FF0000', 'value': 'Red' },
  373 + { 'key': '[0,255,255]', 'color': '#00FFFF', 'value': 'Cyan' },
  374 + { 'key': '[255,0,255]', 'color': '#FF00FF', 'value': 'Magenta' },
  375 + { 'key': '[0,128,0]', 'color': '#008000', 'value': 'Green' },
  376 + { 'key': '[128,128,128]', 'color': '#808080', 'value': 'Gray' },
  377 + { 'key': '[0,255,0]', 'color': '#00FF00', 'value': 'Lime' },
  378 + { 'key': '[128,0,0]', 'color': '#800000', 'value': 'Maroon' },
  379 + { 'key': '[0,0,128]', 'color': '#000080', 'value': 'Navy' },
  380 + { 'key': '[128,128,0]', 'color': '#808000', 'value': 'Olive' },
  381 + { 'key': '[128,0,128]', 'color': '#800080', 'value': 'Purple' },
  382 + { 'key': '[192,192,192]', 'color': '#C0C0C0', 'value': 'Silver' },
  383 + { 'key': '[0,128,128]', 'color': '#008080', 'value': 'Teal' },
  384 + { 'key': '[255,255,0]', 'color': '#FFFF00', 'value': 'Yellow' },
  385 + { 'key': '[0,64,64]', 'color': '#004040', 'value': 'Cyprus' }
  386 + ],
  387 +
  388 + availableStatusBarPositions: [
  389 + { 'key': 'top', 'value': 'Top' },
  390 + { 'key': 'bottom', 'value': 'Bottom' }
  391 + ],
  392 +
  393 + availableStatusBarColorMaps: [
  394 + { 'key': '0', 'value': '0' },
  395 + { 'key': '1', 'value': '1' },
  396 + { 'key': '2', 'value': '2' }
  397 + ],
  398 +
  399 + availablePageLayouts: [
  400 + { 'key': 'vertical', 'value': 'Vertical' },
  401 + { 'key': 'auto', 'value': 'Auto' },
  402 + { 'key': 'manual', 'value': 'Manual' }
  403 + ],
  404 +
  405 + availableResamplingModes: [
  406 + { 'key': 'xparam', 'value': 'X Parameter' },
  407 + { 'key': 'yparam', 'value': 'Y Parameter' }
  408 + ],
  409 +
  410 + availableOrbitSerieProjections: [
  411 + { 'key': 'XY', 'value': 'XY' },
  412 + { 'key': 'XZ', 'value': 'XZ' },
  413 + { 'key': 'YZ', 'value': 'YZ' },
  414 + { 'key': 'XR', 'value': 'XR' },
  415 + { 'key': 'YR', 'value': 'YR' },
  416 + { 'key': 'ZR', 'value': 'ZR' }
  417 + ],
  418 +
  419 + availableDimsOnXAxis: [
  420 + { 'key': '0', 'value': 'First dimension' },
  421 + { 'key': '1', 'value': 'Second dimension' }
  422 + ],
  423 +
  424 + availableTimeTickTypes: [
  425 + { 'key': 'auto', 'value': 'Auto' },
  426 + { 'key': 'time-step', 'value': 'Time step' },
  427 + { 'key': 'nb-major', 'value': 'Num. of major symb.' }
  428 + ],
  429 +
  430 + availableIntervalTickModes: [
  431 + { 'key': 'symbol-only', 'value': 'Symbol only' },
  432 + { 'key': 'interval-index', 'value': 'Interval index' },
  433 + { 'key': 'start-time', 'value': 'Start time' },
  434 + { 'key': 'start-stop-time', 'value': 'Start/Stop times' }
  435 + ],
  436 +
  437 + availableErrorBarTypes: [
  438 + { 'key': 'min-max', 'value': 'Min./Max. Parameters' },
  439 + { 'key': 'delta', 'value': 'Delta parameter' }
  440 + ],
  441 +
  442 + availableLegendSeriesTypes: [
  443 + { 'key': 'text-line-symbol', 'value': 'Text, Line & Symbols' },
  444 + { 'key': 'text-only', 'value': 'Text only' }
  445 + ],
  446 +
  447 + availableLegendSeriesPositions: [
  448 + { 'key': 'inside', 'value': 'Inside' },
  449 + { 'key': 'outside', 'value': 'Outside' }
  450 + ],
  451 +
  452 + availableLegendSeriesIntervalInfoTypes: [
  453 + { 'key': 'index', 'value': 'Interval Index' },
  454 + { 'key': 'start-stop', 'value': 'Interval Start/Stop' }
  455 + ],
  456 +
  457 + availableLegendTextPositions: [
  458 + { 'key': 'right', 'value': 'Right' },
  459 + { 'key': 'left', 'value': 'Left' },
  460 + { 'key': 'top', 'value': 'Top' },
  461 + { 'key': 'bottom', 'value': 'Bottom' }
  462 + ],
  463 +
  464 + availableConstantAxes: [
  465 + { 'key': 'x', 'value': 'X / Time / Epoch' },
  466 + { 'key': 'y-left', 'value': 'Y Left' },
  467 + { 'key': 'y-right', 'value': 'Y Right' }
  468 + ],
  469 +
  470 + availableTextAlignments: [
  471 + { 'key': 'left', 'value': 'Left' },
  472 + { 'key': 'center', 'value': 'Center' },
  473 + { 'key': 'right', 'value': 'Right' }
  474 + ],
  475 +
  476 + availableFillTypes: [
  477 + { 'key': 'serie-constant', 'value': 'Serie / Constant' },
  478 + { 'key': 'serie-serie', 'value': 'Serie / Serie' }
  479 + ],
  480 + availableSpectroNormalization: [
  481 + { 'key': 'none', 'value': 'None' },
  482 + { 'key': 'linear', 'value': 'Linear' },
  483 + { 'key': 'log', 'value': 'Logarithmic' }
  484 + ],
  485 +
  486 + availableFilteringLevel: [
  487 + { 'key': 1, 'value': 'Weak' },
  488 + { 'key': 2, 'value': 'Intermediate/moderated' },
  489 + { 'key': 3, 'value': 'Strong' }
  490 + ],
  491 +
  492 + fieldComboBox: {
  493 + key: 'key',
  494 + value: 'value'
  495 + },
  496 +
  497 + bgSubstraction: {
  498 + tableName: "channels-param-info",
  499 + tableChannels: "channels",
  500 + tableRelatedDim: 'relatedDim',
  501 + name: 'Background Substraction',
  502 + type: {
  503 + label: "Type ",
  504 + key: "background_sub_type",
  505 + values: {
  506 + bychannel: "By Channel",
  507 + fixedvalue: "Fixed Value"
  508 + }
  509 + },
  510 + value: {
  511 + textinputlabel: "Fixed value ",
  512 + key: "background_sub_value",
  513 + textinputkey: "background_sub_by_value",
  514 + dimlabel: 'Dim ',
  515 + dimkey: 'background_sub_dim',
  516 + dimNullValue: "-1"
  517 + }
  518 + },
  519 +
  520 + getParamConfig: function (paramId, onParamConfigLoaded) {
  521 + AmdaAction.getParamPlotInit({ "paramId": paramId }, function (result, e) {
496 onParamConfigLoaded(result.success, result.data); 522 onParamConfigLoaded(result.success, result.data);
497 }); 523 });
498 } 524 }
js/app/models/PlotObjects/PlotSpectroObject.js
@@ -11,73 +11,83 @@ @@ -11,73 +11,83 @@
11 ****************************************************************************** 11 ******************************************************************************
12 * : :21/08/2015: BRE - file creation 12 * : :21/08/2015: BRE - file creation
13 */ 13 */
14 -  
15 - 14 +
  15 +
16 Ext.define('amdaPlotObj.PlotSpectroObject', { 16 Ext.define('amdaPlotObj.PlotSpectroObject', {
17 - extend: 'Ext.data.Model',  
18 -  
19 - requires: [  
20 - 'amdaPlotObj.PlotObjectConfig'  
21 - ],  
22 -  
23 - fields : [  
24 - {name: 'spectro-yaxis', type: 'string'},  
25 - {name: 'spectro-resolution', type: 'int'},  
26 - {name: 'spectro-value-min', type: 'float', useNull:true},  
27 - {name: 'spectro-value-max', type: 'float', useNull:true},  
28 - {name: 'spectro-log0-as-min', type: 'boolean'},  
29 - {name: 'spectro-normalization', type: 'string'},  
30 - //Filtering  
31 - {name: 'filtering-activated', type: 'boolean'},  
32 - {name:'filtering-level', type:'int'}  
33 - ],  
34 -  
35 - constructor: function(){ 17 + extend: 'Ext.data.Model',
  18 +
  19 + requires: [
  20 + 'amdaPlotObj.PlotObjectConfig'
  21 + ],
  22 +
  23 + fields: [
  24 + { name: 'spectro-yaxis', type: 'string' },
  25 + { name: 'spectro-resolution', type: 'int' },
  26 + { name: 'spectro-value-min', type: 'float', useNull: true },
  27 + { name: 'spectro-value-max', type: 'float', useNull: true },
  28 + { name: 'spectro-log0-as-min', type: 'boolean' },
  29 + { name: 'spectro-normalization', type: 'string' },
  30 + //Filtering
  31 + { name: 'filtering-activated', type: 'boolean' },
  32 + { name: 'filtering-level', type: 'int' },
  33 +
  34 + { name: amdaPlotObj.PlotObjectConfig.bgSubstraction.name, type: 'boolean' },
  35 + { name: amdaPlotObj.PlotObjectConfig.bgSubstraction.type.key, type: 'string' },
  36 + { name: amdaPlotObj.PlotObjectConfig.bgSubstraction.value.key, type: 'string' },
  37 + { name: amdaPlotObj.PlotObjectConfig.bgSubstraction.value.dimkey, type: 'string' }
  38 + ],
  39 +
  40 + constructor: function () {
36 var me = this; 41 var me = this;
37 me.callParent(arguments); 42 me.callParent(arguments);
38 - if ((arguments.length > 0) && arguments[0])  
39 - { 43 + if ((arguments.length > 0) && arguments[0]) {
40 } 44 }
41 - else  
42 - {  
43 - //new object, set default fields values  
44 - me.setDefaultValues(); 45 + else {
  46 + //new object, set default fields values
  47 + me.setDefaultValues();
45 } 48 }
46 this.dirty = false; 49 this.dirty = false;
47 }, 50 },
48 -  
49 - loadFromData : function(drawData)  
50 - {  
51 - Ext.Object.each(drawData, function(key, value) {  
52 - if (key == 'type')  
53 - return;  
54 - this.set(key, value);  
55 - }, this); 51 +
  52 + loadFromData: function (drawData) {
  53 + Ext.Object.each(drawData, function (key, value) {
  54 + if (key == 'type')
  55 + return;
  56 + this.set(key, value);
  57 + }, this);
56 }, 58 },
57 -  
58 - setDefaultValues: function()  
59 - {  
60 - this.set('spectro-yaxis', amdaPlotObj.PlotObjectConfig.defaultValues.spectro.yAxis);  
61 - this.set('spectro-resolution', amdaPlotObj.PlotObjectConfig.defaultValues.spectro.resolution);  
62 - this.set('spectro-log0-as-min', false);  
63 - this.set('spectro-normalization', "none");  
64 - // filtering  
65 - this.set( 'filtering-activated', false);  
66 - this.set('filtering-level', amdaPlotObj.PlotObjectConfig.defaultValues.filtering.level); 59 +
  60 + setDefaultValues: function () {
  61 + this.set('spectro-yaxis', amdaPlotObj.PlotObjectConfig.defaultValues.spectro.yAxis);
  62 + this.set('spectro-resolution', amdaPlotObj.PlotObjectConfig.defaultValues.spectro.resolution);
  63 + this.set('spectro-log0-as-min', false);
  64 + this.set('spectro-normalization', "none");
  65 + // filtering
  66 + this.set('filtering-activated', false);
  67 + this.set('filtering-level', amdaPlotObj.PlotObjectConfig.defaultValues.filtering.level);
  68 +
  69 + this.set(amdaPlotObj.PlotObjectConfig.bgSubstraction.name, false);
  70 + this.set(amdaPlotObj.PlotObjectConfig.bgSubstraction.type.key, null);
  71 + this.set(amdaPlotObj.PlotObjectConfig.bgSubstraction.value.key, amdaPlotObj.PlotObjectConfig.bgSubstraction.value.dimNullValue);
  72 + this.set(amdaPlotObj.PlotObjectConfig.bgSubstraction.value.dimkey, amdaPlotObj.PlotObjectConfig.bgSubstraction.value.dimNullValue);
67 }, 73 },
68 -  
69 - getJsonValues : function()  
70 - {  
71 - var spectroValues = new Object();  
72 -  
73 - spectroValues['spectro-yaxis'] = this.get('spectro-yaxis');  
74 - spectroValues['spectro-resolution'] = this.get('spectro-resolution');  
75 - spectroValues['spectro-value-min'] = this.get('spectro-value-min');  
76 - spectroValues['spectro-value-max'] = this.get('spectro-value-max');  
77 - spectroValues['spectro-log0-as-min'] = this.get('spectro-log0-as-min');  
78 - spectroValues['spectro-normalization'] = this.get('spectro-normalization');  
79 - spectroValues['filtering-activated'] = this.get('filtering-activated');  
80 - spectroValues['filtering-level'] = this.get('filtering-level');  
81 - return spectroValues; 74 +
  75 + getJsonValues: function () {
  76 + var spectroValues = new Object();
  77 +
  78 + spectroValues['spectro-yaxis'] = this.get('spectro-yaxis');
  79 + spectroValues['spectro-resolution'] = this.get('spectro-resolution');
  80 + spectroValues['spectro-value-min'] = this.get('spectro-value-min');
  81 + spectroValues['spectro-value-max'] = this.get('spectro-value-max');
  82 + spectroValues['spectro-log0-as-min'] = this.get('spectro-log0-as-min');
  83 + spectroValues['spectro-normalization'] = this.get('spectro-normalization');
  84 + spectroValues['filtering-activated'] = this.get('filtering-activated');
  85 + spectroValues['filtering-level'] = this.get('filtering-level');
  86 +
  87 + spectroValues[amdaPlotObj.PlotObjectConfig.bgSubstraction.name] = this.get(amdaPlotObj.PlotObjectConfig.bgSubstraction.name);
  88 + spectroValues[amdaPlotObj.PlotObjectConfig.bgSubstraction.type.key] = this.get(amdaPlotObj.PlotObjectConfig.bgSubstraction.type.key);
  89 + spectroValues[amdaPlotObj.PlotObjectConfig.bgSubstraction.value.key] = this.get(amdaPlotObj.PlotObjectConfig.bgSubstraction.value.key);
  90 + spectroValues[amdaPlotObj.PlotObjectConfig.bgSubstraction.value.dimkey] = this.get(amdaPlotObj.PlotObjectConfig.bgSubstraction.value.dimkey);
  91 + return spectroValues;
82 } 92 }
83 }); 93 });
js/app/views/ParamArgumentsUI.js
@@ -12,56 +12,58 @@ @@ -12,56 +12,58 @@
12 Ext.define('amdaUI.ParamArgumentsUI', { 12 Ext.define('amdaUI.ParamArgumentsUI', {
13 extend: 'Ext.container.Container', 13 extend: 'Ext.container.Container',
14 alias: 'widget.paramArguments', 14 alias: 'widget.paramArguments',
15 - 15 +
16 regexp_istemplate: /^template_(.*)/, 16 regexp_istemplate: /^template_(.*)/,
17 - 17 +
18 paramRequestObject: null, 18 paramRequestObject: null,
19 onChange: null, 19 onChange: null,
20 onModifyHeight: null, 20 onModifyHeight: null,
21 pluginOwner: null, 21 pluginOwner: null,
22 - inRebuild : false,  
23 -  
24 - constructor: function(config) {  
25 - this.init(config); 22 + inRebuild: false,
  23 +
  24 + constructor: function (config) {
  25 + this.init(config);
26 this.callParent(arguments); 26 this.callParent(arguments);
27 }, 27 },
28 -  
29 - init : function(config) { 28 +
  29 + init: function (config) {
30 var myConf = { 30 var myConf = {
31 layout: { 31 layout: {
32 type: 'vbox', 32 type: 'vbox',
33 align: 'stretch' 33 align: 'stretch'
34 - }, 34 + },
35 }; 35 };
36 -  
37 - Ext.apply (this , Ext.apply (arguments, myConf)); 36 +
  37 + Ext.apply(this, Ext.apply(arguments, myConf));
38 }, 38 },
39 -  
40 - editParameter: function(paramRequestObject, uiScope, onReady) { 39 +
  40 + editParameter: function (paramRequestObject, uiScope, onReady) {
41 this.paramRequestObject = paramRequestObject; 41 this.paramRequestObject = paramRequestObject;
42 42
43 var me = this; 43 var me = this;
44 me.getEl().mask(); 44 me.getEl().mask();
45 me.resetArguments(); 45 me.resetArguments();
46 - 46 +
47 var explorerModule = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.explorer.id); 47 var explorerModule = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.explorer.id);
48 - 48 +
49 if (explorerModule) { 49 if (explorerModule) {
50 explorerModule.getParamInfo(paramRequestObject.get('paramid'), function (paramInfo) { 50 explorerModule.getParamInfo(paramRequestObject.get('paramid'), function (paramInfo) {
51 if (paramInfo) { 51 if (paramInfo) {
  52 + paramRequestObject.set(amdaPlotObj.PlotObjectConfig.bgSubstraction.tableName, paramInfo.data.tables);
  53 +
52 if (!paramRequestObject.get('is-init')) { 54 if (!paramRequestObject.get('is-init')) {
53 if (paramInfo.data && paramInfo.data.dimensions) { 55 if (paramInfo.data && paramInfo.data.dimensions) {
54 //Init each dimensions and set parameter type (0: scalar, 1: vector or 2: Tab2D) 56 //Init each dimensions and set parameter type (0: scalar, 1: vector or 2: Tab2D)
55 - paramRequestObject.set('type',0); 57 + paramRequestObject.set('type', 0);
56 if (me.initDimension('dim1', paramInfo.data)) { 58 if (me.initDimension('dim1', paramInfo.data)) {
57 - paramRequestObject.set('type',paramRequestObject.get('type')+1); 59 + paramRequestObject.set('type', paramRequestObject.get('type') + 1);
58 } 60 }
59 if (me.initDimension('dim2', paramInfo.data)) { 61 if (me.initDimension('dim2', paramInfo.data)) {
60 - paramRequestObject.set('type',paramRequestObject.get('type')+1); 62 + paramRequestObject.set('type', paramRequestObject.get('type') + 1);
61 } 63 }
62 if (paramRequestObject.get('type') == 2) { 64 if (paramRequestObject.get('type') == 2) {
63 //Tab2D 65 //Tab2D
64 - var dim2RelatedTable = me.getRelatedTableFromDim('dim2',paramInfo.data.tables); 66 + var dim2RelatedTable = me.getRelatedTableFromDim('dim2', paramInfo.data.tables);
65 if (!dim2RelatedTable.variable) { 67 if (!dim2RelatedTable.variable) {
66 paramRequestObject.set('dim2-index', 0); 68 paramRequestObject.set('dim2-index', 0);
67 } 69 }
@@ -77,13 +79,13 @@ Ext.define('amdaUI.ParamArgumentsUI', { @@ -77,13 +79,13 @@ Ext.define('amdaUI.ParamArgumentsUI', {
77 if (onReady) 79 if (onReady)
78 onReady(uiScope); 80 onReady(uiScope);
79 me.getEl().unmask(); 81 me.getEl().unmask();
80 - }); 82 + });
81 } 83 }
82 else 84 else
83 me.getEl().unmask(); 85 me.getEl().unmask();
84 }, 86 },
85 87
86 - initDimension: function(relatedDim, data) { 88 + initDimension: function (relatedDim, data) {
87 if (!data || !data.dimensions || !data.dimensions[relatedDim] || this.paramRequestObject.get('is-init')) { 89 if (!data || !data.dimensions || !data.dimensions[relatedDim] || this.paramRequestObject.get('is-init')) {
88 return false; 90 return false;
89 } 91 }
@@ -92,23 +94,23 @@ Ext.define('amdaUI.ParamArgumentsUI', { @@ -92,23 +94,23 @@ Ext.define('amdaUI.ParamArgumentsUI', {
92 if (relatedTable) { 94 if (relatedTable) {
93 var minmax = this.getDimensionMinMaxValues(relatedDim, data); 95 var minmax = this.getDimensionMinMaxValues(relatedDim, data);
94 if (!minmax) { 96 if (!minmax) {
95 - myDesktopApp.warningMsg('Min/Max '+this.getDimensionTitle(relatedDim, data)+' values are undefined<br/>Arbitrary values are taken'); 97 + myDesktopApp.warningMsg('Min/Max ' + this.getDimensionTitle(relatedDim, data) + ' values are undefined<br/>Arbitrary values are taken');
96 minmax = { 98 minmax = {
97 'min': 10, 99 'min': 10,
98 'max': 10000 100 'max': 10000
99 }; 101 };
100 } 102 }
101 - this.paramRequestObject.set(relatedDim+'-min-value', minmax['min']);  
102 - this.paramRequestObject.set(relatedDim+'-max-value', minmax['max']);  
103 - this.paramRequestObject.set(relatedDim+'-min-index', 0);  
104 - this.paramRequestObject.set(relatedDim+'-max-index', parseInt(data.dimensions[relatedDim])-1); 103 + this.paramRequestObject.set(relatedDim + '-min-value', minmax['min']);
  104 + this.paramRequestObject.set(relatedDim + '-max-value', minmax['max']);
  105 + this.paramRequestObject.set(relatedDim + '-min-index', 0);
  106 + this.paramRequestObject.set(relatedDim + '-max-index', parseInt(data.dimensions[relatedDim]) - 1);
105 } 107 }
106 return true; 108 return true;
107 } 109 }
108 return false; 110 return false;
109 }, 111 },
110 112
111 - getDimensionMinMaxValues: function(relatedDim, data) { 113 + getDimensionMinMaxValues: function (relatedDim, data) {
112 var relatedTable = this.getRelatedTableFromDim(relatedDim, data.tables); 114 var relatedTable = this.getRelatedTableFromDim(relatedDim, data.tables);
113 if (relatedTable.variable) { 115 if (relatedTable.variable) {
114 if (Ext.Object.isEmpty(relatedTable.minmax)) { 116 if (Ext.Object.isEmpty(relatedTable.minmax)) {
@@ -138,7 +140,7 @@ Ext.define(&#39;amdaUI.ParamArgumentsUI&#39;, { @@ -138,7 +140,7 @@ Ext.define(&#39;amdaUI.ParamArgumentsUI&#39;, {
138 }; 140 };
139 }, 141 },
140 142
141 - getDimensionTitle: function(relatedDim, data) { 143 + getDimensionTitle: function (relatedDim, data) {
142 var relatedTable = this.getRelatedTableFromDim(relatedDim, data.tables); 144 var relatedTable = this.getRelatedTableFromDim(relatedDim, data.tables);
143 var title = 'Unknown'; 145 var title = 'Unknown';
144 if (relatedTable) { 146 if (relatedTable) {
@@ -154,8 +156,8 @@ Ext.define(&#39;amdaUI.ParamArgumentsUI&#39;, { @@ -154,8 +156,8 @@ Ext.define(&#39;amdaUI.ParamArgumentsUI&#39;, {
154 } 156 }
155 return title; 157 return title;
156 }, 158 },
157 -  
158 - rebuildAll: function(paramInfoResult , uiScope) { 159 +
  160 + rebuildAll: function (paramInfoResult, uiScope) {
159 this.inRebuild = true; 161 this.inRebuild = true;
160 //Rebuild arguments selection 162 //Rebuild arguments selection
161 this.rebuildArguments(paramInfoResult, uiScope); 163 this.rebuildArguments(paramInfoResult, uiScope);
@@ -163,402 +165,402 @@ Ext.define(&#39;amdaUI.ParamArgumentsUI&#39;, { @@ -163,402 +165,402 @@ Ext.define(&#39;amdaUI.ParamArgumentsUI&#39;, {
163 var templateArgsValues = this.paramRequestObject.get('template_args'); 165 var templateArgsValues = this.paramRequestObject.get('template_args');
164 if (!templateArgsValues) 166 if (!templateArgsValues)
165 templateArgsValues = {}; 167 templateArgsValues = {};
166 - if (paramInfoResult.template && paramInfoResult.template.arguments) { 168 + if (paramInfoResult.template && paramInfoResult.template.arguments) {
167 //Add default template args definition if needed 169 //Add default template args definition if needed
168 Ext.Object.each(paramInfoResult.template.arguments, function (argKey, argDef) { 170 Ext.Object.each(paramInfoResult.template.arguments, function (argKey, argDef) {
169 if (!templateArgsValues[argKey]) 171 if (!templateArgsValues[argKey])
170 templateArgsValues[argKey] = argDef['default']; 172 templateArgsValues[argKey] = argDef['default'];
171 }, this); 173 }, this);
172 - 174 +
173 this.paramRequestObject.set('template_args', templateArgsValues); 175 this.paramRequestObject.set('template_args', templateArgsValues);
174 } 176 }
175 -  
176 - 177 +
  178 +
177 //Init values in interface 179 //Init values in interface
178 this.items.each(function (item) { 180 this.items.each(function (item) {
179 if (!item.argId) 181 if (!item.argId)
180 return; 182 return;
181 if (this.regexp_istemplate.test(item.argId)) { 183 if (this.regexp_istemplate.test(item.argId)) {
182 var arg_key = this.regexp_istemplate.exec(item.argId)[1]; 184 var arg_key = this.regexp_istemplate.exec(item.argId)[1];
183 - 185 +
184 if (this.paramRequestObject.get('template_args') && this.paramRequestObject.get('template_args')[arg_key]) 186 if (this.paramRequestObject.get('template_args') && this.paramRequestObject.get('template_args')[arg_key])
185 item.setValue(this.paramRequestObject.get('template_args')[arg_key]); 187 item.setValue(this.paramRequestObject.get('template_args')[arg_key]);
186 } 188 }
187 else if (item.argId == 'dim1' || item.argId == 'dim2') { 189 else if (item.argId == 'dim1' || item.argId == 'dim2') {
188 - item.setValue(this.paramRequestObject.get(item.argId+'-index'));  
189 - var sumInRangeField = item.up().down('[name=sum_fieldset_'+item.argId +']'); 190 + item.setValue(this.paramRequestObject.get(item.argId + '-index'));
  191 + var sumInRangeField = item.up().down('[name=sum_fieldset_' + item.argId + ']');
190 if (sumInRangeField) { 192 if (sumInRangeField) {
191 //Fill fields 193 //Fill fields
192 - sumInRangeField.down('textfield[name=value_min_' + item.argId + ']').setValue(this.paramRequestObject.get(item.argId+'-min-value'));  
193 - sumInRangeField.down('textfield[name=value_max_' + item.argId + ']').setValue(this.paramRequestObject.get(item.argId+'-max-value'));  
194 - sumInRangeField.down('textfield[name=index_min_' + item.argId + ']').setValue(this.paramRequestObject.get(item.argId+'-min-index'));  
195 - sumInRangeField.down('textfield[name=index_max_' + item.argId + ']').setValue(this.paramRequestObject.get(item.argId+'-max-index'));  
196 - if (this.paramRequestObject.get(item.argId+'-sum-type') > 0) { 194 + sumInRangeField.down('textfield[name=value_min_' + item.argId + ']').setValue(this.paramRequestObject.get(item.argId + '-min-value'));
  195 + sumInRangeField.down('textfield[name=value_max_' + item.argId + ']').setValue(this.paramRequestObject.get(item.argId + '-max-value'));
  196 + sumInRangeField.down('textfield[name=index_min_' + item.argId + ']').setValue(this.paramRequestObject.get(item.argId + '-min-index'));
  197 + sumInRangeField.down('textfield[name=index_max_' + item.argId + ']').setValue(this.paramRequestObject.get(item.argId + '-max-index'));
  198 + if (this.paramRequestObject.get(item.argId + '-sum-type') > 0) {
197 sumInRangeField.expand(); 199 sumInRangeField.expand();
198 } 200 }
199 else { 201 else {
200 sumInRangeField.collapse(); 202 sumInRangeField.collapse();
201 } 203 }
202 } 204 }
203 - }  
204 - else  
205 - item.setValue(this.paramRequestObject.get(item.argId));  
206 - this.inRebuild = false;  
207 - }, this);  
208 - },  
209 -  
210 - getValues: function() {  
211 - var values = {type : paramRequestObject.get('type')};  
212 - this.items.each(function(item) {  
213 - if (!item.argId)  
214 - return;  
215 - if (this.regexp_istemplate.test(item.argId)) {  
216 - var arg_key = this.regexp_istemplate.exec(item.argId)[1];  
217 - if (!values['template_args'])  
218 - values['template_args'] = {};  
219 - values['template_args'][arg_key] = item.getValue();  
220 - }  
221 - else  
222 - values[item.argId] = item.getValue();  
223 - }, this);  
224 -  
225 - return values;  
226 - },  
227 -  
228 - resetValues: function() {  
229 - this.items.each(function (item) {  
230 - if (item.reset)  
231 - item.reset();  
232 - });  
233 - },  
234 -  
235 - resetArguments: function(noArgsMsg) {  
236 - this.removeAll();  
237 - if (!noArgsMsg)  
238 - this.add(new Ext.form.Label({text: 'No argument for this parameter', argId: null}));  
239 - },  
240 -  
241 - rebuildArguments: function(result, uiScope) {  
242 - this.resetArguments(true);  
243 -  
244 - if (result.data && result.data.dimensions) {  
245 - if (result.data.dimensions.dim1 && (parseInt(result.data.dimensions.dim1) > 1) || this.getRelatedTableFromDim('dim1',result.data.tables)) {  
246 - this.buildDimIndexSelection("dim1", result.data, uiScope);  
247 - }  
248 - if (result.data.dimensions.dim2 && (parseInt(result.data.dimensions.dim2) > 1) || this.getRelatedTableFromDim('dim2',result.data.tables)) {  
249 - this.buildDimIndexSelection("dim2", result.data, uiScope);  
250 - }  
251 - }  
252 -  
253 - var isTemplate = (result.template && result.template.arguments);  
254 - if (isTemplate)  
255 - this.buildTemplateArguments(result.template.arguments, uiScope);  
256 -  
257 - if ((this.paramRequestObject.get('type') == 0) && !isTemplate)  
258 - //Add no args message  
259 - this.resetArguments(false);  
260 - },  
261 -  
262 - getRelatedTableFromDim : function(relatedDim, tables) {  
263 - var relatedTable = null; 205 + }
  206 + else
  207 + item.setValue(this.paramRequestObject.get(item.argId));
  208 + this.inRebuild = false;
  209 + }, this);
  210 + },
  211 +
  212 + getValues: function () {
  213 + var values = { type: paramRequestObject.get('type') };
  214 + this.items.each(function (item) {
  215 + if (!item.argId)
  216 + return;
  217 + if (this.regexp_istemplate.test(item.argId)) {
  218 + var arg_key = this.regexp_istemplate.exec(item.argId)[1];
  219 + if (!values['template_args'])
  220 + values['template_args'] = {};
  221 + values['template_args'][arg_key] = item.getValue();
  222 + }
  223 + else
  224 + values[item.argId] = item.getValue();
  225 + }, this);
  226 +
  227 + return values;
  228 + },
  229 +
  230 + resetValues: function () {
  231 + this.items.each(function (item) {
  232 + if (item.reset)
  233 + item.reset();
  234 + });
  235 + },
  236 +
  237 + resetArguments: function (noArgsMsg) {
  238 + this.removeAll();
  239 + if (!noArgsMsg)
  240 + this.add(new Ext.form.Label({ text: 'No argument for this parameter', argId: null }));
  241 + },
  242 +
  243 + rebuildArguments: function (result, uiScope) {
  244 + this.resetArguments(true);
  245 +
  246 + if (result.data && result.data.dimensions) {
  247 + if (result.data.dimensions.dim1 && (parseInt(result.data.dimensions.dim1) > 1) || this.getRelatedTableFromDim('dim1', result.data.tables)) {
  248 + this.buildDimIndexSelection("dim1", result.data, uiScope);
  249 + }
  250 + if (result.data.dimensions.dim2 && (parseInt(result.data.dimensions.dim2) > 1) || this.getRelatedTableFromDim('dim2', result.data.tables)) {
  251 + this.buildDimIndexSelection("dim2", result.data, uiScope);
  252 + }
  253 + }
  254 +
  255 + var isTemplate = (result.template && result.template.arguments);
  256 + if (isTemplate)
  257 + this.buildTemplateArguments(result.template.arguments, uiScope);
  258 +
  259 + if ((this.paramRequestObject.get('type') == 0) && !isTemplate)
  260 + //Add no args message
  261 + this.resetArguments(false);
  262 + },
  263 +
  264 + getRelatedTableFromDim: function (relatedDim, tables) {
  265 + var relatedTable = null;
264 if (tables) { 266 if (tables) {
265 - Ext.each(tables, function(table, index) { 267 + Ext.each(tables, function (table, index) {
266 if (table.relatedDim == relatedDim) 268 if (table.relatedDim == relatedDim)
267 relatedTable = table; 269 relatedTable = table;
268 }, this); 270 }, this);
269 } 271 }
270 return relatedTable; 272 return relatedTable;
271 - },  
272 -  
273 - buildDimIndexSelection: function(relatedDim, data, uiScope) {  
274 - var ruler = {  
275 - xtype: 'box',  
276 - autoEl : {  
277 - tag : 'hr'  
278 - }  
279 - };  
280 - //Check if this dimension is attached to a table 273 + },
  274 +
  275 + buildDimIndexSelection: function (relatedDim, data, uiScope) {
  276 + var ruler = {
  277 + xtype: 'box',
  278 + autoEl: {
  279 + tag: 'hr'
  280 + }
  281 + };
  282 + //Check if this dimension is attached to a table
281 var relatedTable = this.getRelatedTableFromDim(relatedDim, data.tables); 283 var relatedTable = this.getRelatedTableFromDim(relatedDim, data.tables);
282 var dimSize = data.dimensions[relatedDim]; 284 var dimSize = data.dimensions[relatedDim];
283 - 285 +
284 var title = this.getDimensionTitle(relatedDim, data); 286 var title = this.getDimensionTitle(relatedDim, data);
285 - 287 +
286 var indexes = []; 288 var indexes = [];
287 - indexes.push({'key' : '*', 'value' : 'All'});  
288 - 289 + indexes.push({ 'key': '*', 'value': 'All' });
  290 +
289 if (relatedTable) { 291 if (relatedTable) {
290 //If it's not a variable table => enable channel selection 292 //If it's not a variable table => enable channel selection
291 if (!relatedTable.variable) 293 if (!relatedTable.variable)
292 Ext.Object.each(relatedTable.channels, function (index, channel) { 294 Ext.Object.each(relatedTable.channels, function (index, channel) {
293 - indexes.push({'key' : index.toString(), 'value' : index + ' : [' + channel.min + ', ' + channel.max + ']'}); 295 + indexes.push({ 'key': index.toString(), 'value': index + ' : [' + channel.min + ', ' + channel.max + ']' });
294 }); 296 });
295 } 297 }
296 else { 298 else {
297 //Else, use components 299 //Else, use components
298 Ext.Object.each(data.components, function (index, component) { 300 Ext.Object.each(data.components, function (index, component) {
299 if (relatedDim == "dim1" && component.index_1 != "") 301 if (relatedDim == "dim1" && component.index_1 != "")
300 - indexes.push({'key' : component.index_1, 'value' : index + ' : ' + component.name}); 302 + indexes.push({ 'key': component.index_1, 'value': index + ' : ' + component.name });
301 else if (relatedDim == "dim2" && component.index_2 != "") 303 else if (relatedDim == "dim2" && component.index_2 != "")
302 - indexes.push({'key' : component.index_2, 'value' : index + ' : ' + component.name}); 304 + indexes.push({ 'key': component.index_2, 'value': index + ' : ' + component.name });
303 }); 305 });
304 } 306 }
305 307
306 //Add combo box 308 //Add combo box
307 var indexesStore = Ext.create('Ext.data.Store', { 309 var indexesStore = Ext.create('Ext.data.Store', {
308 - fields: ['key', 'value'],  
309 - data : indexes 310 + fields: ['key', 'value'],
  311 + data: indexes
310 }); 312 });
311 313
312 var indexesCombo = Ext.create('Ext.form.ComboBox', { 314 var indexesCombo = Ext.create('Ext.form.ComboBox', {
313 - fieldLabel: title,  
314 - store: indexesStore,  
315 - queryMode: 'local',  
316 - displayField: 'value',  
317 - valueField: 'key',  
318 - value: '*',  
319 - editable: false,  
320 - argId: relatedDim,  
321 - hidden: (relatedTable ? relatedTable.variable : false),  
322 - listeners: {  
323 - change: function(field, newValue, oldValue, eOpts) {  
324 - this.paramRequestObject.set(relatedDim+'-index', newValue);  
325 - if (!this.inRebuild && (this.onChange != null))  
326 - this.onChange(uiScope, relatedDim, newValue, oldValue, false);  
327 - },  
328 - scope: this  
329 - }  
330 - 315 + fieldLabel: title,
  316 + store: indexesStore,
  317 + queryMode: 'local',
  318 + displayField: 'value',
  319 + valueField: 'key',
  320 + value: '*',
  321 + editable: false,
  322 + argId: relatedDim,
  323 + hidden: (relatedTable ? relatedTable.variable : false),
  324 + listeners: {
  325 + change: function (field, newValue, oldValue, eOpts) {
  326 + this.paramRequestObject.set(relatedDim + '-index', newValue);
  327 + if (!this.inRebuild && (this.onChange != null))
  328 + this.onChange(uiScope, relatedDim, newValue, oldValue, false);
  329 + },
  330 + scope: this
  331 + }
  332 +
331 }); 333 });
332 - 334 +
333 this.add(indexesCombo); 335 this.add(indexesCombo);
334 - 336 +
335 if (relatedTable) { 337 if (relatedTable) {
336 var sumTypes = Ext.create('Ext.data.Store', { 338 var sumTypes = Ext.create('Ext.data.Store', {
337 fields: ['type', 'name'], 339 fields: ['type', 'name'],
338 data: [ 340 data: [
339 - {'type': 1, 'name': 'Between Values'},  
340 - {'type': 2, 'name': 'Between Indexes'} 341 + { 'type': 1, 'name': 'Between Values' },
  342 + { 'type': 2, 'name': 'Between Indexes' }
341 ] 343 ]
342 }); 344 });
343 var sumItems = [ 345 var sumItems = [
344 - {  
345 - xtype: 'combobox',  
346 - name: 'sum_type_'+relatedDim,  
347 - store: sumTypes,  
348 - queryMode: 'local',  
349 - editable: false,  
350 - displayField: 'name',  
351 - valueField: 'type',  
352 - fieldLabel: 'Type',  
353 - value: 1,  
354 - listeners: {  
355 - change: function(field, newValue, oldValue, eOpts) {  
356 - this.paramRequestObject.set(relatedDim+'-sum-type',newValue);  
357 - field.up().down('[name=value_min_'+relatedDim+']').setVisible(newValue == 1);  
358 - field.up().down('[name=value_max_'+relatedDim+']').setVisible(newValue == 1);  
359 - field.up().down('[name=index_min_'+relatedDim+']').setVisible(newValue == 2);  
360 - field.up().down('[name=index_max_'+relatedDim+']').setVisible(newValue == 2);  
361 - if (!this.inRebuild && (this.onChange != null))  
362 - this.onChange(uiScope, relatedDim, newValue, oldValue, false); 346 + {
  347 + xtype: 'combobox',
  348 + name: 'sum_type_' + relatedDim,
  349 + store: sumTypes,
  350 + queryMode: 'local',
  351 + editable: false,
  352 + displayField: 'name',
  353 + valueField: 'type',
  354 + fieldLabel: 'Type',
  355 + value: 1,
  356 + listeners: {
  357 + change: function (field, newValue, oldValue, eOpts) {
  358 + this.paramRequestObject.set(relatedDim + '-sum-type', newValue);
  359 + field.up().down('[name=value_min_' + relatedDim + ']').setVisible(newValue == 1);
  360 + field.up().down('[name=value_max_' + relatedDim + ']').setVisible(newValue == 1);
  361 + field.up().down('[name=index_min_' + relatedDim + ']').setVisible(newValue == 2);
  362 + field.up().down('[name=index_max_' + relatedDim + ']').setVisible(newValue == 2);
  363 + if (!this.inRebuild && (this.onChange != null))
  364 + this.onChange(uiScope, relatedDim, newValue, oldValue, false);
  365 + },
  366 + scope: this
  367 + }
363 }, 368 },
364 - scope: this  
365 - }  
366 - },  
367 - {  
368 - xtype: 'numberfield',  
369 - name: 'value_min_'+relatedDim,  
370 - fieldLabel: 'Min.',  
371 - decimalPrecision : 3,  
372 - value: 0.,  
373 - listeners: {  
374 - change: function(field, newValue, oldValue, eOpts) {  
375 - this.paramRequestObject.set(relatedDim+'-min-value', newValue);  
376 - if (!this.inRebuild && (this.onChange != null))  
377 - this.onChange(uiScope, relatedDim, newValue, oldValue, false);  
378 - },  
379 - scope: this  
380 - }  
381 - },  
382 - {  
383 - xtype: 'numberfield',  
384 - name: 'value_max_'+relatedDim,  
385 - fieldLabel: 'Max.',  
386 - decimalPrecision : 3,  
387 - value: 0.,  
388 - listeners: {  
389 - change: function(field, newValue, oldValue, eOpts) {  
390 - this.paramRequestObject.set(relatedDim+'-max-value', newValue);  
391 - if (!this.inRebuild && (this.onChange != null))  
392 - this.onChange(uiScope, relatedDim, newValue, oldValue, false);  
393 - },  
394 - scope: this  
395 - }  
396 - },  
397 - {  
398 - xtype: 'numberfield',  
399 - name: 'index_min_'+relatedDim,  
400 - fieldLabel: 'Min.',  
401 - allowDecimals: false,  
402 - value: 0,  
403 - minValue: 0,  
404 - hidden: true,  
405 - listeners: {  
406 - change: function(field, newValue, oldValue, eOpts) {  
407 - this.paramRequestObject.set(relatedDim+'-min-index', newValue);  
408 - if (!this.inRebuild && (this.onChange != null))  
409 - this.onChange(uiScope, relatedDim, newValue, oldValue, false);  
410 - },  
411 - scope: this  
412 - }  
413 - },  
414 - {  
415 - xtype: 'numberfield',  
416 - name: 'index_max_'+relatedDim,  
417 - fieldLabel: 'Max.',  
418 - allowDecimals: false,  
419 - value: 0,  
420 - minValue: 0,  
421 - hidden: true,  
422 - listeners: {  
423 - change: function(field, newValue, oldValue, eOpts) {  
424 - this.paramRequestObject.set(relatedDim+'-max-index', newValue);  
425 - if (!this.inRebuild && (this.onChange != null))  
426 - this.onChange(uiScope, relatedDim, newValue, oldValue, false);  
427 - },  
428 - scope: this  
429 - }  
430 - } 369 + {
  370 + xtype: 'numberfield',
  371 + name: 'value_min_' + relatedDim,
  372 + fieldLabel: 'Min.',
  373 + decimalPrecision: 3,
  374 + value: 0.,
  375 + listeners: {
  376 + change: function (field, newValue, oldValue, eOpts) {
  377 + this.paramRequestObject.set(relatedDim + '-min-value', newValue);
  378 + if (!this.inRebuild && (this.onChange != null))
  379 + this.onChange(uiScope, relatedDim, newValue, oldValue, false);
  380 + },
  381 + scope: this
  382 + }
  383 + },
  384 + {
  385 + xtype: 'numberfield',
  386 + name: 'value_max_' + relatedDim,
  387 + fieldLabel: 'Max.',
  388 + decimalPrecision: 3,
  389 + value: 0.,
  390 + listeners: {
  391 + change: function (field, newValue, oldValue, eOpts) {
  392 + this.paramRequestObject.set(relatedDim + '-max-value', newValue);
  393 + if (!this.inRebuild && (this.onChange != null))
  394 + this.onChange(uiScope, relatedDim, newValue, oldValue, false);
  395 + },
  396 + scope: this
  397 + }
  398 + },
  399 + {
  400 + xtype: 'numberfield',
  401 + name: 'index_min_' + relatedDim,
  402 + fieldLabel: 'Min.',
  403 + allowDecimals: false,
  404 + value: 0,
  405 + minValue: 0,
  406 + hidden: true,
  407 + listeners: {
  408 + change: function (field, newValue, oldValue, eOpts) {
  409 + this.paramRequestObject.set(relatedDim + '-min-index', newValue);
  410 + if (!this.inRebuild && (this.onChange != null))
  411 + this.onChange(uiScope, relatedDim, newValue, oldValue, false);
  412 + },
  413 + scope: this
  414 + }
  415 + },
  416 + {
  417 + xtype: 'numberfield',
  418 + name: 'index_max_' + relatedDim,
  419 + fieldLabel: 'Max.',
  420 + allowDecimals: false,
  421 + value: 0,
  422 + minValue: 0,
  423 + hidden: true,
  424 + listeners: {
  425 + change: function (field, newValue, oldValue, eOpts) {
  426 + this.paramRequestObject.set(relatedDim + '-max-index', newValue);
  427 + if (!this.inRebuild && (this.onChange != null))
  428 + this.onChange(uiScope, relatedDim, newValue, oldValue, false);
  429 + },
  430 + scope: this
  431 + }
  432 + }
431 ]; 433 ];
432 - 434 +
433 var sumRangeFieldSet = Ext.create('Ext.form.FieldSet', { 435 var sumRangeFieldSet = Ext.create('Ext.form.FieldSet', {
434 title: relatedTable.variable ? title + " - Sum. in range" : "Sum. in range", 436 title: relatedTable.variable ? title + " - Sum. in range" : "Sum. in range",
435 collapsed: true, 437 collapsed: true,
436 - checkboxName: 'sum_checkbox_'+relatedDim, 438 + checkboxName: 'sum_checkbox_' + relatedDim,
437 checkboxToggle: true, 439 checkboxToggle: true,
438 - name: 'sum_fieldset_'+relatedDim, 440 + name: 'sum_fieldset_' + relatedDim,
439 layout: { 441 layout: {
440 - type: 'vbox',  
441 - pack: 'start',  
442 - align: 'stretch' 442 + type: 'vbox',
  443 + pack: 'start',
  444 + align: 'stretch'
443 }, 445 },
444 items: sumItems, 446 items: sumItems,
445 listeners: { 447 listeners: {
446 - expand: function(fieldset, eOpts) {  
447 - if (this.paramRequestObject.get(relatedDim+'-sum-type') == 0) {  
448 - this.paramRequestObject.set(relatedDim+'-sum-type',1);  
449 - }  
450 - fieldset.down('[name=sum_type_'+relatedDim+']').setValue(this.paramRequestObject.get(relatedDim+'-sum-type'));  
451 - indexesCombo.setDisabled(true);  
452 - if (!this.inRebuild && (this.onChange != null))  
453 - this.onChange(uiScope, relatedDim, true, false, false);  
454 - if (this.onModifyHeight)  
455 - this.onModifyHeight(this.pluginOwner); 448 + expand: function (fieldset, eOpts) {
  449 + if (this.paramRequestObject.get(relatedDim + '-sum-type') == 0) {
  450 + this.paramRequestObject.set(relatedDim + '-sum-type', 1);
  451 + }
  452 + fieldset.down('[name=sum_type_' + relatedDim + ']').setValue(this.paramRequestObject.get(relatedDim + '-sum-type'));
  453 + indexesCombo.setDisabled(true);
  454 + if (!this.inRebuild && (this.onChange != null))
  455 + this.onChange(uiScope, relatedDim, true, false, false);
  456 + if (this.onModifyHeight)
  457 + this.onModifyHeight(this.pluginOwner);
456 }, 458 },
457 - collapse: function(fieldset, eOpts) {  
458 - indexesCombo.setDisabled(false);  
459 - this.paramRequestObject.set(relatedDim+'-sum-type', 0);  
460 - if (!this.inRebuild && (this.onChange != null))  
461 - this.onChange(uiScope, relatedDim, false, true, false);  
462 - if (this.onModifyHeight)  
463 - this.onModifyHeight(this.pluginOwner); 459 + collapse: function (fieldset, eOpts) {
  460 + indexesCombo.setDisabled(false);
  461 + this.paramRequestObject.set(relatedDim + '-sum-type', 0);
  462 + if (!this.inRebuild && (this.onChange != null))
  463 + this.onChange(uiScope, relatedDim, false, true, false);
  464 + if (this.onModifyHeight)
  465 + this.onModifyHeight(this.pluginOwner);
464 }, 466 },
465 scope: this 467 scope: this
466 } 468 }
467 }); 469 });
468 this.add(sumRangeFieldSet); 470 this.add(sumRangeFieldSet);
469 - this.add(ruler); 471 + this.add(ruler);
470 } 472 }
471 return indexesCombo; 473 return indexesCombo;
472 }, 474 },
473 -  
474 - buildTemplateArguments: function(arguments, uiScope) {  
475 - var me = this;  
476 - Ext.Object.each(arguments, function (key, argument) {  
477 - switch (argument.type) {  
478 - case 'float' :  
479 - var argumentField = Ext.create('Ext.form.NumberField', {  
480 - argId: 'template_' + key,  
481 - fieldLabel: argument.name,  
482 - decimalPrecision : 3,  
483 - allowBlank : false,  
484 - value: parseFloat(argument.default),  
485 - listeners: {  
486 - change: function(field, newValue, oldValue, eOpts) {  
487 - var template_args = me.paramRequestObject.get('template_args');  
488 - if (!template_args)  
489 - template_args = {};  
490 - template_args[key] = newValue;  
491 - me.paramRequestObject.set('template_args', template_args);  
492 - if (!this.inRebuild && (me.onChange != null))  
493 - me.onChange(uiScope, key, newValue, oldValue, true);  
494 - },  
495 - scope: me  
496 - }  
497 - });  
498 -  
499 - me.add(argumentField);  
500 - break;  
501 - case 'list' :  
502 - var items = [];  
503 - Ext.Object.each(argument.items, function (itemKey, itemName) {  
504 - items.push({'key' : itemKey, 'value' : itemName});  
505 - });  
506 -  
507 - var itemsStore = Ext.create('Ext.data.Store', {  
508 - fields: ['key', 'value'],  
509 - data : items  
510 - });  
511 -  
512 - var itemsCombo = Ext.create('Ext.form.ComboBox', {  
513 - fieldLabel: argument.name,  
514 - store: itemsStore,  
515 - queryMode: 'local',  
516 - displayField: 'value',  
517 - valueField: 'key',  
518 - value: argument.default,  
519 - editable: false,  
520 - argId: 'template_' + key,  
521 - listeners: {  
522 - change: function(field, newValue, oldValue, eOpts) {  
523 - var template_args = me.paramRequestObject.get('template_args');  
524 - if (!template_args)  
525 - template_args = {};  
526 - template_args[key] = newValue;  
527 - me.paramRequestObject.set('template_args', template_args);  
528 - if (!this.inRebuild && (me.onChange != null))  
529 - me.onChange(uiScope, key, newValue, oldValue, true);  
530 - },  
531 - scope: me  
532 - }  
533 -  
534 - });  
535 -  
536 - me.add(itemsCombo);  
537 - break;  
538 - case 'bool' :  
539 - var argumentField = Ext.create('Ext.form.Checkbox', {  
540 - argId: 'template_' + key,  
541 - fieldLabel: argument.name,  
542 - value: (parseInt(argument.default) == 1),  
543 - listeners: {  
544 - change: function(field, newValue, oldValue, eOpts) {  
545 - var template_args = me.paramRequestObject.get('template_args');  
546 - if (!template_args)  
547 - template_args = {};  
548 - template_args[key] = newValue;  
549 - me.paramRequestObject.set('template_args', template_args);  
550 - if (!this.inRebuild && (me.onChange != null))  
551 - me.onChange(uiScope, key, newValue, oldValue, true);  
552 - },  
553 - scope: me  
554 - }  
555 - });  
556 -  
557 - me.add(argumentField);  
558 - break;  
559 - default:  
560 - console.log('Template argument type not yet implemented: '+argument.type);  
561 - }  
562 - });  
563 - } 475 +
  476 + buildTemplateArguments: function (arguments, uiScope) {
  477 + var me = this;
  478 + Ext.Object.each(arguments, function (key, argument) {
  479 + switch (argument.type) {
  480 + case 'float':
  481 + var argumentField = Ext.create('Ext.form.NumberField', {
  482 + argId: 'template_' + key,
  483 + fieldLabel: argument.name,
  484 + decimalPrecision: 3,
  485 + allowBlank: false,
  486 + value: parseFloat(argument.default),
  487 + listeners: {
  488 + change: function (field, newValue, oldValue, eOpts) {
  489 + var template_args = me.paramRequestObject.get('template_args');
  490 + if (!template_args)
  491 + template_args = {};
  492 + template_args[key] = newValue;
  493 + me.paramRequestObject.set('template_args', template_args);
  494 + if (!this.inRebuild && (me.onChange != null))
  495 + me.onChange(uiScope, key, newValue, oldValue, true);
  496 + },
  497 + scope: me
  498 + }
  499 + });
  500 +
  501 + me.add(argumentField);
  502 + break;
  503 + case 'list':
  504 + var items = [];
  505 + Ext.Object.each(argument.items, function (itemKey, itemName) {
  506 + items.push({ 'key': itemKey, 'value': itemName });
  507 + });
  508 +
  509 + var itemsStore = Ext.create('Ext.data.Store', {
  510 + fields: ['key', 'value'],
  511 + data: items
  512 + });
  513 +
  514 + var itemsCombo = Ext.create('Ext.form.ComboBox', {
  515 + fieldLabel: argument.name,
  516 + store: itemsStore,
  517 + queryMode: 'local',
  518 + displayField: 'value',
  519 + valueField: 'key',
  520 + value: argument.default,
  521 + editable: false,
  522 + argId: 'template_' + key,
  523 + listeners: {
  524 + change: function (field, newValue, oldValue, eOpts) {
  525 + var template_args = me.paramRequestObject.get('template_args');
  526 + if (!template_args)
  527 + template_args = {};
  528 + template_args[key] = newValue;
  529 + me.paramRequestObject.set('template_args', template_args);
  530 + if (!this.inRebuild && (me.onChange != null))
  531 + me.onChange(uiScope, key, newValue, oldValue, true);
  532 + },
  533 + scope: me
  534 + }
  535 +
  536 + });
  537 +
  538 + me.add(itemsCombo);
  539 + break;
  540 + case 'bool':
  541 + var argumentField = Ext.create('Ext.form.Checkbox', {
  542 + argId: 'template_' + key,
  543 + fieldLabel: argument.name,
  544 + value: (parseInt(argument.default) == 1),
  545 + listeners: {
  546 + change: function (field, newValue, oldValue, eOpts) {
  547 + var template_args = me.paramRequestObject.get('template_args');
  548 + if (!template_args)
  549 + template_args = {};
  550 + template_args[key] = newValue;
  551 + me.paramRequestObject.set('template_args', template_args);
  552 + if (!this.inRebuild && (me.onChange != null))
  553 + me.onChange(uiScope, key, newValue, oldValue, true);
  554 + },
  555 + scope: me
  556 + }
  557 + });
  558 +
  559 + me.add(argumentField);
  560 + break;
  561 + default:
  562 + console.log('Template argument type not yet implemented: ' + argument.type);
  563 + }
  564 + });
  565 + }
564 }); 566 });
js/app/views/PlotComponents/PlotParamForm.js
@@ -10,98 +10,96 @@ @@ -10,98 +10,96 @@
10 10
11 Ext.define('amdaPlotComp.PlotParamForm', { 11 Ext.define('amdaPlotComp.PlotParamForm', {
12 extend: 'amdaPlotComp.PlotStandardForm', 12 extend: 'amdaPlotComp.PlotStandardForm',
13 - 13 +
14 requires: [ 14 requires: [
15 - 'amdaPlotComp.PlotSerieForm',  
16 - 'amdaPlotComp.PlotOrbitSerieForm',  
17 - 'amdaPlotComp.PlotSpectroForm',  
18 - 'amdaPlotComp.PlotStatusBarForm',  
19 - 'amdaPlotComp.PlotTickBarForm',  
20 - 'amdaPlotComp.PlotInstantSerieForm',  
21 - 'amdaPlotComp.PlotInstantSpectroForm',  
22 - 'amdaPlotComp.PlotIntervalsForm',  
23 - 'amdaUI.ParamArgumentsUI' 15 + 'amdaPlotComp.PlotSerieForm',
  16 + 'amdaPlotComp.PlotOrbitSerieForm',
  17 + 'amdaPlotComp.PlotSpectroForm',
  18 + 'amdaPlotComp.PlotStatusBarForm',
  19 + 'amdaPlotComp.PlotTickBarForm',
  20 + 'amdaPlotComp.PlotInstantSerieForm',
  21 + 'amdaPlotComp.PlotInstantSpectroForm',
  22 + 'amdaPlotComp.PlotIntervalsForm',
  23 + 'amdaUI.ParamArgumentsUI'
24 ], 24 ],
25 - 25 +
26 drawingOptionsContainer: null, 26 drawingOptionsContainer: null,
27 -  
28 - drawingOptionsFormsManager : new Ext.AbstractManager(),  
29 -  
30 - paramArgs : null,  
31 -  
32 - isFirstMsg: true,  
33 -  
34 - destroy: function() { 27 +
  28 + drawingOptionsFormsManager: new Ext.AbstractManager(),
  29 +
  30 + paramArgs: null,
  31 +
  32 + isFirstMsg: true,
  33 +
  34 + destroy: function () {
35 this.drawingOptionsFormsManager.each(function (key, value, length) { 35 this.drawingOptionsFormsManager.each(function (key, value, length) {
36 - this.drawingOptionsFormsManager.unregister(value); 36 + this.drawingOptionsFormsManager.unregister(value);
37 value.destroy(); 37 value.destroy();
38 - }, this); 38 + }, this);
39 this.callParent(); 39 this.callParent();
40 }, 40 },
41 -  
42 - setObject : function(object) { 41 +
  42 + setObject: function (object) {
43 this.object = object; 43 this.object = object;
44 this.loadRecord(this.object); 44 this.loadRecord(this.object);
45 this.updateDrawingOptions(this.object.get('param-drawing-type'), this.object.get('paramid')); 45 this.updateDrawingOptions(this.object.get('param-drawing-type'), this.object.get('paramid'));
46 }, 46 },
47 -  
48 - getDrawingOptionsForm: function(type) { 47 +
  48 + getDrawingOptionsForm: function (type) {
49 var formId = ''; 49 var formId = '';
50 if (!type || (type == '')) 50 if (!type || (type == ''))
51 formId = 'none'; 51 formId = 'none';
52 else 52 else
53 formId = type; 53 formId = type;
54 - 54 +
55 formId += '-drawing-options-form'; 55 formId += '-drawing-options-form';
56 - if (!this.drawingOptionsFormsManager.get(formId))  
57 - {  
58 - switch(type)  
59 - { 56 + if (!this.drawingOptionsFormsManager.get(formId)) {
  57 + switch (type) {
60 //Create drawing options form 58 //Create drawing options form
61 - case 'serie' :  
62 - this.drawingOptionsFormsManager.register(new amdaPlotComp.PlotSerieForm({id : formId})); 59 + case 'serie':
  60 + this.drawingOptionsFormsManager.register(new amdaPlotComp.PlotSerieForm({ id: formId }));
63 break; 61 break;
64 - case 'orbit-serie' :  
65 - this.drawingOptionsFormsManager.register(new amdaPlotComp.PlotOrbitSerieForm({id : formId})); 62 + case 'orbit-serie':
  63 + this.drawingOptionsFormsManager.register(new amdaPlotComp.PlotOrbitSerieForm({ id: formId }));
66 break; 64 break;
67 - case 'spectro' :  
68 - this.drawingOptionsFormsManager.register(new amdaPlotComp.PlotSpectroForm({id : formId})); 65 + case 'spectro':
  66 + this.drawingOptionsFormsManager.register(new amdaPlotComp.PlotSpectroForm({ id: formId }));
69 break; 67 break;
70 - case 'status-bar' :  
71 - this.drawingOptionsFormsManager.register(new amdaPlotComp.PlotStatusBarForm({id : formId})); 68 + case 'status-bar':
  69 + this.drawingOptionsFormsManager.register(new amdaPlotComp.PlotStatusBarForm({ id: formId }));
72 break; 70 break;
73 - case 'tick-bar' :  
74 - this.drawingOptionsFormsManager.register(new amdaPlotComp.PlotTickBarForm({id : formId})); 71 + case 'tick-bar':
  72 + this.drawingOptionsFormsManager.register(new amdaPlotComp.PlotTickBarForm({ id: formId }));
75 break; 73 break;
76 - case 'iserie' :  
77 - this.drawingOptionsFormsManager.register(new amdaPlotComp.PlotInstantSerieForm({id : formId})); 74 + case 'iserie':
  75 + this.drawingOptionsFormsManager.register(new amdaPlotComp.PlotInstantSerieForm({ id: formId }));
78 break; 76 break;
79 - case 'ispectro' :  
80 - this.drawingOptionsFormsManager.register(new amdaPlotComp.PlotInstantSpectroForm({id : formId})); 77 + case 'ispectro':
  78 + this.drawingOptionsFormsManager.register(new amdaPlotComp.PlotInstantSpectroForm({ id: formId }));
81 break; 79 break;
82 - case 'intervals' :  
83 - this.drawingOptionsFormsManager.register(new amdaPlotComp.PlotIntervalsForm({id : formId})); 80 + case 'intervals':
  81 + this.drawingOptionsFormsManager.register(new amdaPlotComp.PlotIntervalsForm({ id: formId }));
84 break; 82 break;
85 - default :  
86 - this.drawingOptionsFormsManager.register(new Ext.form.Label({id : formId, text: 'No available options for this drawing type'})); 83 + default:
  84 + this.drawingOptionsFormsManager.register(new Ext.form.Label({ id: formId, text: 'No available options for this drawing type' }));
87 } 85 }
88 } 86 }
89 - 87 +
90 return this.drawingOptionsFormsManager.get(formId); 88 return this.drawingOptionsFormsManager.get(formId);
91 - 89 +
92 }, 90 },
93 -  
94 - updateDrawingOptions: function(drawingType, paramId) { 91 +
  92 + updateDrawingOptions: function (drawingType, paramId) {
95 var typeField = this.getForm().findField('param-drawing-type'); 93 var typeField = this.getForm().findField('param-drawing-type');
96 - 94 +
97 var availableDrawingObjects = this.object.getAvailableDrawingObjectByPlotType(this.crtTree.getSelectedPlotType()); 95 var availableDrawingObjects = this.object.getAvailableDrawingObjectByPlotType(this.crtTree.getSelectedPlotType());
98 typeField.getStore().loadData(availableDrawingObjects); 96 typeField.getStore().loadData(availableDrawingObjects);
99 typeField.suspendEvents(); 97 typeField.suspendEvents();
100 typeField.setValue(drawingType); 98 typeField.setValue(drawingType);
101 typeField.resumeEvents(false); 99 typeField.resumeEvents(false);
102 - 100 +
103 this.drawingOptionsContainer.removeAll(false); 101 this.drawingOptionsContainer.removeAll(false);
104 - 102 +
105 var drawingOptionsForm = this.getDrawingOptionsForm(drawingType); 103 var drawingOptionsForm = this.getDrawingOptionsForm(drawingType);
106 this.drawingOptionsContainer.add(drawingOptionsForm); 104 this.drawingOptionsContainer.add(drawingOptionsForm);
107 drawingOptionsForm.crtTree = this.crtTree; 105 drawingOptionsForm.crtTree = this.crtTree;
@@ -112,8 +110,8 @@ Ext.define(&#39;amdaPlotComp.PlotParamForm&#39;, { @@ -112,8 +110,8 @@ Ext.define(&#39;amdaPlotComp.PlotParamForm&#39;, {
112 uiScope.crtTree.refresh(); 110 uiScope.crtTree.refresh();
113 }); 111 });
114 }, 112 },
115 -  
116 - onChangeParamArgs: function(uiScope, args_key, newValue, oldValue, isTemplateArg) { 113 +
  114 + onChangeParamArgs: function (uiScope, args_key, newValue, oldValue, isTemplateArg) {
117 if ((uiScope.isFirstMsg) && (uiScope.object.get('type') == 2) && (uiScope.object.get('dim1-sum-type') == 0) && (uiScope.object.get('dim2-sum-type') == 0) && 115 if ((uiScope.isFirstMsg) && (uiScope.object.get('type') == 2) && (uiScope.object.get('dim1-sum-type') == 0) && (uiScope.object.get('dim2-sum-type') == 0) &&
118 (uiScope.object.get('dim1-index') == '*') && (uiScope.object.get('dim2-index') == '*')) { 116 (uiScope.object.get('dim1-index') == '*') && (uiScope.object.get('dim2-index') == '*')) {
119 uiScope.isFirstMsg = false; 117 uiScope.isFirstMsg = false;
@@ -121,35 +119,34 @@ Ext.define(&#39;amdaPlotComp.PlotParamForm&#39;, { @@ -121,35 +119,34 @@ Ext.define(&#39;amdaPlotComp.PlotParamForm&#39;, {
121 } 119 }
122 uiScope.crtTree.refresh(); 120 uiScope.crtTree.refresh();
123 }, 121 },
124 -  
125 - getFormItems: function() { 122 +
  123 + getFormItems: function () {
126 var me = this; 124 var me = this;
127 - 125 +
128 this.drawingOptionsContainer = Ext.create('Ext.container.Container', { 126 this.drawingOptionsContainer = Ext.create('Ext.container.Container', {
129 layout: 'fit' 127 layout: 'fit'
130 }); 128 });
131 - 129 +
132 this.paramArgs = Ext.create('amdaUI.ParamArgumentsUI', { 130 this.paramArgs = Ext.create('amdaUI.ParamArgumentsUI', {
133 - onChange : me.onChangeParamArgs, 131 + onChange: me.onChangeParamArgs,
134 scope: me 132 scope: me
135 }); 133 });
136 - 134 +
137 //ToDoparamArgsPlug 135 //ToDoparamArgsPlug
138 var paramInfoFieldSet = this.addStandardFieldSet('Arguments', '', [this.paramArgs]); 136 var paramInfoFieldSet = this.addStandardFieldSet('Arguments', '', [this.paramArgs]);
139 paramInfoFieldSet.collapsed = false; 137 paramInfoFieldSet.collapsed = false;
140 - 138 +
141 return [ 139 return [
142 - paramInfoFieldSet,  
143 - this.addStandardCombo('param-drawing-type', 'Drawing type', [{'key' : '', 'value' : 'None'}], function(name, value, oldValue) {  
144 - if (me.object.get('param-drawing-type') != value)  
145 - {  
146 - me.object.changeDrawingType(value);  
147 - me.object.set('param-drawing-type', value);  
148 - me.crtTree.refresh();  
149 - me.updateDrawingOptions(value);  
150 - }  
151 - }),  
152 - this.drawingOptionsContainer 140 + paramInfoFieldSet,
  141 + this.addStandardCombo('param-drawing-type', 'Drawing type', [{ 'key': '', 'value': 'None' }], function (name, value, oldValue) {
  142 + if (me.object.get('param-drawing-type') != value) {
  143 + me.object.changeDrawingType(value);
  144 + me.object.set('param-drawing-type', value);
  145 + me.crtTree.refresh();
  146 + me.updateDrawingOptions(value);
  147 + }
  148 + }),
  149 + this.drawingOptionsContainer
153 ]; 150 ];
154 } 151 }
155 }); 152 });
js/app/views/PlotComponents/PlotSpectroForm.js
@@ -10,46 +10,282 @@ @@ -10,46 +10,282 @@
10 10
11 Ext.define('amdaPlotComp.PlotSpectroForm', { 11 Ext.define('amdaPlotComp.PlotSpectroForm', {
12 extend: 'amdaPlotComp.PlotStandardForm', 12 extend: 'amdaPlotComp.PlotStandardForm',
13 -  
14 - setObject : function(object) { 13 +
  14 + requires: [
  15 + 'amdaUI.ParamArgumentsUI'
  16 + ],
  17 + setObject: function (object) {
  18 + this.data = object.data;
15 this.object = object.get('param-drawing-object'); 19 this.object = object.get('param-drawing-object');
  20 +
16 this.loadRecord(this.object); 21 this.loadRecord(this.object);
17 }, 22 },
18 -  
19 - getValuesRangeItems: function() { 23 +
  24 + getValuesRangeItems: function () {
  25 + return [
  26 + this.addStandardFloat2('spectro-value-min', 'Min value', -Number.MAX_VALUE, Number.MAX_VALUE, true),
  27 + this.addStandardFloat2('spectro-value-max', 'Max value', -Number.MAX_VALUE, Number.MAX_VALUE, true)
  28 + ];
  29 + },
  30 + getFilteringItems: function () {
  31 + return [
  32 + this.addStandardCombo('filtering-level', 'Level', amdaPlotObj.PlotObjectConfig.availableFilteringLevel)
  33 + ];
  34 + },
  35 +
  36 + /**
  37 + * Populate the comboBoxValue by the set of channel data related to the selected dimension
  38 + * @param {*} ref the reference of the current instance of this class
  39 + * @param {*} index dimension's index
  40 + * @param {*} comboBoxV the comboBoxValue
  41 + * @returns
  42 + */
  43 + populateComboBoxValue: (ref, index, comboBoxV) => {
  44 + if (ref.data[amdaPlotObj.PlotObjectConfig.bgSubstraction.tableName][index].variable)
  45 + return;
  46 +
  47 + const channelsData = ref.data[amdaPlotObj.PlotObjectConfig.bgSubstraction.tableName][index]
  48 + [amdaPlotObj.PlotObjectConfig.bgSubstraction.tableChannels];
  49 +
  50 + const keyTemp = amdaPlotObj.PlotObjectConfig.fieldComboBox.key;
  51 + const valueTemp = amdaPlotObj.PlotObjectConfig.fieldComboBox.value;
  52 +
  53 + const newDataForStore = [];
  54 + //Loop through the channels
  55 + for (channelIndex in channelsData) {
  56 + const channelData = channelsData[channelIndex];
  57 + let item = {};
  58 + item[keyTemp] = channelIndex;
  59 + item[valueTemp] = channelIndex + " : [" + channelData.min + " , " + channelData.max + "]";
  60 + newDataForStore.push(item);
  61 + }
  62 +
  63 + //Update the label of the field
  64 + comboBoxV.setFieldLabel(ref.data[amdaPlotObj.PlotObjectConfig.bgSubstraction.tableName][index]["name"]
  65 + + " (" + ref.data[amdaPlotObj.PlotObjectConfig.bgSubstraction.tableName][index]["units"] + ") ");
  66 +
  67 + comboBoxV.store.loadData(newDataForStore);
  68 + },
  69 +
  70 + /**
  71 + * Populate the comboBoxDim by the set of dimensions related to the selected parameter
  72 + * @param {*} ref the reference of the current instance of this class
  73 + * @param {*} comboBoxDim the comboBoxDim reference
  74 + */
  75 + populateComboBoxDim: (ref, comboBoxDim) => {
  76 + const keyTemp = amdaPlotObj.PlotObjectConfig.fieldComboBox.key;
  77 + const valueTemp = amdaPlotObj.PlotObjectConfig.fieldComboBox.value;
  78 +
  79 + const newDataForStore = [];
  80 + for (indexTable in ref.data[amdaPlotObj.PlotObjectConfig.bgSubstraction.tableName]) {
  81 + const table = ref.data[amdaPlotObj.PlotObjectConfig.bgSubstraction.tableName][indexTable];
  82 + let item = {};
  83 + item[keyTemp] = indexTable;
  84 + item[valueTemp] = table[amdaPlotObj.PlotObjectConfig.bgSubstraction.tableRelatedDim];
  85 + newDataForStore.push(item);
  86 + }
  87 +
  88 + //Set the new store
  89 + comboBoxDim.store.loadData(newDataForStore);
  90 + },
  91 +
  92 + /**
  93 + * Add a textInput which holds Background Substraction value when fixedvalue is selected
  94 + * @param {*} ref the reference of the current instance of this class
  95 + * @returns addStandardFloat2
  96 + */
  97 + addComboBoxBackgroundSubFixedValue: (ref) => {
  98 + return ref.addStandardFloat2(amdaPlotObj.PlotObjectConfig.bgSubstraction.value.textinputkey,
  99 + amdaPlotObj.PlotObjectConfig.bgSubstraction.value.textinputlabel, 0
  100 + , Number.MAX_VALUE, true, true, (name, newValue, oldValue) => {
  101 + if (oldValue !== newValue) {
  102 + if (!newValue) {
  103 + ref.object.set(amdaPlotObj.PlotObjectConfig.bgSubstraction.value.key,
  104 + amdaPlotObj.PlotObjectConfig.bgSubstraction.value.dimNullValue);
  105 + return;
  106 + }
  107 + ref.object.set(amdaPlotObj.PlotObjectConfig.bgSubstraction.value.key,
  108 + newValue);
  109 + }
  110 + });
  111 + },
  112 +
  113 + /**
  114 + * Reset ComboBoxDim and textInput
  115 + *
  116 + * @param {*} ref the reference of the current instance of this class
  117 + */
  118 + resetDependentComponents: (ref) => {
  119 + const comboBoxDim = ref.getForm().findField(amdaPlotObj.PlotObjectConfig.bgSubstraction.value.dimkey);
  120 + ref.populateComboBoxDim(ref, comboBoxDim);
  121 + comboBoxDim.setVisible(false);
  122 + comboBoxDim.setValue(amdaPlotObj.PlotObjectConfig.bgSubstraction.value.dimNullValue);
  123 +
  124 + const textInputV = ref.getForm().findField(amdaPlotObj.PlotObjectConfig.bgSubstraction.value.textinputkey);
  125 + textInputV.setVisible(false);
  126 + textInputV.setValue(null);
  127 + },
  128 +
  129 + /**
  130 + * Add a comboBox which holds Background Substraction type : bychannel, fixedvalue
  131 + * @param {*} ref the reference of the current instance of this class
  132 + * @returns StandardCombo
  133 + */
  134 + addComboBoxBackgroundSubType: (ref) => {
  135 + const data = [];
  136 + for (value in amdaPlotObj.PlotObjectConfig.bgSubstraction.type.values) {
  137 + const keyTemp = amdaPlotObj.PlotObjectConfig.fieldComboBox.key;
  138 + const valueTemp = amdaPlotObj.PlotObjectConfig.fieldComboBox.value;
  139 + let item = {};
  140 + item[keyTemp] = value;
  141 + item[valueTemp] = amdaPlotObj.PlotObjectConfig.bgSubstraction.type.values[value];
  142 + data.push(item);
  143 + }
  144 +
  145 + const comboBoxType = ref.addStandardCombo(amdaPlotObj.PlotObjectConfig.bgSubstraction.type.key,
  146 + amdaPlotObj.PlotObjectConfig.bgSubstraction.type.label, data,
  147 + (name, newKey, oldKey) => {
  148 + if (newKey !== oldKey) {
  149 + const newValue = amdaPlotObj.PlotObjectConfig.bgSubstraction.type.values[newKey];
  150 + if (newKey === null || newValue === undefined) {
  151 + ref.resetDependentComponents(ref);
  152 + return;
  153 + }
  154 +
  155 + //ComboBoxDim
  156 + const comboBoxDim = ref.getForm().findField(amdaPlotObj.PlotObjectConfig.bgSubstraction.value.dimkey);
  157 + //Fixed value input
  158 + const textInputV = ref.getForm().findField(amdaPlotObj.PlotObjectConfig.bgSubstraction.value.textinputkey);
  159 +
  160 + //By channel
  161 + if (newValue === amdaPlotObj.PlotObjectConfig.bgSubstraction.type.values.bychannel) {
  162 + const nbDims = ref.data[amdaPlotObj.PlotObjectConfig.bgSubstraction.tableName].length;
  163 + //Show comboBoxDim
  164 + comboBoxDim.select(comboBoxDim.store.getAt(0));
  165 + if (nbDims > 1)
  166 + comboBoxDim.setVisible(true);
  167 +
  168 + //Hide comboBoxDim
  169 + else
  170 + comboBoxDim.setVisible(false);
  171 +
  172 + //Hide text input
  173 + textInputV.setValue(null);
  174 + textInputV.setVisible(false);
  175 + }
  176 + //By fixed value
  177 + else if (newValue === amdaPlotObj.PlotObjectConfig.bgSubstraction.type.values.fixedvalue) {
  178 + //Hide comboBoxDim
  179 + comboBoxDim.setVisible(false);
  180 + comboBoxDim.setValue(amdaPlotObj.PlotObjectConfig.bgSubstraction.value.dimNullValue);
  181 + //Show text input
  182 + textInputV.setValue(null);
  183 + textInputV.setVisible(true);
  184 + }
  185 + //Another value
  186 + else {
  187 + console.warn("Unkown key : ", newKey);
  188 + }
  189 + }
  190 + });
  191 +
  192 + return comboBoxType;
  193 + },
  194 +
  195 + /**
  196 + * Add a comboBox which holds Background Substraction value
  197 + * @param {*} ref the reference of the current instance of this class
  198 + * @returns StandardCombo
  199 + */
  200 + addComboBoxBackgroundSubValue: (ref) => {
  201 + const comboBoxValue = ref.addStandardCombo(amdaPlotObj.PlotObjectConfig.bgSubstraction.value.key,
  202 + "", [],
  203 + (name, newKey, oldKey) => {
  204 + if (newKey !== oldKey) {
  205 + ref.object.set(amdaPlotObj.PlotObjectConfig.bgSubstraction.value.key,
  206 + newKey);
  207 + }
  208 + });
  209 +
  210 + return comboBoxValue;
  211 + },
  212 +
  213 + /**
  214 + * Add a comboBox which holds Background Substraction dimension
  215 + * @param {*} ref the reference of the current instance of this class
  216 + * @returns StandardCombo
  217 + */
  218 + addComboBoxBackgroundSubDim: (ref) => {
  219 + const comboBoxDim = ref.addStandardCombo(amdaPlotObj.PlotObjectConfig.bgSubstraction.value.dimkey,
  220 + amdaPlotObj.PlotObjectConfig.bgSubstraction.value.dimlabel, [],
  221 + (name, newKey, oldKey) => {
  222 + const comboBoxV = ref.getForm().findField(amdaPlotObj.PlotObjectConfig.bgSubstraction.value.key);
  223 +
  224 + if (newKey === amdaPlotObj.PlotObjectConfig.bgSubstraction.value.dimNullValue) {
  225 + comboBoxV.setValue(amdaPlotObj.PlotObjectConfig.bgSubstraction.value.dimNullValue);
  226 + comboBoxV.setVisible(false);
  227 + return;
  228 + }
  229 +
  230 + if (newKey !== null && newKey !== undefined) {
  231 + comboBoxV.setVisible(true);
  232 + ref.populateComboBoxValue(ref, newKey, comboBoxV);
  233 + comboBoxV.select(comboBoxV.store.getAt(0));
  234 + }
  235 +
  236 + ref.object.set(amdaPlotObj.PlotObjectConfig.bgSubstraction.value.dimkey,
  237 + newKey);
  238 +
  239 + });
  240 +
  241 + return comboBoxDim;
  242 + },
  243 +
  244 + /**
  245 + * Add Background Substraction items
  246 + * @returns StandardFieldSet
  247 + */
  248 + getBackgroundSubItems: function () {
20 return [ 249 return [
21 - this.addStandardFloat2('spectro-value-min', 'Min value', -Number.MAX_VALUE, Number.MAX_VALUE, true),  
22 - this.addStandardFloat2('spectro-value-max', 'Max value', -Number.MAX_VALUE, Number.MAX_VALUE, true) 250 + this.addComboBoxBackgroundSubType(this),
  251 + this.addComboBoxBackgroundSubDim(this),
  252 + this.addComboBoxBackgroundSubValue(this),
  253 + this.addComboBoxBackgroundSubFixedValue(this)
23 ]; 254 ];
24 }, 255 },
25 - getFilteringItems: function(){  
26 - return[  
27 - this.addStandardCombo('filtering-level', 'Level', amdaPlotObj.PlotObjectConfig.availableFilteringLevel)  
28 - ];  
29 - },  
30 -  
31 - getFormItems: function() {  
32 - var me = this; 256 +
  257 + getFormItems: function () {
  258 + const ref = this;
  259 + const field = this.addStandardFieldSet(amdaPlotObj.PlotObjectConfig.bgSubstraction.name,
  260 + amdaPlotObj.PlotObjectConfig.bgSubstraction.name, this.getBackgroundSubItems(),
  261 + function (name, newKey, oldKey) {
  262 + const comboBoxType = ref.getForm().findField(amdaPlotObj.PlotObjectConfig.bgSubstraction.type.key);
  263 + comboBoxType.setValue(null);
  264 + if (newKey) {
  265 + comboBoxType.setValue(Object.keys(amdaPlotObj.PlotObjectConfig.bgSubstraction.type.values)[0]);
  266 + }
  267 + });
  268 +
33 return [ 269 return [
34 - this.addStandardCombo('spectro-resolution', 'Points per plot', amdaPlotObj.PlotObjectConfig.availableResolutions, function(name, value, oldValue) {  
35 - me.object.set('spectro-resolution', value);  
36 - }),  
37 - this.addStandardCombo('spectro-yaxis', 'Y axis', amdaPlotObj.PlotObjectConfig.availableYAxes, function(name, value, oldValue) {  
38 - me.object.set('spectro-yaxis', value);  
39 - me.crtTree.refresh(); 270 + this.addStandardCombo('spectro-resolution', 'Points per plot', amdaPlotObj.PlotObjectConfig.availableResolutions, function (name, value, oldValue) {
  271 + ref.object.set('spectro-resolution', value);
  272 + }),
  273 + this.addStandardCombo('spectro-yaxis', 'Y axis', amdaPlotObj.PlotObjectConfig.availableYAxes, function (name, value, oldValue) {
  274 + ref.object.set('spectro-yaxis', value);
  275 + ref.crtTree.refresh();
40 }), 276 }),
41 - myDesktopApp.addAmdaInfo('MinMaxThreshold','vertical-align:bottom'), 277 + myDesktopApp.addAmdaInfo('MinMaxThreshold', 'vertical-align:bottom'),
42 this.addStandardFieldSet('Min/Max thresholds', '', this.getValuesRangeItems()), 278 this.addStandardFieldSet('Min/Max thresholds', '', this.getValuesRangeItems()),
43 - this.addStandardCheck('spectro-log0-as-min', 'Show 0 values as Min Values in log scale', function(name, value, oldValue) {  
44 - me.object.set('spectro-log0-as-min', value); 279 + this.addStandardCheck('spectro-log0-as-min', 'Show 0 values as Min Values in log scale', function (name, value, oldValue) {
  280 + ref.object.set('spectro-log0-as-min', value);
  281 + }),
  282 + this.addStandardCombo('spectro-normalization', 'Normalization', amdaPlotObj.PlotObjectConfig.availableSpectroNormalization, function (name, value, oldValue) {
  283 + if (ref.object.get('spectro-normalization') != value) {
  284 + ref.object.set('spectro-normalization', value);
  285 + }
45 }), 286 }),
46 - this.addStandardCombo('spectro-normalization', 'Normalization', amdaPlotObj.PlotObjectConfig.availableSpectroNormalization, function(name, value, oldValue) {  
47 - if (me.object.get('spectro-normalization') != value)  
48 - {  
49 - me.object.set('spectro-normalization', value);  
50 - }  
51 - }),  
52 - this.addStandardFieldSet('Spike Filtering ( ! Experimental ! )', 'filtering-activated', this.getFilteringItems()) 287 + this.addStandardFieldSet('Spike Filtering ( ! Experimental ! )', 'filtering-activated', this.getFilteringItems()),
  288 + field
53 ]; 289 ];
54 } 290 }
55 }); 291 });
js/app/views/PlotComponents/PlotStandardForm.js
@@ -10,112 +10,112 @@ @@ -10,112 +10,112 @@
10 10
11 Ext.define('amdaPlotComp.PlotStandardForm', { 11 Ext.define('amdaPlotComp.PlotStandardForm', {
12 extend: 'Ext.form.Panel', 12 extend: 'Ext.form.Panel',
13 -  
14 - requires : [  
15 - 'amdaPlotObj.PlotObjectConfig',  
16 - 'amdaPlotComp.EraseTrigger' 13 +
  14 + requires: [
  15 + 'amdaPlotObj.PlotObjectConfig',
  16 + 'amdaPlotComp.EraseTrigger'
17 ], 17 ],
18 -  
19 - //Object associated to this form  
20 - object: null,  
21 -  
22 - //Link to the tree  
23 - crtTree: null,  
24 - desableTickNumber:true,  
25 - desableTickSpacing:true,  
26 -  
27 - constructor: function(config) { 18 +
  19 + //Object associated to this form
  20 + object: null,
  21 +
  22 + //Link to the tree
  23 + crtTree: null,
  24 + desableTickNumber: true,
  25 + desableTickSpacing: true,
  26 +
  27 + constructor: function (config) {
28 this.init(config); 28 this.init(config);
29 this.callParent(arguments); 29 this.callParent(arguments);
30 }, 30 },
31 -  
32 - setObject : function(object) { 31 +
  32 + setObject: function (object) {
33 this.object = object; 33 this.object = object;
34 this.loadRecord(this.object); 34 this.loadRecord(this.object);
35 }, 35 },
36 - 36 +
37 //To override to add form components 37 //To override to add form components
38 - getFormItems: function() { 38 + getFormItems: function () {
39 return []; 39 return [];
40 }, 40 },
41 - 41 +
42 //Function called after element creation by PlotElementPanel 42 //Function called after element creation by PlotElementPanel
43 - updateElement: function(onAfterUpdate) {  
44 - if (onAfterUpdate)  
45 - onAfterUpdate();  
46 - },  
47 -  
48 - //  
49 - addStandardText: function(name, label, onChange) { 43 + updateElement: function (onAfterUpdate) {
  44 + if (onAfterUpdate)
  45 + onAfterUpdate();
  46 + },
  47 +
  48 + //
  49 + addStandardText: function (name, label, onChange) {
50 return { 50 return {
51 - xtype: 'textfield',  
52 - name: name,  
53 - fieldLabel: label,  
54 - listeners: {  
55 - change: function(field, newValue, oldValue, eOpts) {  
56 - this.object.set(name, newValue);  
57 - if (onChange != null)  
58 - onChange(name, newValue, oldValue);  
59 - },  
60 - scope: this  
61 - }  
62 - }; 51 + xtype: 'textfield',
  52 + name: name,
  53 + fieldLabel: label,
  54 + listeners: {
  55 + change: function (field, newValue, oldValue, eOpts) {
  56 + this.object.set(name, newValue);
  57 + if (onChange != null)
  58 + onChange(name, newValue, oldValue);
  59 + },
  60 + scope: this
  61 + }
  62 + };
63 }, 63 },
64 -  
65 - addStandardFloat: function(name, label, min, max, allowBlank, onChange) { 64 +
  65 + addStandardFloat: function (name, label, min, max, allowBlank, onChange) {
66 allowBlank = (typeof allowBlank !== 'undefined') ? allowBlank : false; 66 allowBlank = (typeof allowBlank !== 'undefined') ? allowBlank : false;
67 - 67 +
68 return { 68 return {
69 - xtype: 'numberfield',  
70 - name: name,  
71 - fieldLabel: label,  
72 - decimalPrecision : 20,  
73 - minValue : min,  
74 - maxValue : max,  
75 - allowBlank : allowBlank,  
76 - listeners: {  
77 - change: function(field, newValue, oldValue, eOpts) {  
78 - this.object.set(name, newValue);  
79 - if (onChange != null)  
80 - onChange(name, newValue, oldValue);  
81 - },  
82 - scope: this  
83 - }  
84 - }; 69 + xtype: 'numberfield',
  70 + name: name,
  71 + fieldLabel: label,
  72 + decimalPrecision: 20,
  73 + minValue: min,
  74 + maxValue: max,
  75 + allowBlank: allowBlank,
  76 + listeners: {
  77 + change: function (field, newValue, oldValue, eOpts) {
  78 + this.object.set(name, newValue);
  79 + if (onChange != null)
  80 + onChange(name, newValue, oldValue);
  81 + },
  82 + scope: this
  83 + }
  84 + };
85 }, 85 },
86 - addStandardInteger: function(name, label, min, max, allowBlank, hidden,onChange) { 86 + addStandardInteger: function (name, label, min, max, allowBlank, hidden, onChange) {
87 allowBlank = (typeof allowBlank !== 'undefined') ? allowBlank : false; 87 allowBlank = (typeof allowBlank !== 'undefined') ? allowBlank : false;
88 - 88 +
89 return { 89 return {
90 - xtype: 'numberfield',  
91 - name: name,  
92 - fieldLabel: label,  
93 - hidden : (hidden)? true:false,  
94 - regex:/^\d+$/,  
95 - decimalPrecision : 20,  
96 - minValue : min,  
97 - maxValue : max,  
98 - allowBlank : allowBlank,  
99 - listeners: {  
100 - change: function(field, newValue, oldValue, eOpts) {  
101 - this.object.set(name, newValue);  
102 - if (onChange != null)  
103 - onChange(name, newValue, oldValue);  
104 - },  
105 - scope: this  
106 - }  
107 - }; 90 + xtype: 'numberfield',
  91 + name: name,
  92 + fieldLabel: label,
  93 + hidden: (hidden) ? true : false,
  94 + regex: /^\d+$/,
  95 + decimalPrecision: 20,
  96 + minValue: min,
  97 + maxValue: max,
  98 + allowBlank: allowBlank,
  99 + listeners: {
  100 + change: function (field, newValue, oldValue, eOpts) {
  101 + this.object.set(name, newValue);
  102 + if (onChange != null)
  103 + onChange(name, newValue, oldValue);
  104 + },
  105 + scope: this
  106 + }
  107 + };
108 }, 108 },
109 109
110 - addStandardFloat2: function(name, label, min, max, allowBlank, hidden, onChange) { 110 + addStandardFloat2: function (name, label, min, max, allowBlank, hidden, onChange) {
111 allowBlank = (typeof allowBlank !== 'undefined') ? allowBlank : false; 111 allowBlank = (typeof allowBlank !== 'undefined') ? allowBlank : false;
112 112
113 return { 113 return {
114 xtype: 'textfield', 114 xtype: 'textfield',
115 name: name, 115 name: name,
116 fieldLabel: label, 116 fieldLabel: label,
117 - regex : /[-+]?(?:\d*\.?\d+|\d+\.?\d*)(?:[eE][-+]?\d+)?/,  
118 - hidden : (hidden)? true:false, 117 + regex: /[-+]?(?:\d*\.?\d+|\d+\.?\d*)(?:[eE][-+]?\d+)?/,
  118 + hidden: (hidden) ? true : false,
119 validator: function (val) { 119 validator: function (val) {
120 var errMsg = null; 120 var errMsg = null;
121 if (!allowBlank && Ext.isEmpty(val)) { 121 if (!allowBlank && Ext.isEmpty(val)) {
@@ -127,11 +127,11 @@ Ext.define(&#39;amdaPlotComp.PlotStandardForm&#39;, { @@ -127,11 +127,11 @@ Ext.define(&#39;amdaPlotComp.PlotStandardForm&#39;, {
127 else if ((typeof max !== 'undefined') && (parseFloat(val) > max)) { 127 else if ((typeof max !== 'undefined') && (parseFloat(val) > max)) {
128 errMsg = 'Max. allowed value is ' + max; 128 errMsg = 'Max. allowed value is ' + max;
129 } 129 }
130 - 130 +
131 return errMsg ? errMsg : true; 131 return errMsg ? errMsg : true;
132 }, 132 },
133 listeners: { 133 listeners: {
134 - change: function(field, newValue, oldValue, eOpts) { 134 + change: function (field, newValue, oldValue, eOpts) {
135 this.object.set(name, newValue); 135 this.object.set(name, newValue);
136 if (onChange != null) 136 if (onChange != null)
137 onChange(name, newValue, oldValue); 137 onChange(name, newValue, oldValue);
@@ -140,51 +140,51 @@ Ext.define(&#39;amdaPlotComp.PlotStandardForm&#39;, { @@ -140,51 +140,51 @@ Ext.define(&#39;amdaPlotComp.PlotStandardForm&#39;, {
140 } 140 }
141 }; 141 };
142 }, 142 },
143 -  
144 - addStandardCombo: function(name, label, availableData, onChange) { 143 +
  144 + addStandardCombo: function (name, label, availableData, onChange) {
145 var comboStore = Ext.create('Ext.data.Store', { 145 var comboStore = Ext.create('Ext.data.Store', {
146 - fields: ['key', 'value'],  
147 - data : availableData 146 + fields: [amdaPlotObj.PlotObjectConfig.fieldComboBox.key, amdaPlotObj.PlotObjectConfig.fieldComboBox.value],
  147 + data: availableData
148 }); 148 });
149 - 149 +
150 return { 150 return {
151 - xtype: 'combo',  
152 - name: name,  
153 - fieldLabel: label,  
154 - store: comboStore,  
155 - queryMode: 'local',  
156 - displayField: 'value',  
157 - valueField: 'key',  
158 - editable: false,  
159 - listeners: {  
160 - change: function(combo, newValue, oldValue, eOpts) {  
161 - if (onChange != null)  
162 - onChange(name, newValue, oldValue);  
163 - this.object.set(name, newValue);  
164 - },  
165 - scope: this  
166 - }  
167 - }; 151 + xtype: 'combo',
  152 + name: name,
  153 + fieldLabel: label,
  154 + store: comboStore,
  155 + queryMode: 'local',
  156 + displayField: 'value',
  157 + valueField: 'key',
  158 + editable: false,
  159 + listeners: {
  160 + change: function (combo, newValue, oldValue, eOpts) {
  161 + if (onChange != null)
  162 + onChange(name, newValue, oldValue);
  163 + this.object.set(name, newValue);
  164 + },
  165 + scope: this
  166 + }
  167 + };
168 }, 168 },
169 -  
170 - addStandardCheck: function(name, label, onChange, tooltip) { 169 +
  170 + addStandardCheck: function (name, label, onChange, tooltip) {
171 171
172 return { 172 return {
173 xtype: 'checkbox', 173 xtype: 'checkbox',
174 name: name, 174 name: name,
175 boxLabel: label, 175 boxLabel: label,
176 listeners: { 176 listeners: {
177 - change: function(combo, newValue, oldValue, eOpts) { 177 + change: function (combo, newValue, oldValue, eOpts) {
178 this.object.set(name, newValue); 178 this.object.set(name, newValue);
179 if (onChange != null) 179 if (onChange != null)
180 onChange(name, newValue, oldValue); 180 onChange(name, newValue, oldValue);
181 }, 181 },
182 - render: function(c) { 182 + render: function (c) {
183 if (tooltip) { 183 if (tooltip) {
184 Ext.create('Ext.tip.ToolTip', { 184 Ext.create('Ext.tip.ToolTip', {
185 target: c.getEl(), 185 target: c.getEl(),
186 dismissDelay: 0, 186 dismissDelay: 0,
187 - html: tooltip 187 + html: tooltip
188 }); 188 });
189 } 189 }
190 }, 190 },
@@ -192,34 +192,32 @@ Ext.define(&#39;amdaPlotComp.PlotStandardForm&#39;, { @@ -192,34 +192,32 @@ Ext.define(&#39;amdaPlotComp.PlotStandardForm&#39;, {
192 } 192 }
193 }; 193 };
194 }, 194 },
195 -  
196 - addStandardFieldSet: function(title, checkboxName, items, onChangeCheck) { 195 +
  196 + addStandardFieldSet: function (title, checkboxName, items, onChangeCheck) {
197 return { 197 return {
198 - xtype: 'fieldset',  
199 - cls : 'child-fieldset',  
200 - title: title,  
201 - collapsible: true,  
202 - collapsed: true,  
203 - checkboxName: checkboxName,  
204 - checkboxToggle: checkboxName != '',  
205 - layout: {  
206 - type: 'vbox',  
207 - pack: 'start',  
208 - align: 'stretch' 198 + xtype: 'fieldset',
  199 + cls: 'child-fieldset',
  200 + title: title,
  201 + collapsible: true,
  202 + collapsed: true,
  203 + checkboxName: checkboxName,
  204 + checkboxToggle: checkboxName != '',
  205 + layout: {
  206 + type: 'vbox',
  207 + pack: 'start',
  208 + align: 'stretch'
209 }, 209 },
210 items: items, 210 items: items,
211 listeners: { 211 listeners: {
212 - expand: function(fieldset, eOpts) {  
213 - if (checkboxName != '')  
214 - { 212 + expand: function (fieldset, eOpts) {
  213 + if (checkboxName != '') {
215 this.object.set(checkboxName, true); 214 this.object.set(checkboxName, true);
216 if (onChangeCheck != null) 215 if (onChangeCheck != null)
217 onChangeCheck(checkboxName, true, false); 216 onChangeCheck(checkboxName, true, false);
218 } 217 }
219 }, 218 },
220 - collapse: function(fieldset, eOpts) {  
221 - if (checkboxName != '')  
222 - { 219 + collapse: function (fieldset, eOpts) {
  220 + if (checkboxName != '') {
223 this.object.set(checkboxName, false); 221 this.object.set(checkboxName, false);
224 if (onChangeCheck != null) 222 if (onChangeCheck != null)
225 onChangeCheck(checkboxName, false, true); 223 onChangeCheck(checkboxName, false, true);
@@ -227,214 +225,213 @@ Ext.define(&#39;amdaPlotComp.PlotStandardForm&#39;, { @@ -227,214 +225,213 @@ Ext.define(&#39;amdaPlotComp.PlotStandardForm&#39;, {
227 }, 225 },
228 scope: this 226 scope: this
229 } 227 }
230 - }; 228 + };
231 }, 229 },
232 -  
233 - addStandardFont: function(namePrefix) { 230 +
  231 + addStandardFont: function (namePrefix) {
234 var fontItems = [ 232 var fontItems = [
235 - this.addStandardCombo(namePrefix+'-name', 'Name', amdaPlotObj.PlotObjectConfig.availableFontNames),  
236 - {  
237 - xtype : 'toolbar',  
238 - bodyStyle: { background : '#dfe8f6' }, 233 + this.addStandardCombo(namePrefix + '-name', 'Name', amdaPlotObj.PlotObjectConfig.availableFontNames),
  234 + {
  235 + xtype: 'toolbar',
  236 + bodyStyle: { background: '#dfe8f6' },
239 border: false, 237 border: false,
240 - items : [  
241 - {  
242 - xtype: 'numberfield',  
243 - name: namePrefix+'-size',  
244 - fieldLabel: 'Size',  
245 - labelWidth: 60,  
246 - width: 150,  
247 - maxValue: 32,  
248 - minValue: 6,  
249 - value: 12,  
250 - listeners: {  
251 - change: function(field, newValue, oldValue, eOpts) {  
252 - this.object.set(namePrefix+'-size', newValue);  
253 - },  
254 - scope: this  
255 - }  
256 - },  
257 - ' ',  
258 - {  
259 - xtype: 'checkbox',  
260 - name: namePrefix+'-bold',  
261 - boxLabel: '<b>B</b>',  
262 - width: 30,  
263 - listeners: {  
264 - change: function(combo, newValue, oldValue, eOpts) {  
265 - this.object.set(namePrefix+'-bold', newValue);  
266 - },  
267 - scope: this  
268 - }  
269 - },  
270 - {  
271 - xtype: 'checkbox',  
272 - name: namePrefix+'-italic',  
273 - boxLabel: '<i>I</i>',  
274 - width: 30,  
275 - listeners: {  
276 - change: function(combo, newValue, oldValue, eOpts) {  
277 - this.object.set(namePrefix+'-italic', newValue);  
278 - },  
279 - scope: this  
280 - }  
281 - }  
282 - ]  
283 - } 238 + items: [
  239 + {
  240 + xtype: 'numberfield',
  241 + name: namePrefix + '-size',
  242 + fieldLabel: 'Size',
  243 + labelWidth: 60,
  244 + width: 150,
  245 + maxValue: 32,
  246 + minValue: 6,
  247 + value: 12,
  248 + listeners: {
  249 + change: function (field, newValue, oldValue, eOpts) {
  250 + this.object.set(namePrefix + '-size', newValue);
  251 + },
  252 + scope: this
  253 + }
  254 + },
  255 + ' ',
  256 + {
  257 + xtype: 'checkbox',
  258 + name: namePrefix + '-bold',
  259 + boxLabel: '<b>B</b>',
  260 + width: 30,
  261 + listeners: {
  262 + change: function (combo, newValue, oldValue, eOpts) {
  263 + this.object.set(namePrefix + '-bold', newValue);
  264 + },
  265 + scope: this
  266 + }
  267 + },
  268 + {
  269 + xtype: 'checkbox',
  270 + name: namePrefix + '-italic',
  271 + boxLabel: '<i>I</i>',
  272 + width: 30,
  273 + listeners: {
  274 + change: function (combo, newValue, oldValue, eOpts) {
  275 + this.object.set(namePrefix + '-italic', newValue);
  276 + },
  277 + scope: this
  278 + }
  279 + }
  280 + ]
  281 + }
284 ]; 282 ];
285 -  
286 - return this.addStandardFieldSet('Font', namePrefix+'-activated', fontItems); 283 +
  284 + return this.addStandardFieldSet('Font', namePrefix + '-activated', fontItems);
287 }, 285 },
288 -  
289 - addStandardColor: function(name, label, availableData, onChange) { 286 +
  287 + addStandardColor: function (name, label, availableData, onChange) {
290 var comboStore = Ext.create('Ext.data.Store', { 288 var comboStore = Ext.create('Ext.data.Store', {
291 - fields: ['color', 'value'],  
292 - data : availableData 289 + fields: ['color', 'value'],
  290 + data: availableData
293 }); 291 });
294 - 292 +
295 return { 293 return {
296 - xtype: 'combo',  
297 - name: name,  
298 - fieldLabel: label,  
299 - store: comboStore,  
300 - queryMode: 'local',  
301 - displayField: 'value',  
302 - valueField: 'color',  
303 - editable: false,  
304 - tpl: Ext.create('Ext.XTemplate',  
305 - '<ul class="x-list-plain"><tpl for=".">',  
306 - '<li role="option" class="x-boundlist-item" style="color: {color};">{value}</li>',  
307 - '</tpl></ul>'  
308 - ),  
309 - // template for the content inside text field  
310 - displayTpl: Ext.create('Ext.XTemplate',  
311 - '<tpl for=".">',  
312 - '{value}',  
313 - '</tpl>'  
314 - ),  
315 -  
316 -  
317 - listeners: {  
318 - change: function(combo, newValue, oldValue, eOpts) {  
319 - this.object.set(name, newValue);  
320 - if (onChange != null)  
321 - onChange(name, newValue, oldValue);  
322 - },  
323 - scope: this  
324 - }  
325 - }; 294 + xtype: 'combo',
  295 + name: name,
  296 + fieldLabel: label,
  297 + store: comboStore,
  298 + queryMode: 'local',
  299 + displayField: 'value',
  300 + valueField: 'color',
  301 + editable: false,
  302 + tpl: Ext.create('Ext.XTemplate',
  303 + '<ul class="x-list-plain"><tpl for=".">',
  304 + '<li role="option" class="x-boundlist-item" style="color: {color};">{value}</li>',
  305 + '</tpl></ul>'
  306 + ),
  307 + // template for the content inside text field
  308 + displayTpl: Ext.create('Ext.XTemplate',
  309 + '<tpl for=".">',
  310 + '{value}',
  311 + '</tpl>'
  312 + ),
  313 +
  314 +
  315 + listeners: {
  316 + change: function (combo, newValue, oldValue, eOpts) {
  317 + this.object.set(name, newValue);
  318 + if (onChange != null)
  319 + onChange(name, newValue, oldValue);
  320 + },
  321 + scope: this
  322 + }
  323 + };
326 }, 324 },
327 -  
328 - addStandardParamDropTarget: function(name, label, onChange) { 325 +
  326 + addStandardParamDropTarget: function (name, label, onChange) {
329 return { 327 return {
330 - xtype: 'erasetrigger',  
331 - name: name,  
332 - fieldLabel: label,  
333 - emptyText: 'Drop a parameter',  
334 - listeners: {  
335 - change: function(field, newValue, oldValue, eOpts) {  
336 - this.object.set(name, newValue);  
337 - if (onChange != null)  
338 - onChange(name, newValue, oldValue);  
339 - },  
340 - afterrender: function(field, eOpts ){  
341 - var paramTarget = new Ext.dd.DropTarget(field.el.dom,  
342 - {  
343 - ddGroup: 'explorerTree',  
344 - notifyEnter: function(ddSource, e, data) {  
345 - },  
346 - notifyDrop: function(ddSource, e, data) {  
347 - var selectedRecord = ddSource.dragData.records[0];  
348 - switch (selectedRecord.$className)  
349 - {  
350 - case 'amdaModel.LocalParamNode' :  
351 - case 'amdaModel.RemoteParamNode' :  
352 - case 'amdaModel.RemoteSimuParamNode' :  
353 - if (!selectedRecord.get('isParameter') || selectedRecord.get('disable'))  
354 - return false;  
355 - if (selectedRecord.get('alias') != "" )  
356 - field.setValue("#"+selectedRecord.get('alias'));  
357 - else  
358 - field.setValue(selectedRecord.get('id'));  
359 - return true;  
360 - case 'amdaModel.AliasNode' :  
361 - if (!selectedRecord.isLeaf())  
362 - return false;  
363 - field.setValue("#"+selectedRecord.get('text'));  
364 - return true;  
365 - case 'amdaModel.DerivedParamNode' :  
366 - if (!selectedRecord.isLeaf())  
367 - return false;  
368 - field.setValue("ws_"+selectedRecord.get('text'));  
369 - return true;  
370 - case 'amdaModel.MyDataParamNode' :  
371 - if (!selectedRecord.isLeaf())  
372 - return false;  
373 - field.setValue("wsd_"+selectedRecord.get('text'));  
374 - return true;  
375 - default :  
376 - return false;  
377 - }  
378 - return true;  
379 - }  
380 - }  
381 - );  
382 - },  
383 - scope: this  
384 - }  
385 - }; 328 + xtype: 'erasetrigger',
  329 + name: name,
  330 + fieldLabel: label,
  331 + emptyText: 'Drop a parameter',
  332 + listeners: {
  333 + change: function (field, newValue, oldValue, eOpts) {
  334 + this.object.set(name, newValue);
  335 + if (onChange != null)
  336 + onChange(name, newValue, oldValue);
  337 + },
  338 + afterrender: function (field, eOpts) {
  339 + var paramTarget = new Ext.dd.DropTarget(field.el.dom,
  340 + {
  341 + ddGroup: 'explorerTree',
  342 + notifyEnter: function (ddSource, e, data) {
  343 + },
  344 + notifyDrop: function (ddSource, e, data) {
  345 + var selectedRecord = ddSource.dragData.records[0];
  346 + switch (selectedRecord.$className) {
  347 + case 'amdaModel.LocalParamNode':
  348 + case 'amdaModel.RemoteParamNode':
  349 + case 'amdaModel.RemoteSimuParamNode':
  350 + if (!selectedRecord.get('isParameter') || selectedRecord.get('disable'))
  351 + return false;
  352 + if (selectedRecord.get('alias') != "")
  353 + field.setValue("#" + selectedRecord.get('alias'));
  354 + else
  355 + field.setValue(selectedRecord.get('id'));
  356 + return true;
  357 + case 'amdaModel.AliasNode':
  358 + if (!selectedRecord.isLeaf())
  359 + return false;
  360 + field.setValue("#" + selectedRecord.get('text'));
  361 + return true;
  362 + case 'amdaModel.DerivedParamNode':
  363 + if (!selectedRecord.isLeaf())
  364 + return false;
  365 + field.setValue("ws_" + selectedRecord.get('text'));
  366 + return true;
  367 + case 'amdaModel.MyDataParamNode':
  368 + if (!selectedRecord.isLeaf())
  369 + return false;
  370 + field.setValue("wsd_" + selectedRecord.get('text'));
  371 + return true;
  372 + default:
  373 + return false;
  374 + }
  375 + return true;
  376 + }
  377 + }
  378 + );
  379 + },
  380 + scope: this
  381 + }
  382 + };
386 }, 383 },
387 -  
388 - addStandardDate: function(name, label, onChange) {  
389 - return {  
390 - xtype: 'datefield',  
391 - name: name,  
392 - format: 'Y/m/d H:i:s',  
393 - enforceMaxLength : true,  
394 - maxLength: 19,  
395 - fieldLabel: label,  
396 - listeners: {  
397 - change: function(field, newValue, oldValue, eOpts) {  
398 - this.object.set(name, newValue);  
399 - if (onChange != null)  
400 - onChange(name, newValue, oldValue);  
401 - },  
402 - scope : this  
403 - }  
404 - }; 384 +
  385 + addStandardDate: function (name, label, onChange) {
  386 + return {
  387 + xtype: 'datefield',
  388 + name: name,
  389 + format: 'Y/m/d H:i:s',
  390 + enforceMaxLength: true,
  391 + maxLength: 19,
  392 + fieldLabel: label,
  393 + listeners: {
  394 + change: function (field, newValue, oldValue, eOpts) {
  395 + this.object.set(name, newValue);
  396 + if (onChange != null)
  397 + onChange(name, newValue, oldValue);
  398 + },
  399 + scope: this
  400 + }
  401 + };
405 }, 402 },
406 -  
407 - addStandardLineItems: function(namePrefix) { 403 +
  404 + addStandardLineItems: function (namePrefix) {
408 return [ 405 return [
409 - this.addStandardCombo(namePrefix+'-style', 'Style', amdaPlotObj.PlotObjectConfig.availableLinesStyles),  
410 - this.addStandardFloat(namePrefix+'-width', 'Width', 1, 10),  
411 - this.addStandardColor(namePrefix+'-color', 'Color', amdaPlotObj.PlotObjectConfig.availableColors) 406 + this.addStandardCombo(namePrefix + '-style', 'Style', amdaPlotObj.PlotObjectConfig.availableLinesStyles),
  407 + this.addStandardFloat(namePrefix + '-width', 'Width', 1, 10),
  408 + this.addStandardColor(namePrefix + '-color', 'Color', amdaPlotObj.PlotObjectConfig.availableColors)
412 ]; 409 ];
413 }, 410 },
414 -  
415 - addStandardSymbolsItems: function(namePrefix) { 411 +
  412 + addStandardSymbolsItems: function (namePrefix) {
416 return [ 413 return [
417 - this.addStandardCombo(namePrefix+'-type', 'Type', amdaPlotObj.PlotObjectConfig.availableSymbolsTypes),  
418 - this.addStandardFloat(namePrefix+'-size', 'Size', 1, 10),  
419 - this.addStandardColor(namePrefix+'-color', 'Color', amdaPlotObj.PlotObjectConfig.availableColors)  
420 - ]; 414 + this.addStandardCombo(namePrefix + '-type', 'Type', amdaPlotObj.PlotObjectConfig.availableSymbolsTypes),
  415 + this.addStandardFloat(namePrefix + '-size', 'Size', 1, 10),
  416 + this.addStandardColor(namePrefix + '-color', 'Color', amdaPlotObj.PlotObjectConfig.availableColors)
  417 + ];
421 }, 418 },
422 -  
423 - init : function(config) { 419 +
  420 + init: function (config) {
424 var me = this; 421 var me = this;
425 - 422 +
426 var myConf = { 423 var myConf = {
427 - bodyPadding: 5,  
428 - bodyStyle: { background : '#dfe8f6' },  
429 - border: false,  
430 - layout: {  
431 - type: 'vbox',  
432 - pack: 'start',  
433 - align: 'stretch'  
434 - },  
435 - items: this.getFormItems() 424 + bodyPadding: 5,
  425 + bodyStyle: { background: '#dfe8f6' },
  426 + border: false,
  427 + layout: {
  428 + type: 'vbox',
  429 + pack: 'start',
  430 + align: 'stretch'
  431 + },
  432 + items: this.getFormItems()
436 }; 433 };
437 -  
438 - Ext.apply (this , Ext.apply (arguments, myConf)); 434 +
  435 + Ext.apply(this, Ext.apply(arguments, myConf));
439 } 436 }
440 }); 437 });