File: Graph.cpp

package info (click to toggle)
ace 6.2.8%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 49,348 kB
  • ctags: 42,082
  • sloc: cpp: 342,284; perl: 32,718; ansic: 20,838; sh: 3,759; python: 828; exp: 787; yacc: 511; xml: 330; lex: 158; lisp: 116; makefile: 82; csh: 20; tcl: 5
file content (47 lines) | stat: -rw-r--r-- 961 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// $Id: Graph.cpp 80826 2008-03-04 14:51:23Z wotte $

#include "ace/Log_Msg.h"
#include "Graph.h"

void Graph::graph (char *filename, Graphable_Element_List &data)
{
  data.sort ();

  ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Save graph to %C\n"), filename));

  char h[10][10];
  for (int n = 0 ; n < 10 ; ++n )
    {
      for (int j = 0; j < 10; ++j )
        {
          h[n][j] = ' ';
        }
    }

  int l[10];
  int k = 0;
  for (Graphable_Element_List::iterator i = data.begin ();
        i != data.end ();
        ++i, ++k )
    {
      l[k] = (*i).when ();

      int temp = (int)((*i).temp () - 80.0);

      for (int j = 0; j <= temp; ++j)
        {
          h[k][j] = '#';
        }
    }

  for (int m = 0 ; m < 10 ; ++m)
    {
      ACE_DEBUG ((LM_INFO, ACE_TEXT ("%d  "), l[m]));

      for (int j = 0; j < 10; ++j)
        {
          ACE_DEBUG ((LM_INFO, ACE_TEXT ("%c"), h[m][j]));
        }
      ACE_DEBUG ((LM_INFO, ACE_TEXT ("\n")));
    }
}