Ejemplo n.º 1
0
 function CheckData(READER $reader, LOGGROUP $grp, INTERVAL $iv, CACHESet $caches, array &$data, array &$spec)
 {
     global $GRAPH_MAX_CACHE_GAP;
     if (!$spec['amount'][1] || !$data) {
         $grinfo = $reader->GetGroupInfo($grp, REQUEST::LIST_COMPLEX | REQUEST::LIST_VIRTUAL);
         $grname = $grinfo['name'];
         $dbname = $reader->req->GetSourceTitle();
         if ($caches->IsEmpty()) {
             throw new ADEIException(translate("CACHESet (%s -- %s) is empty: No channels are selected", $dbname, $grname), ADEIException::NO_DATA);
         } else {
             $from = date('c', floor($iv->GetWindowStart()));
             $to = date('c', ceil($iv->GetWindowEnd()));
             throw new ADEIException(translate("CACHESet (%s -- %s) have no data available between %s and %s ", $dbname, $grname, $from, $to), ADEIException::NO_DATA);
         }
     }
     if ($GRAPH_MAX_CACHE_GAP) {
         if ($from - $iv->window_start < $GRAPH_MAX_CACHE_GAP || $to - $iv->window_start - $iv->window_size < $GRAPH_MAX_CACHE_GAP) {
             $range1 = date("c", ceil($iv->window_start)) . " and " . date("c", floor($iv->window_start + $iv->window_size));
             $range2 = date("c", ceil($from)) . " and " . date("c", floor($to));
             throw new ADEIException(translate("The data is missing in CACHE: Needed: {$range1}, Available: {$range2}"));
         }
     }
 }
Ejemplo n.º 2
0
 function ApplyReader(READER &$reader, LOGGROUP &$grp, $flags = 0)
 {
     if ($flags & INTERVAL::NEED_AMOUNT || $this->end_mode || $this->all_mode) {
         if (flags & INTERVAL::NEED_AMOUNT) {
             $info = $reader->GetGroupInfo($grp, REQUEST::NEED_INFO | REQUEST::NEED_COUNT);
             $this->Apply($info['first'], $info['last'], $info['records']);
         } else {
             $info = $reader->GetGroupInfo($grp, REQUEST::NEED_INFO);
             $this->Apply($info['first'], $info['last']);
         }
     } else {
         $this->UpdateWindow();
     }
 }