Commit 3d7c42ed54a0afa5fffa2f81b6c3f15420c821a7

Authored by Elena.Budnik
1 parent 19955040

disable fields predefined, add attributes

Showing 2 changed files with 30 additions and 23 deletions   Show diff stats
js/app/views/MyDataUI.js
... ... @@ -117,11 +117,11 @@ Ext.define('amdaUI.MyDataUI', {
117 117 // edit in module from FileUpload Module and ExplorerModule (edit param)
118 118 if (this.module.linkedNode) {
119 119 if (this.module.linkedNode.get('fileObject')) {
120   - this.fileObject = this.module.linkedNode.get('fileObject');
  120 + this.fileObject = this.module.linkedNode.get('fileObject');
121 121 }
122 122 // edit in module from Explorer Module (edit file)
123   - else if (this.module.linkedNode.get('object')) {
124   - this.fileObject = this.module.linkedNode.get('object');
  123 + else if (this.module.linkedNode.get('object')) {
  124 + this.fileObject = this.module.linkedNode.get('object');
125 125 this.resetLinkedNode();
126 126 }
127 127 else {
... ... @@ -167,13 +167,15 @@ Ext.define('amdaUI.MyDataUI', {
167 167 }
168 168 else { // cdf, cef, nc
169 169 // select parameter
170   - var radio = this.down('radiogroup');
171   - radio.setValue({'cdfvar' : this.object.get('realvar')});
  170 + var radio = this.down('radiogroup');
  171 + radio.suspendEvent('change');
  172 + radio.setValue({'cdfvar' : this.object.get('realvar')});
  173 + radio.resumeEvent('change');
172 174 // disable form fields defined in file
173 175 this.disablePredefined(true);
174 176 }
175 177 }
176   -
  178 +
177 179 //Set table definition
178 180 if (object.get('tableDef'))
179 181 this.getPlugin('tabledef').setTableDefinition(object.get('tableDef'));
... ... @@ -186,8 +188,8 @@ Ext.define('amdaUI.MyDataUI', {
186 188 {
187 189 var form = this.down('form');
188 190 form.getForm().findField('start').setDisabled(disable);
189   - form.getForm().findField('size').setDisabled(disable);
190   - this.down('combobox').setDisabled(disable);
  191 + form.getForm().findField('size').setReadOnly(disable);
  192 + this.down('combobox').setReadOnly(disable);
191 193 },
192 194  
193 195 /*
... ... @@ -323,6 +325,10 @@ Ext.define('amdaUI.MyDataUI', {
323 325 paramModule.linkedNode.set('iconCls', 'icon-scalar');
324 326 paramModule.linkedNode.set('isSpectra', false);
325 327 }
  328 + else if (values.size == 3) {
  329 + paramModule.linkedNode.set('iconCls', 'icon-vector');
  330 + paramModule.linkedNode.set('isSpectra', false);
  331 + }
326 332 else {
327 333 if (values.plottype == 'Spectra') {
328 334 paramModule.linkedNode.set('isSpectra', true);
... ... @@ -492,18 +498,7 @@ Ext.define('amdaUI.MyDataUI', {
492 498 var items = [];
493 499 Ext.Array.each(vars, function(name, index) {
494 500 if (name) {
495   - items[index] = { boxLabel: name, name: 'cdfvar', inputValue: name,
496   - listeners:
497   - {
498   - scope: this,
499   - change: function (cb, nv, ov) {
500   - if (nv) {
501   - AmdaAction.getMyParamInfo({format: format, file : fileName, varName : cb.inputValue},
502   - this.updateInfo, this);
503   - }
504   - }
505   - }
506   - }
  501 + items[index] = { boxLabel: name, name: 'cdfvar', inputValue: name }
507 502 }
508 503 }, this);
509 504  
... ... @@ -519,7 +514,16 @@ Ext.define('amdaUI.MyDataUI', {
519 514 cls: 'x-check-group-alt',
520 515 columns: 2,
521 516 vertical: true,
522   - items: items
  517 + items: items,
  518 + listeners : {
  519 + scope: this,
  520 + change: function (cb, nv, ov) {
  521 + if (nv.cdfvar) {
  522 + AmdaAction.getMyParamInfo({format: format, file : fileName, varName : nv.cdfvar},
  523 + this.updateInfo, this);
  524 + }
  525 + }
  526 + }
523 527 }]
524 528 };
525 529  
... ...
php/classes/FilesMgr.php
... ... @@ -113,8 +113,11 @@ class FilesMgr extends AmdaObjectMgr
113 113 else {
114 114 $size = 1;
115 115 }
116   -
117   - return array('type' => $data_type, 'size' => $size, 'n_records' => $n_recs);
  116 +
  117 + $units = exec('cdfvar_attr '.$this->fileName.' '.$cdfVarId.' UNITS');
  118 + $fillval = exec('cdfvar_attr '.$this->fileName.' '.$cdfVarId.' FILLVAL');
  119 +
  120 + return array('type' => $data_type, 'size' => $size, 'n_records' => $n_recs, 'units' => $units, 'fillvalue' => $fillval);
118 121 }
119 122  
120 123 public function getCdfSampling()
... ...