From 11bee92b77ab8c974ef9f8091b1ffd8a70a0bc40 Mon Sep 17 00:00:00 2001 From: Frank Wuerthwein Date: Fri, 13 Feb 2009 03:29:37 +0000 Subject: Now filters implement the same interface as rrdFile --- src/lib/rrdFilter.js | 196 ++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 162 insertions(+), 34 deletions(-) diff --git a/src/lib/rrdFilter.js b/src/lib/rrdFilter.js index 20c13e4..e37038c 100644 --- a/src/lib/rrdFilter.js +++ b/src/lib/rrdFilter.js @@ -1,5 +1,6 @@ /* * Filter classes for rrdFile + * They implement the same interface, but changing the content * * Part of the javascriptRRD package * Copyright (c) 2009 Frank Wuerthwein, fkw@ucsd.edu @@ -31,30 +32,91 @@ // ================================================================ -// Filter out a single DS (identified either by idx or by name) +// Filter out a subset of DSs (identified either by idx or by name) -function RRDRRAFilterDS(rrd_rra,ds_idx) { +function RRDRRAFilterDS(rrd_rra,ds_list) { this.rrd_rra=rrd_rra; - this.ds_idx=ds_idx; + this.ds_list=ds_list; } RRDRRAFilterDS.prototype.getIdx = function() {return this.rrd_rra.getIdx();} RRDRRAFilterDS.prototype.getNrRows = function() {return this.rrd_rra.getNrRows();} +RRDRRAFilterDS.prototype.getNrDSs = function() {return this.ds_list.length;} RRDRRAFilterDS.prototype.getStep = function() {return this.rrd_rra.getStep();} RRDRRAFilterDS.prototype.getCFName = function() {return this.rrd_rra.getCFName();} -RRDRRAFilterDS.prototype.getEl = function(row_idx) {return this.rrd_rra.getEl(row_idx,this.ds_idx);} -RRDRRAFilterDS.prototype.getElFast = function(row_idx) {return this.rrd_rra.getElFast(row_idx,this.ds_idx);} +RRDRRAFilterDS.prototype.getEl = function(row_idx,ds_idx) { + if ((ds_idx>=0) && (ds_idx=0) && (ds_idx=0) && (idx=0) && (ds_idx=0) && (ds_idx=0) && (idx