FERS 1.0.0
The Flexible Extensible Radar Simulator
Loading...
Searching...
No Matches
radar::Transmitter Class Referencefinal

Represents a radar transmitter system. More...

#include "transmitter.h"

+ Inheritance diagram for radar::Transmitter:
+ Collaboration diagram for radar::Transmitter:

Public Member Functions

 Transmitter (Platform *platform, std::string name, const OperationMode mode) noexcept
 Constructor for the Transmitter class.
 
 ~Transmitter () override=default
 
 Transmitter (const Transmitter &)=delete
 
Transmitteroperator= (const Transmitter &)=delete
 
 Transmitter (Transmitter &&)=delete
 
Transmitteroperator= (Transmitter &&)=delete
 
RealType getPrf () const noexcept
 Retrieves the pulse repetition frequency (PRF).
 
fers_signal::RadarSignalgetSignal () const noexcept
 Retrieves the radar signal currently being transmitted.
 
OperationMode getMode () const noexcept
 Gets the operational mode of the transmitter.
 
void setWave (fers_signal::RadarSignal *pulse) noexcept
 Sets the radar signal wave to be transmitted.
 
void setSignal (fers_signal::RadarSignal *signal) noexcept
 Sets the radar signal wave to be transmitted.
 
void setPrf (RealType mprf) noexcept
 Sets the pulse repetition frequency (PRF) of the transmitter.
 
void setSchedule (std::vector< SchedulePeriod > schedule)
 Sets the active schedule for the transmitter.
 
const std::vector< SchedulePeriod > & getSchedule () const noexcept
 Retrieves the list of active transmission periods.
 
std::optional< RealTypegetNextPulseTime (RealType time) const
 Determines the valid simulation time for a pulse at or after the given time.
 
const RadargetAttached () const noexcept
 Retrieves the attached radar object.
 
const antenna::AntennagetAntenna () const noexcept
 Gets the antenna associated with this radar.
 
RealType getGain (const math::SVec3 &angle, const math::SVec3 &refangle, RealType wavelength) const
 Calculates the radar gain based on input angles and wavelength.
 
virtual RealType getNoiseTemperature (const math::SVec3 &angle) const noexcept
 Gets the noise temperature of the radar.
 
std::shared_ptr< timing::TiminggetTiming () const
 Retrieves the timing source for the radar.
 
void setTiming (const std::shared_ptr< timing::Timing > &tim)
 Sets the timing source for the radar.
 
void setAntenna (const antenna::Antenna *ant)
 Sets the antenna for the radar.
 
void setAttached (const Radar *obj)
 Attaches another radar object to this radar.
 
math::Vec3 getPosition (const RealType time) const
 Retrieves the position of the object.
 
math::SVec3 getRotation (const RealType time) const
 Retrieves the rotation of the object.
 
PlatformgetPlatform () const noexcept
 Retrieves the associated platform of the object.
 
const std::string & getName () const noexcept
 Retrieves the name of the object.
 

Protected Attributes

std::shared_ptr< timing::Timing_timing
 Timing source for the radar.
 

Detailed Description

Represents a radar transmitter system.

Definition at line 31 of file transmitter.h.

Constructor & Destructor Documentation

◆ Transmitter() [1/3]

radar::Transmitter::Transmitter ( Platform platform,
std::string  name,
const OperationMode  mode 
)
noexcept

Constructor for the Transmitter class.

Parameters
platformPointer to the platform object.
nameName of the transmitter.
modeThe operational mode (PULSED_MODE or CW_MODE).

Definition at line 41 of file transmitter.h.

41 :
42 Radar(platform, std::move(name)), _mode(mode)
43 {
44 }
Radar(Platform *platform, std::string name) noexcept
Constructs a Radar object.
Definition radar_obj.h:54

◆ ~Transmitter()

radar::Transmitter::~Transmitter ( )
overridedefault

◆ Transmitter() [2/3]

radar::Transmitter::Transmitter ( const Transmitter )
delete

