Overview
Comment:Removed obsolete file struc2gnuplot_txt.cc.
trans/struc2gnuplot_txt2wish does a similar job much better.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 497d318d0a88b8395bf6870bc560afa145b21806a8fd8a386db50b461977ac44
User & Date: geraint@users.sourceforge.net on 2002-04-27 09:27:18
Other Links: branch diff | manifest | tags
Context
2002-04-27
10:10:43
Removed cruft from Makefile (pre -cc code). check-in: 7a5baa6e15 user: geraint@users.sourceforge.net tags: origin/master, trunk
09:27:18
Removed obsolete file struc2gnuplot_txt.cc.
trans/struc2gnuplot_txt2wish does a similar job much better.
check-in: 497d318d0a user: geraint@users.sourceforge.net tags: origin/master, trunk
00:23:40
Makefile -- initial version.

usage: [DESTDIR=/prefix/path] make install install-doc
export PATH=$PATH:$DESTDIR/usr/bin
edit $DESTDIR/etc/mtt.conf if required check-in: 288c29bf93 user: geraint@users.sourceforge.net tags: origin/master, trunk

Changes

Modified mttroot/mtt/cc/Makefile from [873ef71cfa] to [fef01bbbdc].

1
2
3
4
5
6
7
8
9

10
11
12

13
14
15
16
17
18
19
1
2
3
4
5
6
7


8
9
10

11
12
13
14
15
16
17
18







-
-
+


-
+








.POSIX:

CC=g++

ifeq (0,1)
CFLAGS+=-static
OCTAVE_LIBS_PATH=-L/usr/local/lib/octave
OCTAVE_LIBRARIES=-loctave -lcruft -lm -lncurses -ldl -lstdc++ -lc -lkpathsea -lreadline -lf2c
OCTAVE_LIBRARIES=-loctave -lcruft -lm -lncurses -ldl -lstdc++ -lc -lkpathsea -lreadline -lg2c

%.exe: %.cc
	$(CC) $< $(CFLAGS) $(OCTAVE_LIBS_PATH) $(OCTAVE_LIBRARIES) -o $@
	$(CC) $< $(CFLAGS) $(OCTAVE_LIBRARIES) -o $@

%.oct: %.cc
	mkoctfile $<
endif



Deleted mttroot/mtt/cc/struc2gnuplot_txt.cc version [6bc7a67f34].

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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82


















































































-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

#include <iostream>
#include <list.h>
#include <string>

    
ostream &struc2gnuplot_txt(const string sys = "sim", istream &in = cin, ostream &out = cout)
{
  typedef struct record_ record_t;
  struct record_
  {
    string       	vec;
    unsigned int	num;
    string     		cmp;
    string     	 	mod;
    unsigned int       	rpt;
  };

  list<record_t>	Lx;
  list<record_t>	Ly;

  record_t		r;


  // read data from struc.txt

  while (in >> r.vec >> r.num >> r.cmp >> r.mod >> r.rpt)
    {
      if ("state" == r.vec)
	{
	  Lx.push_back(r);
	}
      else if ("output" == r.vec)
	{
	  Ly.push_back(r);
	}
    }

  // write header

  out << "wait=-1" << endl
      << "set data style lines" << endl
      << "set xlabel \"time\"" << endl
      << "set grid" << endl
      << "set term X11" << endl
      << endl;

  // write states (X11)

  for (list<record_t>::iterator i = Lx.begin(); i != Lx.end() ; i++)
    {
      out << "plot " << "\"" << sys << "_odes.dat2\" using 1:" << 2 + Ly.size() + i->num
	  << " axes x1y1 title \"" << i->mod << "_" << i->cmp << ";" << endl
	  << "pause(wait);" << endl;
    }

  // write outputs (X11)

  for (list<record_t>::iterator i = Ly.begin(); i != Ly.end() ; i++)
    {
      out << "plot " << "\"" << sys << "_odes.dat2\" using 1:" << 1 + i->num
	  << " axes x1y1 title \"" << i->mod << "_" << i->cmp << endl
	  << "; pause(wait);" << endl;
    }

  return out;
}

#ifdef MAIN
int main(int argc, char *argv[])
{
  if (--argc)
    {
      struc2gnuplot_txt(argv[1]);
    }
  else
    {
      struc2gnuplot_txt();
    }
  return 0;
}
#endif // MAIN


MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]