Commit b767ff8fc59bf8fdb3a55b6ff73b379eee2fe5cd

Authored by Erdogan Furkan
1 parent a63e6108

#11500 - Done.

js/app/models/PlotObjects/PlotIntervalsObject.js
... ... @@ -26,7 +26,9 @@ Ext.define('amdaPlotObj.PlotIntervalsObject', {
26 26 { name: 'legend-text-font-name', type: 'string', defaultValue: "sans-serif" },
27 27 { name: 'legend-text-font-size', type: 'int', defaultValue: "12" },
28 28 { name: 'legend-text-font-bold', type: 'boolean' },
29   - { name: 'legend-text-font-italic', type: 'boolean' }
  29 + { name: 'legend-text-font-italic', type: 'boolean' },
  30 + { name: 'intervals-column-show', type: 'boolean', defaultValue: false},
  31 + { name: 'intervals-param-show', type: 'string', defaultValue: "none"}
30 32  
31 33 ],
32 34  
... ... @@ -64,7 +66,7 @@ Ext.define('amdaPlotObj.PlotIntervalsObject', {
64 66 {
65 67 var intervalsValues = new Object();
66 68 intervalsValues['intervals-color'] = this.get('intervals-color');
67   - intervalsValues['legend-text-activated'] = this.get('legend-text-activated');
  69 + intervalsValues['legend-text-activated'] = this.get('legend-text-activated');
68 70 intervalsValues['legend-text-value'] = this.get('legend-text-value');
69 71 intervalsValues['legend-text-position'] = this.get('legend-text-position');
70 72 intervalsValues['legend-text-color'] = this.get('legend-text-color');
... ... @@ -73,6 +75,8 @@ Ext.define('amdaPlotObj.PlotIntervalsObject', {
73 75 intervalsValues['legend-text-font-size'] = this.get('legend-text-font-size');
74 76 intervalsValues['legend-text-font-bold'] = this.get('legend-text-font-bold');
75 77 intervalsValues['legend-text-font-italic'] = this.get('legend-text-font-italic');
  78 + intervalsValues['intervals-column-show'] = this.get('intervals-column-show');
  79 + intervalsValues['intervals-param-show'] = this.get('intervals-param-show');
76 80  
77 81 return intervalsValues;
78 82 }
... ...
js/app/views/PlotComponents/PlotContextManager.js
... ... @@ -54,11 +54,15 @@ Ext.define('amdaPlotComp.PlotContextManager', {
54 54 getIntervalCoordInfo: function (context, panel, crtTimestamp) {
55 55 var intervalName = new Array();
56 56 var intervalId = new Array();
  57 + var intervalSelectedColValue = "";
57 58 var intervalText = "";
58 59 Ext.each(panel.intervals, function (interval) {
59 60 if (crtTimestamp > interval.startTime && crtTimestamp < interval.stopTime) {
60 61 intervalName.push(interval.name);
61 62 intervalId.push(interval.id);
  63 + if(interval.selectedColValue != "")
  64 + intervalSelectedColValue = interval.selectedColValue;
  65 +
62 66 }
63 67 return;
64 68 });
... ... @@ -73,6 +77,10 @@ Ext.define(&#39;amdaPlotComp.PlotContextManager&#39;, {
73 77 }
74 78 }
75 79 intervalText += ']'
  80 + if(intervalSelectedColValue != "" ){
  81 + intervalText += ', Selected column : ' + intervalSelectedColValue.split("|")[1];
  82 +
  83 + }
76 84 }
77 85 return intervalText;
78 86 },
... ...
js/app/views/PlotComponents/PlotIntervalsForm.js
... ... @@ -13,17 +13,31 @@ Ext.define(&#39;amdaPlotComp.PlotIntervalsForm&#39;, {
13 13  
14 14 setObject : function(object) {
15 15 this.object = object.get('param-drawing-object');
  16 +
16 17 this.loadRecord(this.object);
  18 + this.updateColumnInfoCombo(object.get('paramid'));
  19 + },
  20 +
  21 + updateColumnInfoCombo: function(catId){
  22 + if (catId.substring(0, 3) === 'cat'){
  23 + AmdaAction.getAllColumnNames(catId, function(result){
  24 + var combobox = this.getForm().findField('intervals-param-show');
  25 + combobox.store.loadData(result['result']);
  26 + combobox.reset();
  27 + }, this);
  28 + }
17 29 },
18   -
19 30 getFormItems: function() {
20 31 var legendItems = [
21 32 this.addStandardText('legend-text-value', 'Text'),
22 33 this.addStandardCombo('legend-text-position', 'Position', amdaDefaultConfigs.availableLegendTextPositions),
23 34 this.addStandardFont('legend-text-font')]
24   -
  35 +
25 36 return [
26 37 this.addColorsPicker('intervals-color', 'Color', amdaDefaultConfigs.availableColorsNew, 'none'),
  38 + this.addStandardFieldSet('Show column info','intervals-column-show', [
  39 + this.addStandardCombo('intervals-param-show', 'Parameter to show' ),
  40 + ]),
27 41 this.addStandardFieldSet('Legend', 'legend-text-activated', legendItems)
28 42 ];
29 43 }
... ...
php/classes/AmdaAction.php
... ... @@ -810,6 +810,15 @@ class AmdaAction
810 810 return $objectMgr->getObject($id, $nodeType);
811 811 }
812 812  
  813 + public function getAllColumnNames($id){
  814 + $objectMgr = new CatalogMgr();
  815 + $columnInfos = $objectMgr->getCatalogParamDescription(array('id' => $id));
  816 + $columnNames = array();
  817 + foreach ($columnInfos['parameters'] as $columnInfo){
  818 + $columnNames[] = array("key" => $columnInfo['id'], "value" => $columnInfo['name']);
  819 + }
  820 + return array('success' => true ,"result" => $columnNames);
  821 + }
813 822 /*
814 823 * $obj = { id: node.id, leaf: node.leaf, nodeType: node.nodeType }
815 824 */
... ...
php/config.php
... ... @@ -218,6 +218,8 @@ $API = array(
218 218 'getParametersList' => array('len' => 0),
219 219 // Reset user password
220 220 'resetPwd' => array('len' => 1),
  221 + // Get column names for a cat
  222 + 'getAllColumnNames' => array('len' => 1),
221 223  
222 224 )
223 225 )
... ...