◆ Transmitter() [3/3]

radar::Transmitter::Transmitter ( Transmitter &&  )
delete

Member Function Documentation

◆ getAntenna()

const antenna::Antenna * radar::Radar::getAntenna ( ) const
noexceptinherited

Gets the antenna associated with this radar.

Returns
Pointer to the associated antenna.

Definition at line 78 of file radar_obj.h.

78{ return _antenna; }

Referenced by radar::to_json(), and radar::to_json().

+ Here is the caller graph for this function:

◆ getAttached()

const Radar * radar::Radar::getAttached ( ) const
noexceptinherited

Retrieves the attached radar object.

Returns
Pointer to the attached radar object.

Definition at line 71 of file radar_obj.h.

71{ return _attached; }

Referenced by simulation::calculatePreviewLinks(), and simulation::calculateResponse().

+ Here is the caller graph for this function:

◆ getGain()

RealType radar::Radar::getGain ( const math::SVec3 angle,
const math::SVec3 refangle,
RealType  wavelength 
) const
inherited

Calculates the radar gain based on input angles and wavelength.

Parameters
angleThe radar's pointing angle.
refangleThe reference angle for comparison.
wavelengthThe wavelength of the radar signal.
Returns
The calculated radar gain.

Definition at line 26 of file radar_obj.cpp.

27 {
28 return _antenna->getGain(angle, refangle, wavelength);
29 }
virtual RealType getGain(const math::SVec3 &angle, const math::SVec3 &refangle, RealType wavelength) const =0
Computes the gain of the antenna based on the input angle and reference angle.

References antenna::Antenna::getGain().

+ Here is the call graph for this function:

◆ getMode()

OperationMode radar::Transmitter::getMode ( ) const
noexcept

Gets the operational mode of the transmitter.

Returns
The operational mode (PULSED_MODE or CW_MODE).

Definition at line 75 of file transmitter.h.

75{ return _mode; }

Referenced by radar::to_json().

+ Here is the caller graph for this function:

◆ getName()

const std::string & radar::Object::getName ( ) const
noexceptinherited

Retrieves the name of the object.

Returns
A const reference to the string representing the object's name.

Definition at line 68 of file object.h.

68{ return _name; }

Referenced by simulation::calculatePreviewLinks(), simulation::calculateResponse(), processing::finalizeCwReceiver(), serial::Response::getTransmitterName(), processing::runPulsedFinalizer(), radar::Receiver::setNoiseTemperature(), radar::to_json(), radar::to_json(), and radar::to_json().

+ Here is the caller graph for this function:

◆ getNextPulseTime()

std::optional< RealType > radar::Transmitter::getNextPulseTime ( RealType  time) const

Determines the valid simulation time for a pulse at or after the given time.

If the requested time falls within an active period, it is returned. If it falls in a gap between periods, the start of the next period is returned. If it falls after all periods, std::nullopt is returned. If no schedule is defined, the transmitter is considered "always on".

Parameters
timeThe proposed pulse time.
Returns
The actual pulse time, or nullopt if no valid time exists.

Definition at line 31 of file transmitter.cpp.

32 {
33 // If no schedule is defined, assume always on.
34 if (_schedule.empty())
35 {
36 return time;
37 }
38
39 for (const auto& period : _schedule)
40 {
41 // If time is within this period, it's valid.
42 if (time >= period.start && time <= period.end)
43 {
44 return time;
45 }
46 // If time is before this period, skip to the start of this period.
47 if (time < period.start)
48 {
49 return period.start;
50 }
51 // If time is after this period, continue to next period.
52 }
53
54 // Time is after the last scheduled period.
55 return std::nullopt;
56 }

◆ getNoiseTemperature()

RealType radar::Radar::getNoiseTemperature ( const math::SVec3 angle) const
virtualnoexceptinherited

Gets the noise temperature of the radar.

Parameters
angleThe angle at which the noise temperature is calculated.
Returns
The calculated noise temperature.

