Skip to content

Commit

Permalink
Merge pull request #185 from pcdshub/MNT/txi_restartdaq
Browse files Browse the repository at this point in the history
MNT Temporarily modify `restartdaq` and `get_info` to allow TXI to run from TMO/RIX machines
  • Loading branch information
silkenelson authored Jun 29, 2024
2 parents da49912 + 238ba03 commit 8e2077a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 13 deletions.
9 changes: 9 additions & 0 deletions scripts/get_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import os
import socket
import sys
import getpass

import requests

Expand Down Expand Up @@ -71,12 +72,20 @@
for ihutch in hutches: # use the IP address to match the host to a hutch by subnet
if subnet in hutch_subnets.get(ihutch):
hutch = ihutch.upper()
if hutch in ("TMO", "RIX"):
user = getpass.getuser()
if user[:3].upper() == "TXI":
hutch = "TXI"
foundHutch = True
break
if not foundHutch:
for ihutch in hutches:
if hostname.find(ihutch) >= 0:
hutch = ihutch.upper()
if hutch in ("TMO", "RIX"):
user = getpass.getuser()
if user[:3].upper() == "TXI":
hutch = "TXI"
foundHutch = True
break
if not foundHutch:
Expand Down
26 changes: 13 additions & 13 deletions scripts/restartdaq
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ do
s)
SILENT=1
;;
m)
m)
AIMHOST=$OPTARG
;;
c)
CORESIZE=2000000000
c)
CORESIZE=2000000000
;;
d)
d)
DSSTEST=1
;;
?)
Expand Down Expand Up @@ -86,7 +86,7 @@ unset LD_LIBRARY_PATH
cd /reg/g/pcds/dist/pds/"$HUTCH"/scripts/ || exit

DAQNETWORK='fez'
LCLS2_HUTCHES="rix, tmo, ued"
LCLS2_HUTCHES="rix, tmo, ued, txi"
if echo "$LCLS2_HUTCHES" | grep -iw "$HUTCH" > /dev/null; then
source /reg/g/pcds/dist/pds/"$HUTCH"/scripts/setup_env.sh
PROCMGR='procmgr'
Expand Down Expand Up @@ -122,7 +122,7 @@ if [[ "$DAQHOST" != *$NOTRUNNING* ]]; then
echo stop the DAQ on "$DAQHOST" from "$HOSTNAME"
T="$(date +%s%N)"
$PROCMGR stop \
/reg/g/pcds/dist/pds/"$HUTCH"/scripts/$CNFFILE
/reg/g/pcds/dist/pds/"$HUTCH"/scripts/$CNFFILE


if [ -f /reg/g/pcds/dist/pds/"$HUTCH"/scripts/p"$PLATFORM"$CNFEXT.running ]; then
Expand All @@ -138,7 +138,7 @@ else
echo while DAQ reports to not run, will stop the DAQ on "$DAQHOST" from "$HOSTNAME" to clear the p"$PLATFORM"$CNFEXT.running file
T="$(date +%s%N)"
$PROCMGR stop \
/reg/g/pcds/dist/pds/"$HUTCH"/scripts/$CNFFILE
/reg/g/pcds/dist/pds/"$HUTCH"/scripts/$CNFFILE

if [ -f /reg/g/pcds/dist/pds/"$HUTCH"/scripts/p"$PLATFORM"$CNFEXT.running ]; then
echo 'the DAQ did not stop properly, exit now and try again follow the escalation procedure'
Expand Down Expand Up @@ -199,7 +199,7 @@ if [ ${#DOWIN} != 0 ] || [ ${#SELPART} != 0 ]; then
fi
fi

if [ ${#DOWIN} != 0 ]; then
if [ ${#DOWIN} != 0 ]; then
T="$(date +%s%N)"
if [ "$HUTCH" == 'xpp' ]; then
test=$(xdotool search --sync --onlyvisible --name 'ProcStat')
Expand All @@ -215,18 +215,18 @@ if [ ${#DOWIN} != 0 ]; then
echo 'and '"$Sinter"'.'"$Minter"' extra seconds for windows'
fi

if [ ${#SELPART} != 0 ]; then
if [ ${#SELPART} != 0 ]; then
DAQC=$(xdotool search --onlyvisible --name 'DAQ Control')
#echo $DAQC
xdotool mousemove --sync --window "$DAQC" 80 230
xdotool windowfocus "$DAQC"
xdotool click 1
xdotool click 1

PARTSEL=$(xdotool search --onlyvisible --sync --name 'Partition Selection')
YLOW=$(xdotool search --name 'Partition Selection' getwindowgeometry %@ | grep Geometry | awk '{print $2}' | sed s/x/" "/g | awk '{print $2}')
#echo $PARTSEL
xdotool mousemove --sync --window "$PARTSEL" 80 $(("$YLOW"-28))
xdotool click 1
xdotool mousemove --sync --window "$PARTSEL" 80 $(("$YLOW"-28))
xdotool click 1
fi

if [ "$SILENT" == 0 ];then
Expand Down

0 comments on commit 8e2077a

Please sign in to comment.