Commit 0318dbe6b3c30e46fa683474463c051a114e1c99

Authored by Hacene SI HADJ MOHAND
1 parent b5342f56

rm_6998 ok

help/statisticalHelpcatalogUI 0 → 100644
... ... @@ -0,0 +1,8 @@
  1 +<h2>Catalogue statistical information</h2>
  2 +When hitting the <b>"Apply"</b> button the following data on the edited catalogue are computed from the list of intervals :</br></br>
  3 +<ul>
  4 +<li>The <b>minimum</b> and <b>maximum</b> durations with corresponding intervals (following the '--' signs)</li></br>
  5 +<li>The <b>mean</b>, <b>the standard deviation (St. dev)</b> and the <b>median</b> of interval durations</li><br/>
  6 +<li>The <b>density</b> of the catalogue in the global time span : this is the ratio of the sum of all interval durations over the global time span, i.e. the duration of the interval starting with the min 'Start' and finishing with the max 'Stop'.</li>
  7 +</ul>
  8 +The <b>density</b> is an indication of the occurrence frequency of the event described in a catalogue.
... ...
help/statisticalHelp renamed to help/statisticalHelptimeTableUi
js/app/views/CatalogUI.js
... ... @@ -12,7 +12,8 @@ Ext.define(&#39;amdaUI.CatalogUI&#39;, {
12 12 alias: 'widget.panelCatalog',
13 13  
14 14 requires: [
15   - 'Ext.grid.plugin.BufferedRenderer'
  15 + 'Ext.grid.plugin.BufferedRenderer',
  16 + 'amdaUI.StatisticalPlug'
16 17 ],
17 18  
18 19 isCatalog : true,
... ... @@ -46,8 +47,11 @@ Ext.define(&#39;amdaUI.CatalogUI&#39;, {
46 47 // show this column
47 48 item.show();
48 49 }
49   - });
50   -
  50 + });
  51 + // fire the refresh event (to statistical plugin)
  52 + this.fireEvent("refresh");
  53 + // global event
  54 + myDesktopApp.EventManager.fireEvent("refresh");
