![]() |
libcyberradio
22.01.24
|
Base transmitter component class. More...
#include <TransmitterComponent.h>
Public Member Functions | |
| TransmitterComponent (const std::string &name="TX", int index=1, RadioHandler *parent=NULL, bool debug=false, double freqRangeMin=20e6, double freqRangeMax=6000e6, double freqRes=1e6, double freqUnits=1e6, double attRangeMin=0.0, double attRangeMax=10.0, double attRes=1.0, int numToneGen=0, int toneGenIndexBase=1, double frequency=900e6, double attenuation=0.0) | |
| Constructs a TransmitterComponent object. More... | |
| virtual | ~TransmitterComponent () |
| Destroys a TransmitterComponent object. | |
| TransmitterComponent (const TransmitterComponent &other) | |
| Copies a TransmitterComponent object. More... | |
| virtual TransmitterComponent & | operator= (const TransmitterComponent &other) |
| Assignment operator for TransmitterComponent 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 double | getFrequency () const |
| Gets the transmitter center frequency. More... | |
| virtual bool | setFrequency (double freq) |
| Sets the transmitter center frequency. More... | |
| virtual double | getAttenuation () const |
| Gets the attenuation. More... | |
| virtual bool | setAttenuation (double atten) |
| Sets the attenuation. More... | |
| virtual BasicDoubleList | getFrequencyRange () const |
| Gets the transmitter center frequency range. More... | |
| virtual double | getFrequencyRes () const |
| Gets the transmitter center frequency resolution. More... | |
| virtual double | getFrequencyUnit () const |
| Gets the transmitter center frequency units. More... | |
| virtual BasicDoubleList | getAttenuationRange () const |
| Gets the attenuation range. More... | |
| virtual double | getAttenuationRes () const |
| Gets the attenuation resolution. More... | |
| virtual bool | supportsCW () const |
| Gets whether the transmitter supports CW tone generation. More... | |
| virtual int | getCWNum () const |
| Gets the number of CW tone generators associated with this transmitter. More... | |
| virtual BasicIntList | getCWIndexRange () const |
| Gets the range of indices for CW tone generators. More... | |
| virtual BasicDoubleList | getCWFrequencyRange () const |
| Gets the CW frequency range. More... | |
| virtual double | getCWFrequencyRes () const |
| Gets the CW frequency resolution. More... | |
| virtual BasicDoubleList | getCWAmplitudeRange () const |
| Gets the CW amplitude range. More... | |
| virtual double | getCWAmplitudeRes () const |
| Gets the CW amplitude resolution. More... | |
| virtual BasicDoubleList | getCWPhaseRange () const |
| Gets the CW phase range. More... | |
| virtual double | getCWPhaseRes () const |
| Gets the CW phase resolution. More... | |
| virtual bool | supportsCWSweep () const |
| Gets whether the transmitter supports CW tone sweeping. More... | |
| virtual BasicDoubleList | getCWSweepStartRange () const |
| Gets the CW start frequency range. More... | |
| virtual double | getCWSweepStartRes () const |
| Gets the CW start frequency resolution. More... | |
| virtual BasicDoubleList | getCWSweepStopRange () const |
| Gets the CW stop frequency range. More... | |
| virtual double | getCWSweepStopRes () const |
| Gets the CW stop frequency resolution. More... | |
| virtual BasicDoubleList | getCWSweepStepRange () const |
| Gets the CW frequency step range. More... | |
| virtual double | getCWSweepStepRes () const |
| Gets the CW frequency step resolution. More... | |
| virtual BasicDoubleList | getCWSweepDwellRange () const |
| Gets the CW dwell time range. More... | |
| virtual double | getCWSweepDwellRes () const |
| Gets the CW dwell time resolution. More... | |
| virtual bool | enableCW (int index, bool enabled=true) |
| Enables a given CW tone generator. More... | |
| virtual bool | disableCW (int index) |
| Disables a given CW tone generator. More... | |
| virtual ConfigurationDict | getCWConfiguration (int index) const |
| Gets the configuration for a given CW tone generator. More... | |
| virtual bool | setCWConfiguration (int index, ConfigurationDict &cfg) |
| Sets the configuration dictionary for a given CW tone generator. More... | |
| virtual double | getCWFrequency (int index) const |
| Gets the constant frequency for a given CW tone generator. More... | |
| virtual bool | setCWFrequency (int index, double freq) |
| Sets the constant frequency for a given CW tone generator. More... | |
| virtual double | getCWAmplitude (int index) const |
| Gets the signal amplitude for a given CW tone generator. More... | |
| virtual bool | setCWAmplitude (int index, double amp) |
| Sets the signal amplitude for a given CW tone generator. More... | |
| virtual double | getCWPhase (int index) const |
| Gets the signal phase for a given CW tone generator. More... | |
| virtual bool | setCWPhase (int index, double phase) |
| Sets the signal phase for a given CW tone generator. More... | |
| virtual bool | supportsCWSweep (int index) const |
| Gets whether or not a given CW tone generator supports signal sweeps. More... | |
| virtual double | getCWSweepStartFrequency (int index) const |
| Gets the start frequency for a signal sweep for a given CW tone generator. More... | |
| virtual double | getCWSweepStopFrequency (int index) const |
| Gets the stop frequency for a signal sweep for a given CW tone generator. More... | |
| virtual double | getCWSweepFrequencyStep (int index) const |
| Gets the frequency step for a signal sweep for a given CW tone generator. More... | |
| virtual double | getCWSweepDwellTime (int index) const |
| Gets the dwell time for a signal sweep for a given CW tone generator. More... | |
| virtual bool | setCWFrequencySweep (int index, double start, double stop, double step, double dwell) |
| Sets the parameters for a frequency sweep for a given CW tone generator. 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 | executeEnableQuery (int index, bool &enabled) |
| Executes the tuner enabled query command. More... | |
| virtual bool | executeFreqQuery (int index, double &freq) |
| Executes the tuner frequency query command. More... | |
| virtual bool | executeAttenQuery (int index, double &atten) |
| Executes the tuner attenuation query command. More... | |
| virtual bool | executeEnableCommand (int index, bool &enabled) |
| Executes the tuner enable command. More... | |
| virtual bool | executeFreqCommand (int index, double &freq) |
| Executes the tuner frequency set command. More... | |
| virtual bool | executeAttenCommand (int index, double &atten) |
| Executes the tuner attenuation set 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. | |
Base transmitter component class.
A radio handler object maintains one transmitter component object per transmitter on the radio.
Configuration dictionary elements:
Definition at line 45 of file TransmitterComponent.h.
| TransmitterComponent | ( | const std::string & | name = "TX", |
| int | index = 1, |
||
| RadioHandler * | parent = NULL, |
||
| bool | debug = false, |
||
| double | freqRangeMin = 20e6, |
||
| double | freqRangeMax = 6000e6, |
||
| double | freqRes = 1e6, |
||
| double | freqUnits = 1e6, |
||
| double | attRangeMin = 0.0, |
||
| double | attRangeMax = 10.0, |
||
| double | attRes = 1.0, |
||
| int | numToneGen = 0, |
||
| int | toneGenIndexBase = 1, |
||
| double | frequency = 900e6, |
||
| double | attenuation = 0.0 |
||
| ) |
Constructs a TransmitterComponent object.
| name | The name of this component. |
| 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. |
| freqRangeMin | Minimum tunable frequency (Hz). |
| freqRangeMax | Maximum tunable frequency (Hz). |
| freqRes | Tunable frequency resolution (Hz). |
| freqUnits | Tunable frequency units (Hz). |
| attRangeMin | Minimum attenuation (dB). |
| attRangeMax | Maximum attenuation (dB). |
| attRes | Attenuation resolution (dB). |
| numToneGen | Number of CW tone generators associated with this transmitter. |
| toneGenIndexBase | Number where tone generator index numbers begin. |
| frequency | Transmitter center frequency (Hz). |
| attenuation | Transmitter attenuation (dB). |
Definition at line 24 of file TransmitterComponent.cpp.
| TransmitterComponent | ( | const TransmitterComponent & | other | ) |
Copies a TransmitterComponent object.
| other | The TransmitterComponent object to copy. |
Definition at line 66 of file TransmitterComponent.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.
|
virtual |
Disables a given CW tone generator.
| index | CW tone generator index. |
Definition at line 423 of file TransmitterComponent.cpp.
|
virtual |
Enables this component.
| enabled | Whether or not this component should be enabled. |
Reimplemented from RadioComponent.
Definition at line 102 of file TransmitterComponent.cpp.
|
virtual |
Enables a given CW tone generator.
| index | CW tone generator index. |
| enabled | Whether or not this component should be enabled. |
Definition at line 414 of file TransmitterComponent.cpp.
|
protectedvirtual |
Executes the tuner attenuation set command.
| index | tuner index. |
| atten | Attenuation (dB). |
Definition at line 693 of file TransmitterComponent.cpp.
|
protectedvirtual |
Executes the tuner attenuation query command.
| index | tuner index. |
| atten | Attenuation (dB) (return). |
Definition at line 631 of file TransmitterComponent.cpp.
|
protectedvirtual |
Executes the tuner enable command.
| index | tuner index. |
| enabled | Whether or not tuner is enabled. |
Definition at line 654 of file TransmitterComponent.cpp.
|
protectedvirtual |
Executes the tuner enabled query command.
| index | tuner index. |
| enabled | Whether or not tuner is enabled (return). |
Definition at line 584 of file TransmitterComponent.cpp.
|
protectedvirtual |
Executes the tuner frequency set command.
| index | tuner index. |
| freq | Tuned frequency (Hz). |
Definition at line 673 of file TransmitterComponent.cpp.
|
protectedvirtual |
Executes the tuner frequency query command.
| index | tuner index. |
| freq | Tuned frequency (Hz) (return). |
Definition at line 608 of file TransmitterComponent.cpp.
|
virtual |
Gets the attenuation.
Definition at line 208 of file TransmitterComponent.cpp.
|
virtual |
Gets the attenuation range.
Definition at line 247 of file TransmitterComponent.cpp.
|
virtual |
Gets the attenuation resolution.
Definition at line 255 of file TransmitterComponent.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.
|
virtual |
Gets the signal amplitude for a given CW tone generator.
| index | CW tone generator index. |
Definition at line 464 of file TransmitterComponent.cpp.
|
virtual |
Gets the CW amplitude range.
Definition at line 297 of file TransmitterComponent.cpp.
|
virtual |
Gets the CW amplitude resolution.
Definition at line 306 of file TransmitterComponent.cpp.
|
virtual |
Gets the configuration for a given CW tone generator.
| index | CW tone generator index. |
Definition at line 428 of file TransmitterComponent.cpp.
|
virtual |
Gets the constant frequency for a given CW tone generator.
| index | CW tone generator index. |
Definition at line 446 of file TransmitterComponent.cpp.
|
virtual |
Gets the CW frequency range.
Definition at line 279 of file TransmitterComponent.cpp.
|
virtual |
Gets the CW frequency resolution.
Definition at line 288 of file TransmitterComponent.cpp.
|
virtual |
Gets the range of indices for CW tone generators.
Definition at line 270 of file TransmitterComponent.cpp.
|
virtual |
Gets the number of CW tone generators associated with this transmitter.
Definition at line 265 of file TransmitterComponent.cpp.
|
virtual |
Gets the signal phase for a given CW tone generator.
| index | CW tone generator index. |
Definition at line 482 of file TransmitterComponent.cpp.
|
virtual |
Gets the CW phase range.
Definition at line 315 of file TransmitterComponent.cpp.
|
virtual |
Gets the CW phase resolution.
Definition at line 324 of file TransmitterComponent.cpp.
|
virtual |
Gets the CW dwell time range.
Definition at line 396 of file TransmitterComponent.cpp.
|
virtual |
Gets the CW dwell time resolution.
Definition at line 405 of file TransmitterComponent.cpp.
|
virtual |
Gets the dwell time for a signal sweep for a given CW tone generator.
| index | CW tone generator index. |
Definition at line 536 of file TransmitterComponent.cpp.
|
virtual |
Gets the frequency step for a signal sweep for a given CW tone generator.
| index | CW tone generator index. |
Definition at line 527 of file TransmitterComponent.cpp.
|
virtual |
Gets the start frequency for a signal sweep for a given CW tone generator.
| index | CW tone generator index. |
Definition at line 509 of file TransmitterComponent.cpp.
|
virtual |
Gets the CW start frequency range.
Definition at line 342 of file TransmitterComponent.cpp.
|
virtual |
Gets the CW start frequency resolution.
Definition at line 351 of file TransmitterComponent.cpp.
|
virtual |
Gets the CW frequency step range.
Definition at line 378 of file TransmitterComponent.cpp.
|
virtual |
Gets the CW frequency step resolution.
Definition at line 387 of file TransmitterComponent.cpp.
|
virtual |
Gets the stop frequency for a signal sweep for a given CW tone generator.
| index | CW tone generator index. |
Definition at line 518 of file TransmitterComponent.cpp.
|
virtual |
Gets the CW stop frequency range.
Definition at line 360 of file TransmitterComponent.cpp.
|
virtual |
Gets the CW stop frequency resolution.
Definition at line 369 of file TransmitterComponent.cpp.
|
virtualinherited |
Gets the debug name for this object.
Definition at line 138 of file Debuggable.cpp.
|
virtual |
Gets the transmitter center frequency.
Definition at line 187 of file TransmitterComponent.cpp.
|
virtual |
Gets the transmitter center frequency range.
Definition at line 229 of file TransmitterComponent.cpp.
|
virtual |
Gets the transmitter center frequency resolution.
Definition at line 237 of file TransmitterComponent.cpp.
|
virtual |
Gets the transmitter center frequency units.
Definition at line 242 of file TransmitterComponent.cpp.
|
virtualinherited |
Gets the index number of the component.
Definition at line 56 of file RadioComponent.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 |
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.
|
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 TransmitterComponent objects.
| other | The TransmitterComponent object to copy. |
Definition at line 82 of file TransmitterComponent.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.
|
virtual |
Sets the attenuation.
| atten | The new attenuation (dB). |
Definition at line 213 of file TransmitterComponent.cpp.
|
virtual |
Sets the configuration dictionary for this component.
| cfg | The component configuration dictionary. |
Reimplemented from RadioComponent.
Definition at line 118 of file TransmitterComponent.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.
|
virtual |
Sets the signal amplitude for a given CW tone generator.
| index | CW tone generator index. |
| amp | The new signal amplitude (scale units). |
Definition at line 473 of file TransmitterComponent.cpp.
|
virtual |
Sets the configuration dictionary for a given CW tone generator.
| index | CW tone generator index. |
| cfg | The component configuration dictionary. |
Definition at line 437 of file TransmitterComponent.cpp.
|
virtual |
Sets the constant frequency for a given CW tone generator.
| index | CW tone generator index. |
| freq | The new constant frequency (Hz). |
Definition at line 455 of file TransmitterComponent.cpp.
|
virtual |
Sets the parameters for a frequency sweep for a given CW tone generator.
| index | CW tone generator index. |
| start | The new start frequency (Hz). |
| stop | The new stop frequency (Hz). |
| step | The new frequency step (Hz). |
| dwell | The new dwell time (sample clocks). |
Definition at line 545 of file TransmitterComponent.cpp.
|
virtual |
Sets the signal phase for a given CW tone generator.
| index | CW tone generator index. |
| phase | The new signal phase (degrees). |
Definition at line 491 of file TransmitterComponent.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.
|
virtual |
Sets the transmitter center frequency.
| freq | The new transmitter center frequency (Hz). |
Definition at line 192 of file TransmitterComponent.cpp.
|
virtualinherited |
Sets the index number of the component.
| index | The index number. |
Definition at line 61 of file RadioComponent.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.
|
virtual |
Gets whether the transmitter supports CW tone generation.
Definition at line 260 of file TransmitterComponent.cpp.
|
virtual |
Gets whether the transmitter supports CW tone sweeping.
Definition at line 333 of file TransmitterComponent.cpp.
|
virtual |
Gets whether or not a given CW tone generator supports signal sweeps.
| index | CW tone generator index. |
Definition at line 500 of file TransmitterComponent.cpp.