Commit e27eecbd4eca3eb48cdea4f4ce3d0def8f41addd

Authored by Benjamin Renard
1 parent 7cf5fd16

Save and load TT list for a plot request

js/app/views/PlotComponents/PlotTabContent.js
... ... @@ -39,6 +39,12 @@ Ext.define('amdaPlotComp.PlotTabContent', {
39 39 this.object = object;
40 40 this.treePlot.buildTree(this.object);
41 41 this.timeSelector.intervalSel.setInterval(this.object.get('startDate'), this.object.get('stopDate'));
  42 + this.addTTs(this.object.get('timeTables'));
  43 + },
  44 +
  45 + addTTs : function(TTarray) {
  46 + // set TTTab
  47 + this.timeSelector.setTTTab(TTarray);
42 48 },
43 49  
44 50 updateLinkedToMultiPlotMode : function (isLinkedToMultiPlotMode) {
... ...
js/app/views/PlotComponents/PlotTree.js
... ... @@ -426,36 +426,6 @@ Ext.define('amdaPlotComp.PlotTree', {
426 426 return true;
427 427 }
428 428 return false;
429   -
430   - /*var fromIndex = targetNode.parentNode.indexOf(record);
431   - var toIndex = targetNode.parentNode.indexOf(targetNode);
432   -
433   - var fromRecord = this.tabObject.panels().getAt(fromIndex);
434   - if (!fromRecord)
435   - return false;
436   -
437   - switch (position)
438   - {
439   - case 'before' :
440   - this.tabObject.panels().data.removeAt(fromIndex);
441   - var insertIndex = (fromIndex > toIndex) ? toIndex : toIndex - 1;
442   - this.tabObject.panels().data.insert(insertIndex, fromRecord);
443   - this.buildPanelsNode();
444   - this.getSelectionModel().select(this.panelsNode.getChildAt(insertIndex));
445   - return true;
446   - case 'after' :
447   - this.tabObject.panels().data.removeAt(fromIndex);
448   - var insertIndex = (fromIndex > toIndex) ? toIndex + 1 : toIndex;
449   - this.tabObject.panels().data.insert(insertIndex, fromRecord);
450   - this.buildPanelsNode();
451   - this.getSelectionModel().select(this.panelsNode.getChildAt(insertIndex));
452   - return true;
453   - break;
454   - default :
455   - return false;
456   - }*/
457   -
458   - return true;
459 429 },
460 430  
461 431 onNodeSelect: function(tree, record, index, eOpts) {
... ...
js/app/views/PlotUI.js
... ... @@ -44,6 +44,7 @@ Ext.define('amdaUI.PlotUI', {
44 44 this.plotOutput.setObject(this.object);
45 45 this.plotTabs.setRequestObject(this.object);
46 46 this.timeSelector.intervalSel.setInterval(this.object.get('startDate'), this.object.get('stopDate'));
  47 + this.addTTs(this.object.get('timeTables'));
47 48 },
48 49  
49 50 saveProcess : function() {
... ... @@ -51,6 +52,8 @@ Ext.define('amdaUI.PlotUI', {
51 52 if (!plotModule)
52 53 return;
53 54  
  55 + this.updateObject();
  56 +
54 57 if ((this.object.get('id') != '') && (plotModule.linkedNode.get('text') == this.object.get('name')))
55 58 //update existing request
56 59 plotModule.linkedNode.update();
... ... @@ -150,6 +153,11 @@ Ext.define('amdaUI.PlotUI', {
150 153 if (crtTimeSelector)
151 154 crtTimeSelector.addTT(newTTName,newTTid);
152 155 },
  156 +
  157 + addTTs : function(TTarray) {
  158 + // set TTTab
  159 + this.timeSelector.setTTTab(TTarray);
  160 + },
153 161  
154 162 /**
155 163 * Set Start-Stop from parameter info (Local & MyData)
... ...