/[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 121 by torben, Sun Dec 2 08:49:18 2007 UTC revision 122 by torben, Sun Dec 2 16:56:14 2007 UTC
# Line 19  int id; Line 19  int id;
19  <{  <{
20    
21  GD::Image image;  GD::Image image;
22  image.CreateTrueColor( GD::Size(600,350));  image.CreateTrueColor( GD::Size(600,360));
23    
24  //Black color scheme  //Black color scheme
25  //GD::TrueColor decoration(45,95,0);  //GD::TrueColor decoration(45,95,0);
# Line 34  GD::TrueColor line(255,0,0); Line 34  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());
37    image.String(gdFontSmall, 200,18, "Latest 20 samples, in degrees Celcius", text.Int());
38    
39  for (int i=0; i<11; ++i)  for (int i=0; i<11; ++i)
40  {  {
41          std::stringstream marker;          std::stringstream marker;
42          marker << (100- (i*10));          marker << (100- (i*10));
43          int y = (i*30) + 25;          int y = (i*30) + 40;
44          image.Line(     30, y, 590, y, decoration.Int());          image.Line(     30, y, 590, y, decoration.Int());
45    
46          image.String(gdFontSmall, 5, y-7, marker.str().c_str(), text.Int());          image.String(gdFontSmall, 5, y-7, marker.str().c_str(), text.Int());
# Line 64  GD::Point previous; Line 65  GD::Point previous;
65  for (int i=0; i<res.size(); ++i)  for (int i=0; i<res.size(); ++i)
66  {  {
67          int current = res[i].getInt(0);          int current = res[i].getInt(0);
68          int x = (i*28) + 40;          int x = (i*28) + 45;
69          int y = ((100-current) * 3) + 25;          int y = ((100-current) * 3) + 40;
70    
71          //image.FilledArc( GD::Point(x,y), GD::Size(3,3), 0, 360, line.Int(), gdPie);          //image.FilledArc( GD::Point(x,y), GD::Size(3,3), 0, 360, line.Int(), gdPie);
72          image.FilledRectangle( GD::Point(x-1,y-1), GD::Point(x+1,y+1), line.Int() );          image.FilledRectangle( GD::Point(x-1,y-1), GD::Point(x+1,y+1), line.Int() );

Legend:
Removed from v.121  
changed lines
  Added in v.122

  ViewVC Help
Powered by ViewVC 1.1.20