Commit 9a9c6ebf47e90f42de08cde34ea2a96ee1756157

Authored by Elena.Budnik
1 parent 085aaa36

sum in variable range is implemented

Showing 1 changed file with 32 additions and 33 deletions   Show diff stats
js/app/views/ParamArgumentsUI.js
... ... @@ -276,29 +276,31 @@ Ext.define('amdaUI.ParamArgumentsUI', {
276 276 }
277 277 ];
278 278  
279   - var sumRangeFieldSet = Ext.create('Ext.form.FieldSet', {
280   - title: relatedTable.variable ? title + " - Sum. in range" : "Sum. in range",
  279 + var sumRangeFieldSet = Ext.create('Ext.form.FieldSet', {
  280 + title: relatedTable.variable ? title + " - Sum. in range" : "Sum. in range",
281 281 collapsed: true,
282   - checkboxName: 'range_checkbox_'+relatedDim,
283   - checkboxToggle: true,
284   - name: 'range_fieldset_'+relatedDim,
285   - layout: {
286   - type: 'vbox',
287   - pack: 'start',
288   - align: 'stretch'
  282 + checkboxName: 'range_checkbox_'+relatedDim,
  283 + checkboxToggle: true,
  284 + name: 'range_fieldset_'+relatedDim,
  285 + layout: {
  286 + type: 'vbox',
  287 + pack: 'start',
  288 + align: 'stretch'
289 289 },
290 290 items: rangeItems,
291 291 listeners: {
292 292 expand: function(fieldset, eOpts) {
293 293 if (relatedTable.variable) {
294   - myDesktopApp.infoMsg('SumInRange for variable EnergyTable is not implemented yet');
295   - fieldset.collapse();
  294 + //TODO define min/max auto
  295 + var minValue = 10;
  296 + var maxValue = 1000;
296 297 }
297 298 else {
298 299 var minValue = parseInt(relatedTable.channels[0].min);
299 300 var maxValue = parseInt(relatedTable.channels[relatedTable.channels.length - 1].max);
300   - fieldset.items.items[ + (minValue > maxValue)].setValue(minValue);
301   - fieldset.items.items[ + (minValue < maxValue)].setValue(maxValue);
  301 + }
  302 + fieldset.items.items[ + (minValue > maxValue)].setValue(minValue);
  303 + fieldset.items.items[ + (minValue < maxValue)].setValue(maxValue);
302 304 // if (indexesCombo.getValue() == "*") {
303 305 // Ext.Object.each(relatedTable.channels, function (index, channel) {
304 306 // //ToDo
... ... @@ -309,33 +311,30 @@ Ext.define(&#39;amdaUI.ParamArgumentsUI&#39;, {
309 311 //
310 312 // //ToDo
311 313 // }
312   - indexesCombo.setDisabled(true);
  314 + indexesCombo.setDisabled(true);
313 315  
314   - this.paramRequestObject.set(relatedDim+'-is-range', true);
315   - if (this.onChange != null)
316   - this.onChange(uiScope, relatedDim, true, false, false);
317   - if (this.onModifyHeight)
318   - this.onModifyHeight(this.pluginOwner);
319   - }
  316 + this.paramRequestObject.set(relatedDim+'-is-range', true);
  317 + if (this.onChange != null)
  318 + this.onChange(uiScope, relatedDim, true, false, false);
  319 + if (this.onModifyHeight)
  320 + this.onModifyHeight(this.pluginOwner);
320 321 },
321 322 collapse: function(fieldset, eOpts) {
322   - indexesCombo.setDisabled(false);
323   -
324   - this.paramRequestObject.set(relatedDim+'-is-range', false);
325   - if (this.onChange != null)
326   - this.onChange(uiScope, relatedDim, false, true, false);
327   - if (this.onModifyHeight)
328   - this.onModifyHeight(this.pluginOwner);
329   - },
330   - scope: this
  323 + indexesCombo.setDisabled(false);
  324 +
  325 + this.paramRequestObject.set(relatedDim+'-is-range', false);
  326 + if (this.onChange != null)
  327 + this.onChange(uiScope, relatedDim, false, true, false);
  328 + if (this.onModifyHeight)
  329 + this.onModifyHeight(this.pluginOwner);
  330 + },
  331 + scope: this
331 332 }
332   - });
333   -
  333 + });
334 334 this.add(sumRangeFieldSet);
335 335 }
336   -
337 336 return indexesCombo;
338   - },
  337 + },
339 338  
340 339 buildTemplateArguments: function(arguments, uiScope) {
341 340 var me = this;
... ...