/adei/trunk

To get this branch, use:
bzr branch http://darksoft.org/webbzr/adei/trunk

« back to all changes in this revision

Viewing changes to classes/export.php

  • Committer: Suren A. Chilingaryan
  • Date: 2018-04-13 03:42:49 UTC
  • Revision ID: csa@suren.me-20180413034249-f7zx8mrrp7ycidhs
Support real-time export mode for status displays

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
 
27
27
 var $filename;
28
28
 
 
29
 var $rt_mode;          // Varios optimizations to reduce latency (mainly for status displays)
29
30
 var $cache_mode;       // Get data out of cache
30
31
 
31
32
 var $export_data;
34
35
 const MASK_GROUP = 1;
35
36
 const MASK_SOURCE = 2;
36
37
 const MASK_COMPLETE = 3;
 
38
 
 
39
 const RT_SKIP_HEADERS = 1;
 
40
 const RT_FULL = 0xFFFF;
37
41
   
38
42
 function __construct(DATARequest $props = NULL, STREAMObjectInterface $h = NULL, &$format = NULL, DOWNLOADMANAGER $dm = NULL) {
39
43
    global $ADEI_SETUP;
122
126
    }
123
127
    
124
128
    $this->cache_mode = false;
 
129
    $this->rt_mode = 0;
125
130
 }
126
131
 
127
132
 function SetCacheMode($mode = true) {
128
133
    $this->cache_mode = $mode;
129
134
 }
 
135
 
 
136
 function SetRealTimeMode($mode = EXPORT::RT_FULL) {
 
137
    $this->rt_mode = $mode;
 
138
 }
130
139
 
131
140
 function CheckMode() {
132
141
    if ((!$this->multimode)&&(!$this->handler->multigroup)) {
282
291
 
283
292
    $list = $rdr->CreateRequestSet($grp, $mask, "DATARequest");
284
293
    foreach ($list as $req) {
285
 
        $reader = $req->CreateReader();
 
294
        $reader = $this->CreateReader($req);
286
295
        $group = $reader->CreateGroup();
287
296
        $ivl = $reader->CreateInterval($group);
288
297
        $msk = $reader->CreateMask();
373
382
 
374
383
    $this->handler->GroupStart($title, $subseconds);
375
384
    
376
 
    $rdr->Export($this->handler, $grp, $msk, $ivl, $this->resample, "", $this->dmcb);
 
385
    $flags = 0;
 
386
    if ($this->rt_mode&EXPORT::RT_SKIP_HEADERS) $flags |= READER::EXPORT_SKIP_HEADERS;
 
387
 
 
388
    $rdr->Export($this->handler, $grp, $msk, $ivl, $this->resample, $flags, $this->dmcb);
377
389
    $this->handler->GroupEnd();    
378
390
 
379
391
    if (($this->stream)&&(!$this->handler->multigroup)) $this->stream->BlockEnd();