51 55 },
52 56  
53 57 /**
... ... @@ -310,8 +314,8 @@ Ext.define(&#39;amdaUI.CatalogUI&#39;, {
310 314 me.TTGrid.getView().refresh();
311 315 me.TTGrid.getSelectionModel().refresh();
312 316 me.updateCount();
313   - //Statistical plugin
314   - // this.fireEvent("refresh");
  317 + //Statistical plugin
  318 + this.fireEvent("refresh");
315 319 }
316 320 }
317 321 });
... ... @@ -333,6 +337,8 @@ Ext.define(&#39;amdaUI.CatalogUI&#39;, {
333 337 me.TTGrid.getStore().load();
334 338  
335 339 me.status = result.status;
  340 + //Statistical plugin
  341 + me.fireEvent("refresh");
336 342 },
337 343  
338 344 /**
... ... @@ -365,6 +371,8 @@ Ext.define(&#39;amdaUI.CatalogUI&#39;, {
365 371 AmdaAction.initTTCacheFromTT(this.object.get('id'), typeTT, this.onAfterInit, this);
366 372 }
367 373 }
  374 + //Statistical plugin
  375 + this.fireEvent("refresh");
368 376 },
369 377  
370 378 checkIntervalsStatusForSave : function(onStatusOk) {
... ... @@ -647,6 +655,7 @@ Ext.define(&#39;amdaUI.CatalogUI&#39;, {
647 655 }
648 656 }]
649 657 },
  658 +
650 659 {
651 660 xtype: 'toolbar',
652 661 dock: 'bottom',
... ... @@ -740,7 +749,25 @@ Ext.define(&#39;amdaUI.CatalogUI&#39;, {
740 749 // });
741 750 // }
742 751 // },
743   - {
  752 +
  753 + ]
  754 + },
  755 + //statistical info
  756 + {
  757 + xtype: 'toolbar',
  758 + dock: 'bottom',
  759 + ui: 'footer',
  760 + items:[{
  761 + xtype: 'button',
  762 + text: 'Statistical info',
  763 + scope: this,
  764 + //dock: 'bottom',
  765 + //ui: 'footer',
  766 + handler: function() {
  767 + this.fireEvent('info','catalogUI');
  768 + }
  769 + },
  770 + {
744 771 type: 'button',
745 772 text: 'Visualize',
746 773 scope: this,
... ... @@ -755,8 +782,9 @@ Ext.define(&#39;amdaUI.CatalogUI&#39;, {
755 782 module.createWindow();
756 783 });
757 784 }
758   - }]
759   - }]
  785 + }
  786 + ]
  787 + }]
760 788 },
761 789 {
762 790 xtype: 'form',
... ... @@ -791,8 +819,10 @@ Ext.define(&#39;amdaUI.CatalogUI&#39;, {
791 819 url: helpDir+'catalogHOWTO'
792 820 }
793 821 }
794   - ]
  822 + ] ,
  823 + plugins: [ {ptype: 'statisticalPlugin'} ]
795 824 };
796 825 Ext.apply (this, Ext.apply(arguments, myConf));
797   - }
  826 + }
  827 +
798 828 });
... ...
js/app/views/OperationsTT.js
... ... @@ -178,7 +178,7 @@ Ext.define(&#39;amdaUI.OperationsTT&#39;, {
178 178 minWidth: 105,
179 179 scope: this,
180 180 handler: function() {
181   - this.parent.fireEvent('info');
  181 + this.parent.fireEvent('info','timeTableUi');
182 182 }
183 183 }
184 184 ]
... ...
js/app/views/StatisticalPlug.js
... ... @@ -45,7 +45,7 @@ Ext.define(&#39;amdaUI.StatisticalPlug&#39;, {
45 45 }*/
46 46 },
47 47  
48   - onInfo: function() {
  48 + onInfo: function(type) {
49 49 if (!this.win) {
50 50 this.win = new Ext.Window({
51 51 id: 'statistical-win',
... ... @@ -63,7 +63,8 @@ Ext.define(&#39;amdaUI.StatisticalPlug&#39;, {
63 63 type:'help',
64 64 qtip: 'Help on Statistical info',
65 65 handler: function(event, toolEl, panel){
66   - AmdaAction.getInfo({name : 'statisticalHelp'}, function(res,e) {
  66 +
  67 + AmdaAction.getInfo({name : 'statisticalHelp'+type}, function(res,e) {
67 68 if (res.success) myDesktopApp.infoMsg(res.result);
68 69 });
69 70 }
... ... @@ -90,8 +91,9 @@ Ext.define(&#39;amdaUI.StatisticalPlug&#39;, {
90 91 */
91 92 statTT: function(){
92 93 if (this.win) {
  94 + var type =this.hostCmp[0]['id'];
93 95 var me = this;
94   - AmdaAction.getTTCacheStatistics(function (result, e) {
  96 + AmdaAction.getTTCacheStatistics({name : type }, function (result, e) {
95 97 if (!result || !result.success)
96 98 {
97 99 if (result.message)
... ...
php/classes/AmdaAction.php
... ... @@ -1183,9 +1183,16 @@ class AmdaAction
1183 1183 return $cacheMgr->mergeIntervals();
1184 1184 }
1185 1185  
1186   - public function getTTCacheStatistics()
1187   - {
1188   - $cacheMgr = new TimeTableCacheMgr();
  1186 + public function getTTCacheStatistics($obj)
  1187 + {
  1188 + error_log("name",$obj->name );
  1189 + if($obj->name == "timeTableUi"){
  1190 + $cacheMgr = new TimeTableCacheMgr();
  1191 + }elseif($obj->name == "catalogUI"){
  1192 + $cacheMgr = new CatalogCacheMgr();
  1193 + }else{
  1194 + return array('success' => false, 'message' => 'unkown type: '.$obj->name);
  1195 + }
1189 1196 return $cacheMgr->getStatistics();
1190 1197 }
1191 1198  
... ...
php/config.php
... ... @@ -167,7 +167,7 @@ $API = array(
167 167 'modifyTTCacheInterval'=>array('len'=>1),
168 168 'operationTTCacheIntervals'=>array('len'=>2),
169 169 'mergeTTCacheIntervals'=>array('len'=>0),
170   - 'getTTCacheStatistics'=>array('len'=>0),
  170 + 'getTTCacheStatistics'=>array('len'=>1),
171 171 'sendFeedback'=>array('len'=>1),
172 172 'saveState'=>array('len'=>1),
173 173 'loadState'=>array('len'=>1),
... ...