RMM API 2.0.0
Loading...
Searching...
No Matches
RMMSideChannels.h
1#pragma once
2
3#include <iostream>
4#include <json.hpp>
5#include <string>
6
7#include "RMMRegisterAccess.h"
8#include "RMMUtils.h"
9using json = nlohmann::json;
10
15 bool enabled;
16 std::string dataFormat;
17 uint32_t fibre;
18 uint32_t node;
19 std::string type;
20 uint32_t channel;
21 uint32_t xPosition;
22 uint32_t yPosition;
23 uint32_t extraWord;
24};
25
30 double frequency;
31 bool overflow;
32};
33
38using SideChannelStatsData = std::map<uint8_t, SideChannelStats>;
39
44using SideChannelsMap = std::map<uint8_t, SideChannelsData>;
45
54 public:
61 rmmStatus fillSideChannelsfromJson(json& settings);
62 rmmStatus configSideChannels();
63 rmmStatus getSideChannelStats(SideChannelStatsData& stats);
64 rmmStatus fetchSideChannelData(uint8_t sideChIdx, SideChannelsData& data);
65
66 private:
67 RMMRegisterAccess& RMMRegs;
68 SideChannelsMap sideChannels;
69 rmmStatus configSideChannel(uint8_t id, SideChannelsData settings);
70 rmmStatus toggleSideChannel(uint8_t id, bool enableDisable);
71};
Class for managing and writing log messages to different log levels and files.
Definition RMMLog.h:47
Class to handle register access over the ESS Readout Master Module.
Definition RMMRegisterAccess.h:57
rmmStatus fetchSideChannelData(uint8_t sideChIdx, SideChannelsData &data)
Fetches and populates the data for a specific side channel.
Definition RMMSideChannels.cpp:232
rmmStatus fillSideChannelsfromJson(json &settings)
Populates side channel configurations from a JSON object.
Definition RMMSideChannels.cpp:35
RMMSideChannels(RMMRegisterAccess &RMMRegs)
Constructor for the RMMSideChannels class.
Definition RMMSideChannels.cpp:20
RMMLog rmmLog
Log handler for RMMSideChannel messages.
Definition RMMSideChannels.h:60
rmmStatus configSideChannels()
Configures all side channels based on stored settings.
Definition RMMSideChannels.cpp:88
rmmStatus getSideChannelStats(SideChannelStatsData &stats)
Retrieves statistics for the side channels.
Definition RMMSideChannels.cpp:202
struct to store the measured frequency and overflow status of a side channel.
Definition RMMSideChannels.h:29
bool overflow
Indicates if the side channel buffers have overflowed.
Definition RMMSideChannels.h:31
double frequency
Measured frequency of the side channel in Hz.
Definition RMMSideChannels.h:30
Struct to hold parameters that define how side channels generate and format data.
Definition RMMSideChannels.h:14
uint32_t fibre
Dummy Fibre ID included in each side channel data packet (range: 0-25).
Definition RMMSideChannels.h:17
uint32_t node
Dummy Node ID included in each side channel data packet (range: 0-30).
Definition RMMSideChannels.h:18
uint32_t channel
Beam Monitor Channel ID (range: 0-255).
Definition RMMSideChannels.h:20
uint32_t extraWord
Optional 32-bit value added to the payload.
Definition RMMSideChannels.h:23
uint32_t yPosition
Y position for 2D Beam Monitors (range: 0-65535).
Definition RMMSideChannels.h:22
std::string dataFormat
Data format for side channel packets (e.g., "minimal", "ess_beam_monitor").
Definition RMMSideChannels.h:16
std::string type
Beam Monitor Type (e.g., "ttl").
Definition RMMSideChannels.h:19
bool enabled
Whether the side channel generates data when pulses on the LEMO are connected.
Definition RMMSideChannels.h:15
uint32_t xPosition
X position for 1D Beam Monitors (range: 0-65535).
Definition RMMSideChannels.h:21