Commit 04b5da7a4ce97f2b1361590480ca9ed2e2fce4e7

Authored by Benjamin Renard
2 parents 02d7d98e 8202e86e

Merge develop into amdadev

js/app/models/PlotObjects/PlotObjectConfig.js
... ... @@ -143,7 +143,7 @@ Ext.define('amdaPlotObj.PlotObjectConfig', {
143 143 yAxis: 'y-left',
144 144 resolution: 3000
145 145 },
146   - sauvaud: {
  146 + sauvaud: {
147 147 yAxis: 'y-right',
148 148 resolution: 3000
149 149 },
... ... @@ -375,22 +375,22 @@ Ext.define('amdaPlotObj.PlotObjectConfig', {
375 375 ],
376 376  
377 377 availableColorsNew: [
378   - "#000000", "#0000ff", "#ff0000", "#00ffff", "#ff00ff", "#008000", "#800000",
379   - "#000080", "#808000", "#800080", "#c0c0c0", "#008080", "#ffff00", "#004040",
380   - "#29d8d7", "#6b9842", "#73a9b4", "#1c883d", "#808080", "#4342dd", "#e84130",
381   - "#dee2e6", "#ced4da", "#adb5bd", "#868e96", "#495057", "#343a40", "#212529",
382   - "#ffa8a8", "#ff8787", "#ff6b6b", "#fa5252", "#f03e3e", "#e03131", "#c92a2a",
383   - "#faa2c1", "#f783ac", "#f06595", "#e64980", "#d6336c", "#c2255c", "#a61e4d",
384   - "#e599f7", "#da77f2", "#cc5de8", "#be4bdb", "#ae3ec9", "#9c36b5", "#862e9c",
385   - "#b197fc", "#9775fa", "#845ef7", "#7950f2", "#7048e8", "#6741d9", "#5f3dc4",
386   - "#91a7ff", "#748ffc", "#5c7cfa", "#4c6ef5", "#4263eb", "#3b5bdb", "#364fc7",
387   - "#74c0fc", "#4dabf7", "#339af0", "#228be6", "#1c7ed6", "#1971c2", "#1864ab",
388   - "#66d9e8", "#3bc9db", "#22b8cf", "#15aabf", "#1098ad", "#0c8599", "#0b7285",
389   - "#63e6be", "#38d9a9", "#20c997", "#12b886", "#0ca678", "#099268", "#087f5b",
390   - "#8ce99a", "#69db7c", "#51cf66", "#40c057", "#37b24d", "#2f9e44", "#2b8a3e",
391   - "#c0eb75", "#a9e34b", "#94d82d", "#82c91e", "#74b816", "#66a80f", "#5c940d",
392   - "#ffe066", "#ffd43b", "#fcc419", "#fab005", "#f59f00", "#f08c00", "#e67700",
393   - "#ffc078", "#ffa94d", "#ff922b", "#fd7e14", "#f76707", "#e8590c", "#d9480f"
  378 + "#000000", "#0000ff", "#ff0000", "#00ffff", "#ff00ff", "#008000", "#800000",
  379 + "#000080", "#808000", "#800080", "#c0c0c0", "#008080", "#ffff00", "#004040",
  380 + "#29d8d7", "#6b9842", "#73a9b4", "#1c883d", "#808080", "#4342dd", "#e84130",
  381 + "#dee2e6", "#ced4da", "#adb5bd", "#868e96", "#495057", "#343a40", "#212529",
  382 + "#ffa8a8", "#ff8787", "#ff6b6b", "#fa5252", "#f03e3e", "#e03131", "#c92a2a",
  383 + "#faa2c1", "#f783ac", "#f06595", "#e64980", "#d6336c", "#c2255c", "#a61e4d",
  384 + "#e599f7", "#da77f2", "#cc5de8", "#be4bdb", "#ae3ec9", "#9c36b5", "#862e9c",
  385 + "#b197fc", "#9775fa", "#845ef7", "#7950f2", "#7048e8", "#6741d9", "#5f3dc4",
  386 + "#91a7ff", "#748ffc", "#5c7cfa", "#4c6ef5", "#4263eb", "#3b5bdb", "#364fc7",
  387 + "#74c0fc", "#4dabf7", "#339af0", "#228be6", "#1c7ed6", "#1971c2", "#1864ab",
  388 + "#66d9e8", "#3bc9db", "#22b8cf", "#15aabf", "#1098ad", "#0c8599", "#0b7285",
  389 + "#63e6be", "#38d9a9", "#20c997", "#12b886", "#0ca678", "#099268", "#087f5b",
  390 + "#8ce99a", "#69db7c", "#51cf66", "#40c057", "#37b24d", "#2f9e44", "#2b8a3e",
  391 + "#c0eb75", "#a9e34b", "#94d82d", "#82c91e", "#74b816", "#66a80f", "#5c940d",
  392 + "#ffe066", "#ffd43b", "#fcc419", "#fab005", "#f59f00", "#f08c00", "#e67700",
  393 + "#ffc078", "#ffa94d", "#ff922b", "#fd7e14", "#f76707", "#e8590c", "#d9480f"
394 394 ],
395 395  
396 396 availableBackgroundColors: [
... ... @@ -544,7 +544,6 @@ Ext.define('amdaPlotObj.PlotObjectConfig', {
544 544 dimNullValue: "-1"
545 545 }
546 546 },
547   -
548 547 getParamConfig: function (paramId, onParamConfigLoaded) {
549 548 AmdaAction.getParamPlotInit({ "paramId": paramId }, function (result, e) {
550 549 onParamConfigLoaded(result.success, result.data);
... ...
js/app/views/PlotComponents/PlotZoomPlug.js
... ... @@ -17,6 +17,8 @@
17 17 Ext.define('amdaPlotComp.PlotZoomPlug', {
18 18 extend: 'Ext.util.Observable',
19 19 alias: 'plugin.plotZoomPlugin',
  20 + requires: [
  21 + 'amdaPlotComp.plotFunction.ParamField', 'amdaPlotComp.plotFunction.FunctionType'],
20 22  
21 23 id: 'plot-zoom-plug',
22 24  
... ... @@ -30,6 +32,14 @@ Ext.define('amdaPlotComp.PlotZoomPlug', {
30 32 panelId: -1,
31 33  
32 34 linkedTTCatNode: null,
  35 + /**
  36 + * Un composant de 'PlotFunction' qui permet d'afficher le min samplig de chaque paramรจtre et le nombre de points thรฉoriques entre un start time et stop time
  37 + */
  38 + plotFunctionParamField: null,
  39 + /**
  40 + * Un composant de 'PlotFunction' qui permet ร  l'utilisateur de sรฉlรฉctionner le type de fonction ร  appliquer : FFT, SUM, ...
  41 + */
  42 + plotFunctionType: null,
33 43  
34 44 constructor: function (config) {
35 45 Ext.apply(this, config);
... ... @@ -44,12 +54,25 @@ Ext.define('amdaPlotComp.PlotZoomPlug', {
44 54 this.hostCmp = cmp;
45 55 },
46 56  
  57 + /**
  58 + * Set different parameters displayed on the current panel
  59 + * @param {*} listParams_ parameters displayed on the current panel
  60 + */
  61 + setParameters: function (listParams_) {
  62 + this.listParams = listParams_;
  63 + this.plotFunctionParamField = new amdaPlotComp.plotFunction.ParamField({ params: this.listParams });
  64 + this.plotFunctionType = new amdaPlotComp.plotFunction.FunctionType({});
  65 + },
  66 +
  67 +
47 68 setMinValue: function (min) {
48 69 if (!this.form)
49 70 return;
50 71  
51   - if (this.zoomType == 'timeAxis')
  72 + if (this.zoomType == 'timeAxis') {
52 73 this.form.getForm().findField('zoom-min-time').setValue(min);
  74 +
  75 + }
53 76 else
54 77 this.form.getForm().findField('zoom-min-float').setValue(min);
55 78 },
... ... @@ -60,12 +83,18 @@ Ext.define('amdaPlotComp.PlotZoomPlug', {
60 83  
61 84 if (this.zoomType == 'timeAxis') {
62 85 var minValue = this.form.getForm().findField('zoom-min-time').getValue();
63   - if (minValue <= max)
  86 + if (minValue <= max) {
64 87 this.form.getForm().findField('zoom-max-time').setValue(max);
  88 + if (this.isPlotFunction)
  89 + this.plotFunctionParamField.setValues(minValue, max);
  90 + }
65 91 else {
66 92 this.form.getForm().findField('zoom-min-time').setValue(max);
67 93 this.form.getForm().findField('zoom-max-time').setValue(minValue);
  94 + if (this.isPlotFunction)
  95 + this.plotFunctionParamField.setValues(max, minValue);
68 96 }
  97 +
69 98 }
70 99 else {
71 100 var minValue = this.form.getForm().findField('zoom-min-float').getValue();
... ... @@ -101,7 +130,8 @@ Ext.define(&#39;amdaPlotComp.PlotZoomPlug&#39;, {
101 130 /**
102 131 * creation of the window
103 132 */
104   - show: function (interactiveId, zoomType, panelId) {
  133 + show: function (interactiveId, zoomType, panelId, isPlotFunction_ = false) {
  134 + this.isPlotFunction = isPlotFunction_;
105 135 if (!this.win) {
106 136 this.win = new Ext.Window({
107 137 id: 'plot-zoom-win-' + this.hostCmp.ownerCt.getId(), // Plot window ID
... ... @@ -135,7 +165,6 @@ Ext.define(&#39;amdaPlotComp.PlotZoomPlug&#39;, {
135 165  
136 166 Ext.PluginManager.register(this);
137 167 }
138   -
139 168 this.interactiveId = interactiveId;
140 169 this.updateWinByType(zoomType, panelId);
141 170 this.win.show();
... ... @@ -157,15 +186,20 @@ Ext.define(&#39;amdaPlotComp.PlotZoomPlug&#39;, {
157 186  
158 187 switch (zoomType) {
159 188 case 'timeAxis':
160   - this.win.setTitle('Zoom on time axis');
  189 + if (this.isPlotFunction) {
  190 + const title = "Appliquer une Transformation";
  191 + this.win.setTitle(title + '-Panel Id: ' + panelId);
  192 + } else {
  193 + this.win.setTitle('Zoom on time axis & Interval selection - Panel Id : ' + panelId);
  194 + }
161 195 break;
162   - case 'y-left' :
  196 + case 'y-left':
163 197 this.win.setTitle('Zoom on Y Left axis - Panel Id : ' + panelId);
164 198 break;
165   - case 'y-right' :
  199 + case 'y-right':
166 200 this.win.setTitle('Zoom on Y Right axis - Panel Id : ' + panelId);
167 201 break;
168   - case 'xaxis_id' :
  202 + case 'xaxis_id':
169 203 this.win.setTitle('Zoom on X axis - Panel Id : ' + panelId);
170 204 break;
171 205 }
... ... @@ -193,18 +227,17 @@ Ext.define(&#39;amdaPlotComp.PlotZoomPlug&#39;, {
193 227  
194 228 this.hostCmp.panelImage.resetZoom();
195 229 },
196   - setTimePlot : function(){
  230 + setTimePlot: function () {
197 231 var timeObj = new Object();
198 232 timeObj.start = this.form.getForm().findField('zoom-min-time').getValue();
199 233 timeObj.stop = this.form.getForm().findField('zoom-max-time').getValue();
200 234 var plotModule = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.plot.id);
201 235 plotModule.setTimeInterval(timeObj);
202   - },
  236 + },
203 237 /**
204 238 * Main form
205 239 */
206 240 getFormConfig: function () {
207   -
208 241 var intervalFieldSet = {
209 242 xtype: 'fieldset',
210 243 title: 'Interval Selection',
... ... @@ -218,7 +251,7 @@ Ext.define(&#39;amdaPlotComp.PlotZoomPlug&#39;, {
218 251 items: [
219 252 {
220 253 xtype: 'datefield', name: 'zoom-min-time', fieldLabel: 'Start Time',
221   - format: 'Y/m/d H:i:s.u',
  254 + format: 'Y/m/d H:i:s.u',
222 255 },
223 256 {
224 257 xtype: 'datefield', name: 'zoom-max-time', fieldLabel: 'Stop Time',
... ... @@ -238,8 +271,8 @@ Ext.define(&#39;amdaPlotComp.PlotZoomPlug&#39;, {
238 271 handler: function () {
239 272 this.resetMinMaxValue();
240 273 }
241   - },
242   - {
  274 + },
  275 + {
243 276 xtype: 'button',
244 277 width: 100,
245 278 text: 'Use in Time Selection',
... ... @@ -252,11 +285,11 @@ Ext.define(&#39;amdaPlotComp.PlotZoomPlug&#39;, {
252 285 };
253 286  
254 287 var insertTypeStore = Ext.create('Ext.data.Store', {
255   - fields: ['key', 'name'],
256   - data : [
257   - {"key":"timeTable", "name":"TimeTable"},
258   - {"key":"catalog", "name":"Catalog"}
259   - ]
  288 + fields: ['key', 'name'],
  289 + data: [
  290 + { "key": "timeTable", "name": "TimeTable" },
  291 + { "key": "catalog", "name": "Catalog" }
  292 + ]
260 293 });
261 294  
262 295 var me = this;
... ... @@ -287,30 +320,30 @@ Ext.define(&#39;amdaPlotComp.PlotZoomPlug&#39;, {
287 320 fieldLabel: 'Name',
288 321 name: 'ttcat-name',
289 322 listeners:
290   - {
291   - render: function (o, op) {
292   - var field = this;
293   - var el = this.el;
294   - var dropTarget = Ext.create('Ext.dd.DropTarget', el, {
295   - ddGroup: 'explorerTree',
296   - notifyOver: function (ddSource, e, data) {
297   - var TTCatType = me.form.getForm().findField('ttcat-type').getValue();
298   - if (data.records[0].data.leaf && (data.records[0].data.nodeType == TTCatType)) {
299   - this.valid = true;
300   - return this.dropAllowed;
301   - }
302   - this.valid = false;
303   - return this.dropNotAllowed;
304   - },
305   - notifyDrop: function (ddSource, e, data) {
306   - if (!this.valid)
307   - return false;
308   - field.setValue(data.records[0].get('text'));
309   - return true;
  323 + {
  324 + render: function (o, op) {
  325 + var field = this;
  326 + var el = this.el;
  327 + var dropTarget = Ext.create('Ext.dd.DropTarget', el, {
  328 + ddGroup: 'explorerTree',
  329 + notifyOver: function (ddSource, e, data) {
  330 + var TTCatType = me.form.getForm().findField('ttcat-type').getValue();
  331 + if (data.records[0].data.leaf && (data.records[0].data.nodeType == TTCatType)) {
  332 + this.valid = true;
  333 + return this.dropAllowed;
310 334 }
311   - });
312   - }
  335 + this.valid = false;
  336 + return this.dropNotAllowed;
  337 + },
  338 + notifyDrop: function (ddSource, e, data) {
  339 + if (!this.valid)
  340 + return false;
  341 + field.setValue(data.records[0].get('text'));
  342 + return true;
  343 + }
  344 + });
313 345 }
  346 + }
314 347 },
315 348 {
316 349 xtype: 'button',
... ... @@ -347,31 +380,31 @@ Ext.define(&#39;amdaPlotComp.PlotZoomPlug&#39;, {
347 380 if (nodeWithSameName !== null)
348 381 me.linkedTTCatNode = nodeWithSameName;
349 382 else {
350   - module.createLinkedNode();
351   - module.getLinkedNode().set('text', TTCatName);
352   - me.linkedTTCatNode = module.getLinkedNode();
353   - var obj = {
354   - name: TTCatName,
355   - fromPlugin: true
  383 + module.createLinkedNode();
  384 + module.getLinkedNode().set('text', TTCatName);
  385 + me.linkedTTCatNode = module.getLinkedNode();
  386 + var obj = {
  387 + name: TTCatName,
  388 + fromPlugin: true
356 389 };
357   - if (isCatalog) {
358   - Ext.Msg.prompt('Define Parameters', 'Please enter parameters number for the new catalog:', function(btn, text){
359   - if (btn == 'ok'){
360   - obj.nbParameters = parseInt(text,10);
361   - if (isNaN(obj.nbParameters)) {
362   - obj.nbParameters = 1;
363   - }
364   - module.createObject(obj);
365   - me.linkedTTCatNode.editLeaf(function () {
366   - me.insertInterval();
367   - });
368   - }
369   - });
370   - return;
371   - }
372   - else {
373   - module.createObject(obj);
374   - }
  390 + if (isCatalog) {
  391 + Ext.Msg.prompt('Define Parameters', 'Please enter parameters number for the new catalog:', function (btn, text) {
  392 + if (btn == 'ok') {
  393 + obj.nbParameters = parseInt(text, 10);
  394 + if (isNaN(obj.nbParameters)) {
  395 + obj.nbParameters = 1;
  396 + }
  397 + module.createObject(obj);
  398 + me.linkedTTCatNode.editLeaf(function () {
  399 + me.insertInterval();
  400 + });
  401 + }
  402 + });
  403 + return;
  404 + }
  405 + else {
  406 + module.createObject(obj);
  407 + }
375 408 }
376 409  
377 410 me.linkedTTCatNode.editLeaf(function () {
... ... @@ -398,11 +431,13 @@ Ext.define(&#39;amdaPlotComp.PlotZoomPlug&#39;, {
398 431 },
399 432 items: [
400 433 intervalFieldSet,
401   - insertTTFieldSet
  434 + //Ici on rajoute les composants associรฉs ร  la fonctionnalitรฉ 'PlotFunction'
  435 + me.isPlotFunction ? this.plotFunctionType : insertTTFieldSet,
  436 + me.isPlotFunction ? this.plotFunctionParamField : null,
402 437 ],
403 438 fbar: [
404 439 {
405   - text: 'Apply Zoom',
  440 + text: me.isPlotFunction ? "Apply" : 'Apply Zoom',
406 441 width: 100,
407 442 scope: this,
408 443 handler: function () {
... ... @@ -420,14 +455,33 @@ Ext.define(&#39;amdaPlotComp.PlotZoomPlug&#39;, {
420 455 return;
421 456 }
422 457  
423   - this.hostCmp.callInteractivePlot({
424   - 'action': 'zoom',
425   - 'interactiveId': this.interactiveId,
426   - 'panelId': this.panelId,
427   - 'axeId': this.zoomType,
428   - 'min': minZoom,
429   - 'max': maxZoom
430   - });
  458 + if (me.isPlotFunction) {
  459 + const start_time = this.form.getForm().findField('zoom-min-time').getValue();
  460 + const stop_time = this.form.getForm().findField('zoom-max-time').getValue();
  461 +
  462 + let request_to_send = {};
  463 + request_to_send = Object.assign({}, me.plotFunctionType.getValues(), me.plotFunctionParamField.getValues());
  464 + request_to_send = Object.assign({}, request_to_send, {
  465 + 'action': 'plotFunction',
  466 + 'interactiveId': this.interactiveId,
  467 + 'panelId': this.panelId,
  468 + 'starttime': start_time,
  469 + 'stoptime': stop_time
  470 + });
  471 +
  472 + this.hostCmp.callInteractivePlot(request_to_send);
  473 +
  474 + } else {
  475 + this.hostCmp.callInteractivePlot({
  476 + 'action': 'zoom',
  477 + 'interactiveId': this.interactiveId,
  478 + 'panelId': this.panelId,
  479 + 'axeId': this.zoomType,
  480 + 'min': minZoom,
  481 + 'max': maxZoom
  482 + });
  483 + }
  484 +
431 485 this.hostCmp.panelImage.resetZoom();
432 486 }
433 487 },
... ... @@ -447,6 +501,10 @@ Ext.define(&#39;amdaPlotComp.PlotZoomPlug&#39;, {
447 501 }
448 502 ]
449 503 });
  504 +
  505 + this.plotFunctionType.setParent(this.form.getForm());
  506 + this.plotFunctionParamField.setParent(this.form.getForm());
450 507 return this.form;
451   - }
  508 + },
  509 +
452 510 });
... ...
js/app/views/PlotComponents/plotFunction/FunctionType.js 0 โ†’ 100644
... ... @@ -0,0 +1,201 @@
  1 +/**
  2 + * Un composant de 'PlotFunction' qui permet ร  l'utilisateur de sรฉlรฉctionner le type de fonction ร  appliquer : FFT, SUM, ...
  3 + */
  4 +Ext.define('amdaPlotComp.plotFunction.FunctionType', {
  5 + extend: 'Ext.form.Panel',
  6 + /**
  7 + * Le parent composant qui hรฉbรฉrge celui-ci
  8 + */
  9 + parent: null,
  10 + plotFunctionItems: {
  11 + type: {
  12 + name: "type",
  13 + field: "Function Type",
  14 + values: {
  15 + fft: "FFT",
  16 + sum: "AVG"
  17 + }
  18 + },
  19 + scale: {
  20 + name: "scale_abscisse",
  21 + field: "Scale Abscisse",
  22 + values: {
  23 + log: "Log",
  24 + linear: "Linear"
  25 + }
  26 + },
  27 + abscisse: {
  28 + name: "abscisse",
  29 + field: "Abscisse",
  30 + values: {
  31 + frequency: "Frequency",
  32 + period: "Period"
  33 + }
  34 + },
  35 + scale_ordonnee: {
  36 + name: "scale_ordonnee",
  37 + field: "Scale Ordonnรฉe"
  38 + }
  39 + },
  40 +
  41 + initComponent: function () {
  42 + const key_ = "key";
  43 + const name_ = "name";
  44 +
  45 + //Combobox to choose the type of fucntion to be applied
  46 + const data_function_type = [];
  47 + let item_type = {};
  48 + item_type[key_] = this.plotFunctionItems.type.values.fft;
  49 + item_type[name_] = this.plotFunctionItems.type.values.fft;
  50 + data_function_type.push(item_type);
  51 + item_type = {};
  52 + item_type[key_] = this.plotFunctionItems.type.values.sum;
  53 + item_type[name_] = this.plotFunctionItems.type.values.sum;
  54 + data_function_type.push(item_type);
  55 +
  56 + const function_type = Ext.create('Ext.data.Store', {
  57 + fields: [key_, name_],
  58 + data: data_function_type
  59 + });
  60 +
  61 + //Combo to choose type of scaling
  62 + const data_ = [];
  63 + const item_log = {};
  64 + item_log[key_] = this.plotFunctionItems.scale.values.log;
  65 + item_log[name_] = this.plotFunctionItems.scale.values.log;
  66 + //data_.push(item_log);
  67 +
  68 + const item_linear = {};
  69 + item_linear[key_] = this.plotFunctionItems.scale.values.linear;
  70 + item_linear[name_] = this.plotFunctionItems.scale.values.linear;
  71 + data_.push(item_linear);
  72 +
  73 + const scale = Ext.create('Ext.data.Store', {
  74 + fields: [key_, name_],
  75 + data: data_
  76 + });
  77 +
  78 + //Combo to choose x type data of FFT
  79 + const data__ = [];
  80 + const item_frequency = {};
  81 + item_frequency[key_] = this.plotFunctionItems.abscisse.values.frequency;
  82 + item_frequency[name_] = this.plotFunctionItems.abscisse.values.frequency;
  83 + data__.push(item_frequency);
  84 +
  85 + const item_period = {};
  86 + item_period[key_] = this.plotFunctionItems.abscisse.values.period;
  87 + item_period[name_] = this.plotFunctionItems.abscisse.values.period;
  88 + data__.push(item_period);
  89 +
  90 + const abscisse = Ext.create('Ext.data.Store', {
  91 + fields: [key_, name_],
  92 + data: data__
  93 + });
  94 +
  95 + const me = this;
  96 +
  97 + const tabParams = Ext.create('Ext.form.FieldSet', {
  98 + collapsible: false,
  99 + layout: {
  100 + type: 'vbox',
  101 + pack: 'start',
  102 + align: 'stretch',
  103 + },
  104 + bodyStyle: 'background: none',
  105 + items: [
  106 + {
  107 + xtype: 'combo',
  108 + fieldLabel: this.plotFunctionItems.type.field,
  109 + store: function_type,
  110 + queryMode: 'local',
  111 + displayField: name_,
  112 + valueField: key_,
  113 + editable: false,
  114 + value: this.plotFunctionItems.type.values.sum,
  115 + name: this.plotFunctionItems.type.name,
  116 + listeners: {
  117 + change: function (combo, value) {
  118 + if (value === me.plotFunctionItems.type.values.sum) {
  119 + me.parent.findField(me.plotFunctionItems.abscisse.name).setVisible(false);
  120 + }
  121 + else {
  122 + me.parent.findField(me.plotFunctionItems.abscisse.name).setVisible(true);
  123 + }
  124 + }
  125 + }
  126 + },
  127 + {
  128 + xtype: 'combo',
  129 + fieldLabel: this.plotFunctionItems.scale.field,
  130 + store: scale,
  131 + queryMode: 'local',
  132 + displayField: name_,
  133 + valueField: key_,
  134 + editable: false,
  135 + value: this.plotFunctionItems.scale.values.linear,
  136 + name: this.plotFunctionItems.scale.name
  137 + },
  138 + {
  139 + xtype: 'combo',
  140 + fieldLabel: this.plotFunctionItems.abscisse.field,
  141 + store: abscisse,
  142 + queryMode: 'local',
  143 + displayField: name_,
  144 + valueField: key_,
  145 + editable: false,
  146 + hidden: true,
  147 + value: this.plotFunctionItems.abscisse.values.frequency,
  148 + name: this.plotFunctionItems.abscisse.name
  149 + },
  150 + {
  151 + xtype: 'combo',
  152 + fieldLabel: this.plotFunctionItems.scale_ordonnee.field,
  153 + store: scale,
  154 + queryMode: 'local',
  155 + displayField: name_,
  156 + valueField: key_,
  157 + editable: false,
  158 + value: this.plotFunctionItems.scale.values.linear,
  159 + name: this.plotFunctionItems.scale_ordonnee.name
  160 + }
  161 + ]
  162 + });
  163 +
  164 + const config =
  165 + {
  166 + title: 'Function Type',
  167 + bodyStyle: { background: '#dfe8f6' },
  168 + items: [tabParams]
  169 + };
  170 +
  171 + Ext.apply(this, config);
  172 + this.callParent(arguments);
  173 + },
  174 +
  175 + /**
  176 + * Mettre ร  jour le parent
  177 + * @param {*} parent_ le parent qui va hรฉbรฉrger
  178 + */
  179 + setParent: function (parent_) {
  180 + this.parent = parent_;
  181 + },
  182 +
  183 + /**
  184 + * Retournes les valeurs des comboboxes associรฉes ร  ce composant
  185 + * @returns les valeurs des comboboxes se forme d'un dictionnaire
  186 + */
  187 + getValues: function () {
  188 + const value_scale = this.parent.findField(this.plotFunctionItems.scale.name).getValue();
  189 + const value_abscisse = this.parent.findField(this.plotFunctionItems.abscisse.name).getValue();
  190 + const value_scale_ordonnee = this.parent.findField(this.plotFunctionItems.scale_ordonnee.name).getValue();
  191 + const type_function = this.parent.findField(this.plotFunctionItems.type.name).getValue();
  192 +
  193 + let out = {};
  194 + out[this.plotFunctionItems.type.name] = type_function;
  195 + out[this.plotFunctionItems.abscisse.name] = value_abscisse;
  196 + out[this.plotFunctionItems.scale.name] = value_scale;
  197 + out[this.plotFunctionItems.scale_ordonnee.name] = value_scale_ordonnee;
  198 +
  199 + return out;
  200 + }
  201 +});
0 202 \ No newline at end of file
... ...
js/app/views/PlotComponents/plotFunction/ParamField.js 0 โ†’ 100644
... ... @@ -0,0 +1,124 @@
  1 +/**
  2 + * Un composant de 'PlotFunction' qui permet d'afficher le min samplig de chaque paramรจtre et le nombre de points thรฉoriques entre un start time et stop time
  3 + */
  4 +Ext.define('amdaPlotComp.plotFunction.ParamField', {
  5 + extend: 'Ext.form.Panel',
  6 + /**
  7 + * id du composant de type numberfield qui hรฉbรฉrge le min sampling
  8 + */
  9 + label_number_field: "NUMBERFIELD",
  10 + /**
  11 + * id du composant de type numberfield qui hรฉbรฉrge le nombre de points
  12 + */
  13 + label_number_field1: "NUMBERFIELD1",
  14 + /**
  15 + * Le composant parent de celui-ci
  16 + */
  17 + parent: null,
  18 +
  19 + initComponent: function () {
  20 + const items_params = [];
  21 + const minSampling = "Min Sampling (s)";
  22 + const minValue = 0;
  23 + const labelWitdh = 120;
  24 + const width = 30;
  25 +
  26 + for (p in this.params) {
  27 + const param = this.params[p];
  28 + const fieldSet = {
  29 + xtype: 'fieldset',
  30 + name: 'FIELDSET' + param.id,
  31 + title: param.id,
  32 + collapsible: false,
  33 + layout: {
  34 + type: 'vbox',
  35 + align: 'stretch',
  36 + },
  37 + items: [
  38 + {
  39 + xtype: 'numberfield',
  40 + name: this.label_number_field + param.id,
  41 + labelWidth: labelWitdh,
  42 + width: width,
  43 + value: param.MinSampling,
  44 + minValue: minValue,
  45 + disabled: true,
  46 + fieldLabel: minSampling
  47 + },
  48 + {
  49 + xtype: 'numberfield',
  50 + name: this.label_number_field1 + param.id,
  51 + labelWidth: labelWitdh,
  52 + width: width,
  53 + value: 0,
  54 + minValue: minValue,
  55 + fieldLabel: "Nb Points"
  56 + }
  57 + ]
  58 + };
  59 +
  60 + items_params.push(fieldSet);
  61 + }
  62 +
  63 + const tabParams = Ext.create('Ext.tab.Panel', {
  64 + layout: 'fit',
  65 + plain: true,
  66 + bodyStyle: 'background: none',
  67 + items: items_params
  68 + });
  69 +
  70 + const config =
  71 + {
  72 + title: 'Parameters Sampling',
  73 + layout: 'fit',
  74 + bodyStyle: { background: '#dfe8f6' },
  75 + items: [tabParams]
  76 + };
  77 +
  78 + Ext.apply(this, config);
  79 + //Les arguments sont les paramรจtres, chaque paramรจtre contient un id et un min Sampling
  80 + this.callParent(arguments);
  81 + },
  82 +
  83 + /**
  84 + * Set parent
  85 + * @param {*} parent_ le parent qui contient ce composant
  86 + */
  87 + setParent: function (parent_) {
  88 + this.parent = parent_;
  89 + },
  90 +
  91 + /**
  92 + * Retourne les valeurs d'id, min sampling et nb_points de tout les parametres passรฉs comme argument
  93 + * @returns id1@minSampling1@nb_points1@id2@minSampling2@nb_points2....
  94 + */
  95 + getValues: function () {
  96 + let list = "";
  97 + const delimeter = "@";
  98 + let i = 0;
  99 + for (p in this.params) {
  100 + let param = this.params[p];
  101 + const ui_item = this.parent.findField(this.label_number_field1 + param.id);
  102 + if (i > 0) list += delimeter;
  103 + if (ui_item !== undefined && ui_item !== null) {
  104 + list += param.id + delimeter + param.MinSampling + delimeter + ui_item.getValue();
  105 + }
  106 + i++;
  107 + }
  108 + return { "param_nb_points": list };
  109 + },
  110 +
  111 + /**
  112 + * Mettre ร  jour le nb_points en fonction de la valeur de start time et stop time passรฉs en paramรจtres
  113 + * @param {*} startTime le start time issu du ZoomPlugin
  114 + * @param {*} stopTime le stop time issu du ZoomPlugin
  115 + */
  116 + setValues: function (startTime, stopTime) {
  117 + for (p in this.params) {
  118 + let param = this.params[p];
  119 + const nb_points = (stopTime - startTime) / param.MinSampling;
  120 + const ui_item = this.parent.findField(this.label_number_field1 + param.id);
  121 + ui_item.setValue(parseInt(nb_points));
  122 + }
  123 + }
  124 +});
0 125 \ No newline at end of file
... ...
js/app/views/PlotTabResultUI.js
... ... @@ -29,6 +29,7 @@ Ext.define(&#39;amdaUI.PlotTabResultUI&#39;, {
29 29 disableSynchronize: false,
30 30 multiplot: false,
31 31 plotName: '',
  32 + listParams: [],
32 33  
33 34 hiddenForm: null,
34 35  
... ... @@ -77,6 +78,9 @@ Ext.define(&#39;amdaUI.PlotTabResultUI&#39;, {
77 78  
78 79 var panelContext = amdaPlotComp.PlotContextManager.getPanelById(this.crtContext, panelId);
79 80 var size = this.getImageSize();
  81 + // We need a list of parameters to compute the number of points needed to apply FFT
  82 + this.listParams = panelContext["parameters"];
  83 + zoomPlugin.setParameters(this.listParams);
80 84  
81 85 var me = this;
82 86 var insertIntervalItem = null;
... ... @@ -153,6 +157,16 @@ Ext.define(&#39;amdaUI.PlotTabResultUI&#39;, {
153 157 },
154 158 scope: this
155 159 });
  160 + //plotFunction Menu
  161 + me.contextualMenu.add({
  162 + text: 'Appliquer une Transformation',
  163 + handler: function (item, e) {
  164 + zoomPlugin.show(me.interactiveId, axis.id, panelContext.id, true);
  165 + zoomPlugin.resetMinMaxValue();
  166 + me.panelImage.startZoom(true, 0, size.height, onMinTimeSelection, onMaxTimeSelection);
  167 + },
  168 + scope: this
  169 + });
156 170 insertIntervalItem = {
157 171 text: 'Insert Interval in TimeTable or Catalog',
158 172 handler: function (item, e) {
... ... @@ -529,25 +543,25 @@ Ext.define(&#39;amdaUI.PlotTabResultUI&#39;, {
529 543 this.callInteractivePlot({ 'action': 'goto', 'interactiveId': this.interactiveId, 'ttFileIndex': ttFileIndex, 'intIndex': ttintervalIndex });
530 544 }
531 545 },
532   - '-',
  546 + '-',
533 547 {
534 548 text: 'Use This Time Inteval',
535 549 scope: this,
536   - handler: function(){
537   - var timeObj = new Object();
538   - var startTime = new Date(this.crtContext.page.startTime*1000);
539   - timeObj.start = Ext.Date.add(startTime, Ext.Date.MINUTE, startTime.getTimezoneOffset());
540   -
541   - var stopTime = new Date(this.crtContext.page.stopTime*1000);
542   - timeObj.stop = Ext.Date.add(stopTime, Ext.Date.MINUTE, stopTime.getTimezoneOffset());
  550 + handler: function () {
  551 + var timeObj = new Object();
  552 + var startTime = new Date(this.crtContext.page.startTime * 1000);
  553 + timeObj.start = Ext.Date.add(startTime, Ext.Date.MINUTE, startTime.getTimezoneOffset());
  554 +
  555 + var stopTime = new Date(this.crtContext.page.stopTime * 1000);
  556 + timeObj.stop = Ext.Date.add(stopTime, Ext.Date.MINUTE, stopTime.getTimezoneOffset());
543 557  
544 558 var plotModule = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.plot.id);
545   - plotModule.setTimeInterval(timeObj);
  559 + plotModule.setTimeInterval(timeObj);
546 560 }
547 561 },
548   - '-',
549   - {
550   - text: 'Go to Interval #',
  562 + '-',
  563 + {
  564 + text: 'Go to Interval #',
551 565 scope: this,
552 566 handler: function (bt) {
553 567 var ttGotoNumberField = this.navToolBar.items.get('tt-goto-number-' + this.interactiveId);
... ...