-
Notifications
You must be signed in to change notification settings - Fork 0
/
gen.sh
executable file
·46 lines (41 loc) · 1.36 KB
/
gen.sh
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
#!/bin/sh
. ./config.sh
mkdir -p temp
cp ${COMP_NAME}Service.idl temp
cd temp
/opt/grx/bin/rtc-template -bcxx \
--module-name=${COMP_NAME} \
--module-type='SequenceInComponent' \
--module-desc='Sequence InPort component' \
--module-version=1.0 \
--module-vendor='General Robotix,Inc.' \
--module-category=example \
--module-comp-type=DataFlowComponent \
--module-act-type=SPORADIC \
--module-max-inst=1 \
--inport=jointDat:TimedJointData \
--outport=jointDat:TimedJointData \
--service=${COMP_NAME}Service:service0:${COMP_NAME}Service \
--service-idl=${COMP_NAME}Service.idl \
--consumer-idl=JointDataTypes.idl
rm *_vc*
rm *.bat
rm user_config.vsprops
mv ${COMP_NAME}ServiceSVC_impl.h ${COMP_NAME}Service_impl.h
mv ${COMP_NAME}ServiceSVC_impl.cpp ${COMP_NAME}Service_impl.cpp
rm Makefile.${COMP_NAME}
removeSVC() {
sed -e "s/ServiceSVC/Service/g" $1 > /tmp/.$1
sed -e "s/SERVICESVC/SERVICE/g" /tmp/.$1 > $1
}
removeSVC ${COMP_NAME}.h
removeSVC ${COMP_NAME}Service_impl.h
removeSVC ${COMP_NAME}Service_impl.cpp
removeOpenHRP() {
sed -e "s/OpenHRP_//g" $1 > /tmp/.$1
sed -e "s/${COMP_NAME}ServiceSkel.h/${COMP_NAME}Service.hh/g" /tmp/.$1 > $1
}
removeOpenHRP ${COMP_NAME}Service_impl.h
removeOpenHRP ${COMP_NAME}Service_impl.cpp
sed '16 a\#include "JointDataTypesStub.h"' ${COMP_NAME}.h > .${COMP_NAME}.h
mv .${COMP_NAME}.h ${COMP_NAME}.h