![]() |
libcyberradio
22.01.24
|
Flow control client class. More...
#include <FlowControlClient.h>
Public Member Functions | |
| FlowControlClient (unsigned int ducChannel, bool config_tx, unsigned int updatesPerSecond, bool debug=false) | |
| Constructs a FlowControlClient object. More... | |
| virtual | ~FlowControlClient () |
| Destroys a FlowControlClient object. | |
| virtual void | run () |
| Executes the main processing loop for the thread. | |
| void | update (void) |
| Updates the flow controller. | |
| bool | connectToRadio (const std::string &hostname, unsigned int port) |
| Connects to the radio. More... | |
| unsigned int | setUpdateRate (unsigned int updatesPerSecond) |
| Sets the update rate. More... | |
| unsigned int | getUpdateDelay () |
| Gets the update delay. More... | |
| void | setDucChannel (unsigned int ducChannel) |
| Sets the DUC channel number. More... | |
| bool | isConnected (void) |
| Gets whether or not the client is connected. More... | |
| bool | disconnect (void) |
| Disconnects the flow control client. More... | |
| void | testQueries (void) |
| Tests the flow control queries. | |
| long unsigned int | getUtc (void) |
| Gets the radio's UTC time. More... | |
| std::string | getRadioMac (unsigned int tenGbeIndex) |
| Gets the MAC address of a 10GigE port on the radio. More... | |
| std::string | getRadioIp (unsigned int tenGbeIndex) |
| Gets the IP address of a 10GigE port on the radio. More... | |
| bool | disableDuc () |
| Disables the DUC. More... | |
| bool | enableDuc (unsigned int rateIndex, unsigned int txChannel, unsigned int streamId, unsigned int tenGbeIndex, float attenuation, double txFreq, long ducFreq, unsigned int txAtten, bool ducEnable=true) |
| Enables the DUC. More... | |
| bool | setTxFrequency (double txFreq, bool applySetting=true) |
| Sets the transmitter frequency. More... | |
| bool | setTxAttenuation (unsigned int txAttenuation, bool applySetting=true) |
| Sets the transmitter attenuation. More... | |
| bool | setDucTxChannel (unsigned int txChannel, bool applySetting=true) |
| Sets the DUC transmitter bitmap. More... | |
| bool | setDucRateIndex (unsigned int rateIndex, bool applySetting=true) |
| Sets the DUC rate index. More... | |
| bool | setDucStreamId (unsigned int streamId, bool applySetting=true) |
| Sets the Stream ID. More... | |
| bool | setDucAttenuation (float attenuation, bool applySetting=true) |
| Sets the DUC attenuation. More... | |
| bool | setDucFrequency (long ducFreq, bool applySetting=true) |
| Sets the DUC frequency. More... | |
| bool | setDucTxinvMode (unsigned int txinvMode, bool applySetting=true) |
| Sets the DUC TX Inversion Mode. More... | |
| bool | setDucEnable (bool ducEnable, bool applySetting=true) |
| Sets whether or not the DUC is enabled. More... | |
| bool | setDucTenGbePort (unsigned int ducTenGbePort, bool applySetting=true) |
| Sets the 10GigE port used by the DUC. More... | |
| bool | okToSend (long int pendingSamples, bool lockIfOk) |
| Determines if it is OK to send data. More... | |
| long int | getFreeSpace (void) |
| Gets the amount of free space available. More... | |
| bool | sentNSamples (long int samplesSent) |
| Updates status based on the number of samples sent. More... | |
| virtual void | start () |
| Starts thread processing. | |
| virtual void | interrupt () |
| Interrupts (stops) the thread. | |
| virtual void | sleep (double secs) |
| Pauses thread execution for a given time, checking for user interrupts during that time. More... | |
| virtual bool | isRunning () const |
| Determines if the thread is running or not. More... | |
| virtual void | setName (const std::string &name) |
| Sets the name of the thread. More... | |
| virtual void | setClass (const std::string &cls) |
| Sets the class identifer string for the thread. More... | |
| virtual boost::thread::id | getId () const |
| Gets the identifier of the underlying Boost thread. More... | |
| virtual std::string | getIdString () const |
| Gets the identifier string for this thread. More... | |
| virtual void | onInterrupt () |
| Executes code that must run when the thread is interrupted. More... | |
| virtual void | onException (const std::exception &ex) |
| Executes code that must run when an unhandled exception occurs within the thread. 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... | |
Flow control client class.
Definition at line 41 of file FlowControlClient.h.
| FlowControlClient | ( | unsigned int | ducChannel, |
| bool | config_tx, | ||
| unsigned int | updatesPerSecond, | ||
| bool | debug = false |
||
| ) |
Constructs a FlowControlClient object.
| ducChannel | DUC channel number |
| config_tx | Whether or not to configure the transmitter |
| updatesPerSecond | Number of updates to make per second |
| debug | Whether or not to produce debug output |
Definition at line 27 of file FlowControlClient.cpp.
| bool connectToRadio | ( | const std::string & | hostname, |
| unsigned int | port | ||
| ) |
Connects to the radio.
| hostname | Radio host name |
| port | Radio TCP port number |
Definition at line 134 of file FlowControlClient.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.
| bool disableDuc | ( | ) |
Disables the DUC.
Definition at line 237 of file FlowControlClient.cpp.
| bool disconnect | ( | void | ) |
Disconnects the flow control client.
Definition at line 171 of file FlowControlClient.cpp.
| bool enableDuc | ( | unsigned int | rateIndex, |
| unsigned int | txChannel, | ||
| unsigned int | streamId, | ||
| unsigned int | tenGbeIndex, | ||
| float | attenuation, | ||
| double | txFreq, | ||
| long | ducFreq, | ||
| unsigned int | txAtten, | ||
| bool | ducEnable = true |
||
| ) |
Enables the DUC.
| rateIndex | DUC rate index |
| txChannel | Bitmap of transmitters the DUC will use |
| streamId | Stream ID |
| tenGbeIndex | 10GigE interface index |
| attenuation | DUC attenuation (dB) |
| txFreq | Transmitter frequency (Hz) |
| ducFreq | DUC frequency (Hz) |
| txAtten | Transmitter attenuation (dB) |
| ducEnable | Whether or not to enable the DUC |
Definition at line 245 of file FlowControlClient.cpp.
|
virtualinherited |
Gets the debug name for this object.
Definition at line 138 of file Debuggable.cpp.
| long int getFreeSpace | ( | void | ) |
Gets the amount of free space available.
Definition at line 349 of file FlowControlClient.cpp.
|
virtualinherited |
Gets the identifier of the underlying Boost thread.
Definition at line 91 of file Thread.cpp.
|
virtualinherited |
Gets the identifier string for this thread.
Definition at line 96 of file Thread.cpp.
| std::string getRadioIp | ( | unsigned int | tenGbeIndex | ) |
Gets the IP address of a 10GigE port on the radio.
| tenGbeIndex | 10GigE interface index |
Definition at line 209 of file FlowControlClient.cpp.
| std::string getRadioMac | ( | unsigned int | tenGbeIndex | ) |
Gets the MAC address of a 10GigE port on the radio.
| tenGbeIndex | 10GigE interface index |
Definition at line 180 of file FlowControlClient.cpp.
|
inline |
|
inline |
Gets the radio's UTC time.
Definition at line 109 of file FlowControlClient.h.
|
inline |
Gets whether or not the client is connected.
Definition at line 94 of file FlowControlClient.h.
|
virtualinherited |
Gets whether this object produces debug output.
Definition at line 133 of file Debuggable.cpp.
|
virtualinherited |
Determines if the thread is running or not.
Definition at line 72 of file Thread.cpp.
| bool okToSend | ( | long int | pendingSamples, |
| bool | lockIfOk | ||
| ) |
Determines if it is OK to send data.
| pendingSamples | Number of samples pending |
| lockIfOk | Whether or not to lock sending if sending is OK |
Definition at line 338 of file FlowControlClient.cpp.
|
virtualinherited |
Executes code that must run when an unhandled exception occurs within the thread.
The base-class method does nothing. Override this method in derived classes to perform custom exception processing.
| ex | The exception that occurred. |
Definition at line 110 of file Thread.cpp.
|
virtualinherited |
Executes code that must run when the thread is interrupted.
The base-class method does nothing. Override this method in derived classes to perform custom interrupt processing.
Definition at line 87 of file Thread.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.
| bool sentNSamples | ( | long int | samplesSent | ) |
Updates status based on the number of samples sent.
| samplesSent | Number of samples sent |
Definition at line 354 of file FlowControlClient.cpp.
|
virtualinherited |
Sets the class identifer string for the thread.
| cls | The new class identifer for the thread. |
Definition at line 82 of file Thread.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.
| bool setDucAttenuation | ( | float | attenuation, |
| bool | applySetting = true |
||
| ) |
Sets the DUC attenuation.
| attenuation | DUC attenuation (dB) |
| applySetting | Whether or not to apply the new setting immediately |
Definition at line 323 of file FlowControlClient.cpp.
| void setDucChannel | ( | unsigned int | ducChannel | ) |
Sets the DUC channel number.
| ducChannel | DUC channel number |
Definition at line 164 of file FlowControlClient.cpp.
| bool setDucEnable | ( | bool | ducEnable, |
| bool | applySetting = true |
||
| ) |
Sets whether or not the DUC is enabled.
| ducEnable | Whether or not to enable the DUC |
| applySetting | Whether or not to apply the new setting immediately |
Definition at line 287 of file FlowControlClient.cpp.
| bool setDucFrequency | ( | long | ducFreq, |
| bool | applySetting = true |
||
| ) |
Sets the DUC frequency.
| ducFreq | DUC frequency (Hz) |
| applySetting | Whether or not to apply the new setting immediately |
Definition at line 328 of file FlowControlClient.cpp.
| bool setDucRateIndex | ( | unsigned int | rateIndex, |
| bool | applySetting = true |
||
| ) |
Sets the DUC rate index.
| rateIndex | DUC rate index |
| applySetting | Whether or not to apply the new setting immediately |
Definition at line 310 of file FlowControlClient.cpp.
| bool setDucStreamId | ( | unsigned int | streamId, |
| bool | applySetting = true |
||
| ) |
Sets the Stream ID.
| streamId | Stream ID |
| applySetting | Whether or not to apply the new setting immediately |
Definition at line 316 of file FlowControlClient.cpp.
| bool setDucTenGbePort | ( | unsigned int | ducTenGbePort, |
| bool | applySetting = true |
||
| ) |
Sets the 10GigE port used by the DUC.
| ducTenGbePort | 10GigE interface index |
| applySetting | Whether or not to apply the new setting immediately |
Definition at line 282 of file FlowControlClient.cpp.
| bool setDucTxChannel | ( | unsigned int | txChannel, |
| bool | applySetting = true |
||
| ) |
Sets the DUC transmitter bitmap.
| txChannel | Bitmap of transmitters the DUC will use |
| applySetting | Whether or not to apply the new setting immediately |
Definition at line 298 of file FlowControlClient.cpp.
| bool setDucTxinvMode | ( | unsigned int | txinvMode, |
| bool | applySetting = true |
||
| ) |
Sets the DUC TX Inversion Mode.
| txinvMode | TX Inversion Mode (0=normal, 1=inverted) |
| applySetting | Whether or not to apply the new setting immediately |
Definition at line 333 of file FlowControlClient.cpp.
|
virtualinherited |
Sets the name of the thread.
| name | The new name of the thread. |
Definition at line 77 of file Thread.cpp.
| bool setTxAttenuation | ( | unsigned int | txAttenuation, |
| bool | applySetting = true |
||
| ) |
Sets the transmitter attenuation.
| txAttenuation | Transmitter attenuation (dB) |
| applySetting | Whether or not to apply the new setting immediately |
Definition at line 276 of file FlowControlClient.cpp.
| bool setTxFrequency | ( | double | txFreq, |
| bool | applySetting = true |
||
| ) |
Sets the transmitter frequency.
| txFreq | Transmitter frequency (Hz) |
| applySetting | Whether or not to apply the new setting immediately |
Definition at line 266 of file FlowControlClient.cpp.
| unsigned int setUpdateRate | ( | unsigned int | updatesPerSecond | ) |
Sets the update rate.
| updatesPerSecond | Number of updates to make per second |
Definition at line 157 of file FlowControlClient.cpp.
|
virtualinherited |
Pauses thread execution for a given time, checking for user interrupts during that time.
The sleep timer has microsecond resolution.
| secs | Number of seconds to "sleep". |
Definition at line 65 of file Thread.cpp.