-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsc_mps_gui.bash
executable file
·47 lines (39 loc) · 950 Bytes
/
sc_mps_gui.bash
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
#!/bin/bash
cd "$(dirname "${BASH_SOURCE[0]}")"
usage(){
echo "LCLS-SC MPS GUI launcher"
echo "Usage:" 1>&2
echo " sc_mps_gui.bash [ -c | --cud ] [ -d | --dbfile DB_FILE ]" 1>&2
echo "" 1>&2
echo "Examples:" 1>&2
echo " sc_mps_gui.bash" 1>&2
echo " sc_mps_gui.bash --dbfile ~/database/my_file.db" 1>&2
echo "For the MPS CUD use:" 1>&2
echo " sc_mps_gui.bash --cud" 1>&2
}
exit_abnormal(){
usage
exit 1
}
CUD_MODE="False"
DB_FILE=""
while [ $# -gt 0 ]
do
case $1 in
-d | --dbfile) DB_FILE="$2"
shift ;;
-c | --cud) CUD_MODE="True" ;;
-h | --help) exit_abnormal ;;
*) exit_abnormal
esac
shift
done
MACROS="P=SIOC:SYS0:MP03, T=TPG:SYS0:1:DST0, CUD=$CUD_MODE"
if [[ -n $DB_FILE ]]
then
MACROS+=", DB_FILE=$DB_FILE"
fi
pydm --hide-nav-bar --hide-status-bar --hide-menu-bar \
-m "$MACROS" \
gui/mps_gui_main.py
exit 0