libcyberradio  22.01.24
DucComponent.cpp
1 /***************************************************************************
2  * \file DucComponent.cpp
3  * \brief Defines the basic DUC interface for an NDR-class radio.
4  * \author DA
5  * \author NH
6  * \author MN
7  * \copyright (c) 2017 CyberRadio Solutions, Inc. All rights reserved.
8  *
9  ***************************************************************************/
10 
11 #include "LibCyberRadio/Driver/RadioHandler.h"
12 #include "LibCyberRadio/Driver/DucComponent.h"
13 #include "LibCyberRadio/Common/Pythonesque.h"
14 #include <boost/lexical_cast.hpp>
15 #include <sstream>
16 #include <iomanip>
17 
18 
19 namespace LibCyberRadio
20 {
21  namespace Driver
22  {
23 
25  const std::string& name,
26  int index,
27  RadioHandler* parent,
28  bool debug,
29  double freqRangeMin,
30  double freqRangeMax,
31  double freqRes,
32  double freqUnits,
33  double attRangeMin,
34  double attRangeMax,
35  double attRes,
36  int dataPort,
37  double frequency,
38  double attenuation,
39  int rateIndex,
40  int txChannels,
41  int mode,
42  unsigned int streamId) :
43  RadioComponent(name, index, parent, debug),
44  _freqRangeMin(freqRangeMin),
45  _freqRangeMax(freqRangeMax),
46  _freqRes(freqRes),
47  _freqUnits(freqUnits),
48  _attRangeMin(attRangeMin),
49  _attRangeMax(attRangeMax),
50  _attRes(attRes),
51  _dataPort(dataPort),
52  _frequency(frequency),
53  _attenuation(attenuation),
54  _rateIndex(rateIndex),
55  _txChannels(txChannels),
56  _mode(mode),
57  _streamId(streamId),
58  _supportsSnapLoad(false),
59  _snapFilename(""),
60  _snapStartSample(0),
61  _snapSamples(0),
62  _supportsSnapTransmit(false),
63  _snapSinglePlayback(false),
64  _snapPauseUntilEnabled(false)
65  {
66  // Call init function
68  }
69 
71  {
72  }
73 
75  RadioComponent(other),
76  _freqRangeMin(other._freqRangeMin),
77  _freqRangeMax(other._freqRangeMax),
78  _freqRes(other._freqRes),
79  _freqUnits(other._freqUnits),
80  _attRangeMin(other._attRangeMin),
81  _attRangeMax(other._attRangeMax),
82  _attRes(other._attRes),
83  _dataPort(other._dataPort),
84  _frequency(other._frequency),
85  _attenuation(other._attenuation),
86  _rateIndex(other._rateIndex),
87  _txChannels(other._txChannels),
88  _mode(other._mode),
89  _streamId(other._streamId),
90  _supportsSnapLoad(other._supportsSnapLoad),
91  _snapFilename(other._snapFilename),
92  _snapStartSample(other._snapStartSample),
93  _snapSamples(other._snapSamples),
94  _supportsSnapTransmit(other._supportsSnapTransmit),
95  _snapSinglePlayback(other._snapSinglePlayback),
96  _snapPauseUntilEnabled(other._snapPauseUntilEnabled)
97  {
98  }
99 
101  {
103  if ( this != &other )
104  {
105  _freqRangeMin = other._freqRangeMin;
106  _freqRangeMax = other._freqRangeMax;
107  _freqRes = other._freqRes;
108  _freqUnits = other._freqUnits;
109  _attRangeMin = other._attRangeMin;
110  _attRangeMax = other._attRangeMax;
111  _attRes = other._attRes;
112  _dataPort = other._dataPort;
113  _frequency = other._frequency;
114  _attenuation = other._attenuation;
115  _rateIndex = other._rateIndex;
116  _txChannels = other._txChannels;
117  _mode = other._mode;
118  _streamId = other._streamId;
119  _supportsSnapLoad = other._supportsSnapLoad;
120  _snapFilename = other._snapFilename;
121  _snapStartSample = other._snapStartSample;
122  _snapSamples = other._snapSamples;
123  _supportsSnapTransmit = other._supportsSnapTransmit;
124  _snapSinglePlayback = other._snapSinglePlayback;
125  _snapPauseUntilEnabled = other._snapPauseUntilEnabled;
126  }
127  return *this;
128  }
129 
130  bool DucComponent::enable(bool enabled)
131  {
132  return false;
133  }
134 
136  {
137  this->debug("[DucComponent::setConfiguration] Called\n");
138  // Call the "grandparent" version of this method instead of the
139  // parent version. We want the normalization, but not the
140  // automatic enabling.
141  bool ret = Configurable::setConfiguration(cfg);
142  // Use the keys provided in the *incoming* dictionary to determine
143  // what needs to be changed via hardware calls.
144  int adjDataPort = _dataPort;
145  double adjFrequency = _frequency;
146  double adjAttenuation = _attenuation;
147  int adjRateIndex = _rateIndex;
148  int adjTxChannels = _txChannels;
149  int adjMode = _mode;
150  unsigned int adjStreamId = _streamId;
151  bool ddcCmdNeedsExecuting = false;
152  bool snapLoadCmdNeedsExecuting = false;
153  bool snapTxCmdNeedsExecuting = false;
154  if ( cfg.hasKey("frequency") && _config.hasKey("frequency") )
155  {
156  adjFrequency = getConfigurationValueAsDbl("frequency");
157  ddcCmdNeedsExecuting = true;
158  }
159  if ( cfg.hasKey("attenuation") && _config.hasKey("attenuation") )
160  {
161  adjAttenuation = getConfigurationValueAsDbl("attenuation");
162  ddcCmdNeedsExecuting = true;
163  }
164  if ( cfg.hasKey("dataPort") && _config.hasKey("dataPort") )
165  {
166  adjDataPort = getConfigurationValueAsInt("dataPort");
167  ddcCmdNeedsExecuting = true;
168  }
169  if ( cfg.hasKey("rateIndex") && _config.hasKey("rateIndex") )
170  {
171  adjRateIndex = getConfigurationValueAsInt("rateIndex");
172  ddcCmdNeedsExecuting = true;
173  }
174  if ( cfg.hasKey("txChannels") && _config.hasKey("txChannels") )
175  {
176  adjTxChannels = getConfigurationValueAsInt("txChannels");
177  ddcCmdNeedsExecuting = true;
178  }
179  if ( cfg.hasKey("mode") && _config.hasKey("mode") )
180  {
181  adjMode = getConfigurationValueAsInt("mode");
182  ddcCmdNeedsExecuting = true;
183  }
184  if ( cfg.hasKey("streamId") && _config.hasKey("streamId") )
185  {
186  adjStreamId = getConfigurationValueAsUInt("streamId");
187  ddcCmdNeedsExecuting = true;
188  }
189  if ( cfg.hasKey("filename") && _config.hasKey("filename") )
190  {
191  snapLoadCmdNeedsExecuting = true;
192  }
193  if ( cfg.hasKey("singlePlayback") && _config.hasKey("singlePlayback") )
194  {
195  snapTxCmdNeedsExecuting = true;
196  }
197  if ( cfg.hasKey("pauseUntilEnabled") && _config.hasKey("pauseUntilEnabled") )
198  {
199  snapTxCmdNeedsExecuting = true;
200  }
201  if ( ddcCmdNeedsExecuting )
202  {
203  ret &= executeDucCommand(_index, adjDataPort, adjFrequency, adjAttenuation,
204  adjRateIndex, adjTxChannels, adjMode, adjStreamId);
205  }
206  if ( snapLoadCmdNeedsExecuting )
207  {
208  ret &= executeSnapshotLoadCommand(_index, _snapFilename, _snapStartSample,
209  _snapSamples);
210  }
211  if ( snapTxCmdNeedsExecuting )
212  {
213  //ret &= executeSnapshotTxCommand(_index, _snapStartSample,
214  // _snapSamples, _snapSinglePlayback,
215  // _snapPauseUntilEnabled);
216  }
217  if ( ret )
218  {
219  _dataPort = adjDataPort;
220  _frequency = adjFrequency;
221  _attenuation = adjAttenuation;
222  _rateIndex = adjRateIndex;
223  _txChannels = adjTxChannels;
224  _mode = adjMode;
225  _streamId = adjStreamId;
227  }
228  this->debug("[DucComponent::setConfiguration] Returning\n");
229 
230  return ret;
231  }
232 
234  {
235  this->debug("[DucComponent::queryConfiguration] Called\n");
236  if ( _config.hasKey("frequency") &&
237  _config.hasKey("attenuation") &&
238  _config.hasKey("dataPort") &&
239  _config.hasKey("rateIndex") &&
240  _config.hasKey("txChannels") &&
241  _config.hasKey("mode") &&
242  _config.hasKey("streamId") &&
243  _config.hasKey("filename") &&
244  _config.hasKey("singlePlayback") &&
245  _config.hasKey("pauseUntilEnabled") )
246  {
247  executeDucQuery(_index, _dataPort, _frequency, _attenuation,
248  _rateIndex, _txChannels, _mode, _streamId);
249  }
251  this->debug("[DucComponent::queryConfiguration] Returning\n");
252  }
253 
255  {
256  return _dataPort;
257  }
258 
260  {
261  bool ret = false;
262  if ( _config.hasKey("dataPort") )
263  {
264  int adjDataPort = port;
265  double adjFrequency = _frequency;
266  double adjAttenuation = _attenuation;
267  int adjRateIndex = _rateIndex;
268  int adjTxChannels = _txChannels;
269  int adjMode = _mode;
270  unsigned int adjStreamId = _streamId;
271  ret = executeDucCommand(_index, adjDataPort, adjFrequency, adjAttenuation,
272  adjRateIndex, adjTxChannels, adjMode, adjStreamId);
273  if ( ret )
274  {
275  _dataPort = adjDataPort;
277  }
278  }
279  return ret;
280  }
281 
283  {
284  return _frequency;
285  }
286 
287  bool DucComponent::setFrequency(double freq)
288  {
289  bool ret = false;
290  if ( _config.hasKey("frequency") )
291  {
292  int adjDataPort = _dataPort;
293  double adjFrequency = freq;
294  double adjAttenuation = _attenuation;
295  int adjRateIndex = _rateIndex;
296  int adjTxChannels = _txChannels;
297  int adjMode = _mode;
298  unsigned int adjStreamId = _streamId;
299  ret = executeDucCommand(_index, adjDataPort, adjFrequency, adjAttenuation,
300  adjRateIndex, adjTxChannels, adjMode, adjStreamId);
301  if ( ret )
302  {
303  _frequency = adjFrequency;
305  }
306  }
307  return ret;
308  }
309 
311  {
312  BasicDoubleList ret;
313  ret.push_back(_freqRangeMin);
314  ret.push_back(_freqRangeMax);
315  return ret;
316  }
317 
319  {
320  return _freqRes;
321  }
322 
324  {
325  return _freqUnits;
326  }
327 
329  {
330  return _attenuation;
331  }
332 
333  bool DucComponent::setAttenuation(double atten)
334  {
335  bool ret = false;
336  if ( _config.hasKey("attenuation") )
337  {
338  int adjDataPort = _dataPort;
339  double adjFrequency = _frequency;
340  double adjAttenuation = atten;
341  int adjRateIndex = _rateIndex;
342  int adjTxChannels = _txChannels;
343  int adjMode = _mode;
344  unsigned int adjStreamId = _streamId;
345  ret = executeDucCommand(_index, adjDataPort, adjFrequency, adjAttenuation,
346  adjRateIndex, adjTxChannels, adjMode, adjStreamId);
347  if ( ret )
348  {
349  _attenuation = adjAttenuation;
351  }
352  }
353  return ret;
354  }
355 
357  {
358  BasicDoubleList ret;
359  ret.push_back(_attRangeMin);
360  ret.push_back(_attRangeMax);
361  return ret;
362  }
363 
365  {
366  return _attRes;
367  }
368 
370  {
371  return _rateIndex;
372  }
373 
375  {
376  bool ret = false;
377  if ( _config.hasKey("rateIndex") )
378  {
379  int adjDataPort = _dataPort;
380  double adjFrequency = _frequency;
381  double adjAttenuation = _attenuation;
382  int adjRateIndex = index;
383  int adjTxChannels = _txChannels;
384  int adjMode = _mode;
385  unsigned int adjStreamId = _streamId;
386  ret = executeDucCommand(_index, adjDataPort, adjFrequency, adjAttenuation,
387  adjRateIndex, adjTxChannels, adjMode, adjStreamId);
388  if ( ret )
389  {
390  _rateIndex = adjRateIndex;
392  }
393  }
394  return ret;
395  }
396 
398  {
399  return _txChannels;
400  }
401 
402  bool DucComponent::setTxChannelBitmap(int txChannels)
403  {
404  bool ret = false;
405  if ( _config.hasKey("txChannels") )
406  {
407  int adjDataPort = _dataPort;
408  double adjFrequency = _frequency;
409  double adjAttenuation = _attenuation;
410  int adjRateIndex = _rateIndex;
411  int adjTxChannels = txChannels;
412  int adjMode = _mode;
413  unsigned int adjStreamId = _streamId;
414  bool ret = executeDucCommand(_index, adjDataPort, adjFrequency, adjAttenuation,
415  adjRateIndex, adjTxChannels, adjMode, adjStreamId);
416  if ( ret )
417  {
418  _txChannels = adjTxChannels;
420  }
421  }
422  return ret;
423  }
424 
426  {
427  return _mode;
428  }
429 
430  bool DucComponent::setMode(int mode)
431  {
432  bool ret = false;
433  if ( _config.hasKey("mode") )
434  {
435  int adjDataPort = _dataPort;
436  double adjFrequency = _frequency;
437  double adjAttenuation = _attenuation;
438  int adjRateIndex = _rateIndex;
439  int adjTxChannels = _txChannels;
440  int adjMode = mode;
441  unsigned int adjStreamId = _streamId;
442  ret = executeDucCommand(_index, adjDataPort, adjFrequency, adjAttenuation,
443  adjRateIndex, adjTxChannels, adjMode, adjStreamId);
444  if ( ret )
445  {
446  _mode = adjMode;
448  }
449  }
450  return ret;
451  }
452 
453  unsigned int DucComponent::getStreamId() const
454  {
455  return _streamId;
456  }
457 
458  bool DucComponent::setStreamId(unsigned int sid)
459  {
460  bool ret = false;
461  if ( _config.hasKey("streamId") )
462  {
463  int adjDataPort = _dataPort;
464  double adjFrequency = _frequency;
465  double adjAttenuation = _attenuation;
466  int adjRateIndex = _rateIndex;
467  int adjTxChannels = _txChannels;
468  int adjMode = _mode;
469  unsigned int adjStreamId = sid;
470  ret = executeDucCommand(_index, adjDataPort, adjFrequency, adjAttenuation,
471  adjRateIndex, adjTxChannels, adjMode, adjStreamId);
472  if ( ret )
473  {
474  _streamId = adjStreamId;
476  }
477  }
478  return ret;
479  }
480 
482  {
483  return _rateSet;
484  }
485 
487  {
488  _rateSet = set;
489  return true;
490  }
491 
493  {
494  BasicDoubleList ret;
495  for (WbddcRateSet::const_iterator it = _rateSet.begin(); it != _rateSet.end(); it++)
496  {
497  ret.push_back(it->second);
498  }
499  return ret;
500  }
501 
503  {
504  return true;
505  }
506 
507  bool DucComponent::loadSnapshot(const std::string& filename,
508  unsigned int startSample,
509  unsigned int samples)
510  {
511  bool ret = executeSnapshotLoadCommand(_index, filename,
512  startSample, samples);
513  if ( ret )
514  {
515  _snapFilename = filename;
516  _snapStartSample = startSample;
517  _snapSamples = samples;
519  }
520  return ret;
521  }
522 
524  {
525  return false;
526  }
527 
529  {
530  //this->debug("[DucComponent::initConfigurationDict] Called\n");
531  _config.clear();
532  // Call the base-class version
534  // Define DUC-specific keys
535  _config["dataPort"] = "";
536  _config["frequency"] = "";
537  _config["attenuation"] = "";
538  _config["rateIndex"] = "";
539  _config["txChannels"] = "";
540  _config["mode"] = "";
541  _config["streamId"] = "";
542  _config["filename"] = "";
543  _config["startSample"] = "";
544  _config["samples"] = "";
545  _config["singlePlayback"] = "";
546  _config["pauseUntilEnabled"] = "";
547  //this->debug("[DucComponent::initConfigurationDict] Returning\n");
548  }
549 
551  {
552  this->debug("[DucComponent::updateConfigurationDict] Called\n");
554  if ( _config.hasKey("dataPort") )
555  setConfigurationValueToInt("dataPort", _dataPort);
556  if ( _config.hasKey("frequency") )
557  setConfigurationValueToDbl("frequency", _frequency);
558  if ( _config.hasKey("attenuation") )
559  setConfigurationValueToDbl("attenuation", _attenuation);
560  if ( _config.hasKey("rateIndex") )
561  setConfigurationValueToInt("rateIndex", _rateIndex);
562  if ( _config.hasKey("txChannels") )
563  setConfigurationValueToInt("txChannels", _txChannels);
564  if ( _config.hasKey("mode") )
565  setConfigurationValueToInt("mode", _mode);
566  if ( _config.hasKey("streamId") )
567  setConfigurationValueToUInt("streamId", _streamId);
568  if ( _config.hasKey("filename") )
569  setConfigurationValue("filename", _snapFilename);
570  if ( _config.hasKey("startSample") )
571  setConfigurationValueToUInt("startSample", _snapStartSample);
572  if ( _config.hasKey("samples") )
573  setConfigurationValueToUInt("samples", _snapSamples);
574  if ( _config.hasKey("singlePlayback") )
575  setConfigurationValueToBool("singlePlayback", _snapSinglePlayback);
576  if ( _config.hasKey("pauseUntilEnabled") )
577  setConfigurationValueToBool("pauseUntilEnabled", _snapPauseUntilEnabled);
578  this->debug("[DucComponent::updateConfigurationDict] Returning\n");
579  }
580 
582  int& dataPort,
583  double& frequency,
584  double& attenuation,
585  int& rateIndex,
586  int& txChannels,
587  int& mode,
588  unsigned int& streamId)
589  {
590  bool ret = false;
591  if ( (_parent != NULL) && (_parent->isConnected()) )
592  {
593  std::ostringstream oss;
594  oss << "DUC? " << index << "\n";
595  BasicStringList rsp = _parent->sendCommand(oss.str(), 2.0);
596  if ( _parent->getLastCommandErrorInfo() == "" )
597  {
599  Pythonesque::Replace(rsp.front(), "DUC ", ""),
600  ", ");
601  // vec[0] = Index
602  // vec[1] = Data port
603  dataPort = boost::lexical_cast<int>(vec[1]);
604  // vec[2] = Frequency
605  frequency = boost::lexical_cast<double>(vec[2]);
606  // vec[3] = Attenuation
607  attenuation = boost::lexical_cast<double>(vec[3]);
608  // vec[4] = Rate index
609  rateIndex = boost::lexical_cast<int>(vec[4]);
610  // vec[5] = TX channel bitmap
611  txChannels = boost::lexical_cast<int>(vec[5]);
612  // vec[6] = Mode
613  mode = boost::lexical_cast<int>(vec[6]);
614  // vec[7] = Stream ID
615  streamId = boost::lexical_cast<unsigned int>(vec[7]);
616  ret = true;
617  }
618  }
619  return ret;
620  }
621 
623  int& dataPort,
624  double& frequency,
625  double& attenuation,
626  int& rateIndex,
627  int& txChannels,
628  int& mode,
629  unsigned int& streamId)
630  {
631  bool ret = false;
632  if ( (_parent != NULL) && (_parent->isConnected()) )
633  {
634  std::ostringstream oss;
635  oss << "DUC " << index
636  << ", " << dataPort
637  << ", " << std::setprecision(1) << std::fixed << frequency
638  << ", " << std::setprecision(1) << std::fixed << attenuation
639  << ", " << rateIndex
640  << ", " << txChannels
641  << ", " << mode
642  << ", " << streamId
643  << "\n";
644  BasicStringList rsp = _parent->sendCommand(oss.str(), 2.0);
645  if ( _parent->getLastCommandErrorInfo() == "" )
646  {
647  ret = true;
648  }
649  }
650  return ret;
651  }
652 
654  const std::string& filename,
655  unsigned int startSample,
656  unsigned int samples)
657  {
658  bool ret = false;
659  if ( (_parent != NULL) && (_parent->isConnected()) )
660  {
661  std::ostringstream oss;
662  oss << "LWF "
663  << filename
664  << ", " << index
665  << ", " << startSample;
666  if (samples > 0)
667  {
668  oss << ", " << samples;
669  }
670  oss << "\n";
671  BasicStringList rsp = _parent->sendCommand(oss.str(), 2.0);
672  if ( _parent->getLastCommandErrorInfo() == "" )
673  {
674  ret = true;
675  }
676  }
677  return ret;
678  }
679 
680  } // namespace Driver
681 
682 } // namespace LibCyberRadio
virtual void updateConfigurationDict()
Updates the configuration dictionary from component settings.
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.
virtual bool setAttenuation(double atten)
Sets the attenuation.
virtual void initConfigurationDict()
Initializes the configuration dictionary, defining the allowed keys.
virtual bool supportsSnapshotTransmit() const
Gets whether or not the DUC supports transmitting snapshots.
DucComponent(const std::string &name="DUC", int index=1, RadioHandler *parent=NULL, bool debug=false, double freqRangeMin=0.0, double freqRangeMax=0.0, double freqRes=1.0, double freqUnits=1.0, double attRangeMin=0.0, double attRangeMax=10.0, double attRes=1.0, int dataPort=0, double frequency=0.0, double attenuation=0.0, int rateIndex=0, int txChannels=0, int mode=0, unsigned int streamId=0)
Constructs a DucComponent object.
virtual bool supportsSnapshotLoad() const
Gets whether or not the DUC supports loading snapshot files.
virtual bool setConfigurationValueToDbl(const std::string &key, const double value)
Sets a named configuration value to a double value.
virtual int getMode() const
Gets the DUC&#39;s mode.
Base hardware component class.
virtual bool hasKey(const std::string &key) const
Determines if the dictionary has the given key.
BASIC_LIST_CONTAINER< double > BasicDoubleList
Type representing a list of doubles.
Definition: BasicList.h:29
virtual bool executeSnapshotLoadCommand(int index, const std::string &filename, unsigned int startSample, unsigned int samples)
Executes the DUC snapshot load command.
virtual bool setConfigurationValueToBool(const std::string &key, const bool value)
Sets a named configuration value to a Boolean.
virtual int getConfigurationValueAsInt(const std::string &key) const
Gets a named configuration value as an integer value.
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.
virtual bool setFrequency(double freq)
Sets the DUC tuned frequency.
virtual bool setTxChannelBitmap(int txChannels)
Sets the DUC&#39;s transmit channel bitmap.
virtual bool isConnected() const
Gets whether or not the handler is connected.
virtual RadioComponent & operator=(const RadioComponent &other)
Assignment operator for RadioComponent objects.
static std::string Replace(const std::string &str, const std::string &oldstr, const std::string &newstr, int count=INT_MAX)
Replaces occurrences of one substring with another within the given string.
Definition: Pythonesque.cpp:62
virtual bool setStreamId(unsigned int sid)
Sets the DUC&#39;s VITA 49 stream ID.
virtual ~DucComponent()
Destroys a DucComponent object.
virtual double getFrequencyRes() const
Gets the tuned frequency resolution.
virtual double getAttenuation() const
Gets the attenuation.
static BasicStringList Split(const std::string &str, const std::string &sep, int maxsplit=INT_MAX)
Splits the given string into a list of string tokens.
Definition: Pythonesque.cpp:77
virtual int getRateIndex() const
Gets the DUC&#39;s rate index.
virtual bool setConfigurationValueToUInt(const std::string &key, const unsigned int value)
Sets a named configuration value to an unsigned integer value.
virtual double getFrequencyUnit() const
Gets the tuned frequency units.
virtual DucComponent & operator=(const DucComponent &other)
Assignment operator for DucComponent objects.
Generic radio handler class.
Definition: RadioHandler.h:54
virtual int debug(const char *format,...)
Outputs debug information.
Definition: Debuggable.cpp:95
virtual BasicDoubleList getAttenuationRange() const
Gets the attenuation range.
BASIC_LIST_CONTAINER< std::string > BasicStringList
Type representing a list of strings.
Definition: BasicList.h:25
BASIC_DICT_CONTAINER< int, double > DucRateSet
A rate set for a DUC.
Definition: DucComponent.h:36
virtual int getDataPort() const
Gets the DUC&#39;s data port.
virtual void updateConfigurationDict()
Updates the configuration dictionary from component settings.
virtual void initConfigurationDict()
Initializes the configuration dictionary, defining the allowed keys.
virtual DucRateSet getRateSet() const
Gets the DUC&#39;s rate set.
Defines functionality for LibCyberRadio applications.
Definition: App.h:23
virtual bool setDataPort(int port)
Sets the DUC&#39;s data port.
virtual void queryConfiguration()
Tells the component to query its hardware configuration in order to create its configuration dictiona...
A configuration dictionary.
Definition: Configurable.h:51
virtual double getFrequency() const
Gets the tuned frequency.
virtual std::string getLastCommandErrorInfo() const
Gets the error message from the last command attempted.
virtual int getTxChannelBitmap() const
Gets the DUC&#39;s transmit channel bitmap.
virtual unsigned int getStreamId() const
Gets the DUC&#39;s VITA 49 stream ID.
virtual BasicDoubleList getFrequencyRange() const
Gets the tunable frequency range.
virtual bool enable(bool enabled=true)
Enables this component.
Base DUC component class.
Definition: DucComponent.h:65
virtual bool setConfiguration(ConfigurationDict &cfg)
Sets the configuration dictionary for this object.
virtual BasicStringList sendCommand(const std::string &cmdString, double timeout=-1)
Sends a command to the radio.
virtual double getAttenuationRes() const
Gets the attenuation resolution.
virtual BasicDoubleList getRateList() const
Gets the list of allowed sample rates, based on the rate set.
virtual bool setRateSet(const DucRateSet &set)
Sets the DUC rate set.
virtual bool loadSnapshot(const std::string &filename, unsigned int startSample=0, unsigned int samples=0)
Load a snapshot file into the DUC&#39;s memory block.
virtual double getConfigurationValueAsDbl(const std::string &key) const
Gets a named configuration value as a double value.
virtual unsigned int getConfigurationValueAsUInt(const std::string &key) const
Gets a named configuration value as an unsigned integer value.
virtual bool setConfigurationValue(const std::string &key, const std::string &value)
Sets a named configuration value to a string.
virtual bool setMode(int mode)
Sets the DUC&#39;s mode.
virtual bool setRateIndex(int index)
Sets the DUC&#39;s rate index.
virtual bool setConfiguration(ConfigurationDict &cfg)
Sets the configuration dictionary for this component.
virtual bool setConfigurationValueToInt(const std::string &key, const int value)
Sets a named configuration value to an integer value.