Reimplemented in radar::Receiver.

Definition at line 31 of file radar_obj.cpp.

32 {
33 return _antenna->getNoiseTemperature(angle);
34 }
virtual RealType getNoiseTemperature(const math::SVec3 &) const noexcept
Computes the noise temperature of the antenna based on the angle.

Referenced by radar::Receiver::getNoiseTemperature().

+ Here is the caller graph for this function:

◆ getPlatform()

Platform * radar::Object::getPlatform ( ) const
noexceptinherited

Retrieves the associated platform of the object.

Returns
A pointer to the Platform object associated with this object.

Definition at line 61 of file object.h.

61{ return _platform; }

Referenced by simulation::calculateDirectPathContribution(), simulation::calculateReflectedPathContribution(), and simulation::calculateResponse().

+ Here is the caller graph for this function:

◆ getPosition()

math::Vec3 radar::Object::getPosition ( const RealType  time) const
inherited

Retrieves the position of the object.

Parameters
timeThe time at which to get the position of the object.
Returns
A math::Vec3 representing the position of the object.

Definition at line 46 of file object.h.

46{ return _platform->getPosition(time); }
math::Vec3 getPosition(const RealType time) const
Gets the position of the platform at a specific time.
Definition platform.h:74

References radar::Platform::getPosition().

Referenced by simulation::calculatePreviewLinks(), simulation::solveRe(), and simulation::solveReDirect().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPrf()

RealType radar::Transmitter::getPrf ( ) const
noexcept

Retrieves the pulse repetition frequency (PRF).

Returns
The current PRF of the transmitter.

Definition at line 61 of file transmitter.h.

61{ return _prf; }

Referenced by core::runEventDrivenSim(), and radar::to_json().

+ Here is the caller graph for this function:

◆ getRotation()

math::SVec3 radar::Object::getRotation ( const RealType  time) const
inherited

Retrieves the rotation of the object.

Parameters
timeThe time at which to get the rotation of the object.
Returns
A math::SVec3 representing the rotation of the object.

Definition at line 54 of file object.h.

54{ return _platform->getRotation(time); }
math::SVec3 getRotation(const RealType time) const
Gets the rotation of the platform at a specific time.
Definition platform.h:82

References radar::Platform::getRotation().

Referenced by radar::FileTarget::getRcs(), and processing::runPulsedFinalizer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSchedule()

const std::vector< SchedulePeriod > & radar::Transmitter::getSchedule ( ) const
noexcept

Retrieves the list of active transmission periods.

Returns
A const reference to the schedule vector.

Definition at line 110 of file transmitter.h.

110{ return _schedule; }

Referenced by simulation::calculatePreviewLinks(), and radar::to_json().

+ Here is the caller graph for this function:

◆ getSignal()

fers_signal::RadarSignal * radar::Transmitter::getSignal ( ) const
noexcept

Retrieves the radar signal currently being transmitted.

Returns
Pointer to the RadarSignal object being transmitted.

Definition at line 68 of file transmitter.h.

68{ return _signal; }

Referenced by simulation::calculateDirectPathContribution(), simulation::calculatePreviewLinks(), simulation::calculateReflectedPathContribution(), and radar::to_json().

+ Here is the caller graph for this function:

◆ getTiming()

std::shared_ptr< timing::Timing > radar::Radar::getTiming ( ) const
inherited

Retrieves the timing source for the radar.

Returns
Shared pointer to the timing source.

Definition at line 66 of file radar_obj.cpp.

67 {
68 if (!_timing)
69 {
70 LOG(Level::FATAL, "Radar::GetTiming called before timing set");
71 throw std::runtime_error("Radar::GetTiming called before timing set");
72 }
73 return _timing;
74 }
std::shared_ptr< timing::Timing > _timing
Timing source for the radar.
Definition radar_obj.h:129
#define LOG(level,...)
Definition logging.h:19

References radar::Radar::_timing, and LOG.

