Commit 28d547b153457463ea2ba8bb5598abafa6710626
Exists in
master
and in
91 other branches
Merge branch 'master' into 6920
Showing
9 changed files
with
318 additions
and
49 deletions
Show diff stats
generic_data/HAPI/conf/capabilities.json deleted
... | ... | @@ -0,0 +1,6 @@ |
1 | +<h3>Reference Parameter</h3> | |
2 | + Original sampling of <i>Reference Parameter</i> is used to resample ( average/interpolate ) | |
3 | + all AMDA parameters used in your expression before calculations. | |
4 | + Drag / drop parameter you wish to use as reference from AMDA parameter tree onto <i>Reference Param.</i> field. | |
5 | +<br/> | |
6 | + | ... | ... |
js/app/models/InteractiveNode.js
... | ... | @@ -204,6 +204,10 @@ Ext.define('amdaModel.InteractiveNode', { |
204 | 204 | this.set('info',res.info); |
205 | 205 | } |
206 | 206 | |
207 | + if (res.last_update) { | |
208 | + this.get('object').set('last_update', res.last_update); | |
209 | + } | |
210 | + | |
207 | 211 | // myDataParam and Parameter special update |
208 | 212 | this.specialUpdate(res, false); |
209 | 213 | |
... | ... | @@ -280,9 +284,29 @@ Ext.define('amdaModel.InteractiveNode', { |
280 | 284 | // set the tooltip |
281 | 285 | this.set('info',res.info); |
282 | 286 | } |
287 | + | |
288 | + var reloadObject = false; | |
289 | + if (res.last_update) { | |
290 | + this.get('object').set('last_update', res.last_update); | |
291 | + reloadObject = true; | |
292 | + } | |
293 | + | |
283 | 294 | //set globalStart & global Stop to be used for time selection |
284 | 295 | this.specialUpdate(res, true); |
285 | 296 | |
297 | + // reload object into the view of corresponding Module | |
298 | + var me = this; | |
299 | + if (reloadObject) { | |
300 | + myDesktopApp.getLoadedModule(this.get('moduleId'), true, function (module) { | |
301 | + if (!opt || !opt.plot) { | |
302 | + module.getUiContent().setObject(me.get('object')); | |
303 | + } | |
304 | + else { | |
305 | + module.getUiContent().reloadPlot(me); | |
306 | + } | |
307 | + }); | |
308 | + } | |
309 | + | |
286 | 310 | //TODO do we need this commission ??? |
287 | 311 | // fix the modifications for object |
288 | 312 | this.get('object').commit(); | ... | ... |
js/app/models/Parameter.js
... | ... | @@ -19,13 +19,16 @@ Ext.define('amdaModel.Parameter', { |
19 | 19 | extend: 'amdaModel.AmdaObject', |
20 | 20 | |
21 | 21 | fields : [ |
22 | - {name: 'timestep', type: 'string'}, | |
22 | + {name: 'timestep', type: 'string'}, // only used if 'sampling_mode' is 'timestep' | |
23 | 23 | {name: 'units', type: 'string'}, |
24 | 24 | {name: 'buildchain', type: 'string'}, |
25 | 25 | {name: 'description', type: 'string'}, |
26 | 26 | {name: 'ytitle', type: 'string'}, |
27 | - {name: 'dim_1', type: 'number'}, | |
28 | - {name: 'dim_2', type: 'number'} | |
27 | + {name: 'dim_1', type: 'number'}, | |
28 | + {name: 'dim_2', type: 'number'}, | |
29 | + {name: 'last_update', type: 'int', defaultValue: 0}, | |
30 | + {name: 'sampling_mode', type: 'string', defaultValue: 'timestep'}, // 'timestep' or 'refparam' | |
31 | + {name: 'reference_param', type: 'string'} // only used if 'sampling_mode' is 'refparam' | |
29 | 32 | ], |
30 | 33 | |
31 | 34 | /** |
... | ... | @@ -54,7 +57,9 @@ Ext.define('amdaModel.Parameter', { |
54 | 57 | myValues.dim_1 = this.get('dim_1'); |
55 | 58 | myValues.dim_2 = this.get('dim_2'); |
56 | 59 | myValues.nodeType = amdaModel.DerivedParamNode.nodeType; |
60 | + myValues.sampling_mode = this.get('sampling_mode'); | |
61 | + myValues.reference_param = this.get('reference_param'); | |
57 | 62 | return myValues; |
58 | 63 | } |
59 | 64 | |
60 | -}); | |
61 | 65 | \ No newline at end of file |
66 | +}); | ... | ... |
js/app/models/Search.js
... | ... | @@ -24,10 +24,13 @@ Ext.define('amdaModel.Search', { |
24 | 24 | {name: 'sampling', type: 'int', defaultValue: '600'}, |
25 | 25 | {name: 'gap', type: 'int', defaultValue: '5'}, |
26 | 26 | {name: 'description', type: 'string'}, |
27 | - {name: 'expression', type: 'string'} | |
27 | + {name: 'expression', type: 'string'}, | |
28 | + {name: 'last_update', type: 'int', defaultValue: 0}, | |
29 | + {name: 'sampling_mode', type: 'string', defaultValue: 'timestep'}, // 'timestep' or 'refparam' | |
30 | + {name: 'reference_param', type: 'string'} // only used if 'sampling_mode' is 'refparam' | |
28 | 31 | ], |
29 | 32 | |
30 | - propertiesToCopy : 'id,name,sampling,gap,description,expression', | |
33 | + propertiesToCopy : 'id,name,sampling,gap,description,expression,last_update,sampling_mode,reference_param', | |
31 | 34 | |
32 | 35 | getJsonValues : function(hasId){ |
33 | 36 | |
... | ... | @@ -38,6 +41,8 @@ Ext.define('amdaModel.Search', { |
38 | 41 | myValues.name = this.get('name'); |
39 | 42 | myValues.sampling = this.get('sampling'); |
40 | 43 | myValues.gap = this.get('gap'); |
44 | + myValues.sampling_mode = this.get('sampling_mode'); | |
45 | + myValues.reference_param = this.get('reference_param'); | |
41 | 46 | myValues.description = this.get('description'); |
42 | 47 | myValues.expression = this.get('expression').replace(/\n/g," ");; |
43 | 48 | myValues.timesrc = this.get('timesrc'); |
... | ... | @@ -73,4 +78,4 @@ Ext.define('amdaModel.Search', { |
73 | 78 | return myValues; |
74 | 79 | } |
75 | 80 | |
76 | -}); | |
77 | 81 | \ No newline at end of file |
82 | +}); | ... | ... |
js/app/views/ParameterUI.js
... | ... | @@ -83,7 +83,7 @@ Ext.define('amdaUI.ParameterUI', |
83 | 83 | setObject : function (object) |
84 | 84 | { |
85 | 85 | this.object = object; |
86 | - // load object into form | |
86 | + // load object into form | |
87 | 87 | this.formPanel.getForm().loadRecord(this.object); |
88 | 88 | }, |
89 | 89 | |
... | ... | @@ -140,7 +140,9 @@ Ext.define('amdaUI.ParameterUI', |
140 | 140 | var obj = { |
141 | 141 | paramId : 'ws_'+this.object.get('name'), |
142 | 142 | buildchain:this.object.get('buildchain'), |
143 | - timestep:this.object.get('timestep') | |
143 | + timestep:this.object.get('timestep'), | |
144 | + reference_param: this.object.get('reference_param'), | |
145 | + sampling_mode: this.object.get('sampling_mode') | |
144 | 146 | }; |
145 | 147 | loadMask.show(); |
146 | 148 | AmdaAction.generateParamInfo(obj, function (result, e) { |
... | ... | @@ -169,12 +171,11 @@ Ext.define('amdaUI.ParameterUI', |
169 | 171 | }); |
170 | 172 | }, |
171 | 173 | |
172 | - | |
173 | 174 | /** |
174 | 175 | * save method called by Save button |
175 | 176 | */ |
176 | 177 | saveProcess : function(toRename) |
177 | - { | |
178 | + { | |
178 | 179 | if(this.object.dirty) |
179 | 180 | { |
180 | 181 | // Parameter Module |
... | ... | @@ -268,6 +269,7 @@ Ext.define('amdaUI.ParameterUI', |
268 | 269 | { |
269 | 270 | this.fieldName = new Ext.form.field.Text({ |
270 | 271 | labelAlign: 'top', itemId: 'formParamName', |
272 | + labelPad: 0, | |
271 | 273 | fieldLabel: 'Parameter Name', |
272 | 274 | name : 'name', |
273 | 275 | allowBlank : false, //blankText : 'Name is required', |
... | ... | @@ -293,11 +295,12 @@ Ext.define('amdaUI.ParameterUI', |
293 | 295 | |
294 | 296 | this.constructionField = new extensions.SelectableTextArea({ |
295 | 297 | labelAlign: 'top', |
298 | + labelPad: 0, | |
296 | 299 | itemId: 'formParamConstructParameter', |
297 | 300 | fieldLabel:'<img amda_clicktip="constructParameter" src="js/resources/images/16x16/info_mini.png"/> Construct Parameter', |
298 | 301 | allowBlank : false, blankText : 'Construct Parameter is required', |
299 | 302 | name : 'buildchain', |
300 | - flex: 0.9, | |
303 | + flex: 0.6, | |
301 | 304 | validateOnChange: false, |
302 | 305 | validateOnBlur: false, |
303 | 306 | validator : this.isBalanced, |
... | ... | @@ -401,6 +404,90 @@ Ext.define('amdaUI.ParameterUI', |
401 | 404 | // } |
402 | 405 | // } |
403 | 406 | }); |
407 | + | |
408 | + var samplingmode_store = new Ext.data.ArrayStore({ | |
409 | + fields: ['id', 'name'], | |
410 | + data: [ | |
411 | + ['timestep', 'Time Step'], | |
412 | + ['refparam', 'Ref. Parameter'] | |
413 | + ] | |
414 | + }); | |
415 | + | |
416 | + this.timeStepField = new Ext.form.NumberField({ | |
417 | + fieldLabel: '<img amda_clicktip="resamplingStep" src="js/resources/images/16x16/info_mini.png"/> Time Step (sec)', | |
418 | + labelAlign: 'top', | |
419 | + labelPad: 0, | |
420 | + blankText : 'Time Step is required', | |
421 | + name : 'timestep', | |
422 | + minValue : 0.001, | |
423 | + decimalPrecision : 10, | |
424 | + hideTrigger: true, | |
425 | + width: 150, | |
426 | + validateOnBlur: false | |
427 | + }); | |
428 | + | |
429 | + this.refParamField = new Ext.form.TextField({ | |
430 | + fieldLabel: '<img amda_clicktip="resamplingRefParam" src="js/resources/images/16x16/info_mini.png"/> Reference Param.', | |
431 | + labelAlign: 'top', | |
432 | + labelPad: 0, | |
433 | + name : 'reference_param', | |
434 | + width: 150, | |
435 | + hidden: true, | |
436 | + listeners: { | |
437 | + afterrender: function(field, eOpts ){ | |
438 | + var paramTarget = new Ext.dd.DropTarget(field.el.dom, | |
439 | + { | |
440 | + ddGroup: 'explorerTree', | |
441 | + notifyEnter: function(ddSource, e, data) { | |
442 | + }, | |
443 | + notifyDrop: function(ddSource, e, data) { | |
444 | + var selectedRecord = ddSource.dragData.records[0]; | |
445 | + switch (selectedRecord.$className) { | |
446 | + case 'amdaModel.LocalParamNode' : | |
447 | + case 'amdaModel.RemoteParamNode' : | |
448 | + case 'amdaModel.RemoteSimuParamNode' : | |
449 | + if (!selectedRecord.get('isParameter') || selectedRecord.get('disable')) | |
450 | + return false; | |
451 | + if (selectedRecord.get('alias') != "" ) | |
452 | + field.setValue("#"+selectedRecord.get('alias')); | |
453 | + else | |
454 | + field.setValue(selectedRecord.get('id')); | |
455 | + return true; | |
456 | + case 'amdaModel.AliasNode' : | |
457 | + if (!selectedRecord.isLeaf()) | |
458 | + return false; | |
459 | + field.setValue("#"+selectedRecord.get('text')); | |
460 | + return true; | |
461 | + case 'amdaModel.DerivedParamNode' : | |
462 | + if (!selectedRecord.isLeaf()) | |
463 | + return false; | |
464 | + field.setValue("ws_"+selectedRecord.get('text')); | |
465 | + return true; | |
466 | + case 'amdaModel.MyDataParamNode' : | |
467 | + if (!selectedRecord.isLeaf()) | |
468 | + return false; | |
469 | + field.setValue("wsd_"+selectedRecord.get('text')); | |
470 | + return true; | |
471 | + default: | |
472 | + return false; | |
473 | + } | |
474 | + return true; | |
475 | + } | |
476 | + } | |
477 | + ); | |
478 | + }, | |
479 | + scope: this | |
480 | + } | |
481 | + }); | |
482 | + | |
483 | + this.samplingDefContainer = new Ext.container.Container({ | |
484 | + border: false, | |
485 | + items: [ | |
486 | + this.timeStepField, | |
487 | + this.refParamField | |
488 | + ], | |
489 | + width: 150 | |
490 | + }); | |
404 | 491 | |
405 | 492 | this.formPanel = new Ext.form.Panel({ |
406 | 493 | id: 'vbox-paramForm', |
... | ... | @@ -411,7 +498,7 @@ Ext.define('amdaUI.ParameterUI', |
411 | 498 | trackResetOnLoad: true, //reset to the last loaded record |
412 | 499 | layout: { |
413 | 500 | type: 'vbox', |
414 | - defaultMargins: {top: 10, left:10, bottom:5, right:5}, | |
501 | + defaultMargins: {top: 5, left:5, bottom:10, right:10}, | |
415 | 502 | align: 'stretch' |
416 | 503 | }, |
417 | 504 | defaults: { |
... | ... | @@ -428,7 +515,8 @@ Ext.define('amdaUI.ParameterUI', |
428 | 515 | }, |
429 | 516 | defaultType: 'textfield', |
430 | 517 | defaults: { |
431 | - labelAlign: 'top' | |
518 | + labelAlign: 'top', | |
519 | + labelPad: 0 | |
432 | 520 | }, |
433 | 521 | items: [ |
434 | 522 | this.fieldName, |
... | ... | @@ -436,17 +524,40 @@ Ext.define('amdaUI.ParameterUI', |
436 | 524 | xtype:'component', width: 20 |
437 | 525 | }, |
438 | 526 | { |
439 | - xtype : 'numberfield', | |
440 | - itemId: 'formParamTimeStep', fieldLabel: '<img amda_clicktip="resamplingStep" src="js/resources/images/16x16/info_mini.png"/> Time Step (sec)', labelAlign: 'top', | |
441 | - allowBlank : false, blankText : 'Time Step is required', | |
442 | - name : 'timestep', | |
443 | - minValue : 0.001, | |
444 | - decimalPrecision : 10, | |
445 | - hideTrigger: true, | |
527 | + fieldLabel: 'Last modification', | |
528 | + xtype: 'displayfield', | |
529 | + name : 'last_update', | |
446 | 530 | width: 150, |
447 | - //validateOnChange: false, | |
448 | - validateOnBlur: false | |
531 | + renderer: function(value, field) { | |
532 | + var tpl = new Ext.XTemplate('<p style="font-style:italic;color:gray;margin:0;">{date}</>'); | |
533 | + var mod_date = 'Not saved'; | |
534 | + if (value > 0) | |
535 | + mod_date = Ext.Date.format(new Date(value*1000), "Y-m-d\\TH:i:s"); | |
536 | + return tpl.apply({date: mod_date}); | |
537 | + }, | |
449 | 538 | }, |
539 | + { | |
540 | + xtype: 'combo', | |
541 | + fieldLabel: 'Sampling mode', | |
542 | + name: 'sampling_mode', | |
543 | + queryMode: 'local', | |
544 | + editable: false, | |
545 | + valueField: 'id', | |
546 | + displayField: 'name', | |
547 | + store: samplingmode_store, | |
548 | + value: samplingmode_store.first(), | |
549 | + listeners: { | |
550 | + change: function(field, value) { | |
551 | + this.timeStepField.setVisible(value != 'refparam'); | |
552 | + this.refParamField.setVisible(value == 'refparam'); | |
553 | + }, | |
554 | + scope: this | |
555 | + } | |
556 | + }, | |
557 | + { | |
558 | + xtype:'component', width: 20 | |
559 | + }, | |
560 | + this.samplingDefContainer, | |
450 | 561 | { |
451 | 562 | itemId: 'formParamUnit', |
452 | 563 | fieldLabel: 'Units', | ... | ... |
js/app/views/SearchUI.js
... | ... | @@ -298,9 +298,9 @@ Ext.define('amdaUI.SearchUI', |
298 | 298 | this.fieldName = new Ext.form.field.Text({ |
299 | 299 | labelAlign: 'top', itemId: 'formParamName', |
300 | 300 | fieldLabel: 'Request Name', |
301 | + labelPad: 0, | |
301 | 302 | name : 'name', |
302 | - width: 375, | |
303 | - colspan: 3, | |
303 | + width: 165, | |
304 | 304 | allowBlank : false, |
305 | 305 | stripCharsRe: /(^\s+|\s+$)/g, |
306 | 306 | validateOnChange: false, |
... | ... | @@ -315,6 +315,7 @@ Ext.define('amdaUI.SearchUI', |
315 | 315 | this.constructionField = new extensions.SelectableTextArea( |
316 | 316 | { |
317 | 317 | labelAlign: 'top', |
318 | + labelPad: 0, | |
318 | 319 | itemId: 'formSearchCondition', |
319 | 320 | fieldLabel:'<img amda_clicktip="constructParameter" src="js/resources/images/16x16/info_mini.png"/> Data Mining Condition', |
320 | 321 | allowBlank : false, blankText : 'Condition expression is required', |
... | ... | @@ -322,7 +323,7 @@ Ext.define('amdaUI.SearchUI', |
322 | 323 | validateOnChange: false, |
323 | 324 | validateOnBlur: false, |
324 | 325 | validator : this.isBalanced, |
325 | - flex : 2.5, | |
326 | + flex : 2, | |
326 | 327 | listeners : |
327 | 328 | { |
328 | 329 | render : function(o,op) |
... | ... | @@ -421,6 +422,90 @@ Ext.define('amdaUI.SearchUI', |
421 | 422 | } |
422 | 423 | }); |
423 | 424 | |
425 | + var samplingmode_store = new Ext.data.ArrayStore({ | |
426 | + fields: ['id', 'name'], | |
427 | + data: [ | |
428 | + ['timestep', 'Time Step'], | |
429 | + ['refparam', 'Ref. Parameter'] | |
430 | + ] | |
431 | + }); | |
432 | + | |
433 | + this.timeStepField = new Ext.form.NumberField({ | |
434 | + fieldLabel: '<img amda_clicktip="resamplingStep" src="js/resources/images/16x16/info_mini.png"/> Time Step (sec)', | |
435 | + labelAlign: 'top', | |
436 | + labelPad: 0, | |
437 | + blankText : 'Time Step is required', | |
438 | + name : 'sampling', | |
439 | + minValue : 0.001, | |
440 | + decimalPrecision : 10, | |
441 | + hideTrigger: true, | |
442 | + width: 165, | |
443 | + validateOnBlur: false | |
444 | + }); | |
445 | + | |
446 | + this.refParamField = new Ext.form.TextField({ | |
447 | + fieldLabel: '<img amda_clicktip="resamplingRefParam" src="js/resources/images/16x16/info_mini.png"/> Reference Param.', | |
448 | + labelAlign: 'top', | |
449 | + labelPad: 0, | |
450 | + name : 'reference_param', | |
451 | + width: 165, | |
452 | + hidden: true, | |
453 | + listeners: { | |
454 | + afterrender: function(field, eOpts ){ | |
455 | + var paramTarget = new Ext.dd.DropTarget(field.el.dom, | |
456 | + { | |
457 | + ddGroup: 'explorerTree', | |
458 | + notifyEnter: function(ddSource, e, data) { | |
459 | + }, | |
460 | + notifyDrop: function(ddSource, e, data) { | |
461 | + var selectedRecord = ddSource.dragData.records[0]; | |
462 | + switch (selectedRecord.$className) { | |
463 | + case 'amdaModel.LocalParamNode' : | |
464 | + case 'amdaModel.RemoteParamNode' : | |
465 | + case 'amdaModel.RemoteSimuParamNode' : | |
466 | + if (!selectedRecord.get('isParameter') || selectedRecord.get('disable')) | |
467 | + return false; | |
468 | + if (selectedRecord.get('alias') != "" ) | |
469 | + field.setValue("#"+selectedRecord.get('alias')); | |
470 | + else | |
471 | + field.setValue(selectedRecord.get('id')); | |
472 | + return true; | |
473 | + case 'amdaModel.AliasNode' : | |
474 | + if (!selectedRecord.isLeaf()) | |
475 | + return false; | |
476 | + field.setValue("#"+selectedRecord.get('text')); | |
477 | + return true; | |
478 | + case 'amdaModel.DerivedParamNode' : | |
479 | + if (!selectedRecord.isLeaf()) | |
480 | + return false; | |
481 | + field.setValue("ws_"+selectedRecord.get('text')); | |
482 | + return true; | |
483 | + case 'amdaModel.MyDataParamNode' : | |
484 | + if (!selectedRecord.isLeaf()) | |
485 | + return false; | |
486 | + field.setValue("wsd_"+selectedRecord.get('text')); | |
487 | + return true; | |
488 | + default: | |
489 | + return false; | |
490 | + } | |
491 | + return true; | |
492 | + } | |
493 | + } | |
494 | + ); | |
495 | + }, | |
496 | + scope: this | |
497 | + } | |
498 | + }); | |
499 | + | |
500 | + this.samplingDefContainer = new Ext.container.Container({ | |
501 | + border: false, | |
502 | + items: [ | |
503 | + this.timeStepField, | |
504 | + this.refParamField | |
505 | + ], | |
506 | + width: 165 | |
507 | + }); | |
508 | + | |
424 | 509 | this.formPanel = new Ext.form.Panel( |
425 | 510 | { |
426 | 511 | region : 'center', |
... | ... | @@ -430,7 +515,7 @@ Ext.define('amdaUI.SearchUI', |
430 | 515 | layout : { |
431 | 516 | type : 'vbox', |
432 | 517 | align: 'stretch', |
433 | - defaultMargins : { top:15, bottom:0, left: 15, right:15} | |
518 | + defaultMargins: {top: 5, left:5, bottom:10, right:10} | |
434 | 519 | }, |
435 | 520 | id: 'formSearch', |
436 | 521 | defaults: { |
... | ... | @@ -455,29 +540,57 @@ Ext.define('amdaUI.SearchUI', |
455 | 540 | }, |
456 | 541 | defaultType: 'textfield', |
457 | 542 | defaults: { |
458 | - labelAlign: 'top' | |
543 | + labelAlign: 'top', | |
544 | + labelPad: 0 | |
459 | 545 | }, |
460 | 546 | items: [ |
461 | 547 | this.fieldName, |
548 | + { xtype: 'component', width: 45}, | |
462 | 549 | { |
463 | - xtype :'displayfield', width: 165, | |
464 | - hideLabel: true, | |
465 | - value: '<b>Averaging/Interpolation</b> <img amda_clicktip="resamplingStep" src="js/resources/images/16x16/info_mini.png"/>' | |
550 | + fieldLabel: 'Last modification', | |
551 | + xtype: 'displayfield', | |
552 | + name : 'last_update', | |
553 | + width: 165, | |
554 | + renderer: function(value, field) { | |
555 | + var tpl = new Ext.XTemplate('<p style="font-style:italic;color:gray;margin:0;">{date}</>'); | |
556 | + var mod_date = 'Not saved'; | |
557 | + if (value > 0) | |
558 | + mod_date = Ext.Date.format(new Date(value*1000), "Y-m-d\\TH:i:s"); | |
559 | + return tpl.apply({date: mod_date}); | |
560 | + }, | |
561 | + }, | |
562 | + { | |
563 | + xtype: 'combo', | |
564 | + fieldLabel: 'Sampling mode', | |
565 | + name: 'sampling_mode', | |
566 | + queryMode: 'local', | |
567 | + editable: false, | |
568 | + valueField: 'id', | |
569 | + displayField: 'name', | |
570 | + store: samplingmode_store, | |
571 | + value: samplingmode_store.first(), | |
572 | + width: 165, | |
573 | + listeners: { | |
574 | + change: function(field, value) { | |
575 | + this.timeStepField.setVisible(value != 'refparam'); | |
576 | + this.refParamField.setVisible(value == 'refparam'); | |
577 | + }, | |
578 | + scope: this | |
579 | + } | |
580 | + }, | |
581 | + { | |
582 | + xtype:'component', width: 45 | |
466 | 583 | }, |
467 | - { xtype: 'component', width: 45 }, | |
584 | + this.samplingDefContainer, | |
468 | 585 | { |
469 | 586 | xtype :'displayfield', width: 165, |
470 | - hideLabel: true, | |
471 | - value: '<b>Data Gap</b> <img amda_clicktip="dataGap" src="js/resources/images/16x16/info_mini.png"/>' | |
587 | + hideLabel: true, | |
588 | + fieldStyle: 'display:inline-block;text-align:right', | |
589 | + value: '<b style="top: 50%;position: relative;">Data Gap <img amda_clicktip="dataGap" src="js/resources/images/16x16/info_mini.png"/></b>' | |
472 | 590 | }, |
473 | 591 | { |
474 | - xtype: 'numberfield', name: 'sampling', | |
475 | - allowBlank : false, blankText : 'Time Step is required', | |
476 | - fieldLabel: 'Time Step (sec)', minValue : 0.001, | |
477 | - labelAlign: 'top', hideTrigger: true, width: 165, | |
478 | - validateOnBlur: false | |
592 | + xtype:'component', width: 45 | |
479 | 593 | }, |
480 | - { xtype: 'component', width: 45 }, | |
481 | 594 | { |
482 | 595 | xtype: 'numberfield', name: 'gap', |
483 | 596 | fieldLabel: 'if no data for interval', minValue : 1, | ... | ... |
php/classes/DerivedParamMgr.php
... | ... | @@ -138,12 +138,13 @@ class DerivedParamMgr extends AmdaObjectMgr |
138 | 138 | { |
139 | 139 | if (file_exists(USERWSDIR.'Alias.xml')) { |
140 | 140 | $p->buildchain = $this->resetAlias($p->buildchain); |
141 | - } | |
141 | + } | |
142 | + $p->last_update = time(); | |
142 | 143 | // switch between myData and Derived |
143 | 144 | $this->createObjectDescription($p); |
144 | 145 | $this->addToContent($p, $folder); |
145 | 146 | |
146 | - return array('id' => $this->id, 'info' => $p->buildchain, 'dim_1' => $p->dim_1, 'dim_2' => $p->dim_2); | |
147 | + return array('id' => $this->id, 'info' => $p->buildchain, 'dim_1' => $p->dim_1, 'dim_2' => $p->dim_2, 'last_update' => $p->last_update); | |
147 | 148 | } |
148 | 149 | // myData parameter |
149 | 150 | else |
... | ... | @@ -317,7 +318,7 @@ class DerivedParamMgr extends AmdaObjectMgr |
317 | 318 | public function getObject($id) |
318 | 319 | { |
319 | 320 | if (!file_exists(USERWSDIR.$id.'.xml')) return array('error' => NO_OBJECT_FILE); |
320 | - | |
321 | + | |
321 | 322 | $this->objectDom -> load(USERWSDIR.$id.'.xml'); |
322 | 323 | if (!($objToGet = $this->objectDom->getElementById($id))) return array('error' => NO_SUCH_ID); |
323 | 324 | |
... | ... | @@ -343,7 +344,11 @@ class DerivedParamMgr extends AmdaObjectMgr |
343 | 344 | } |
344 | 345 | else $attributesToReturn[$attribute->tagName] = $attribute->nodeValue; |
345 | 346 | } |
346 | - | |
347 | + | |
348 | + if (empty($attributesToReturn['last_update'])) { | |
349 | + $attributesToReturn['last_update'] = filemtime(USERWSDIR.$id.'.xml'); | |
350 | + } | |
351 | + | |
347 | 352 | return $attributesToReturn; |
348 | 353 | } |
349 | 354 | ... | ... |
php/classes/RequestMgr.php
... | ... | @@ -132,7 +132,9 @@ class RequestMgr extends AmdaObjectMgr |
132 | 132 | } |
133 | 133 | } |
134 | 134 | //if Start Time - Stop Time |
135 | - if (!$obj->timeTables) $obj = $this->convertTime($obj); | |
135 | + if (!$obj->timeTables) $obj = $this->convertTime($obj); | |
136 | + if (empty($obj->last_update)) | |
137 | + $obj->last_update = filemtime(USERREQDIR.$id); | |
136 | 138 | |
137 | 139 | return $obj; |
138 | 140 | } |
... | ... | @@ -192,6 +194,7 @@ class RequestMgr extends AmdaObjectMgr |
192 | 194 | |
193 | 195 | $this->descFileName = USERREQDIR.$this->id; |
194 | 196 | $p->id = $this->id; |
197 | + $p->last_update = time(); | |
195 | 198 | // save request as json |
196 | 199 | $file = fopen($this->descFileName, 'w'); |
197 | 200 | fwrite($file, json_encode($p)); |
... | ... | @@ -199,7 +202,7 @@ class RequestMgr extends AmdaObjectMgr |
199 | 202 | |
200 | 203 | $this -> addToContent($p, $folder); |
201 | 204 | |
202 | - return array('id' => $this->id, 'info' => $info) + $additional; | |
205 | + return array('id' => $this->id, 'info' => $info, 'last_update' => $p->last_update) + $additional; | |
203 | 206 | } |
204 | 207 | |
205 | 208 | public static function checkRequest($obj) | ... | ... |