62 in >> index >>
static_cast<std::string&
>(source);
114 if (in >> index >> hostname) {
120 target.setTcpNoDelay (
true);
121 target.setReuseAddress(
true);
122 target.setKeepAlive (
true);
123 target.setReceiveBufferSize(1024);
124 target.setSendBufferSize (1024*1024);
125 target.setNonBlocking (
false);
148 out <<
"TCP no-delay " <<
target.getTcpNoDelay() <<
endl;
149 out <<
"Reuse address " <<
target.getReuseAddress() <<
endl;
150 out <<
"Keep alive " <<
target.getKeepAlive() <<
endl;
151 out <<
"Receive buffer " <<
target.getReceiveBufferSize() <<
endl;
152 out <<
"Send buffer " <<
target.getSendBufferSize() <<
endl;
153 out <<
"Non blocking " <<
target.getNonBlocking() <<
endl;
181 const std::string&
server,
204 properties[
"source"] =
source;
205 properties[
"target"] =
target;
206 properties[
"snooze"] =
snooze;
207 properties[
"inputFile"] = inputFile;
208 properties[
"numberOfEvents"] = numberOfEvents;
210 properties[
"probability"] = P;
212 properties.
read(
string(buffer, length));
231 for (map_type::const_iterator i =
snooze.begin(); i !=
snooze.end(); ++i) {
232 os <<
' ' <<
setw(8) << i->first <<
" [" <<
FILL(6,
'0') << i->second.getLowerLimit() <<
"," <<
FILL(6,
'0') << i->second.getUpperLimit() <<
"]";
243 if (index <
source.size()) {
245 while (inputFile.hasNext()) {
249 int i1 = (timeslice->size() * (index + 0)) /
source.size();
250 int i2 = (timeslice->size() * (index + 1)) /
source.size();
256 for (
int i =
i1; i !=
i2; ++i) {
273 JDebugStream(
logger) <<
"Processing timeslice: " << inputFile.getCounter() <<
" [" <<
i1 <<
"," <<
i2 <<
"]";
277 for (
int i =
i1; i !=
i2; ++i) {
278 data.rbegin()->at(i -
i1) << timeslice->at(i);
305 virtual void actionQuit(
int length,
const char* buffer)
override
325 virtual void actionStop(
int length,
const char* buffer)
override
350 if (
snooze.count(header.getModuleID()) == 0 || !
snooze[header.getModuleID()](header.getFrameIndex())) {
405 for (
iterator timeslice = begin(); timeslice != end(); ++timeslice) {
442 if (
page != end() && ++
page == end()) {
446 for (
iterator timeslice = begin(); timeslice != end(); ++timeslice) {
514 JParser<> zap(
"Program for real-time simulation of data queue.");
524 catch(
const exception &error) {
KM3NeT DAQ constants, bit handling, etc.
int main(int argc, char *argv[])
Definition of random value generator.
Scanning of objects from multiple files according a format that follows from the extension of each fi...
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Utility class to parse parameter values.
Auxiliary class to define a range between two values.
Base class for interprocess communication.
ROOT TTree parameter settings of various packages.
Scheduling of actions via fixed latency intervals.
int getRunNumber() const
Get run number.
JDAQStateMachine::ev_configure_event ev_configure
Utility class to parse parameter values.
bool read(const JEquation &equation)
Read equation.
Auxiliary class for CPU timing and usage.
unsigned long long usec_wall
void seekg(const int pos)
Set read position.
Byte array binary output.
Simple data structure to support I/O of equations (see class JLANG::JEquation).
Message logging based on ControlHost.
Interface for logging messages.
Message logging based on std::ostream.
Template definition of a multi-dimensional oscillation probability interpolation table.
JWriter & write(JWriter &out) const override final
Write from input.
std::vector< value_type >::const_iterator const_iterator
std::vector< value_type >::iterator iterator
void setFrameIndex(const int frame_index)
Set frame index.
void setRunNumber(const int run)
Set run number.
Control unit client base class.
JSharedPointer< JControlHost > server
message server
void replaceEvent(const JTag &oldTag, const JTag &newTag, JDAQEvent_t &event)
Replace tag of given event in event table.
JMessageLogger logger
message logger
const_iterator end() const
const_iterator begin() const
Data frame of one optical module.
Data structure for UTC time.
void reset()
Reset internal iterator to begin.
JData()
Default constructor.
JData::const_iterator page
void setRunNumber(int run_number)
Set run number.
void next()
Increment internal iterator.
const_iterator operator->()
Smart pointer operator.
Runcontrol client to simulate data queue.
long long int numberOfBytes
std::vector< JFrame > JTimeslice
virtual void actionConfigure(int length, const char *buffer) override
virtual void actionStart(int length, const char *buffer) override
virtual void actionRunning() override
This method is repeatedly called when this client machine is in state Running and the clock interval ...
virtual void actionStop(int length, const char *buffer) override
std::vector< JTarget > target
JIO::JByteArrayWriter JFrame
Memory management for sending of raw data.
virtual void actionReset(int length, const char *buffer) override
virtual void actionQuit(int length, const char *buffer) override
JDQSimulator(const std::string &name, const std::string &server, JLogger *logger, const int level)
Constructor.
long long int numberOfSlices
std::vector< JSource > source
Data structure for configuration of JDQSimulator.
JSource()
Default constructor.
friend std::istream & operator>>(std::istream &in, JSource &source)
Read JSource from input stream.
friend std::ostream & operator<<(std::ostream &out, const JSource &source)
Write JSource to output stream.
Data structure for configuration of JDataFilter.
friend std::istream & operator>>(std::istream &in, JTarget &target)
Read JTarget from input stream.
friend std::ostream & operator<<(std::ostream &out, const JTarget &target)
Write JTarget to output stream.
JTarget()
Default constructor.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
const char * getName()
Get ROOT name of given data type.
KM3NeT DAQ data structures and auxiliaries.
double getFrameTime()
Get frame time duration.
double getTimeOfFrame(const int frame_index)
Get start time of frame in ns since start of run for a given frame index.
static const JNET::JTag RC_CMD
std::map< int, range_type > map_type
static const JNET::JTag RC_DQSIMULATOR
Auxiliary data structure for sequence of same character.
Level specific message streamers.
Auxiliary data structure for hostname and port number.
void setClockInterval(const long long int interval_us)
Set interval time.
long long int getClockDelay() const
Get total delay time.
void resetClock()
Reset clock.