diff --git a/.gitignore b/.gitignore index 8c20a9f6..ec6e5a2f 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,9 @@ *.d *.a *~ +*ClassDict.cpp +*.pcm +*.rootmap lib Dependencies */a.out @@ -12,3 +15,4 @@ RemoteControl Example/Example Example/Example_root Win_Mac_translation +core diff --git a/Example/Example.cpp b/Example/Example.cpp index 0b9d5f47..dc45b709 100644 --- a/Example/Example.cpp +++ b/Example/Example.cpp @@ -265,19 +265,13 @@ int main(){ // Each submitted plot with the same name is stored in the database as a different version. ///////////////////////////////////////////////////////////////// std::vector plot_x(5); - for (size_t i = 0; i < plot_x.size(); ++i) plot_x[i] = i; std::vector plot_y(plot_x.size()); - for (auto& y : plot_y) y = rand(); - - std::string plot_layout = "{" - "\"title\":\"A random plot\"," - "\"xaxis\":{\"title\":\"x\"}," - "\"yaxis\":{\"title\":\"y\"}" - "}"; + for (size_t i = 0; i < plot_x.size(); ++i) plot_x[i] = i; + Store store; // for conversion to JSON std::vector traces(2); - Store store; + for (auto& y : plot_y) y = rand(); store.Set("x", plot_x); store.Set("y", plot_y); store >> traces[0]; @@ -287,6 +281,12 @@ int main(){ store.Set("y", plot_y); store >> traces[1]; + std::string plot_layout = "{" + "\"title\":\"A random plot\"," + "\"xaxis\":{\"title\":\"x\"}," + "\"yaxis\":{\"title\":\"y\"}" + "}"; + DAQ_inter.SendPlotlyPlot("test_plot", traces, plot_layout); /////////////////////////// generic SQL query example ////////////////////// @@ -294,12 +294,12 @@ int main(){ std::string resp; std::cout<<"Testing submitting generic SQL queries"< resps; - qryok = DAQ_inter.SQLQuery("daq","SELECT version, data FROM device_config WHERE device='"+device_name+"'",resps); + qryok = DAQ_inter.SQLQuery("SELECT time, message FROM logging ORDER BY time DESC LIMIT 5",resps); std::cout<<"multi-record query success: "<5) std::cout<<"...\n"<>monitoring_json; /// prducing monitoring json // send to the database - bool ok = DAQ_inter.SendMonitoringData("general", monitoring_json); + bool ok = DAQ_inter.SendMonitoringData(monitoring_json, "general"); if(!ok){ std::cerr<<"sendmonitoringdata failed"< str: print("testing generic sql queries") # single-record query resp = std.string() - qryok = DAQ_inter.SQLQuery("daq","SELECT config_id, name, version, data FROM configurations",resp) + qryok = DAQ_inter.SQLQuery("SELECT time, message FROM logging ORDER BY time DESC LIMIT 1",resp) print("single-record query success: ",qryok,", response: '",resp,"'") # for multi-record queries resps = std.vector['std::string']() - qryok = DAQ_inter.SQLQuery("daq","SELECT device, version, data FROM device_config",resps) + qryok = DAQ_inter.SQLQuery("SELECT time, message FROM logging ORDER BY time DESC LIMIT 5",resps) print("multi-record query success: ",qryok,", responses:") for i in range(min(5,resps.size())): print(i,": '",resps[i],"'") @@ -336,7 +336,7 @@ def change_voltage(self, control_name: str) -> str: monitoring_data.__rshift__['std::string'](monitoring_json) # send to the Database for plotting on the webpage - DAQ_inter.SendMonitoringData("general", monitoring_json) + DAQ_inter.SendMonitoringData(monitoring_json, "general") # retrieve and respond to control changes ########################################### diff --git a/Example/Example_root.cpp b/Example/Example_root.cpp index ab4066d4..d0e71bed 100644 --- a/Example/Example_root.cpp +++ b/Example/Example_root.cpp @@ -68,21 +68,13 @@ int main(int argc, const char** argv){ std::string graph_name = "TotallyCoolSine"; std::string graph_draw_options = "ALP"; - // each time the same unique name is inserted, a new version of the plot is stored. - // when saving a new version over TCP we may optionally pass a pointer to an integer, - // which will be populated with the version number of the created entry. - int graph_db_ver=0; - // store it in the database - bool persistent=true; // TODO - // For now this setting only affects whether the request is sent over multicast (false, default) or tcp (true) - // At a later date we may add the option for plots to only be stored in a temporary table. - std::cout<<"Sending to database via TCP"< +#include +#include + +using namespace ToolFramework; + +std::string Check(int ok){ + return ok ? "\033[32mPASS" : "\033[31mFAIL"; +} + +const std::string Reset = "\033[39m"; + +int main(){ + + int verbose=1; + + std::string Interface_configfile = "./InterfaceConfig"; + + DAQInterface DAQ_inter(Interface_configfile); + //std::this_thread::sleep_for(std::chrono::seconds(2)); // sleep for a little longer, connecting is slow + std::string device_name = DAQ_inter.GetDeviceName(); + std::string tmp; + bool ok; + + if(verbose) std::cout<<"Testing logging..."< resps; + ok = DAQ_inter.SQLQuery("SELECT time, message FROM logging ORDER BY time DESC LIMIT 5",resps); + if(!ok || verbose) std::cout<<"multi-record SQL sent: "<& json_traces, const std::string& json_layout="{}", int* version=nullptr, unsigned int timestamp=0, unsigned int timeout=300); - bool GetPlotlyPlot(const std::string& name, int& version, std::string& json_trace, std::string& json_layout, unsigned int* timestamp=nullptr, unsigned int timeout=300); + bool SendLog(const std::string& message, unsigned int severity=9, const std::string& device="", const uint64_t timestamp=0); //serverity levels are 0 = critical, 1 = Error, 2 = warning, 3= info , 4-9 debug + bool SendAlarm(const std::string& message, unsigned int level=0, const std::string& device="", const uint64_t timestamp=0, const unsigned int timeout=default_timeout); + bool SendMonitoringData(const std::string& json_data, const std::string& subject, const std::string& device="", const uint64_t timestamp=0); + bool SendCalibrationData(const std::string& json_data, const std::string& description, const std::string& device="", const uint64_t timestamp=0, int* version=nullptr, const unsigned int timeout=default_timeout); + bool GetCalibrationData(std::string& json_data, int& version, const std::string& device="", const unsigned int timeout=default_timeout); + bool GetCalibrationData(std::string& json_data, int&& version=-1, const std::string& device="", const unsigned int timeout=default_timeout); + bool SendDeviceConfig(const std::string& json_data, const std::string& author, const std::string& description, const std::string& device="", const uint64_t timestamp=0, int* version=nullptr, const unsigned int timeout=default_timeout); + bool SendRunConfig(const std::string& json_data, const std::string& name, const std::string& author, const std::string& description, const uint64_t timestamp=0, int* version=nullptr, const unsigned int timeout=default_timeout); + bool GetDeviceConfig(std::string& json_data, const int version, const std::string& device="", const unsigned int timeout=default_timeout); + bool GetRunConfig(std::string& json_data, const int config_id, const unsigned int timeout=default_timeout); + bool GetRunConfig(std::string& json_data, const std::string& name, const int version, const unsigned int timeout=default_timeout); + bool GetDeviceConfigFromRunConfig(std::string& json_data, const int runconfig_id, const std::string& device="", const unsigned int timeout=default_timeout); + bool GetDeviceConfigFromRunConfig(std::string& json_data, const std::string& runconfig_name, const int runconfig_version, const std::string& device="", const unsigned int timeout=default_timeout); + bool SendROOTplot(const std::string& plot_name, const std::string& draw_options, const std::string& json_data, bool acknowledged=true, const uint64_t timestamp=0, const unsigned int lifetime=5, const unsigned int timeout=default_timeout); + bool SendROOTplotMulticast(const std::string& plot_name, const std::string& draw_options, const std::string& json_data, const unsigned int lifetime=5, const uint64_t timestamp=0); + bool SendROOTplotZmq(const std::string& plot_name, const std::string& draw_options, const std::string& json_data, int* version=nullptr, const uint64_t timestamp=0, const unsigned int lifetime=5, const unsigned int timeout=default_timeout); + bool GetROOTplot(const std::string& plot_name, std::string& draw_option, std::string& json_data, int& version, const unsigned int timeout=default_timeout); + bool GetROOTplot(const std::string& plot_name, std::string& draw_option, std::string& json_data, int&& version=-1, const unsigned int timeout=default_timeout); + bool SendPlotlyPlot(const std::string& name, const std::string& json_trace, const std::string& json_layout="{}", int* version=nullptr, const uint64_t timestamp=0, const unsigned int lifetime=5, unsigned int timeout=default_timeout); + bool SendPlotlyPlot(const std::string& name, const std::vector& json_traces, const std::string& json_layout="{}", int* version=nullptr, const uint64_t timestamp=0, const unsigned int lifetime=5, unsigned int timeout=default_timeout); + bool GetPlotlyPlot(const std::string& name, std::string& json_trace, std::string& json_layout, int& version, unsigned int timeout=default_timeout); + bool GetPlotlyPlot(const std::string& name, std::string& json_trace, std::string& json_layout, int&& version=-1, unsigned int timeout=default_timeout); SlowControlCollection* GetSlowControlCollection(); SlowControlElement* GetSlowControlVariable(std::string key); @@ -73,8 +80,6 @@ namespace ToolFramework { zmq::context_t* m_context=nullptr; ServiceDiscovery* mp_SD; Store vars; - // ServicesBackend m_backend_client; - // std::string m_dbname; std::string m_name; diff --git a/scripts/Python/Install.sh b/scripts/Python/Install.sh index 7813c94a..8e743764 100755 --- a/scripts/Python/Install.sh +++ b/scripts/Python/Install.sh @@ -1,6 +1,6 @@ #!/bin/bash -set -x -#set -e +#set -x +#set -e # we can't set this as some commands may be expected to fail # a function to check for presence of cppyy. New ROOT versions come with it. # XXX for some reason this doesn't like the use of tab for whitespace!!! XXX @@ -23,7 +23,11 @@ for m in v: print(m, end=' ') RESULT="$(echo -n ${RESULT} | xargs echo -n)" echo $RESULT | sed 's/ /·/g;s/\t/→/g;s/\r/§/g;s/$/¶/g' # check whitespace if [ "$RESULT" != "0 1 2 3 4 5 6 7 8 9" ]; then - echo "Test Failed! Check your installation of python3 and cppyy!" + if [ "$1" != "q" ]; then + echo "Test Failed! Check your installation of python3 and cppyy!" + else + echo "cppyy not found" + fi return 1 else echo "Test Passed" @@ -32,7 +36,7 @@ for m in v: print(m, end=' ') } echo "checking for pre-existing presence of cppyy" -checkcppyy +checkcppyy "q" if [ $? -eq 0 ]; then # if we already have it, we have nothing to do.... # TODO the PythonScript c++ interface may require at least python3-devel as well...? @@ -43,7 +47,7 @@ fi CURDIR=${PWD} # in case we need to return to it. unused. cd "$( dirname "${BASH_SOURCE[0]}" )" -# first argument is installation destination +# first argument if given is installation destination: INSTALLDIR="/opt" if [ $# -gt 0 ]; then INSTALLDIR="$1" @@ -58,14 +62,14 @@ fi # first determine what kind of OS we're on. REDHATLIKE=$(yum --version >/dev/null 2>&1; echo $?) DEBIANLIKE=$(dpkg --version >/dev/null 2>&1; echo $?) -NEEDDEPS="" +unset NEEDDEPS if [ ${REDHATLIKE} -eq 0 ]; then echo "red-hat based OS" # red-hat based OS. # trigger yum to update its metadata echo "updating yum metadata..." yum list installed >/dev/null 2>&1 - DEPS=(gcc-c++ gcc make cmake git python3 python3-libs python3-devel python3-pip patch which) + DEPS=(wget git make gcc-c++ gcc binutils libX11-devel libXpm-devel libXft-devel libXext-devel python3 python3-devel openssl-devel fftw-devel libuuid-devel) for DEP in "${DEPS[@]}"; do echo "looking for ${DEP}..." # this is probably not a great check as 'grep' could match on anything @@ -75,7 +79,7 @@ if [ ${REDHATLIKE} -eq 0 ]; then GOTDEP=$(yum list installed 2>/dev/null | grep "${DEP}" >/dev/null 2>&1; echo $?) if [ ${GOTDEP} -ne 0 ]; then echo "not found" - NEEDDEPS="${NEEDDEPS} ${DEP}" + NEEDDEPS=( ${NEEDDEPS} ${DEP} ) fi done elif [ ${DEBIANLIKE} -eq 0 ]; then @@ -87,7 +91,7 @@ elif [ ${DEBIANLIKE} -eq 0 ]; then GOTDEP=$(dpkg --list | grep "${DEP}" >/dev/null 2>&1; echo $?) if [ ${GOTDEP} -ne 0 ]; then echo "not found" - NEEDDEPS="${NEEDDEPS} ${DEP}" + NEEDDEPS=( ${NEEDDEPS} ${DEP} ) fi done else @@ -104,7 +108,7 @@ else exit 1; else echo "Attempting installation assuming dependencies are installed"; - NEEDDEPS="" + unset NEEDDEPS break; fi else @@ -146,7 +150,7 @@ else exit 1; else echo "Attempting installation assuming dependencies are installed" - NEEDDEPS="" + unset NEEDDEPS break; fi else @@ -157,7 +161,9 @@ else else echo "Installing dependencies..." if [ ${REDHATLIKE} -eq 0 ]; then - yum install -y ${NEEDDEPS} + for DEP in "${NEEDDEPS[@]}"; do echo "${DEP}"; + yum install -y ${DEP} + done INSTALLOK=$? elif [ ${DEBIANLIKE} -eq 0 ]; then apt-get install -y ${NEEDDEPS} diff --git a/scripts/Python/Install_root.sh b/scripts/Python/Install_root.sh index 21a5df88..208d6f0f 100755 --- a/scripts/Python/Install_root.sh +++ b/scripts/Python/Install_root.sh @@ -69,7 +69,7 @@ if [ ${REDHATLIKE} -eq 0 ]; then # trigger yum to update its metadata echo "updating yum metadata..." yum list installed >/dev/null 2>&1 - DEPS=(wget git make gcc-c++ gcc binutils libX11-devel libXpm-devel libXft-devel libXext-devel python3 python3-devel openssl-devel fftw-devel libuuid-devel) + DEPS=(wget git make gcc-c++ gcc binutils libX11-devel libXpm-devel libXft-devel libXext-devel python3 python3-devel openssl-devel fftw-devel libuuid-devel patch) # centos7 requires cmake3 from epel RHVER=$(grep "VERSION_ID" /etc/os-release | cut -d\" -f2) RHOLD=$(echo -e "8\n${RHVER}" | sort -V -C; echo $?) @@ -118,7 +118,7 @@ else exit 1; else echo "Attempting installation assuming dependencies are installed"; - NEEDDEPS="" + unset NEEDDEPS break; fi else @@ -148,11 +148,11 @@ if [ $(which g++ &> /dev/null; echo $?) -eq 0 ]; then fi fi -if [ -z "${NEEDDEPS}" ]; then +if [ -z "${NEEDDEPS[*]}" ]; then echo "All system dependencies satisfied, continuing" else echo "The following system dependencies were not found on your system" - echo "${NEEDDEPS}" + echo "${NEEDDEPS[*]}" # if we're run as root, offer to install them if [ "$(whoami)" == "root" ]; then echo "Install these packages?" @@ -236,8 +236,8 @@ rm -f root_v${ROOTVER}.source.tar.gz mkdir root_v${ROOTVER} # install dir mkdir rootbuild # build dir (temporary) cd rootbuild -cmake3 ../root-${ROOTVER} -Dpyroot=ON -Dasimage=ON -Dgdml=ON -Dxml=ON -Dmt=ON -Dmathmore=ON -Dx11=ON -Dimt=ON -Dtmva=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -Dpythia6=ON -Dfftw3=ON -DCMAKE_INSTALL_PREFIX=${INSTALLDIR}/root_v${ROOTVER} #-DCMAKE_CXX_STANDARD=14 -#-Dgminimal=ON +#cmake3 ../root-${ROOTVER} -Dpyroot=ON -Dasimage=ON -Dgdml=ON -Dxml=ON -Dmt=ON -Dmathmore=ON -Dx11=ON -Dimt=ON -Dtmva=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -Dpythia6=ON -Dfftw3=ON -DCMAKE_INSTALL_PREFIX=${INSTALLDIR}/root_v${ROOTVER} #-DCMAKE_CXX_STANDARD=14 +cmake3 ../root-${ROOTVER} -Dgminimal=ON -Dpyroot=ON -Dxrootd=OFF -Dbuiltin_xrootd=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=${INSTALLDIR}/root_v${ROOTVER} -DCMAKE_CXX_STANDARD=20 make -j$(nproc) make install cd ../ diff --git a/src/DAQInterface.cpp b/src/DAQInterface.cpp index 497138c4..50b6f216 100644 --- a/src/DAQInterface.cpp +++ b/src/DAQInterface.cpp @@ -41,25 +41,25 @@ DAQInterface::~DAQInterface(){ // Write Functions // --------------- -bool DAQInterface::SendAlarm(const std::string& message, unsigned int level, const std::string& device, int64_t timestamp, const unsigned int timeout){ +bool DAQInterface::SendAlarm(const std::string& message, unsigned int level, const std::string& device, const uint64_t timestamp, const unsigned int timeout){ return m_services->SendAlarm(message, level, device, timestamp, timeout); } -bool DAQInterface::SendCalibrationData(const std::string& json_data, const std::string& description, const std::string& device, int64_t timestamp, int* version, const unsigned int timeout){ +bool DAQInterface::SendCalibrationData(const std::string& json_data, const std::string& description, const std::string& device, const uint64_t timestamp, int* version, const unsigned int timeout){ return m_services->SendCalibrationData(json_data, description, device, timestamp, version, timeout); } -bool DAQInterface::SendDeviceConfig(const std::string& json_data, const std::string& author, const std::string& description, const std::string& device, int64_t timestamp, int* version, const unsigned int timeout){ +bool DAQInterface::SendDeviceConfig(const std::string& json_data, const std::string& author, const std::string& description, const std::string& device, const uint64_t timestamp, int* version, const unsigned int timeout){ return m_services->SendDeviceConfig(json_data, author, description, device, timestamp, version, timeout); } -bool DAQInterface::SendRunConfig(const std::string& json_data, const std::string& name, const std::string& author, const std::string& description, int64_t timestamp, int* version, const unsigned int timeout){ +bool DAQInterface::SendRunConfig(const std::string& json_data, const std::string& name, const std::string& author, const std::string& description, const uint64_t timestamp, int* version, const unsigned int timeout){ return m_services->SendRunConfig(json_data, name, author, description, timestamp, version, timeout); @@ -69,12 +69,18 @@ bool DAQInterface::SendRunConfig(const std::string& json_data, const std::string // Read Functions // -------------- -bool DAQInterface::GetCalibrationData(std::string& json_data, int version, const std::string& device, const unsigned int timeout){ +bool DAQInterface::GetCalibrationData(std::string& json_data, int& version, const std::string& device, const unsigned int timeout){ return m_services->GetCalibrationData(json_data, version, device, timeout); } +bool DAQInterface::GetCalibrationData(std::string& json_data, int&& version, const std::string& device, const unsigned int timeout){ + + return m_services->GetCalibrationData(json_data, version, device, timeout); + +} + bool DAQInterface::GetDeviceConfig(std::string& json_data, int version, const std::string& device, const unsigned int timeout){ return m_services->GetDeviceConfig(json_data, version, device, timeout); @@ -105,34 +111,46 @@ bool DAQInterface::GetDeviceConfigFromRunConfig(std::string& json_data, const st } -bool DAQInterface::GetROOTplot(const std::string& plot_name, int& version, std::string& draw_options, std::string& json_data, std::string* timestamp, const unsigned int timeout){ +bool DAQInterface::GetROOTplot(const std::string& plot_name, std::string& draw_options, std::string& json_data, int& version, const unsigned int timeout){ + + return m_services->GetROOTplot(plot_name, draw_options, json_data, version, timeout); + +} + +bool DAQInterface::GetROOTplot(const std::string& plot_name, std::string& draw_options, std::string& json_data, int&& version, const unsigned int timeout){ + return m_services->GetROOTplot(plot_name, draw_options, json_data, version, timeout); - return m_services->GetROOTplot(plot_name, version, draw_options, json_data, timestamp, timeout); +} + +bool DAQInterface::GetPlotlyPlot(const std::string& name, std::string& trace, std::string& layout, int& version, unsigned int timeout) { + + return m_services->GetPlotlyPlot(name, trace, layout, version, timeout); } -bool DAQInterface::GetPlotlyPlot(const std::string& name, int& version, std::string& trace, std::string& layout, unsigned int* timestamp, unsigned int timeout) { +bool DAQInterface::GetPlotlyPlot(const std::string& name, std::string& trace, std::string& layout, int&& version, unsigned int timeout) { - return m_services->GetPlotlyPlot(name, version, trace, layout, timestamp, timeout); + return m_services->GetPlotlyPlot(name, trace, layout, version, timeout); + } -bool DAQInterface::SQLQuery(const std::string& database, const std::string& query, std::vector& responses, const unsigned int timeout){ +bool DAQInterface::SQLQuery(/*const std::string& database,*/ const std::string& query, std::vector& responses, const unsigned int timeout){ - return m_services->SQLQuery(database, query, responses, timeout); + return m_services->SQLQuery(/*database,*/ query, responses, timeout); } -bool DAQInterface::SQLQuery(const std::string& database, const std::string& query, std::string& response, const unsigned int timeout){ +bool DAQInterface::SQLQuery(/*const std::string& database,*/ const std::string& query, std::string& response, const unsigned int timeout){ - return m_services->SQLQuery(database, query, response, timeout); + return m_services->SQLQuery(/*database,*/ query, response, timeout); } -bool DAQInterface::SQLQuery(const std::string& database, const std::string& query, const unsigned int timeout){ +bool DAQInterface::SQLQuery(/*const std::string& database,*/ const std::string& query, const unsigned int timeout){ - return m_services->SQLQuery(database, query, timeout); + return m_services->SQLQuery(/*database,*/ query, timeout); } @@ -140,45 +158,45 @@ bool DAQInterface::SQLQuery(const std::string& database, const std::string& quer // Multicast Senders // ----------------- -bool DAQInterface::SendLog(const std::string& message, unsigned int severity, const std::string& device, int64_t timestamp){ +bool DAQInterface::SendLog(const std::string& message, unsigned int severity, const std::string& device, const uint64_t timestamp){ return m_services->SendLog(message, severity, device, timestamp); } -bool DAQInterface::SendMonitoringData(const std::string& json_data, const std::string& subject, const std::string& device, int64_t timestamp){ - +bool DAQInterface::SendMonitoringData(const std::string& json_data, const std::string& subject, const std::string& device, const uint64_t timestamp){ return m_services->SendMonitoringData(json_data, subject, device, timestamp); } -// wrapper to send a root plot either to a temporary table or a persistent one -bool DAQInterface::SendROOTplot(const std::string& plot_name, const std::string& draw_options, const std::string& json_data, bool persistent, int* version, const int64_t timestamp, const unsigned int timeout){ - if(!persistent) return SendTemporaryROOTplot(plot_name, draw_options, json_data, version, timestamp); - return SendPersistentROOTplot(plot_name, draw_options, json_data, version, timestamp, timeout); +// wrapper to send a root plot either over multicast or zmq +bool DAQInterface::SendROOTplot(const std::string& plot_name, const std::string& draw_options, const std::string& json_data, bool acknowledged, const uint64_t timestamp, const unsigned int lifetime, const unsigned int timeout){ + if(!acknowledged) return SendROOTplotMulticast(plot_name, draw_options, json_data, lifetime, timestamp); + return SendROOTplotZmq(plot_name, draw_options, json_data, nullptr, timestamp, lifetime, timeout); } -// send to persistent table over TCP -bool DAQInterface::SendPersistentROOTplot(const std::string& plot_name, const std::string& draw_options, const std::string& json_data, int* version, const int64_t timestamp, const unsigned int timeout){ +// send over zmq +bool DAQInterface::SendROOTplotZmq(const std::string& plot_name, const std::string& draw_options, const std::string& json_data, int* version, const uint64_t timestamp, const unsigned int lifetime, const unsigned int timeout){ - return m_services->SendPersistentROOTplot(plot_name, draw_options, json_data, version, timestamp, timeout); + return m_services->SendROOTplotZmq(plot_name, draw_options, json_data, version, timestamp, lifetime, timeout); } -// send to temporary table over multicast -bool DAQInterface::SendTemporaryROOTplot(const std::string& plot_name, const std::string& draw_options, const std::string& json_data, int* version, const int64_t timestamp){ +// send over multicast +bool DAQInterface::SendROOTplotMulticast(const std::string& plot_name, const std::string& draw_options, const std::string& json_data, const unsigned int lifetime, const uint64_t timestamp){ - return m_services->SendTemporaryROOTplot(plot_name, draw_options, json_data, version, timestamp); + return m_services->SendROOTplotMulticast(plot_name, draw_options, json_data, lifetime, timestamp); } -bool DAQInterface::SendPlotlyPlot(const std::string& name, const std::string& trace, const std::string& layout, int* version, unsigned int timestamp, unsigned int timeout) { - return m_services->SendPlotlyPlot(name, trace, layout, version, timestamp, timeout); +// FIXME for now plotlyplots always go over zmq +bool DAQInterface::SendPlotlyPlot(const std::string& name, const std::string& trace, const std::string& layout, int* version, const uint64_t timestamp, const unsigned int lifetime, unsigned int timeout) { + return m_services->SendPlotlyPlot(name, trace, layout, version, timestamp, lifetime, timeout); } -bool DAQInterface::SendPlotlyPlot(const std::string& name, const std::vector& traces, const std::string& layout, int* version, unsigned int timestamp, unsigned int timeout) { - return m_services->SendPlotlyPlot(name, traces, layout, version, timestamp, timeout); +bool DAQInterface::SendPlotlyPlot(const std::string& name, const std::vector& traces, const std::string& layout, int* version, const uint64_t timestamp, const unsigned int lifetime, unsigned int timeout) { + return m_services->SendPlotlyPlot(name, traces, layout, version, timestamp, lifetime, timeout); } // ===========================================================================