/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/resamplers/skipresampler.php

  • Committer: Suren A. Chilingaryan
  • Date: 2020-02-06 06:07:51 UTC
  • Revision ID: csa@suren.me-20200206060751-n4lbi25y4wh10f3u
Generalize data filtering/resampling in the VIEWs and provide common tools for secondary time series plots (based on work of Jalal)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
 
 
3
class SKIPResampler extends RESAMPLER {
 
4
  function Resample($res, $flags = 0) {
 
5
    $filtered = 0;
 
6
    foreach ($res['data'] as $t => &$v) {
 
7
        $cond = (sizeof($v) == $this->GetNumberOfChannels($res));
 
8
        if ($cond) {
 
9
            foreach ($v as $vi) {
 
10
                if (!is_numeric($vi)) {
 
11
                    $cond = false;
 
12
                    break;
 
13
                }
 
14
            }
 
15
        }
 
16
        if (!$cond) {
 
17
            unset($res['data']);
 
18
            $filtered++;
 
19
        }
 
20
    }
 
21
    $res['info']['incomplete'] = $filtered;
 
22
    return $res;
 
23
  }
 
24
}
 
25
 
 
26
 
 
27
?>
 
 
b'\\ No newline at end of file'