Commit 9138608501f13fcaec1a2c6cdd2982988d794779

Authored by Nathanaël Jourdane
2 parents 25bf0977 7348b580

Merge branch 'master' into sort_ws_log

generic_data/RemoteData/Bases.xml deleted
... ... @@ -1,16 +0,0 @@
1   -<?xml version="1.0"?>
2   -<dataRoot xml:id="myRemoteData-treeRootNode">
3   - <!--<dataCenter name="CDAWeb@NASA" desc="Coordinated_Data_Analysis" group="" id1="CDAWEB" xml:id="CDAWEB"/>
4   - <dataCenter name="MAPSKP@IRAP" desc="Cassini MAPS_Key_Parameters" group="" default="yes" id1="MAPSKP" xml:id="MAPSKP"/>
5   - <dataCenter name="THEMIS@IRAP" desc="Mirror_CESR_Data_Base" group="" default="yes" id1="THEMIS" xml:id="THEMIS"/>
6   - <dataCenter name="CLWEB@IRAP" desc="CLWeb_Internal_Data_Base" default="yes" id1="CLWeb" xml:id="CLWeb"/>-->
7   - <dataCenter name="LATMOS" desc="Latmos Hybrid Simulation Database" isSimulation='1' default="yes" id1="LATMOS" xml:id="LATMOS"/>
8   - <dataCenter name="FMI_HYBRID" desc="FMI Hybrid Simulation Database" isSimulation='1' default="yes" id1="FMI_HYBRID" xml:id="FMI_HYBRID"/>
9   - <dataCenter name="FMI_GUMICS" desc="FMI MHD simulation database" isSimulation='1' default="yes" id1="FMI_GUMICS" xml:id="FMI_GUMICS"/>
10   - <!--<dataCenter name="SINP" desc="Paraboloid model calculates the magnetic fields in the Earth's magnetosphere depending on external conditions in solar wind and on geomagnetic activity level" isSimulation='1' default="yes" id1="SINP" xml:id="SINP"/>-->
11   - <dataCenter name="LESIA" desc="LESIA MASER" default="yes" id1="LESIA" isSimulation='1' xml:id="LESIA"/>
12   - <!--<dataCenter name="CDPP" desc="CCMC BATSRUS with RCM v8.01" default="yes" id1="CCMC" isSimulation='1' xml:id="CCMC"/>-->
13   - <dataCenter name="IPIM" desc="IPIM @ IRAP" default="yes" id1="IPIM" isSimulation='1' xml:id="IPIM"/>
14   -</dataRoot>
15   -
16   -
help/ttTimeFormat 0 → 100644
... ... @@ -0,0 +1,15 @@
  1 +<h3>ASCII Time Table Time Format</h3>
  2 +<i>Year Month Day Hour Minute Second</i> => with different separators ("-", ":", "/", " ") used in a standard way.
  3 +<br/><i>Milliseconds</i> are not taken in to account.
  4 +<br/><br/>
  5 +Examples:
  6 + <ul>
  7 + <li> 2001-01-01T00:00:00
  8 + <li> 2001-01-01 00:00:00
  9 + <li> 2001 01 01 00 00 00
  10 + <li> 2001/01/01 00:00:00
  11 + </ul>
  12 +<br/>
  13 +If you plan to use uploaded time table to work with data note that :<br/>
  14 +<b>Valid time range: 1970-01-01 - 2038-01-19</b>
  15 +
