![]() |
libcyberradio
22.01.24
|
Base continuous-wave (CW) tone generator component class. More...
#include <CWToneGenComponent.h>
Public Member Functions | |
| CWToneGenComponent (const std::string &name="CWTONE", int index=0, RadioHandler *parent=NULL, bool debug=false, int txIndex=0, double freqRangeMin=0.0, double freqRangeMax=0.0, double freqRes=0.0, double freqUnits=0.0, double ampRangeMin=0.0, double ampRangeMax=0.0, double ampRes=0.0, double phaseRangeMin=0.0, double phaseRangeMax=0.0, double phaseRes=0.0, double sweepStartRangeMin=0.0, double sweepStartRangeMax=0.0, double sweepStartRes=0.0, double sweepStopRangeMin=0.0, double sweepStopRangeMax=0.0, double sweepStopRes=0.0, double sweepStepRangeMin=0.0, double sweepStepRangeMax=0.0, double sweepStepRes=0.0, double dwellTimeRangeMin=0.0, double dwellTimeRangeMax=0.0, double dwellTimeRes=0.0, double frequency=0.0, double amplitude=0.0, double phase=0.0, double sweepStart=0.0, double sweepStop=0.0, double sweepStep=0.0, double dwellTime=0.0) | |
| Constructs a CWToneGenComponent object. More... | |
| virtual | ~CWToneGenComponent () |
| Destroys a CWToneGenComponent object. | |
| CWToneGenComponent (const CWToneGenComponent &other) | |
| Copies a CWToneGenComponent object. More... | |
| virtual CWToneGenComponent & | operator= (const CWToneGenComponent &other) |
| Assignment operator for CWToneGenComponent 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 BasicDoubleList | getFrequencyRange () const |
| Gets the frequency range. More... | |
| virtual double | getFrequencyRes () const |
| Gets the frequency resolution. More... | |
| virtual BasicDoubleList | getAmplitudeRange () const |
| Gets the amplitude range. More... | |
| virtual double | getAmplitudeRes () const |
| Gets the amplitude resolution. More... | |
| virtual BasicDoubleList | getPhaseRange () const |
| Gets the phase range. More... | |
| virtual double | getPhaseRes () const |
| Gets the phase resolution. More... | |
| virtual BasicDoubleList | getSweepStartRange () const |
| Gets the sweep start range. More... | |
| virtual double | getSweepStartRes () const |
| Gets the sweep start resolution. More... | |
| virtual BasicDoubleList | getSweepStopRange () const |
| Gets the sweep stop range. More... | |
| virtual double | getSweepStopRes () const |
| Gets the sweep stop resolution. More... | |
| virtual BasicDoubleList | getSweepStepRange () const |
| Gets the sweep step range. More... | |
| virtual double | getSweepStepRes () const |
| Gets the sweep step resolution. More... | |
| virtual BasicDoubleList | getDwellTimeRange () const |
| Gets the dwell time range. More... | |
| virtual double | getDwellTimeRes () const |
| Gets the dwell time resolution. More... | |
| virtual double | getFrequency () const |
| Gets the constant frequency. More... | |
| virtual bool | setFrequency (double freq) |
| Sets the constant frequency. More... | |
| virtual double | getAmplitude () const |
| Gets the signal amplitude. More... | |
| virtual bool | setAmplitude (double amp) |
| Sets the signal amplitude. More... | |
| virtual double | getPhase () const |
| Gets the signal phase. More... | |
| virtual bool | setPhase (double phase) |
| Sets the signal phase. More... | |
| virtual bool | supportsSweep () const |
| Gets whether or not the generator supports signal sweeps. More... | |
| virtual double | getSweepStartFrequency () const |
| Gets the start frequency for a signal sweep. More... | |
| virtual double | getSweepStopFrequency () const |
| Gets the stop frequency for a signal sweep. More... | |
| virtual double | getSweepFrequencyStep () const |
| Gets the frequency step for a signal sweep. More... | |
| virtual double | getSweepDwellTime () const |
| Gets the dwell time for a signal sweep. More... | |
| virtual bool | setFrequencySweep (double start, double stop, double step, double dwell) |
| Sets the parameters for a frequency sweep. 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 | executeToneQuery (int index, int txIndex, double &freq, double &, double &phase) |
| Executes the CW tone query command. More... | |
| virtual bool | executeToneCommand (int index, int txIndex, double &freq, double &, double &phase) |
| Executes the CW tone set command. More... | |
| virtual bool | executeSweepQuery (int index, int txIndex, double &sweepStart, double &sweepStop, double &sweepStep, double &dwellTime) |
| Executes the CW sweep query command. More... | |
| virtual bool | executeSweepCommand (int index, int txIndex, double &sweepStart, double &sweepStop, double &sweepStep, double &dwellTime) |
| Executes the CW sweep 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 continuous-wave (CW) tone generator component class.
A radio handler object maintains one CW tone generator component object per tone generator on the radio.
Configuration dictionary elements:
Definition at line 43 of file CWToneGenComponent.h.
| CWToneGenComponent | ( | const std::string & | name = "CWTONE", |
| int | index = 0, |
||
| RadioHandler * | parent = NULL, |
||
| bool | debug = false, |
||
| int | txIndex = 0, |
||
| double | freqRangeMin = 0.0, |
||
| double | freqRangeMax = 0.0, |
||
| double | freqRes = 0.0, |
||
| double | freqUnits = 0.0, |
||
| double | ampRangeMin = 0.0, |
||
| double | ampRangeMax = 0.0, |
||
| double | ampRes = 0.0, |
||
| double | phaseRangeMin = 0.0, |
||
| double | phaseRangeMax = 0.0, |
||
| double | phaseRes = 0.0, |
||
| double | sweepStartRangeMin = 0.0, |
||
| double | sweepStartRangeMax = 0.0, |
||
| double | sweepStartRes = 0.0, |
||
| double | sweepStopRangeMin = 0.0, |
||
| double | sweepStopRangeMax = 0.0, |
||
| double | sweepStopRes = 0.0, |
||
| double | sweepStepRangeMin = 0.0, |
||
| double | sweepStepRangeMax = 0.0, |
||
| double | sweepStepRes = 0.0, |
||
| double | dwellTimeRangeMin = 0.0, |
||
| double | dwellTimeRangeMax = 0.0, |
||
| double | dwellTimeRes = 0.0, |
||
| double | frequency = 0.0, |
||
| double | amplitude = 0.0, |
||
| double | phase = 0.0, |
||
| double | sweepStart = 0.0, |
||
| double | sweepStop = 0.0, |
||
| double | sweepStep = 0.0, |
||
| double | dwellTime = 0.0 |
||
| ) |
Constructs a CWToneGenComponent 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. |
| txIndex | Transmitter index associated with this component. |
| freqRangeMin | Minimum tunable frequency (Hz). |
| freqRangeMax | Maximum tunable frequency (Hz). |
| freqRes | Tunable frequency resolution (Hz). |
| freqUnits | Tunable frequency units (Hz). |
| ampRangeMin | Minimum amplitude (scale units). |
| ampRangeMax | Maximum amplitude (scale units). |
| ampRes | Amplitude resolution (scale units). |
| phaseRangeMin | Minimum phase (degrees). |
| phaseRangeMax | Maximum phase (degrees). |
| phaseRes | Phase resolution (degrees). |
| sweepStartRangeMin | Minimum sweep start frequency (Hz). |
| sweepStartRangeMax | Maximum sweep start frequency (Hz). |
| sweepStartRes | Sweep start frequency resolution (Hz). |
| sweepStopRangeMin | Minimum sweep stop frequency (Hz). |
| sweepStopRangeMax | Maximum sweep stop frequency (Hz). |
| sweepStopRes | Sweep stop frequency resolution (Hz). |
| sweepStepRangeMin | Minimum sweep step frequency (Hz). |
| sweepStepRangeMax | Maximum sweep step frequency (Hz). |
| sweepStepRes | Sweep step frequency resolution (Hz). |
| dwellTimeRangeMin | Minimum dwell time (ADC samples). |
| dwellTimeRangeMax | Maximum dwell time (ADC samples). |
| dwellTimeRes | Dwell time resolution (ADC samples). |
| frequency | Constant frequency (Hz). |
| amplitude | Signal amplitude (scale units). |
| phase | Signal phase (degrees). |
| sweepStart | Frequency sweep start (Hz). |
| sweepStop | Frequency sweep stop (Hz). |
| sweepStep | Frequency sweep step (Hz). |
| dwellTime | Dwell time (ADC samples). |
Definition at line 27 of file CWToneGenComponent.cpp.
| CWToneGenComponent | ( | const CWToneGenComponent & | other | ) |
Copies a CWToneGenComponent object.
| other | The CWToneGenComponent object to copy. |
Definition at line 104 of file CWToneGenComponent.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 |
Enables this component.
| enabled | Whether or not this component should be enabled. |
Reimplemented from RadioComponent.
Definition at line 179 of file CWToneGenComponent.cpp.
|
protectedvirtual |
Executes the CW sweep set command.
| index | CW tone generator index. |
| txIndex | Transmitter index associated with this component. |
| sweepStart | Start frequency (Hz). |
| sweepStop | Stop frequency (Hz). |
| sweepStep | Frequency step (Hz). |
| dwellTime | Dwell time (ADC samples). |
Definition at line 637 of file CWToneGenComponent.cpp.
|
protectedvirtual |
Executes the CW sweep query command.
| index | CW tone generator index. |
| txIndex | Transmitter index associated with this component. |
| sweepStart | Start frequency (Hz) (return). |
| sweepStop | Stop frequency (Hz) (return). |
| sweepStep | Frequency step (Hz) (return). |
| dwellTime | Dwell time (ADC samples) (return). |
Definition at line 602 of file CWToneGenComponent.cpp.
|
protectedvirtual |
Executes the CW tone set command.
| index | CW tone generator index. |
| txIndex | Transmitter index associated with this component. |
| freq | Frequency (Hz). |
| amp | Amplitude (scale units). |
| phase | Phase (degrees). |
Definition at line 576 of file CWToneGenComponent.cpp.
|
protectedvirtual |
Executes the CW tone query command.
| index | CW tone generator index. |
| txIndex | Transmitter index associated with this component. |
| freq | Frequency (Hz) (return). |
| amp | Amplitude (scale units) (return). |
| phase | Phase (degrees) (return). |
Definition at line 544 of file CWToneGenComponent.cpp.
|
virtual |
Gets the signal amplitude.
Definition at line 405 of file CWToneGenComponent.cpp.
|
virtual |
Gets the amplitude range.
Definition at line 304 of file CWToneGenComponent.cpp.
|
virtual |
Gets the amplitude resolution.
Definition at line 312 of file CWToneGenComponent.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 |
Gets the debug name for this object.
Definition at line 138 of file Debuggable.cpp.
|
virtual |
Gets the dwell time range.
Definition at line 369 of file CWToneGenComponent.cpp.
|
virtual |
Gets the dwell time resolution.
Definition at line 377 of file CWToneGenComponent.cpp.
|
virtual |
Gets the constant frequency.
Definition at line 382 of file CWToneGenComponent.cpp.
|
virtual |
Gets the frequency range.
Definition at line 291 of file CWToneGenComponent.cpp.
|
virtual |
Gets the frequency resolution.
Definition at line 299 of file CWToneGenComponent.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.
|
virtual |
Gets the signal phase.
Definition at line 429 of file CWToneGenComponent.cpp.
|
virtual |
Gets the phase range.
Definition at line 317 of file CWToneGenComponent.cpp.
|
virtual |
Gets the phase resolution.
Definition at line 325 of file CWToneGenComponent.cpp.
|
virtual |
Gets the dwell time for a signal sweep.
Definition at line 473 of file CWToneGenComponent.cpp.
|
virtual |
Gets the frequency step for a signal sweep.
Definition at line 468 of file CWToneGenComponent.cpp.
|
virtual |
Gets the start frequency for a signal sweep.
Definition at line 458 of file CWToneGenComponent.cpp.
|
virtual |
Gets the sweep start range.
Definition at line 330 of file CWToneGenComponent.cpp.
|
virtual |
Gets the sweep start resolution.
Definition at line 338 of file CWToneGenComponent.cpp.
|
virtual |
Gets the sweep step range.
Definition at line 356 of file CWToneGenComponent.cpp.
|
virtual |
Gets the sweep step resolution.
Definition at line 364 of file CWToneGenComponent.cpp.
|
virtual |
Gets the stop frequency for a signal sweep.
Definition at line 463 of file CWToneGenComponent.cpp.
|
virtual |
Gets the sweep stop range.
Definition at line 343 of file CWToneGenComponent.cpp.
|
virtual |
Gets the sweep stop resolution.
Definition at line 351 of file CWToneGenComponent.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 CWToneGenComponent objects.
| other | The CWToneGenComponent object to copy. |
Definition at line 140 of file CWToneGenComponent.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 signal amplitude.
| amp | The new signal amplitude (scale units). |
Definition at line 410 of file CWToneGenComponent.cpp.
|
virtual |
Sets the configuration dictionary for this component.
| cfg | The component configuration dictionary. |
Reimplemented from RadioComponent.
Definition at line 184 of file CWToneGenComponent.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 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 constant frequency.
| freq | The new constant frequency (Hz). |
Definition at line 387 of file CWToneGenComponent.cpp.
|
virtual |
Sets the parameters for a frequency sweep.
| start | The new start frequency (Hz). |
| stop | The new stop frequency (Hz). |
| step | The new frequency step (Hz). |
| dwell | The new dwell time (ADC samples). |
Definition at line 478 of file CWToneGenComponent.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 |
Sets the signal phase.
| phase | The new signal phase (degrees). |
Definition at line 434 of file CWToneGenComponent.cpp.
|
virtual |
Gets whether or not the generator supports signal sweeps.
Definition at line 452 of file CWToneGenComponent.cpp.