#!/bin/bash
if [ -e @SIMPATH@/bin/fairmq-shmmonitor ]; then
  @SIMPATH@/bin/fairmq-shmmonitor --cleanup
fi

if [ -z "$1" ]; then
#    _filename=@VMCWORKDIR@/input/stsxyter_cosy2018.tsa
    _filename=tofget4_hd2018.tsa
    _dirname=@VMCWORKDIR@/input/
else
    _filename=$1
    _dirname=$2
fi

SAMPLER="TsaSampler"
SAMPLER+=" --id sampler1"
SAMPLER+=" --max-timeslices 10"
#SAMPLER+=" --flib-port 10"
SAMPLER+=" --filename $_filename"
SAMPLER+=" --dirname $_dirname"
#SAMPLER+=" --flib-host myHost"
SAMPLER+=" --transport shmem"
SAMPLER+=" --channel-config name=tofcomponent,type=push,method=bind,address=tcp://127.0.0.1:5555"
SAMPLER+=" --channel-config name=stscomponent,type=push,method=bind,address=tcp://127.0.0.1:5556"
#SAMPLER+=" --transport zeromq"
#SAMPLER+=" --transport nanomsg"
xterm -geometry 80x23+0+0 -hold -e @CMAKE_BINARY_DIR@/bin/MQ/source/$SAMPLER &