... ...
js/app/controllers/JobsMgr.js
... ... @@ -187,6 +187,7 @@ Ext.define(&#39;amdaDesktop.JobsMgr&#39;, {
187 187 // AKKA - use processid to find job
188 188 nodeToMove = jobRootNode.findChild('id', job.id, false)
189 189 nodeToMove.set('status', job.status)
  190 + nodeToMove.set('info', job.info)
190 191  
191 192 // TODO check if really job.status
192 193  
... ...
js/app/controllers/StatisticsModule.js
... ... @@ -43,14 +43,12 @@ Ext.define(&#39;amdaDesktop.StatisticsModule&#39;, {
43 43  
44 44 saveState: function() {
45 45 var uiContent = this.getUiContent();
46   - var form = uiContent.down('form').getForm();
47   - var values = form.getValues();
48   - // Ext.state.Manager.set(this.id + '_form', values);
  46 + var form = uiContent.formPanel.items.items[1].getForm();
  47 + var values = form.getValues();
49 48 Ext.state.Manager.set('timeinterval', {'startDate' : values.startDate,'stopDate' : values.stopDate });
50 49 },
51 50  
52   - getState : function() {
53   - // return Ext.state.Manager.get(this.id + '_form');
  51 + getState : function() {
54 52 return Ext.state.Manager.get('timeinterval');
55 53 }
56 54  
... ...
js/app/models/BkgJobNode.js
... ... @@ -328,7 +328,7 @@ Ext.define(&#39;amdaModel.BkgJobNode&#39;, {
328 328 case 'condition' : var type = 'Data Mining '; break;
329 329 case 'request' : var type = 'Plot '; break;
330 330 case 'download' : var type = 'Download '; break;
331   - case 'statistics' : var type = 'Statistics '; break;
  331 + case 'statistics' : var type = 'Statistics '; break;
332 332 default: var type = 'unknown';
333 333 }
334 334 myDesktopApp.infoMsg('Your request is still running and has been assigned the name '+this.get('text')+' -- Check Jobs in Progress');
... ... @@ -424,8 +424,8 @@ Ext.define(&#39;amdaModel.BkgJobNode&#39;, {
424 424 var isNewTab = false;
425 425  
426 426 loadMask.show(this.get('object').get('tabId'));
427   - AmdaAction.execute({nodeType : this.get('nodeType')}, jsonObj, function(res,e){
428   -
  427 + AmdaAction.execute({nodeType : this.get('nodeType')}, jsonObj, function(res,e)
  428 + {
429 429 loadMask.hide();
430 430 //AKKA - Rework of the result treatment for the integration with the new kernel
431 431 if (!e.status)
... ...
js/app/models/ExecutableNode.js
... ... @@ -6,142 +6,134 @@
6 6 * @brief Generic Model of Executable Node
7 7 * @author elena
8 8 * @version $Id: ExecutableNode.js 1662 2013-07-02 15:10:22Z benjamin $
9   - * @todo
10   - *******************************************************************************
11   - * FT Id : Date : Name - Description
12   - *******************************************************************************
13   - * : :12/07/2011: elena - creation
14   - *
15 9 */
16 10  
17 11 Ext.define('amdaModel.ExecutableNode', {
18   - extend: 'amdaModel.InteractiveNode',
  12 + extend: 'amdaModel.InteractiveNode',
19 13  
20   -//TODO use resultModel in execute method Is it needed???
21   -
22   - fields: [ 'jobNode', 'resultModel'],
  14 + fields: [ 'jobNode', 'resultModel'],
23 15  
24   - statics: { jobTreeLoaded : false },
  16 + statics: { jobTreeLoaded : false },
25 17  
26   - constructor : function(config) {
27   - this.callParent(arguments);
28   - this.set('ownerTreeId',amdaUI.ExplorerUI.OPE_TAB.TREE_ID);
29   - this.set('jobNode', 'amdaModel.BkgJobNode');
30   - },
  18 + constructor : function(config)
  19 + {
  20 + this.callParent(arguments);
  21 + this.set('ownerTreeId',amdaUI.ExplorerUI.OPE_TAB.TREE_ID);
  22 + this.set('jobNode', 'amdaModel.BkgJobNode');
  23 + },
31 24  
32   - loadJobTree : function() {
33   - var rootNode = Ext.getCmp(amdaUI.ExplorerUI.JOB_TAB.TREE_ID).getRootNode();
34   - var me = this;
35   - amdaModel.InteractiveNode.preloadNodes(rootNode,
36   - function()
37   - {
38   - amdaModel.ExecutableNode.jobTreeLoaded = true;
39   - me.realExecute();
40   - });
41   - },
42   -
43   - execute : function(isDirty) {
44   -
45   - if (!amdaModel.ExecutableNode.jobTreeLoaded) this.loadJobTree();
46   - else this.realExecute();
47   -
48   - },
  25 + loadJobTree : function()
  26 + {
  27 + var rootNode = Ext.getCmp(amdaUI.ExplorerUI.JOB_TAB.TREE_ID).getRootNode();
  28 + var me = this;
  29 + amdaModel.InteractiveNode.preloadNodes(rootNode, function(){
  30 + amdaModel.ExecutableNode.jobTreeLoaded = true;
  31 + me.realExecute();
  32 + });
  33 + },
49 34  
50   - /**
51   - * Method to execute this node
52   - */
53   - realExecute : function() {
54   -
55   - var isInteractivePlot = (this.get('nodeType') == 'request') && (this.get('object').get('file-output') == 'INTERACTIVE');
  35 + execute : function(isDirty)
  36 + {
  37 + if (!amdaModel.ExecutableNode.jobTreeLoaded)
  38 + this.loadJobTree();
  39 + else
  40 + this.realExecute();
  41 + },
  42 +
  43 + /**
  44 + * Method to execute this node
  45 + */
  46 + realExecute : function()
  47 + {
  48 + var isInteractivePlot = (this.get('nodeType') == 'request') && (this.get('object').get('file-output') == 'INTERACTIVE');
56 49  
57   - if (!loadMask.isMasked())
58   - loadMask.show(isInteractivePlot);
  50 + if (!loadMask.isMasked())
  51 + loadMask.show(isInteractivePlot);
59 52  
60   - AmdaAction.execute({nodeType : this.get('nodeType')}, this.get('object').getJsonValues(true), function(res,e){
61   -
62   - loadMask.hide();
  53 + AmdaAction.execute({nodeType : this.get('nodeType')}, this.get('object').getJsonValues(true),
  54 + function(res,e)
  55 + {
  56 + loadMask.hide();
63 57  
64   - //AKKA - Rework of the result treatment for the integration with the new kernel
65   - if (!e.status)
66   - {
67   - myDesktopApp.errorMsg('Internal error during request');
68   - return;
69   - }
  58 + //AKKA - Rework of the result treatment for the integration with the new kernel
  59 + if (!e.status){
  60 + myDesktopApp.errorMsg('Internal error during request');
  61 + return;
  62 + }
70 63  
71   - if (!res.success)
72   - {
73   - myDesktopApp.errorMsg(res.message);
74   - return;
75   - }
76   -
77   - if (res.killed)
78   - return;
  64 + if (!res.success){
  65 + myDesktopApp.errorMsg(res.message);
  66 + return;
  67 + }
  68 +
  69 + if (res.killed)
  70 + return;
79 71  
80   - if (isInteractivePlot)
81   - {
82   - myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.plot.id, true, function (module) {
83   - module.updateInteractiveSession(res, true);
84   - });
85   - }
86   - else
87   - {
88   - var newobj = this.createJobObject(res);
89   - var newNode = Ext.create(this.get('jobNode'),
90   - {
91   - info : res.info,
92   - jobType : this.get('nodeType'),
93   - processId : res.id,
94   - id : res.id,
95   - text : res.name,
96   - status : res.status,
97   - start : res.start,
98   - stop : res.stop,
99   - tabId : res.tabId,
100   - leaf : true,
101   - object : newobj});
  72 + if (isInteractivePlot){
  73 + myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.plot.id, true, function (module) {
  74 + module.updateInteractiveSession(res, true);
  75 + });
  76 + }
  77 + else {
  78 + var newobj = this.createJobObject(res);
  79 + var newNode = Ext.create(this.get('jobNode'), {
  80 + info : res.info,
  81 + jobType : this.get('nodeType'),
  82 + processId : res.id,
  83 + id : res.id,
  84 + text : res.name,
  85 + status : res.status,
  86 + start : res.start,
  87 + stop : res.stop,
  88 + tabId : res.tabId,
  89 + leaf : true,
  90 + object : newobj
  91 + });
102 92  
103   - newNode.get('object').on('execute', function() {
104   - // Then call the node creation method
105   - this.execute(arguments);
106   - }, newNode);
  93 + newNode.get('object').on('execute', function() {
  94 + // Then call the node creation method
  95 + this.execute(arguments);
  96 + }, newNode);
107 97  
108   - switch (res.status)
109   - {
110   - case amdaModel.BkgJobNode.STATUS_LIST.DONE :
111   - newNode.createJobNode(true);
112   - newNode.editNode(true, false);
113   - break;
114   - case amdaModel.BkgJobNode.STATUS_LIST.IN_PROGRESS :
115   - newNode.createJobNode(false);
116   - break;
117   - default:
118   - newNode.createJobNode(true);
119   - }
120   - }
121   - }, this );
122   - },
  98 + switch (res.status)
  99 + {
  100 + case amdaModel.BkgJobNode.STATUS_LIST.DONE :
  101 + newNode.createJobNode(true);
  102 + newNode.editNode(true, false);
  103 + break;
  104 + case amdaModel.BkgJobNode.STATUS_LIST.IN_PROGRESS :
  105 + newNode.createJobNode(false);
  106 + break;
  107 + default:
  108 + newNode.createJobNode(true);
  109 + }
  110 + }
  111 + }, this );
  112 + },
123 113  
124   - createJobObject: function(res) {
125   -
126   - var obj = this.get('object').getJsonValues();
127   -//TODO text, name, outputName - if all is needed
128   - //new object to attach to new bkgJobNode
129   -//TODO Ext.clone()
130   - var newobj = Ext.copyTo({}, obj, this.get('object').propertiesToCopy);
131   - newobj.resultId = res.result;
132   - newobj.folderId = res.folder;
133   - newobj.processId= res.id;
134   - newobj.tabId = res.tabId;
135   - newobj.name = res.name;
136   - newobj = Ext.create(this.get('object').$className, newobj);
137   - return newobj;
  114 + createJobObject: function(res)
  115 + {
  116 + var obj = this.get('object').getJsonValues();
  117 + //TODO text, name, outputName - if all is needed
  118 +
  119 + //new object to attach to new bkgJobNode
  120 + //TODO Ext.clone()
  121 + var newobj = Ext.copyTo({}, obj, this.get('object').propertiesToCopy);
  122 + newobj.resultId = res.result;
  123 + newobj.folderId = res.folder;
  124 + newobj.processId= res.id;
  125 + newobj.tabId = res.tabId;
  126 + newobj.name = res.name;
  127 + newobj = Ext.create(this.get('object').$className, newobj);
  128 +
  129 + return newobj;
138 130 },
139   - /**
140   - * override isExecutable to return true
141   - */
142   - isExecutable: function(){
143   - return true;
144   - }
145   -
  131 +
  132 + /**
  133 + * override isExecutable to return true
  134 + */
  135 + isExecutable: function()
  136 + {
  137 + return true;
  138 + }
146 139 });
147   -
... ...
js/app/models/PlotObjects/PlotObjectConfig.js
... ... @@ -328,6 +328,7 @@ Ext.define(&#39;amdaPlotObj.PlotObjectConfig&#39;, {
328 328 ],
329 329  
330 330 availableColors : [
  331 + {'key' : 'auto', 'color' : 'auto', 'value' : 'auto'},
331 332 {'key' : '[0,0,0]', 'color' : '#000000', 'value' : 'Black'},
332 333 {'key' : '[0,0,255]', 'color' : '#0000ff', 'value' : 'Blue'},
333 334 {'key' : '[255,0,0]', 'color' : '#ff0000', 'value' : 'Red'},
... ...
js/app/models/Stats.js
... ... @@ -22,8 +22,8 @@ Ext.define(&#39;amdaModel.Stats&#39;, {
22 22 values.id = this.get('id');
23 23 }
24 24  
25   - values.timesrc = this.get('timesrc');
26   - values.name = 'test'; //this.get('name');
  25 + values.timesrc = this.get('timesrc');
  26 + values.name = this.get('name');
27 27  
28 28 // if (this.get('description').match(/[a-z,0-9]/gi) != null) {
29 29 // values.description = this.get('description');
... ...
js/app/views/FiltersUI.js
... ... @@ -9,7 +9,7 @@
9 9 ********************************************************************************
10 10 * FT Id : Date : Name - Description
11 11 *******************************************************************************
12   - * :
  12 + * :
13 13 */
14 14  
15 15 /*
... ... @@ -19,41 +19,41 @@
19 19 Ext.define('amdaUI.FilterGridPanel', {
20 20 extend : 'Ext.grid.Panel',
21 21 alias : 'widget.gridFilter',
22   -
  22 +
23 23 filtersInfoStore : null,
24 24 filtersListStore : null,
25   -
  25 +
26 26 selectListStore : null,
27 27 crtFilter : null,
28   -
  28 +
29 29 opStore : null,
30 30 condStore : null,
31   -
  31 +
32 32 groupingFeature : null,
33 33 valueColumn : null,
34   -
  34 +
35 35 groupMenu : null,
36 36 itemMenu : null,
37   -
38   - constructor: function(config)
39   - {
  37 +
  38 + constructor: function(config)
  39 + {
40 40 this.init(config);
41 41 this.callParent(arguments);
42 42 },
43   -
  43 +
44 44 setFiltersInfoStore: function(infoStore)
45 45 {
46 46 this.filtersInfoStore = infoStore;
47 47 },
48   -
  48 +
49 49 setFiltersListStore: function(listStore)
50 50 {
51 51 this.filtersListStore = listStore;
52 52 },
53   -
  53 +
54 54 setConditions : function(record)
55 55 {
56   - this.editingPlugin.completeEdit();
  56 + this.editingPlugin.completeEdit();
57 57 this.crtFilter = record;
58 58 this.reconfigure(record.conditions());
59 59 this.store.groupField = 'type';
... ... @@ -61,59 +61,59 @@ Ext.define(&#39;amdaUI.FilterGridPanel&#39;, {
61 61 if (record.conditions().getCount() > 0)
62 62 this.getSelectionModel().select(record.conditions().getAt(0));
63 63 },
64   -
  64 +
65 65 setConditionType : function(condType,condInfo,reset)
66 66 {
67 67 if (!condInfo)
68 68 return;
69   -
  69 +
70 70 //update current conditions types store
71 71 this.condStore.removeAll();
72   -
  72 +
73 73 this.filtersInfoStore.getById(condType).conditions().data.each(function(cond)
74 74 {
75 75 this.condStore.add(cond);
76 76 },
77 77 this
78 78 );
79   -
  79 +
80 80 //update current operators store
81 81 this.opStore.removeAll();
82   -
  82 +
83 83 condInfo.ops().data.each(function(op)
84 84 {
85 85 this.opStore.add({id : op.get('id'), name : op.get('name')});
86 86 },
87 87 this
88 88 );
89   -
  89 +
90 90 //update current value field
91 91 var valueField = this.getValueField(condInfo);
92   - this.editingPlugin.completeEdit();
  92 + this.editingPlugin.completeEdit();
93 93 this.editingPlugin.setColumnField(this.columns[3],valueField);
94   -
  94 +
95 95 //get current cell
96 96 var crtCell;
97   - if (this.getSelectionModel().hasSelection()) {
98   - crtCell = this.getSelectionModel().getSelection()[0];
  97 + if (this.getSelectionModel().hasSelection()) {
  98 + crtCell = this.getSelectionModel().getSelection()[0];
99 99 }
100 100 else
101   - return;
  101 + return;
102 102 crtCell.set('condId',condInfo.get('id'));
103   -
  103 +
104 104 if (reset)
105   - {
  105 + {
106 106 //set first operator
107 107 crtCell.set('opId',this.opStore.getAt(0).get('id'));
108   -
  108 +
109 109 //reset value field
110 110 switch (valueField.xtype)
111 111 {
112   - case 'combobox' :
  112 + case 'combobox' :
113 113 crtCell.set('value',valueField.store.getAt(0).get('name'));
114 114 break;
115 115 case 'datefield' :
116   - var date = new Date();
  116 + var date = new Date();
117 117 crtCell.set('value',date);
118 118 break;
119 119 default :
... ... @@ -121,7 +121,7 @@ Ext.define(&#39;amdaUI.FilterGridPanel&#39;, {
121 121 }
122 122 }
123 123 },
124   -
  124 +
125 125 getValueField : function(condInfo)
126 126 {
127 127 //get field type in relation with the condition
... ... @@ -130,21 +130,21 @@ Ext.define(&#39;amdaUI.FilterGridPanel&#39;, {
130 130 case 'select' :
131 131 if (!this.filtersListStore.getById(condInfo.get('selectList')))
132 132 console.log('Error - Missing select list definition for '+condInfo.get('selectList'));
133   - else {
  133 + else {
134 134 // to avoid an attempt to load remotely association store in combobox - it is already here!
135 135 var store2 = new Ext.data.Store({model : 'amdaModel.FilterSelectListElt'});
136   -
  136 +
137 137 this.filtersListStore.getById(condInfo.get('selectList')).elems().each(function(record){
138 138 store2.add(record.copy());
139   - });
140   -
  139 + });
  140 +
141 141 return {
142 142 xtype : 'combobox',
143 143 queryMode: 'local',
144 144 editable: false,
145 145 displayField:'name',
146 146 valueField : 'id',
147   - store : store2
  147 + store : store2
148 148 };
149 149 }
150 150 case 'date' :
... ... @@ -159,23 +159,23 @@ Ext.define(&#39;amdaUI.FilterGridPanel&#39;, {
159 159 };
160 160  
161 161 }
162   -
  162 +
163 163 // console.log('Error - Missing value field definition for '+condInfo.get('type'));
164 164 return {
165 165 xtype : 'textfield'
166 166 };
167 167 },
168   -
  168 +
169 169 createCondition : function(group)
170 170 {
171 171 var rec = Ext.create('amdaModel.FilterDefCond',{
172 172 type : group,
173 173 logical : 'and'
174 174 });
175   -
  175 +
176 176 return rec;
177 177 },
178   -
  178 +
179 179 onAddCondition : function(t)
180 180 {
181 181 var crtGroup = t.parentMenu.crtGroup;
... ... @@ -187,7 +187,7 @@ Ext.define(&#39;amdaUI.FilterGridPanel&#39;, {
187 187 this.store.each(function(cond)
188 188 {
189 189 if (cond.get('type') == crtGroup)
190   - maxIndex = (maxIndex < cond.get('index')) ? cond.get('index') : maxIndex;
  190 + maxIndex = (maxIndex < cond.get('index')) ? cond.get('index') : maxIndex;
191 191 },this);
192 192 rec.set('index',maxIndex+1);
193 193 this.store.add(rec);
... ... @@ -196,7 +196,7 @@ Ext.define(&#39;amdaUI.FilterGridPanel&#39;, {
196 196 this.getSelectionModel().select(rec);
197 197 this.setConditionType(crtGroup,firstCond, true);
198 198 },
199   -
  199 +
200 200 onInsertCondition : function(t)
201 201 {
202 202 if (this.getSelectionModel().hasSelection())
... ... @@ -218,7 +218,7 @@ Ext.define(&#39;amdaUI.FilterGridPanel&#39;, {
218 218 this.setConditionType(crtRec.get('type'),firstCond, true);
219 219 }
220 220 },
221   -
  221 +
222 222 onDeleteCondition : function(t)
223 223 {
224 224 if (this.getSelectionModel().hasSelection())
... ... @@ -229,7 +229,7 @@ Ext.define(&#39;amdaUI.FilterGridPanel&#39;, {
229 229 this.store.group('type');
230 230 };
231 231 },
232   -
  232 +
233 233 onClearGroupConditions : function(t)
234 234 {
235 235 var crtGroup = t.parentMenu.crtGroup;
... ... @@ -243,17 +243,17 @@ Ext.define(&#39;amdaUI.FilterGridPanel&#39;, {
243 243 if (rec.get('index') == -1)
244 244 return;
245 245 this.store.remove(rec);
246   - },this);
  246 + },this);
247 247 this.store.group('type');
248 248 },
249   -
  249 +
250 250 onClearAllConditions : function(t)
251   - {
  251 + {
252 252 var recs = this.store.getGroups();
253 253 if (!recs)
254 254 return;
255 255 Ext.each(recs, function (group)
256   - {
  256 + {
257 257 Ext.each(group.children, function (rec)
258 258 {
259 259 if (rec.get('index') == -1)
... ... @@ -264,47 +264,47 @@ Ext.define(&#39;amdaUI.FilterGridPanel&#39;, {
264 264 this);
265 265 this.store.group('type');
266 266 },
267   -
  267 +
268 268 onSelectConditionType : function(combo,records,eOpts)
269 269 {
270 270 if (!records || (records.length != 1))
271 271 return;
272 272 this.setConditionType(records[0].getFilter().get('id'),records[0],true);
273 273 },
274   -
  274 +
275 275 createCellEditingPlugin : function()
276 276 {
277 277 var cellPlug = Ext.create('Ext.grid.plugin.CellEditing', {
278 278 clicksToEdit: 2,
279 279 listeners: {
280   - beforeedit: function(o, el, opt) {
  280 + beforeedit: function(o, el, opt) {
281 281 if ((el.field == 'logical') && (el.record.get('index') <= 0))
282 282 return false;
283 283 return true;
284 284 }
285 285 }
286   - });
287   -
  286 + });
  287 +
288 288 return cellPlug;
289 289 },
290   -
  290 +
291 291 createOperatorStore : function()
292 292 {
293 293 this.opStore = Ext.create('Ext.data.Store',{model: 'amdaModel.FilterOpInfo'});
294 294 return this.opStore;
295 295 },
296   -
  296 +
297 297 createFilterCondInfoStore : function()
298 298 {
299 299 this.condStore = Ext.create('Ext.data.Store',{model: 'amdaModel.FilterConditionInfo'});
300 300 return this.condStore;
301 301 },
302   -
  302 +
303 303 createLogicalColumn : function()
304 304 {
305 305 return {
306   - header: '',
307   - dataIndex: 'logical',
  306 + header: '',
  307 + dataIndex: 'logical',
308 308 flex: 1,
309 309 allowBlank : false,
310 310 renderer: function(value,metaData,record,rowIndex,colIndex,store,view)
... ... @@ -322,18 +322,18 @@ Ext.define(&#39;amdaUI.FilterGridPanel&#39;, {
322 322 }
323 323 };
324 324 },
325   -
  325 +
326 326 createTypeColumn : function()
327 327 {
328   - return {
329   - header: 'Type',
330   - dataIndex: 'condId',
  328 + return {
  329 + header: 'Type',
  330 + dataIndex: 'condId',
331 331 flex: 3,
332 332 allowBlank : false,
333 333 renderer: function(value,metaData,record,rowIndex,colIndex,store,view)
334 334 {
335 335 var crtType = record.get('type');
336   - var conditions = this.filtersInfoStore.getById(crtType).conditions();
  336 + var conditions = this.filtersInfoStore.getById(crtType).conditions();
337 337 var condition = conditions.getById(record.get('condId'));
338 338 if (condition)
339 339 return condition.get('name');
... ... @@ -354,21 +354,21 @@ Ext.define(&#39;amdaUI.FilterGridPanel&#39;, {
354 354 'select': this.onSelectConditionType
355 355 }
356 356 }
357   - };
  357 + };
358 358 },
359   -
  359 +
360 360 createOperatorColumn : function()
361 361 {
362   - return {
363   - header: '',
364   - dataIndex: 'opId',
  362 + return {
  363 + header: '',
  364 + dataIndex: 'opId',
365 365 flex: 1,
366 366 allowBlank : false,
367 367 renderer: function(value,metaData,record,rowIndex,colIndex,store,view)
368 368 {
369 369 var crtType = record.get('type');
370 370 var conditions = this.filtersInfoStore.getById(crtType).conditions();
371   -
  371 +
372 372 var condition = conditions.getById(record.get('condId'));
373 373 if (!condition || !condition.ops().getById(record.get('opId')))
374 374 return '';
... ... @@ -383,21 +383,21 @@ Ext.define(&#39;amdaUI.FilterGridPanel&#39;, {
383 383 valueField : 'id',
384 384 store : this.createOperatorStore()
385 385 }
386   -
  386 +
387 387 };
388 388 },
389   -
  389 +
390 390 createValueColumn : function()
391 391 {
392   - return {
393   - header: 'Value',
394   - dataIndex: 'value',
  392 + return {
  393 + header: 'Value',
  394 + dataIndex: 'value',
395 395 flex: 3,
396 396 renderer: function(value,metaData,record,rowIndex,colIndex,store,view)
397 397 {
398 398 var crtType = record.get('type');
399 399 var conditions = this.filtersInfoStore.getById(crtType).conditions();
400   - var condition = conditions.getById(record.get('condId'));
  400 + var condition = conditions.getById(record.get('condId'));
401 401 if (!condition)
402 402 return value;
403 403 switch(condition.get('type'))
... ... @@ -417,7 +417,7 @@ Ext.define(&#39;amdaUI.FilterGridPanel&#39;, {
417 417 }
418 418 };
419 419 },
420   -
  420 +
421 421 createColumns : function()
422 422 {
423 423 return [
... ... @@ -427,11 +427,11 @@ Ext.define(&#39;amdaUI.FilterGridPanel&#39;, {
427 427 this.createValueColumn()
428 428 ];
429 429 },
430   -
  430 +
431 431 createContextMenus : function()
432 432 {
433 433 var me = this;
434   -
  434 +
435 435 this.groupMenu = Ext.create('Ext.menu.Menu', {
436 436 crtGroup : null,
437 437 items: [{
... ... @@ -454,7 +454,7 @@ Ext.define(&#39;amdaUI.FilterGridPanel&#39;, {
454 454 }
455 455 ]
456 456 });
457   -
  457 +
458 458 this.itemMenu = Ext.create('Ext.menu.Menu', {
459 459 items: [{
460 460 text: 'Insert',
... ... @@ -468,21 +468,21 @@ Ext.define(&#39;amdaUI.FilterGridPanel&#39;, {
468 468 scope : me
469 469 }
470 470 ]
471   - });
  471 + });
472 472 },
473   -
  473 +
474 474 createGroupingFeature : function()
475 475 {
476 476 var me = this;
477   -
  477 +
478 478 this.groupingFeature = Ext.create('Ext.grid.feature.Grouping',{
479 479 enableGroupingMenu: true,
480 480 enableNoGroups : false,
481 481 showGroupsText : false,
482   - groupHeaderTpl: Ext.create('Ext.XTemplate',
483   - '{name:this.filter_type} ({rows.length:this.cond_info})',
  482 + groupHeaderTpl: Ext.create('Ext.XTemplate',
  483 + '{name:this.filter_type} ({rows.length:this.cond_info})',
484 484 {
485   - cond_info : function(val)
  485 + cond_info : function(val)
486 486 {
487 487 var nbCond = val < 1 ? 0 : val-1;
488 488 return (nbCond > 1) ? nbCond+' conditions' : nbCond+' condition';
... ... @@ -497,20 +497,20 @@ Ext.define(&#39;amdaUI.FilterGridPanel&#39;, {
497 497 return rec.get('name');
498 498 }
499 499 }
500   -
  500 +
501 501 )
502 502 });
503 503 },
504   -
505   - init : function(config)
  504 +
  505 + init : function(config)
506 506 {
507 507 var me = this;
508   -
  508 +
509 509 this.createContextMenus();
510   -
  510 +
511 511 this.createGroupingFeature();
512   -
513   - var myConf =
  512 +
  513 + var myConf =
514 514 {
515 515 plugins : [
516 516 this.createCellEditingPlugin()
... ... @@ -531,12 +531,12 @@ Ext.define(&#39;amdaUI.FilterGridPanel&#39;, {
531 531 {
532 532 if (selections && selections[0])
533 533 {
534   -
  534 +
535 535 var condId = selections[0].get('condId');
536   -
  536 +
537 537 var crtType = selections[0].get('type');
538 538 var conditions = this.filtersInfoStore.getById(crtType).conditions();
539   -
  539 +
540 540 var cond = conditions.getById(condId);
541 541 if (cond)
542 542 {
... ... @@ -550,13 +550,13 @@ Ext.define(&#39;amdaUI.FilterGridPanel&#39;, {
550 550 this.itemMenu.showAt(e.getXY());
551 551 },
552 552 groupcontextmenu : function(view, node, group, e)
553   - {
  553 + {
554 554 e.stopEvent();
555 555 this.groupMenu.crtGroup = group;
556 556 this.groupMenu.showAt(e.getXY());
557 557 },
558 558 scope : this
559   -
  559 +
560 560 }
561 561 };
562 562 Ext.apply (this , Ext.apply (arguments, myConf));
... ... @@ -564,7 +564,7 @@ Ext.define(&#39;amdaUI.FilterGridPanel&#39;, {
564 564 });
565 565  
566 566 /*
567   - * Filters main interface
  567 + * Filters main interface
568 568 */
569 569  
570 570 Ext.define('amdaUI.FiltersUI', {
... ... @@ -575,27 +575,27 @@ Ext.define(&#39;amdaUI.FiltersUI&#39;, {
575 575 'amdaModel.FilterInfo',
576 576 'amdaModel.FilterDef'
577 577 ],
578   -
  578 +
579 579 newFilterName : 'New_Filter_',
580   -
  580 +
581 581 //filters info to build interface
582 582 filtersInfoStore : null,
583 583 filtersListStore : null,
584   -
585   - constructor: function(config) {
  584 +
  585 + constructor: function(config) {
586 586 this.init(config);
587 587 this.callParent(arguments);
588 588 },
589   -
  589 +
590 590 onSelect : function(combo,records,eOpts)
591 591 {
592 592 if (!records || (records.length != 1))
593   - return;
  593 + return;
594 594 var record = records[0];
595 595 this.setFilterName(record.get('name'));
596 596 this.grid.setConditions(record);
597 597 },
598   -
  598 +
599 599 onBeforeSelect: function(combo, record, index)
600 600 {
601 601 /*var me = this;
... ... @@ -617,12 +617,12 @@ Ext.define(&#39;amdaUI.FiltersUI&#39;, {
617 617 }*/
618 618 return true;
619 619 },
620   -
  620 +
621 621 onAddFilter : function(t)
622 622 {
623 623 this.addFilter(null,null);
624 624 },
625   -
  625 +
626 626 addFilter : function(name,conds,successfn)
627 627 {
628 628 var combo = this.getFilterCombo();
... ... @@ -630,20 +630,20 @@ Ext.define(&#39;amdaUI.FiltersUI&#39;, {
630 630 return null;
631 631  
632 632 var newRec = Ext.create('amdaModel.FilterDef');
633   -
  633 +
634 634 if (name != null)
635 635 newRec.set('name',name);
636   -
  636 +
637 637 newRec.conditions();
638   -
  638 +
639 639 if (conds != null)
640 640 Ext.each(conds, function(cond)
641 641 {
642 642 newRec.conditions().add(cond);
643 643 },this);
644   -
  644 +
645 645 combo.store.add(newRec);
646   -
  646 +
647 647 //sync store with the server
648 648 combo.store.sync({
649 649 scope: this,
... ... @@ -655,27 +655,27 @@ Ext.define(&#39;amdaUI.FiltersUI&#39;, {
655 655 newRec.conditions().removeAll();
656 656 newRec.conditions().add(resRec.conditions);
657 657 combo.select(newRec);
658   - combo.fireEvent('select', combo, [newRec] );
  658 + combo.fireEvent('select', combo, [newRec] );
659 659 if (successfn)
660 660 successfn.call(this,newRec);
661 661 }});
662   -
  662 +
663 663 return newRec;
664 664 },
665   -
  665 +
666 666 onDeleteFilter : function(t)
667 667 {
668 668 var combo = this.getFilterCombo();
669 669 if (!combo)
670 670 return;
671   -
  671 +
672 672 var rec = this.getCrtFilterRecord();
673   -
  673 +
674 674 if (!rec)
675 675 return;
676 676 if (rec.get("id") == "0")
677 677 Ext.Msg.show( {
678   - title : 'Filter',
  678 + title : 'Filter',
679 679 msg : 'Cannot delete the Default Filter',
680 680 modal : false,
681 681 icon : Ext.Msg.ERROR,
... ... @@ -691,47 +691,44 @@ Ext.define(&#39;amdaUI.FiltersUI&#39;, {
691 691 //fire select event
692 692 combo.fireEvent('select', combo, [combo.store.getAt(0)]);
693 693 }
694   - // the same in WS explorer combobox
  694 + // the same in WS explorer combobox
695 695 myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.explorer.id, true, function (module) {
696 696 var store = module.filtersStore;
697   - var win = module.getUiContent();
  697 + var win = module.getUiContent();
698 698 var comboList = win.dockedItems.getAt(1).items.items[0];
699   -
700   - var recList = store.getById(rec.get("id"));
701   - store.remove(recList);
  699 +
  700 + var recList = store.getById(rec.get("id"));
  701 + store.remove(recList);
702 702 if (store.getCount() > 0)
703   - {
704   - comboList.select(store.getAt(0));
  703 + {
  704 + comboList.select(store.getAt(0));
705 705 //fire select event
706 706 comboList.fireEvent('select', comboList, [store.getAt(0)]);
707   - }
  707 + }
708 708 });
709   -
  709 +
710 710 }
711 711 },
712   -
  712 +
713 713 onSaveFilter : function(t)
714 714 {
715 715 var filters = this.getFilterCombo().getStore().data.items;
716 716 for (key in filters) {
717 717 if (filters[key].get('name') === this.getFilterName()) {
718   - Ext.Msg.show({
719   - title:'Duplicated name',
720   - msg: 'This name is already used.<br/>Please choose an other one or remove the old filter.',
721   - icon: Ext.Msg.WARNING
722   - });
  718 + myDesktopApp.infoMsg('This name is already used.<br/>' +
  719 + 'Please choose an other one or remove the old filter.');
723 720 return null;
724 721 }
725 722 }
726 723  
727 724 var rec = this.getCrtFilterRecord();
728   -
  725 +
729 726 if (!rec)
730 727 return;
731   -
  728 +
732 729 this.saveFilter(rec);
733 730 },
734   -
  731 +
735 732 onApplyFilter : function(t)
736 733 {
737 734 var me = this;
... ... @@ -748,27 +745,27 @@ Ext.define(&#39;amdaUI.FiltersUI&#39;, {
748 745 );
749 746 return;
750 747 }
751   -
  748 +
752 749 this.requestApplyFilter(rec);
753 750 },
754   -
  751 +
755 752 requestApplyFilter : function(rec)
756 753 {
757   - AmdaAction.setCrtFilterId({id : rec.get('id')},
  754 + AmdaAction.setCrtFilterId({id : rec.get('id')},
758 755 function (result, e)
759 756 {
760 757 var t = e.getTransaction();
761   - if (e.status)
762   - {
  758 + if (e.status)
  759 + {
763 760 if (result)
764 761 {
765 762 myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.explorer.id, true, function (module) {
766   - module.setCrtFilter();
767   - });
  763 + module.setCrtFilter();
  764 + });
768 765 }
769 766 else
770 767 Ext.Msg.show( {
771   - title : 'Filter',
  768 + title : 'Filter',
772 769 msg : 'Cannot apply filter',
773 770 modal : true,
774 771 icon : Ext.Msg.ERROR,
... ... @@ -779,10 +776,10 @@ Ext.define(&#39;amdaUI.FiltersUI&#39;, {
779 776 {
780 777 // FAILURE
781 778 Ext.Msg.show({title:'Error System', msg: e.message, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK});
782   - }
  779 + }
783 780 },this);
784 781 },
785   -
  782 +
786 783 isDirty : function(filter)
787 784 {
788 785 if (filter.dirty)
... ... @@ -798,7 +795,7 @@ Ext.define(&#39;amdaUI.FiltersUI&#39;, {
798 795 );
799 796 return dirty;
800 797 },
801   -
  798 +
802 799 getFilterCombo : function()
803 800 {
804 801 var comboField = this.query('#filter_combo');
... ... @@ -806,7 +803,7 @@ Ext.define(&#39;amdaUI.FiltersUI&#39;, {
806 803 return null;
807 804 return comboField[0];
808 805 },
809   -
  806 +
810 807 getNameField : function()
811 808 {
812 809 var nameField = this.query('#filter_name');
... ... @@ -814,11 +811,11 @@ Ext.define(&#39;amdaUI.FiltersUI&#39;, {
814 811 return null;
815 812 return nameField[0];
816 813 },
817   -
  814 +
818 815 saveFilter : function(rec,successfn)
819 816 {
820 817 var me = this;
821   -
  818 +
822 819 var filterName = this.getFilterName();
823 820 if (!filterName)
824 821 return;
... ... @@ -842,13 +839,13 @@ Ext.define(&#39;amdaUI.FiltersUI&#39;, {
842 839 });
843 840 return;
844 841 }
845   -
  842 +
846 843 var msg;
847 844 if (rec.get('id') == 0)
848 845 msg = 'The name of the default filter cannot be modified. Do you want to create a new instance of this filter?';
849 846 else
850 847 msg = 'Filter name has been changed. Do you want to create a new instance of this filter?';
851   -
  848 +
852 849 Ext.Msg.confirm('Filters', msg,
853 850 function(btn) {
854 851 if (btn == 'yes')
... ... @@ -861,33 +858,33 @@ Ext.define(&#39;amdaUI.FiltersUI&#39;, {
861 858 conds[i] = cond.getJsonValues();
862 859 },
863 860 this);
864   -
  861 +
865 862 //reload conditions of the current filter
866 863 amdaModel.FilterDef.load(rec.get('id'),
867 864 {
868 865 scope : this,
869   - callback : function(r, operation)
  866 + callback : function(r, operation)
870 867 {
871 868 //reset modifications on current record
872 869 rec.conditions().removeAll();
873 870 rec.conditions().loadData(r.conditions().data.items);
874 871 //create the new filter
875 872 var newRec = this.addFilter(filterName,conds,successfn);
876   -
  873 +
877 874 }
878   - }
  875 + }
879 876 );
880 877 return;
881   - }
882   -
  878 + }
  879 +
883 880 if (rec.get('id') == 0)
884 881 {
885 882 filterName = rec.get('name'); //cannot change default filter name
886 883 this.setFilterName(filterName);
887 884 }
888   -
  885 +
889 886 //change the name of the filter
890   - rec.set('name',filterName);
  887 + rec.set('name',filterName);
891 888 //save modifications
892 889 rec.save({
893 890 success: function() {
... ... @@ -905,9 +902,9 @@ Ext.define(&#39;amdaUI.FiltersUI&#39;, {
905 902 });
906 903 },
907 904 this
908   - );
  905 + );
909 906 },
910   -
  907 +
911 908 setFilterName : function(n)
912 909 {
913 910 var nameField = this.getNameField();
... ... @@ -915,13 +912,13 @@ Ext.define(&#39;amdaUI.FiltersUI&#39;, {
915 912 return;
916 913 nameField.setValue(n);
917 914 },
918   -
  915 +
919 916 getFilterName : function()
920 917 {
921 918 var nameField = this.getNameField();
922 919 return nameField.getValue();
923 920 },
924   -
  921 +
925 922 getCrtFilterRecord : function()
926 923 {
927 924 var combo = this.getFilterCombo();
... ... @@ -929,14 +926,14 @@ Ext.define(&#39;amdaUI.FiltersUI&#39;, {
929 926 return null;
930 927 return combo.store.getById(combo.getValue());
931 928 },
932   -
  929 +
933 930 setCrtFilter : function()
934   - {
  931 + {
935 932 AmdaAction.getCrtFilterId(function (result, e)
936 933 {
937 934 var t = e.getTransaction();
938   - if (e.status)
939   - {
  935 + if (e.status)
  936 + {
940 937 if (result)
941 938 {
942 939 var crtId = result;
... ... @@ -960,17 +957,17 @@ Ext.define(&#39;amdaUI.FiltersUI&#39;, {
960 957 {
961 958 // FAILURE
962 959 Ext.Msg.show({title:'Error System', msg: e.message, icon: Ext.MessageBox.ERROR, buttons: Ext.Msg.OK});
963   - }
  960 + }
964 961 },this);
965 962 },
966   -
  963 +
967 964 createFilterStore : function()
968 965 {
969 966 return Ext.create('Ext.data.Store',
970 967 {
971 968 model: 'amdaModel.FilterDef',
972 969 autoLoad : true,
973   - listeners :
  970 + listeners :
974 971 {
975 972 'load' : function(store, records, successful)
976 973 {
... ... @@ -987,10 +984,10 @@ Ext.define(&#39;amdaUI.FiltersUI&#39;, {
987 984 },
988 985 scope : this
989 986 }
990   -
  987 +
991 988 });
992 989 },
993   -
  990 +
994 991 reloadFilter : function()
995 992 {
996 993 var combo = this.getFilterCombo();
... ... @@ -998,7 +995,7 @@ Ext.define(&#39;amdaUI.FiltersUI&#39;, {
998 995 return;
999 996 combo.getStore().reload();
1000 997 },
1001   -
  998 +
1002 999 createToolBar : function()
1003 1000 {
1004 1001 var me = this;
... ... @@ -1041,10 +1038,10 @@ Ext.define(&#39;amdaUI.FiltersUI&#39;, {
1041 1038 'beforeselect' : this.onBeforeSelect
1042 1039 }
1043 1040 }
1044   -
  1041 +
1045 1042 ];
1046 1043 },
1047   -
  1044 +
1048 1045 createInfoPanel : function()
1049 1046 {
1050 1047 var me = this;
... ... @@ -1080,21 +1077,21 @@ Ext.define(&#39;amdaUI.FiltersUI&#39;, {
1080 1077 ]
1081 1078 };
1082 1079 },
1083   -
  1080 +
1084 1081 createGridPanel : function()
1085 1082 {
1086 1083 this.grid = Ext.create('amdaUI.FilterGridPanel',{});
1087 1084 return this.grid;
1088 1085 },
1089   -
1090   - init : function(config)
  1086 +
  1087 + init : function(config)
1091 1088 {
1092 1089 var me = this;
1093   -
  1090 +
1094 1091 var myConf = {
1095 1092 layout: 'border',
1096 1093 tbar : this.createToolBar(),
1097   - items: [
  1094 + items: [
1098 1095 {
1099 1096 xtype : 'panel',
1100 1097 region: 'center',
... ... @@ -1107,10 +1104,10 @@ Ext.define(&#39;amdaUI.FiltersUI&#39;, {
1107 1104 items : [
1108 1105 this.createInfoPanel(),
1109 1106 this.createGridPanel()
1110   - ]
  1107 + ]
1111 1108 },
1112 1109 {
1113   - xtype: 'panel',
  1110 + xtype: 'panel',
1114 1111 region: 'south',
1115 1112 title: 'Information',
1116 1113 collapsible: true,
... ... @@ -1121,12 +1118,12 @@ Ext.define(&#39;amdaUI.FiltersUI&#39;, {
1121 1118 loader: {
1122 1119 autoLoad: true,
1123 1120 url: helpDir+'filterHOWTO'
1124   - }
  1121 + }
1125 1122 }
1126 1123 ]
1127 1124 };
1128 1125 Ext.apply (me , Ext.apply (arguments, myConf));
1129   -
  1126 +
1130 1127 this.filtersInfoStore = Ext.create('Ext.data.Store',{model: 'amdaModel.FilterInfo'});
1131 1128 this.filtersListStore = Ext.create('Ext.data.Store',{model: 'amdaModel.FilterSelectList'});
1132 1129  
... ... @@ -1138,7 +1135,7 @@ Ext.define(&#39;amdaUI.FiltersUI&#39;, {
1138 1135 this.filtersListStore.load({
1139 1136 scope : me,
1140 1137 callback: function(records, operation, success)
1141   - {
  1138 + {
1142 1139 me.grid.setFiltersListStore(this.filtersListStore);
1143 1140 }
1144 1141 });
... ...
js/app/views/ParameterUI.js
... ... @@ -286,7 +286,6 @@ Ext.define(&#39;amdaUI.ParameterUI&#39;,
286 286 validateOnChange: false,
287 287 validateOnBlur: false,
288 288 validator : this.isBalanced,
289   - // ToDo - BRE - Wait the fix for drag&drop issue
290 289 listeners :
291 290 {
292 291 render : function(o,op)
... ...
js/app/views/PlotComponents/PlotBaseSerieForm.js
... ... @@ -90,7 +90,7 @@ Ext.define(&#39;amdaPlotComp.PlotBaseSerieForm&#39;, {
90 90 me.object.set('serie-yaxis', value);
91 91 me.crtTree.refresh();
92 92 }),
93   - this.addStandardFieldSet('Y Values range', '', this.getValuesRangeItems()),
  93 + this.addStandardFieldSet('Min/Max thresholds', '', this.getValuesRangeItems()),
94 94 this.addStandardParamDropTarget('serie-colored-param', 'Colored Parameter'),
95 95 this.addStandardFieldSet('Lines', 'serie-lines-activated', this.addStandardLineItems('serie-lines')),
96 96 this.addStandardFieldSet('Symbols', 'serie-symbols-activated', this.addStandardSymbolsItems('serie-symbols')),
... ...
js/app/views/PlotComponents/PlotSpectroForm.js
... ... @@ -30,7 +30,7 @@ Ext.define(&#39;amdaPlotComp.PlotSpectroForm&#39;, {
30 30 me.object.set('spectro-yaxis', value);
31 31 me.crtTree.refresh();
32 32 }),
33   - this.addStandardFieldSet('Values range', '', this.getValuesRangeItems())
  33 + this.addStandardFieldSet('Min/Max thresholds', '', this.getValuesRangeItems())
34 34 ];
35 35 }
36 36 });
37 37 \ No newline at end of file
... ...
js/app/views/PlotComponents/PlotZoomPlug.js
1 1 /**
2   - * Project  : AMDA-NG
3   - * Name : PlotZoomPlug.js
4   - * @plugin amdaPlotComp.PlotZoomPlug
5   - * @extends Ext.util.Observable
6   - * @ptype plotZoomPlugin
7   - * @brief Plot Zoom UI (View)
8   - * @author Benjamin
9   - * @version $Id: PlotZoomPlug.js
10   - ********************************************************************************
11   - * FT Id : Date : Name - Description
12   - *******************************************************************************
13   - * :
14   - */
  2 + * Project  : AMDA-NG
  3 + * Name : PlotZoomPlug.js
  4 + * @plugin amdaPlotComp.PlotZoomPlug
  5 + * @extends Ext.util.Observable
  6 + * @ptype plotZoomPlugin
  7 + * @brief Plot Zoom UI (View)
  8 + * @author Benjamin
  9 + * @version $Id: PlotZoomPlug.js
  10 + ********************************************************************************
  11 + * FT Id : Date : Name - Description
  12 + *******************************************************************************
  13 + * :
  14 + */
15 15  
16 16  
17 17 Ext.define('amdaPlotComp.PlotZoomPlug', {
18   - extend: 'Ext.util.Observable',
19   - alias: 'plugin.plotZoomPlugin',
20   -
21   - id: 'plot-zoom-plug',
22   -
23   - ttModuleId : 'timetab-win',
24   -
25   - win : null,
26   - form : null,
27   - zoomType : '',
28   - tabId : '',
29   - panelId : -1,
30   -
31   - linkedTTNode : null,
32   -
33   - constructor: function(config) {
34   - Ext.apply(this, config);
35   - this.callParent(arguments);
36   - },
37   -
38   - onDestroy : function() {
39   - this.win = null;
40   - },
41   -
42   - init: function(cmp) {
43   - this.hostCmp = cmp;
44   - },
45   -
46   - setMinValue : function(min) {
47   - if (!this.form)
48   - return;
49   -
50   - if (this.zoomType == 'timeAxis')
51   - this.form.getForm().findField('zoom-min-time').setValue(min);
52   - else
53   - this.form.getForm().findField('zoom-min-float').setValue(min);
54   - },
55   -
56   - setMaxValue : function(max) {
57   - if (!this.form)
58   - return;
59   -
60   - if (this.zoomType == 'timeAxis')
61   - {
62   - var minValue = this.form.getForm().findField('zoom-min-time').getValue();
63   - if (minValue <= max)
64   - this.form.getForm().findField('zoom-max-time').setValue(max);
65   - else
66   - {
67   - this.form.getForm().findField('zoom-min-time').setValue(max);
68   - this.form.getForm().findField('zoom-max-time').setValue(minValue);
69   - }
70   - }
71   - else
72   - {
73   - var minValue = this.form.getForm().findField('zoom-min-float').getValue();
74   - if (minValue <= max)
75   - this.form.getForm().findField('zoom-max-float').setValue(max);
76   - else
77   - {
78   - this.form.getForm().findField('zoom-min-float').setValue(max);
79   - this.form.getForm().findField('zoom-max-float').setValue(minValue);
80   - }
81   - }
82   - },
83   -
84   -/**
85   - * add Interval to Time table
86   - **/
87   - insertInterval: function() {
88   - if (this.zoomType != 'timeAxis')
89   - return;
90   -
91   - var start = this.form.getForm().findField('zoom-min-time').getValue();
92   - var stop = this.form.getForm().findField('zoom-max-time').getValue();
93   -
94   - myDesktopApp.getLoadedModule(this.ttModuleId, true, function(module){
95   - var targetModuleUI = module.getUiContent();
96   - if (targetModuleUI)
97   - targetModuleUI.addInterval(start,stop);
98   - });
99   - },
  18 + extend: 'Ext.util.Observable',
  19 + alias: 'plugin.plotZoomPlugin',
100 20  
101   -/**
102   - * creation of the window
103   - */
104   - show : function(tabId, zoomType, panelId) {
105   - if (!this.win)
106   - {
107   - this.win = new Ext.Window({
108   - id: 'plot-zoom-win-' + this.hostCmp.ownerCt.getId(), // Plot window ID
109   - width: 250,
110   - height: 250,
111   - x: 0, y: 0,
112   - baseCls:'x-panel',
113   - title: 'Zoom',
114   - layout: 'fit',
115   - constrain: true,
116   - collapsible: true,
117   - resizable: false,
118   - ghost: false,
119   - renderTo: this.hostCmp.ownerCt.body,
120   - items: this.getFormConfig(),
121   - listeners: {
122   - scope: this,
123   - beforeclose: function() {
124   - this.hostCmp.panelImage.stopZoom();
125   - Ext.PluginManager.unregister(this);
126   - }
127   - },
128   - getConstrainVector: function(constrainTo){
129   - var me = this;
130   - if (me.constrain || me.constrainHeader) {
131   - constrainTo = constrainTo || (me.floatParent && me.floatParent.getTargetEl()) || me.container || me.el.getScopeParent();
132   - return (me.constrainHeader ? me.header.el : me.el).getConstrainVector(constrainTo);
133   - }
134   - }
135   - });
136   -
137   - this.win.on('destroy', this.onDestroy, this);
138   -
139   - Ext.PluginManager.register(this);
140   - }
141   -
142   - this.tabId = tabId;
143   - this.updateWinByType(zoomType, panelId);
144   - this.win.show();
145   - this.win.setPosition(0,0);
146   - },
147   -
148   - close : function() {
149   - if (this.win == null)
150   - return;
151   - this.win.close();
152   - },
153   -
154   - updateWinByType : function(zoomType, panelId) {
155   - if (this.win == null)
156   - return;
157   -
158   - this.zoomType = zoomType;
159   - this.panelId = panelId;
160   -
161   - switch (zoomType)
162   - {
163   - case 'timeAxis':
164   - this.win.setTitle('Zoom on time axis & Interval selection - Panel Id : '+panelId);
165   - break;
166   - case 'y-left' :
167   - this.win.setTitle('Zoom on Y Left axis - Panel Id : '+panelId);
168   - break;
169   - case 'y-right' :
170   - this.win.setTitle('Zoom on Y Right axis - Panel Id : '+panelId);
171   - break;
172   - case 'xaxis_id' :
173   - this.win.setTitle('Zoom on X axis - Panel Id : '+panelId);
174   - break;
175   - }
176   -
177   - this.form.getForm().findField('zoom-min-time').setVisible(this.zoomType == 'timeAxis');
178   - this.form.getForm().findField('zoom-max-time').setVisible(this.zoomType == 'timeAxis');
179   -
180   - this.form.getForm().findField('zoom-min-float').setVisible(this.zoomType != 'timeAxis');
181   - this.form.getForm().findField('zoom-max-float').setVisible(this.zoomType != 'timeAxis');
182   -
183   - var ttNameField = this.form.getForm().findField('tt-name');
184   - if (ttNameField)
185   - ttNameField.findParentByType('fieldset').setVisible(this.zoomType == 'timeAxis');
186   -
187   - this.win.setHeight((this.zoomType == 'timeAxis') ? 250 : 160);
188   - },
189   -
190   - resetMinMaxValue: function() {
191   - if (this.zoomType == 'timeAxis')
192   - {
193   - this.form.getForm().findField('zoom-min-time').setValue('');
194   - this.form.getForm().findField('zoom-max-time').setValue('');
195   - }
196   - else
197   - {
198   - this.form.getForm().findField('zoom-min-float').setValue(null);
199   - this.form.getForm().findField('zoom-max-float').setValue(null);
200   - }
201   -
202   - this.hostCmp.panelImage.resetZoom();
203   - },
  21 + id: 'plot-zoom-plug',
204 22  
205   -/**
206   - * Main form
207   - */
208   - getFormConfig: function(){
209   -
210   - var intervalFieldSet = {
211   - xtype: 'fieldset',
212   - title: 'Interval Selection',
213   - name: 'interval-selection-fieldset',
214   - collapsible: false,
215   - layout: {
216   - type: 'vbox',
217   - pack: 'start',
218   - align: 'stretch'
219   - },
220   - items : [
221   - {
222   - xtype:'datefield', name:'zoom-min-time', fieldLabel: 'Start Time',
223   - format : 'Y-m-d\\TH:i:s'
224   - },
225   - {
226   - xtype:'datefield', name:'zoom-max-time', fieldLabel: 'Stop Time',
227   - format : 'Y-m-d\\TH:i:s'
228   - },
229   - {
230   - xtype:'numberfield', name:'zoom-min-float', fieldLabel: 'Min Value'
231   - },
232   - {
233   - xtype:'numberfield', name:'zoom-max-float', fieldLabel: 'Max Value'
234   - },
235   - {
236   - xtype: 'button',
237   - width: 100,
238   - text: 'Reset interval',
239   - scope: this,
240   - handler: function() {
241   - this.resetMinMaxValue();
242   - }
243   - }
244   - ]
245   - };
246   -
247   - var insertTTFieldSet = {
248   - xtype: 'fieldset',
249   - title: 'TimeTable Insertion',
250   - name: 'tt-insertion-fieldset',
251   - collapsible: false,
252   - layout: {
253   - type: 'vbox',
254   - pack: 'start',
255   - align: 'stretch'
256   - },
257   - items : [
258   - {
259   - xtype: 'textfield',
260   - fieldLabel: 'TimeTable Name',
261   - name: 'tt-name',
262   - listeners :
263   - {
264   - render : function(o,op)
265   - {
266   - var me = this;
267   - var el = me.el;
268   - var dropTarget = Ext.create('Ext.dd.DropTarget', el, {
269   - ddGroup: 'explorerTree',
270   - notifyOver : function(ddSource, e, data)
271   - {
272   - if ((data.records[0].data.nodeType == 'timeTable') && (data.records[0].data.leaf))
273   - {
274   - this.valid = true;
275   - return this.dropAllowed;
276   - }
277   - this.valid = false;
278   - return this.dropNotAllowed;
279   - },
280   - notifyDrop : function(ddSource, e, data)
281   - {
282   - if (!this.valid)
283   - return false;
284   - me.setValue(data.records[0].get('text'));
285   - return true;
286   - }
287   - });
288   - }
289   - }
290   - },
291   - {
292   - xtype: 'button',
293   - width: 100,
294   - text: 'Insert Interval',
295   - scope: this,
296   - handler: function(){
297   - var me = this;
298   -
299   - var TTname = this.form.getForm().findField('tt-name').getValue();
300   -
301   - myDesktopApp.getLoadedModule(this.ttModuleId, true, function(module){
302   - var targetModuleUI = module.getUiContent();
303   - if (me.linkedTTNode && (me.linkedTTNode.get('text') == TTname))
304   - {
305   - if (targetModuleUI)
306   - me.insertInterval();
307   - else
308   - {
309   - me.linkedTTNode.editLeaf(function () {
310   - me.insertInterval();
311   - });
312   - }
313   - }
314   - else
315   - {
316   - if (TTname == '')
317   - {
318   - me.linkedTTNode.editLeaf(function () {
319   - me.insertInterval();
320   - });
321   - }
322   -
323   - var explorerTree = Ext.getCmp(amdaUI.ExplorerUI.RESRC_TAB.TREE_ID);
324   - var ttRootNode = explorerTree.getRootNode().findChild('id','timeTable-treeRootNode',true);
325   - amdaModel.InteractiveNode.preloadNodes(ttRootNode, function() {
326   - var nodeWithSameName = null;
327   -
328   - if (TTname != '')
329   - nodeWithSameName = ttRootNode.findChild('text', TTname, true);
330   -
331   - if (nodeWithSameName !== null)
332   - me.linkedTTNode = nodeWithSameName;
333   - else
334   - {
335   - var obj = Ext.create('amdaModel.TimeTable', {name : TTname, fromPlugin : true});
336   - me.linkedTTNode = Ext.create('amdaModel.TimeTableNode', {
337   - leaf : true,
338   - text : TTname,
339   - nodeType : 'timeTable',
340   - object : obj
341   - });
342   - }
343   -
344   - me.linkedTTNode.editLeaf(function () {
345   - me.insertInterval();
346   - });
347   - });
348   - }
349   - });
350   - }
351   - }
352   - ]
353   - };
354   -
355   - this.form = new Ext.form.FormPanel( {
356   - frame: true,
357   - width: 250,
358   - height: 250,
359   - layout: {
360   - type: 'vbox',
361   - pack: 'start',
362   - align: 'stretch'
363   - },
364   - fieldDefaults: {
365   - labelWidth: 60
366   - },
367   - items: [
368   - intervalFieldSet,
369   - insertTTFieldSet
370   - ],
371   - fbar : [
372   - {
373   - text: 'Apply Zoom',
374   - width: 100,
375   - scope: this,
376   - handler: function(){
377   - if (this.zoomType == 'timeAxis')
378   - {
379   - var minZoom = this.form.getForm().findField('zoom-min-time').getValue();
380   - var maxZoom = this.form.getForm().findField('zoom-max-time').getValue();
381   - }
382   - else
383   - {
384   - var minZoom = this.form.getForm().findField('zoom-min-float').getValue();
385   - var maxZoom = this.form.getForm().findField('zoom-max-float').getValue();
386   - }
387   -
388   - if(!maxZoom || !minZoom || !this.form.getForm().isValid()) {
389   - myDesktopApp.warningMsg('Error in values definition');
390   - return;
391   - }
392   -
393   - this.hostCmp.callInteractivePlot({'action' : 'zoom', 'tabId' : this.tabId, 'panelId' : this.panelId, 'axeId' : this.zoomType, 'min' : minZoom, 'max' : maxZoom});
394   - this.hostCmp.panelImage.resetZoom();
395   - }
396   - },
397   - {
398   - text: 'Undo Zoom',
399   - width: 100,
400   - scope : this,
401   - handler: function(){
402   - this.hostCmp.callInteractivePlot({'action' : 'undozoom', 'tabId' : this.tabId, 'panelId' : this.panelId, 'axeId' : this.zoomType});
403   - this.hostCmp.panelImage.resetZoom();
404   - }
405   - }
406   - ]
407   - });
408   - return this.form;
409   - }
  23 + ttModuleId: 'timetab-win',
  24 +
  25 + win: null,
  26 + form: null,
  27 + zoomType: '',
  28 + tabId: '',
  29 + panelId: -1,
  30 +
  31 + linkedTTNode: null,
  32 +
  33 + constructor: function (config) {
  34 + Ext.apply(this, config);
  35 + this.callParent(arguments);
  36 + },
  37 +
  38 + onDestroy: function () {
  39 + this.win = null;
  40 + },
  41 +
  42 + init: function (cmp) {
  43 + this.hostCmp = cmp;
  44 + },
  45 +
  46 + setMinValue: function (min) {
  47 + if (!this.form)
  48 + return;
  49 +
  50 + if (this.zoomType == 'timeAxis')
  51 + this.form.getForm().findField('zoom-min-time').setValue(min);
  52 + else
  53 + this.form.getForm().findField('zoom-min-float').setValue(min);
  54 + },
  55 +
  56 + setMaxValue: function (max) {
  57 + if (!this.form)
  58 + return;
  59 +
  60 + if (this.zoomType == 'timeAxis') {
  61 + var minValue = this.form.getForm().findField('zoom-min-time').getValue();
  62 + if (minValue <= max)
  63 + this.form.getForm().findField('zoom-max-time').setValue(max);
  64 + else {
  65 + this.form.getForm().findField('zoom-min-time').setValue(max);
  66 + this.form.getForm().findField('zoom-max-time').setValue(minValue);
  67 + }
  68 + }
  69 + else {
  70 + var minValue = this.form.getForm().findField('zoom-min-float').getValue();
  71 + if (minValue <= max)
  72 + this.form.getForm().findField('zoom-max-float').setValue(max);
  73 + else {
  74 + this.form.getForm().findField('zoom-min-float').setValue(max);
  75 + this.form.getForm().findField('zoom-max-float').setValue(minValue);
  76 + }
  77 + }
  78 + },
  79 +
  80 + /**
  81 + * add Interval to Time table
  82 + **/
  83 + insertInterval: function () {
  84 + if (this.zoomType != 'timeAxis')
  85 + return;
  86 +
  87 + var start = this.form.getForm().findField('zoom-min-time').getValue();
  88 + var stop = this.form.getForm().findField('zoom-max-time').getValue();
  89 +
  90 + myDesktopApp.getLoadedModule(this.ttModuleId, true, function (module) {
  91 + var targetModuleUI = module.getUiContent();
  92 + if (targetModuleUI)
  93 + targetModuleUI.addInterval(start, stop);
  94 + });
  95 + },
  96 +
  97 + /**
  98 + * creation of the window
  99 + */
  100 + show: function (tabId, zoomType, panelId) {
  101 + if (!this.win) {
  102 + this.win = new Ext.Window({
  103 + id: 'plot-zoom-win-' + this.hostCmp.ownerCt.getId(), // Plot window ID
  104 + width: 250,
  105 + x: 0, y: 0,
  106 + baseCls: 'x-panel',
  107 + title: 'Zoom',
  108 + constrain: true,
  109 + collapsible: true,
  110 + resizable: false,
  111 + ghost: false,
  112 + renderTo: this.hostCmp.ownerCt.body,
  113 + items: this.getFormConfig(),
  114 + listeners: {
  115 + scope: this,
  116 + beforeclose: function () {
  117 + this.hostCmp.panelImage.stopZoom();
  118 + Ext.PluginManager.unregister(this);
  119 + }
  120 + },
  121 + getConstrainVector: function (constrainTo) {
  122 + var me = this;
  123 + if (me.constrain || me.constrainHeader) {
  124 + constrainTo = constrainTo || (me.floatParent && me.floatParent.getTargetEl()) || me.container || me.el.getScopeParent();
  125 + return (me.constrainHeader ? me.header.el : me.el).getConstrainVector(constrainTo);
  126 + }
  127 + }
  128 + });
  129 +
  130 + this.win.on('destroy', this.onDestroy, this);
  131 +
  132 + Ext.PluginManager.register(this);
  133 + }
  134 +
  135 + this.tabId = tabId;
  136 + this.updateWinByType(zoomType, panelId);
  137 + this.win.show();
  138 + this.win.setPosition(0, 0);
  139 + },
  140 +
  141 + close: function () {
  142 + if (this.win == null)
  143 + return;
  144 + this.win.close();
  145 + },
  146 +
  147 + updateWinByType: function (zoomType, panelId) {
  148 + if (this.win == null)
  149 + return;
  150 +
  151 + this.zoomType = zoomType;
  152 + this.panelId = panelId;
  153 +
  154 + switch (zoomType) {
  155 + case 'timeAxis':
  156 + this.win.setTitle('Zoom on time axis & Interval selection - Panel Id : ' + panelId);
  157 + break;
  158 + case 'y-left' :
  159 + this.win.setTitle('Zoom on Y Left axis - Panel Id : ' + panelId);
  160 + break;
  161 + case 'y-right' :
  162 + this.win.setTitle('Zoom on Y Right axis - Panel Id : ' + panelId);
  163 + break;
  164 + case 'xaxis_id' :
  165 + this.win.setTitle('Zoom on X axis - Panel Id : ' + panelId);
  166 + break;
  167 + }
  168 +
  169 + this.form.getForm().findField('zoom-min-time').setVisible(this.zoomType == 'timeAxis');
  170 + this.form.getForm().findField('zoom-max-time').setVisible(this.zoomType == 'timeAxis');
  171 +
  172 + this.form.getForm().findField('zoom-min-float').setVisible(this.zoomType != 'timeAxis');
  173 + this.form.getForm().findField('zoom-max-float').setVisible(this.zoomType != 'timeAxis');
  174 +
  175 + var ttNameField = this.form.getForm().findField('tt-name');
  176 + if (ttNameField)
  177 + ttNameField.findParentByType('fieldset').setVisible(this.zoomType == 'timeAxis');
  178 + },
  179 +
  180 + resetMinMaxValue: function () {
  181 + if (this.zoomType == 'timeAxis') {
  182 + this.form.getForm().findField('zoom-min-time').setValue('');
  183 + this.form.getForm().findField('zoom-max-time').setValue('');
  184 + }
  185 + else {
  186 + this.form.getForm().findField('zoom-min-float').setValue(null);
  187 + this.form.getForm().findField('zoom-max-float').setValue(null);
  188 + }
  189 +
  190 + this.hostCmp.panelImage.resetZoom();
  191 + },
  192 +
  193 + /**
  194 + * Main form
  195 + */
  196 + getFormConfig: function () {
  197 +
  198 + var intervalFieldSet = {
  199 + xtype: 'fieldset',
  200 + title: 'Interval Selection',
  201 + name: 'interval-selection-fieldset',
  202 + collapsible: false,
  203 + layout: {
  204 + type: 'vbox',
  205 + pack: 'start',
  206 + align: 'stretch'
  207 + },
  208 + items: [
  209 + {
  210 + xtype: 'datefield', name: 'zoom-min-time', fieldLabel: 'Start Time',
  211 + format: 'Y-m-d\\TH:i:s'
  212 + },
  213 + {
  214 + xtype: 'datefield', name: 'zoom-max-time', fieldLabel: 'Stop Time',
  215 + format: 'Y-m-d\\TH:i:s'
  216 + },
  217 + {
  218 + xtype: 'numberfield', name: 'zoom-min-float', fieldLabel: 'Min Value'
  219 + },
  220 + {
  221 + xtype: 'numberfield', name: 'zoom-max-float', fieldLabel: 'Max Value'
  222 + },
  223 + {
  224 + xtype: 'button',
  225 + width: 100,
  226 + text: 'Reset interval',
  227 + scope: this,
  228 + handler: function () {
  229 + this.resetMinMaxValue();
  230 + }
  231 + }
  232 + ]
  233 + };
  234 +
  235 + var insertTTFieldSet = {
  236 + xtype: 'fieldset',
  237 + title: 'TimeTable Insertion',
  238 + name: 'tt-insertion-fieldset',
  239 + collapsible: false,
  240 + layout: {
  241 + type: 'vbox',
  242 + pack: 'start',
  243 + align: 'stretch'
  244 + },
  245 + items: [
  246 + {
  247 + xtype: 'textfield',
  248 + fieldLabel: 'TimeTable Name',
  249 + name: 'tt-name',
  250 + listeners:
  251 + {
  252 + render: function (o, op) {
  253 + var me = this;
  254 + var el = me.el;
  255 + var dropTarget = Ext.create('Ext.dd.DropTarget', el, {
  256 + ddGroup: 'explorerTree',
  257 + notifyOver: function (ddSource, e, data) {
  258 + if ((data.records[0].data.nodeType == 'timeTable') && (data.records[0].data.leaf)) {
  259 + this.valid = true;
  260 + return this.dropAllowed;
  261 + }
  262 + this.valid = false;
  263 + return this.dropNotAllowed;
  264 + },
  265 + notifyDrop: function (ddSource, e, data) {
  266 + if (!this.valid)
  267 + return false;
  268 + me.setValue(data.records[0].get('text'));
  269 + return true;
  270 + }
  271 + });
  272 + }
  273 + }
  274 + },
  275 + {
  276 + xtype: 'button',
  277 + width: 100,
  278 + text: 'Insert Interval',
  279 + scope: this,
  280 + handler: function () {
  281 + var me = this;
  282 +
  283 + var TTname = this.form.getForm().findField('tt-name').getValue();
  284 +
  285 + myDesktopApp.getLoadedModule(this.ttModuleId, true, function (module) {
  286 + var targetModuleUI = module.getUiContent();
  287 + if (me.linkedTTNode && (me.linkedTTNode.get('text') == TTname)) {
  288 + if (targetModuleUI)
  289 + me.insertInterval();
  290 + else {
  291 + me.linkedTTNode.editLeaf(function () {
  292 + me.insertInterval();
  293 + });
  294 + }
  295 + }
  296 + else {
  297 + if (TTname == '') {
  298 + me.linkedTTNode.editLeaf(function () {
  299 + me.insertInterval();
  300 + });
  301 + }
  302 +
  303 + var explorerTree = Ext.getCmp(amdaUI.ExplorerUI.RESRC_TAB.TREE_ID);
  304 + var ttRootNode = explorerTree.getRootNode().findChild('id', 'timeTable-treeRootNode', true);
  305 + amdaModel.InteractiveNode.preloadNodes(ttRootNode, function () {
  306 + var nodeWithSameName = null;
  307 +
  308 + if (TTname != '')
  309 + nodeWithSameName = ttRootNode.findChild('text', TTname, true);
  310 +
  311 + if (nodeWithSameName !== null)
  312 + me.linkedTTNode = nodeWithSameName;
  313 + else {
  314 + var obj = Ext.create('amdaModel.TimeTable', {name: TTname, fromPlugin: true});
  315 + me.linkedTTNode = Ext.create('amdaModel.TimeTableNode', {
  316 + leaf: true,
  317 + text: TTname,
  318 + nodeType: 'timeTable',
  319 + object: obj
  320 + });
  321 + }
  322 +
  323 + me.linkedTTNode.editLeaf(function () {
  324 + me.insertInterval();
  325 + });
  326 + });
  327 + }
  328 + });
  329 + }
  330 + }
  331 + ]
  332 + };
  333 +
  334 + this.form = new Ext.form.FormPanel({
  335 + frame: true,
  336 + width: 250,
  337 + layout: {
  338 + type: 'vbox',
  339 + pack: 'start',
  340 + align: 'stretch'
  341 + },
  342 + fieldDefaults: {
  343 + labelWidth: 60
  344 + },
  345 + items: [
  346 + intervalFieldSet,
  347 + insertTTFieldSet
  348 + ],
  349 + fbar: [
  350 + {
  351 + text: 'Apply Zoom',
  352 + width: 100,
  353 + scope: this,
  354 + handler: function () {
  355 + if (this.zoomType == 'timeAxis') {
  356 + var minZoom = this.form.getForm().findField('zoom-min-time').getValue();
  357 + var maxZoom = this.form.getForm().findField('zoom-max-time').getValue();
  358 + }
  359 + else {
  360 + var minZoom = this.form.getForm().findField('zoom-min-float').getValue();
  361 + var maxZoom = this.form.getForm().findField('zoom-max-float').getValue();
  362 + }
  363 +
  364 + if (!maxZoom || !minZoom || !this.form.getForm().isValid()) {
  365 + myDesktopApp.warningMsg('Error in values definition');
  366 + return;
  367 + }
  368 +
  369 + this.hostCmp.callInteractivePlot({
  370 + 'action': 'zoom',
  371 + 'tabId': this.tabId,
  372 + 'panelId': this.panelId,
  373 + 'axeId': this.zoomType,
  374 + 'min': minZoom,
  375 + 'max': maxZoom
  376 + });
  377 + this.hostCmp.panelImage.resetZoom();
  378 + }
  379 + },
  380 + {
  381 + text: 'Undo Zoom',
  382 + width: 100,
  383 + scope: this,
  384 + handler: function () {
  385 + this.hostCmp.callInteractivePlot({
  386 + 'action': 'undozoom',
  387 + 'tabId': this.tabId,
  388 + 'panelId': this.panelId,
  389 + 'axeId': this.zoomType
  390 + });
  391 + this.hostCmp.panelImage.resetZoom();
  392 + }
  393 + }
  394 + ]
  395 + });
  396 + return this.form;
  397 + }
410 398 });
411 399 \ No newline at end of file
... ...
js/app/views/StatisticsUI.js
... ... @@ -38,8 +38,7 @@ Ext.define(&#39;amdaUI.StatisticsUI&#39;,
38 38 loadObject : function()
39 39 {
40 40 // load object into form
41   - var basicForm = this.formPanel.items.items[0].getForm();
42   -
  41 + var basicForm = this.formPanel.items.items[1].getForm();
43 42 basicForm.loadRecord(this.object);
44 43  
45 44 },
... ... @@ -101,7 +100,21 @@ Ext.define(&#39;amdaUI.StatisticsUI&#39;,
101 100 {
102 101 this.timeSelector.addTT(TTname, TTid); ;
103 102 },
104   -
  103 +
  104 + /**
  105 + * Set Start-Stop from parameter info (Local & MyData)
  106 + */
  107 + setTimeFromData : function(obj) {
  108 + if (!obj.start || !obj.stop)
  109 + return;
  110 +
  111 + var dateStart = new Date(obj.start.replace(/[T|Z]/g,' ').replace(/\-/g,'\/'));
  112 + var dateStop = new Date(obj.stop.replace(/[T|Z]/g,' ').replace(/\-/g,'\/'));
  113 +
  114 + this.formPanel.items.items[1].getForm().setValues({ startDate : dateStart, stopDate : dateStop });
  115 + this.timeSelector.intervalSel.updateDuration();
  116 + },
  117 +
105 118 generateCatalog : function()
106 119 {
107 120 var module = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.statistics.id);
... ... @@ -119,7 +132,7 @@ Ext.define(&#39;amdaUI.StatisticsUI&#39;,
119 132 var updateStatus = true;
120 133  
121 134 var formValues = basicForm.getValues();
122   - //this.object.set('name',formValues.name);
  135 + this.object.set('name',this.fieldName.getValue());
123 136 this.object.set('description',formValues.description);
124 137  
125 138 var recs = this.paramGrid.getStore().getNewRecords();
... ... @@ -207,7 +220,7 @@ Ext.define(&#39;amdaUI.StatisticsUI&#39;,
207 220 fields: [ 'name', 'hidden_id']
208 221 });
209 222  
210   - this.timeSelector = new amdaUI.TimeSelectorUI({id: 'statisticsTimeSelector', height : 160});
  223 + this.timeSelector = new amdaUI.TimeSelectorUI({id: 'statisticsTimeSelector', flex:1});
211 224  
212 225 var store = Ext.create('Ext.data.Store',
213 226 {
... ... @@ -218,8 +231,8 @@ Ext.define(&#39;amdaUI.StatisticsUI&#39;,
218 231 {
219 232 title: 'Select Parameter & Apply Function',
220 233 selType : 'rowmodel',
221   - // flex: 2,
222   - height :250,
  234 + flex: 2,
  235 + // height :250,
223 236 store : store,
224 237 columns: [
225 238 { xtype: 'rownumberer' },
... ... @@ -362,36 +375,20 @@ Ext.define(&#39;amdaUI.StatisticsUI&#39;,
362 375 this.formPanel = Ext.create('Ext.form.Panel',
363 376 {
364 377 region: 'center',
365   - layout: 'hbox',
  378 + layout: {
  379 + type: 'hbox',
  380 + pack: 'start',
  381 + align: 'stretch'
  382 + },
366 383 //bodyStyle: {background : '#dfe8f6'},
367 384 defaults: { bodyStyle: {background : '#dfe8f6'}, padding : '3'},
368 385 fieldDefaults: { labelWidth: 80, labelAlign : 'top' },
369   - items: [
370   - {
  386 + items: [ {
371 387 xtype: 'form',
372 388 flex : 1,
373 389 layout: {type: 'vbox', pack: 'start', align: 'stretch'},
374   - items : [
375   - this.paramGrid,
376   - this.timeSelector
377   - ]
378   - },
379   - {
380   - xtype: 'form',
381   - title: 'Additional Information',
382   - flex : 1,
383   - layout: {type: 'vbox', pack: 'start', align: 'stretch', padding : '3'},
384   - items : [
385   - this.fieldName,
386   - {
387   - xtype: 'textarea',
388   - name: 'description',
389   - fieldLabel: 'Description',
390   - height: 200
391   - }
392   - ],
393   - fbar:[
394   - {
  390 + items : [ this.paramGrid ],
  391 + fbar:[ {
395 392 type: 'button',
396 393 text: 'Generate Catalog',
397 394 scope : this,
... ... @@ -399,8 +396,7 @@ Ext.define(&#39;amdaUI.StatisticsUI&#39;,
399 396 {
400 397 // update object with user's values
401 398 // if the return is true (object had been updated)
402   - if(this.updateObject()){
403   - this.updateObject();
  399 + if (this.updateObject()){
404 400 this.generateCatalog();
405 401 }
406 402 }
... ... @@ -409,9 +405,31 @@ Ext.define(&#39;amdaUI.StatisticsUI&#39;,
409 405 type: 'button',
410 406 text: 'Reset',
411 407 scope : this,
412   - handler: function() {}
  408 + handler: function() {
  409 + this.formPanel.getForm().reset();
  410 + this.paramGrid.store.removeAll();
  411 + this.timeSelector.TTGrid.store.removeAll();
  412 + }
413 413 }]
414   - }]
  414 + },
  415 + {
  416 + xtype: 'form',
  417 + title: 'Additional Information',
  418 + flex : 1,
  419 + trackResetOnLoad: true,
  420 + layout: {type: 'vbox', pack: 'start', align: 'stretch', padding : '3'},
  421 + items : [
  422 + this.fieldName,
  423 + {
  424 + xtype: 'textarea',
  425 + name: 'description',
  426 + fieldLabel: 'Description',
  427 + height: 125
  428 + },
  429 + this.timeSelector
  430 + ]
  431 + }
  432 + ]
415 433 });
416 434  
417 435 var myConf = {
... ...
js/app/views/UploadPanelUI.js
... ... @@ -19,7 +19,7 @@ Ext.define(&#39;amdaUI.UploadPanelUI&#39;, {
19 19 isFile : true,
20 20 isTimeTable : false,
21 21 tmpNode : null,
22   -
  22 +
23 23 constructor: function(config)
24 24 {
25 25 this.init(config);
... ... @@ -310,16 +310,9 @@ Ext.define(&#39;amdaUI.UploadPanelUI&#39;, {
310 310 {
311 311 var title = 'Time Table';
312 312 var items = [
313   - { boxLabel: 'ASCII', name: 'ttfrmt', inputValue: 'ASCII', checked: true,
314   - listeners: {
315   - change: function (cb, nv, ov) {
316   - if (nv) Ext.getCmp('tf_tt').show();
317   - else Ext.getCmp('tf_tt').hide();
318   - }
319   - }
320   - },
321   - { boxLabel: 'VOTable', name: 'ttfrmt', inputValue: 'VOT'}];
322   -
  313 + { boxLabel: 'ASCII&nbsp;<img amda_clicktip="ttTimeFormat" style="vertical-align:bottom" src="js/resources/images/16x16/info_mini.png"', name: 'ttfrmt', inputValue: 'ASCII', checked: true},
  314 + { boxLabel: 'VOTable', name: 'ttfrmt', inputValue: 'VOT'}
  315 + ];
323 316 var timeFormatId = 'tf_tt';
324 317 this.formatId = 'nsf_tt';
325 318 this.localUploadId = 'form-uploadtt';
... ... @@ -467,12 +460,11 @@ Ext.define(&#39;amdaUI.UploadPanelUI&#39;, {
467 460 }
468 461 }
469 462 };
470   - var isCatalog = !(this.isFile || this.isTimeTable);
471 463  
472 464 var timeFormat = Ext.create('Ext.form.FieldSet', {
473 465 id: timeFormatId,
474 466 title: 'Time Settings',
475   - hidden : isCatalog,
  467 + hidden : !this.isFile,
476 468 items : [
477 469 {
478 470 xtype: 'radiogroup',
... ...
php/RemoteDataCenter/getRemoteDDBaseProxies.php
... ... @@ -45,19 +45,27 @@
45 45 exit("No Bases.xml file at DDBase/INFO ? IMPEX only".PHP_EOL);
46 46  
47 47 $basesRemote = $basesDomRemote->getElementsByTagName("dataCenter");
48   -
  48 + echo INFOSITE.PHP_EOL;
49 49 foreach ($basesRemote as $baseRemote) {
50 50 $baseId = $baseRemote->getAttribute("xml:id");
  51 +
51 52 // add remote base if it doesn't exist
52 53 if (!$basesDom->getElementById($baseId)) {
53   - $baseClone = $basesDom->importNode($baseRemote);
54   - $basesDom->documentElement->appendChild($baseClone);
55 54 $baseDir = DATAPATH."/RemoteData/$baseId";
56 55 $baseDirRemote = INFOSITE."INFO/bases/$baseId";
57 56 if (!is_dir($baseDir)) mkdir($baseDir);
58   -
59   - if (!copy("$baseDirRemote/base.xml", "$baseDir/base.xml"))
60   - echo "Cannot copy base.xml for $baseId".PHP_EOL;
  57 + if (!copy("$baseDirRemote/base.xml", "$baseDir/base.xml")) {
  58 + echo "Cannot copy base.xml for $baseId".PHP_EOL;
  59 + }
  60 + else {
  61 + $baseClone = $basesDom->importNode($baseRemote);
  62 + $basesDom->documentElement->appendChild($baseClone);
  63 + echo "Added $baseId".PHP_EOL;
  64 + if ($baseId == "THEMIS") {
  65 + $center = new THEMIS();
  66 + $center->makeAllParams();
  67 + }
  68 + }
61 69 }
62 70 }
63 71 }
... ...
php/RemoteDataCenter/makeRemoteParamInternal.php deleted
... ... @@ -1,20 +0,0 @@
1   -<?php
2   -/*
3   -* Executable to make
4   -*/
5   -
6   - if (!function_exists('__autoload')) {
7   - function __autoload($class_name) {
8   - require_once $class_name . '.php';
9   - }
10   - }
11   -
12   - $AMDA_IHM = getenv('AMDA_IHM');
13   -
14   - require_once $AMDA_IHM."/php/config.php";
15   -
16   - $center = new THEMIS();
17   -
18   - $center->makeAllParams();
19   -
20   -?>
21 0 \ No newline at end of file
php/classes/AmdaAction.php
... ... @@ -2,10 +2,8 @@
2 2 /**
3 3 * @class AmdaAction
4 4 * @version $Id: AmdaAction.php 2976 2015-07-01 15:05:40Z benjamin $
5   - *
  5 + * @brief
6 6 */
7   -
8   -
9 7 class AmdaAction
10 8 {
11 9 private $xmlFiles = array('localParam' => 'LocalParams.xml', 'remoteParam' => 'RemoteParams.xml',
... ... @@ -60,7 +58,6 @@ class AmdaAction
60 58 * $obj = { id: node.id, nodeType: node.nodeType }
61 59 */
62 60 public function getTree($obj) {
63   -
64 61 $node = $obj->node;
65 62  
66 63 $nodeType = $obj->nodeType;
... ... @@ -104,6 +101,7 @@ class AmdaAction
104 101 $xmlName = SHAREDPATH.'/SharedObjectTree.xml';
105 102 break;
106 103 case 'bkgWorks':
  104 + // data/<user>/JOBS/jobs.xml
107 105 $xmlName = USERJOBDIR.$this->xmlFiles[$nodeType];
108 106 break;
109 107 case 'source':
... ... @@ -146,8 +144,6 @@ class AmdaAction
146 144 $id = $child->getAttribute('xml:id');
147 145 $name = $child->getAttribute('name');
148 146 $help = $child->getAttribute('att');
149   - if ($child->hasAttribute('dataStart')) $dataStart = $child->getAttribute('dataStart');
150   - if ($child->hasAttribute('dataStop')) $dataStop = $child->getAttribute('dataStop');
151 147  
152 148 $specialNode = false;
153 149 $isParameter = false;
... ... @@ -160,12 +156,17 @@ class AmdaAction
160 156 {
161 157 case 'bkgWorks':
162 158 $specialNode = true;
163   - $status = $child->getAttribute('status');
164   - // if ($status == 'done') continue;
165   - $childrenToReturn[] = array('text' => $name, 'id' => $id,'nodeType' => $nodeType, 'leaf' => $isLeaf,
166   - 'pid' => $child->getAttribute('pid'), 'status' => $status,
167   - 'jobType' => $child->getAttribute('jobType'), 'info' => $child->getAttribute('info'));
168   - break;
  159 + $childrenToReturn[] = [
  160 + 'text' => $name,
  161 + 'id' => $id,
  162 + 'nodeType' => $nodeType,
  163 + 'leaf' => $isLeaf,
  164 + 'pid' => $child->getAttribute('pid'),
  165 + 'status' => $child->getAttribute('status'),
  166 + 'jobType' => $child->getAttribute('jobType'),
  167 + 'info' => $child->getAttribute('info')
  168 + ];
  169 + break;
169 170  
170 171 case 'condition':
171 172 $objectMgr = new RequestMgr();
... ... @@ -177,9 +178,8 @@ class AmdaAction
177 178 $objplot = $objectMgr->getObject($id);
178 179 for ($i=0; $i < count($objplot->children); $i++)
179 180 {
180   - for ($j=0; $j < count($objplot->children[$i]->children); $j++)
181   - {
182   - $info = $info.' '.$objplot->children[$i]->children[$j]->name;
  181 + for ($j=0; $j < count($objplot->children[$i]->children); $j++) {
  182 + $info = $info.' . '.$objplot->children[$i]->children[$j]->name;
183 183 }
184 184 }
185 185 break;
... ... @@ -483,14 +483,7 @@ class AmdaAction
483 483 else
484 484 {
485 485 $restricted = FALSE;
486   -// if ($child->tagName == 'dataCenter')
487   -// {
488   -// $restricted = ($child->getAttribute('available') != "1");
489   -// }
490   -//
491   - if ($id == 'CDAWEB' || $id == 'THEMIS'|| $id == 'MAPSKP')
492   - $restricted = FALSE;
493   -
  486 +
494 487 if ($child->tagName == 'dataset')
495 488 {
496 489 $nonavailable = ($child->getAttribute('disabled'));
... ... @@ -683,8 +676,7 @@ class AmdaAction
683 676 case 'request' :
684 677 $objectMgr = new RequestMgr($nodeType);
685 678 break;
686   - case 'bkgWorks' :
687   - require_once(INTEGRATION_SRC_DIR."RequestManager.php");
  679 + case 'bkgWorks' :
688 680 return $this->executeRequest($id, FunctionTypeEnumClass::PROCESSGETINFO);
689 681 break;
690 682 case 'myData' :
... ... @@ -722,7 +714,6 @@ class AmdaAction
722 714 $obj->id = substr($obj->id,strlen('alias_'));
723 715 break;
724 716 case 'bkgWorks' :
725   - require_once(INTEGRATION_SRC_DIR."RequestManager.php");
726 717 return $this->executeRequest($obj, FunctionTypeEnumClass::PROCESSDELETE);
727 718  
728 719 case 'myData' :
... ... @@ -857,7 +848,6 @@ class AmdaAction
857 848 */
858 849 public function getJobs()
859 850 {
860   - require_once(INTEGRATION_SRC_DIR."RequestManager.php");
861 851 $obj = (object) array();
862 852 return $this->executeRequest($obj, FunctionTypeEnumClass::PROCESSRUNNINGINFO);
863 853 }
... ... @@ -906,7 +896,7 @@ class AmdaAction
906 896 }
907 897  
908 898 private function executeRequest($obj, $function)
909   - {
  899 + {
910 900 // Check user if access to DD Server and / or possible 'space consuming' action
911 901 if ( $function == FunctionTypeEnumClass::PARAMS ||
912 902 $function == FunctionTypeEnumClass::ACTION ||
... ... @@ -917,13 +907,11 @@ class AmdaAction
917 907 }
918 908  
919 909 $requestManager = new RequestManagerClass();
920   -
921 910 try {
922 911 $res = $requestManager->runIHMRequest($this->user, !empty($res['userHost']) ? $res['userHost'] : NULL, $function, $obj);
923 912 } catch (Exception $e) {
924 913 return array('success' => false, 'message' => 'Exception detected : '.$e->getMessage());
925 914 }
926   -
927 915 return $res;
928 916 }
929 917  
... ... @@ -932,8 +920,6 @@ class AmdaAction
932 920 */
933 921 public function execute($node, $obj)
934 922 {
935   - require_once(INTEGRATION_SRC_DIR."RequestManager.php");
936   -
937 923 // just convert TT / Catalog
938 924 if ($obj->nodeType == "download" && $obj->downloadSrc == "1")
939 925 return $this->executeRequest($obj, FunctionTypeEnumClass::TTCONVERT);
... ... @@ -953,7 +939,6 @@ class AmdaAction
953 939 */
954 940 public function compilParam($obj)
955 941 {
956   - require_once(INTEGRATION_SRC_DIR."RequestManager.php");
957 942 return $this->executeRequest($obj, FunctionTypeEnumClass::PARAMSGEN);
958 943 }
959 944  
... ... @@ -962,7 +947,6 @@ class AmdaAction
962 947 */
963 948 public function compilParamDelete($obj)
964 949 {
965   - require_once(INTEGRATION_SRC_DIR."RequestManager.php");
966 950 $res = $this->checkUser($obj);
967 951  
968 952 if (!$res['success'])
... ... @@ -981,7 +965,6 @@ class AmdaAction
981 965  
982 966 public function killPlotRequest()
983 967 {
984   - require_once(INTEGRATION_SRC_DIR."RequestManager.php");
985 968 return $this->executeRequest((object) array('nodeType' => 'killplot'), FunctionTypeEnumClass::PARAMS);
986 969 }
987 970  
... ... @@ -1323,7 +1306,6 @@ class AmdaAction
1323 1306 public function cleanUserWS()
1324 1307 {
1325 1308 $this->rrmdir(USERDIR.'DOWNLOAD.TEMP');
1326   - require_once(INTEGRATION_SRC_DIR."RequestManager.php");
1327 1309 IHMConfigClass::setUserName($this->user);
1328 1310  
1329 1311 // delete impex params and data
... ... @@ -1359,7 +1341,6 @@ class AmdaAction
1359 1341  
1360 1342 public function interactivePlot($obj, $multiPlotState)
1361 1343 {
1362   - require_once(INTEGRATION_SRC_DIR."RequestManager.php");
1363 1344 $inputobj = (Object)array(
1364 1345 'action' => $obj,
1365 1346 'multiPlotState' => $multiPlotState
... ... @@ -1369,7 +1350,6 @@ class AmdaAction
1369 1350  
1370 1351 public function getParamPlotInit($obj)
1371 1352 {
1372   - require_once(INTEGRATION_SRC_DIR."RequestManager.php");
1373 1353 // IMPEX param
1374 1354 if (preg_match("#^spase___IMPEX_#",$obj->paramId))
1375 1355 $type = 'impex_plot_init';
... ... @@ -1385,7 +1365,6 @@ class AmdaAction
1385 1365  
1386 1366 public function getParamInfo($obj)
1387 1367 {
1388   - require_once(INTEGRATION_SRC_DIR."RequestManager.php");
1389 1368 // IMPEX param
1390 1369 if (preg_match("#^spase___IMPEX_#",$obj->paramId))
1391 1370 $type = 'impex_param_info';
... ... @@ -1437,8 +1416,6 @@ class AmdaAction
1437 1416  
1438 1417 public function getRequestByProcessId($obj)
1439 1418 {
1440   - require_once(INTEGRATION_SRC_DIR."RequestManager.php");
1441   -
1442 1419 return $this->executeRequest($obj->processId, FunctionTypeEnumClass::PROCESSGETREQUEST);
1443 1420 }
1444 1421 }
... ...
php/classes/TimeTableMgr.php
... ... @@ -114,16 +114,6 @@ class TimeTableMgr extends AmdaObjectMgr
114 114 if ($key == 'created') {
115 115 $rootElement->appendChild($this->objectDom->createElement($key, $this->created));
116 116 }
117   - /*else if ($key == 'intervals') {
118   - $n_int = 0;
119   - foreach ($value as $item) {
120   - $newInterval = $this->objectDom->createElement('intervals');
121   - $newInterval->appendChild($this->objectDom->createElement('start', $item->start));
122   - $newInterval->appendChild($this->objectDom->createElement('stop', $item->stop));
123   - $rootElement->appendChild($newInterval);
124   - $n_int++;
125   - }
126   - }*/
127 117 // it is catalog
128 118 else if ($key == 'parameters') {
129 119 $paramsElement = $this->setParamDescription($value);
... ... @@ -161,26 +151,44 @@ class TimeTableMgr extends AmdaObjectMgr
161 151 $lines = file($tmp_file,FILE_SKIP_EMPTY_LINES);
162 152 $description="Uploaded Time Table".PHP_EOL;
163 153  
164   - foreach ($lines as $line){
165   - if ($line[0] == '#') $description=$description."\n".substr($line,1,-1);
  154 + $recordsNumber = count($lines);
  155 + $descNumber = 0;
  156 +
  157 + foreach ($lines as $line)
  158 + {
  159 + if ($line[0] == '#') {
  160 + $description=$description.PHP_EOL.substr($line,1,-1);
  161 + }
166 162 else {
167   - $date = explode(' ',$line);
  163 + $date = explode(' ', trim(preg_replace('!\s+!', ' ',$line)));
  164 +
168 165 if (!strtotime(trim($date[0]))) {
169   - $description=$description."\n".$line;
  166 + $description=$description.PHP_EOL.$line;
  167 + $descNumber++;
170 168 continue;
171 169 }
172 170 // check if it is ISO format
173   - if (!isset($isIso)) $isIso = preg_match('/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})$/', trim($date[0]));
  171 + if (!isset($isIso))
  172 + $isIso = preg_match('/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})$/', trim($date[0]));
  173 +
174 174 if (!$isIso) {
175   - $tempT = strtotime(trim($date[0]));
176   - $startDate = date('Y-m-d',$tempT)."T".date('H:i:s',$tempT);
177   - $tempT = strtotime(trim($date[1]));
178   - $stopDate = date('Y-m-d',$tempT)."T".date('H:i:s',$tempT);
179   - //TODO convert time into non standard formats
180   - // $startDate = DateTime::createFromFormat($timeFormat, trim($date[0]);
181   - // $start = $startDate->format('Y-m-d')."T".$startDate->format('H:i:s');
182   - // $stopDate = DateTime::createFromFormat($timeFormat, trim($date[1]);
183   - // $stop = $stopDate->format('Y-m-d')."T".$stopDate->format('H:i:s');
  175 + // y-m-d h:m:s for example
  176 + $dateLength = count($date) / 2;
  177 +
  178 + $tempStart = $date[0];
  179 + $tempStop = $date[$dateLength];
  180 +
  181 + if ($dateLength > 1) {
  182 + for ($i = 1; $i < $dateLength; $i++)
  183 + $tempStart.= $date[$i];
  184 +
  185 + for ($i = $dateLength + 1; $i < $dateLength * 2; $i++)
  186 + $tempStop .= $date[$i];
  187 + }
  188 +
  189 + $startDate = date('Y-m-d\TH:i:s',strtotime($tempStart));
  190 + $stopDate = date('Y-m-d\TH:i:s',strtotime($tempStop));
  191 +
184 192 if (!$onlyDescription)
185 193 $attributesToReturn['intervals'][] = array('start' => $startDate, 'stop' => $stopDate);
186 194 }
... ... @@ -190,15 +198,16 @@ class TimeTableMgr extends AmdaObjectMgr
190 198 }
191 199 }
192 200 }
193   -
  201 + if ( $recordsNumber == $descNumber )
  202 + $description = "Looks like we can not read your time format...".PHP_EOL.$description;
  203 +
194 204 $attributesToReturn['description'] = $description;
195 205 $attributesToReturn['name'] = basename($tmp_file, '.'.$suffix[1]);
196   - $attributesToReturn['created'] = date('Y-m-d')."T".date('H:i:s');
  206 + $attributesToReturn['created'] = date('Y-m-d\TH:i:s');
197 207  
198 208 return $attributesToReturn;
199 209 }
200   -
201   -
  210 +
202 211 /*
203 212 * Uploaded vot TT => convert to array
204 213 */
... ...
php/config.php
... ... @@ -2,49 +2,31 @@
2 2 /**
3 3 * @file config.php
4 4 * @version $Id: config.php 2368 2014-05-21 08:46:23Z elena $
5   - *
6 5 */
7 6  
8 7 /*
9   - * ob_start
10   - * This function will turn output buffering on.
11   - * While output buffering is active no output is sent from the script (other than headers),
12   - * instead the output is stored in an internal buffer.
13   - * The contents of this internal buffer may be copied into a string variable using ob_get_contents().
14   - * To output what is stored in the internal buffer, use ob_end_flush().
15   - * Alternatively, ob_end_clean() will silently discard the buffer contents.
16   -*/
17   -// ob_start();
18   -
19   -/*
20 8 * Installation-dependent settings
21 9 */
22 10 require_once 'my_config.php';
23 11  
24   -if (is_file('amda_version.php'))
25   - require_once 'amda_version.php';
  12 +error_reporting(E_ERROR);
26 13  
27   -if (is_file('errors.php'))
28   - require_once 'errors.php';
  14 +if (is_file('amda_version.php')) require_once 'amda_version.php';
  15 +if (is_file('errors.php')) require_once 'errors.php';
29 16  
30   -/*----------------------- SYSTEM config section --------*/
31   -if (!defined('PHP_VERSION_ID'))
32   -{
  17 +// SYSTEM config section
  18 +if (!defined('PHP_VERSION_ID')) {
33 19 $version = explode('.', PHP_VERSION);
34 20 define('PHP_VERSION_ID', ($version[0] * 10000 + $version[1] * 100 + $version[2]));
35 21 }
36   -
37   -if (!defined('MAGIC_FILE'))
38   - define('MAGIC_FILE','/usr/share/misc/magic');
39   -
  22 +if (!defined('MAGIC_FILE')) define('MAGIC_FILE','/usr/share/misc/magic');
40 23 date_default_timezone_set('UTC');
41   -/*-----------------------END SYSTEM config section --------*/
42 24  
43   -/*----------------------- GUESTS LOGIN section --------*/
44   -define("MaxGuests", 10); // Max Guests number
  25 +// GUESTS LOGIN section
  26 +define("MaxGuests", 10); // Max Guests number
45 27 define("GuestSessionDuration", 300); //300 minutes
46   -define("MaxGuestTimeInterval", 10); // days
47   -/*-----------------------END GUESTS LOGIN section --------*/
  28 +define("MaxGuestTimeInterval", 10); // days
  29 +
48 30  
49 31 // user WS size limit
50 32 define('DISK_QUOTA_standard', 1024*1024*200); // 200MB
... ... @@ -53,21 +35,18 @@ define(&#39;MAX_FILE_INDEX_TO_SHOW&#39;, 100);
53 35 // private key used to be considerate as a trust client for some functions of DD web service
54 36 define('DDSERVICE_PRIVATEKEY','!%p856Dc');
55 37  
56   -define('IMPEX_INTERVAL_LIMIT', 86400); // one day for impex request
57 38  
58   -/*----------------------- BATCH JOBS section --------*/
59   -define('JOBTIMEOUT', '1'); // one cycle secs to sleep to allow job be executed
60   -define('PLOT_CYCLES_NUMBER', 500); // cycles number for PNG
61   -define('JOB_CYCLES_NUMBER', 5); // cycles number for all the jobs
  39 +// BATCH JOBS section
  40 +//define('JOBTIMEOUT', '1'); // one cycle secs to sleep to allow job be executed
  41 +//define('PLOT_CYCLES_NUMBER', 500); // cycles number for PNG
  42 +//define('JOB_CYCLES_NUMBER', 5); // cycles number for all the jobs
62 43 //define('TIMEOUT', '100'); //TODO secs wait before job is killed OR 'max_execution_time' - kill automatic?
63 44  
64   -/*-----------------------END BATCH JOBS section --------*/
65   -
66 45 // EPN-TAP services
67 46 define('EPNTAP_APIS','http://voparis-tap.obspm.fr/__system__/tap/run/tap/sync');
68 47 define('EPNTAP_AMDA','http://cdpp-epntap.irap.omp.eu/__system__/tap/run/tap/sync');
69 48  
70   -/*----------------------- PHP run-time settings --------*/
  49 +// PHP run-time settings
71 50 ini_set('memory_limit',128000000);
72 51 ini_set('max_execution_time',600); // max PHP execution
73 52 ini_set('default_socket_timeout', 600); //TODO if this is needed ? IMPEX LONG DURATION WEBSERVICES
... ... @@ -77,7 +56,6 @@ ini_set(&#39;user_agent&#39;, &#39;Mozilla/5.0 (X11; U; Linux i686; en-US; rv:7.0) Gecko/201
77 56 // ini_set('upload_max_filesize',100000000);
78 57 // ini_set('post_max_size',1050000000);
79 58  
80   -/*-----------------------END PHP run-time settings --------*/
81 59  
82 60 // General Info dirs
83 61 define('DATAPATH', IHM_SRC_DIR.'generic_data/');
... ... @@ -97,10 +75,11 @@ define(&#39;specialGrpsXml&#39;,SpecialSettingsDir.&#39;Groups.xml&#39;);
97 75 define('specialSettingsXml',SpecialSettingsDir.'Settings.xml');
98 76  
99 77 //Help info dirs
100   -define('HELPPATH', IHM_SRC_DIR."help/");
  78 +define('HELPPATH', IHM_SRC_DIR."help/");
101 79  
102   -// IMPEX special files
  80 +// IMPEX section
103 81 define('SimuTargetsXml', DATAPATH.'SimuTemplate/TargetsSimu.xml');
  82 +define('IMPEX_INTERVAL_LIMIT', 86400); // one day for impex request
104 83  
105 84 // Root User dir : All user dirs are defined in UserMgr.php
106 85 define('USERPATH', IHM_SRC_DIR.'data/');
... ... @@ -108,18 +87,15 @@ define(&#39;USERPATH&#39;, IHM_SRC_DIR.&#39;data/&#39;);
108 87 // Shared dir
109 88 define('SHAREDPATH', IHM_SRC_DIR.'shared_data/');
110 89  
111   -/*------------------- WEB SERVICES section ---------*/
  90 +// WEB SERVICES section
112 91 define('WSRESULT', USERPATH.'WSRESULT/'); // Web Services result directory
113 92 define('wsResultsXml',WSRESULT.'WSresults.xml'); // Web Service result file
114   -
115 93 define('plotsXml', IHM_SRC_DIR.'public/WebServices/XML/AmdaPlots.xml'); // Web Service getPlot : list of parameters to plot
116 94  
117 95 // Web Service servers WSDL : $_SERVER['SERVER_NAME'] (par apache) gethostname() (par command)
118 96 $SERVER_NAME = $_SERVER['SERVER_NAME'] ? $_SERVER['SERVER_NAME'] : gethostname();
119   -
120 97 define('webAlias',"http://".$SERVER_NAME.APACHE_ALIAS);
121 98 define('wsdl_AMDA', webAlias."public/wsdl/Methods_AMDA.wsdl");
122   -/*-------------------END WEB SERVICES section ---------*/
123 99  
124 100 // AKKA - KERNELBIN is now the new kernel bin dir
125 101 define('KERNELBIN',NEWKERNEL_INSTALL_DIR.'bin/');
... ... @@ -128,21 +104,9 @@ putenv(&quot;LD_LIBRARY_PATH=&quot;.SYS_LIBS.&quot;:&quot;.DDLIB.&quot;:&quot;.CEFLIB.&quot;:&quot;.CDFLIB);
128 104 putenv("PATH=./:".DDBIN.":".SYS_BIN.":".IHM_SRC_DIR."php/bin");
129 105  
130 106 putenv("DDPATH=".DDRES_DIR);
131   -
132   -// PHP classes
133 107 define('XMLPATH', IHM_SRC_DIR.'php/XML/');
134   -define('CLASSPATH', IHM_SRC_DIR.'php/classes/');
135   -define('REMOTE_CLASSPATH', IHM_SRC_DIR.'php/RemoteDataCenter/');
136   -define('OLD_CLASSPATH', IHM_SRC_DIR.'php/old_amda/');
137   -
138   -set_include_path(".:".CLASSPATH.":".REMOTE_CLASSPATH.":".OLD_CLASSPATH);
139 108  
140   -if (!function_exists('__autoload'))
141   -{
142   - function __autoload($class_name) {
143   - require_once $class_name . '.php';
144   - }
145   -}
  109 +require_once(INTEGRATION_BASE_PATH.'src/amdaintegration_autoload.php');
146 110  
147 111 global $API;
148 112 $API = array(
... ...
update_amda/cp2amda
... ... @@ -61,6 +61,7 @@ if [ -d $NEWMETA/ParamInfo ]; then
61 61 mkdir $AMDAINSTALLATION/AMDA_IHM/generic_data/ParamInfo
62 62 fi
63 63 cp $NEWMETA/ParamInfo/info*.xml $AMDAINSTALLATION/AMDA_IHM/generic_data/ParamInfo
  64 + cp $AMDAINTERNALDIR/PARAM_INFO_PREDEFINED/info*.xml $AMDAINSTALLATION/AMDA_IHM/generic_data/ParamInfo
64 65 fi
65 66  
66 67 # copy LocalParams.xml created by makeTree.php to AMDA installation
... ...
update_amda/makeRemote
... ... @@ -35,10 +35,7 @@
35 35 # "DDBASE side" ( CDAWEB-like ) data centers
36 36 #
37 37 php $AMDA_IHM/php/RemoteDataCenter/getRemoteDDBaseProxies.php
38   -
39   - # make THEMIS Remote Params descriptions
40   - php $AMDA_IHM/php/RemoteDataCenter/makeRemoteParamInternal.php
41   -
  38 +
42 39 # copy "DDBASE" Remote Params descriptions
43 40 if [ -d $AMDA_IHM/generic_data/RemoteData/PARAMS ]; then
44 41 cp $AMDA_IHM/generic_data/RemoteData/PARAMS/* $AMDA_IHM/generic_data/newKernelDDBase/
... ...