TSDuck v3.40-4033
MPEG Transport Stream Toolkit
|
State of a modulated broadcast signal. More...
#include <tsSignalState.h>
Classes | |
class | Value |
Implementation of a state value. More... | |
Public Types | |
enum class | Unit { COUNTER , PERCENT , MDB } |
Unit of a state value. More... | |
Public Member Functions | |
SignalState ()=default | |
Constructor. | |
virtual void | clear () |
Clear content, reset all values, they become "unset". | |
virtual std::ostream & | display (std::ostream &strm, const UString &margin=UString(), int level=Severity::Info) const override |
Display the content of this object to a stream. | |
void | setPercent (std::optional< Value > SignalState::*field, int64_t value, int64_t min, int64_t max) |
Set a percentage value from a raw driver value. | |
void | toJSON (json::Object &obj) const |
Build a JSON description of this object. | |
virtual UString | toString () const override |
Convert to a string object. | |
Public Attributes | |
std::optional< Value > | bit_error_rate {} |
Bit error rate (BER). | |
std::optional< Value > | packet_error_rate {} |
Packet error rate (PER). | |
bool | signal_locked = false |
Set to true when the signal is confirmed to be locked at the input of the demodulator. | |
std::optional< Value > | signal_noise_ratio {} |
Signal to noise ratio (SNR). | |
std::optional< Value > | signal_strength {} |
Signal strength. | |
State of a modulated broadcast signal.
The type of information on the state of a modulated broadcast signal highly depends on the operating systems and drivers. The units also differ. The value can be in decibels or percentage. So, this structure contains many different fields which can be set or not.
|
strong |
|
overridevirtual |
Convert to a string object.
Implements ts::StringifyInterface.
|
overridevirtual |
Display the content of this object to a stream.
[in,out] | stream | The stream where to print the content. Standard output by default. |
[in] | margin | The prefix string on each line, empty by default. |
[in] | level | Severity level (for instance, Severity::Info or Severity::Debug may display more information). |
Implements ts::DisplayInterface.
void ts::SignalState::toJSON | ( | json::Object & | obj | ) | const |
Build a JSON description of this object.
[in,out] | obj | JSON object into which the signal state information is added. |
void ts::SignalState::setPercent | ( | std::optional< Value > SignalState::* | field, |
int64_t | value, | ||
int64_t | min, | ||
int64_t | max | ||
) |
Set a percentage value from a raw driver value.
This method is a utility for system-specific implementations.
[out] | field | Pointer-to-member for the field to update. |
[in] | value | Raw value as returned by the driver. The field is set with a value from 0 to 100, based on the range min to max. |
[in] | min | Minimum value corresponding to 0 %. |
[in] | max | Maximum value corresponding to 100 %. |