/** * Adds complex source (<b>CDEF</b>). * Complex sources are evaluated using the supplied <code>RPN</code> expression. * <p> * Complex source <code>name</code> can be used: * <ul> * <li>To specify sources for line, area and stack plots.</li> * <li>To define other complex sources.</li> * </ul> * <p> * JRobin supports the following RPN functions, operators and constants: +, -, *, /, * %, SIN, COS, LOG, EXP, FLOOR, CEIL, ROUND, POW, ABS, SQRT, RANDOM, LT, LE, GT, GE, EQ, * IF, MIN, MAX, LIMIT, DUP, EXC, POP, UN, UNKN, NOW, TIME, PI, E, * AND, OR, XOR, PREV, PREV(sourceName), INF, NEGINF, STEP, YEAR, MONTH, DATE, * HOUR, MINUTE, SECOND, WEEK, SIGN and RND. * <p> * JRobin does not force you to specify at least one simple source name as RRDTool. * <p> * For more details on RPN see RRDTool's * <a href="http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/manual/rrdgraph.html" target="man"> * rrdgraph man page</a>. * * @param name source name. * @param rpnExpression RPN expression containig comma (or space) delimited simple and complex * source names, RPN constants, functions and operators. */ public void addDatasource(String name, String rpnExpression) { CDef cDef = new CDef(name, rpnExpression); sources.put(name, cDef); }
private void calculateCDef(CDef cDef) throws RrdException { RpnCalculator calc = new RpnCalculator(cDef.getRpnExpression(), cDef.getName(), this); cDef.setValues(calc.calculateValues()); }
private void calculateCDef(CDef cDef) throws RrdException { RpnCalculator calc = new RpnCalculator(cDef.getRpnExpression(), cDef.getName(), this); cDef.setValues(calc.calculateValues()); }
/** * <p>Adds complex source (<b>CDEF</b>). * Complex sources are evaluated using the supplied <code>RPN</code> expression.</p> * <p/> * <p>Complex source <code>name</code> can be used:</p> * <ul> * <li>To specify sources for line, area and stack plots.</li> * <li>To define other complex sources.</li> * </ul> * <p/> * <p>JRobin supports the following RPN functions, operators and constants: +, -, *, /, * %, SIN, COS, LOG, EXP, FLOOR, CEIL, ROUND, POW, ABS, SQRT, RANDOM, LT, LE, GT, GE, EQ, * IF, MIN, MAX, LIMIT, DUP, EXC, POP, UN, UNKN, NOW, TIME, PI, E, * AND, OR, XOR, PREV, PREV(sourceName), INF, NEGINF, STEP, YEAR, MONTH, DATE, * HOUR, MINUTE, SECOND, WEEK, SIGN and RND.</p> * <p/> * <p>JRobin does not force you to specify at least one simple source name as RRDTool.</p> * <p/> * <p>For more details on RPN see RRDTool's * <a href="http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/manual/rrdgraph.html" target="man"> * rrdgraph man page</a>.</p> * * @param name source name. * @param rpnExpression RPN expression containig comma (or space) delimited simple and complex * source names, RPN constants, functions and operators. */ public void addDatasource(String name, String rpnExpression) { CDef cDef = new CDef(name, rpnExpression); sources.put(name, cDef); }