Overview
Comment:Changed function name to name()
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 4445c30b1b55eea8f06284697fe7cf1ee45f9993f5e3b13235a210a4e96031f2
User & Date: gawthrop@users.sourceforge.net on 2000-12-05 12:04:03
Other Links: branch diff | manifest | tags
Context
2000-12-05
12:05:26
Changed to () form check-in: 2f1942ae91 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
12:04:03
Changed function name to name() check-in: 4445c30b1b user: gawthrop@users.sourceforge.net tags: origin/master, trunk
10:04:52
Fixed dummy variable bug check-in: b4fc80e6e0 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/rbg2abg_m from [cd8aa2e02b] to [8935ad4917].

1
2
3
4
5
6
7
8
9
10
11
12
13



14
15
16
17
18
19
20
#! /bin/sh

     ###################################### 
     ##### Model Transformation Tools #####
     ######################################

# Bourne shell script: rbg2abg_m
#
###############################################################
## Version control history
###############################################################
## $Id$
## $Log$



## Revision 1.15  2000/11/03 14:53:33  peterg
## Copy NOTPAR as well
##
## Revision 1.14  2000/09/14 08:41:35  peterg
## Strip off the additional direction info from rbonds
##
## Revision 1.13  2000/03/16 12:53:26  peterg













>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#! /bin/sh

     ###################################### 
     ##### Model Transformation Tools #####
     ######################################

# Bourne shell script: rbg2abg_m
#
###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.16  2000/12/05 09:04:08  peterg
## Fixed function () compatibility problem.
##
## Revision 1.15  2000/11/03 14:53:33  peterg
## Copy NOTPAR as well
##
## Revision 1.14  2000/09/14 08:41:35  peterg
## Strip off the additional direction info from rbonds
##
## Revision 1.13  2000/03/16 12:53:26  peterg
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
                               infofile,errorfile);

  %Write the function m-file for the causal bond graph
  write_abg(name,bonds,components,n_vector_bonds);    
EOF

## Sets the units for the abg file
function test_units
{ 
  grep '^[\s]*[#|%]UNITS' < ${lbl_file} >/dev/null
  if [ $? = "0" ]; then 
    grep '^[\s]*[#|%]UNITS' < ${lbl_file} |\
    awk '{
      printf("mtt_units.sh %s %s %s %s %s\n", sys, $2, $3, $4, $5)
    }' sys=${sys}  | sh | grep ERROR
    if [ $? = "0" ]; then
      echo "    " *MTT_ERRROR: domains and units are not OK - exiting
      exit 1  
    else
      echo "    " domains and units are OK 
    fi
  else
    echo "  no domains or units declared"
  fi
} 

function check_ports_exist
{
 declared_ports=`grep '^[\s]*[#|%]UNITS' < ${lbl_file} | awk '{print $2}'`
  for declared_port in $declared_ports; do
    grep "${sys}\.ports\.${declared_port}\.type" ${abg_file} >/dev/null
    if [ $? = "1" ]; then
      echo "*MTT_ERRROR: Units declared for non-existent port ${declared_port}"
      exit 1
    fi
  done
}

function set_units
{ 
  grep '^[\s]*[#|%]UNITS' < ${lbl_file} |\
  awk '{
    printf("  %s.ports.%s.domain = \"%s\";\n", sys, $2, $3);
    printf("  %s.ports.%s.units.effort = \"%s\";\n", sys, $2, $4);
    printf("  %s.ports.%s.units.flow = \"%s\";\n", sys, $2, $5);
  }' sys=${sys}







|


















|











|







151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
                               infofile,errorfile);

  %Write the function m-file for the causal bond graph
  write_abg(name,bonds,components,n_vector_bonds);    
EOF

## Sets the units for the abg file
test_units()
{ 
  grep '^[\s]*[#|%]UNITS' < ${lbl_file} >/dev/null
  if [ $? = "0" ]; then 
    grep '^[\s]*[#|%]UNITS' < ${lbl_file} |\
    awk '{
      printf("mtt_units.sh %s %s %s %s %s\n", sys, $2, $3, $4, $5)
    }' sys=${sys}  | sh | grep ERROR
    if [ $? = "0" ]; then
      echo "    " *MTT_ERRROR: domains and units are not OK - exiting
      exit 1  
    else
      echo "    " domains and units are OK 
    fi
  else
    echo "  no domains or units declared"
  fi
} 

check_ports_exist()
{
 declared_ports=`grep '^[\s]*[#|%]UNITS' < ${lbl_file} | awk '{print $2}'`
  for declared_port in $declared_ports; do
    grep "${sys}\.ports\.${declared_port}\.type" ${abg_file} >/dev/null
    if [ $? = "1" ]; then
      echo "*MTT_ERRROR: Units declared for non-existent port ${declared_port}"
      exit 1
    fi
  done
}

set_units()
{ 
  grep '^[\s]*[#|%]UNITS' < ${lbl_file} |\
  awk '{
    printf("  %s.ports.%s.domain = \"%s\";\n", sys, $2, $3);
    printf("  %s.ports.%s.units.effort = \"%s\";\n", sys, $2, $4);
    printf("  %s.ports.%s.units.flow = \"%s\";\n", sys, $2, $5);
  }' sys=${sys}


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