15#include <condition_variable>
86 [[nodiscard]]
bool checkFlag(
RecvFlag flag)
const noexcept {
return _flags &
static_cast<int>(flag); }
157 [[nodiscard]]
bool isActive() const noexcept {
return _is_active; }
163 void setActive(
const bool active)
noexcept { _is_active = active; }
169 std::vector<std::unique_ptr<serial::Response>>
drainInbox() noexcept;
228 [[nodiscard]]
const std::vector<ComplexType>&
getCwData()
const {
return _cw_iq_data; }
242 return _pulsed_interference_log;
249 void setSchedule(std::vector<SchedulePeriod> schedule);
255 [[nodiscard]]
const std::vector<SchedulePeriod>&
getSchedule() const noexcept {
return _schedule; }
267 bool _is_active =
false;
272 std::vector<SchedulePeriod> _schedule;
278 std::vector<std::unique_ptr<serial::Response>>
280 std::mutex _inbox_mutex;
281 std::queue<core::RenderingJob> _finalizer_queue;
282 std::mutex _finalizer_queue_mutex;
283 std::condition_variable _finalizer_queue_cv;
286 std::vector<std::unique_ptr<serial::Response>>
287 _pulsed_interference_log;
288 std::mutex _interference_log_mutex;
289 std::vector<ComplexType> _cw_iq_data;
290 std::mutex _cw_mutex;
A class representing a vector in spherical coordinates.
Represents a radar system on a platform.
Manages radar signal reception and response processing.
void addInterferenceToLog(std::unique_ptr< serial::Response > response) noexcept
Adds a pulsed interference response to the receiver's CW-mode log.
void setCwSample(size_t index, ComplexType sample)
Sets a single IQ sample at a specific index for CW simulation.
std::mt19937 & getRngEngine() noexcept
Gets the receiver's internal random number generator engine.
void setActive(const bool active) noexcept
Sets the active state of the receiver.
bool checkFlag(RecvFlag flag) const noexcept
Checks if a specific flag is set.
std::vector< std::unique_ptr< serial::Response > > drainInbox() noexcept
Moves all responses from the inbox into a RenderingJob.
void setFlag(RecvFlag flag) noexcept
Sets a receiver flag.
const std::vector< SchedulePeriod > & getSchedule() const noexcept
Retrieves the list of active reception periods.
~Receiver() override=default
bool isActive() const noexcept
Checks if the receiver is currently active (listening).
unsigned getWindowCount() const noexcept
Gets the number of radar windows.
Receiver & operator=(Receiver &&)=delete
RealType getWindowStart(unsigned window) const
Retrieves the start time of a specific radar window.
std::optional< RealType > getNextWindowTime(RealType time) const
Determines the next valid window start time at or after the given time.
RecvFlag
Enumeration for receiver configuration flags.
void prepareCwData(size_t numSamples)
Prepares the internal storage for CW IQ data.
std::vector< ComplexType > & getMutableCwData()
Retrieves the collected CW IQ data for modification.
const std::vector< std::unique_ptr< serial::Response > > & getPulsedInterferenceLog() const
Retrieves the log of pulsed interferences for CW mode.
void setSchedule(std::vector< SchedulePeriod > schedule)
Sets the active schedule for the receiver.
void enqueueFinalizerJob(core::RenderingJob &&job)
Adds a completed RenderingJob to the finalizer queue.
Receiver & operator=(const Receiver &)=delete
RealType getNoiseTemperature() const noexcept
Retrieves the noise temperature of the receiver.
OperationMode getMode() const noexcept
Gets the operational mode of the receiver.
RealType getWindowPrf() const noexcept
Retrieves the pulse repetition frequency (PRF) of the radar window.
bool waitAndDequeueFinalizerJob(core::RenderingJob &job)
Waits for and dequeues a RenderingJob from the finalizer queue.
RealType getWindowSkip() const noexcept
Retrieves the window skip time.
void setWindowProperties(RealType length, RealType prf, RealType skip) noexcept
Sets the properties for radar windows.
void addResponseToInbox(std::unique_ptr< serial::Response > response) noexcept
Adds a response to the receiver's pulsed-mode inbox.
const std::vector< ComplexType > & getCwData() const
Retrieves the collected CW IQ data.
Receiver(const Receiver &)=delete
void setNoiseTemperature(RealType temp)
Sets the noise temperature of the receiver.
RealType getWindowLength() const noexcept
Retrieves the radar window length.
Receiver(Receiver &&)=delete
double RealType
Type for real numbers.
std::complex< RealType > ComplexType
Type for complex numbers.
OperationMode
Defines the operational mode of a radar component.
Defines the Radar class and associated functionality.
Defines the data packet for asynchronous receiver finalization.
Classes for managing radar signal responses.