![]() |
libcyberradio
22.01.24
|
DUC component class for the NDR651. More...
#include <DucComponent.h>
Public Member Functions | |
| DucComponent (int index=1, ::LibCyberRadio::Driver::RadioHandler *parent=NULL, bool debug=false, int dataPort=0, double frequency=0.0, double attenuation=0.0, int rateIndex=0, int txChannels=0, int mode=0, int streamId=0) | |
| Constructs a DucComponent object. More... | |
| virtual | ~DucComponent () |
| Destroys a DucComponent object. | |
| DucComponent (const DucComponent &other) | |
| Copies a DucComponent object. More... | |
| virtual DucComponent & | operator= (const DucComponent &other) |
| Assignment operator for DucComponent objects. More... | |
| virtual bool | enable (bool enabled=true) |
| Enables this component. More... | |
| virtual bool | setConfiguration (ConfigurationDict &cfg) |
| Sets the configuration dictionary for this component. More... | |
| virtual void | queryConfiguration () |
| Tells the component to query its hardware configuration in order to create its configuration dictionary. | |
| virtual int | getDataPort () const |
| Gets the DUC's data port. More... | |
| virtual bool | setDataPort (int port) |
| Sets the DUC's data port. More... | |
| virtual double | getFrequency () const |
| Gets the tuned frequency. More... | |
| virtual bool | setFrequency (double freq) |
| Sets the DUC tuned frequency. More... | |
| virtual BasicDoubleList | getFrequencyRange () const |
| Gets the tunable frequency range. More... | |
| virtual double | getFrequencyRes () const |
| Gets the tuned frequency resolution. More... | |
| virtual double | getFrequencyUnit () const |
| Gets the tuned frequency units. More... | |
| virtual double | getAttenuation () const |
| Gets the attenuation. More... | |
| virtual bool | setAttenuation (double atten) |
| Sets the attenuation. More... | |
| virtual BasicDoubleList | getAttenuationRange () const |
| Gets the attenuation range. More... | |
| virtual double | getAttenuationRes () const |
| Gets the attenuation resolution. More... | |
| virtual int | getRateIndex () const |
| Gets the DUC's rate index. More... | |
| virtual bool | setRateIndex (int index) |
| Sets the DUC's rate index. More... | |
| virtual int | getTxChannelBitmap () const |
| Gets the DUC's transmit channel bitmap. More... | |
| virtual bool | setTxChannelBitmap (int txChannels) |
| Sets the DUC's transmit channel bitmap. More... | |
| virtual int | getMode () const |
| Gets the DUC's mode. More... | |
| virtual bool | setMode (int mode) |
| Sets the DUC's mode. More... | |
| virtual unsigned int | getStreamId () const |
| Gets the DUC's VITA 49 stream ID. More... | |
| virtual bool | setStreamId (unsigned int sid) |
| Sets the DUC's VITA 49 stream ID. More... | |
| virtual DucRateSet | getRateSet () const |
| Gets the DUC's rate set. More... | |
| virtual bool | setRateSet (const DucRateSet &set) |
| Sets the DUC rate set. More... | |
| virtual BasicDoubleList | getRateList () const |
| Gets the list of allowed sample rates, based on the rate set. More... | |
| virtual bool | supportsSnapshotLoad () const |
| Gets whether or not the DUC supports loading snapshot files. More... | |
| virtual bool | loadSnapshot (const std::string &filename, unsigned int startSample=0, unsigned int samples=0) |
| Load a snapshot file into the DUC's memory block. More... | |
| virtual bool | supportsSnapshotTransmit () const |
| Gets whether or not the DUC supports transmitting snapshots. More... | |
| virtual int | getIndex () const |
| Gets the index number of the component. More... | |
| virtual void | setIndex (int index) |
| Sets the index number of the component. More... | |
| virtual RadioHandler * | getParent () const |
| Gets the "parent" radio handler for this component. More... | |
| virtual void | setParent (RadioHandler *parent) |
| Sets the "parent" radio handler for this component. More... | |
| virtual bool | disable () |
| Disables this component. More... | |
| virtual bool | isEnabled () const |
| Gets whether or not the component is enabled. More... | |
| virtual std::string | getName () const |
| Gets the name of the configurable object. More... | |
| virtual void | setName (const std::string &name) |
| Sets the name of the configurable object. More... | |
| virtual ConfigurationDict | getConfiguration () const |
| Gets the configuration dictionary for this object. More... | |
| virtual ConfigString | getConfigurationValue (const std::string &key) const |
| Gets a named configuration value as a string. More... | |
| virtual bool | getConfigurationValueAsBool (const std::string &key) const |
| Gets a named configuration value as a Boolean. More... | |
| virtual int | getConfigurationValueAsInt (const std::string &key) const |
| Gets a named configuration value as an integer value. More... | |
| virtual unsigned int | getConfigurationValueAsUInt (const std::string &key) const |
| Gets a named configuration value as an unsigned integer value. More... | |
| virtual double | getConfigurationValueAsDbl (const std::string &key) const |
| Gets a named configuration value as a double value. More... | |
| virtual bool | setConfigurationValue (const std::string &key, const std::string &value) |
| Sets a named configuration value to a string. More... | |
| virtual bool | setConfigurationValueToBool (const std::string &key, const bool value) |
| Sets a named configuration value to a Boolean. More... | |
| virtual bool | setConfigurationValueToInt (const std::string &key, const int value) |
| Sets a named configuration value to an integer value. More... | |
| virtual bool | setConfigurationValueToUInt (const std::string &key, const unsigned int value) |
| Sets a named configuration value to an unsigned integer value. More... | |
| virtual bool | setConfigurationValueToDbl (const std::string &key, const double value) |
| Sets a named configuration value to a double value. More... | |
| virtual void | setDebugName (const std::string &debug_name) |
| Sets the debug name for this object. More... | |
| virtual void | setDebugFile (FILE *debug_fp) |
| Sets the debug file pointer for this object. More... | |
| virtual void | setDebugTimeFormat (const std::string &debug_timefmt) |
| Sets the debug time format for this object. More... | |
| virtual int | debug (const char *format,...) |
| Outputs debug information. More... | |
| virtual const char * | debugBool (bool x) |
| Gets a debug output string for a Boolean value. More... | |
| virtual bool | isDebug () const |
| Gets whether this object produces debug output. More... | |
| virtual std::string | getDebugName () const |
| Gets the debug name for this object. More... | |
| virtual std::string | rawString (const std::string &data) |
| Gets a "raw" string representation of a given data string. More... | |
Protected Member Functions | |
| virtual void | initConfigurationDict () |
| Initializes the configuration dictionary, defining the allowed keys. | |
| virtual void | updateConfigurationDict () |
| Updates the configuration dictionary from component settings. | |
| virtual bool | executeDucQuery (int index, int &dataPort, double &frequency, double &attenuation, int &rateIndex, int &txChannels, int &mode, unsigned int &streamId) |
| Executes the DUC configuration query command. More... | |
| virtual bool | executeDucCommand (int index, int &dataPort, double &frequency, double &attenuation, int &rateIndex, int &txChannels, int &mode, unsigned int &streamId) |
| Executes the DUC configuration set command. More... | |
| virtual bool | executeSnapshotLoadCommand (int index, const std::string &filename, unsigned int startSample, unsigned int samples) |
| Executes the DUC snapshot load command. More... | |
| virtual ConfigurationDict | normalizedConfigurationDict (const ConfigurationDict &cfg) |
| Normalizes an incoming configuration dictionary. More... | |
| virtual std::string | normalizedBool (const std::string &val) |
| Normalizes a Boolean string value. More... | |
| virtual void | dumpConfiguration () |
| Dumps this object's configuration dictionary to debug output. | |
DUC component class for the NDR651.
Configuration dictionary elements:
Definition at line 59 of file DucComponent.h.
| DucComponent | ( | int | index = 1, |
| ::LibCyberRadio::Driver::RadioHandler * | parent = NULL, |
||
| bool | debug = false, |
||
| int | dataPort = 0, |
||
| double | frequency = 0.0, |
||
| double | attenuation = 0.0, |
||
| int | rateIndex = 0, |
||
| int | txChannels = 0, |
||
| int | mode = 0, |
||
| int | streamId = 0 |
||
| ) |
Constructs a DucComponent object.
| index | The index number of this component. |
| parent | A pointer to the RadioHandler object that "owns" this component. |
| debug | Whether the component supports debug output. |
| dataPort | Data port used by this DUC. Setting this to 0 stops streaming. |
| frequency | Tuned frequency (Hz). |
| attenuation | Attenuation (dB). |
| rateIndex | DUC rate index. This should be one of the rate indices in the DUC's rate set. |
| txChannels | Bitmap indicating which transmitters output the signal from this DUC. Setting a bit position to 1 enables transmit on the associated transmitter. The LSB corresponds to TX 1, and each succeeding bit corresponds to the other transmitters. |
| mode | DUC mode. Either 0 (streaming mode) or 1 (playback mode). |
| streamId | VITA 49 stream ID. |
Definition at line 24 of file DucComponent.cpp.
| DucComponent | ( | const DucComponent & | other | ) |
Copies a DucComponent object.
| other | The DucComponent object to copy. |
Definition at line 79 of file DucComponent.cpp.
|
virtualinherited |
Outputs debug information.
This method follows the same semantics as printf(). Output is preceded by a timestamp and the name of the object, if provided.
| format | The printf()-style format string. |
| ... | Comma-separated list of arguments to print. Note that these need to be arguments that can be supported natively through printf(). |
Definition at line 95 of file Debuggable.cpp.
|
virtualinherited |
Gets a debug output string for a Boolean value.
| x | Boolean value |
Definition at line 126 of file Debuggable.cpp.
|
virtualinherited |
Disables this component.
Definition at line 76 of file RadioComponent.cpp.
|
virtualinherited |
Enables this component.
| enabled | Whether or not this component should be enabled. |
Reimplemented from RadioComponent.
Definition at line 130 of file DucComponent.cpp.
|
protectedvirtualinherited |
Executes the DUC configuration set command.
| index | DUC index. |
| dataPort | Data port number (0 disables). |
| frequency | Tuned frequency (Hz). |
| attenuation | Attenuation (dB). |
| rateIndex | DUC's rate index. |
| txChannels | DUC's TX channel output bitmap. |
| mode | DUC's mode setting. |
| streamId | DUC's VITA 49 stream ID. |
Definition at line 622 of file DucComponent.cpp.
|
protectedvirtualinherited |
Executes the DUC configuration query command.
| index | DUC index. |
| dataPort | Data port number (0 disables) (return). |
| frequency | Tuned frequency (Hz) (return). |
| attenuation | Attenuation (dB) (return). |
| rateIndex | DUC's rate index (return). |
| txChannels | DUC's TX channel output bitmap (return). |
| mode | DUC's mode setting (return). |
| streamId | DUC's VITA 49 stream ID (return). |
Definition at line 581 of file DucComponent.cpp.
|
protectedvirtualinherited |
Executes the DUC snapshot load command.
| index | DUC index. |
| filename | Snapshot file name. |
| startSample | Starting sample number. |
| samples | Number of samples (0 = load maximum). |
Definition at line 653 of file DucComponent.cpp.
|
virtualinherited |
Gets the attenuation.
Definition at line 328 of file DucComponent.cpp.
|
virtualinherited |
Gets the attenuation range.
Definition at line 356 of file DucComponent.cpp.
|
virtualinherited |
Gets the attenuation resolution.
Definition at line 364 of file DucComponent.cpp.
|
virtualinherited |
Gets the configuration dictionary for this object.
Definition at line 93 of file Configurable.cpp.
|
virtualinherited |
Gets a named configuration value as a string.
| key | The key string in the configuration dictionary. |
Definition at line 98 of file Configurable.cpp.
|
virtualinherited |
Gets a named configuration value as a Boolean.
| key | The key string in the configuration dictionary. |
Definition at line 109 of file Configurable.cpp.
|
virtualinherited |
Gets a named configuration value as a double value.
| key | The key string in the configuration dictionary. |
Definition at line 148 of file Configurable.cpp.
|
virtualinherited |
Gets a named configuration value as an integer value.
| key | The key string in the configuration dictionary. |
Definition at line 122 of file Configurable.cpp.
|
virtualinherited |
Gets a named configuration value as an unsigned integer value.
| key | The key string in the configuration dictionary. |
Definition at line 135 of file Configurable.cpp.
|
virtualinherited |
|
virtualinherited |
Gets the debug name for this object.
Definition at line 138 of file Debuggable.cpp.
|
virtualinherited |
Gets the tuned frequency.
Definition at line 282 of file DucComponent.cpp.
|
virtualinherited |
Gets the tunable frequency range.
Definition at line 310 of file DucComponent.cpp.
|
virtualinherited |
Gets the tuned frequency resolution.
Definition at line 318 of file DucComponent.cpp.
|
virtualinherited |
Gets the tuned frequency units.
Definition at line 323 of file DucComponent.cpp.
|
virtualinherited |
Gets the index number of the component.
Definition at line 56 of file RadioComponent.cpp.
|
virtualinherited |
Gets the DUC's mode.
Definition at line 425 of file DucComponent.cpp.
|
virtualinherited |
Gets the name of the configurable object.
Definition at line 83 of file Configurable.cpp.
|
virtualinherited |
Gets the "parent" radio handler for this component.
Definition at line 66 of file RadioComponent.cpp.
|
virtualinherited |
|
virtualinherited |
Gets the list of allowed sample rates, based on the rate set.
Definition at line 492 of file DucComponent.cpp.
|
virtualinherited |
|
virtualinherited |
Gets the DUC's VITA 49 stream ID.
Definition at line 453 of file DucComponent.cpp.
|
virtualinherited |
Gets the DUC's transmit channel bitmap.
Definition at line 397 of file DucComponent.cpp.
|
virtualinherited |
Gets whether this object produces debug output.
Definition at line 133 of file Debuggable.cpp.
|
virtualinherited |
Gets whether or not the component is enabled.
Definition at line 88 of file RadioComponent.cpp.
|
virtualinherited |
Load a snapshot file into the DUC's memory block.
Snapshot files contain 16-bit complex I/Q data samples.
| filename | Snapshot file name. The snapshot file needs to be present on the radio. |
| startSample | Starting address in DUC's memory block. Must be a multiple of 1024. |
| samples | Number of I/Q samples to load. Must be a multiple of 16. If specified as 0, load the maximum number of samples from the file. |
Definition at line 507 of file DucComponent.cpp.
|
protectedvirtualinherited |
Normalizes a Boolean string value.
Definition at line 241 of file Configurable.cpp.
|
protectedvirtualinherited |
Normalizes an incoming configuration dictionary.
"Normalizing" a configuration dictionary replaces certain strings representing Boolean values ("yes", "on", "true", "no", "off", and "false", case is irrelevant) with standard values ("0" and "1").
Definition at line 232 of file Configurable.cpp.
|
virtual |
Assignment operator for DucComponent objects.
| other | The DucComponent object to copy. |
Definition at line 84 of file DucComponent.cpp.
|
virtualinherited |
Gets a "raw" string representation of a given data string.
"Raw" string representations mimic Python string representations. Whitespace characters are denoted by backslash representations ("\\r", "\\n", "\\t", "\\v", "\\f"), while other non-printable characters are represented with hex representation ("\\x00", etc.)
| data | Data string |
Definition at line 143 of file Debuggable.cpp.
|
virtualinherited |
Sets the attenuation.
| atten | The new attenuation (dB). |
Definition at line 333 of file DucComponent.cpp.
|
virtualinherited |
Sets the configuration dictionary for this component.
| cfg | The component configuration dictionary. |
Reimplemented from RadioComponent.
Definition at line 135 of file DucComponent.cpp.
|
virtualinherited |
Sets a named configuration value to a string.
| key | The key string in the configuration dictionary. |
| value | The new value. |
Definition at line 177 of file Configurable.cpp.
|
virtualinherited |
Sets a named configuration value to a Boolean.
| key | The key string in the configuration dictionary. |
| value | The new value. |
Definition at line 193 of file Configurable.cpp.
|
virtualinherited |
Sets a named configuration value to a double value.
| key | The key string in the configuration dictionary. |
| value | The new value. |
Definition at line 211 of file Configurable.cpp.
|
virtualinherited |
Sets a named configuration value to an integer value.
| key | The key string in the configuration dictionary. |
| value | The new value. |
Definition at line 199 of file Configurable.cpp.
|
virtualinherited |
Sets a named configuration value to an unsigned integer value.
| key | The key string in the configuration dictionary. |
| value | The new value. |
Definition at line 205 of file Configurable.cpp.
|
virtualinherited |
Sets the DUC's data port.
| port | The new data port. Setting this to 0 disables streaming. |
Definition at line 259 of file DucComponent.cpp.
|
virtualinherited |
Sets the debug file pointer for this object.
| debug_fp | File to send debug output to. |
Definition at line 81 of file Debuggable.cpp.
|
virtualinherited |
Sets the debug name for this object.
Use this method to set unique debug names for objects of the same class for easy differentiation.
| debug_name | Name for identifying this object in debug output. |
Definition at line 74 of file Debuggable.cpp.
|
virtualinherited |
Sets the debug time format for this object.
| debug_timefmt | Format string for displaying timestamp, as compatible with strftime(). If this is an empty string, don't display a timestamp. |
Definition at line 88 of file Debuggable.cpp.
|
virtualinherited |
Sets the DUC tuned frequency.
| freq | The new tuned frequency (Hz). |
Definition at line 287 of file DucComponent.cpp.
|
virtualinherited |
Sets the index number of the component.
| index | The index number. |
Definition at line 61 of file RadioComponent.cpp.
|
virtualinherited |
Sets the DUC's mode.
| mode | The new mode. This is either 0 (streaming) or 1 (playback). |
Definition at line 430 of file DucComponent.cpp.
|
virtualinherited |
Sets the name of the configurable object.
| name | The new name. |
Definition at line 88 of file Configurable.cpp.
|
virtualinherited |
Sets the "parent" radio handler for this component.
| parent | A pointer to the RadioHandler object. |
Definition at line 71 of file RadioComponent.cpp.
|
virtualinherited |
Sets the DUC's rate index.
| index | The new rate index. |
Definition at line 374 of file DucComponent.cpp.
|
virtualinherited |
Sets the DUC rate set.
| set | The new rate set. |
Definition at line 486 of file DucComponent.cpp.
|
virtualinherited |
Sets the DUC's VITA 49 stream ID.
| sid | The new stream ID. |
Definition at line 458 of file DucComponent.cpp.
|
virtualinherited |
Sets the DUC's transmit channel bitmap.
| txChannels | Bitmap indicating which transmitters output the signal from this DUC. Setting a bit position to 1 enables transmit on the associated transmitter. The LSB corresponds to TX 1, and each succeeding bit corresponds to the other transmitters. |
Definition at line 402 of file DucComponent.cpp.
|
virtualinherited |
Gets whether or not the DUC supports loading snapshot files.
Definition at line 502 of file DucComponent.cpp.
|
virtualinherited |
Gets whether or not the DUC supports transmitting snapshots.
Definition at line 523 of file DucComponent.cpp.