/[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 126 by torben, Sun Dec 2 20:26:43 2007 UTC revision 196 by torben, Sat Dec 8 19:19:07 2007 UTC
# Line 17  dburl; Line 17  dburl;
17  int id;  int id;
18  </%args>  </%args>
19  <{  <{
20    reply.setHeader("Cache-Control", "no-cache, must-revalidate"); // Http/1.1
21    reply.setHeader("Expires",  "Mon, 26 Jul 1997 05:00:00 GMT"); //date in the past
22    
23  GD::Image image;  GD::Image image;
24  image.CreateTrueColor( GD::Size(600,360));  image.CreateTrueColor( GD::Size(600,360));
# Line 49  for (int i=0; i<11; ++i) Line 51  for (int i=0; i<11; ++i)
51  /////////////////////////////////////////////////  /////////////////////////////////////////////////
52    
53    
54  tntdb::Connection conn = tntdb::connect(dburl);  tntdb::Connection conn = tntdb::connectCached(dburl);
55    
56  std::stringstream query;  std::stringstream query;
57  query << "SELECT temperature FROM ( ";  query << "SELECT temperature FROM ( ";
# Line 84  for (unsigned int i=0; i<res.size(); ++i Line 86  for (unsigned int i=0; i<res.size(); ++i
86  // echo the image to the browser...  // echo the image to the browser...
87  reply.setContentType("image/png");  reply.setContentType("image/png");
88  int size;  int size;
89  unsigned char* ptr = (unsigned char*) image.Png(&size);  unsigned char* ptr = (unsigned char*) image.Png(&size,1);
90    
91  for (int i=0; i<size; ++i)  for (int i=0; i<size; ++i)
92          reply.out() << ptr[i];          reply.out() << ptr[i];

Legend:
Removed from v.126  
changed lines
  Added in v.196

  ViewVC Help
Powered by ViewVC 1.1.20