Overview
Comment:Initial revision
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: f5def571c2e9ae5357e064e242cf1462992757e0ca20bd627a1227e19fafc698
User & Date: gawthrop@users.sourceforge.net on 2000-12-05 12:12:39
Other Links: branch diff | manifest | tags
Context
2000-12-27
12:55:21
Initial revision check-in: 8c40c5e1e6 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
2000-12-05
12:12:39
Initial revision check-in: f5def571c2 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
12:11:45
Changed function name to name() check-in: 436a0a6509 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Added mttroot/mtt/bin/trans/mtt_units.sh version [480dcd5dd2].













































































































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

## MTT units script - wrapper for the units program.

# Copyright (C) 2000 by Peter J. Gawthrop

# Arguments
sys=$1
port=$2
domain=$3
effort=$4
flow=$5

case ${domain} in
    electrical)
	base_effort=volt
	base_flow=amp
	;;
    translational)
	base_effort='newton'
	base_flow='m/s'
	;;
    rotational)
	base_effort='newton*m'
	base_flow='rad/s'
	;;
    fluid)
	base_effort='Pa'
	base_flow='m^3/s'
	;;
    thermal)
	base_effort='degK'
	base_flow='watt/degK'

	;;
    *)
	echo ${sys} ${port} DOMAIN_ERROR invalid domain ${domain}
	exit 1
esac

get_unit()
{
  factor=`units $2 $3 | head -1 | sed 's/\*//'`
  if [ `echo $factor | wc -w` = "1" ]; then
    echo $factor
  else
    echo $1_UNIT_ERROR unit $2 not compatible with domain ${domain}
  fi
}
## Check effort and flow for comptability + find factor
effort_factor=`get_unit EFFORT $effort $base_effort`
flow_factor=`get_unit FLOW $flow $base_flow`

echo ${sys} ${port} ${effort_factor} ${flow_factor}


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