Overview
Comment:*** empty log message ***
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 8d4d0bc2dcef493e527f6b3720e27edc85e462261fbec9ac6438ee084387505a
User & Date: geraint@users.sourceforge.net on 2005-11-13 18:15:27
Other Links: branch diff | manifest | tags
Context
2005-11-16
00:43:15
rtxi check-in: aca770446b user: geraint@users.sourceforge.net tags: origin/master, trunk
2005-11-13
18:15:27
*** empty log message *** check-in: 8d4d0bc2dc user: geraint@users.sourceforge.net tags: origin/master, trunk
2005-10-13
10:01:57
Explicitly set U to zero check-in: c982c26de6 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Added mttroot/mtt/bin/capitalise_initial version [b5ca98d45c].







1
2
3
4
5
6
+
+
+
+
+
+
#! /bin/sh

phrase="$*"
initial=$(echo $phrase | sed 's/\(.\).*/\1/')
Initial=$(echo $initial | tr [a-z] [A-Z])
echo $phrase | sed s/$initial/$Initial/

Added mttroot/mtt/bin/trans/sympar2rtxi_txt2cc version [fbdb9437f7].













































































































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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
#! /bin/sh

sys=$1
Sys=$(capitalise_initial $sys)
struc=${sys}_struc.txt
sympar=${sys}_sympar.txt
RTXI_H="${Sys}_rtxi.h"
RTXI_CC="${Sys}_rtxi.cc"
program=$(basename $0)
date=$(date)

cat <<EOF > ${RTXI_CC}
// -*-c++-*- Put Emacs into c++-mode

// Generated from $sympar and $struc by MTT
// using $program
// at $date

#include <${RTXI_H}>

extern "C" Plugin::Object *createRTXIPlugin(void) {
  return new ${Sys}();
}

static DefaultGUIModel::variable_t vars[] = {
EOF

gawk '
  ($1=="input") {
    printf("  {\n");
    printf("    \"%s\",\n", $3);
    printf("    \"%s\",\n", $6);
    printf("    DefaultGUIModel::INPUT,\n");
    printf("  },\n");
  }
  ($1=="output") {
    printf("  {\n");
    printf("    \"%s\",\n", $3);
    printf("    \"%s\",\n", $6);
    printf("    DefaultGUIModel::OUTPUT,\n");
    printf("  },\n");
  }
' ${struc} >> ${RTXI_CC}

gawk '
  {
    printf("  {\n");
    printf("    \"%s\",\n", $1);
    printf("    \"\",\n");
    printf("    DefaultGUIModel::PARAMETER |");
    printf(" DefaultGUIModel::DOUBLE,\n");
    printf("  },\n");
  }
' $sympar >> ${RTXI_CC}

cat <<EOF >> ${RTXI_CC}
};

static size_t num_vars = sizeof(vars)/sizeof(DefaultGUIModel::variable_t);
// TODO: initialise from numpar
EOF

gawk '
  BEGIN { printf("static double\n"); }
  { printf("  %s=0.0,\n", $1); }
  END {printf("  ;\n"); }
' $sympar >> ${RTXI_CC}

cat <<EOF >> ${RTXI_CC}
static long i_count = 0;

${Sys}::~${Sys}(void) {}

void ${Sys}::execute(void) {
  // TODO: call ode2odes functions
}

void ${Sys}::update(DefaultGUIModel::update_flags_t flag) {
  setCaption("${sys}");
  switch(flag) {
    case INIT:
EOF

gawk '
  {
    printf("      setParameter(\"%s\",QString::number(%s));\n",
	 $1, $1);
  }
' $sympar >> ${RTXI_CC}

cat <<EOF >> ${RTXI_CC}
      break;
    case MODIFY:
EOF

gawk '
  {
    printf("      getParameter(\"%s\").toDouble();\n", $1);
  }
' $sympar >> ${RTXI_CC}

cat <<EOF >> ${RTXI_CC}
      break;
    default:
      break;
  }
}
EOF

Added mttroot/mtt/bin/trans/sympar2rtxi_txt2h version [6fe211e926].













































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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
#! /bin/sh

sys=$1
Sys=$(capitalise_initial $sys)
sympar=${sys}_sympar.txt
RTXI_H="${Sys}_rtxi.h"
program=$(basename $0)
date=$(date)

cat <<EOF > ${RTXI_H}
// -*-c++-*- Put Emacs into c++-mode

// Generated from $sympar by MTT
// using $program
// at $date

#include <rt.h>
#include <default_gui_model.h>

class $Sys : public DefaultGUIModel
{

public:
  
  $Sys(void);
  virtual ~$Sys(void);
  
  virtual void execute(void);

protected:

  virtual void update(DefaultGUIModel::update_flags_t);

private:

EOF

gawk '
	{ printf("  double %s;\n", $1); }
' $sympar >> ${RTXI_H}

cat <<EOF >> ${RTXI_H}
};
EOF


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