#!/bin/bash
#==============================================================
#
#  Abs: Controls tmux sessions for LCLS-2 pattern server with launch scripts
#
#  Name: pattServerStart
#   $1 :  SYS argument for pattern server
#   $2 :  UNIT argument for pattern server
#   $3 :  IOC argument for pattern server
#
# ------------------------------------------------------------
# This script restarts the pattern server for the given system
# and is designed to be run from the associated system's timing expert pannel.
# ------------------------------------------------------------
#
#  Facility:  SLAC
#
#  Auth: 27-Feb-2024, R. McClanahan (rpm)
#
#==============================================================

SYS=$1
UNIT=$2
TPG_IOC=$3
echo $TPG_IOC
cd $TOOLS/script && source ./use_pydm.sh

which python
tools=$TOOLS/scripts/TpgScripts/tools
echo $(python --version)

cd $TOOLS/script/TpgScripts/scTimingPatternServer && python sc_timing_pattern_server.py --SYS $SYS --UNIT $UNIT --IOC $TPG_IOC
