Mantid
Loading...
Searching...
No Matches
ILiveListener.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2012 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
9//----------------------------------------------------------------------
10// Includes
11//----------------------------------------------------------------------
12#include "MantidAPI/DllConfig.h"
16#include <Poco/Net/SocketAddress.h>
17#include <string>
18
19namespace Mantid {
20namespace API {
21//----------------------------------------------------------------------
22// Forward declaration
23//----------------------------------------------------------------------
24class Workspace;
25
31class MANTID_API_DLL ILiveListener : public Kernel::PropertyManager {
32public:
33 //----------------------------------------------------------------------
34 // Static properties
35 //----------------------------------------------------------------------
36
38 virtual std::string name() const = 0;
40 virtual bool supportsHistory() const = 0;
42 virtual bool buffersEvents() const = 0;
43
44 //----------------------------------------------------------------------
45 // Actions
46 //----------------------------------------------------------------------
47
52 virtual bool connect(const Poco::Net::SocketAddress &address) = 0;
53
68 virtual void start(Types::Core::DateAndTime startTime = Types::Core::DateAndTime()) = 0;
69
85 virtual std::shared_ptr<Workspace> extractData() = 0;
86
87 //----------------------------------------------------------------------
88 // State information
89 //----------------------------------------------------------------------
90
94 virtual bool isConnected() = 0;
95
105 virtual bool dataReset() = 0;
106
113 enum RunStatus { NoRun = 0, BeginRun = 1, Running = 2, EndRun = 4 };
114
119
121 virtual int runNumber() const = 0;
122
126 virtual void setSpectra(const std::vector<specnum_t> &specList) = 0;
127
131 virtual void setAlgorithm(const class IAlgorithm &callingAlgorithm) = 0;
132};
133
135using ILiveListener_sptr = std::shared_ptr<ILiveListener>;
136
137} // namespace API
138} // namespace Mantid
IAlgorithm is the interface implemented by the Algorithm base class.
Definition: IAlgorithm.h:45
ILiveListener is the interface implemented by classes which connect directly to instrument data acqui...
Definition: ILiveListener.h:31
virtual bool supportsHistory() const =0
Does this listener support requests for (recent) past data.
RunStatus
The possible run statuses (initial list taken from SNS SMS protocol) None : No current run Begin : A ...
virtual ILiveListener::RunStatus runStatus()=0
Gets the current run status of the listened-to data stream.
virtual std::string name() const =0
The name of this listener.
virtual bool connect(const Poco::Net::SocketAddress &address)=0
Connect to the specified address and start listening/buffering.
virtual int runNumber() const =0
Returns the run number of the current run.
virtual void setSpectra(const std::vector< specnum_t > &specList)=0
Sets a list of spectra to be extracted.
virtual std::shared_ptr< Workspace > extractData()=0
Get the data that's been buffered since the last call to this method (or since start() was called).
virtual bool buffersEvents() const =0
Does this listener buffer events (true) or histogram data (false)
virtual void start(Types::Core::DateAndTime startTime=Types::Core::DateAndTime())=0
Commence the collection of data from the DAS.
virtual bool isConnected()=0
Has the connection to the DAS been established? Could also be used to check for a continued connectio...
virtual bool dataReset()=0
Indicates that a reset (or period change?) signal has been received from the DAS.
virtual void setAlgorithm(const class IAlgorithm &callingAlgorithm)=0
Allow listener to see calling algorithm.
Property manager helper class.
std::shared_ptr< ILiveListener > ILiveListener_sptr
Shared pointer to an ILiveListener.
Helper class which provides the Collimation Length for SANS instruments.