cnping

Minimal Graphical Ping Tool
git clone https://git.sinitax.com/cnlohr/cnping
Log | Files | Refs | Submodules | README | LICENSE | sfeed.txt

commit ccfb045c7631d50e404a6c9d40c413c55c1ee073
parent 09562d13f213159f7f5adf3cf76037063e47c498
Author: hackrid <hack.rid@gmail.com>
Date:   Fri,  8 Apr 2016 14:21:08 +0200

fixed drawing of avg and stddev lines

Diffstat:
Mcnping.c | 13++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/cnping.c b/cnping.c @@ -153,8 +153,6 @@ void DrawFrame( void ) dt = rt - st; dt *= 1000; stddev += (dt-avg)*(dt-avg); - //dt *= GraphScaleFactor; - } } @@ -162,12 +160,17 @@ void DrawFrame( void ) stddev = sqrt(stddev); + int avg_gui = avg*GuiYScaleFactor; + int stddev_gui = stddev*GuiYScaleFactor; + CNFGColor( 0xff00 ); - int l = avg; + + + int l = avg_gui; CNFGTackSegment( 0, screeny-l, screenx, screeny - l ); - l = avg + stddev; + l = (avg_gui) + (stddev_gui); CNFGTackSegment( 0, screeny-l, screenx, screeny - l ); - l = avg - stddev; + l = (avg_gui) - (stddev_gui); CNFGTackSegment( 0, screeny-l, screenx, screeny - l ); char stbuf[1024];