Closed
Merge Request #47 · created by Erdogan Furkan


Fer 10557


From FER_10557 into develop

Closed by Erdogan Furkan

Changes were not merged into target branch

1 participants

05 Oct, 2022

2 commits


28 Sep, 2022

1 commit


generic_data/SpecialParameters/SpecialParams.xml 0 → 100644
  Diff comments   Edit  View file @9d88b61
... ... @@ -0,0 +1,12 @@
  1 +<?xml version="1.0"?>
  2 + <special name="Special" desc="Special_parameter" xml:id="specialParam-treeRootNode">
  3 + <group xml:id="ConstantsAll" name = "Constants" desc = "Usable constants for scalar, vector of matrix cases.">
  4 + <parameter name ="Scalar" xml:id="constant_scal"/>
  5 + <parameter name ="Vector" xml:id="constant_vec"/>
  6 + <parameter name ="Matrix" xml:id="constant_mat"/>
  7 + </group>
  8 + <group xml:id="TimeStampAll" name="TimeStamp" desc="Time parameters : Timestamp gives you the elapsed time in seconds since 01/01/1970 and Timestamp from gives the same since a time decided by the user." >
  9 + <parameter name='Timestamp' xml:id="timestamp"/>
  10 + <parameter name='Timestamp From' xml:id="timestampfrom"/>
  11 + </group>
  12 + </special>
... ...
generic_data/resources.json
  Diff comments   Edit  View file @9d88b61
