I start to write a "Graph Editor"
The goal of this peace of code is to make the more flexible as possible rrdgraph printing.
- Change color (graph, background, shade...)
Multi graph
I hope not to be in the same scope as one of your current dev

Moderator: RDNZL
Hi Minus, I have added your work to version 0.1.187.Minus wrote: I 've added loads of functions and redesign the code.
This first version (0.0001) is working but some functions have to be redesign.
So quick, thanks you so much !RDNZL wrote:Hi Minus, I have added your work to version 0.1.187.Minus wrote: I 've added loads of functions and redesign the code.
This first version (0.0001) is working but some functions have to be redesign.
Cleaned up code.
Fixed spelling errors widht -> width (db table name)
Store original device name in Combo, make lowercase DSname in other routine (otherwise devices with capitals are not found)
Sort combolist entries for easier searching.
Add period selection to preview window.
Todo: Move graph generate code to a module so DomotiGaServer can generate graphs too. (for example if a xmlrpc call requests that)
Bug left: ERROR: Cannot parse vname from 'DEF:www.google.com_rtt=/home/ron/domotiga/rrd/www.google.com.rrd:rtt:AVERAGE'
I also moved some fields and buttons around in the GUI, hope you don't mind.
Thanks again for your work!
Code: Select all
ERROR: Cannot parse vname from 'DEF:www.google.com_rtt=/home/ron/domotiga/rrd/www.google.com.rrd:rtt:AVERAGE'
Code: Select all
2010/09/17 22:21:28 [Graph Editor] rrdtool graph /tmp/gambas.1000/23626/15.tmp --lazy --start end-1d -a PNG --slope-mode --font DEFAULT:7: --watermark 'Domotiga v0.1.187' --width 400 --height 100 -c BACK#FFFFFF -c CANVAS#FFFFFF -c SHADEA#000000 -c SHADEB#000000 -c GRID#000000 -c MGRID#000000 -c FONT#000000 -c AXIS#000000 -c FRAME#000000 -c ARROW#000000 --title='Google Bug' --vertical-label '' DEF:www.google.com_rtt=/home/ron/domotiga/rrd/www.google.com.rrd:rtt:AVERAGE COMMENT:'\s' COMMENT:' ' COMMENT:'\l' LINE1:www.google.com_rtt#00FF00:'RTT ' COMMENT:'\s' COMMENT:'\s' 2>&1 >/dev/null
I found the reason, VDEF name (made from device name) can't be with a dot inside.RDNZL wrote:Others work ok, maybe because of the dots in the device name, quotes missing, dunno...?
The solution could be to add in DeviceName2RRDName a regex to replace dot to whatever :the reason for limiting the characterset of vnames is to
simplify parsing CDEF expressions (no , for example) and for future
enhancements. At the moment, allowing the . would not hurt, but it
would prevent us from using it for something more useful in the
future or we would have to come up with more backslash escapes
which do not help either ...
Code: Select all
sRRDName = Replace$(sRRDName, ".", "{whatever}")