Referenced by processing::finalizeCwReceiver(), processing::runPulsedFinalizer(), radar::to_json(), and radar::to_json().

+ Here is the caller graph for this function:

◆ operator=() [1/2]

Transmitter & radar::Transmitter::operator= ( const Transmitter )
delete

◆ operator=() [2/2]

Transmitter & radar::Transmitter::operator= ( Transmitter &&  )
delete

◆ setAntenna()

void radar::Radar::setAntenna ( const antenna::Antenna ant)
inherited

Sets the antenna for the radar.

Parameters
antPointer to the antenna to set.

Definition at line 46 of file radar_obj.cpp.

47 {
48 if (!ant)
49 {
50 LOG(Level::FATAL, "Transmitter's antenna set to null");
51 throw std::logic_error("Transmitter's antenna set to null");
52 }
53 _antenna = ant;
54 }

References LOG.

◆ setAttached()

void radar::Radar::setAttached ( const Radar obj)
inherited

Attaches another radar object to this radar.

Parameters
objPointer to the radar object to attach.
Exceptions
std::runtime_errorIf another object is already attached.

Definition at line 56 of file radar_obj.cpp.

57 {
58 if (_attached)
59 {
60 LOG(Level::FATAL, "Attempted to attach second object to transmitter");
61 throw std::runtime_error("Attempted to attach second object to transmitter");
62 }
63 _attached = obj;
64 }

References LOG.

◆ setPrf()

void radar::Transmitter::setPrf ( RealType  mprf)
noexcept

Sets the pulse repetition frequency (PRF) of the transmitter.

Parameters
mprfDesired PRF to be set.

Definition at line 19 of file transmitter.cpp.

20 {
22 _prf = 1 / (std::floor(rate / mprf) / rate);
23 }
double RealType
Type for real numbers.
Definition config.h:27
RealType rate() noexcept
Get the rendering sample rate.
Definition parameters.h:109
unsigned oversampleRatio() noexcept
Get the oversampling ratio.
Definition parameters.h:139

References params::oversampleRatio(), and params::rate().

+ Here is the call graph for this function:

◆ setSchedule()

void radar::Transmitter::setSchedule ( std::vector< SchedulePeriod schedule)

Sets the active schedule for the transmitter.

The provided schedule should be pre-validated and sorted.

Parameters
scheduleA vector of active periods.

Definition at line 25 of file transmitter.cpp.

26 {
27 // The schedule is assumed to be sorted and merged by the parser.
28 _schedule = std::move(schedule);
29 }

◆ setSignal()

void radar::Transmitter::setSignal ( fers_signal::RadarSignal signal)
noexcept

Sets the radar signal wave to be transmitted.

Parameters
signalPointer to the RadarSignal object to be transmitted.

Definition at line 89 of file transmitter.h.

89{ _signal = signal; }

◆ setTiming()

void radar::Radar::setTiming ( const std::shared_ptr< timing::Timing > &  tim)
inherited

Sets the timing source for the radar.

Parameters
timShared pointer to the timing source to set.

Definition at line 36 of file radar_obj.cpp.

37 {
38 if (!tim)
39 {
40 LOG(Level::FATAL, "Radar timing source must not be null");
41 throw std::runtime_error("Radar timing source must not be null");
42 }
43 _timing = tim;
44 }

References radar::Radar::_timing, and LOG.

◆ setWave()

void radar::Transmitter::setWave ( fers_signal::RadarSignal pulse)
noexcept

Sets the radar signal wave to be transmitted.

Parameters
pulsePointer to the RadarSignal object representing the wave.

Definition at line 82 of file transmitter.h.

82{ _signal = pulse; }

Member Data Documentation

◆ _timing

std::shared_ptr<timing::Timing> radar::Radar::_timing
protectedinherited

Timing source for the radar.

Definition at line 129 of file radar_obj.h.

Referenced by radar::Radar::getTiming(), radar::Receiver::getWindowStart(), and radar::Radar::setTiming().


The documentation for this class was generated from the following files: