/[H9]/trunk/tntnet/dynamic/temperaturegraph.ecpp
ViewVC logotype

Diff of /trunk/tntnet/dynamic/temperaturegraph.ecpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 119 by torben, Sat Dec 1 20:53:59 2007 UTC revision 120 by torben, Sun Dec 2 08:49:18 2007 UTC
# Line 21  int id; Line 21  int id;
21  GD::Image image;  GD::Image image;
22  image.CreateTrueColor( GD::Size(600,350));  image.CreateTrueColor( GD::Size(600,350));
23    
24  GD::TrueColor green(45,95,0);  //Black color scheme
25  GD::TrueColor text(200,200,200);  //GD::TrueColor decoration(45,95,0);
26  GD::TrueColor red(255,0,0);  //GD::TrueColor text(200,200,200);
27    //GD::TrueColor line(255,0,0);
28    
29    //White color scheme
30    image.Fill( GD::Point(1,1), GD::TrueColor(255,255,255).Int() );
31    GD::TrueColor decoration(60,60,60);
32    GD::TrueColor text(0,0,0);
33    GD::TrueColor line(255,0,0);
34    
35    
36  image.String(gdFontSmall, 250,5, "Temperature graph", text.Int());  image.String(gdFontSmall, 250,5, "Temperature graph", text.Int());
# Line 33  for (int i=0; i<11; ++i) Line 40  for (int i=0; i<11; ++i)
40          std::stringstream marker;          std::stringstream marker;
41          marker << (100- (i*10));          marker << (100- (i*10));
42          int y = (i*30) + 25;          int y = (i*30) + 25;
43          image.Line(     30, y, 590, y, green.Int());          image.Line(     30, y, 590, y, decoration.Int());
44    
45          image.String(gdFontSmall, 5, y-7, marker.str().c_str(), text.Int());          image.String(gdFontSmall, 5, y-7, marker.str().c_str(), text.Int());
46    
# Line 60  for (int i=0; i<res.size(); ++i) Line 67  for (int i=0; i<res.size(); ++i)
67          int x = (i*28) + 40;          int x = (i*28) + 40;
68          int y = ((100-current) * 3) + 25;          int y = ((100-current) * 3) + 25;
69    
70          //image.FilledArc( GD::Point(x,y), GD::Size(3,3), 0, 360, red.Int(), gdPie);          //image.FilledArc( GD::Point(x,y), GD::Size(3,3), 0, 360, line.Int(), gdPie);
71          image.FilledRectangle( GD::Point(x-1,y-1), GD::Point(x+1,y+1), red.Int() );          image.FilledRectangle( GD::Point(x-1,y-1), GD::Point(x+1,y+1), line.Int() );
72    
73          if (i>0)          if (i>0)
74          {          {
75                  image.Line( GD::Point(x,y), previous, red.Int());                  image.Line( GD::Point(x,y), previous, line.Int());
76          }          }
77    
78          previous = GD::Point(x,y);          previous = GD::Point(x,y);

Legend:
Removed from v.119  
changed lines
  Added in v.120

  ViewVC Help
Powered by ViewVC 1.1.20