From 03aa895403f2f6375f3c72e843df2fd907edacbe Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Thu, 26 Jun 2014 12:38:06 +1000 Subject: [PATCH] Extract common setup code and add wombat --- site_ansto/instrument/TEST_SICS/setup/common | 34 ++++++++++++++++++++ site_ansto/instrument/TEST_SICS/setup/taipan | 34 +++----------------- site_ansto/instrument/TEST_SICS/setup/wombat | 22 +++++++++++++ 3 files changed, 61 insertions(+), 29 deletions(-) create mode 100755 site_ansto/instrument/TEST_SICS/setup/common create mode 100755 site_ansto/instrument/TEST_SICS/setup/wombat diff --git a/site_ansto/instrument/TEST_SICS/setup/common b/site_ansto/instrument/TEST_SICS/setup/common new file mode 100755 index 00000000..762926ad --- /dev/null +++ b/site_ansto/instrument/TEST_SICS/setup/common @@ -0,0 +1,34 @@ +#!/bin/bash +echo ${0} +echo $(dirname ${0}) + common +if [ -f ${PWD}/${0} ]; then + echo True: ${PWD}/${0} +else + echo False: ${PWD}/${0} +fi +if [ -d TEST_SICS ]; then + root=$PWD/TEST_SICS +elif [ $(basename $PWD) == "TEST_SICS" ]; then + root=$PWD +else + root=${PWD} + while [ "${root}" != "/" ]; do + echo ${root} + if [ $(basename ${root}) == "TEST_SICS" ]; then + break + fi + root=$(dirname ${root}) + done +fi +echo Root:${root} +if [ $(basename ${root}) != "TEST_SICS" ]; then + echo "Can't find TEST_SICS directory" + exit 1 +fi +for f in setup fakeGalil fakeTempControl; do + if [ ! -d ${root}/${f} ]; then + echo "Can't find ${f} directory" + exit 1 + fi +done + diff --git a/site_ansto/instrument/TEST_SICS/setup/taipan b/site_ansto/instrument/TEST_SICS/setup/taipan index 5c9124fb..6b4a1c3d 100755 --- a/site_ansto/instrument/TEST_SICS/setup/taipan +++ b/site_ansto/instrument/TEST_SICS/setup/taipan @@ -1,35 +1,11 @@ #!/bin/bash -echo ${0} -if [ -f ${PWD}/${0} ]; then - echo True: ${PWD}/${0} -else - echo False: ${PWD}/${0} -fi -if [ -d TEST_SICS ]; then - root=$PWD/TEST_SICS -elif [ $(basename $PWD) == "TEST_SICS" ]; then - root=$PWD -else - root=${PWD} - while [ "${root}" != "/" ]; do - echo ${root} - if [ $(basename ${root}) == "TEST_SICS" ]; then - break - fi - root=$(dirname ${root}) - done -fi -echo ${root} -if [ $(basename ${root}) != "TEST_SICS" ]; then - echo "Can't find TEST_SICS directory" +echo me:${0} +. $(dirname ${0})/common +status=${?} +echo root:${status}:${root} +if [ ! ${status} ]; then exit 1 fi -for f in setup fakeGalil fakeTempControl; do - if [ ! -d ${root}/${f} ]; then - echo "Can't find ${f} directory" - exit 1 - fi -done gnome-terminal \ --tab --title="Motors" \ --working-directory=${root}/fakeGalil \ diff --git a/site_ansto/instrument/TEST_SICS/setup/wombat b/site_ansto/instrument/TEST_SICS/setup/wombat new file mode 100755 index 00000000..1064ada4 --- /dev/null +++ b/site_ansto/instrument/TEST_SICS/setup/wombat @@ -0,0 +1,22 @@ +#!/bin/bash +echo me:${0} +. $(dirname ${0})/common +status=${?} +echo root:${status}:${root} +if [ ! ${status} ]; then + exit 1 +fi + +gnome-terminal \ + --tab --title="Motors" \ + --working-directory=${root}/fakeGalil \ + --command="${root}/fakeGalil/SIM_GALIL.py -w wombat" \ + --tab --title="Mercury" \ + --working-directory=${root}/fakeTempControl/oxford \ + --command="${root}/fakeTempControl/oxford/SIM_MERCURY.py -w" \ + --tab --title="Pfeiffer" \ + --working-directory=${root}/fakePfeiffer/tpg261 \ + --command="${root}/fakePfeiffer/tpg261/SIM_PFEIFFER.py -w" \ + --tab --title="Bash" \ + --working-directory=${root} \ + --command="bash"