Changeset 5b62a23974aecc334c1cf76a2672f26b69c02d0c
 Timestamp:
 10/09/09 03:17:54
(7 years ago)
 Author:
 Theo Schlossnagle <jesus@omniti.com>
 gitcommitter:
 Theo Schlossnagle <jesus@omniti.com> 1255058274 +0000
 gitparent:
[d83c60ec436c1936f4b7e575a76dc3fe546b6d04]
 gitauthor:
 Theo Schlossnagle <jesus@omniti.com> 1255058274 +0000
 Message:
missing data isn't rendering right. fixes #201

Files:

Legend:
 Unmodified
 Added
 Removed
 Modified
 Copied
 Moved
r3db67ae 
r5b62a23 

200  200  } 

201  201  middle = parseInt(((highlow)/2))+ low; 

202   if(middle>=a.length) { 

 202  if(middle>=a.length  a[middle] == null) { 

 203  var r = { found: false, index: middle }; return r; 

203  204  } //bad index, somehow 

204  205  if(a[middle][0] > v) return binary_search(a, v, middle1, low); 

…  …  
1179  1180  for (var i = 0; i < data.length; ++i) { 

1180  1181  prev = cur; 

 1182  if(data[i] == null) continue; 

1181  1183  cur = [data[i][0], data[i][1]]; 

1182  1184  if(dataManip) cur[1] = dataManip(cur[1]); 

r1ce987a 
r5b62a23 

17  17  

18  18  $this>derive = $derive; 

19   $this>uuid = $db>get_uuid_by_sid($uuid); 

 19  $this>uuid = $db>get_uuid_by_sid($uuid); 

20  20  

21  21  if($derive == 'derive'  $derive == 'true') { 

…  …  
50  50  if(!isset($attr)) $attr = $this>default_attr; 

51  51  if(!$this>expr) return $this>data[$ts][$attr]; 

52   return $this>rpn_eval($this>data[$ts][$attr], $this>expr); 

 52  $rv = $this>rpn_eval($this>data[$ts][$attr], $this>expr); 

 53  return $rv; 

53  54  } 

54  55  } 

rdf2e366 
r5b62a23 

9  9  switch($op) { 

10  10  case 'ln': 

11   array_unshift($s, log(array_shift($s))); break; 

 11  $v = array_shift($s); 

 12  array_unshift($s, is_null($v) ? $v : log($v)); break; 

12  13  case 'round': 

13  14  $r = array_shift($s); 

14  15  $l = array_shift($s); 

15   array_unshift($s, round($l,$r)); 

 16  array_unshift($s, is_null($l) ? $l : round($l,$r)); 

16  17  break; 

17  18  case 'floor': 

18   array_unshift($s, floor(array_shift($s))); break; 

 19  $v = array_shift($s); 

 20  array_unshift($s, is_null($v) ? $v : floor($v)); break; 

19  21  case 'ceil': 

20   array_unshift($s, ceil(array_shift($s))); break; 

 22  $v = array_shift($s); 

 23  array_unshift($s, is_null($v) ? $v : ceil($v)); break; 

21  24  case 'log': 

22  25  $r = array_shift($s); 

23  26  $l = array_shift($s); 

24   array_unshift($s, log($l,$r)); 

 27  array_unshift($s, is_null($l) ? $l : log($l,$r)); 

25  28  break; 

26  29  case 'e': 

…  …  
31  34  $r = array_shift($s); 

32  35  $l = array_shift($s); 

33   array_unshift($s, pow($l,$r)); 

 36  array_unshift($s, (is_null($r)  is_null($l)) ? NULL : pow($l,$r)); 

34  37  break; 

35  38  case '': 

36  39  $r = array_shift($s); 

37  40  $l = array_shift($s); 

38   array_unshift($s, $l$r); 

 41  array_unshift($s, (is_null($r)  is_null($l)) ? NULL : ($l$r)); 

39  42  break; 

40  43  case '/': 

41  44  $r = array_shift($s); 

42  45  $l = array_shift($s); 

43   array_unshift($s, $l/$r); 

 46  array_unshift($s, (is_null($r)  is_null($l)  $r == 0) ? NULL : ($l/$r)); 

44  47  break; 

45  48  case '.': 

46  49  array_unshift($s, $s[array_shift($s)]); break; 

47  50  case '+': 

48   array_unshift($s, array_shift($s) + array_shift($s)); break; 

 51  $r = array_shift($s); 

 52  $l = array_shift($s); 

 53  array_unshift($s, (is_null($r)  is_null($l)) ? NULL : ($l+$r)); 

 54  break; 

49  55  case '*': 

50   array_unshift($s, array_shift($s) * array_shift($s)); break; 

 56  $r = array_shift($s); 

 57  $l = array_shift($s); 

 58  array_unshift($s, (is_null($r)  is_null($l)) ? NULL : ($l*$r)); 

 59  break; 

51  60  case 'auto': 

52   array_unshift($s, $this>autounits(array_shift($s))); break; 

 61  $v = array_shift($s); 

 62  array_unshift($s, is_null($v) ? $v : $this>autounits($v)); break; 

53  63  case 'min': 

54   array_unshift($s, min(array_shift($s),array_shift($s))); break; 

 64  $r = array_shift($s); 

 65  $l = array_shift($s); 

 66  if(is_null($r)) array_unshift($s,$l); 

 67  else if(is_null($l)) array_unshift($s,$r); 

 68  else array_unshift($s, min($r,$l)); 

 69  break; 

55  70  case 'max': 

56   array_unshift($s, max(array_shift($s),array_shift($s))); break; 

 71  $r = array_shift($s); 

 72  $l = array_shift($s); 

 73  if(is_null($r)) array_unshift($s,$l); 

 74  else if(is_null($l)) array_unshift($s,$r); 

 75  else array_unshift($s, max($r,$l)); 

 76  break; 

57  77  default: 

58  78  if(preg_match('/^?\d+$/', $op)) { 

r5b94a67 
r5b62a23 

98  98  foreach($timeline as $ts) { 

99  99  $value = $set>data($ts); 

100   if($value != "") { 

101   $desc = $set>description($ts); 

102   if($desc) { 

 100  $desc = $set>description($ts); 

 101  if($desc) { 

103  102  $a[] = array( $ts * 1000, "$value", $desc ); 

104   } else { 

 103  } else { 

105  104  $a[] = array( $ts * 1000, "$value" ); 

106   } 

107  105  } 

108  106  $i++; 

109   } 

 107  } 

110  108  } 

111  109  return $a; 
