From dd30e2c86e82479c1345415e600e4072eb150b3b Mon Sep 17 00:00:00 2001 From: lhdamiani Date: Wed, 18 Aug 2021 17:36:07 +0200 Subject: [PATCH] live preview streamer in start daq script --- eiger/sf-daq-4/control/start_daq.sh | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/eiger/sf-daq-4/control/start_daq.sh b/eiger/sf-daq-4/control/start_daq.sh index 9a3d3eb..61d663a 100755 --- a/eiger/sf-daq-4/control/start_daq.sh +++ b/eiger/sf-daq-4/control/start_daq.sh @@ -12,6 +12,7 @@ BUILD_PATH='/home/hax_l/sf_daq_buffer/build/' UDP_RECV='std_udp_recv' UDP_SYNC='std_udp_sync' EIGER_ASSEMBLER='eiger_assembler' +STD_STREAM_SEND='std_stream_send' STD_DET_WRITER='std_det_writer' # default config file @@ -22,6 +23,7 @@ HELP_FLAG=0 # CONFIGURATION BIT_DEPTH=16 N_MPI_EXEC=3 +STREAM_NAME='streamvis' while getopts h:c:b:m: flag do case "${flag}" in @@ -29,15 +31,17 @@ do c ) CONFIG_FILE=${OPTARG};; b ) BIT_DEPTH=${OPTARG};; m ) N_MPIT_EXEC=${OPTARG};; + s ) STREAMVIS=${OPTARG};; esac done # prints help and exits if (( ${HELP_FLAG} == 1 )); then - echo "Usage : $0 -h -c -b " + echo "Usage : $0 -h -c -b -s " echo " help_flag : show this help and exits." echo " config_file : detector configuration file." echo " bit_depth : detector bit depth." + echo " stream name : live stream name." exit fi @@ -127,6 +131,25 @@ else exit fi +# Start the stream +echo "Starting the ${STD_STREAM_SEND}..." +if [ -f "${BUILD_PATH}${STD_STREAM_SEND}" ]; then + if [ -f "${CONFIG_FILE}" ]; then + if [ ${BIT_DEPTH} -ne 0 ]; then + ${BUILD_PATH}${STD_STREAM_SEND} ${CONFIG_FILE} ${BIT_DEPTH} ${STREAM_NAME} & + else + echo "Error: ${BIT_DEPTH} can't be zero..." + exit + fi + else + echo "Something went wrong while starting the ${STD_STREAM_SEND}..." + exit + fi +else + echo "Error: ${STD_STREAM_SEND} wasn't found..." + exit +fi + # Start the eiger writer echo "Starting the ${STD_DET_WRITER}..." export PATH="/usr/lib64/mpich-3.2/bin:${PATH}";