6
function __construct($minimal = 0, &$config = false) {
12
if ($config) $cfg = &$config;
13
else $cfg = &$ADEI_CACHE;
15
foreach ($cfg as $res) {
16
if ($res['res'] < $minimal) break;
17
else array_push($this->cfg, $res);
19
array_push($this->cfg, array("min" => -1, "res" => 0));
23
array_push($this->cfg, array("min" => -1, "res" => 0));
24
} else $this->cfg = &$ADEI_CACHE;
29
return sizeof($this->cfg) - 1;
33
return sizeof($this->cfg) - 2;
36
function Smaller($res) {
37
if (isset($this->cfg[$res + 1])) return $res + 1;
41
function Larger($res) {
42
if ($res > 0) return $res - 1;
46
function Get(INTERVAL &$ivl, $amount = 0) {
48
for ($res = 0; isset($this->cfg[$res]);$res++)
49
if ((!$this->cfg[$res]["res"])||(($ivl->window_size/$this->cfg[$res]["res"])>$amount)) {
53
for ($res = 0; isset($this->cfg[$res]);$res++)
54
if ($ivl->window_size > $this->cfg[$res]["min"]) {
61
for ($res = 0; isset($this->cfg[$res]);$res++)
62
if (($ivl->window_size > $this->cfg[$res]["min"])&&((!$this->cfg[$res]["res"])||(($ivl->window_size/$this->cfg[$res]["res"])>$amount)))
65
$f=fopen("/tmp/xxx3", "w");
66
fprintf($f, $ivl->window_size . "\n");
67
fprintf($f, "%i %i %i\n", $ivl->window_size, (!$this->cfg[$res-1]["res"]), (($ivl->window_size/$this->cfg[$res-1]["res"])>$amount));
68
fprintf($f, print_r($this->cfg[$res-1], true));
69
fprintf($f, print_r($ivl, true));
73
if ($ivl->window_size <= 0)
74
throw new ADEIException(translate("Invalid WINDOW %s is specified", $ivl->window_start . '+' . $ivl->window_size));
76
throw new ADEIException(translate("Internal Error in module RESOLUTION"));
79
function GetWindowSize($res) {
80
return $this->cfg[$res]["res"];
84
array_push($ADEI_CACHE, array("min" => -1, "res" => 0));
b'\\ No newline at end of file'