Commit f85f44e4fdc5c912913045c23057ebf2761bbf0d

Authored by Benjamin Renard
1 parent 4f1c058a

us okkkkkkkkkk

js/app/models/InteractiveNode.js
... ... @@ -475,6 +475,18 @@ Ext.define('amdaModel.InteractiveNode', {
475 475 case 'amdaModel.AliasNode' :
476 476 paramName = "#"+node.get('text');
477 477 break;
  478 + case 'amdaModel.DerivedParamComponentNode' :
  479 + paramId = node.get('text');
  480 + var parentId = paramId.substr(0, paramId.length - 3);
  481 + paramName= "ws_" + parentId;
  482 + var regExp = /\(([\d]+)\)/;
  483 + var component_index = regExp.exec(paramId);
  484 + if (component_index)
  485 + {
  486 + components = [];
  487 + components['index1'] = component_index[1];
  488 + }
  489 + break;
478 490 case 'amdaModel.DerivedParamNode' :
479 491 paramName = "ws_"+node.get('text');
480 492 break;
... ...
js/app/views/DownloadUI.js
... ... @@ -131,12 +131,14 @@ Ext.define('amdaUI.DownloadUI', {
131 131 {
132 132 var arrayRec = new Array();
133 133 var index = 1;
  134 +
134 135 if (arrayParams)
135 136 {
136   - index = 0;
137 137 Ext.Array.each(arrayParams, function (item) {
138 138 if (Ext.isObject(item)) {
139   - if (typeof paramId !== 'undefined')
  139 + // handel case of derived parameters
  140 + var patt = new RegExp("ws_");
  141 + if (typeof paramId !== 'undefined' && ! patt.test(item.paramid))
140 142 {
141 143 // for Parameter Name in Download Module
142 144 var paramObj = {
... ...
js/app/views/ParameterUI.js
... ... @@ -152,16 +152,18 @@ Ext.define('amdaUI.ParameterUI',
152 152 buildchain:this.object.get('buildchain'),
153 153 timestep:this.object.get('timestep')
154 154 };
  155 + loadMask.show();
155 156 AmdaAction.generateParamInfo(obj, function (result, e) {
156 157 if (!result || !result.success)
157 158 {
  159 + loadMask.hide();
158 160 if (result.message)
159 161 myDesktopApp.warningMsg(result.message);
160 162 else
161 163 myDesktopApp.warningMsg('Unknown error during parameter compilation');
162 164 return;
163 165 }
164   -
  166 + loadMask.hide();
165 167 paramModule.linkedNode.get('object').set('dim_1', parseInt(result.dimensions.dim_1));
166 168 paramModule.linkedNode.get('object').set('dim_2', parseInt(result.dimensions.dim_2));
167 169 if (onSuccess)
... ... @@ -206,24 +208,20 @@ Ext.define('amdaUI.ParameterUI',
206 208 this.object = paramobj;
207 209 if (toRename) paramModule.linkedNode.toRename = true;
208 210 }
209   - loadMask.show();
210 211 this.generateParamInfo(function () {
211 212 paramModule.linkedNode.set('isParameter', true);
212 213 paramModule.linkedNode.create({scope : this, callback : function() {
213   - loadMask.hide();
214 214 }});
215 215 });
216 216 } else
217 217 {
218 218 paramModule.linkedNode.set('contextNode',paramModule.contextNode);
219   - loadMask.show();
220 219 this.generateParamInfo(function () {
221 220 paramModule.linkedNode.update({scope : this, callback : function() {
222   - loadMask.hide();
223 221 }});
224 222 });
225 223 }
226   - }
  224 + }
227 225 },
228 226  
229 227 /**
... ...
js/app/views/PlotComponents/PlotTree.js
... ... @@ -694,7 +694,19 @@ Ext.define('amdaPlotComp.PlotTree', {
694 694 if (!record.get('isParameter'))
695 695 return false;
696 696 //targetNode, position, paramId, paramComponents, isVector, plotOnly
697   - this.dropParamToCreate(targetNode, position, "ws_" + record.get('text'));
  697 + var components = null;
  698 + var dim1=record.get("dim_1");
  699 + var dim2=record.get("dim_2");
  700 + if(dim1>3 && dim2==1)
  701 + {
  702 + components = [];
  703 + components['index2'] ="0"
  704 + }else if(dim1==1 && dim2>1)
  705 + {
  706 + components = [];
  707 + components['index1'] ="0"
  708 + }
  709 + this.dropParamToCreate(targetNode, position, "ws_" + record.get('text'),components);
698 710 return true;
699 711 case 'amdaModel.DerivedParamComponentNode':
700 712 if (!record.get('isParameter'))
... ... @@ -776,7 +788,6 @@ Ext.define('amdaPlotComp.PlotTree', {
776 788 if (dataLength > 1)
777 789 return false;
778 790 var draggedRecord = draggedRecords[0];
779   - console.log(me.isValidToDrop(draggedRecord,targetNode,position));
780 791 return me.isValidToDrop(draggedRecord,targetNode,position);
781 792 },
782 793 onPlotContainerDrop : function(dd, e, data){
... ...
js/app/views/PlotUI.js
... ... @@ -102,8 +102,9 @@ Ext.define('amdaUI.PlotUI', {
102 102 if (this.object.get('last-plotted-tab') == 0) {
103 103 this.object.set('last-plotted-tab', this.plotTabs.getSelectedTabId());
104 104 }
105   - var downObject = amdaModel.DownloadNode.decodeObject(this.object);
106   - amdaModel.DownloadNode.set('object',Ext.create('amdaModel.Download',downObject));
  105 + var downObject = amdaModel.DownloadNode.decodeObject(this.object);
  106 + amdaModel.DownloadNode.set('object',Ext.create('amdaModel.Download',downObject));
  107 +
107 108 amdaModel.DownloadNode.editInModule();
108 109 },
109 110  
... ...