diff --git a/js/app/models/InteractiveNode.js b/js/app/models/InteractiveNode.js index 7e4ecba..51be87d 100644 --- a/js/app/models/InteractiveNode.js +++ b/js/app/models/InteractiveNode.js @@ -475,6 +475,18 @@ Ext.define('amdaModel.InteractiveNode', { case 'amdaModel.AliasNode' : paramName = "#"+node.get('text'); break; + case 'amdaModel.DerivedParamComponentNode' : + paramId = node.get('text'); + var parentId = paramId.substr(0, paramId.length - 3); + paramName= "ws_" + parentId; + var regExp = /\(([\d]+)\)/; + var component_index = regExp.exec(paramId); + if (component_index) + { + components = []; + components['index1'] = component_index[1]; + } + break; case 'amdaModel.DerivedParamNode' : paramName = "ws_"+node.get('text'); break; diff --git a/js/app/views/DownloadUI.js b/js/app/views/DownloadUI.js index 8b9bec4..d724806 100644 --- a/js/app/views/DownloadUI.js +++ b/js/app/views/DownloadUI.js @@ -131,12 +131,14 @@ Ext.define('amdaUI.DownloadUI', { { var arrayRec = new Array(); var index = 1; + if (arrayParams) { - index = 0; Ext.Array.each(arrayParams, function (item) { if (Ext.isObject(item)) { - if (typeof paramId !== 'undefined') + // handel case of derived parameters + var patt = new RegExp("ws_"); + if (typeof paramId !== 'undefined' && ! patt.test(item.paramid)) { // for Parameter Name in Download Module var paramObj = { diff --git a/js/app/views/ParameterUI.js b/js/app/views/ParameterUI.js index dae152b..0525614 100755 --- a/js/app/views/ParameterUI.js +++ b/js/app/views/ParameterUI.js @@ -152,16 +152,18 @@ Ext.define('amdaUI.ParameterUI', buildchain:this.object.get('buildchain'), timestep:this.object.get('timestep') }; + loadMask.show(); AmdaAction.generateParamInfo(obj, function (result, e) { if (!result || !result.success) { + loadMask.hide(); if (result.message) myDesktopApp.warningMsg(result.message); else myDesktopApp.warningMsg('Unknown error during parameter compilation'); return; } - + loadMask.hide(); paramModule.linkedNode.get('object').set('dim_1', parseInt(result.dimensions.dim_1)); paramModule.linkedNode.get('object').set('dim_2', parseInt(result.dimensions.dim_2)); if (onSuccess) @@ -206,24 +208,20 @@ Ext.define('amdaUI.ParameterUI', this.object = paramobj; if (toRename) paramModule.linkedNode.toRename = true; } - loadMask.show(); this.generateParamInfo(function () { paramModule.linkedNode.set('isParameter', true); paramModule.linkedNode.create({scope : this, callback : function() { - loadMask.hide(); }}); }); } else { paramModule.linkedNode.set('contextNode',paramModule.contextNode); - loadMask.show(); this.generateParamInfo(function () { paramModule.linkedNode.update({scope : this, callback : function() { - loadMask.hide(); }}); }); } - } + } }, /** diff --git a/js/app/views/PlotComponents/PlotTree.js b/js/app/views/PlotComponents/PlotTree.js index c4df699..ed85cb5 100644 --- a/js/app/views/PlotComponents/PlotTree.js +++ b/js/app/views/PlotComponents/PlotTree.js @@ -694,7 +694,19 @@ Ext.define('amdaPlotComp.PlotTree', { if (!record.get('isParameter')) return false; //targetNode, position, paramId, paramComponents, isVector, plotOnly - this.dropParamToCreate(targetNode, position, "ws_" + record.get('text')); + var components = null; + var dim1=record.get("dim_1"); + var dim2=record.get("dim_2"); + if(dim1>3 && dim2==1) + { + components = []; + components['index2'] ="0" + }else if(dim1==1 && dim2>1) + { + components = []; + components['index1'] ="0" + } + this.dropParamToCreate(targetNode, position, "ws_" + record.get('text'),components); return true; case 'amdaModel.DerivedParamComponentNode': if (!record.get('isParameter')) @@ -776,7 +788,6 @@ Ext.define('amdaPlotComp.PlotTree', { if (dataLength > 1) return false; var draggedRecord = draggedRecords[0]; - console.log(me.isValidToDrop(draggedRecord,targetNode,position)); return me.isValidToDrop(draggedRecord,targetNode,position); }, onPlotContainerDrop : function(dd, e, data){ diff --git a/js/app/views/PlotUI.js b/js/app/views/PlotUI.js index b6ad001..e604eae 100644 --- a/js/app/views/PlotUI.js +++ b/js/app/views/PlotUI.js @@ -102,8 +102,9 @@ Ext.define('amdaUI.PlotUI', { if (this.object.get('last-plotted-tab') == 0) { this.object.set('last-plotted-tab', this.plotTabs.getSelectedTabId()); } - var downObject = amdaModel.DownloadNode.decodeObject(this.object); - amdaModel.DownloadNode.set('object',Ext.create('amdaModel.Download',downObject)); + var downObject = amdaModel.DownloadNode.decodeObject(this.object); + amdaModel.DownloadNode.set('object',Ext.create('amdaModel.Download',downObject)); + amdaModel.DownloadNode.editInModule(); }, -- libgit2 0.21.2