libcyberradio  22.01.24
CWToneGenComponent.cpp
1 /***************************************************************************
2  * \file CWToneGenComponent.cpp
3  * \brief Defines the basic continuous-wave (CW) tone generator interface
4  * for an NDR-class radio.
5  * \author DA
6  * \author NH
7  * \author MN
8  * \copyright (c) 2017 CyberRadio Solutions, Inc. All rights reserved.
9  *
10  ***************************************************************************/
11 
12 #include "LibCyberRadio/Driver/CWToneGenComponent.h"
13 #include "LibCyberRadio/Driver/RadioHandler.h"
14 #include "LibCyberRadio/Common/Pythonesque.h"
15 #include <boost/lexical_cast.hpp>
16 #include <sstream>
17 #include <iomanip>
18 #include <string>
19 
20 
21 namespace LibCyberRadio
22 {
23 
24  namespace Driver
25  {
26 
28  const std::string& name,
29  int index,
30  RadioHandler* parent,
31  bool debug,
32  int txIndex,
33  double freqRangeMin,
34  double freqRangeMax,
35  double freqRes,
36  double freqUnits,
37  double ampRangeMin,
38  double ampRangeMax,
39  double ampRes,
40  double phaseRangeMin,
41  double phaseRangeMax,
42  double phaseRes,
43  double sweepStartRangeMin,
44  double sweepStartRangeMax,
45  double sweepStartRes,
46  double sweepStopRangeMin,
47  double sweepStopRangeMax,
48  double sweepStopRes,
49  double sweepStepRangeMin,
50  double sweepStepRangeMax,
51  double sweepStepRes,
52  double dwellTimeRangeMin,
53  double dwellTimeRangeMax,
54  double dwellTimeRes,
55  double frequency,
56  double amplitude,
57  double phase,
58  double sweepStart,
59  double sweepStop,
60  double sweepStep,
61  double dwellTime
62  ) :
63  RadioComponent(name, index, parent, debug),
64  _txIndex(txIndex),
65  _freqRangeMin(freqRangeMin),
66  _freqRangeMax(freqRangeMax),
67  _freqRes(freqRes),
68  _freqUnits(freqUnits),
69  _ampRangeMin(ampRangeMin),
70  _ampRangeMax(ampRangeMax),
71  _ampRes(ampRes),
72  _phaseRangeMin(phaseRangeMin),
73  _phaseRangeMax(phaseRangeMax),
74  _phaseRes(phaseRes),
75  _sweepStartRangeMin(sweepStartRangeMin),
76  _sweepStartRangeMax(sweepStartRangeMax),
77  _sweepStartRes(sweepStartRes),
78  _sweepStopRangeMin(sweepStopRangeMin),
79  _sweepStopRangeMax(sweepStopRangeMax),
80  _sweepStopRes(sweepStopRes),
81  _sweepStepRangeMin(sweepStepRangeMin),
82  _sweepStepRangeMax(sweepStepRangeMax),
83  _sweepStepRes(sweepStepRes),
84  _dwellTimeRangeMin(dwellTimeRangeMin),
85  _dwellTimeRangeMax(dwellTimeRangeMax),
86  _dwellTimeRes(dwellTimeRes),
87  _frequency(frequency),
88  _amplitude(amplitude),
89  _phase(phase),
90  _sweepStart(sweepStart),
91  _sweepStop(sweepStop),
92  _sweepStep(sweepStep),
93  _dwellTime(dwellTime)
94  {
95  // Call init function
97  }
98 
100  {
101 
102  }
103 
105  RadioComponent(other),
106  _txIndex(other._txIndex),
107  _freqRangeMin(other._freqRangeMin),
108  _freqRangeMax(other._freqRangeMax),
109  _freqRes(other._freqRes),
110  _freqUnits(other._freqUnits),
111  _ampRangeMin(other._ampRangeMin),
112  _ampRangeMax(other._ampRangeMax),
113  _ampRes(other._ampRes),
114  _phaseRangeMin(other._phaseRangeMin),
115  _phaseRangeMax(other._phaseRangeMax),
116  _phaseRes(other._phaseRes),
117  _sweepStartRangeMin(other._sweepStartRangeMin),
118  _sweepStartRangeMax(other._sweepStartRangeMax),
119  _sweepStartRes(other._sweepStartRes),
120  _sweepStopRangeMin(other._sweepStopRangeMin),
121  _sweepStopRangeMax(other._sweepStopRangeMax),
122  _sweepStopRes(other._sweepStopRes),
123  _sweepStepRangeMin(other._sweepStepRangeMin),
124  _sweepStepRangeMax(other._sweepStepRangeMax),
125  _sweepStepRes(other._sweepStepRes),
126  _dwellTimeRangeMin(other._dwellTimeRangeMin),
127  _dwellTimeRangeMax(other._dwellTimeRangeMax),
128  _dwellTimeRes(other._dwellTimeRes),
129  _frequency(other._frequency),
130  _amplitude(other._amplitude),
131  _phase(other._phase),
132  _sweepStart(other._sweepStart),
133  _sweepStop(other._sweepStop),
134  _sweepStep(other._sweepStep),
135  _dwellTime(other._dwellTime)
136  {
137 
138  }
139 
141  {
143  if ( this != &other )
144  {
145  _txIndex = other._txIndex;
146  _freqRangeMin = other._freqRangeMin;
147  _freqRangeMax = other._freqRangeMax;
148  _freqRes = other._freqRes;
149  _freqUnits = other._freqUnits;
150  _ampRangeMin = other._ampRangeMin;
151  _ampRangeMax = other._ampRangeMax;
152  _ampRes = other._ampRes;
153  _phaseRangeMin = other._phaseRangeMin;
154  _phaseRangeMax = other._phaseRangeMax;
155  _phaseRes = other._phaseRes;
156  _sweepStartRangeMin = other._sweepStartRangeMin;
157  _sweepStartRangeMax = other._sweepStartRangeMax;
158  _sweepStartRes = other._sweepStartRes;
159  _sweepStopRangeMin = other._sweepStopRangeMin;
160  _sweepStopRangeMax = other._sweepStopRangeMax;
161  _sweepStopRes = other._sweepStopRes;
162  _sweepStepRangeMin = other._sweepStepRangeMin;
163  _sweepStepRangeMax = other._sweepStepRangeMax;
164  _sweepStepRes = other._sweepStepRes;
165  _dwellTimeRangeMin = other._dwellTimeRangeMin;
166  _dwellTimeRangeMax = other._dwellTimeRangeMax;
167  _dwellTimeRes = other._dwellTimeRes;
168  _frequency = other._frequency;
169  _amplitude = other._amplitude;
170  _phase = other._phase;
171  _sweepStart = other._sweepStart;
172  _sweepStop = other._sweepStop;
173  _sweepStep = other._sweepStep;
174  _dwellTime = other._dwellTime;
175  }
176  return *this;
177  }
178 
179  bool CWToneGenComponent::enable(bool enabled)
180  {
181  return setAmplitude(enabled ? _amplitude : 0);
182  }
183 
185  {
186  this->debug("[CWToneGenComponent::setConfiguration] Called\n");
187  // Call the "grandparent" version of this method instead of the
188  // parent version. We want the normalization, but not the
189  // automatic enabling.
190  bool ret = Configurable::setConfiguration(cfg);
191  // Use the keys provided in the *incoming* dictionary to determine
192  // what needs to be changed via hardware calls.
193  double adjFrequency = _frequency;
194  double adjAmplitude = _amplitude;
195  double adjPhase = _phase;
196  double adjStart = _sweepStart;
197  double adjStop = _sweepStop;
198  double adjStep = _sweepStep;
199  double adjDwell = _dwellTime;
200  bool adjEnabled = _enabled;
201  bool toneCmdNeedsExecuting = false;
202  bool sweepCmdNeedsExecuting = false;
203  if ( cfg.hasKey("enable") && _config.hasKey("enable") )
204  {
205  adjEnabled = getConfigurationValueAsBool("enable");
206  toneCmdNeedsExecuting = true;
207  }
208  if ( cfg.hasKey("cwFrequency") && _config.hasKey("cwFrequency") )
209  {
210  adjFrequency = getConfigurationValueAsDbl("cwFrequency");
211  toneCmdNeedsExecuting = true;
212  }
213  if ( cfg.hasKey("cwAmplitude") && _config.hasKey("cwAmplitude") )
214  {
215  adjAmplitude = getConfigurationValueAsInt("cwAmplitude");
216  toneCmdNeedsExecuting = true;
217  }
218  if ( cfg.hasKey("cwPhase") && _config.hasKey("cwPhase") )
219  {
220  adjPhase = getConfigurationValueAsInt("cwPhase");
221  toneCmdNeedsExecuting = true;
222  }
223  if ( cfg.hasKey("cwSweepStart") && _config.hasKey("cwSweepStart") )
224  {
225  adjStart = getConfigurationValueAsDbl("cwSweepStart");
226  sweepCmdNeedsExecuting = true;
227  }
228  if ( cfg.hasKey("cwSweepStop") && _config.hasKey("cwSweepStop") )
229  {
230  adjStop = getConfigurationValueAsDbl("cwSweepStop");
231  sweepCmdNeedsExecuting = true;
232  }
233  if ( cfg.hasKey("cwSweepStep") && _config.hasKey("cwSweepStep") )
234  {
235  adjStep = getConfigurationValueAsDbl("cwSweepStep");
236  sweepCmdNeedsExecuting = true;
237  }
238  if ( cfg.hasKey("cwSweepDwell") && _config.hasKey("cwSweepDwell") )
239  {
240  adjDwell = getConfigurationValueAsInt("cwSweepDwell");
241  sweepCmdNeedsExecuting = true;
242  }
243  if ( toneCmdNeedsExecuting )
244  {
245  ret &= executeToneCommand(_index, _txIndex, adjFrequency, adjAmplitude,
246  adjPhase);
247  }
248  if ( sweepCmdNeedsExecuting )
249  {
250  ret &= executeSweepCommand(_index, _txIndex, adjStart, adjStop,
251  adjStep, adjDwell);
252  }
253  if ( ret )
254  {
255  _enabled = adjEnabled;
256  _frequency = adjFrequency;
257  _amplitude = adjAmplitude;
258  _phase = adjPhase;
259  _sweepStart = adjStart;
260  _sweepStop = adjStop;
261  _sweepStep = adjStep;
262  _dwellTime = adjDwell;
264  }
265  this->debug("[CWToneGenComponent::setConfiguration] Returning\n");
266  return ret;
267  }
268 
270  {
271  this->debug("[CWToneGenComponent::queryConfiguration] Called\n");
272  if ( _config.hasKey("cwFrequency") &&
273  _config.hasKey("cwAmplitude") &&
274  _config.hasKey("cwPhase") )
275  {
276  executeToneQuery(_index, _txIndex, _frequency, _amplitude, _phase);
277  }
278  if ( _config.hasKey("cwSweepStart") &&
279  _config.hasKey("cwSweepStop") &&
280  _config.hasKey("cwSweepStep") &&
281  _config.hasKey("cwSweepDwell") )
282  {
283  executeSweepQuery(_index, _txIndex, _sweepStart, _sweepStop, _sweepStep,
284  _dwellTime);
285  }
286  _enabled = (_amplitude != 0);
288  this->debug("[CWToneGenComponent::queryConfiguration] Returning\n");
289  }
290 
292  {
293  BasicDoubleList ret;
294  ret.push_back(_freqRangeMin);
295  ret.push_back(_freqRangeMax);
296  return ret;
297  }
298 
300  {
301  return _freqRes;
302  }
303 
305  {
306  BasicDoubleList ret;
307  ret.push_back(_ampRangeMin);
308  ret.push_back(_ampRangeMax);
309  return ret;
310  }
311 
313  {
314  return _ampRes;
315  }
316 
318  {
319  BasicDoubleList ret;
320  ret.push_back(_phaseRangeMin);
321  ret.push_back(_phaseRangeMax);
322  return ret;
323  }
324 
326  {
327  return _phaseRes;
328  }
329 
331  {
332  BasicDoubleList ret;
333  ret.push_back(_sweepStartRangeMin);
334  ret.push_back(_sweepStartRangeMax);
335  return ret;
336  }
337 
339  {
340  return _sweepStartRes;
341  }
342 
344  {
345  BasicDoubleList ret;
346  ret.push_back(_sweepStopRangeMin);
347  ret.push_back(_sweepStopRangeMax);
348  return ret;
349  }
350 
352  {
353  return _sweepStopRes;
354  }
355 
357  {
358  BasicDoubleList ret;
359  ret.push_back(_sweepStepRangeMin);
360  ret.push_back(_sweepStepRangeMax);
361  return ret;
362  }
363 
365  {
366  return _sweepStepRes;
367  }
368 
370  {
371  BasicDoubleList ret;
372  ret.push_back(_dwellTimeRangeMin);
373  ret.push_back(_dwellTimeRangeMax);
374  return ret;
375  }
376 
378  {
379  return _dwellTimeRes;
380  }
381 
383  {
384  return _frequency;
385  }
386 
388  {
389  bool ret = false;
390  if ( _config.hasKey("frequency") )
391  {
392  double adjFrequency = freq;
393  double adjAmplitude = _amplitude;
394  double adjPhase = _phase;
395  ret = executeToneCommand(_index, _txIndex, adjFrequency, adjAmplitude, adjPhase);
396  if ( ret )
397  {
398  _frequency = adjFrequency;
400  }
401  }
402  return ret;
403  }
404 
406  {
407  return _amplitude;
408  }
409 
411  {
412  bool ret = false;
413  if ( _config.hasKey("cwAmplitude") )
414  {
415  double adjFrequency = _frequency;
416  double adjAmplitude = amp;
417  double adjPhase = _phase;
418  ret = executeToneCommand(_index, _txIndex, adjFrequency, adjAmplitude, adjPhase);
419  if ( ret )
420  {
421  _amplitude = adjAmplitude;
422  _enabled = (_amplitude != 0);
424  }
425  }
426  return ret;
427  }
428 
430  {
431  return _phase;
432  }
433 
434  bool CWToneGenComponent::setPhase(double phase)
435  {
436  bool ret = false;
437  if ( _config.hasKey("cwPhase") )
438  {
439  double adjFrequency = _frequency;
440  double adjAmplitude = _amplitude;
441  double adjPhase = phase;
442  ret = executeToneCommand(_index, _txIndex, adjFrequency, adjAmplitude, adjPhase);
443  if ( ret )
444  {
445  _phase = adjPhase;
447  }
448  }
449  return ret;
450  }
451 
453  {
454  bool ret = ( _sweepStartRangeMin != _sweepStartRangeMax );
455  return ret;
456  }
457 
459  {
460  return _sweepStart;
461  }
462 
464  {
465  return _sweepStop;
466  }
467 
469  {
470  return _sweepStep;
471  }
472 
474  {
475  return _dwellTime;
476  }
477 
478  bool CWToneGenComponent::setFrequencySweep(double start, double stop,
479  double step, double dwell)
480  {
481  bool ret = false;
482  if ( _config.hasKey("cwSweepStart") &&
483  _config.hasKey("cwSweepStop") &&
484  _config.hasKey("cwSweepStep") &&
485  _config.hasKey("cwSweepDwell") )
486  {
487  double adjStart = start;
488  double adjStop = stop;
489  double adjStep = step;
490  double adjDwell = dwell;
491  ret = executeSweepCommand(_index, _txIndex, adjStart, adjStop, adjStep,
492  adjDwell);
493  if ( ret )
494  {
495  _sweepStart = adjStart;
496  _sweepStop = adjStop;
497  _sweepStep = adjStep;
498  _dwellTime = adjDwell;
500  }
501  }
502  return ret;
503  }
504 
506  {
507  //this->debug("[CWToneGenComponent::initConfigurationDict] Called\n");
508  _config.clear();
509  // Call the base-class version
511  // Define tone generator-specific keys
512  _config["cwFrequency"] = "0";
513  _config["cwAmplitude"] = "0";
514  _config["cwPhase"] = "0";
515  _config["cwSweepStart"] = "0";
516  _config["cwSweepStop"] = "0";
517  _config["cwSweepStep"] = "0";
518  _config["cwSweepDwell"] = "0";
519  //this->debug("[CWToneGenComponent::initConfigurationDict] Returning\n");
520  }
521 
523  {
524  this->debug("[CWToneGenComponent::updateConfigurationDict] Called\n");
526  if ( _config.hasKey("cwFrequency") )
527  setConfigurationValueToDbl("cwFrequency", _frequency);
528  if ( _config.hasKey("cwAmplitude") )
529  setConfigurationValueToDbl("cwAmplitude", _amplitude);
530  if ( _config.hasKey("cwPhase") )
531  setConfigurationValueToDbl("cwPhase", _phase);
532  if ( _config.hasKey("cwSweepStart") )
533  setConfigurationValueToDbl("cwSweepStart", _sweepStart);
534  if ( _config.hasKey("cwSweepStop") )
535  setConfigurationValueToDbl("cwSweepStop", _sweepStop);
536  if ( _config.hasKey("cwSweepStep") )
537  setConfigurationValueToDbl("cwSweepStep", _sweepStep);
538  if ( _config.hasKey("cwSweepDwell") )
539  setConfigurationValueToDbl("cwSweepDwell", _dwellTime);
540  this->debug("[CWToneGenComponent::updateConfigurationDict] Returning\n");
541  }
542 
543  // CW tone query uses the NDR651 implementation as the base
545  int txIndex,
546  double& freq,
547  double& amp,
548  double& phase)
549  {
550  bool ret = false;
551  if ( (_parent != NULL) && (_parent->isConnected()) )
552  {
553  std::ostringstream oss;
554  oss << "CWT? " << txIndex << ", " << index << "\n";
555  BasicStringList rsp = _parent->sendCommand(oss.str(), 2.0);
556  if ( _parent->getLastCommandErrorInfo() == "" )
557  {
559  Pythonesque::Replace(rsp.front(), "CWT ", ""),
560  ", ");
561  // vec[0] = TX Index
562  // vec[1] = CWTG Index
563  // vec[2] = Frequency (Hz)
564  freq = boost::lexical_cast<double>(vec[2]);
565  // vec[3] = Amplitude
566  amp = boost::lexical_cast<double>(vec[3]);
567  // vec[4] = Phase (deg)
568  phase = boost::lexical_cast<double>(vec[4]);
569  ret = true;
570  }
571  }
572  return ret;
573  }
574 
575  // CW tone command uses the NDR651 implementation as the base
577  int txIndex,
578  double& freq,
579  double& amp,
580  double& phase)
581  {
582  bool ret = false;
583  if ( (_parent != NULL) && (_parent->isConnected()) )
584  {
585  std::ostringstream oss;
586  oss << "CWT " << txIndex
587  << ", " << index
588  << ", " << std::setprecision(1) << std::fixed << freq
589  << ", " << std::setprecision(1) << std::fixed << amp
590  << ", " << std::setprecision(1) << std::fixed << phase
591  << "\n";
592  BasicStringList rsp = _parent->sendCommand(oss.str(), 2.0);
593  if ( _parent->getLastCommandErrorInfo() == "" )
594  {
595  ret = true;
596  }
597  }
598  return ret;
599  }
600 
601  // CW sweep query uses the NDR651 implementation as the base
603  int txIndex,
604  double& sweepStart,
605  double& sweepStop,
606  double& sweepStep,
607  double& dwellTime)
608  {
609  bool ret = false;
610  if ( (_parent != NULL) && (_parent->isConnected()) )
611  {
612  std::ostringstream oss;
613  oss << "CWS? " << txIndex << ", " << index << "\n";
614  BasicStringList rsp = _parent->sendCommand(oss.str(), 2.0);
615  if ( _parent->getLastCommandErrorInfo() == "" )
616  {
618  Pythonesque::Replace(rsp.front(), "CWS ", ""),
619  ", ");
620  // vec[0] = TX Index
621  // vec[1] = CWTG Index
622  // vec[2] = Start frequency (Hz)
623  sweepStart = boost::lexical_cast<double>(vec[2]);
624  // vec[3] = Stop frequency (Hz)
625  sweepStop = boost::lexical_cast<double>(vec[3]);
626  // vec[4] = Frequency step (Hz)
627  sweepStep = boost::lexical_cast<double>(vec[4]);
628  // vec[5] = Dwell time (sample clocks)
629  dwellTime = boost::lexical_cast<double>(vec[5]);
630  ret = true;
631  }
632  }
633  return ret;
634  }
635 
636  // CW sweep command uses the NDR651 implementation as the base
638  int txIndex,
639  double& sweepStart,
640  double& sweepStop,
641  double& sweepStep,
642  double& dwellTime)
643  {
644  bool ret = false;
645  if ( (_parent != NULL) && (_parent->isConnected()) )
646  {
647  std::ostringstream oss;
648  oss << "CWS " << txIndex
649  << ", " << index
650  << ", " << std::setprecision(1) << std::fixed << sweepStart
651  << ", " << std::setprecision(1) << std::fixed << sweepStop
652  << ", " << std::setprecision(1) << std::fixed << sweepStep
653  << ", " << std::setprecision(1) << std::fixed << dwellTime
654  << "\n";
655  BasicStringList rsp = _parent->sendCommand(oss.str(), 2.0);
656  if ( _parent->getLastCommandErrorInfo() == "" )
657  {
658  ret = true;
659  }
660  }
661  return ret;
662  }
663 
664 
665  } // namespace Driver
666 
667 } // namespace LibCyberRadio
668 
669 
670 
671 
672 
virtual void updateConfigurationDict()
Updates the configuration dictionary from component settings.
virtual bool getConfigurationValueAsBool(const std::string &key) const
Gets a named configuration value as a Boolean.
virtual BasicDoubleList getSweepStopRange() const
Gets the sweep stop range.
virtual double getFrequencyRes() const
Gets the frequency resolution.
virtual BasicDoubleList getSweepStartRange() const
Gets the sweep start range.
virtual bool setConfigurationValueToDbl(const std::string &key, const double value)
Sets a named configuration value to a double value.
virtual double getSweepStartFrequency() const
Gets the start frequency for a signal sweep.
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 int getConfigurationValueAsInt(const std::string &key) const
Gets a named configuration value as an integer value.
virtual double getFrequency() const
Gets the constant frequency.
virtual double getSweepStopFrequency() const
Gets the stop frequency for a signal sweep.
virtual bool isConnected() const
Gets whether or not the handler is connected.
virtual RadioComponent & operator=(const RadioComponent &other)
Assignment operator for RadioComponent objects.
virtual bool setPhase(double phase)
Sets the signal phase.
virtual double getSweepStartRes() const
Gets the sweep start resolution.
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
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.
virtual BasicDoubleList getFrequencyRange() const
Gets the frequency range.
virtual bool setFrequencySweep(double start, double stop, double step, double dwell)
Sets the parameters for a frequency sweep.
virtual bool executeSweepQuery(int index, int txIndex, double &sweepStart, double &sweepStop, double &sweepStep, double &dwellTime)
Executes the CW sweep query command.
virtual double getAmplitude() const
Gets the signal amplitude.
virtual double getSweepFrequencyStep() const
Gets the frequency step for a signal sweep.
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 CWToneGenComponent & operator=(const CWToneGenComponent &other)
Assignment operator for CWToneGenComponent objects.
virtual double getDwellTimeRes() const
Gets the dwell time resolution.
Generic radio handler class.
Definition: RadioHandler.h:54
virtual int debug(const char *format,...)
Outputs debug information.
Definition: Debuggable.cpp:95
BASIC_LIST_CONTAINER< std::string > BasicStringList
Type representing a list of strings.
Definition: BasicList.h:25
virtual BasicDoubleList getSweepStepRange() const
Gets the sweep step range.
virtual void updateConfigurationDict()
Updates the configuration dictionary from component settings.
virtual void initConfigurationDict()
Initializes the configuration dictionary, defining the allowed keys.
virtual bool executeToneQuery(int index, int txIndex, double &freq, double &amp, double &phase)
Executes the CW tone query command.
virtual bool supportsSweep() const
Gets whether or not the generator supports signal sweeps.
virtual BasicDoubleList getPhaseRange() const
Gets the phase range.
Defines functionality for LibCyberRadio applications.
Definition: App.h:23
virtual double getSweepDwellTime() const
Gets the dwell time for a signal sweep.
A configuration dictionary.
Definition: Configurable.h:51
virtual std::string getLastCommandErrorInfo() const
Gets the error message from the last command attempted.
virtual double getAmplitudeRes() const
Gets the amplitude resolution.
virtual bool setConfiguration(ConfigurationDict &cfg)
Sets the configuration dictionary for this component.
virtual bool executeSweepCommand(int index, int txIndex, double &sweepStart, double &sweepStop, double &sweepStep, double &dwellTime)
Executes the CW sweep set command.
virtual BasicDoubleList getDwellTimeRange() const
Gets the dwell time range.
virtual double getPhaseRes() const
Gets the phase resolution.
virtual bool setConfiguration(ConfigurationDict &cfg)
Sets the configuration dictionary for this object.
virtual double getSweepStopRes() const
Gets the sweep stop resolution.
virtual BasicStringList sendCommand(const std::string &cmdString, double timeout=-1)
Sends a command to the radio.
virtual void initConfigurationDict()
Initializes the configuration dictionary, defining the allowed keys.
virtual double getPhase() const
Gets the signal phase.
virtual ~CWToneGenComponent()
Destroys a CWToneGenComponent object.
virtual bool setFrequency(double freq)
Sets the constant frequency.
virtual double getSweepStepRes() const
Gets the sweep step resolution.
virtual bool setAmplitude(double amp)
Sets the signal amplitude.
virtual double getConfigurationValueAsDbl(const std::string &key) const
Gets a named configuration value as a double value.
virtual bool enable(bool enabled=true)
Enables this component.
Base continuous-wave (CW) tone generator component class.
virtual BasicDoubleList getAmplitudeRange() const
Gets the amplitude range.
virtual void queryConfiguration()
Tells the component to query its hardware configuration in order to create its configuration dictiona...
virtual bool executeToneCommand(int index, int txIndex, double &freq, double &amp, double &phase)
Executes the CW tone set command.