1 1 {"nodes": [
2 2 {"nodeType" : "", "text" : "Parameters", "id" : "parameters-treeBase",
3 3 "children" : [ {"nodeType" : "localParam", "text" : "AMDA DataBase","id" : "myLocalData-treeRootNode"},
4   - {"nodeType" : "remoteParam", "info" : "Access to other Data Bases : CDAWEB, ...", "text" : "Remote DataBases : Observations", "id" : "myRemoteData-treeRootNode"},
5   - {"nodeType" : "remoteSimuParam", "info" : "Access to Simulation Data Bases", "text" : "Remote DataBases : Simulations", "id" : "myRemoteSimuData-treeRootNode"},
6   - {"nodeType" : "myDataParam", "text" : "My DataBase", "id" : "myDataParam-treeRootNode"}
  4 + {"nodeType" : "remoteParam", "info" : "Access to other Data Bases : CDAWEB, ...", "text" : "Remote DataBases : Observations", "id" : "myRemoteData-treeRootNode"},
  5 + {"nodeType" : "remoteSimuParam", "info" : "Access to Simulation Data Bases", "text" : "Remote DataBases : Simulations", "id" : "myRemoteSimuData-treeRootNode"},
  6 + {"nodeType" : "specialParam", "text" : "Special Parameters", "id" : "specialParam-treeRootNode"},
  7 + {"nodeType" : "myDataParam", "text" : "My DataBase", "id" : "myDataParam-treeRootNode"}
  8 +
7 9 ]
8 10 },
9 11 {"nodeType" : "derivedParam","text" : "Derived Parameters","id" : "derivedParam-treeRootNode"},
... ...
js/app/controllers/ExplorerModule.js
  Diff comments   Edit  View file @9d88b61
... ... @@ -51,7 +51,8 @@ Ext.define(&#39;amdaDesktop.ExplorerModule&#39;,
51 51 'amdaModel.Statistic',
52 52 'amdaModel.FileObject',
53 53 'amdaModel.FileParamObject',
54   - 'amdaModel.FilterInfo'
  54 + 'amdaModel.FilterInfo',
  55 + 'amdaModel.SpecialParamNode'
55 56 ],
56 57  
57 58 contentId: 'explorerUI',
... ...
js/app/models/SpecialParamNode.js 0 → 100644
  Diff comments   Edit  View file @9d88b61
... ... @@ -0,0 +1,113 @@
  1 +/**
  2 + * Project : AMDA-NG4
  3 + * Name : SpecialParamNode.js
  4 + * @class amdaModel.SpecialParamNode
  5 + * @extends amdaModel.InteractiveNode
  6 + * @brief
  7 + * @author
  8 + * @version $Id: MyDataNode.js 2267 2014-04-03 10:13:16Z elena $
  9 + * @todo
  10 + *******************************************************************************
  11 + * FT Id : Date : Name - Description
  12 + *******************************************************************************
  13 + *
  14 + */
  15 +
  16 +Ext.define('amdaModel.SpecialParamNode', {
  17 +
  18 + extend: 'amdaModel.InteractiveNode',
  19 +
  20 + statics:{
  21 + nodeType: 'specialParam'
  22 + },
  23 +
  24 + fields:
  25 + [
  26 + ],
  27 +
  28 + dependentRootNodeId : 'specialParam-treeRootNode',
  29 +
  30 + constructor : function(config){
  31 + this.callParent(arguments);
  32 +
  33 + this.set('moduleId',myDesktopApp.dynamicModules.param.id);
  34 + this.set('objectDataModel',amdaModel.Parameter.$className);
  35 + },
  36 +
  37 + localMenuItems : function() {
  38 + var menuItems =
  39 + [{
  40 + fnId: 'leaf-plotParam',
  41 + text: 'Plot Parameter',
  42 + hidden: true
  43 + }, {
  44 + fnId: 'leaf-downParam',
  45 + text: 'Download Parameter',
  46 + hidden: true
  47 + }, {
  48 + fnId: 'para-plotParam',
  49 + text: 'Plot Parameter',
  50 + hidden: true
  51 + }, {
  52 + fnId: 'para-downParam',
  53 + text: 'Download Parameter',
  54 + hidden: true
  55 + },{
  56 + fnId : 'leaf-createDerivedParam',
  57 + text : 'Create Derived Parameter',
  58 + hidden : true
  59 + },];
  60 + return menuItems;
  61 + },
  62 +
  63 + getAllContextMenuItems: function(){
  64 + var locMenuItems = this.localMenuItems();
  65 + return locMenuItems;
  66 + },
  67 +
  68 + onMenuItemClick : function(menu,item,event) {
  69 + var fnId = Ext.util.Format.substr(item.fnId, 5, item.fnId.length);
  70 + if(item){
  71 + switch (item.fnId)
  72 + {
  73 + case 'root-collapseAll':
  74 + case 'dire-collapseAll':
  75 + case 'miss-collapseAll':
  76 + if(this && !this.isLeaf()) {
  77 + this.collapse(true);
  78 + }
  79 + break;
  80 + case 'leaf-createDerivedParam':
  81 + this.createLeaf(this);
  82 + break;
  83 + case 'leaf-plotParam':
  84 + case 'para-plotParam':
  85 + this.createPlot(this);
  86 + break;
  87 + case 'leaf-downParam':
  88 + case 'para-downParam':
  89 + this.createDownload(this);
  90 + break;
  91 + default:
  92 + break;
  93 + } // switch end
  94 + }
  95 +
  96 + },
  97 +
  98 + createLeaf: function(node)
  99 + {
  100 + myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.param.id, true, function(module) {
  101 + if (!myDesktopApp.desktop.getWindow(myDesktopApp.dynamicModules.param.id)) {
  102 + var param = Ext.create(node.get('objectDataModel'));
  103 + var newNode = Ext.create(amdaModel.DerivedParamNode.$className, {leaf : true, object : param});
  104 + // edit newNode into Parameter Module with node as contextNode
  105 + newNode.editInModule();
  106 + }
  107 + var paramName = node.get('id');
  108 + var components = null;
  109 + module.addParam(paramName,node.get('leaf'),node.get('needsArgs'),components);
  110 + });
  111 + },
  112 +
  113 +});
... ...
js/app/stores/ExplorerReader.js
  Diff comments   Edit  View file @9d88b61
... ... @@ -18,7 +18,6 @@ Ext.define(&#39;amdaReader.ExplorerReader&#39;, {
18 18 */
19 19  
20 20 getType: function(node){
21   -
22 21 switch (node.nodeType) {
23 22  
24 23 case 'derivedParam':
... ... @@ -37,7 +36,7 @@ Ext.define(&#39;amdaReader.ExplorerReader&#39;, {
37 36 return amdaModel.AliasNode;
38 37 case 'timeTable' :
39 38 return amdaModel.TimeTableNode;
40   - case 'catalog' :
  39 + case 'catalog' :
41 40 return amdaModel.CatalogNode;
42 41 case 'sharedtimeTable' :
43 42 return amdaModel.sharedTimeTableNode;
... ... @@ -52,7 +51,9 @@ Ext.define(&#39;amdaReader.ExplorerReader&#39;, {
52 51 case 'statistic' :
53 52 return amdaModel.StatisticsNode;
54 53 case 'bkgWorks' :
55   - return amdaModel.BkgJobNode;
  54 + return amdaModel.BkgJobNode;
  55 + case 'specialParam':
  56 + return amdaModel.SpecialParamNode;
56 57 default:
57 58 return amdaModel.InteractiveNode;
58 59  
... ...
js/app/views/DownloadUI.js
  Diff comments   Edit  View file @9d88b61
... ... @@ -400,6 +400,7 @@ Ext.define(&#39;amdaUI.DownloadUI&#39;, {
400 400 (record.get('nodeType') == 'remoteParam') ||
401 401 (record.get('nodeType') == 'remoteSimuParam') ||
402 402 (record.get('nodeType') == 'derivedParam') ||
  403 + (record.get('nodeType') == 'specialParam') ||
403 404 (record.get('nodeType') == 'myDataParam') ||
404 405 (record.get('nodeType') == 'alias')) &&
405 406 (record.isLeaf() || record.get('isParameter')) &&
... ... @@ -476,6 +477,9 @@ Ext.define(&#39;amdaUI.DownloadUI&#39;, {
476 477 idToSent = "wsd_" + record.get('text');
477 478 }
478 479 break;
  480 + case 'specialParam':
  481 + idToSent=record.get('id');
  482 + break;
479 483 default:
480 484 return false;
481 485 }
... ...
js/app/views/ExplorerUI.js
  Diff comments   Edit  View file @9d88b61
... ... @@ -597,6 +597,7 @@ Ext.define(&#39;amdaUI.ExplorerUI&#39;, {
597 597 break;
598 598 case 'localParam' :
599 599 case 'remoteParam':
  600 + case 'specialParam':
600 601 case 'remoteSimuParam':
601 602 record.createPlot(record);
602 603 break;
... ...
js/app/views/ParamArgumentsUI.js
  Diff comments   Edit  View file @9d88b61
... ... @@ -558,6 +558,60 @@ Ext.define(&#39;amdaUI.ParamArgumentsUI&#39;, {
558 558  
559 559 me.add(argumentField);
560 560 break;
  561 + case 'int':
  562 + var argumentField = Ext.create('Ext.form.NumberField', {
  563 + argId: 'template_' + key,
  564 + fieldLabel: argument.name,
  565 + value: parseInt(argument.default),
  566 + regex: /^\d+$/,
  567 + listeners: {
  568 + change: function (field, newValue, oldValue, eOpts) {
  569 + var template_args = me.paramRequestObject.get('template_args');
  570 + if (!template_args)
  571 + template_args = {};
  572 + template_args[key] = newValue;
  573 + me.paramRequestObject.set('template_args', template_args);
  574 + if (!this.inRebuild && (me.onChange != null))
  575 + me.onChange(uiScope, key, newValue, oldValue, true);
  576 + },
  577 + scope: me
  578 + }
  579 + });
  580 +
  581 +
  582 + me.add(argumentField);
  583 + break;
  584 + case 'date':
  585 + var argumentField = Ext.create('Ext.form.field.Date', {
  586 + argId: 'template_' + key,
  587 + fieldLabel: argument.name,
  588 + allowBlank: false, format: 'Y/m/d H:i:s.u',
  589 + minValue:'1970/01/01 00:00:00.000',
  590 + value: parseInt(argument.default),
  591 + listeners: {
  592 + change: function (field, newValue, oldValue, eOpts) {
  593 + var template_args = me.paramRequestObject.get('template_args');
  594 + if (!template_args)
  595 + template_args = {};
  596 +
  597 + if(field.isValid() && newValue.getTime() > 0 ){
  598 + template_args[key] = newValue.getTime()/1000.;
  599 + }
  600 + else{
  601 + template_args[key] = 0;
  602 + }
  603 + me.paramRequestObject.set('template_args', template_args);
  604 + if (!this.inRebuild && (me.onChange != null)){
  605 + me.onChange(uiScope, key, newValue, oldValue, true);
  606 + }
  607 + },
  608 + scope: me
  609 + }
  610 + });
  611 +
  612 +
  613 + me.add(argumentField);
  614 + break;
561 615 default:
562 616 console.log('Template argument type not yet implemented: ' + argument.type);
563 617 }
... ...
js/app/views/ParameterUI.js
  Diff comments   Edit  View file @9d88b61
... ... @@ -308,6 +308,7 @@ Ext.define(&#39;amdaUI.ParameterUI&#39;,
308 308 (data.records[0].get('nodeType') == 'remoteParam') ||
309 309 (data.records[0].get('nodeType') == 'remoteSimuParam') ||
310 310 (data.records[0].get('nodeType') == 'derivedParam') ||
  311 + (data.records[0].get('nodeType') == 'specialParam') ||
311 312 (data.records[0].get('nodeType') == 'myDataParam') ||
312 313 (data.records[0].get('nodeType') == 'alias')) &&
313 314 (data.records[0].isLeaf() || data.records[0].get('isParameter')) &&
... ... @@ -355,6 +356,9 @@ Ext.define(&#39;amdaUI.ParameterUI&#39;,
355 356 case 'derivedParam':
356 357 nameToSent = "ws_" + data.records[0].get('text');
357 358 break;
  359 + case 'specialParam':
  360 + nameToSent = data.records[0].get('id');
  361 + break;
358 362 case 'myDataParam':
359 363 var name = data.records[0].get('text');
360 364 nameToSent = "wsd_" + name;
... ...
js/app/views/PlotComponents/PlotTree.js
  Diff comments   Edit  View file @9d88b61
... ... @@ -554,19 +554,20 @@ Ext.define(&#39;amdaPlotComp.PlotTree&#39;, {
554 554 case 'amdaModel.TimeTableNode' :
555 555 case 'amdaModel.CatalogNode' :
556 556 return record.get('leaf');
557   - case 'amdaModel.LocalParamNode' :
558   - case 'amdaModel.RemoteParamNode' :
559   - case 'amdaModel.RemoteSimuParamNode' :
560   - return record.get('isParameter') && ! record.get('disable');
561   -
562   - case 'amdaModel.DerivedParamNode' :
563   - case 'amdaModel.DerivedParamComponentNode':
564   - return record.get('isParameter') ;
565   - case 'amdaModel.AliasNode' :
566   - case 'amdaModel.MyDataParamNode' :
567   - case 'amdaModel.MyDataParamComponentNode':
568   - return record.get('isParameter') ;
569   - case 'amdaPlotObj.PlotParamTreeNode' :
  557 + case 'amdaModel.LocalParamNode' :
  558 + case 'amdaModel.RemoteParamNode' :
  559 + case 'amdaModel.RemoteSimuParamNode' :
  560 + return record.get('isParameter') && ! record.get('disable');
  561 +
  562 + case 'amdaModel.DerivedParamNode' :
  563 + case 'amdaModel.DerivedParamComponentNode':
  564 + return record.get('isParameter') ;
  565 + case 'amdaModel.AliasNode' :
  566 + case 'amdaModel.SpecialParamNode':
  567 + case 'amdaModel.MyDataParamNode' :
  568 + case 'amdaModel.MyDataParamComponentNode':
  569 + return record.get('isParameter') ;
  570 + case 'amdaPlotObj.PlotParamTreeNode' :
570 571 var fromPanelObject = null;
571 572 if (this.tabObject.get('tree-full-view'))
572 573 {
... ... @@ -776,6 +777,11 @@ Ext.define(&#39;amdaPlotComp.PlotTree&#39;, {
776 777 return this.moveParam(record, targetNode, position);
777 778 case 'amdaPlotObj.PlotPanelTreeNode' :
778 779 return this.movePanel(record, targetNode, position);
  780 + case 'amdaModel.SpecialParamNode' :
  781 + if (!record.get('isParameter'))
  782 + return false;
  783 + this.dropParamToCreate(targetNode, position, record.get('id'));
  784 + return true;
779 785 default :
780 786 return false;
781 787 }
... ...
js/app/views/SearchUI.js
  Diff comments   Edit  View file @9d88b61
... ... @@ -317,6 +317,7 @@ Ext.define(&#39;amdaUI.SearchUI&#39;,
317 317 (data.records[0].get('nodeType') == 'remoteParam') ||
318 318 (data.records[0].get('nodeType') == 'remoteSimuParam') ||
319 319 (data.records[0].get('nodeType') == 'derivedParam') ||
  320 + (data.records[0].get('nodeType') == 'specialParam') ||
320 321 (data.records[0].get('nodeType') == 'myDataParam') ||
321 322 (data.records[0].get('nodeType') == 'alias')) &&
322 323 (data.records[0].isLeaf() || data.records[0].get('isParameter')) &&
... ... @@ -365,6 +366,9 @@ Ext.define(&#39;amdaUI.SearchUI&#39;,
365 366 case 'derivedParam':
366 367 nameToSent = "ws_" + data.records[0].get('text');
367 368 break;
  369 + case 'specialParam':
  370 + nameToSent = data.records[0].get('id');
  371 + break;
368 372 case 'myDataParam':
369 373 var name = data.records[0].get('text');
370 374 nameToSent = "wsd_" + name;
... ...
js/app/views/StatisticsUI.js
  Diff comments   Edit  View file @9d88b61
... ... @@ -347,6 +347,7 @@ Ext.define(&#39;amdaUI.StatisticsUI&#39;,
347 347 (data.records[0].data.nodeType == 'remoteParam') ||
348 348 (data.records[0].data.nodeType == 'remoteSimuParam') ||
349 349 (data.records[0].data.nodeType == 'derivedParam') ||
  350 + (data.records[0].data.nodeType == 'specialParam') ||
350 351 (data.records[0].data.nodeType == 'myDataParam') ||
351 352 (data.records[0].data.nodeType == 'alias')) &&
352 353 (data.records[0].isLeaf() || data.records[0].data.isParameter) &&
... ... @@ -437,6 +438,9 @@ Ext.define(&#39;amdaUI.StatisticsUI&#39;,
437 438 nameToSent = "wsd_" + data.records[0].get('text');
438 439 }
439 440 break;
  441 + case 'specialParam':
  442 + nameToSent = data.records[0].get('id');
  443 + break;
440 444 default :
441 445 return false;
442 446 }
... ...
php/classes/AmdaAction.php
  Diff comments   Edit  View file @9d88b61
... ... @@ -61,7 +61,6 @@ class AmdaAction
61 61 $node = $obj->node;
62 62  
63 63 $nodeType = $obj->nodeType;
64   -
65 64 $remoteBase = false;
66 65 $isRemoteDataSet = false;
67 66  
... ... @@ -110,6 +109,9 @@ class AmdaAction
110 109 case 'destination':
111 110 $xmlName = USERWSDIR.'RemoteParams.xml';
112 111 break;
  112 + case 'specialParam':
  113 + $xmlName = DATAPATH.'SpecialParameters/SpecialParams.xml';
  114 + break;
113 115 default:
114 116 $xmlName = USERWSDIR.$this->xmlFiles[$nodeType];
115 117 }
... ... @@ -223,7 +225,7 @@ class AmdaAction
223 225 break;
224 226  
225 227 case 'localParam':
226   -
  228 +
227 229 $globalStart = null;
228 230 $globalStop = null;
229 231 $timeRestriction = false;
... ... @@ -278,8 +280,8 @@ class AmdaAction
278 280 if ($child->hasAttribute('TemplatedParameter'))
279 281 $needsArgs = true;
280 282  
281   - if ($child->hasAttribute('PredefinedTemplatedParameter'))
282   - $predefinedArgs = true;
  283 + if ($child->hasAttribute('PredefinedTemplatedParameter'))
  284 + $predefinedArgs = true;
283 285  
284 286 if ($child->parentNode->hasAttribute('dataStart')) {
285 287 $globalStart = $child->parentNode->getAttribute('dataStart');
... ... @@ -584,6 +586,13 @@ class AmdaAction
584 586 'isParameter' => $isParameter, 'linkedMask' => $mask, 'isSpectra' => $isSpectra);
585 587  
586 588 break;
  589 +
  590 + case 'specialParam':
  591 + $specialNode=TRUE;
  592 + $isParameter=($child->tagName == 'parameter');
  593 + $childrenToReturn[] = array('text' => $name, 'id' => $id,'nodeType' => $nodeType, 'isParameter' => $isParameter, 'needsArgs' => $isParameter, 'leaf' => $isParameter);
  594 + break;
  595 +
587 596 default:
588 597 }
589 598  
... ...