libcyberradio  22.01.24
TransmitterComponent.cpp
1 /***************************************************************************
2  * \file TransmitterComponent.cpp
3  * \brief Defines the basic transmitter 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/TransmitterComponent.h"
12 #include "LibCyberRadio/Driver/RadioHandler.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 numToneGen,
37  int toneGenIndexBase,
38  double frequency,
39  double attenuation) :
40  RadioComponent(name, index, parent, debug),
41  _freqRangeMin(freqRangeMin),
42  _freqRangeMax(freqRangeMax),
43  _freqRes(freqRes),
44  _freqUnits(freqUnits),
45  _attRangeMin(attRangeMin),
46  _attRangeMax(attRangeMax),
47  _attRes(attRes),
48  _numToneGen(numToneGen),
49  _toneGenIndexBase(toneGenIndexBase),
50  _frequency(frequency),
51  _attenuation(attenuation)
52  {
53  // Call init function
55  }
56 
58  {
59  for ( CWToneGenComponentDict::iterator it = _cwToneGens.begin();
60  it != _cwToneGens.end(); it++)
61  {
62  delete it->second;
63  }
64  }
65 
67  RadioComponent(other),
68  _freqRangeMin(other._freqRangeMin),
69  _freqRangeMax(other._freqRangeMax),
70  _freqRes(other._freqRes),
71  _freqUnits(other._freqUnits),
72  _attRangeMin(other._attRangeMin),
73  _attRangeMax(other._attRangeMax),
74  _attRes(other._attRes),
75  _numToneGen(other._numToneGen),
76  _toneGenIndexBase(other._toneGenIndexBase),
77  _frequency(other._frequency),
78  _attenuation(other._attenuation)
79  {
80  }
81 
83  {
85  if ( this != &other )
86  {
87  _freqRangeMin = other._freqRangeMin;
88  _freqRangeMax = other._freqRangeMax;
89  _freqRes = other._freqRes;
90  _freqUnits = other._freqUnits;
91  _attRangeMin = other._attRangeMin;
92  _attRangeMax = other._attRangeMax;
93  _attRes = other._attRes;
94  _numToneGen = other._numToneGen;
95  _toneGenIndexBase = other._toneGenIndexBase;
96  _frequency = other._frequency;
97  _attenuation = other._attenuation;
98  }
99  return *this;
100  }
101 
102  bool TransmitterComponent::enable(bool enabled)
103  {
104  bool adjEnabled = enabled;
105  bool ret = false;
106  if ( _config.hasKey("enable") )
107  {
108  ret = executeEnableCommand(_index, adjEnabled);
109  if ( ret )
110  {
111  // If the hardware call succeeds, call the base class version
112  RadioComponent::enable(adjEnabled);
113  }
114  }
115  return ret;
116  }
117 
119  {
120  this->debug("[TransmitterComponent::setConfiguration] Called\n");
121  // Call the base-class version to modify the configuration dictionary
122  // (this including any enabling/disabling)
123  bool ret = RadioComponent::setConfiguration(cfg);
124  // Use the keys provided in the *incoming* dictionary to determine
125  // what needs to be changed via hardware calls.
126  if ( cfg.hasKey("frequency") && _config.hasKey("frequency") )
127  {
128  try
129  {
130  double inFreq = boost::lexical_cast<double>( cfg["frequency"] );
131  //this->debug("[setConfiguration] -- set freq = %0.1f\n", inFreq);
132  ret &= setFrequency( inFreq );
133  }
134  catch(std::exception& ex)
135  {
136  }
137  }
138  else
139  {
140  //this->debug("[setConfiguration] -- CAN'T set freq = not in incoming\n");
141  }
142  if ( cfg.hasKey("attenuation") && _config.hasKey("attenuation") )
143  {
144  try
145  {
146  double inAtten = boost::lexical_cast<double>( cfg["attenuation"] );
147  //this->debug("[setConfiguration] -- set atten = %0.1f\n", inAtten);
148  ret &= setAttenuation( inAtten );
149  }
150  catch(std::exception& ex)
151  {
152  }
153  }
154  else
155  {
156  //this->debug("[setConfiguration] -- CAN'T set atten = not in incoming\n");
157  }
158  this->debug("[TransmitterComponent::setConfiguration] Returning %s\n", debugBool(ret));
159  return ret;
160  }
161 
163  {
164  this->debug("[TransmitterComponent::queryConfiguration] Called\n");
165  if ( _config.hasKey("enable") )
166  {
167  executeEnableQuery(_index, _enabled);
168  }
169  if ( _config.hasKey("frequency") )
170  {
171  executeFreqQuery(_index, _frequency);
172  }
173  if ( _config.hasKey("attenuation") )
174  {
175  executeAttenQuery(_index, _attenuation);
176  }
178  // Query configuration of CW tone generators
179  for ( CWToneGenComponentDict::iterator it = _cwToneGens.begin();
180  it != _cwToneGens.end(); it++)
181  {
182  it->second->queryConfiguration();
183  }
184  this->debug("[TransmitterComponent::queryConfiguration] Returning\n");
185  }
186 
188  {
189  return _frequency;
190  }
191 
193  {
194  double adjFreq = freq;
195  bool ret = false;
196  if ( _config.hasKey("frequency") )
197  {
198  ret = executeFreqCommand(_index, adjFreq);
199  if ( ret )
200  {
201  _frequency = adjFreq;
203  }
204  }
205  return ret;
206  }
207 
209  {
210  return _attenuation;
211  }
212 
214  {
215  double adjAtten = atten;
216  bool ret = false;
217  if ( _config.hasKey("attenuation") )
218  {
219  ret = executeAttenCommand(_index, adjAtten);
220  if ( ret )
221  {
222  _attenuation = adjAtten;
224  }
225  }
226  return ret;
227  }
228 
230  {
231  BasicDoubleList ret;
232  ret.push_back(_freqRangeMin);
233  ret.push_back(_freqRangeMax);
234  return ret;
235  }
236 
238  {
239  return _freqRes;
240  }
241 
243  {
244  return _freqUnits;
245  }
246 
248  {
249  BasicDoubleList ret;
250  ret.push_back(_attRangeMin);
251  ret.push_back(_attRangeMax);
252  return ret;
253  }
254 
256  {
257  return _attRes;
258  }
259 
261  {
262  return ( _numToneGen > 0 );
263  }
264 
266  {
267  return _numToneGen;
268  }
269 
271  {
272  BasicIntList ret;
273  for (int num = _toneGenIndexBase; num < _toneGenIndexBase + _numToneGen;
274  num++)
275  ret.push_back(num);
276  return ret;
277  }
278 
280  {
281  BasicDoubleList ret;
282  CWToneGenComponentDict::const_iterator it = _cwToneGens.begin();
283  if ( it != _cwToneGens.end() )
284  ret = it->second->getFrequencyRange();
285  return ret;
286  }
287 
289  {
290  double ret = 0.0;
291  CWToneGenComponentDict::const_iterator it = _cwToneGens.begin();
292  if ( it != _cwToneGens.end() )
293  ret = it->second->getFrequencyRes();
294  return ret;
295  }
296 
298  {
299  BasicDoubleList ret;
300  CWToneGenComponentDict::const_iterator it = _cwToneGens.begin();
301  if ( it != _cwToneGens.end() )
302  ret = it->second->getAmplitudeRange();
303  return ret;
304  }
305 
307  {
308  double ret = 0.0;
309  CWToneGenComponentDict::const_iterator it = _cwToneGens.begin();
310  if ( it != _cwToneGens.end() )
311  ret = it->second->getAmplitudeRes();
312  return ret;
313  }
314 
316  {
317  BasicDoubleList ret;
318  CWToneGenComponentDict::const_iterator it = _cwToneGens.begin();
319  if ( it != _cwToneGens.end() )
320  ret = it->second->getPhaseRange();
321  return ret;
322  }
323 
325  {
326  double ret = 0.0;
327  CWToneGenComponentDict::const_iterator it = _cwToneGens.begin();
328  if ( it != _cwToneGens.end() )
329  ret = it->second->getPhaseRes();
330  return ret;
331  }
332 
334  {
335  bool ret = false;
336  CWToneGenComponentDict::const_iterator it = _cwToneGens.begin();
337  if ( it != _cwToneGens.end() )
338  ret = it->second->supportsSweep();
339  return ret;
340  }
341 
343  {
344  BasicDoubleList ret;
345  CWToneGenComponentDict::const_iterator it = _cwToneGens.begin();
346  if ( it != _cwToneGens.end() )
347  ret = it->second->getSweepStartRange();
348  return ret;
349  }
350 
352  {
353  double ret = 0.0;
354  CWToneGenComponentDict::const_iterator it = _cwToneGens.begin();
355  if ( it != _cwToneGens.end() )
356  ret = it->second->getSweepStartRes();
357  return ret;
358  }
359 
361  {
362  BasicDoubleList ret;
363  CWToneGenComponentDict::const_iterator it = _cwToneGens.begin();
364  if ( it != _cwToneGens.end() )
365  ret = it->second->getSweepStopRange();
366  return ret;
367  }
368 
370  {
371  double ret = 0.0;
372  CWToneGenComponentDict::const_iterator it = _cwToneGens.begin();
373  if ( it != _cwToneGens.end() )
374  ret = it->second->getSweepStopRes();
375  return ret;
376  }
377 
379  {
380  BasicDoubleList ret;
381  CWToneGenComponentDict::const_iterator it = _cwToneGens.begin();
382  if ( it != _cwToneGens.end() )
383  ret = it->second->getSweepStepRange();
384  return ret;
385  }
386 
388  {
389  double ret = 0.0;
390  CWToneGenComponentDict::const_iterator it = _cwToneGens.begin();
391  if ( it != _cwToneGens.end() )
392  ret = it->second->getSweepStepRes();
393  return ret;
394  }
395 
397  {
398  BasicDoubleList ret;
399  CWToneGenComponentDict::const_iterator it = _cwToneGens.begin();
400  if ( it != _cwToneGens.end() )
401  ret = it->second->getDwellTimeRange();
402  return ret;
403  }
404 
406  {
407  double ret = 0.0;
408  CWToneGenComponentDict::const_iterator it = _cwToneGens.begin();
409  if ( it != _cwToneGens.end() )
410  ret = it->second->getDwellTimeRes();
411  return ret;
412  }
413 
414  bool TransmitterComponent::enableCW(int index, bool enabled)
415  {
416  bool ret = false;
417  CWToneGenComponentDict::const_iterator it = _cwToneGens.begin();
418  if ( it != _cwToneGens.end() )
419  ret = it->second->enable(enabled);
420  return ret;
421  }
422 
424  {
425  return enableCW(index, false);
426  }
427 
429  {
430  ConfigurationDict ret;
431  CWToneGenComponentDict::const_iterator it = _cwToneGens.begin();
432  if ( it != _cwToneGens.end() )
433  ret = it->second->getConfiguration();
434  return ret;
435  }
436 
438  {
439  bool ret = false;
440  CWToneGenComponentDict::const_iterator it = _cwToneGens.begin();
441  if ( it != _cwToneGens.end() )
442  ret = it->second->setConfiguration(cfg);
443  return ret;
444  }
445 
446  double TransmitterComponent::getCWFrequency(int index) const
447  {
448  double ret = 0.0;
449  CWToneGenComponentDict::const_iterator it = _cwToneGens.begin();
450  if ( it != _cwToneGens.end() )
451  ret = it->second->getFrequency();
452  return ret;
453  }
454 
455  bool TransmitterComponent::setCWFrequency(int index, double freq)
456  {
457  bool ret = false;
458  CWToneGenComponentDict::const_iterator it = _cwToneGens.begin();
459  if ( it != _cwToneGens.end() )
460  ret = it->second->setFrequency(freq);
461  return ret;
462  }
463 
464  double TransmitterComponent::getCWAmplitude(int index) const
465  {
466  double ret = 0.0;
467  CWToneGenComponentDict::const_iterator it = _cwToneGens.begin();
468  if ( it != _cwToneGens.end() )
469  ret = it->second->getAmplitude();
470  return ret;
471  }
472 
473  bool TransmitterComponent::setCWAmplitude(int index, double amp)
474  {
475  bool ret = false;
476  CWToneGenComponentDict::const_iterator it = _cwToneGens.begin();
477  if ( it != _cwToneGens.end() )
478  ret = it->second->setAmplitude(amp);
479  return ret;
480  }
481 
482  double TransmitterComponent::getCWPhase(int index) const
483  {
484  double ret = 0.0;
485  CWToneGenComponentDict::const_iterator it = _cwToneGens.begin();
486  if ( it != _cwToneGens.end() )
487  ret = it->second->getPhase();
488  return ret;
489  }
490 
491  bool TransmitterComponent::setCWPhase(int index, double phase)
492  {
493  bool ret = false;
494  CWToneGenComponentDict::const_iterator it = _cwToneGens.begin();
495  if ( it != _cwToneGens.end() )
496  ret = it->second->setPhase(phase);
497  return ret;
498  }
499 
501  {
502  bool ret = false;
503  CWToneGenComponentDict::const_iterator it = _cwToneGens.begin();
504  if ( it != _cwToneGens.end() )
505  ret = it->second->supportsSweep();
506  return ret;
507  }
508 
510  {
511  double ret = 0.0;
512  CWToneGenComponentDict::const_iterator it = _cwToneGens.begin();
513  if ( it != _cwToneGens.end() )
514  ret = it->second->getSweepStartFrequency();
515  return ret;
516  }
517 
519  {
520  double ret = 0.0;
521  CWToneGenComponentDict::const_iterator it = _cwToneGens.begin();
522  if ( it != _cwToneGens.end() )
523  ret = it->second->getSweepStopFrequency();
524  return ret;
525  }
526 
528  {
529  double ret = 0.0;
530  CWToneGenComponentDict::const_iterator it = _cwToneGens.begin();
531  if ( it != _cwToneGens.end() )
532  ret = it->second->getSweepFrequencyStep();
533  return ret;
534  }
535 
537  {
538  double ret = 0.0;
539  CWToneGenComponentDict::const_iterator it = _cwToneGens.begin();
540  if ( it != _cwToneGens.end() )
541  ret = it->second->getSweepDwellTime();
542  return ret;
543  }
544 
545  bool TransmitterComponent::setCWFrequencySweep(int index, double start,
546  double stop, double step,
547  double dwell)
548  {
549  bool ret = false;
550  CWToneGenComponentDict::const_iterator it = _cwToneGens.begin();
551  if ( it != _cwToneGens.end() )
552  ret = it->second->setFrequencySweep(start, stop, step, dwell);
553  return ret;
554  }
555 
557  {
558  //this->debug("[TransmitterComponent::initConfigurationDict] Called\n");
559  _config.clear();
560  // Call the base-class version
562  // Define tuner-specific keys
563  _config["frequency"] = "";
564  _config["attenuation"] = "";
565  //this->debug("[TransmitterComponent::initConfigurationDict] Returning\n");
566  }
567 
569  {
570  this->debug("[TransmitterComponent::updateConfigurationDict] Called\n");
572  if ( _config.hasKey("frequency") )
573  {
574  setConfigurationValueToDbl("frequency", _frequency);
575  }
576  if ( _config.hasKey("attenuation") )
577  {
578  setConfigurationValueToDbl("attenuation", _attenuation);
579  }
580  this->debug("[TransmitterComponent::updateConfigurationDict] Returning\n");
581  }
582 
583  // Enable query uses the NDR651 implementation as the base
584  bool TransmitterComponent::executeEnableQuery(int index, bool& enabled)
585  {
586  bool ret = false;
587  if ( (_parent != NULL) && (_parent->isConnected()) )
588  {
589  std::ostringstream oss;
590  oss << "TXP? " << index << "\n";
591  BasicStringList rsp = _parent->sendCommand(oss.str(), 2.0);
592  if ( _parent->getLastCommandErrorInfo() == "" )
593  {
595  Pythonesque::Replace(rsp.front(), "TXP ", ""),
596  ", ");
597  // vec[0] = Index
598  // vec[1] = Powered state (0=off, 1=on)
599  enabled = (boost::lexical_cast<int>(vec[1]) == 1);
600  ret = true;
601  }
602  }
603  return ret;
604 
605  }
606 
607  // Frequency query uses the NDR651 implementation as the base
608  bool TransmitterComponent::executeFreqQuery(int index, double& freq)
609  {
610  bool ret = false;
611  if ( (_parent != NULL) && (_parent->isConnected()) )
612  {
613  std::ostringstream oss;
614  oss << "TXF? " << index << "\n";
615  BasicStringList rsp = _parent->sendCommand(oss.str(), 2.0);
616  if ( _parent->getLastCommandErrorInfo() == "" )
617  {
619  Pythonesque::Replace(rsp.front(), "TXF ", ""),
620  ", ");
621  // vec[0] = Index
622  // vec[1] = Frequency (MHz) [FLOATING POINT]
623  freq = boost::lexical_cast<double>(vec[1]) * _freqUnits;
624  ret = true;
625  }
626  }
627  return ret;
628  }
629 
630  // Attenuation query uses the NDR651 implementation as the base
631  bool TransmitterComponent::executeAttenQuery(int index, double& atten)
632  {
633  bool ret = false;
634  if ( (_parent != NULL) && (_parent->isConnected()) )
635  {
636  std::ostringstream oss;
637  oss << "TXA? " << index << "\n";
638  BasicStringList rsp = _parent->sendCommand(oss.str(), 2.0);
639  if ( _parent->getLastCommandErrorInfo() == "" )
640  {
642  Pythonesque::Replace(rsp.front(), "TXA ", ""),
643  ", ");
644  // vec[0] = Index
645  // vec[1] = Atten (dB)
646  atten = boost::lexical_cast<double>(vec[1]);
647  ret = true;
648  }
649  }
650  return ret;
651  }
652 
653  // Enable command uses the NDR651 implementation as the base
654  bool TransmitterComponent::executeEnableCommand(int index, bool& enabled)
655  {
656  bool ret = false;
657  if ( (_parent != NULL) && (_parent->isConnected()) )
658  {
659  std::ostringstream oss;
660  oss << "TXP " << index
661  << ", " << (enabled ? 1 : 0)
662  << "\n";
663  BasicStringList rsp = _parent->sendCommand(oss.str(), 2.0);
664  if ( _parent->getLastCommandErrorInfo() == "" )
665  {
666  ret = true;
667  }
668  }
669  return ret;
670  }
671 
672  // Frequency command uses the NDR651 implementation as the base
673  bool TransmitterComponent::executeFreqCommand(int index, double& freq)
674  {
675  bool ret = false;
676  if ( (_parent != NULL) && (_parent->isConnected()) )
677  {
678  std::ostringstream oss;
679  oss << "TXF " << index
680  << ", " << std::setprecision(6) << std::fixed << (freq / _freqUnits)
681  << "\n";
682  BasicStringList rsp = _parent->sendCommand(oss.str(), 2.0);
683  if ( _parent->getLastCommandErrorInfo() == "" )
684  {
685  freq = (freq / _freqUnits);
686  ret = true;
687  }
688  }
689  return ret;
690  }
691 
692  // Attenuation command uses the NDR651 implementation as the base
693  bool TransmitterComponent::executeAttenCommand(int index, double& atten)
694  {
695  bool ret = false;
696  if ( (_parent != NULL) && (_parent->isConnected()) )
697  {
698  std::ostringstream oss;
699  oss << "TXA " << index
700  << ", " << std::setprecision(1) << std::fixed << atten
701  << "\n";
702  BasicStringList rsp = _parent->sendCommand(oss.str(), 2.0);
703  if ( _parent->getLastCommandErrorInfo() == "" )
704  {
705  ret = true;
706  }
707  }
708  return ret;
709  }
710 
711  } // namespace Driver
712 
713 } // namespace LibCyberRadio
714 
virtual void updateConfigurationDict()
Updates the configuration dictionary from component settings.
virtual bool executeFreqCommand(int index, double &freq)
Executes the tuner frequency set command.
virtual bool setCWConfiguration(int index, ConfigurationDict &cfg)
Sets the configuration dictionary for a given CW tone generator.
virtual double getCWAmplitude(int index) const
Gets the signal amplitude for a given CW tone generator.
virtual bool setFrequency(double freq)
Sets the transmitter center frequency.
virtual void updateConfigurationDict()
Updates the configuration dictionary from component settings.
virtual bool supportsCWSweep() const
Gets whether the transmitter supports CW tone sweeping.
virtual bool executeAttenQuery(int index, double &atten)
Executes the tuner attenuation query command.
virtual bool setConfigurationValueToDbl(const std::string &key, const double value)
Sets a named configuration value to a double value.
virtual BasicIntList getCWIndexRange() const
Gets the range of indices for CW tone generators.
Base transmitter component class.
virtual double getCWFrequency(int index) const
Gets the constant frequency for a given CW tone generator.
Base hardware component class.
virtual bool hasKey(const std::string &key) const
Determines if the dictionary has the given key.
virtual bool setConfiguration(ConfigurationDict &cfg)
Sets the configuration dictionary for this component.
virtual BasicDoubleList getCWPhaseRange() const
Gets the CW phase range.
virtual bool enableCW(int index, bool enabled=true)
Enables a given CW tone generator.
BASIC_LIST_CONTAINER< double > BasicDoubleList
Type representing a list of doubles.
Definition: BasicList.h:29
virtual bool executeEnableCommand(int index, bool &enabled)
Executes the tuner enable command.
virtual double getFrequency() const
Gets the transmitter center frequency.
virtual double getCWSweepFrequencyStep(int index) const
Gets the frequency step for a signal sweep for a given CW tone generator.
virtual double getCWSweepDwellTime(int index) const
Gets the dwell time for a signal sweep for a given CW tone generator.
virtual bool setCWPhase(int index, double phase)
Sets the signal phase for a given CW tone generator.
virtual double getCWSweepStartRes() const
Gets the CW start frequency resolution.
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 double getCWSweepStopRes() const
Gets the CW stop frequency resolution.
virtual double getCWFrequencyRes() const
Gets the CW frequency resolution.
virtual BasicDoubleList getFrequencyRange() const
Gets the transmitter center frequency range.
virtual bool setCWFrequency(int index, double freq)
Sets the constant frequency for a given CW tone generator.
virtual double getCWSweepStartFrequency(int index) const
Gets the start frequency for a signal sweep for a given CW tone generator.
virtual void queryConfiguration()
Tells the component to query its hardware configuration in order to create its configuration dictiona...
virtual double getCWSweepDwellRes() const
Gets the CW dwell time resolution.
virtual bool setCWAmplitude(int index, double amp)
Sets the signal amplitude for a given CW tone generator.
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.
virtual BasicDoubleList getCWSweepStopRange() const
Gets the CW stop frequency range.
virtual bool enable(bool enabled=true)
Enables this component.
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.
virtual BasicDoubleList getCWAmplitudeRange() const
Gets the CW amplitude range.
virtual bool setAttenuation(double atten)
Sets 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 double getCWSweepStopFrequency(int index) const
Gets the stop frequency for a signal sweep for a given CW tone generator.
virtual BasicDoubleList getCWSweepStepRange() const
Gets the CW frequency step range.
virtual int getCWNum() const
Gets the number of CW tone generators associated with this transmitter.
Generic radio handler class.
Definition: RadioHandler.h:54
virtual bool disableCW(int index)
Disables a given CW tone generator.
virtual int debug(const char *format,...)
Outputs debug information.
Definition: Debuggable.cpp:95
virtual ConfigurationDict getCWConfiguration(int index) const
Gets the configuration for a given CW tone generator.
virtual double getCWAmplitudeRes() const
Gets the CW amplitude resolution.
BASIC_LIST_CONTAINER< std::string > BasicStringList
Type representing a list of strings.
Definition: BasicList.h:25
virtual bool supportsCW() const
Gets whether the transmitter supports CW tone generation.
virtual BasicDoubleList getCWSweepStartRange() const
Gets the CW start frequency range.
virtual bool executeEnableQuery(int index, bool &enabled)
Executes the tuner enabled query command.
virtual void initConfigurationDict()
Initializes the configuration dictionary, defining the allowed keys.
virtual ~TransmitterComponent()
Destroys a TransmitterComponent object.
Defines functionality for LibCyberRadio applications.
Definition: App.h:23
virtual double getAttenuation() const
Gets the attenuation.
virtual BasicDoubleList getAttenuationRange() const
Gets the attenuation range.
virtual bool executeAttenCommand(int index, double &atten)
Executes the tuner attenuation set command.
A configuration dictionary.
Definition: Configurable.h:51
virtual double getCWPhaseRes() const
Gets the CW phase resolution.
virtual std::string getLastCommandErrorInfo() const
Gets the error message from the last command attempted.
virtual const char * debugBool(bool x)
Gets a debug output string for a Boolean value.
Definition: Debuggable.cpp:126
virtual TransmitterComponent & operator=(const TransmitterComponent &other)
Assignment operator for TransmitterComponent objects.
virtual double getAttenuationRes() const
Gets the attenuation resolution.
virtual BasicStringList sendCommand(const std::string &cmdString, double timeout=-1)
Sends a command to the radio.
virtual BasicDoubleList getCWSweepDwellRange() const
Gets the CW dwell time range.
BASIC_LIST_CONTAINER< int > BasicIntList
Type representing a list of integers.
Definition: BasicList.h:27
virtual bool executeFreqQuery(int index, double &freq)
Executes the tuner frequency query command.
virtual bool enable(bool enabled=true)
Enables this component.
virtual bool setConfiguration(ConfigurationDict &cfg)
Sets the configuration dictionary for this component.
virtual double getFrequencyUnit() const
Gets the transmitter center frequency units.
virtual void initConfigurationDict()
Initializes the configuration dictionary, defining the allowed keys.
virtual double getFrequencyRes() const
Gets the transmitter center frequency resolution.
virtual BasicDoubleList getCWFrequencyRange() const
Gets the CW frequency range.
virtual double getCWSweepStepRes() const
Gets the CW frequency step resolution.
virtual double getCWPhase(int index) const
Gets the signal phase for a given CW tone generator.