Commit fe22687638b99769ff71efb5e4bfb60919449f50

Authored by Benjamin Renard
2 parents 05a6a826 7348b580

Merge branch master into install-rework

help/ttTimeFormat
1 <h3>ASCII Time Table Time Format</h3> 1 <h3>ASCII Time Table Time Format</h3>
2 -<i>Year Month Day Hour Minute Second</i> => with different separators ("-", ":", "/", " "). 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. 3 <br/><i>Milliseconds</i> are not taken in to account.
4 <br/><br/> 4 <br/><br/>
5 Examples: 5 Examples:
js/app/controllers/JobsMgr.js
@@ -187,6 +187,7 @@ Ext.define(&#39;amdaDesktop.JobsMgr&#39;, { @@ -187,6 +187,7 @@ Ext.define(&#39;amdaDesktop.JobsMgr&#39;, {
187 // AKKA - use processid to find job 187 // AKKA - use processid to find job
188 nodeToMove = jobRootNode.findChild('id', job.id, false) 188 nodeToMove = jobRootNode.findChild('id', job.id, false)
189 nodeToMove.set('status', job.status) 189 nodeToMove.set('status', job.status)
  190 + nodeToMove.set('info', job.info)
190 191
191 // TODO check if really job.status 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,14 +43,12 @@ Ext.define(&#39;amdaDesktop.StatisticsModule&#39;, {
43 43
44 saveState: function() { 44 saveState: function() {
45 var uiContent = this.getUiContent(); 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 Ext.state.Manager.set('timeinterval', {'startDate' : values.startDate,'stopDate' : values.stopDate }); 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 return Ext.state.Manager.get('timeinterval'); 52 return Ext.state.Manager.get('timeinterval');
55 } 53 }
56 54
js/app/models/Stats.js
@@ -22,8 +22,8 @@ Ext.define(&#39;amdaModel.Stats&#39;, { @@ -22,8 +22,8 @@ Ext.define(&#39;amdaModel.Stats&#39;, {
22 values.id = this.get('id'); 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 // if (this.get('description').match(/[a-z,0-9]/gi) != null) { 28 // if (this.get('description').match(/[a-z,0-9]/gi) != null) {
29 // values.description = this.get('description'); 29 // values.description = this.get('description');
js/app/views/PlotComponents/PlotBaseSerieForm.js
@@ -90,7 +90,7 @@ Ext.define(&#39;amdaPlotComp.PlotBaseSerieForm&#39;, { @@ -90,7 +90,7 @@ Ext.define(&#39;amdaPlotComp.PlotBaseSerieForm&#39;, {
90 me.object.set('serie-yaxis', value); 90 me.object.set('serie-yaxis', value);
91 me.crtTree.refresh(); 91 me.crtTree.refresh();
92 }), 92 }),
93 - this.addStandardFieldSet('Y Values range', '', this.getValuesRangeItems()), 93 + this.addStandardFieldSet('Min/Max thresholds', '', this.getValuesRangeItems()),
94 this.addStandardParamDropTarget('serie-colored-param', 'Colored Parameter'), 94 this.addStandardParamDropTarget('serie-colored-param', 'Colored Parameter'),
95 this.addStandardFieldSet('Lines', 'serie-lines-activated', this.addStandardLineItems('serie-lines')), 95 this.addStandardFieldSet('Lines', 'serie-lines-activated', this.addStandardLineItems('serie-lines')),
96 this.addStandardFieldSet('Symbols', 'serie-symbols-activated', this.addStandardSymbolsItems('serie-symbols')), 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,7 +30,7 @@ Ext.define(&#39;amdaPlotComp.PlotSpectroForm&#39;, {
30 me.object.set('spectro-yaxis', value); 30 me.object.set('spectro-yaxis', value);
31 me.crtTree.refresh(); 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 \ No newline at end of file 37 \ No newline at end of file
js/app/views/StatisticsUI.js
@@ -38,8 +38,7 @@ Ext.define(&#39;amdaUI.StatisticsUI&#39;, @@ -38,8 +38,7 @@ Ext.define(&#39;amdaUI.StatisticsUI&#39;,
38 loadObject : function() 38 loadObject : function()
39 { 39 {
40 // load object into form 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 basicForm.loadRecord(this.object); 42 basicForm.loadRecord(this.object);
44 43
45 }, 44 },
@@ -101,7 +100,21 @@ Ext.define(&#39;amdaUI.StatisticsUI&#39;, @@ -101,7 +100,21 @@ Ext.define(&#39;amdaUI.StatisticsUI&#39;,
101 { 100 {
102 this.timeSelector.addTT(TTname, TTid); ; 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 generateCatalog : function() 118 generateCatalog : function()
106 { 119 {
107 var module = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.statistics.id); 120 var module = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.statistics.id);
@@ -119,7 +132,7 @@ Ext.define(&#39;amdaUI.StatisticsUI&#39;, @@ -119,7 +132,7 @@ Ext.define(&#39;amdaUI.StatisticsUI&#39;,
119 var updateStatus = true; 132 var updateStatus = true;
120 133
121 var formValues = basicForm.getValues(); 134 var formValues = basicForm.getValues();
122 - //this.object.set('name',formValues.name); 135 + this.object.set('name',this.fieldName.getValue());
123 this.object.set('description',formValues.description); 136 this.object.set('description',formValues.description);
124 137
125 var recs = this.paramGrid.getStore().getNewRecords(); 138 var recs = this.paramGrid.getStore().getNewRecords();
@@ -207,7 +220,7 @@ Ext.define(&#39;amdaUI.StatisticsUI&#39;, @@ -207,7 +220,7 @@ Ext.define(&#39;amdaUI.StatisticsUI&#39;,
207 fields: [ 'name', 'hidden_id'] 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 var store = Ext.create('Ext.data.Store', 225 var store = Ext.create('Ext.data.Store',
213 { 226 {
@@ -218,8 +231,8 @@ Ext.define(&#39;amdaUI.StatisticsUI&#39;, @@ -218,8 +231,8 @@ Ext.define(&#39;amdaUI.StatisticsUI&#39;,
218 { 231 {
219 title: 'Select Parameter & Apply Function', 232 title: 'Select Parameter & Apply Function',
220 selType : 'rowmodel', 233 selType : 'rowmodel',
221 - // flex: 2,  
222 - height :250, 234 + flex: 2,
  235 + // height :250,
223 store : store, 236 store : store,
224 columns: [ 237 columns: [
225 { xtype: 'rownumberer' }, 238 { xtype: 'rownumberer' },
@@ -362,36 +375,20 @@ Ext.define(&#39;amdaUI.StatisticsUI&#39;, @@ -362,36 +375,20 @@ Ext.define(&#39;amdaUI.StatisticsUI&#39;,
362 this.formPanel = Ext.create('Ext.form.Panel', 375 this.formPanel = Ext.create('Ext.form.Panel',
363 { 376 {
364 region: 'center', 377 region: 'center',
365 - layout: 'hbox', 378 + layout: {
  379 + type: 'hbox',
  380 + pack: 'start',
  381 + align: 'stretch'
  382 + },
366 //bodyStyle: {background : '#dfe8f6'}, 383 //bodyStyle: {background : '#dfe8f6'},
367 defaults: { bodyStyle: {background : '#dfe8f6'}, padding : '3'}, 384 defaults: { bodyStyle: {background : '#dfe8f6'}, padding : '3'},
368 fieldDefaults: { labelWidth: 80, labelAlign : 'top' }, 385 fieldDefaults: { labelWidth: 80, labelAlign : 'top' },
369 - items: [  
370 - { 386 + items: [ {
371 xtype: 'form', 387 xtype: 'form',
372 flex : 1, 388 flex : 1,
373 layout: {type: 'vbox', pack: 'start', align: 'stretch'}, 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 type: 'button', 392 type: 'button',
396 text: 'Generate Catalog', 393 text: 'Generate Catalog',
397 scope : this, 394 scope : this,
@@ -399,8 +396,7 @@ Ext.define(&#39;amdaUI.StatisticsUI&#39;, @@ -399,8 +396,7 @@ Ext.define(&#39;amdaUI.StatisticsUI&#39;,
399 { 396 {
400 // update object with user's values 397 // update object with user's values
401 // if the return is true (object had been updated) 398 // if the return is true (object had been updated)
402 - if(this.updateObject()){  
403 - this.updateObject(); 399 + if (this.updateObject()){
404 this.generateCatalog(); 400 this.generateCatalog();
405 } 401 }
406 } 402 }
@@ -409,9 +405,31 @@ Ext.define(&#39;amdaUI.StatisticsUI&#39;, @@ -409,9 +405,31 @@ Ext.define(&#39;amdaUI.StatisticsUI&#39;,
409 type: 'button', 405 type: 'button',
410 text: 'Reset', 406 text: 'Reset',
411 scope : this, 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 var myConf = { 435 var myConf = {
php/classes/AmdaAction.php
@@ -58,7 +58,6 @@ class AmdaAction @@ -58,7 +58,6 @@ class AmdaAction
58 * $obj = { id: node.id, nodeType: node.nodeType } 58 * $obj = { id: node.id, nodeType: node.nodeType }
59 */ 59 */
60 public function getTree($obj) { 60 public function getTree($obj) {
61 -  
62 $node = $obj->node; 61 $node = $obj->node;
63 62
64 $nodeType = $obj->nodeType; 63 $nodeType = $obj->nodeType;
@@ -102,6 +101,7 @@ class AmdaAction @@ -102,6 +101,7 @@ class AmdaAction
102 $xmlName = SHAREDPATH.'/SharedObjectTree.xml'; 101 $xmlName = SHAREDPATH.'/SharedObjectTree.xml';
103 break; 102 break;
104 case 'bkgWorks': 103 case 'bkgWorks':
  104 + // data/<user>/JOBS/jobs.xml
105 $xmlName = USERJOBDIR.$this->xmlFiles[$nodeType]; 105 $xmlName = USERJOBDIR.$this->xmlFiles[$nodeType];
106 break; 106 break;
107 case 'source': 107 case 'source':
@@ -144,8 +144,6 @@ class AmdaAction @@ -144,8 +144,6 @@ class AmdaAction
144 $id = $child->getAttribute('xml:id'); 144 $id = $child->getAttribute('xml:id');
145 $name = $child->getAttribute('name'); 145 $name = $child->getAttribute('name');
146 $help = $child->getAttribute('att'); 146 $help = $child->getAttribute('att');
147 - if ($child->hasAttribute('dataStart')) $dataStart = $child->getAttribute('dataStart');  
148 - if ($child->hasAttribute('dataStop')) $dataStop = $child->getAttribute('dataStop');  
149 147
150 $specialNode = false; 148 $specialNode = false;
151 $isParameter = false; 149 $isParameter = false;
@@ -158,12 +156,17 @@ class AmdaAction @@ -158,12 +156,17 @@ class AmdaAction
158 { 156 {
159 case 'bkgWorks': 157 case 'bkgWorks':
160 $specialNode = true; 158 $specialNode = true;
161 - $status = $child->getAttribute('status');  
162 - // if ($status == 'done') continue;  
163 - $childrenToReturn[] = array('text' => $name, 'id' => $id,'nodeType' => $nodeType, 'leaf' => $isLeaf,  
164 - 'pid' => $child->getAttribute('pid'), 'status' => $status,  
165 - 'jobType' => $child->getAttribute('jobType'), 'info' => $child->getAttribute('info'));  
166 - 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;
167 170
168 case 'condition': 171 case 'condition':
169 $objectMgr = new RequestMgr(); 172 $objectMgr = new RequestMgr();
@@ -175,9 +178,8 @@ class AmdaAction @@ -175,9 +178,8 @@ class AmdaAction
175 $objplot = $objectMgr->getObject($id); 178 $objplot = $objectMgr->getObject($id);
176 for ($i=0; $i < count($objplot->children); $i++) 179 for ($i=0; $i < count($objplot->children); $i++)
177 { 180 {
178 - for ($j=0; $j < count($objplot->children[$i]->children); $j++)  
179 - {  
180 - $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;
181 } 183 }
182 } 184 }
183 break; 185 break;
@@ -846,7 +848,7 @@ class AmdaAction @@ -846,7 +848,7 @@ class AmdaAction
846 */ 848 */
847 public function getJobs() 849 public function getJobs()
848 { 850 {
849 - $obj = (object) array(); 851 + $obj = (object) array();
850 return $this->executeRequest($obj, FunctionTypeEnumClass::PROCESSRUNNINGINFO); 852 return $this->executeRequest($obj, FunctionTypeEnumClass::PROCESSRUNNINGINFO);
851 } 853 }
852 854
@@ -910,7 +912,6 @@ class AmdaAction @@ -910,7 +912,6 @@ class AmdaAction
910 } catch (Exception $e) { 912 } catch (Exception $e) {
911 return array('success' => false, 'message' => 'Exception detected : '.$e->getMessage()); 913 return array('success' => false, 'message' => 'Exception detected : '.$e->getMessage());
912 } 914 }
913 -  
914 return $res; 915 return $res;
915 } 916 }
916 917
php/classes/TimeTableMgr.php
@@ -151,6 +151,9 @@ class TimeTableMgr extends AmdaObjectMgr @@ -151,6 +151,9 @@ class TimeTableMgr extends AmdaObjectMgr
151 $lines = file($tmp_file,FILE_SKIP_EMPTY_LINES); 151 $lines = file($tmp_file,FILE_SKIP_EMPTY_LINES);
152 $description="Uploaded Time Table".PHP_EOL; 152 $description="Uploaded Time Table".PHP_EOL;
153 153
  154 + $recordsNumber = count($lines);
  155 + $descNumber = 0;
  156 +
154 foreach ($lines as $line) 157 foreach ($lines as $line)
155 { 158 {
156 if ($line[0] == '#') { 159 if ($line[0] == '#') {
@@ -161,6 +164,7 @@ class TimeTableMgr extends AmdaObjectMgr @@ -161,6 +164,7 @@ class TimeTableMgr extends AmdaObjectMgr
161 164
162 if (!strtotime(trim($date[0]))) { 165 if (!strtotime(trim($date[0]))) {
163 $description=$description.PHP_EOL.$line; 166 $description=$description.PHP_EOL.$line;
  167 + $descNumber++;
164 continue; 168 continue;
165 } 169 }
166 // check if it is ISO format 170 // check if it is ISO format
@@ -194,7 +198,9 @@ class TimeTableMgr extends AmdaObjectMgr @@ -194,7 +198,9 @@ class TimeTableMgr extends AmdaObjectMgr
194 } 198 }
195 } 199 }
196 } 200 }
197 - 201 + if ( $recordsNumber == $descNumber )
  202 + $description = "Looks like we can not read your time format...".PHP_EOL.$description;
  203 +
198 $attributesToReturn['description'] = $description; 204 $attributesToReturn['description'] = $description;
199 $attributesToReturn['name'] = basename($tmp_file, '.'.$suffix[1]); 205 $attributesToReturn['name'] = basename($tmp_file, '.'.$suffix[1]);
200 $attributesToReturn['created'] = date('Y-m-d\TH:i:s'); 206 $attributesToReturn['created'] = date('Y-m-d\TH:i:s');
update_amda/cp2amda
@@ -65,6 +65,7 @@ if [ -d &quot;$NEWMETA/ParamInfo&quot; ]; then @@ -65,6 +65,7 @@ if [ -d &quot;$NEWMETA/ParamInfo&quot; ]; then
65 mkdir $PARAMS_LOCALINFO_DIR 65 mkdir $PARAMS_LOCALINFO_DIR
66 fi 66 fi
67 cp $NEWMETA/ParamInfo/info*.xml $PARAMS_LOCALINFO_DIR 67 cp $NEWMETA/ParamInfo/info*.xml $PARAMS_LOCALINFO_DIR
  68 + cp $AMDAINTERNALDIR/PARAM_INFO_PREDEFINED/info*.xml $PARAMS_LOCALINFO_DIR
68 fi 69 fi
69 70
70 # copy LocalParams.xml created by makeTree.php to AMDA installation 71 # copy LocalParams.xml created by makeTree.php to AMDA installation