libcyberradio  22.01.24
RadioHandler.cpp
1 /***************************************************************************
2  * \file RadioHandler.cpp
3  * \brief Defines the basic radio handler 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/Common/Pythonesque.h"
13 #include <boost/format.hpp>
14 #include <boost/lexical_cast.hpp>
15 #include <algorithm>
16 #include <sstream>
17 #include <iomanip>
18 #include <cstdio>
19 #include <cstring>
20 #include <ctime>
21 #include <arpa/inet.h>
22 
23 namespace LibCyberRadio
24 {
25 
26  namespace Driver
27  {
29  const std::string& name,
30  int numTuner,
31  int tunerIndexBase,
32  int numWbddc,
33  int wbddcIndexBase,
34  int numNbddc,
35  int nbddcIndexBase,
36  int numTunerBoards,
37  int maxTunerBw,
38  int numTransmitter,
39  int transmitterIndexBase,
40  int numDuc,
41  int ducIndexBase,
42  int numWbddcGroups,
43  int wbddcGroupIndexBase,
44  int numNbddcGroups,
45  int nbddcGroupIndexBase,
46  int numDdcGroups,
47  int ddcGroupIndexBase,
48  int numDataPorts,
49  int dataPortIndexBase,
50  int numSimpleIpSetups,
51  double adcRate,
52  VitaIfSpec ifSpec,
53  bool debug) :
54  Configurable(name, debug),
55  _numTuner(numTuner),
56  _tunerIndexBase(tunerIndexBase),
57  _numWbddc(numWbddc),
58  _wbddcIndexBase(wbddcIndexBase),
59  _numNbddc(numNbddc),
60  _nbddcIndexBase(nbddcIndexBase),
61  _numTunerBoards(numTunerBoards),
62  _maxTunerBw(maxTunerBw),
63  _numTransmitter(numTransmitter),
64  _transmitterIndexBase(transmitterIndexBase),
65  _numDuc(numDuc),
66  _ducIndexBase(ducIndexBase),
67  _numWbddcGroups(numWbddcGroups),
68  _wbddcGroupIndexBase(wbddcGroupIndexBase),
69  _numNbddcGroups(numNbddcGroups),
70  _nbddcGroupIndexBase(nbddcGroupIndexBase),
71  _numDdcGroups(numDdcGroups),
72  _ddcGroupIndexBase(ddcGroupIndexBase),
73  _numDataPorts(numDataPorts),
74  _dataPortIndexBase(dataPortIndexBase),
75  _numSimpleIpSetups(numSimpleIpSetups),
76  _adcRate(adcRate),
77  _ifSpec(ifSpec),
78  _configMode(0),
79  _coherentMode(0),
80  _freqNormalization(0),
81  _gpsEnabled(0),
82  _referenceMode(0),
83  _referenceTuningVoltage(0),
84  _referenceBypass(0),
85  _calibFrequency(0.0),
86  _lastCmdErrorInfo(""),
87  _defaultTimeout(2.0),
88  _defaultDeviceInfo(0)
89  {
90  _versionInfo["model"] = "N/A";
91  _versionInfo["serialNumber"] = "N/A";
92  _versionInfo["unitRevision"] = "N/A";
93  _versionInfo["softwareVersion"] = "N/A";
94  _versionInfo["firmwareVersion"] = "N/A";
95  _versionInfo["firmwareDate"] = "N/A";
96  _versionInfo["referenceVersion"] = "N/A";
97  _versionInfo["hardwareVersion"] = "N/A";
98  this->initConfigurationDict();
99  }
100 
102  {
103  if ( isConnected() )
104  {
105  disconnect();
106  }
107  for ( TunerComponentDict::iterator it = _tuners.begin();
108  it != _tuners.end(); it++)
109  {
110  delete it->second;
111  }
112  for ( WbddcComponentDict::iterator it = _wbddcs.begin();
113  it != _wbddcs.end(); it++)
114  {
115  delete it->second;
116  }
117  for ( NbddcComponentDict::iterator it = _nbddcs.begin();
118  it != _nbddcs.end(); it++)
119  {
120  delete it->second;
121  }
122  for ( TransmitterComponentDict::iterator it = _txs.begin();
123  it != _txs.end(); it++)
124  {
125  delete it->second;
126  }
127  for ( DataPortDict::iterator it = _dataPorts.begin();
128  it != _dataPorts.end(); it++)
129  {
130  delete it->second;
131  }
132  for ( DucComponentDict::iterator it = _ducs.begin();
133  it != _ducs.end(); it++)
134  {
135  delete it->second;
136  }
137  for ( WbddcGroupComponentDict::iterator it = _wbddcGroups.begin();
138  it != _wbddcGroups.end(); it++)
139  {
140  delete it->second;
141  }
142  for ( NbddcGroupComponentDict::iterator it = _nbddcGroups.begin();
143  it != _nbddcGroups.end(); it++)
144  {
145  delete it->second;
146  }
147  for ( SimpleIpSetupDict::iterator it = _simpleIpSetups.begin();
148  it != _simpleIpSetups.end(); it++)
149  {
150  delete it->second;
151  }
152  }
153 
155  Configurable(other)
156  {
157  _connModesSupported = other._connModesSupported;
158  _numTuner = other._numTuner;
159  _tunerIndexBase = other._tunerIndexBase;
160  _numWbddc = other._numWbddc;
161  _wbddcIndexBase = other._wbddcIndexBase;
162  _numNbddc = other._numNbddc;
163  _nbddcIndexBase = other._nbddcIndexBase;
164  _numTunerBoards = other._numTunerBoards;
165  _maxTunerBw = other._maxTunerBw;
166  _numTransmitter = other._numTransmitter;
167  _transmitterIndexBase = other._transmitterIndexBase;
168  _numDuc = other._numDuc;
169  _ducIndexBase = other._ducIndexBase;
170  _numWbddcGroups = other._numWbddcGroups;
171  _wbddcGroupIndexBase = other._wbddcGroupIndexBase;
172  _numNbddcGroups = other._numNbddcGroups;
173  _nbddcGroupIndexBase = other._nbddcGroupIndexBase;
174  _numDdcGroups = other._numDdcGroups;
175  _ddcGroupIndexBase = other._ddcGroupIndexBase;
176  _numDataPorts = other._numDataPorts;
177  _dataPortIndexBase = other._dataPortIndexBase;
178  _numSimpleIpSetups = other._numSimpleIpSetups;
179  _adcRate = other._adcRate;
180  _ifSpec = other._ifSpec;
181  _configMode = other._configMode;
182  _coherentMode = other._coherentMode;
183  _freqNormalization = other._freqNormalization;
184  _gpsEnabled = other._gpsEnabled;
185  _referenceMode = other._referenceMode;
186  _referenceTuningVoltage = other._referenceTuningVoltage;
187  _referenceBypass = other._referenceBypass;
188  _calibFrequency = other._calibFrequency;
189  _lastCmdErrorInfo = other._lastCmdErrorInfo;
190  _transport = other._transport;
191  _versionInfo = other._versionInfo;
192  _connectionInfo = other._connectionInfo;
193  _defaultTimeout = other._defaultTimeout;
194  _defaultDeviceInfo = other._defaultDeviceInfo;
195  }
196 
198  {
200  // Block self-assignment
201  if (this != &other)
202  {
203  _connModesSupported = other._connModesSupported;
204  _numTuner = other._numTuner;
205  _tunerIndexBase = other._tunerIndexBase;
206  _numWbddc = other._numWbddc;
207  _wbddcIndexBase = other._wbddcIndexBase;
208  _numNbddc = other._numNbddc;
209  _nbddcIndexBase = other._nbddcIndexBase;
210  _numTunerBoards = other._numTunerBoards;
211  _maxTunerBw = other._maxTunerBw;
212  _numTransmitter = other._numTransmitter;
213  _transmitterIndexBase = other._transmitterIndexBase;
214  _numDuc = other._numDuc;
215  _ducIndexBase = other._ducIndexBase;
216  _numWbddcGroups = other._numWbddcGroups;
217  _wbddcGroupIndexBase = other._wbddcGroupIndexBase;
218  _numNbddcGroups = other._numNbddcGroups;
219  _nbddcGroupIndexBase = other._nbddcGroupIndexBase;
220  _numDdcGroups = other._numDdcGroups;
221  _ddcGroupIndexBase = other._ddcGroupIndexBase;
222  _numDataPorts = other._numDataPorts;
223  _dataPortIndexBase = other._dataPortIndexBase;
224  _numSimpleIpSetups = other._numSimpleIpSetups;
225  _adcRate = other._adcRate;
226  _ifSpec = other._ifSpec;
227  _configMode = other._configMode;
228  _coherentMode = other._coherentMode;
229  _freqNormalization = other._freqNormalization;
230  _gpsEnabled = other._gpsEnabled;
231  _referenceMode = other._referenceMode;
232  _referenceTuningVoltage = other._referenceTuningVoltage;
233  _referenceBypass = other._referenceBypass;
234  _calibFrequency = other._calibFrequency;
235  _lastCmdErrorInfo = other._lastCmdErrorInfo;
236  _transport = other._transport;
237  _versionInfo = other._versionInfo;
238  _connectionInfo = other._connectionInfo;
239  _defaultTimeout = other._defaultTimeout;
240  _defaultDeviceInfo = other._defaultDeviceInfo;
241  }
242  return *this;
243  }
244 
246  {
247  return _transport.isConnected();
248  }
249 
251  {
252  return _versionInfo;
253  }
254 
256  {
257  return _connectionInfo;
258  }
259 
260  bool RadioHandler::connect(const std::string &mode, const std::string &host_or_dev, const int port_or_baudrate)
261  {
262  this->debug("[RadioHandler::connect] Called; mode=\"%s\", HorD=\"%s\", PorB=%d\n", mode.c_str(), host_or_dev.c_str(), port_or_baudrate);
263  bool ret = false;
264  _connectionInfo = BasicStringStringDict();
265  // Sanity check: Make sure radio supports the given connection mode
266  if ( isConnectionModeSupported(mode) )
267  {
268  ret = _transport.connect(mode, host_or_dev, port_or_baudrate);
269  this->debug("[RadioHandler::connect] Connect result: %s\n", debugBool(ret));
270  if (ret)
271  {
272  _connectionInfo["mode"] = mode;
273  if ( (mode == "tcp") or (mode == "udp") )
274  {
275  _connectionInfo["hostname"] = host_or_dev;
276  _connectionInfo["port"] = ( boost::format("%d") % port_or_baudrate ).str();
277  }
278  else if ( (mode == "tty") )
279  {
280  _connectionInfo["device"] = host_or_dev;
281  _connectionInfo["baudrate"] = ( boost::format("%d") % port_or_baudrate ).str();
282  }
283  this->debug("[RadioHandler::connect] Querying configuration\n");
284  this->queryConfiguration();
285  }
286  else
287  _lastCmdErrorInfo = _transport.getLastCommandErrorInfo();
288  }
289  else
290  {
291  std::ostringstream oss;
292  oss << "Unsupported connection mode: " << mode;
293  _lastCmdErrorInfo = oss.str();
294  }
295  this->debug("[RadioHandler::connect] Returning %s\n", debugBool(ret));
296  return ret;
297  }
298 
300  {
301  this->debug("[RadioHandler::disconnect] Called\n");
302  if (_transport.isConnected())
303  _transport.disconnect();
304  this->debug("[RadioHandler::disconnect] Returning\n");
305  }
306 
307  BasicStringList RadioHandler::sendCommand(const std::string &cmdString, double timeout)
308  {
309  this->debug("[RadioHandler::sendCommand] Called; cmd=\"%s\"\n",
310  Pythonesque::Strip(cmdString).c_str());
311  BasicStringList ret;
312  _lastCmdErrorInfo = "";
313  if ( _transport.sendCommand(cmdString) )
314  {
315  ret = _transport.receive(timeout);
316  }
317  else
318  _lastCmdErrorInfo = _transport.getLastCommandErrorInfo();
319  // This covers the case where the act of sending the command itself
320  // generates an error, but not the case where the command/response happens
321  // but the response contains an error message. This section looks for
322  // error messages in the response and sets last command error info accordingly.
323  BasicStringList::iterator it;
324  for (it = ret.begin(); it != ret.end(); it++)
325  {
326  if ( it->find("ERROR") != std::string::npos )
327  {
328  _lastCmdErrorInfo = Pythonesque::Replace(*it, "ERROR: ", "");
329  break;
330  }
331  }
332  // If the first line of the response just echoed the command, remove it
333  if ( (ret.size() > 0) && (ret.front() == Pythonesque::Strip(cmdString)) )
334  ret.erase(ret.begin());
335  // Debug print
336  this->debug("[RadioHandler::sendCommand] Returning %lu elements\n", ret.size());
337  for (it = ret.begin(); it != ret.end(); it++)
338  this->debug("[RadioHandler::sendCommand] -- %s\n", it->c_str());
339  return ret;
340  }
341 
343  {
344  this->queryVersionInfo();
345  if ( this->queryRadioConfiguration() )
346  this->updateConfigurationDict();
347  for ( TunerComponentDict::iterator it = _tuners.begin();
348  it != _tuners.end(); it++)
349  {
350  it->second->queryConfiguration();
351  }
352  for ( WbddcComponentDict::iterator it = _wbddcs.begin();
353  it != _wbddcs.end(); it++)
354  {
355  it->second->queryConfiguration();
356  }
357  for ( NbddcComponentDict::iterator it = _nbddcs.begin();
358  it != _nbddcs.end(); it++)
359  {
360  it->second->queryConfiguration();
361  }
362  for ( TransmitterComponentDict::iterator it = _txs.begin();
363  it != _txs.end(); it++)
364  {
365  it->second->queryConfiguration();
366  }
367  for ( DataPortDict::iterator it = _dataPorts.begin();
368  it != _dataPorts.end(); it++)
369  {
370  it->second->queryConfiguration();
371  }
372  for ( DucComponentDict::iterator it = _ducs.begin();
373  it != _ducs.end(); it++)
374  {
375  it->second->queryConfiguration();
376  }
377  for ( WbddcGroupComponentDict::iterator it = _wbddcGroups.begin();
378  it != _wbddcGroups.end(); it++)
379  {
380  it->second->queryConfiguration();
381  }
382  for ( NbddcGroupComponentDict::iterator it = _nbddcGroups.begin();
383  it != _nbddcGroups.end(); it++)
384  {
385  it->second->queryConfiguration();
386  }
387  for ( SimpleIpSetupDict::iterator it = _simpleIpSetups.begin();
388  it != _simpleIpSetups.end(); it++)
389  {
390  it->second->queryConfiguration();
391  }
392  }
393 
395  {
396  this->debug("[RadioHandler::setConfiguration] Called\n");
397  // Call the parent version.
398  bool ret = Configurable::setConfiguration(cfg);
399  int adjCfg = _configMode;
400  int adjCoh = _coherentMode;
401  int adjFnr = _freqNormalization;
402  int adjGps = _gpsEnabled;
403  int adjRef = _referenceMode;
404  int adjRtv = _referenceTuningVoltage;
405  int adjByp = _referenceBypass;
406  double adjCal = _calibFrequency;
407  if ( cfg.find("configMode") != cfg.end() )
408  {
409  adjCfg = getConfigurationValueAsInt("configMode");
410  ret &= this->executeConfigModeCommand(adjCfg);
411  }
412  if ( cfg.find("coherentMode") != cfg.end() )
413  {
414  adjCoh = getConfigurationValueAsInt("coherentMode");
415  ret &= this->executeCoherentModeCommand(adjCoh);
416  }
417  if ( cfg.find("freqNormalization") != cfg.end() )
418  {
419  adjFnr = getConfigurationValueAsInt("freqNormalization");
420  ret &= this->executeFreqNormalizationCommand(adjFnr);
421  }
422  if ( cfg.find("gpsEnabled") != cfg.end() )
423  {
424  adjGps = getConfigurationValueAsInt("gpsEnabled");
425  ret &= this->executeGpsEnabledCommand(adjGps);
426  }
427  if ( cfg.find("referenceMode") != cfg.end() )
428  {
429  adjRef = getConfigurationValueAsInt("referenceMode");
430  ret &= this->executeReferenceModeCommand(adjRef);
431  }
432  if ( cfg.find("referenceTuningVoltage") != cfg.end() )
433  {
434  adjRtv = getConfigurationValueAsInt("referenceTuningVoltage");
435  ret &= this->executeReferenceVoltageCommand(adjRtv);
436  }
437  if ( cfg.find("bypassMode") != cfg.end() )
438  {
439  adjByp = getConfigurationValueAsInt("bypassMode");
440  ret &= this->executeReferenceBypassCommand(adjByp);
441  }
442  if ( cfg.find("calibFrequency") != cfg.end() )
443  {
444  adjCal = getConfigurationValueAsDbl("calibFrequency");
445  ret &= this->executeCalibFrequencyCommand(adjCal);
446  }
447  if ( ret )
448  {
449  _configMode = adjCfg;
450  _coherentMode = adjCoh;
451  _freqNormalization = adjFnr;
452  _gpsEnabled = adjGps;
453  _referenceMode = adjRef;
454  _referenceTuningVoltage = adjRtv;
455  _referenceBypass = adjByp;
456  _calibFrequency = adjCal;
458  }
459  this->debug("[RadioHandler::setConfiguration] Returning\n");
460  return ret;
461  }
462 
464  {
465  return _lastCmdErrorInfo;
466  }
467 
468  bool RadioHandler::sendReset(int resetType)
469  {
470  return this->executeResetCommand(resetType);
471  }
472 
474  {
475  return this->executePpsQuery();
476  }
477 
478  bool RadioHandler::setTimeNextPps(bool checkTime, bool useGpsTime)
479  {
480  bool ret = this->getPps();
481  if ( ret )
482  {
483  // Determine target time -- either the next whole second
484  // after current system time, or GPS time, as requested.
485  time_t targetTime = time(NULL) + 1;
486  std::string adjTime;
487  if ( useGpsTime )
488  {
489  // Set target time based on GPS time
490  adjTime = "G";
491  ret = this->executeTimeCommand(adjTime);
492  }
493  else
494  {
495  // Set target time based on system time
496  adjTime = boost::lexical_cast<std::string>(targetTime);
497  ret = this->executeTimeCommand(adjTime);
498  }
499  if ( ret )
500  {
501  if ( checkTime )
502  {
503  time_t radioUtc = this->getTimeNextPps();
504  ret = (radioUtc == targetTime);
505  }
506  }
507  }
508  else
509  {
510  ret = false;
511  }
512  return ret;
513  }
514 
516  {
517  time_t ret = 0;
518  std::string adjTime;
519  this->debug("[RadioHandler::getTimeNow] Executing time query\n");
520  if ( this->executeTimeQuery(adjTime) )
521  {
522  this->debug("[RadioHandler::getTimeNow] -- query result: %s\n", adjTime.c_str());
523  ret = (time_t)boost::lexical_cast<unsigned int>(adjTime);
524  //this->debug("[RadioHandler::getTimeNow] -- converted: %lu\n", ret);
525  }
526  return ret;
527  }
528 
530  {
531  time_t ret = 0;
532  bool ok = this->getPps();
533  if ( ok )
534  {
535  ret = this->getTimeNow();
536  }
537  return ret;
538  }
539 
540  unsigned int RadioHandler::getStatus()
541  {
542  unsigned int ret = 0;
543  unsigned int stat = 0;
544  if ( this->executeStatusQuery(stat) )
545  {
546  ret = stat;
547  }
548  return ret;
549  }
550 
552  {
553  unsigned int ret = 0;
554  unsigned int stat = 0;
555  if ( this->executeTstatusQuery(stat) )
556  {
557  ret = stat;
558  }
559  return ret;
560  }
561 
563  {
564  ConfigurationDict cfg;
565  cfg["referenceMode"] = mode;
566  return this->setConfiguration(cfg);
567  }
568 
570  {
571  ConfigurationDict cfg;
572  cfg["bypassMode"] = mode;
573  return this->setConfiguration(cfg);
574  }
575 
576  bool RadioHandler::setTimeAdjustment(int tunerIndex, int timeAdjustValue)
577  {
578  bool ret = false;
579  TunerComponentDict::const_iterator it = _tuners.find(tunerIndex);
580  if ( it != _tuners.end() )
581  ret = it->second->setTimingAdjustment(timeAdjustValue);
582  return ret;
583  }
584 
586  {
587  BasicDoubleList ret = {0.0, 0.0};
588  double lat = 0.0;
589  double lon = 0.0;
590  if ( this->executeGpsPositionQuery(lat, lon) )
591  {
592  ret[0] = lat;
593  ret[1] = lon;
594  }
595  return ret;
596  }
597 
599  {
600  int ret = 0;
601  int temp = 0;
602  if ( this->executeTemperatureQuery(temp) )
603  {
604  ret = temp;
605  }
606  return ret;
607  }
608 
610  {
611  return _numDataPorts;
612  }
613 
615  {
616  int ret = 0;
617  int value = 0;
618  if ( this->executeGpioStaticQuery(value) )
619  {
620  ret = value;
621  }
622  return ret;
623  }
624 
626  {
627  BasicIntList ret = {0, 0, 0};
628  int value = 0;
629  int duration = 0;
630  int loop = 0;
631  if ( this->executeGpioSequenceQuery(index, value, duration, loop) )
632  {
633  ret[0] = value;
634  ret[1] = duration;
635  ret[2] = loop;
636  }
637  return ret;
638  }
639 
641  {
642  bool ret = false;
643  int adjValue = value;
644  if ( this->executeGpioStaticCommand(adjValue) )
645  ret = true;
646  return ret;
647  }
648 
649  bool RadioHandler::setGpioOutputByIndex(int index, int value,
650  int duration, int loop, int go)
651  {
652  bool ret = false;
653  int adjValue = value;
654  int adjDur = duration;
655  int adjLoop = loop;
656  int adjGo = go;
657  if ( this->executeGpioSequenceCommand(index, adjValue, adjDur, adjLoop, adjGo) )
658  ret = true;
659  return ret;
660  }
661 
663  {
664  return _calibFrequency;
665  }
666 
668  {
669  bool ret = false;
670  if ( _config.find("calibFrequency") != _config.end() )
671  {
672  ConfigurationDict cfg;
673  cfg["calibFrequency"] = freq;
674  ret = this->setConfiguration(cfg);
675  }
676  return ret;
677  }
678 
680  {
681  BasicIntList ret;
682  for (int num = _dataPortIndexBase; num < _dataPortIndexBase + _numDataPorts; num++)
683  ret.push_back(num);
684  return ret;
685  }
686 
688  {
689  int ret;
690  DataPortDict::const_iterator it = _dataPorts.begin();
691  if ( it != _dataPorts.end() )
692  ret = it->second->getNumDestEntries();
693  return ret;
694  }
695 
697  {
698  BasicIntList ret;
699  DataPortDict::const_iterator it = _dataPorts.begin();
700  if ( it != _dataPorts.end() )
701  ret = it->second->getDestEntryIndexRange();
702  return ret;
703  }
704 
706  {
707  return _connModesSupported;
708  }
709 
710  bool RadioHandler::isConnectionModeSupported(const std::string &mode) const
711  {
712  bool ret = false;
713  if (std::find(_connModesSupported.begin(), _connModesSupported.end(), mode) != _connModesSupported.end())
714  {
715  ret = true;
716  }
717  return ret;
718  }
719 
721  {
722  return _adcRate;
723  }
724 
726  {
727  return _ifSpec.headerSizeWords * 4;
728  }
729 
731  {
732  return _ifSpec.payloadSizeWords * 4;
733  }
734 
736  {
737  return _ifSpec.tailSizeWords * 4;
738  }
739 
741  {
742  // Get our byte order
743  const char *ourByteOrder = "little";
744  if ( htonl(0xDEAD) == 0xDEAD )
745  ourByteOrder = "big";
746  // Compare it to the IF spec
747  return ( strcmp(ourByteOrder, _ifSpec.byteOrder) != 0 );
748  }
749 
751  {
752  return _ifSpec.iqSwapped;
753  }
754 
755  const char* RadioHandler::getByteOrder() const
756  {
757  return _ifSpec.byteOrder;
758  }
759 
761  {
762  return _numTuner;
763  }
764 
766  {
767  return _numTunerBoards;
768  }
769 
771  {
772  BasicIntList ret;
773  for (int num = _tunerIndexBase; num < _tunerIndexBase + _numTuner; num++)
774  ret.push_back(num);
775  return ret;
776  }
777 
779  {
780  BasicDoubleList ret;
781  TunerComponentDict::const_iterator it = _tuners.begin();
782  if ( it != _tuners.end() )
783  ret = it->second->getFrequencyRange();
784  return ret;
785  }
786 
788  {
789  double ret = 0.0;
790  TunerComponentDict::const_iterator it = _tuners.begin();
791  if ( it != _tuners.end() )
792  ret = it->second->getFrequencyRes();
793  return ret;
794  }
795 
797  {
798  double ret = 0.0;
799  TunerComponentDict::const_iterator it = _tuners.begin();
800  if ( it != _tuners.end() )
801  ret = it->second->getFrequencyUnit();
802  return ret;
803  }
804 
806  {
807  BasicDoubleList ret;
808  TunerComponentDict::const_iterator it = _tuners.begin();
809  if ( it != _tuners.end() )
810  ret = it->second->getAttenuationRange();
811  return ret;
812  }
813 
815  {
816  double ret = 0.0;
817  TunerComponentDict::const_iterator it = _tuners.begin();
818  if ( it != _tuners.end() )
819  ret = it->second->getAttenuationRes();
820  return ret;
821  }
822 
823  bool RadioHandler::isTunerEnabled(int index) const
824  {
825  bool ret = false;
826  TunerComponentDict::const_iterator it = _tuners.find(index);
827  if ( it != _tuners.end() )
828  ret = it->second->isEnabled();
829  return ret;
830  }
831 
832  bool RadioHandler::enableTuner(int index, bool enabled)
833  {
834  bool ret = false;
835  TunerComponentDict::const_iterator it = _tuners.find(index);
836  if ( it != _tuners.end() )
837  ret = it->second->enable(enabled);
838  return ret;
839  }
840 
842  {
843  return enableTuner(index, false);
844  }
845 
846  double RadioHandler::getTunerFrequency(int index) const
847  {
848  double ret = 0.0;
849  TunerComponentDict::const_iterator it = _tuners.find(index);
850  if ( it != _tuners.end() )
851  ret = it->second->getFrequency();
852  return ret;
853  }
854 
855  bool RadioHandler::setTunerFrequency(int index, double freq)
856  {
857  bool ret = false;
858  TunerComponentDict::const_iterator it = _tuners.find(index);
859  if ( it != _tuners.end() )
860  ret = it->second->setFrequency(freq);
861  return ret;
862  }
863 
864  double RadioHandler::getTunerAttenuation(int index) const
865  {
866  double ret = 0.0;
867  TunerComponentDict::const_iterator it = _tuners.find(index);
868  if ( it != _tuners.end() )
869  ret = it->second->getAttenuation();
870  return ret;
871  }
872 
873  bool RadioHandler::setTunerAttenuation(int index, double atten)
874  {
875  bool ret = false;
876  TunerComponentDict::const_iterator it = _tuners.find(index);
877  if ( it != _tuners.end() )
878  ret = it->second->setAttenuation(atten);
879  return ret;
880  }
881 
882  int RadioHandler::getTunerFilter(int index) const
883  {
884  int ret = 0;
885  TunerComponentDict::const_iterator it = _tuners.find(index);
886  if ( it != _tuners.end() )
887  ret = it->second->getFilter();
888  return ret;
889  }
890 
891  bool RadioHandler::setTunerFilter(int index, int filter)
892  {
893  bool ret = false;
894  TunerComponentDict::const_iterator it = _tuners.find(index);
895  if ( it != _tuners.end() )
896  ret = it->second->setFilter(filter);
897  return ret;
898  }
899 
901  {
902  ConfigurationDict ret;
903  TunerComponentDict::const_iterator it = _tuners.find(index);
904  if ( it != _tuners.end() )
905  ret = it->second->getConfiguration();
906  return ret;
907  }
908 
910  {
911  bool ret = false;
912  TunerComponentDict::const_iterator it = _tuners.find(index);
913  if ( it != _tuners.end() )
914  ret = it->second->setConfiguration(cfg);
915  return ret;
916  }
917 
919  {
920  return _numWbddc;
921  }
922 
924  {
925  BasicIntList ret;
926  for (int num = _wbddcIndexBase; num < _wbddcIndexBase + _numWbddc; num++)
927  ret.push_back(num);
928  return ret;
929  }
930 
932  {
933  bool ret = false;
934  WbddcComponentDict::const_iterator it = _wbddcs.begin();
935  if ( it != _wbddcs.end() )
936  ret = it->second->isTunable();
937  return ret;
938  }
939 
941  {
942  bool ret = false;
943  WbddcComponentDict::const_iterator it = _wbddcs.begin();
944  if ( it != _wbddcs.end() )
945  ret = it->second->isSourceSelectable();
946  return ret;
947  }
948 
950  {
951  BasicDoubleList ret;
952  WbddcComponentDict::const_iterator it = _wbddcs.begin();
953  if ( it != _wbddcs.end() )
954  ret = it->second->getFrequencyRange();
955  return ret;
956  }
957 
959  {
960  double ret = 0.0;
961  WbddcComponentDict::const_iterator it = _wbddcs.begin();
962  if ( it != _wbddcs.end() )
963  ret = it->second->getFrequencyRes();
964  return ret;
965  }
966 
968  {
969  double ret = 0.0;
970  WbddcComponentDict::const_iterator it = _wbddcs.begin();
971  if ( it != _wbddcs.end() )
972  ret = it->second->getFrequencyUnit();
973  return ret;
974  }
975 
977  {
978  WbddcRateSet ret;
979  WbddcComponentDict::const_iterator it = _wbddcs.begin();
980  if ( it != _wbddcs.end() )
981  ret = it->second->getRateSet();
982  return ret;
983  }
984 
986  {
987  BasicDoubleList ret;
988  WbddcComponentDict::const_iterator it = _wbddcs.begin();
989  if ( it != _wbddcs.end() )
990  ret = it->second->getRateList();
991  return ret;
992  }
993 
994  bool RadioHandler::isWbddcEnabled(int index) const
995  {
996  bool ret = false;
997  WbddcComponentDict::const_iterator it = _wbddcs.find(index);
998  if ( it != _wbddcs.end() )
999  ret = it->second->isEnabled();
1000  return ret;
1001  }
1002 
1003  bool RadioHandler::enableWbddc(int index, bool enabled)
1004  {
1005  bool ret = false;
1006  WbddcComponentDict::const_iterator it = _wbddcs.find(index);
1007  if ( it != _wbddcs.end() )
1008  ret = it->second->enable(enabled);
1009  return ret;
1010  }
1011 
1013  {
1014  return enableWbddc(index, false);
1015  }
1016 
1017  double RadioHandler::getWbddcFrequency(int index) const
1018  {
1019  double ret = 0.0;
1020  WbddcComponentDict::const_iterator it = _wbddcs.find(index);
1021  if ( it != _wbddcs.end() )
1022  ret = it->second->getFrequency();
1023  return ret;
1024  }
1025 
1026  bool RadioHandler::setWbddcFrequency(int index, double freq)
1027  {
1028  bool ret = false;
1029  WbddcComponentDict::const_iterator it = _wbddcs.find(index);
1030  if ( it != _wbddcs.end() )
1031  ret = it->second->setFrequency(freq);
1032  return ret;
1033  }
1034 
1035  int RadioHandler::getWbddcSource(int index) const
1036  {
1037  int ret = 0;
1038  WbddcComponentDict::const_iterator it = _wbddcs.find(index);
1039  if ( it != _wbddcs.end() )
1040  ret = it->second->getSource();
1041  return ret;
1042  }
1043 
1044  bool RadioHandler::setWbddcSource(int index, int source)
1045  {
1046  bool ret = false;
1047  WbddcComponentDict::const_iterator it = _wbddcs.find(index);
1048  if ( it != _wbddcs.end() )
1049  ret = it->second->setSource(source);
1050  return ret;
1051  }
1052 
1053  int RadioHandler::getWbddcRateIndex(int index) const
1054  {
1055  int ret = 0;
1056  WbddcComponentDict::const_iterator it = _wbddcs.find(index);
1057  if ( it != _wbddcs.end() )
1058  ret = it->second->getRateIndex();
1059  return ret;
1060  }
1061 
1062  bool RadioHandler::setWbddcRateIndex(int index, int rateIndex)
1063  {
1064  bool ret = false;
1065  WbddcComponentDict::const_iterator it = _wbddcs.find(index);
1066  if ( it != _wbddcs.end() )
1067  ret = it->second->setRateIndex(rateIndex);
1068  return ret;
1069  }
1070 
1072  {
1073  int ret = 0;
1074  WbddcComponentDict::const_iterator it = _wbddcs.find(index);
1075  if ( it != _wbddcs.end() )
1076  ret = it->second->getUdpDestination();
1077  return ret;
1078  }
1079 
1080  bool RadioHandler::setWbddcUdpDestination(int index, int dest)
1081  {
1082  bool ret = false;
1083  WbddcComponentDict::const_iterator it = _wbddcs.find(index);
1084  if ( it != _wbddcs.end() )
1085  ret = it->second->setUdpDestination(dest);
1086  return ret;
1087  }
1088 
1090  {
1091  int ret = 0;
1092  WbddcComponentDict::const_iterator it = _wbddcs.find(index);
1093  if ( it != _wbddcs.end() )
1094  ret = it->second->getVitaEnable();
1095  return ret;
1096  }
1097 
1098  bool RadioHandler::setWbddcVitaEnable(int index, int enable)
1099  {
1100  bool ret = false;
1101  WbddcComponentDict::const_iterator it = _wbddcs.find(index);
1102  if ( it != _wbddcs.end() )
1103  ret = it->second->setVitaEnable(enable);
1104  return ret;
1105  }
1106 
1107  unsigned int RadioHandler::getWbddcStreamId(int index) const
1108  {
1109  unsigned int ret = 0;
1110  WbddcComponentDict::const_iterator it = _wbddcs.find(index);
1111  if ( it != _wbddcs.end() )
1112  ret = it->second->getStreamId();
1113  return ret;
1114  }
1115 
1116  bool RadioHandler::setWbddcStreamId(int index, unsigned int sid)
1117  {
1118  bool ret = false;
1119  WbddcComponentDict::const_iterator it = _wbddcs.find(index);
1120  if ( it != _wbddcs.end() )
1121  ret = it->second->setStreamId(sid);
1122  return ret;
1123  }
1124 
1125  int RadioHandler::getWbddcDataPort(int index) const
1126  {
1127  int ret = 0;
1128  WbddcComponentDict::const_iterator it = _wbddcs.find(index);
1129  if ( it != _wbddcs.end() )
1130  ret = it->second->getDataPort();
1131  return ret;
1132  }
1133 
1134  bool RadioHandler::setWbddcDataPort(int index, int port)
1135  {
1136  bool ret = false;
1137  WbddcComponentDict::const_iterator it = _wbddcs.find(index);
1138  if ( it != _wbddcs.end() )
1139  ret = it->second->setDataPort(port);
1140  return ret;
1141  }
1142 
1143  bool RadioHandler::setWbddcRateSet(int index, const WbddcRateSet& set)
1144  {
1145  bool ret = false;
1146  WbddcComponentDict::const_iterator it = _wbddcs.find(index);
1147  if ( it != _wbddcs.end() )
1148  ret = it->second->setRateSet(set);
1149  return ret;
1150  }
1151 
1153  {
1154  ConfigurationDict ret;
1155  WbddcComponentDict::const_iterator it = _wbddcs.find(index);
1156  if ( it != _wbddcs.end() )
1157  ret = it->second->getConfiguration();
1158  return ret;
1159  }
1160 
1162  {
1163  bool ret = false;
1164  WbddcComponentDict::const_iterator it = _wbddcs.find(index);
1165  if ( it != _wbddcs.end() )
1166  ret = it->second->setConfiguration(cfg);
1167  return ret;
1168  }
1169 
1171  {
1172  return _numNbddc;
1173  }
1174 
1176  {
1177  BasicIntList ret;
1178  for (int num = _nbddcIndexBase; num < _nbddcIndexBase + _numNbddc; num++)
1179  ret.push_back(num);
1180  return ret;
1181  }
1182 
1184  {
1185  BasicDoubleList ret;
1186  NbddcComponentDict::const_iterator it = _nbddcs.begin();
1187  if ( it != _nbddcs.end() )
1188  ret = it->second->getFrequencyRange();
1189  return ret;
1190  }
1191 
1193  {
1194  double ret = 0.0;
1195  NbddcComponentDict::const_iterator it = _nbddcs.begin();
1196  if ( it != _nbddcs.end() )
1197  ret = it->second->getFrequencyRes();
1198  return ret;
1199  }
1200 
1202  {
1203  double ret = 0.0;
1204  NbddcComponentDict::const_iterator it = _nbddcs.begin();
1205  if ( it != _nbddcs.end() )
1206  ret = it->second->getFrequencyUnit();
1207  return ret;
1208  }
1209 
1211  {
1212  NbddcRateSet ret;
1213  NbddcComponentDict::const_iterator it = _nbddcs.begin();
1214  if ( it != _nbddcs.end() )
1215  ret = it->second->getRateSet();
1216  return ret;
1217  }
1218 
1220  {
1221  BasicDoubleList ret;
1222  NbddcComponentDict::const_iterator it = _nbddcs.begin();
1223  if ( it != _nbddcs.end() )
1224  ret = it->second->getRateList();
1225  return ret;
1226  }
1227 
1228  bool RadioHandler::isNbddcEnabled(int index) const
1229  {
1230  bool ret = false;
1231  NbddcComponentDict::const_iterator it = _nbddcs.begin();
1232  if ( it != _nbddcs.end() )
1233  ret = it->second->isEnabled();
1234  return ret;
1235  }
1236 
1237  bool RadioHandler::enableNbddc(int index, bool enabled)
1238  {
1239  bool ret = false;
1240  NbddcComponentDict::const_iterator it = _nbddcs.begin();
1241  if ( it != _nbddcs.end() )
1242  ret = it->second->enable(enabled);
1243  return ret;
1244  }
1245 
1247  {
1248  return enableNbddc(index, false);
1249  }
1250 
1252  {
1253  ConfigurationDict ret;
1254  NbddcComponentDict::const_iterator it = _nbddcs.find(index);
1255  if ( it != _nbddcs.end() )
1256  ret = it->second->getConfiguration();
1257  return ret;
1258  }
1259 
1261  {
1262  bool ret = false;
1263  NbddcComponentDict::const_iterator it = _nbddcs.begin();
1264  if ( it != _nbddcs.end() )
1265  ret = it->second->setConfiguration(cfg);
1266  return ret;
1267  }
1268 
1269  double RadioHandler::getNbddcFrequency(int index) const
1270  {
1271  double ret = 0.0;
1272  NbddcComponentDict::const_iterator it = _nbddcs.begin();
1273  if ( it != _nbddcs.end() )
1274  ret = it->second->getFrequency();
1275  return ret;
1276  }
1277 
1278  bool RadioHandler::setNbddcFrequency(int index, double freq)
1279  {
1280  bool ret = false;
1281  NbddcComponentDict::const_iterator it = _nbddcs.begin();
1282  if ( it != _nbddcs.end() )
1283  ret = it->second->setFrequency(freq);
1284  return ret;
1285  }
1286 
1287  int RadioHandler::getNbddcSource(int index) const
1288  {
1289  int ret = 0;
1290  NbddcComponentDict::const_iterator it = _nbddcs.begin();
1291  if ( it != _nbddcs.end() )
1292  ret = it->second->getSource();
1293  return ret;
1294  }
1295 
1296  bool RadioHandler::setNbddcSource(int index, int source)
1297  {
1298  bool ret = false;
1299  NbddcComponentDict::const_iterator it = _nbddcs.begin();
1300  if ( it != _nbddcs.end() )
1301  ret = it->second->setSource(source);
1302  return ret;
1303  }
1304 
1305  int RadioHandler::getNbddcRateIndex(int index) const
1306  {
1307  int ret = 0;
1308  NbddcComponentDict::const_iterator it = _nbddcs.begin();
1309  if ( it != _nbddcs.end() )
1310  ret = it->second->getRateIndex();
1311  return ret;
1312  }
1313 
1314  bool RadioHandler::setNbddcRateIndex(int index, int rateIndex)
1315  {
1316  bool ret = false;
1317  NbddcComponentDict::const_iterator it = _nbddcs.begin();
1318  if ( it != _nbddcs.end() )
1319  ret = it->second->setRateIndex(rateIndex);
1320  return ret;
1321  }
1322 
1324  {
1325  int ret = 0;
1326  NbddcComponentDict::const_iterator it = _nbddcs.begin();
1327  if ( it != _nbddcs.end() )
1328  ret = it->second->getUdpDestination();
1329  return ret;
1330  }
1331 
1332  bool RadioHandler::setNbddcUdpDestination(int index, int dest)
1333  {
1334  bool ret = false;
1335  NbddcComponentDict::const_iterator it = _nbddcs.begin();
1336  if ( it != _nbddcs.end() )
1337  ret = it->second->setUdpDestination(dest);
1338  return ret;
1339  }
1340 
1342  {
1343  int ret = 0;
1344  NbddcComponentDict::const_iterator it = _nbddcs.begin();
1345  if ( it != _nbddcs.end() )
1346  ret = it->second->getVitaEnable();
1347  return ret;
1348  }
1349 
1350  bool RadioHandler::setNbddcVitaEnable(int index, int enable)
1351  {
1352  bool ret = false;
1353  NbddcComponentDict::const_iterator it = _nbddcs.begin();
1354  if ( it != _nbddcs.end() )
1355  ret = it->second->setVitaEnable(enable);
1356  return ret;
1357  }
1358 
1359  unsigned int RadioHandler::getNbddcStreamId(int index) const
1360  {
1361  int ret = 0;
1362  NbddcComponentDict::const_iterator it = _nbddcs.begin();
1363  if ( it != _nbddcs.end() )
1364  ret = it->second->getStreamId();
1365  return ret;
1366  }
1367 
1368  bool RadioHandler::setNbddcStreamId(int index, unsigned int sid)
1369  {
1370  bool ret = false;
1371  NbddcComponentDict::const_iterator it = _nbddcs.begin();
1372  if ( it != _nbddcs.end() )
1373  ret = it->second->setStreamId(sid);
1374  return ret;
1375  }
1376 
1377  int RadioHandler::getNbddcDataPort(int index) const
1378  {
1379  int ret = 0;
1380  NbddcComponentDict::const_iterator it = _nbddcs.begin();
1381  if ( it != _nbddcs.end() )
1382  ret = it->second->getDataPort();
1383  return ret;
1384  }
1385 
1386  bool RadioHandler::setNbddcDataPort(int index, int port)
1387  {
1388  bool ret = false;
1389  NbddcComponentDict::const_iterator it = _nbddcs.begin();
1390  if ( it != _nbddcs.end() )
1391  ret = it->second->setDataPort(port);
1392  return ret;
1393  }
1394 
1395  bool RadioHandler::setNbddcRateSet(int index, const NbddcRateSet& set)
1396  {
1397  bool ret = false;
1398  NbddcComponentDict::const_iterator it = _nbddcs.begin();
1399  if ( it != _nbddcs.end() )
1400  ret = it->second->setRateSet(set);
1401  return ret;
1402  }
1403 
1405  {
1406  return _numTransmitter;
1407  }
1408 
1410  {
1411  BasicIntList ret;
1412  for (int num = _transmitterIndexBase; num < _transmitterIndexBase + _numTransmitter;
1413  num++)
1414  ret.push_back(num);
1415  return ret;
1416  }
1417 
1419  {
1420  BasicDoubleList ret;
1421  TransmitterComponentDict::const_iterator it = _txs.begin();
1422  if ( it != _txs.end() )
1423  ret = it->second->getFrequencyRange();
1424  return ret;
1425  }
1426 
1428  {
1429  double ret = 0.0;
1430  TransmitterComponentDict::const_iterator it = _txs.begin();
1431  if ( it != _txs.end() )
1432  ret = it->second->getFrequencyRes();
1433  return ret;
1434  }
1435 
1437  {
1438  double ret = 0.0;
1439  TransmitterComponentDict::const_iterator it = _txs.begin();
1440  if ( it != _txs.end() )
1441  ret = it->second->getFrequencyUnit();
1442  return ret;
1443  }
1444 
1446  {
1447  BasicDoubleList ret;
1448  TransmitterComponentDict::const_iterator it = _txs.begin();
1449  if ( it != _txs.end() )
1450  ret = it->second->getAttenuationRange();
1451  return ret;
1452  }
1453 
1455  {
1456  double ret = 0.0;
1457  TransmitterComponentDict::const_iterator it = _txs.begin();
1458  if ( it != _txs.end() )
1459  ret = it->second->getAttenuationRes();
1460  return ret;
1461  }
1462 
1464  {
1465  bool ret = false;
1466  TransmitterComponentDict::const_iterator it = _txs.find(index);
1467  if ( it != _txs.end() )
1468  ret = it->second->isEnabled();
1469  return ret;
1470  }
1471 
1472  bool RadioHandler::enableTransmitter(int index, bool enabled)
1473  {
1474  bool ret = false;
1475  TransmitterComponentDict::const_iterator it = _txs.find(index);
1476  if ( it != _txs.end() )
1477  ret = it->second->enable(enabled);
1478  return ret;
1479  }
1480 
1482  {
1483  return enableTransmitter(index, false);
1484  }
1485 
1487  {
1488  double ret = 0.0;
1489  TransmitterComponentDict::const_iterator it = _txs.find(index);
1490  if ( it != _txs.end() )
1491  ret = it->second->getFrequency();
1492  return ret;
1493  }
1494 
1495  bool RadioHandler::setTransmitterFrequency(int index, double freq)
1496  {
1497  bool ret = false;
1498  TransmitterComponentDict::const_iterator it = _txs.find(index);
1499  if ( it != _txs.end() )
1500  ret = it->second->setFrequency(freq);
1501  return ret;
1502  }
1503 
1505  {
1506  double ret = 0.0;
1507  TransmitterComponentDict::const_iterator it = _txs.find(index);
1508  if ( it != _txs.end() )
1509  ret = it->second->getAttenuation();
1510  return ret;
1511  }
1512 
1513  bool RadioHandler::setTransmitterAttenuation(int index, double atten)
1514  {
1515  bool ret = false;
1516  TransmitterComponentDict::const_iterator it = _txs.find(index);
1517  if ( it != _txs.end() )
1518  ret = it->second->setAttenuation(atten);
1519  return ret;
1520  }
1521 
1523  {
1524  ConfigurationDict ret;
1525  TransmitterComponentDict::const_iterator it = _txs.find(index);
1526  if ( it != _txs.end() )
1527  ret = it->second->getConfiguration();
1528  return ret;
1529  }
1530 
1532  {
1533  bool ret = false;
1534  TransmitterComponentDict::const_iterator it = _txs.find(index);
1535  if ( it != _txs.end() )
1536  ret = it->second->setConfiguration(cfg);
1537  return ret;
1538  }
1539 
1541  {
1542  bool ret = false;
1543  TransmitterComponentDict::const_iterator it = _txs.begin();
1544  if ( it != _txs.end() )
1545  ret = it->second->supportsCW();
1546  return ret;
1547  }
1548 
1550  {
1551  int ret = 0;
1552  TransmitterComponentDict::const_iterator it = _txs.begin();
1553  if ( it != _txs.end() )
1554  ret = it->second->getCWNum();
1555  return ret;
1556  }
1557 
1559  {
1560  BasicIntList ret;
1561  TransmitterComponentDict::const_iterator it = _txs.begin();
1562  if ( it != _txs.end() )
1563  ret = it->second->getCWIndexRange();
1564  return ret;
1565  }
1566 
1568  {
1569  BasicDoubleList ret;
1570  TransmitterComponentDict::const_iterator it = _txs.begin();
1571  if ( it != _txs.end() )
1572  ret = it->second->getCWFrequencyRange();
1573  return ret;
1574  }
1575 
1577  {
1578  double ret = 0.0;
1579  TransmitterComponentDict::const_iterator it = _txs.begin();
1580  if ( it != _txs.end() )
1581  ret = it->second->getCWFrequencyRes();
1582  return ret;
1583  }
1584 
1586  {
1587  BasicDoubleList ret;
1588  TransmitterComponentDict::const_iterator it = _txs.begin();
1589  if ( it != _txs.end() )
1590  ret = it->second->getCWAmplitudeRange();
1591  return ret;
1592  }
1593 
1595  {
1596  double ret = 0.0;
1597  TransmitterComponentDict::const_iterator it = _txs.begin();
1598  if ( it != _txs.end() )
1599  ret = it->second->getCWAmplitudeRes();
1600  return ret;
1601  }
1602 
1604  {
1605  BasicDoubleList ret;
1606  TransmitterComponentDict::const_iterator it = _txs.begin();
1607  if ( it != _txs.end() )
1608  ret = it->second->getCWPhaseRange();
1609  return ret;
1610  }
1611 
1613  {
1614  int ret = 0;
1615  TransmitterComponentDict::const_iterator it = _txs.begin();
1616  if ( it != _txs.end() )
1617  ret = it->second->getCWPhaseRes();
1618  return ret;
1619  }
1620 
1622  {
1623  bool ret = false;
1624  TransmitterComponentDict::const_iterator it = _txs.begin();
1625  if ( it != _txs.end() )
1626  ret = it->second->supportsCWSweep();
1627  return ret;
1628  }
1629 
1631  {
1632  BasicDoubleList ret;
1633  TransmitterComponentDict::const_iterator it = _txs.begin();
1634  if ( it != _txs.end() )
1635  ret = it->second->getCWSweepStartRange();
1636  return ret;
1637  }
1638 
1640  {
1641  double ret = 0.0;
1642  TransmitterComponentDict::const_iterator it = _txs.begin();
1643  if ( it != _txs.end() )
1644  ret = it->second->getCWSweepStartRes();
1645  return ret;
1646  }
1647 
1649  {
1650  BasicDoubleList ret;
1651  TransmitterComponentDict::const_iterator it = _txs.begin();
1652  if ( it != _txs.end() )
1653  ret = it->second->getCWSweepStopRange();
1654  return ret;
1655  }
1656 
1658  {
1659  double ret = 0.0;
1660  TransmitterComponentDict::const_iterator it = _txs.begin();
1661  if ( it != _txs.end() )
1662  ret = it->second->getCWSweepStopRes();
1663  return ret;
1664  }
1665 
1667  {
1668  BasicDoubleList ret;
1669  TransmitterComponentDict::const_iterator it = _txs.begin();
1670  if ( it != _txs.end() )
1671  ret = it->second->getCWSweepStepRange();
1672  return ret;
1673  }
1674 
1676  {
1677  double ret = 0.0;
1678  TransmitterComponentDict::const_iterator it = _txs.begin();
1679  if ( it != _txs.end() )
1680  ret = it->second->getCWSweepStepRes();
1681  return ret;
1682  }
1683 
1685  {
1686  BasicDoubleList ret;
1687  TransmitterComponentDict::const_iterator it = _txs.begin();
1688  if ( it != _txs.end() )
1689  ret = it->second->getCWSweepDwellRange();
1690  return ret;
1691  }
1692 
1694  {
1695  double ret = 0.0;
1696  TransmitterComponentDict::const_iterator it = _txs.begin();
1697  if ( it != _txs.end() )
1698  ret = it->second->getCWSweepDwellRes();
1699  return ret;
1700  }
1701 
1702  bool RadioHandler::enableTransmitterCW(int index, int cwIndex, bool enabled)
1703  {
1704  bool ret = false;
1705  TransmitterComponentDict::const_iterator it = _txs.find(index);
1706  if ( it != _txs.end() )
1707  ret = it->second->enableCW(cwIndex);
1708  return ret;
1709  }
1710 
1711  bool RadioHandler::disableTransmitterCW(int index, int cwIndex)
1712  {
1713  return enableTransmitterCW(index, cwIndex, false);
1714  }
1715 
1717  int cwIndex) const
1718  {
1719  ConfigurationDict ret;
1720  TransmitterComponentDict::const_iterator it = _txs.find(index);
1721  if ( it != _txs.end() )
1722  ret = it->second->getCWConfiguration(cwIndex);
1723  return ret;
1724  }
1725 
1726  bool RadioHandler::setTransmitterCWConfiguration(int index, int cwIndex,
1727  ConfigurationDict& cfg)
1728  {
1729  bool ret = false;
1730  TransmitterComponentDict::const_iterator it = _txs.find(index);
1731  if ( it != _txs.end() )
1732  ret = it->second->setCWConfiguration(cwIndex, cfg);
1733  return ret;
1734  }
1735 
1736  double RadioHandler::getTransmitterCWFrequency(int index, int cwIndex) const
1737  {
1738  double ret = 0.0;
1739  TransmitterComponentDict::const_iterator it = _txs.find(index);
1740  if ( it != _txs.end() )
1741  ret = it->second->getCWFrequency(cwIndex);
1742  return ret;
1743  }
1744 
1745  bool RadioHandler::setTransmitterCWFrequency(int index, int cwIndex, double freq)
1746  {
1747  bool ret = false;
1748  TransmitterComponentDict::const_iterator it = _txs.find(index);
1749  if ( it != _txs.end() )
1750  ret = it->second->setCWFrequency(cwIndex, freq);
1751  return ret;
1752  }
1753 
1754  double RadioHandler::getTransmitterCWAmplitude(int index, int cwIndex) const
1755  {
1756  double ret = 0.0;
1757  TransmitterComponentDict::const_iterator it = _txs.find(index);
1758  if ( it != _txs.end() )
1759  ret = it->second->getCWAmplitude(cwIndex);
1760  return ret;
1761  }
1762 
1763  bool RadioHandler::setTransmitterCWAmplitude(int index, int cwIndex, double amp)
1764  {
1765  bool ret = false;
1766  TransmitterComponentDict::const_iterator it = _txs.find(index);
1767  if ( it != _txs.end() )
1768  ret = it->second->setCWAmplitude(cwIndex, amp);
1769  return ret;
1770  }
1771 
1772  double RadioHandler::getTransmitterCWPhase(int index, int cwIndex) const
1773  {
1774  double ret = 0.0;
1775  TransmitterComponentDict::const_iterator it = _txs.find(index);
1776  if ( it != _txs.end() )
1777  ret = it->second->getCWPhase(cwIndex);
1778  return ret;
1779  }
1780 
1781  bool RadioHandler::setTransmitterCWPhase(int index, int cwIndex, double phase)
1782  {
1783  bool ret = false;
1784  TransmitterComponentDict::const_iterator it = _txs.find(index);
1785  if ( it != _txs.end() )
1786  ret = it->second->setCWPhase(cwIndex, phase);
1787  return ret;
1788  }
1789 
1790  bool RadioHandler::transmitterSupportsCWSweep(int index, int cwIndex) const
1791  {
1792  bool ret = false;
1793  TransmitterComponentDict::const_iterator it = _txs.find(index);
1794  if ( it != _txs.end() )
1795  ret = it->second->supportsCWSweep(cwIndex);
1796  return ret;
1797  }
1798 
1799  double RadioHandler::getTransmitterCWSweepStartFrequency(int index, int cwIndex) const
1800  {
1801  double ret = 0.0;
1802  TransmitterComponentDict::const_iterator it = _txs.find(index);
1803  if ( it != _txs.end() )
1804  ret = it->second->getCWSweepStartFrequency(cwIndex);
1805  return ret;
1806  }
1807 
1808  double RadioHandler::getTransmitterCWSweepStopFrequency(int index, int cwIndex) const
1809  {
1810  double ret = 0.0;
1811  TransmitterComponentDict::const_iterator it = _txs.find(index);
1812  if ( it != _txs.end() )
1813  ret = it->second->getCWSweepStopFrequency(cwIndex);
1814  return ret;
1815  }
1816 
1817  double RadioHandler::getTransmitterCWSweepFrequencyStep(int index, int cwIndex) const
1818  {
1819  double ret = 0.0;
1820  TransmitterComponentDict::const_iterator it = _txs.find(index);
1821  if ( it != _txs.end() )
1822  ret = it->second->getCWSweepFrequencyStep(cwIndex);
1823  return ret;
1824  }
1825 
1826  double RadioHandler::getTransmitterCWSweepDwellTime(int index, int cwIndex) const
1827  {
1828  double ret = 0.0;
1829  TransmitterComponentDict::const_iterator it = _txs.find(index);
1830  if ( it != _txs.end() )
1831  ret = it->second->getCWSweepDwellTime(cwIndex);
1832  return ret;
1833  }
1834 
1835  bool RadioHandler::setTransmitterCWFrequencySweep(int index, int cwIndex, double start,
1836  double stop, double step, double dwell)
1837  {
1838  bool ret = false;
1839  TransmitterComponentDict::const_iterator it = _txs.find(index);
1840  if ( it != _txs.end() )
1841  ret = it->second->setCWFrequencySweep(cwIndex, start, stop, step, dwell);
1842  return ret;
1843  }
1844 
1846  {
1847  return _numDuc;
1848  }
1849 
1851  {
1852  BasicIntList ret;
1853  for (int num = _ducIndexBase; num < _ducIndexBase + _numDuc; num++)
1854  ret.push_back(num);
1855  return ret;
1856  }
1857 
1859  {
1860  bool ret = false;
1861  DucComponentDict::const_iterator it = _ducs.begin();
1862  if ( it != _ducs.end() )
1863  ret = it->second->supportsSnapshotLoad();
1864  return ret;
1865  }
1866 
1868  {
1869  bool ret = false;
1870  DucComponentDict::const_iterator it = _ducs.begin();
1871  if ( it != _ducs.end() )
1872  ret = it->second->supportsSnapshotTransmit();
1873  return ret;
1874  }
1875 
1876  bool RadioHandler::enableDuc(int index, bool enabled)
1877  {
1878  bool ret = false;
1879  DucComponentDict::const_iterator it = _ducs.find(index);
1880  if ( it != _ducs.end() )
1881  ret = it->second->enable(enabled);
1882  return ret;
1883  }
1884 
1886  {
1887  return enableDuc(index, false);
1888  }
1889 
1891  {
1892  ConfigurationDict ret;
1893  DucComponentDict::const_iterator it = _ducs.find(index);
1894  if ( it != _ducs.end() )
1895  ret = it->second->getConfiguration();
1896  return ret;
1897  }
1898 
1900  {
1901  bool ret = false;
1902  DucComponentDict::const_iterator it = _ducs.find(index);
1903  if ( it != _ducs.end() )
1904  ret = it->second->setConfiguration(cfg);
1905  return ret;
1906  }
1907 
1908  int RadioHandler::getDucDataPort(int index) const
1909  {
1910  int ret = 0;
1911  DucComponentDict::const_iterator it = _ducs.find(index);
1912  if ( it != _ducs.end() )
1913  ret = it->second->getDataPort();
1914  return ret;
1915  }
1916 
1917  bool RadioHandler::setDucDataPort(int index, int port)
1918  {
1919  bool ret = false;
1920  DucComponentDict::const_iterator it = _ducs.find(index);
1921  if ( it != _ducs.end() )
1922  ret = it->second->setDataPort(port);
1923  return ret;
1924  }
1925 
1926  double RadioHandler::getDucFrequency(int index) const
1927  {
1928  double ret = 0.0;
1929  DucComponentDict::const_iterator it = _ducs.find(index);
1930  if ( it != _ducs.end() )
1931  ret = it->second->getFrequency();
1932  return ret;
1933  }
1934 
1935  bool RadioHandler::setDucFrequency(int index, double freq)
1936  {
1937  bool ret = false;
1938  DucComponentDict::const_iterator it = _ducs.find(index);
1939  if ( it != _ducs.end() )
1940  ret = it->second->setFrequency(freq);
1941  return ret;
1942  }
1943 
1945  {
1946  BasicDoubleList ret;
1947  DucComponentDict::const_iterator it = _ducs.begin();
1948  if ( it != _ducs.end() )
1949  ret = it->second->getFrequencyRange();
1950  return ret;
1951  }
1952 
1954  {
1955  double ret = 0.0;
1956  DucComponentDict::const_iterator it = _ducs.begin();
1957  if ( it != _ducs.end() )
1958  ret = it->second->getFrequencyRes();
1959  return ret;
1960  }
1961 
1963  {
1964  double ret = 0.0;
1965  DucComponentDict::const_iterator it = _ducs.begin();
1966  if ( it != _ducs.end() )
1967  ret = it->second->getFrequencyUnit();
1968  return ret;
1969  }
1970 
1971  double RadioHandler::getDucAttenuation(int index) const
1972  {
1973  double ret = 0.0;
1974  DucComponentDict::const_iterator it = _ducs.find(index);
1975  if ( it != _ducs.end() )
1976  ret = it->second->getAttenuation();
1977  return ret;
1978  }
1979 
1980  bool RadioHandler::setDucAttenuation(int index, double atten)
1981  {
1982  bool ret = false;
1983  DucComponentDict::const_iterator it = _ducs.find(index);
1984  if ( it != _ducs.end() )
1985  ret = it->second->setAttenuation(atten);
1986  return ret;
1987  }
1988 
1990  {
1991  BasicDoubleList ret;
1992  DucComponentDict::const_iterator it = _ducs.begin();
1993  if ( it != _ducs.end() )
1994  ret = it->second->getAttenuationRange();
1995  return ret;
1996  }
1997 
1999  {
2000  double ret = 0.0;
2001  DucComponentDict::const_iterator it = _ducs.begin();
2002  if ( it != _ducs.end() )
2003  ret = it->second->getAttenuationRes();
2004  return ret;
2005  }
2006 
2007  int RadioHandler::getDucRateIndex(int index) const
2008  {
2009  int ret = 0;
2010  DucComponentDict::const_iterator it = _ducs.find(index);
2011  if ( it != _ducs.end() )
2012  ret = it->second->getRateIndex();
2013  return ret;
2014  }
2015 
2016  bool RadioHandler::setDucRateIndex(int index, int rateIndex)
2017  {
2018  bool ret = false;
2019  DucComponentDict::const_iterator it = _ducs.find(index);
2020  if ( it != _ducs.end() )
2021  ret = it->second->setRateIndex(rateIndex);
2022  return ret;
2023  }
2024 
2026  {
2027  int ret = 0;
2028  DucComponentDict::const_iterator it = _ducs.find(index);
2029  if ( it != _ducs.end() )
2030  ret = it->second->getTxChannelBitmap();
2031  return ret;
2032  }
2033 
2034  bool RadioHandler::setDucTxChannelBitmap(int index, int txChannels)
2035  {
2036  bool ret = false;
2037  DucComponentDict::const_iterator it = _ducs.find(index);
2038  if ( it != _ducs.end() )
2039  ret = it->second->setTxChannelBitmap(txChannels);
2040  return ret;
2041  }
2042 
2043  int RadioHandler::getDucMode(int index) const
2044  {
2045  int ret = 0;
2046  DucComponentDict::const_iterator it = _ducs.find(index);
2047  if ( it != _ducs.end() )
2048  ret = it->second->getMode();
2049  return ret;
2050  }
2051 
2052  bool RadioHandler::setDucMode(int index, int mode)
2053  {
2054  bool ret = false;
2055  DucComponentDict::const_iterator it = _ducs.find(index);
2056  if ( it != _ducs.end() )
2057  ret = it->second->setMode(mode);
2058  return ret;
2059  }
2060 
2061  unsigned int RadioHandler::getDucStreamId(int index) const
2062  {
2063  int ret = 0;
2064  DucComponentDict::const_iterator it = _ducs.find(index);
2065  if ( it != _ducs.end() )
2066  ret = it->second->getStreamId();
2067  return ret;
2068  }
2069 
2070  bool RadioHandler::setDucStreamId(int index, unsigned int sid)
2071  {
2072  bool ret = false;
2073  DucComponentDict::const_iterator it = _ducs.find(index);
2074  if ( it != _ducs.end() )
2075  ret = it->second->setStreamId(sid);
2076  return ret;
2077  }
2078 
2080  const std::string& filename,
2081  unsigned int startSample,
2082  unsigned int samples)
2083  {
2084  bool ret = false;
2085  DucComponentDict::const_iterator it = _ducs.find(index);
2086  if ( it != _ducs.end() )
2087  if ( it->second->supportsSnapshotLoad() )
2088  ret = it->second->loadSnapshot(filename, startSample, samples);
2089  return ret;
2090  }
2091 
2093  {
2094  DucRateSet ret;
2095  DucComponentDict::const_iterator it = _ducs.begin();
2096  if ( it != _ducs.end() )
2097  ret = it->second->getRateSet();
2098  return ret;
2099  }
2100 
2102  {
2103  BasicDoubleList ret;
2104  DucComponentDict::const_iterator it = _ducs.begin();
2105  if ( it != _ducs.end() )
2106  ret = it->second->getRateList();
2107  return ret;
2108  }
2109 
2111  {
2112  return _numWbddcGroups;
2113  }
2114 
2116  {
2117  BasicIntList ret;
2118  for (int num = _wbddcGroupIndexBase; num < _wbddcGroupIndexBase + _numWbddcGroups; num++)
2119  ret.push_back(num);
2120  return ret;
2121  }
2122 
2124  {
2125  bool ret = false;
2126  WbddcGroupComponentDict::const_iterator it = _wbddcGroups.find(index);
2127  if ( it != _wbddcGroups.end() )
2128  ret = it->second->isEnabled();
2129  return ret;
2130  }
2131 
2132  bool RadioHandler::enableWbddcGroup(int index, bool enabled)
2133  {
2134  bool ret = false;
2135  WbddcGroupComponentDict::const_iterator it = _wbddcGroups.find(index);
2136  if ( it != _wbddcGroups.end() )
2137  ret = it->second->enable(enabled);
2138  return ret;
2139  }
2140 
2142  {
2143  return enableWbddcGroup(index, false);
2144  }
2145 
2147  {
2148  ConfigurationDict ret;
2149  WbddcGroupComponentDict::const_iterator it = _wbddcGroups.find(index);
2150  if ( it != _wbddcGroups.end() )
2151  ret = it->second->getConfiguration();
2152  return ret;
2153  }
2154 
2156  {
2157  bool ret = false;
2158  WbddcGroupComponentDict::const_iterator it = _wbddcGroups.find(index);
2159  if ( it != _wbddcGroups.end() )
2160  ret = it->second->setConfiguration(cfg);
2161  return ret;
2162  }
2163 
2165  {
2166  BasicIntList ret;
2167  WbddcGroupComponentDict::const_iterator it = _wbddcGroups.find(index);
2168  if ( it != _wbddcGroups.end() )
2169  ret = it->second->getMembers();
2170  return ret;
2171  }
2172 
2173  bool RadioHandler::setWbddcGroupMembers(int index, const BasicIntList& groupMembers)
2174  {
2175  bool ret = false;
2176  WbddcGroupComponentDict::const_iterator it = _wbddcGroups.find(index);
2177  if ( it != _wbddcGroups.end() )
2178  ret = it->second->setMembers(groupMembers);
2179  return ret;
2180  }
2181 
2182  bool RadioHandler::addWbddcGroupMember(int index, int member)
2183  {
2184  bool ret = false;
2185  WbddcGroupComponentDict::const_iterator it = _wbddcGroups.find(index);
2186  if ( it != _wbddcGroups.end() )
2187  ret = it->second->addMember(member);
2188  return ret;
2189  }
2190 
2191  bool RadioHandler::removeWbddcGroupMember(int index, int member)
2192  {
2193  bool ret = false;
2194  WbddcGroupComponentDict::const_iterator it = _wbddcGroups.find(index);
2195  if ( it != _wbddcGroups.end() )
2196  ret = it->second->removeMember(member);
2197  return ret;
2198  }
2199 
2201  {
2202  return _numNbddcGroups;
2203  }
2204 
2206  {
2207  BasicIntList ret;
2208  for (int num = _nbddcGroupIndexBase; num < _nbddcGroupIndexBase + _numNbddcGroups; num++)
2209  ret.push_back(num);
2210  return ret;
2211  }
2212 
2214  {
2215  bool ret = false;
2216  NbddcGroupComponentDict::const_iterator it = _nbddcGroups.find(index);
2217  if ( it != _nbddcGroups.end() )
2218  ret = it->second->isEnabled();
2219  return ret;
2220  }
2221 
2222  bool RadioHandler::enableNbddcGroup(int index, bool enabled)
2223  {
2224  bool ret = false;
2225  NbddcGroupComponentDict::const_iterator it = _nbddcGroups.find(index);
2226  if ( it != _nbddcGroups.end() )
2227  ret = it->second->enable(enabled);
2228  return ret;
2229  }
2230 
2232  {
2233  return enableNbddcGroup(index, false);
2234  }
2235 
2237  {
2238  ConfigurationDict ret;
2239  NbddcGroupComponentDict::const_iterator it = _nbddcGroups.find(index);
2240  if ( it != _nbddcGroups.end() )
2241  ret = it->second->getConfiguration();
2242  return ret;
2243  }
2244 
2246  {
2247  bool ret = false;
2248  NbddcGroupComponentDict::const_iterator it = _nbddcGroups.find(index);
2249  if ( it != _nbddcGroups.end() )
2250  ret = it->second->setConfiguration(cfg);
2251  return ret;
2252  }
2253 
2255  {
2256  BasicIntList ret;
2257  NbddcGroupComponentDict::const_iterator it = _nbddcGroups.find(index);
2258  if ( it != _nbddcGroups.end() )
2259  ret = it->second->getMembers();
2260  return ret;
2261  }
2262 
2263  bool RadioHandler::setNbddcGroupMembers(int index, const BasicIntList& groupMembers)
2264  {
2265  bool ret = false;
2266  NbddcGroupComponentDict::const_iterator it = _nbddcGroups.find(index);
2267  if ( it != _nbddcGroups.end() )
2268  ret = it->second->setMembers(groupMembers);
2269  return ret;
2270  }
2271 
2272  bool RadioHandler::addNbddcGroupMember(int index, int member)
2273  {
2274  bool ret = false;
2275  NbddcGroupComponentDict::const_iterator it = _nbddcGroups.find(index);
2276  if ( it != _nbddcGroups.end() )
2277  ret = it->second->addMember(member);
2278  return ret;
2279  }
2280 
2281  bool RadioHandler::removeNbddcGroupMember(int index, int member)
2282  {
2283  bool ret = false;
2284  NbddcGroupComponentDict::const_iterator it = _nbddcGroups.find(index);
2285  if ( it != _nbddcGroups.end() )
2286  ret = it->second->removeMember(member);
2287  return ret;
2288  }
2289 
2291  {
2292  return setTenGigFlowControlStatus(true);
2293  }
2294 
2296  {
2297  return setTenGigFlowControlStatus(false);
2298  }
2299 
2301  {
2302  bool ret = true;
2303  for ( DataPortDict::const_iterator it = _dataPorts.begin();
2304  it != _dataPorts.end(); it++)
2305  {
2306  ret &= it->second->enableFlowControl(enable);
2307  }
2308  return ret;
2309  }
2310 
2312  {
2313  BasicIntBoolDict ret;
2314  bool enabled;
2315  for ( DataPortDict::iterator it = _dataPorts.begin();
2316  it != _dataPorts.end(); it++)
2317  {
2318  ret[it->first] = it->second->getConfigurationValueAsBool("flowControl");
2319  }
2320  return ret;
2321  }
2322 
2324  {
2325  ConfigurationDict ret;
2326  DataPortDict::const_iterator it = _dataPorts.find(index);
2327  if ( it != _dataPorts.end() )
2328  ret = it->second->getConfiguration();
2329  return ret;
2330  }
2331 
2333  {
2334  bool ret = false;
2335  DataPortDict::const_iterator it = _dataPorts.find(index);
2336  if ( it != _dataPorts.end() )
2337  ret = it->second->setConfiguration(cfg);
2338  return ret;
2339  }
2340 
2341  std::string RadioHandler::getDataPortSourceIP(int index) const
2342  {
2343  std::string ret = "";
2344  DataPortDict::const_iterator it = _dataPorts.find(index);
2345  if ( it != _dataPorts.end() )
2346  ret = it->second->getSourceIP();
2347  return ret;
2348  }
2349 
2350  bool RadioHandler::setDataPortSourceIP(int index, const std::string& ipAddr)
2351  {
2352  bool ret = false;
2353  DataPortDict::const_iterator it = _dataPorts.find(index);
2354  if ( it != _dataPorts.end() )
2355  ret = it->second->setSourceIP(ipAddr);
2356  return ret;
2357  }
2358 
2359  bool RadioHandler::enableDataPortErrors(int index, bool enabled)
2360  {
2361  bool ret = false;
2362  DataPortDict::const_iterator it = _dataPorts.find(index);
2363  if ( it != _dataPorts.end() )
2364  ret = it->second->enableErrors(enabled);
2365  return ret;
2366  }
2367 
2369  {
2370  return enableDataPortErrors(index, false);
2371  }
2372 
2373  bool RadioHandler::enableDataPortFlowControl(int index, bool enabled)
2374  {
2375  bool ret = false;
2376  DataPortDict::const_iterator it = _dataPorts.find(index);
2377  if ( it != _dataPorts.end() )
2378  ret = it->second->enableFlowControl(enabled);
2379  return ret;
2380  }
2381 
2383  {
2384  return enableDataPortFlowControl(index, false);
2385  }
2386 
2387  std::string RadioHandler::getDataPortDestMACAddress(int index, int dipIndex) const
2388  {
2389  std::string ret = "";
2390  DataPortDict::const_iterator it = _dataPorts.find(index);
2391  if ( it != _dataPorts.end() )
2392  ret = it->second->getDestMACAddress(dipIndex);
2393  return ret;
2394  }
2395 
2396  bool RadioHandler::setDataPortDestMACAddress(int index, int dipIndex,
2397  const std::string& macAddr)
2398  {
2399  bool ret = false;
2400  DataPortDict::const_iterator it = _dataPorts.find(index);
2401  if ( it != _dataPorts.end() )
2402  ret = it->second->setDestMACAddress(dipIndex, macAddr);
2403  return ret;
2404  }
2405 
2406  std::string RadioHandler::getDataPortDestIPAddress(int index, int dipIndex) const
2407  {
2408  std::string ret = "";
2409  DataPortDict::const_iterator it = _dataPorts.find(index);
2410  if ( it != _dataPorts.end() )
2411  ret = it->second->getDestIPAddress(dipIndex);
2412  return ret;
2413  }
2414 
2415  bool RadioHandler::setDataPortDestIPAddress(int index, int dipIndex,
2416  const std::string& ipAddr)
2417  {
2418  bool ret = false;
2419  DataPortDict::const_iterator it = _dataPorts.find(index);
2420  if ( it != _dataPorts.end() )
2421  ret = it->second->setDestIPAddress(dipIndex, ipAddr);
2422  return ret;
2423  }
2424 
2425  unsigned int RadioHandler::getDataPortDestSourcePort(int index, int dipIndex) const
2426  {
2427  unsigned int ret = 0;
2428  DataPortDict::const_iterator it = _dataPorts.find(index);
2429  if ( it != _dataPorts.end() )
2430  ret = it->second->getDestSourcePort(dipIndex);
2431  return ret;
2432  }
2433 
2434  bool RadioHandler::setDataPortDestSourcePort(int index, int dipIndex,
2435  unsigned int sourcePort)
2436  {
2437  bool ret = false;
2438  DataPortDict::const_iterator it = _dataPorts.find(index);
2439  if ( it != _dataPorts.end() )
2440  ret = it->second->setDestSourcePort(dipIndex, sourcePort);
2441  return ret;
2442  }
2443 
2444  unsigned int RadioHandler::getDataPortDestDestPort(int index, int dipIndex) const
2445  {
2446  unsigned int ret = 0;
2447  DataPortDict::const_iterator it = _dataPorts.find(index);
2448  if ( it != _dataPorts.end() )
2449  ret = it->second->getDestDestPort(dipIndex);
2450  return ret;
2451  }
2452 
2453  bool RadioHandler::setDataPortDestDestPort(int index, int dipIndex,
2454  unsigned int destPort)
2455  {
2456  bool ret = false;
2457  DataPortDict::const_iterator it = _dataPorts.find(index);
2458  if ( it != _dataPorts.end() )
2459  ret = it->second->setDestDestPort(dipIndex, destPort);
2460  return ret;
2461  }
2462 
2464  int dipIndex,
2465  const std::string& ipAddr,
2466  const std::string& macAddr,
2467  unsigned int sourcePort,
2468  unsigned int destPort)
2469  {
2470  bool ret = false;
2471  DataPortDict::const_iterator it = _dataPorts.find(index);
2472  if ( it != _dataPorts.end() )
2473  ret = it->second->setDestInfo(dipIndex, ipAddr, macAddr, sourcePort,
2474  destPort);
2475  return ret;
2476  }
2477 
2479  {
2480  ConfigurationDict ret;
2481  if ( _numSimpleIpSetups > 0 )
2482  {
2483  ret = _simpleIpSetups.at(0)->getConfiguration();
2484  }
2485  return ret;
2486  }
2487 
2489  {
2490  bool ret = false;
2491  if ( _numSimpleIpSetups > 0 )
2492  {
2493  ret = _simpleIpSetups.at(0)->setConfiguration(cfg);
2494  }
2495  return ret;
2496  }
2497 
2499  {
2500  std::string ret = "";
2501  return ret;
2502  }
2503 
2505  {
2506  std::string ret = "";
2507  return ret;
2508  }
2509 
2510  bool RadioHandler::setSimpleSourceIPAddress(const std::string& ipAddr)
2511  {
2512  bool ret = true;
2513  return ret;
2514  }
2515 
2517  {
2518  std::string ret = "";
2519  return ret;
2520  }
2521 
2522  bool RadioHandler::setSimpleDestMACAddress(const std::string& macAddr)
2523  {
2524  bool ret = true;
2525  return ret;
2526  }
2527 
2529  {
2530  std::string ret = "";
2531  return ret;
2532  }
2533 
2534  bool RadioHandler::setSimpleDestIPAddress(const std::string& ipAddr)
2535  {
2536  bool ret = true;
2537  return ret;
2538  }
2539 
2541  {
2542  return _defaultDeviceInfo;
2543  }
2544 
2545  // Default implementation is the NDR308 pattern
2547  {
2548  //this->debug("[RadioHandler::initConfigurationDict] Called\n");
2549  _config.clear();
2550  _config["calibFrequency"] = _calibFrequency;
2551  _config["coherentMode"] = _coherentMode;
2552  _config["configMode"] = _configMode;
2553  _config["referenceMode"] = _referenceMode;
2554  _config["bypassMode"] = _referenceBypass;
2555  _config["freqNormalization"] = _freqNormalization;
2556  _config["gpsEnable"] = _gpsEnabled;
2557  _config["referenceTuningVoltage"] = _referenceTuningVoltage;
2558  //this->debug("[RadioHandler::initConfigurationDict] Returning\n");
2559  }
2560 
2562  {
2563  //this->debug("[RadioHandler::updateConfigurationDict] Called\n");
2564  if ( _config.hasKey("configMode") )
2565  {
2566  _config["configMode"] = _configMode;
2567  }
2568  if ( _config.hasKey("coherentMode") )
2569  {
2570  _config["coherentMode"] = _coherentMode;
2571  }
2572  if ( _config.hasKey("freqNormalization") )
2573  {
2574  _config["freqNormalization"] = _freqNormalization;
2575  }
2576  if ( _config.hasKey("gpsEnable") )
2577  {
2578  _config["gpsEnable"] = _gpsEnabled;
2579  }
2580  if ( _config.hasKey("referenceMode") )
2581  {
2582  _config["referenceMode"] = _referenceMode;
2583  }
2584  if ( _config.hasKey("bypassMode") )
2585  {
2586  _config["bypassMode"] = _referenceBypass;
2587  }
2588  if ( _config.hasKey("referenceTuningVoltage") )
2589  {
2590  _config["referenceTuningVoltage"] = _referenceTuningVoltage;
2591  }
2592  if ( _config.hasKey("calibFrequency") )
2593  {
2594  _config["calibFrequency"] = _calibFrequency;
2595  }
2596  //this->debug("[RadioHandler::updateConfigurationDict] Returning\n");
2597  }
2598 
2599  bool RadioHandler::queryVersionInfo()
2600  {
2601  this->debug("[RadioHandler::queryVersionInfo] Called\n");
2602  bool ret = executeQueryIDN(_versionInfo["model"], _versionInfo["serialNumber"]);
2603  if (ret)
2604  {
2605  ret = executeQueryVER(_versionInfo["softwareVersion"],
2606  _versionInfo["firmwareVersion"],
2607  _versionInfo["referenceVersion"],
2608  _versionInfo["firmwareDate"] );
2609  if ( ret )
2610  {
2611  ret = executeQueryHREV(_versionInfo["hardwareVersion"]);
2612  }
2613  }
2614  this->debug("[RadioHandler::queryVersionInfo] Returning %s\n", debugBool(ret));
2615  if (ret)
2616  {
2617  for (BasicStringStringDict::iterator it = _versionInfo.begin(); it != _versionInfo.end(); it++)
2618  {
2619  this->debug("[RadioHandler::queryVersionInfo] %s = \"%s\"\n", it->first.c_str(), it->second.c_str());
2620  }
2621  }
2622  return ret;
2623  }
2624 
2625  bool RadioHandler::queryRadioConfiguration()
2626  {
2627  bool ret = true;
2628  if ( _config.hasKey("configMode") )
2629  {
2630  ret &= this->executeConfigModeQuery(_configMode);
2631  }
2632  if ( _config.hasKey("coherentMode") )
2633  {
2634  ret &= this->executeCoherentModeQuery(_coherentMode);
2635  }
2636  if ( _config.hasKey("freqNormalization") )
2637  {
2638  ret &= this->executeFreqNormalizationQuery(_freqNormalization);
2639  }
2640  if ( _config.hasKey("gpsEnable") )
2641  {
2642  ret &= this->executeGpsEnabledQuery(_gpsEnabled);
2643  }
2644  if ( _config.hasKey("referenceMode") )
2645  {
2646  ret &= this->executeReferenceModeQuery(_referenceMode);
2647  }
2648  if ( _config.hasKey("bypassMode") )
2649  {
2650  ret &= this->executeReferenceBypassQuery(_referenceBypass);
2651  }
2652  if ( _config.hasKey("referenceTuningVoltage") )
2653  {
2654  ret &= this->executeReferenceVoltageQuery(_referenceTuningVoltage);
2655  }
2656  if ( _config.hasKey("calibFrequency") )
2657  {
2658  ret &= this->executeCalibFrequencyQuery(_calibFrequency);
2659  }
2660  return ret;
2661  }
2662 
2663  // NOTE: Default implementation is based on the NDR308 response
2664  // NDR308 Receiver
2665  // S/N 2038
2666  // OK
2667  bool RadioHandler::executeQueryIDN(std::string& model,
2668  std::string& serialNumber)
2669  {
2670  bool ret = false;
2671  // Issue the identity query to get model and serial number
2672  BasicStringList rsp = sendCommand("*IDN?\n", _defaultTimeout);
2673  if ( getLastCommandErrorInfo() == "" )
2674  {
2675  BasicStringList::iterator it;
2676  for (it = rsp.begin(); it != rsp.end(); it++)
2677  {
2678  if ( it->find(" Receiver") != std::string::npos )
2679  model = Pythonesque::Replace(*it, " Receiver", "");
2680  else if ( it->find("NDR") != std::string::npos )
2681  model = *it;
2682  if ( it->find("S/N ") != std::string::npos )
2683  serialNumber = Pythonesque::Replace(*it, "S/N ", "");
2684  }
2685  ret = true;
2686  }
2687  return ret;
2688  }
2689 
2690  // NOTE: Default implementation is based on the NDR308 response
2691  // NDR308 Application code:
2692  // REV: 16.02.16
2693  // Date: Feb 16 2016 13:59:48
2694  // FPGA Rev: 20150923
2695  // NDR308 Digital Reference Code Version: 16.01.21
2696  // OK
2697  bool RadioHandler::executeQueryVER(std::string& softwareVersion,
2698  std::string& firmwareVersion,
2699  std::string& referenceVersion,
2700  std::string& firmwareDate)
2701  {
2702  bool ret = true;
2703  // Query the version command to get software versioning info
2704  BasicStringList rsp = sendCommand("VER?\n", _defaultTimeout);
2705  if ( getLastCommandErrorInfo() == "" )
2706  {
2707  BasicStringList::iterator it;
2708  for (it = rsp.begin(); it != rsp.end(); it++)
2709  {
2710  if ( it->find(" REV: ") != std::string::npos )
2711  softwareVersion = Pythonesque::Replace(*it, " REV: ", "");
2712  if ( it->find(" Date: ") != std::string::npos )
2713  firmwareDate = Pythonesque::Replace(*it, " Date: ", "");
2714  if ( it->find("FPGA Rev: ") != std::string::npos )
2715  firmwareVersion = Pythonesque::Replace(*it, "FPGA Rev: ", "");
2716  std::string::size_type pos = it->find("Digital Reference Code Version: ");
2717  if ( pos != std::string::npos )
2718  referenceVersion = it->substr(pos+32, std::string::npos);
2719  }
2720  ret = true;
2721  }
2722  return ret;
2723  }
2724 
2725  // NOTE: Default implementation is based on the NDR308 response
2726  // Unit
2727  // Model: NDR308 Receiver
2728  // Serial: 2038
2729  // Revision: 04.00
2730  // Digital Board_tuners
2731  // Model: 602851
2732  // Serial: 51150004
2733  // Revision: 05.00
2734  // Tuner Quad 1:
2735  // Board Model : 603056
2736  // Board Revision: 04.00
2737  // Serial Number : IE7210015
2738  // Bandwidth: 6000
2739  // Tuner Quad 2:Not Installed
2740  bool RadioHandler::executeQueryHREV(std::string& hardwareInfo)
2741  {
2742  bool ret = true;
2743  // Query the hardware revision command to get other stuff
2744  BasicStringList rsp = sendCommand("HREV?\n", _defaultTimeout);
2745  if ( getLastCommandErrorInfo() == "" )
2746  {
2747  std::ostringstream oss;
2748  BasicStringList::iterator it;
2749  for (it = rsp.begin(); it != rsp.end(); it++)
2750  {
2751  if ( *it != "OK" )
2752  {
2753  if ( oss.str() != "" )
2754  oss << "\n";
2755  //oss << Pythonesque::Strip(*it);
2756  oss << *it;
2757  }
2758  }
2759  hardwareInfo = oss.str();
2760  ret = true;
2761  }
2762  return ret;
2763  }
2764 
2765  // NOTE: Default implementation is based on the NDR308 response
2766  // (a radio that doesn't actually support this command)
2767  bool RadioHandler::executeResetCommand(int resetType)
2768  {
2769  bool ret = false;
2770  return ret;
2771  }
2772 
2773  // NOTE: Default implementation is based on the NDR308 response
2774  bool RadioHandler::executePpsQuery()
2775  {
2776  bool ret = false;
2777  // Query the PPS
2778  BasicStringList rsp = sendCommand("PPS?\n", _defaultTimeout);
2779  if ( getLastCommandErrorInfo() == "" )
2780  {
2781  ret = true;
2782  }
2783  return ret;
2784  }
2785 
2786  // NOTE: Default implementation is based on the NDR308 response
2787  bool RadioHandler::executeTimeQuery(std::string& timeStr)
2788  {
2789  bool ret = false;
2790  // Query the time
2791  BasicStringList rsp = sendCommand("UTC?\n", _defaultTimeout);
2792  if ( getLastCommandErrorInfo() == "" )
2793  {
2794  BasicStringList::iterator it;
2795  for (it = rsp.begin(); it != rsp.end(); it++)
2796  {
2797  if ( it->find("UTC ") != std::string::npos )
2798  timeStr = Pythonesque::Replace(*it, "UTC ", "");
2799  }
2800  ret = true;
2801  }
2802  return ret;
2803  }
2804 
2805  // NOTE: Default implementation is based on the NDR308 response
2806  bool RadioHandler::executeTimeCommand(std::string& timeStr)
2807  {
2808  bool ret = false;
2809  // Query the time
2810  BasicStringList rsp = sendCommand("UTC?\n", _defaultTimeout);
2811  if ( getLastCommandErrorInfo() == "" )
2812  {
2813  BasicStringList::iterator it;
2814  for (it = rsp.begin(); it != rsp.end(); it++)
2815  {
2816  if ( it->find("UTC ") != std::string::npos )
2817  timeStr = Pythonesque::Replace(*it, "UTC ", "");
2818  }
2819  ret = true;
2820  }
2821  return ret;
2822  }
2823 
2824  // NOTE: Default implementation is based on the NDR308 response
2825  bool RadioHandler::executeGpsTimeQuery(std::string& timeStr)
2826  {
2827  bool ret = false;
2828  // Query the time
2829  BasicStringList rsp = sendCommand("GUTC?\n", _defaultTimeout);
2830  if ( getLastCommandErrorInfo() == "" )
2831  {
2832  BasicStringList::iterator it;
2833  for (it = rsp.begin(); it != rsp.end(); it++)
2834  {
2835  if ( it->find("GUTC ") != std::string::npos )
2836  timeStr = Pythonesque::Replace(*it, "GUTC ", "");
2837  }
2838  ret = true;
2839  }
2840  return ret;
2841  }
2842 
2843  bool RadioHandler::executeConfigModeQuery(int& configMode)
2844  {
2845  this->debug("[RadioHandler::executeConfigModeQuery] Called\n");
2846  bool ret = false;
2847  if ( this->isConnected() )
2848  {
2849  std::ostringstream oss;
2850  oss << "CFG?" << "\n";
2851  BasicStringList rsp = this->sendCommand(oss.str(), 2.0);
2852  if ( this->getLastCommandErrorInfo() == "" )
2853  {
2855  Pythonesque::Replace(rsp.front(), "CFG ", ""),
2856  ", ");
2857  // vec[0] = Config mode indicator
2858  configMode = boost::lexical_cast<int>(vec[0]);
2859  ret = true;
2860  }
2861  }
2862  this->debug("[RadioHandler::executeConfigModeQuery] Returning %s\n",
2863  this->debugBool(ret));
2864  return ret;
2865  }
2866 
2867  bool RadioHandler::executeConfigModeCommand(int& configMode)
2868  {
2869  this->debug("[RadioHandler::executeConfigModeCommand] Called\n");
2870  bool ret = false;
2871  if ( this->isConnected() )
2872  {
2873  std::ostringstream oss;
2874  oss << "CFG " << configMode << "\n";
2875  BasicStringList rsp = this->sendCommand(oss.str(), 2.0);
2876  if ( this->getLastCommandErrorInfo() == "" )
2877  {
2878  ret = true;
2879  }
2880  }
2881  this->debug("[RadioHandler::executeConfigModeCommand] Returning %s\n",
2882  this->debugBool(ret));
2883  return ret;
2884  }
2885 
2886  bool RadioHandler::executeCoherentModeQuery(int& coherentMode)
2887  {
2888  this->debug("[RadioHandler::executeCoherentModeQuery] Called\n");
2889  bool ret = false;
2890  if ( this->isConnected() )
2891  {
2892  std::ostringstream oss;
2893  oss << "COH?" << "\n";
2894  BasicStringList rsp = this->sendCommand(oss.str(), 2.0);
2895  if ( this->getLastCommandErrorInfo() == "" )
2896  {
2898  Pythonesque::Replace(rsp.front(), "COH ", ""),
2899  ", ");
2900  // vec[0] = Coherent mode indicator
2901  // NOTE: This is a hex string, prefixed by "0x". Lexical_cast does
2902  // not work.
2903  std::istringstream iss(vec[0]);
2904  iss >> std::hex >> coherentMode;
2905  ret = true;
2906  }
2907  }
2908  this->debug("[RadioHandler::executeCoherentModeQuery] Returning %s\n",
2909  this->debugBool(ret));
2910  return ret;
2911  }
2912 
2913  bool RadioHandler::executeCoherentModeCommand(int& coherentMode)
2914  {
2915  this->debug("[RadioHandler::executeCoherentModeCommand] Called\n");
2916  bool ret = false;
2917  if ( this->isConnected() )
2918  {
2919  std::ostringstream oss;
2920  oss << "COH " << coherentMode << "\n";
2921  BasicStringList rsp = this->sendCommand(oss.str(), 2.0);
2922  if ( this->getLastCommandErrorInfo() == "" )
2923  {
2924  ret = true;
2925  }
2926  }
2927  this->debug("[RadioHandler::executeCoherentModeCommand] Returning %s\n",
2928  this->debugBool(ret));
2929  return ret;
2930  }
2931 
2932  bool RadioHandler::executeFreqNormalizationQuery(int& fnrMode)
2933  {
2934  this->debug("[RadioHandler::executeFreqNormalizationQuery] Called\n");
2935  bool ret = false;
2936  if ( this->isConnected() )
2937  {
2938  std::ostringstream oss;
2939  oss << "FNR?" << "\n";
2940  BasicStringList rsp = this->sendCommand(oss.str(), 2.0);
2941  if ( this->getLastCommandErrorInfo() == "" )
2942  {
2944  Pythonesque::Replace(rsp.front(), "FNR ", ""),
2945  ", ");
2946  // vec[0] = FNR mode indicator
2947  fnrMode = boost::lexical_cast<int>(vec[0]);
2948  ret = true;
2949  }
2950  }
2951  this->debug("[RadioHandler::executeFreqNormalizationQuery] Returning %s\n",
2952  this->debugBool(ret));
2953  return ret;
2954  }
2955 
2956  bool RadioHandler::executeFreqNormalizationCommand(int& fnrMode)
2957  {
2958  this->debug("[RadioHandler::executeFreqNormalizationCommand] Called\n");
2959  bool ret = false;
2960  if ( this->isConnected() )
2961  {
2962  std::ostringstream oss;
2963  oss << "FNR " << fnrMode << "\n";
2964  BasicStringList rsp = this->sendCommand(oss.str(), 2.0);
2965  if ( this->getLastCommandErrorInfo() == "" )
2966  {
2967  ret = true;
2968  }
2969  }
2970  this->debug("[RadioHandler::executeFreqNormalizationCommand] Returning %s\n",
2971  this->debugBool(ret));
2972  return ret;
2973  }
2974 
2975  bool RadioHandler::executeGpsEnabledQuery(int& enabled)
2976  {
2977  this->debug("[RadioHandler::executeGpsEnabledQuery] Called\n");
2978  bool ret = false;
2979  if ( this->isConnected() )
2980  {
2981  std::ostringstream oss;
2982  oss << "GPS?" << "\n";
2983  BasicStringList rsp = this->sendCommand(oss.str(), 2.0);
2984  if ( this->getLastCommandErrorInfo() == "" )
2985  {
2987  Pythonesque::Replace(rsp.front(), "GPS ", ""),
2988  ", ");
2989  // vec[0] = GPS mode indicator
2990  enabled = boost::lexical_cast<int>(vec[0]);
2991  ret = true;
2992  }
2993  }
2994  this->debug("[RadioHandler::executeGpsEnabledQuery] Returning %s\n",
2995  this->debugBool(ret));
2996  return ret;
2997  }
2998 
2999  bool RadioHandler::executeGpsPositionQuery(double& lat, double& lon)
3000  {
3001  this->debug("[RadioHandler::executeGpsPositionQuery] Called\n");
3002  bool ret = false;
3003  if ( this->isConnected() )
3004  {
3005  std::ostringstream oss;
3006  oss << "GPOS?" << "\n";
3007  BasicStringList rsp = this->sendCommand(oss.str(), 2.0);
3008  if ( this->getLastCommandErrorInfo() == "" )
3009  {
3011  Pythonesque::Replace(rsp.front(), "GPOS ", ""),
3012  ", ");
3013  // vec[0] = GPS position string (comma-separated NMEA)
3014  BasicStringList coords = Pythonesque::Split(vec[0], ",");
3015  lat = this->getDecimalDegreesFromNmea(coords[0]);
3016  lon = this->getDecimalDegreesFromNmea(coords[1]);
3017  ret = true;
3018  }
3019  }
3020  this->debug("[RadioHandler::executeGpsPositionQuery] Returning %s\n",
3021  this->debugBool(ret));
3022  return ret;
3023  }
3024 
3025  bool RadioHandler::executeGpsEnabledCommand(int& enabled)
3026  {
3027  this->debug("[RadioHandler::executeGpsEnabledCommand] Called\n");
3028  bool ret = false;
3029  if ( this->isConnected() )
3030  {
3031  std::ostringstream oss;
3032  oss << "GPS " << enabled << "\n";
3033  BasicStringList rsp = this->sendCommand(oss.str(), 2.0);
3034  if ( this->getLastCommandErrorInfo() == "" )
3035  {
3036  ret = true;
3037  }
3038  }
3039  this->debug("[RadioHandler::executeGpsEnabledCommand] Returning %s\n",
3040  this->debugBool(ret));
3041  return ret;
3042  }
3043 
3044  bool RadioHandler::executeReferenceModeQuery(int& refMode)
3045  {
3046  this->debug("[RadioHandler::executeReferenceModeQuery] Called\n");
3047  bool ret = false;
3048  if ( this->isConnected() )
3049  {
3050  std::ostringstream oss;
3051  oss << "REF?" << "\n";
3052  BasicStringList rsp = this->sendCommand(oss.str(), 2.0);
3053  if ( this->getLastCommandErrorInfo() == "" )
3054  {
3056  Pythonesque::Replace(rsp.front(), "REF ", ""),
3057  ", ");
3058  // vec[0] = Ref mode indicator
3059  refMode = boost::lexical_cast<int>(vec[0]);
3060  ret = true;
3061  }
3062  }
3063  this->debug("[RadioHandler::executeReferenceModeQuery] Returning %s\n",
3064  this->debugBool(ret));
3065  return ret;
3066  }
3067 
3068  bool RadioHandler::executeReferenceModeCommand(int& refMode)
3069  {
3070  this->debug("[RadioHandler::executeReferenceModeCommand] Called\n");
3071  bool ret = false;
3072  if ( this->isConnected() )
3073  {
3074  std::ostringstream oss;
3075  oss << "REF " << refMode << "\n";
3076  BasicStringList rsp = this->sendCommand(oss.str(), 2.0);
3077  if ( this->getLastCommandErrorInfo() == "" )
3078  {
3079  ret = true;
3080  }
3081  }
3082  this->debug("[RadioHandler::executeReferenceModeCommand] Returning %s\n",
3083  this->debugBool(ret));
3084  return ret;
3085  }
3086 
3087  bool RadioHandler::executeReferenceBypassQuery(int& bypassMode)
3088  {
3089  this->debug("[RadioHandler::executeReferenceBypassQuery] Called\n");
3090  bool ret = false;
3091  if ( this->isConnected() )
3092  {
3093  std::ostringstream oss;
3094  oss << "RBYP?" << "\n";
3095  BasicStringList rsp = this->sendCommand(oss.str(), 2.0);
3096  if ( this->getLastCommandErrorInfo() == "" )
3097  {
3099  Pythonesque::Replace(rsp.front(), "RBYP ", ""),
3100  ", ");
3101  // vec[0] = Ref bypass mode indicator
3102  bypassMode = boost::lexical_cast<int>(vec[0]);
3103  ret = true;
3104  }
3105  }
3106  this->debug("[RadioHandler::executeReferenceBypassQuery] Returning %s\n",
3107  this->debugBool(ret));
3108  return ret;
3109  }
3110 
3111  bool RadioHandler::executeReferenceBypassCommand(int& bypassMode)
3112  {
3113  this->debug("[RadioHandler::executeReferenceBypassCommand] Called\n");
3114  bool ret = false;
3115  if ( this->isConnected() )
3116  {
3117  std::ostringstream oss;
3118  oss << "RBYP " << bypassMode << "\n";
3119  BasicStringList rsp = this->sendCommand(oss.str(), 2.0);
3120  if ( this->getLastCommandErrorInfo() == "" )
3121  {
3122  ret = true;
3123  }
3124  }
3125  this->debug("[RadioHandler::executeReferenceBypassCommand] Returning %s\n",
3126  this->debugBool(ret));
3127  return ret;
3128  }
3129 
3130  bool RadioHandler::executeReferenceVoltageQuery(int& voltage)
3131  {
3132  this->debug("[RadioHandler::executeReferenceVoltageQuery] Called\n");
3133  bool ret = false;
3134  if ( this->isConnected() )
3135  {
3136  std::ostringstream oss;
3137  oss << "RTV?" << "\n";
3138  BasicStringList rsp = this->sendCommand(oss.str(), 2.0);
3139  if ( this->getLastCommandErrorInfo() == "" )
3140  {
3142  Pythonesque::Replace(rsp.front(), "RTV ", ""),
3143  ", ");
3144  // vec[0] = Ref tuning voltage indicator
3145  voltage = boost::lexical_cast<int>(vec[0]);
3146  ret = true;
3147  }
3148  }
3149  this->debug("[RadioHandler::executeReferenceVoltageQuery] Returning %s\n",
3150  this->debugBool(ret));
3151  return ret;
3152  }
3153 
3154  bool RadioHandler::executeReferenceVoltageCommand(int& voltage)
3155  {
3156  this->debug("[RadioHandler::executeReferenceVoltageCommand] Called\n");
3157  bool ret = false;
3158  if ( this->isConnected() )
3159  {
3160  std::ostringstream oss;
3161  oss << "RTV " << voltage << "\n";
3162  BasicStringList rsp = this->sendCommand(oss.str(), 2.0);
3163  if ( this->getLastCommandErrorInfo() == "" )
3164  {
3165  ret = true;
3166  }
3167  }
3168  this->debug("[RadioHandler::executeReferenceVoltageCommand] Returning %s\n",
3169  this->debugBool(ret));
3170  return ret;
3171  }
3172 
3173  bool RadioHandler::executeStatusQuery(unsigned int& stat)
3174  {
3175  this->debug("[RadioHandler::executeStatusQuery] Called\n");
3176  bool ret = false;
3177  if ( this->isConnected() )
3178  {
3179  std::ostringstream oss;
3180  oss << "STAT?" << "\n";
3181  BasicStringList rsp = this->sendCommand(oss.str(), 2.0);
3182  if ( this->getLastCommandErrorInfo() == "" )
3183  {
3185  Pythonesque::Replace(rsp.front(), "STAT ", ""),
3186  ", ");
3187  // vec[0] = Status
3188  // NOTE: This is a hex string, so lexical_cast will not work
3189  std::istringstream iss(vec[0]);
3190  iss >> std::hex >> stat;
3191  ret = true;
3192  }
3193  }
3194  this->debug("[RadioHandler::executeStatusQuery] Returning %s\n",
3195  this->debugBool(ret));
3196  return ret;
3197  }
3198 
3199  bool RadioHandler::executeTstatusQuery(unsigned int& stat)
3200  {
3201  this->debug("[RadioHandler::executeTstatusQuery] Called\n");
3202  bool ret = false;
3203  if ( this->isConnected() )
3204  {
3205  std::ostringstream oss;
3206  oss << "TSTAT?" << "\n";
3207  BasicStringList rsp = this->sendCommand(oss.str(), 2.0);
3208  if ( this->getLastCommandErrorInfo() == "" )
3209  {
3211  Pythonesque::Replace(rsp.front(), "TSTAT ", ""),
3212  ", ");
3213  // vec[0] = Status
3214  // NOTE: This is a hex string, so lexical_cast will not work
3215  std::istringstream iss(vec[0]);
3216  iss >> std::hex >> stat;
3217  ret = true;
3218  }
3219  }
3220  this->debug("[RadioHandler::executeTstatusQuery] Returning %s\n",
3221  this->debugBool(ret));
3222  return ret;
3223  }
3224 
3225  bool RadioHandler::executeTemperatureQuery(int& temp)
3226  {
3227  this->debug("[RadioHandler::executeTemperatureQuery] Called\n");
3228  bool ret = false;
3229  if ( this->isConnected() )
3230  {
3231  std::ostringstream oss;
3232  oss << "TEMP?" << "\n";
3233  BasicStringList rsp = this->sendCommand(oss.str(), 2.0);
3234  if ( this->getLastCommandErrorInfo() == "" )
3235  {
3237  Pythonesque::Replace(rsp.front(), "TEMP ", ""),
3238  ", ");
3239  // vec[0] = Temperature
3240  temp = boost::lexical_cast<int>(vec[0]);
3241  ret = true;
3242  }
3243  }
3244  this->debug("[RadioHandler::executeTemperatureQuery] Returning %s\n",
3245  this->debugBool(ret));
3246  return ret;
3247  }
3248 
3249  bool RadioHandler::executeGpioStaticQuery(int& value)
3250  {
3251  this->debug("[RadioHandler::executeGpioStaticQuery] Called\n");
3252  bool ret = false;
3253  if ( this->isConnected() )
3254  {
3255  std::ostringstream oss;
3256  oss << "GPIO?" << "\n";
3257  BasicStringList rsp = this->sendCommand(oss.str(), 2.0);
3258  if ( this->getLastCommandErrorInfo() == "" )
3259  {
3261  Pythonesque::Replace(rsp.front(), "GPIO ", ""),
3262  ", ");
3263  // vec[0] = GPIO value
3264  // NOTE: This is a hex string, so lexical_cast will not work
3265  std::istringstream iss(vec[0]);
3266  iss >> std::hex >> value;
3267  ret = true;
3268  }
3269  }
3270  this->debug("[RadioHandler::executeGpioStaticQuery] Returning %s\n",
3271  this->debugBool(ret));
3272  return ret;
3273  }
3274 
3275  bool RadioHandler::executeGpioSequenceQuery(int index, int& value,
3276  int &duration, int& loop)
3277  {
3278  this->debug("[RadioHandler::executeGpioSequenceQuery] Called\n");
3279  bool ret = false;
3280  if ( this->isConnected() )
3281  {
3282  std::ostringstream oss;
3283  oss << "GPIO? " << index << "\n";
3284  BasicStringList rsp = this->sendCommand(oss.str(), 2.0);
3285  if ( this->getLastCommandErrorInfo() == "" )
3286  {
3288  Pythonesque::Replace(rsp.front(), "GPIO ", ""),
3289  ", ");
3290  // vec[0] = Index
3291  // vec[1] = Value
3292  // NOTE: This is a hex string, so lexical_cast will not work
3293  std::istringstream iss(vec[1]);
3294  iss >> std::hex >> value;
3295  // vec[2] = Duration
3296  duration = boost::lexical_cast<int>(vec[2]);
3297  // vec[3] = Loop
3298  loop = boost::lexical_cast<int>(vec[3]);
3299  ret = true;
3300  }
3301  }
3302  this->debug("[RadioHandler::executeGpioSequenceQuery] Returning %s\n",
3303  this->debugBool(ret));
3304  return ret;
3305  }
3306 
3307  bool RadioHandler::executeGpioStaticCommand(int& value)
3308  {
3309  this->debug("[RadioHandler::executeGpioStaticCommand] Called\n");
3310  bool ret = false;
3311  if ( this->isConnected() )
3312  {
3313  std::ostringstream oss;
3314  oss << "GPIO " << value << "\n";
3315  BasicStringList rsp = this->sendCommand(oss.str(), 2.0);
3316  if ( this->getLastCommandErrorInfo() == "" )
3317  {
3318  ret = true;
3319  }
3320  }
3321  this->debug("[RadioHandler::executeGpioStaticCommand] Returning %s\n",
3322  this->debugBool(ret));
3323  return ret;
3324  }
3325 
3326  bool RadioHandler::executeGpioSequenceCommand(int index, int& value,
3327  int &duration, int& loop,
3328  int &go)
3329  {
3330  this->debug("[RadioHandler::executeGpioSequenceCommand] Called\n");
3331  bool ret = false;
3332  if ( this->isConnected() )
3333  {
3334  std::ostringstream oss;
3335  oss << "GPIO " << index
3336  << ", " << value
3337  << ", " << duration
3338  << ", " << loop
3339  << ", " << go
3340  << "\n";
3341  BasicStringList rsp = this->sendCommand(oss.str(), 2.0);
3342  if ( this->getLastCommandErrorInfo() == "" )
3343  {
3344  ret = true;
3345  }
3346  }
3347  this->debug("[RadioHandler::executeGpioSequenceCommand] Returning %s\n",
3348  this->debugBool(ret));
3349  return ret;
3350  }
3351 
3352  bool RadioHandler::executeCalibFrequencyQuery(double& freq)
3353  {
3354  this->debug("[RadioHandler::executeCalibFrequencyQuery] Called\n");
3355  bool ret = false;
3356  if ( this->isConnected() )
3357  {
3358  std::ostringstream oss;
3359  oss << "CALF?" << "\n";
3360  BasicStringList rsp = this->sendCommand(oss.str(), 2.0);
3361  if ( this->getLastCommandErrorInfo() == "" )
3362  {
3364  Pythonesque::Replace(rsp.front(), "CALF ", ""),
3365  ", ");
3366  // vec[0] = Calibration freq
3367  freq = boost::lexical_cast<double>(vec[0]);
3368  ret = true;
3369  }
3370  }
3371  this->debug("[RadioHandler::executeCalibFrequencyQuery] Returning %s\n",
3372  this->debugBool(ret));
3373  return ret;
3374  }
3375 
3376  bool RadioHandler::executeCalibFrequencyCommand(double& freq)
3377  {
3378  this->debug("[RadioHandler::executeCalibFrequencyCommand] Called\n");
3379  bool ret = false;
3380  if ( this->isConnected() )
3381  {
3382  std::ostringstream oss;
3383  oss << "CALF " << freq
3384  << "\n";
3385  BasicStringList rsp = this->sendCommand(oss.str(), 2.0);
3386  if ( this->getLastCommandErrorInfo() == "" )
3387  {
3388  ret = true;
3389  }
3390  }
3391  this->debug("[RadioHandler::executeCalibFrequencyCommand] Returning %s\n",
3392  this->debugBool(ret));
3393  return ret;
3394  }
3395 
3396  double RadioHandler::getDecimalDegreesFromNmea(const std::string& coord)
3397  {
3398  double ret = 0.0;
3399  // Get the sign from the directional indicator
3400  int sgn = 1;
3401  if ( (coord[0] == 'W') || (coord[0] == 'S') )
3402  sgn = -1;
3403  // Find the decimal point position
3404  std::string::size_type dotPos = coord.find('.');
3405  // Get the degrees part of the string, then convert to decimal
3406  std::string degPart = coord.substr(1, dotPos - 3);
3407  double degs = boost::lexical_cast<double>(degPart);
3408  // Get the minutes part of the string, then convert to decimal
3409  std::string minPart = coord.substr(dotPos - 2, std::string::npos);
3410  double mins = boost::lexical_cast<double>(minPart);
3411  // Calculate decimal degrees
3412  ret = degs + mins / 60.0;
3413  ret = ret * sgn;
3414  return ret;
3415  }
3416 
3418  {
3419  return 0;
3420  }
3421 
3422  } /* namespace Driver */
3423 
3424 } /* namespace LibCyberRadio */
3425 
virtual BasicIntList getWbddcIndexRange() const
Gets the range of WBDDC indices on the radio.
virtual BasicDoubleList getTransmitterCWSweepStepRange() const
Gets the CW frequency step range.
virtual ~RadioHandler()
Destroys a RadioHandler object.
virtual BasicIntList getTransmitterCWIndexRange() const
Gets the range of indices for CW tone generators.
virtual bool disableTransmitterCW(int index, int cwIndex)
Disables a given CW tone generator.
virtual BasicDoubleList getTransmitterCWSweepStopRange() const
Gets the CW stop frequency range.
virtual WbddcRateSet getWbddcRateSet() const
Gets the WBDDC rate set.
virtual std::string getDataPortDestMACAddress(int index, int dipIndex) const
Gets the MAC address for a given entry in the destination IP table on a given data port...
virtual bool connect(const std::string &mode, const std::string &host_or_dev, const int port_or_baudrate)
Connects to the radio.
virtual bool setWbddcSource(int index, int source)
Sets the source (which tuner is supplying the signal) for a given WBDDC.
virtual bool setWbddcStreamId(int index, unsigned int sid)
Sets the VITA 49 stream ID for a given WBDDC.
virtual double getWbddcFrequency(int index) const
Gets the tuned frequency for a given WBDDC.
virtual int getNumDataPortDipEntries() const
Gets the number of UDP destination table entries for the 10GigE data ports on the radio...
virtual RadioHandler & operator=(const RadioHandler &other)
Assignment operator for RadioHandler objects.
virtual bool setNbddcGroupConfiguration(int index, ConfigurationDict &cfg)
Sets the configuration dictionary for a given NBDDC group.
virtual bool setReferenceMode(int mode)
Sets the reference mode on the radio.
virtual int getNumNbddc() const
Gets the number of NBDDCs on the radio.
virtual unsigned int getTstatus()
Gets the tuner status from the radio.
virtual BasicDoubleList getDucRateList() const
Gets the list of allowed DUC sample rates, based on the rate set.
virtual double getTransmitterAttenuation(int index) const
Gets the attenuation for a given transmitter.
virtual std::string getDataPortSourceIP(int index) const
Gets the source IP address for a given data port.
virtual bool setTimeAdjustment(int tunerIndex, int timeAdjustValue)
Sets the time adjustment for tuners on the radio.
virtual double getTunerFrequencyUnit() const
Gets the tuned frequency units for tuners.
bool iqSwapped
Whether the I/Q data in the payload are swapped.
Definition: VitaIfSpec.h:56
virtual bool setWbddcGroupConfiguration(int index, ConfigurationDict &cfg)
Sets the configuration dictionary for a given WBDDC group.
virtual std::string getLastCommandErrorInfo() const
Gets the error information for the last command.
virtual int getNumDataPorts() const
Gets the number of 10GigE data ports on the radio.
virtual double getDucFrequencyRes() const
Gets the tuned frequency resolution for DUCs.
virtual int getWbddcDataPort(int index) const
Gets the data port for a given WBDDC.
virtual bool setNbddcUdpDestination(int index, int dest)
Sets the UDP destination for a given NBDDC.
virtual BasicIntList getNbddcGroupMembers(int index) const
Gets the list of group members for a given NBDDC group.
virtual bool enableTransmitterCW(int index, int cwIndex, bool enabled=true)
Enables a given CW tone generator.
virtual bool isWbddcSelectableSource() const
Gets whether the WBDDCs on this radio support selecting their tuner source.
virtual int getNumWbddc() const
Gets the number of WBDDCs on the radio.
virtual double getTransmitterCWSweepStepRes() const
Gets the CW frequency step resolution.
virtual bool removeWbddcGroupMember(int index, int member)
Removes a WBDDC from the given WBDDC group.
virtual int getDucDataPort(int index) const
Gets the data port for a given DUC.
virtual bool setWbddcVitaEnable(int index, int enable)
Sets the VITA 49 setting for a given WBDDC.
virtual bool setConfiguration(ConfigurationDict &cfg)
Sets the configuration dictionary for this object.
virtual ConfigurationDict getSimpleIPConfiguration() const
Gets the "simple" IP configuration dictionary for radios without 10Gig data ports.
static std::string Strip(const std::string &str, const std::string &chars=" \\\)
Strips both leading and trailing whitespace from the given string.
Definition: Pythonesque.cpp:57
virtual bool setDucRateIndex(int index, int rateIndex)
Sets the rate index for a given DUC.
virtual double getTransmitterCWSweepDwellRes() const
Gets the CW dwell time resolution.
Class that defines the VITA interface specification for an NDR-class radio.
Definition: VitaIfSpec.h:33
virtual bool setNbddcSource(int index, int source)
Sets the source (which tuner is supplying the signal) for a given NBDDC.
virtual ConfigurationDict getDucConfiguration(int index) const
Gets the configuration dictionary for a given DUC.
virtual bool setWbddcFrequency(int index, double freq)
Sets the tuned frequency for a given WBDDC.
virtual bool setTransmitterCWConfiguration(int index, int cwIndex, ConfigurationDict &cfg)
Sets the configuration dictionary for a given CW tone generator.
virtual bool hasKey(const std::string &key) const
Determines if the dictionary has the given key.
virtual bool disableTenGigFlowControl()
Disables flow control on all 10GigE data ports.
virtual double getDucFrequency(int index) const
Gets the tuned frequency for a given DUC.
virtual bool setTransmitterCWFrequency(int index, int cwIndex, double freq)
Sets the constant frequency for a given CW tone generator.
virtual bool disableWbddc(int index)
Disables a given WBDDC.
virtual bool setDataPortConfiguration(int index, ConfigurationDict &cfg)
Sets the configuration dictionary for a given data port.
virtual BasicDoubleList getTransmitterCWFrequencyRange() const
Gets the CW frequency range.
virtual bool disableWbddcGroup(int index)
Disables a given WBDDC group.
virtual bool setWbddcDataPort(int index, int port)
Sets the data port for a given WBDDC.
virtual bool setTenGigFlowControlStatus(bool enable)
Sets flow control status on all 10GigE data ports.
virtual bool setNbddcRateIndex(int index, int rateIndex)
Sets the rate index for a given NBDDC.
BASIC_LIST_CONTAINER< double > BasicDoubleList
Type representing a list of doubles.
Definition: BasicList.h:29
virtual double getTransmitterCWAmplitudeRes() const
Gets the CW amplitude resolution.
const char * byteOrder
Byte order used by the radio.
Definition: VitaIfSpec.h:54
virtual bool addWbddcGroupMember(int index, int member)
Adds a WBDDC to the given WBDDC group.
RadioHandler(const std::string &name="NDR", int numTuner=0, int tunerIndexBase=1, int numWbddc=0, int wbddcIndexBase=1, int numNbddc=0, int nbddcIndexBase=1, int numTunerBoards=1, int maxTunerBw=0, int numTransmitter=0, int transmitterIndexBase=1, int numDuc=0, int ducIndexBase=1, int numWbddcGroups=0, int wbddcGroupIndexBase=1, int numNbddcGroups=0, int nbddcGroupIndexBase=1, int numDdcGroups=0, int ddcGroupIndexBase=1, int numDataPorts=0, int dataPortIndexBase=1, int numSimpleIpSetups=0, double adcRate=102.4e6, VitaIfSpec ifSpec=VitaIfSpec(), bool debug=false)
Constructs a RadioHandler object.
virtual NbddcRateSet getNbddcRateSet() const
Gets the NBDDC rate set.
virtual bool setDucConfiguration(int index, ConfigurationDict &cfg)
Sets the configuration dictionary for a given DUC.
virtual ConfigurationDict getTunerConfiguration(int index) const
Gets the configuration dictionary for a given tuner.
virtual bool connect(const std::string &mode, const std::string &host_or_dev, const int port_or_baudrate)
Connects to the radio.
virtual bool isTunerEnabled(int index) const
Gets whether or not a given tuner is enabled.
virtual double getTransmitterFrequency(int index) const
Gets the frequency for a given transmitter.
virtual int getConfigurationValueAsInt(const std::string &key) const
Gets a named configuration value as an integer value.
virtual bool setSimpleSourceIPAddress(const std::string &ipAddr)
Sets the source IP address for radios without 10Gig data ports.
virtual bool setCalibrationFrequency(double freq)
Sets the calibration frequency.
virtual bool disableDataPortFlowControl(int index)
Disables flow control on the data port.
virtual bool setDataPortDestInfo(int index, int dipIndex, const std::string &ipAddr, const std::string &macAddr, unsigned int sourcePort, unsigned int destPort)
Sets the destination table information for a given entry in the DIP table on a given data port...
virtual bool setDucTxChannelBitmap(int index, int txChannels)
Sets the transmit channel bitmap for a given DUC.
virtual BasicDoubleList getDucAttenuationRange() const
Gets the DUC attenuation range.
BASIC_DICT_CONTAINER< int, double > NbddcRateSet
A rate set for a NBDDC.
virtual ConfigurationDict getWbddcConfiguration(int index) const
Gets the configuration dictionary for a given WBDDC.
virtual ConfigurationDict getDataPortConfiguration(int index) const
Gets the configuration dictionary for a given data port.
virtual double getTunerAttenuationRes() const
Gets the attenuation resolution.
virtual void disconnect()
Disconnects from the radio.
virtual bool isConnected() const
Gets whether or not the handler is connected.
virtual BasicDoubleList getTunerFrequencyRange() const
Gets the tunable frequency range.
virtual int getDucMode(int index) const
Gets the mode for a given DUC.
virtual int getDefaultDeviceInfo() const
Gets the default device information.
virtual double getDucAttenuationRes() const
Gets the DUC attenuation 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
virtual time_t getTimeNow()
Gets the current radio time.
virtual bool setTunerAttenuation(int index, double atten)
Sets the attenuation for a given tuner.
virtual BasicIntBoolDict getTenGigFlowControlStatus()
Gets flow control status on all 10GigE data ports.
virtual double getTunerFrequencyRes() const
Gets the tuned frequency resolution.
virtual BasicIntList getNbddcIndexRange() const
Gets the range of NBDDC indices on the radio.
virtual bool transmitterSupportsCW() const
Gets whether transmitters support continuous-wave (CW) tone generation.
virtual bool isNbddcGroupEnabled(int index) const
Gets whether or not a given NBDDC group is enabled.
virtual int getNbddcSource(int index) const
Gets the source (which tuner is supplying the signal) for a given NBDDC.
virtual bool setTransmitterFrequency(int index, double freq)
Sets the frequency for a given transmitter.
virtual bool setDucFrequency(int index, double freq)
Sets the tuned frequency for a given DUC.
virtual BasicDoubleList getNbddcRateList() const
Gets the list of allowed NBDDC sample rates, based on the rate set.
virtual BasicDoubleList getTransmitterCWSweepStartRange() const
Gets the CW start frequency range.
virtual double getCalibrationFrequency() const
Gets the calibration frequency.
virtual void initConfigurationDict()
Initializes the configuration dictionary, defining the allowed keys.
virtual double getTransmitterCWSweepStopFrequency(int index, int cwIndex) const
Gets the stop frequency for a signal sweep for a given CW tone generator.
virtual double getTransmitterCWSweepStopRes() const
Gets the CW stop frequency resolution.
virtual bool enableDuc(int index, bool enabled)
Enables a given DUC.
virtual int getNbddcDataPort(int index) const
Gets the data port for a given NBDDC.
virtual double getTransmitterFrequencyUnit() const
Gets the frequency unit for transmitters on the radio.
virtual bool setNbddcStreamId(int index, unsigned int sid)
Sets the VITA 49 stream ID for a given NBDDC.
virtual bool ducSupportsSnapshotTransmit() const
Gets whether DUCs support transmitting snapshots.
virtual bool setDataPortDestDestPort(int index, int dipIndex, unsigned int destPort)
Sets the VITA stream ID for a given entry in the destination IP table on a given data port...
virtual bool setWbddcGroupMembers(int index, const BasicIntList &groupMembers)
Sets the list of group members for a given WBDDC group.
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 BasicIntList getNbddcGroupIndexRange() const
Gets the range of NBDDC group indices on the radio.
virtual bool setTransmitterCWPhase(int index, int cwIndex, double phase)
Sets the signal phase for a given CW tone generator.
virtual unsigned int getNbddcStreamId(int index) const
Gets the VITA 49 stream ID for a given NBDDC.
virtual bool setTunerFilter(int index, int filter)
Sets the filter setting for a given tuner.
virtual bool setDataPortSourceIP(int index, const std::string &ipAddr)
Sets the source IP address for a given data port.
virtual bool setWbddcRateIndex(int index, int rateIndex)
Sets the rate index for a given WBDDC.
virtual bool disableDuc(int index)
Disables a given DUC.
virtual bool isNbddcEnabled(int index) const
Gets whether or not a given NBDDC is enabled.
virtual bool addNbddcGroupMember(int index, int member)
Adds a NBDDC to the given NBDDC group.
virtual int getNumTransmitters() const
Gets the number of transmitters on the radio.
virtual BasicDoubleList getTransmitterAttenuationRange() const
Gets the attenuation range for the transmitters on the radio.
virtual int getVitaTailSize() const
Gets the size of the VITA 49 tail.
virtual int getDucTxChannelBitmap(int index) const
Gets the transmit channel bitmap for a given DUC.
virtual std::string getSimpleSourceIPAddress() const
Gets the source IP address for radios without 10Gig data ports.
virtual bool setDucMode(int index, int mode)
Sets the mode for a given DUC.
virtual bool enableNbddcGroup(int index, bool enabled)
Enables a given NBDDC group.
virtual bool disableNbddcGroup(int index)
Disables a given NBDDC group.
virtual double getTransmitterCWSweepDwellTime(int index, int cwIndex) const
Gets the dwell time for a signal sweep for a given CW tone generator.
virtual BasicDoubleList getWbddcFrequencyRange() const
Gets the tunable frequency range for WBDDCs.
virtual int getVitaHeaderSize() const
Gets the size of the VITA 49 header.
Generic radio handler class.
Definition: RadioHandler.h:54
virtual unsigned int getDataPortDestDestPort(int index, int dipIndex) const
Gets the destination UDP port number for a given entry in the destination IP table on a given data po...
virtual std::string getSimpleDestIPAddress() const
Gets the destination IP address for radios without 10Gig data ports.
virtual int getWbddcSource(int index) const
Gets the source (which tuner is supplying the signal) for a given WBDDC.
virtual int debug(const char *format,...)
Outputs debug information.
Definition: Debuggable.cpp:95
virtual double getTransmitterFrequencyRes() const
Gets the frequency resolution for transmitters on the radio.
BASIC_LIST_CONTAINER< std::string > BasicStringList
Type representing a list of strings.
Definition: BasicList.h:25
virtual bool disableTransmitter(int index)
Disables a given transmitter.
virtual bool isTransmitterEnabled(int index) const
Gets whether a given transmitter is enabled.
virtual double getWbddcFrequencyRes() const
Gets the tuned frequency resolution for WBDDCs.
virtual bool setTransmitterAttenuation(int index, double atten)
Sets the attenuation for a given transmitter.
BASIC_DICT_CONTAINER< int, double > DucRateSet
A rate set for a DUC.
Definition: DucComponent.h:36
virtual double getTransmitterCWSweepFrequencyStep(int index, int cwIndex) const
Gets the frequency step for a signal sweep for a given CW tone generator.
virtual DucRateSet getDucRateSet() const
Gets the DUC&#39;s rate set.
virtual BasicIntList getWbddcGroupMembers(int index) const
Gets the list of group members for a given WBDDC group.
virtual BasicIntList getTunerIndexRange() const
Gets the tuner index range.
virtual int getWbddcRateIndex(int index) const
Gets the rate index for a given WBDDC.
virtual bool setNbddcFrequency(int index, double freq)
Sets the tuned frequency for a given NBDDC.
virtual double getTransmitterCWSweepStartRes() const
Gets the CW start frequency resolution.
virtual ConfigurationDict getNbddcGroupConfiguration(int index) const
Gets the configuration dictionary for a given NBDDC group.
BASIC_DICT_CONTAINER< int, bool > BasicIntBoolDict
Type representing a dictionary of Boolean values, keyed by integers.
Definition: BasicDict.h:37
Defines functionality for LibCyberRadio applications.
Definition: App.h:23
virtual bool ducSupportsSnapshotLoad() const
Gets whether DUCs support loading snapshot files.
virtual bool enableDataPortErrors(int index, bool enabled=true)
Enables errors on the data port.
virtual BasicDoubleList getTransmitterCWPhaseRange() const
Gets the CW phase range.
virtual bool setNbddcDataPort(int index, int port)
Sets the data port for a given NBDDC.
virtual BasicStringStringDict getVersionInfo()
Gets version information for the radio.
int payloadSizeWords
Size of the payload, in 32-byte words.
Definition: VitaIfSpec.h:50
virtual double getTunerAttenuation(int index) const
Gets the attenuation for a given tuner.
virtual bool isWbddcEnabled(int index) const
Gets whether or not a given WBDDC is enabled.
virtual double getTransmitterCWFrequencyRes() const
Gets the CW frequency resolution.
virtual int getNumWbddcGroups() const
Gets the number of WBDDC groups on the radio.
A configuration dictionary.
Definition: Configurable.h:51
virtual double getTransmitterCWSweepStartFrequency(int index, int cwIndex) const
Gets the start frequency for a signal sweep for a given CW tone generator.
BASIC_DICT_CONTAINER< std::string, std::string > BasicStringStringDict
Type representing a dictionary of strings, keyed by string values.
Definition: BasicDict.h:27
virtual BasicDoubleList getTransmitterCWAmplitudeRange() const
Gets the CW amplitude range.
virtual BasicDoubleList getDucFrequencyRange() const
Gets the tunable frequency range for DUCs.
virtual BasicDoubleList getTransmitterCWSweepDwellRange() const
Gets the CW dwell time range.
virtual bool setSimpleIPConfiguration(ConfigurationDict &cfg)
Sets the "simple" IP configuration dictionary for radios without 10Gig data ports.
virtual bool enableDataPortFlowControl(int index, bool enabled=true)
Enables flow control on the data port.
virtual bool setDataPortDestIPAddress(int index, int dipIndex, const std::string &ipAddr)
Sets the IP address for a given entry in the destination IP table on a given data port...
virtual double getNbddcFrequencyUnit() const
Gets the tuned frequency units for NBDDCs.
virtual std::string getLastCommandErrorInfo() const
Gets the error message from the last command attempted.
virtual double getTransmitterCWPhase(int index, int cwIndex) const
Gets the signal phase for a given CW tone generator.
virtual bool setSimpleDestMACAddress(const std::string &macAddr)
Sets the destination MAC address for radios without 10Gig data ports.
virtual BasicIntList getWbddcGroupIndexRange() const
Gets the range of WBDDC group indices on the radio.
virtual bool setDataPortDestMACAddress(int index, int dipIndex, const std::string &macAddr)
Sets the MAC address for a given entry in the destination IP table on a given data port...
virtual bool setTimeNextPps(bool checkTime=false, bool useGpsTime=false)
Sets the time for the next PPS rising edge on the radio.
virtual BasicIntList getGpioOutputByIndex(int index)
Gets the GPIO output settings for a given sequence index.
virtual bool setDucAttenuation(int index, double atten)
Sets the attenuation for a given DUC.
virtual int getVitaPayloadSize() const
Gets the size of the VITA 49 payload.
virtual int getNumTuner() const
Gets the number of tuners on the radio.
virtual std::string getSimpleDestMACAddress() const
Gets the destination MAC address for radios without 10Gig data ports.
virtual double getWbddcFrequencyUnit() const
Gets the tuned frequency units for WBDDCs.
virtual const char * debugBool(bool x)
Gets a debug output string for a Boolean value.
Definition: Debuggable.cpp:126
virtual int getNbddcRateIndex(int index) const
Gets the rate index for a given NBDDC.
virtual time_t getTimeNextPps()
Gets the time for the next PPS rising edge on the radio.
virtual bool setWbddcRateSet(int index, const WbddcRateSet &set)
Sets the rate set for a given WBDDC.
virtual bool disableDataPortErrors(int index)
Disables errors on the data port.
virtual BasicIntList getDataPortIndexRange() const
Gets the range of indices 10GigE data ports on the radio.
virtual bool setTunerFrequency(int index, double freq)
Sets the tuned frequency for a given tuner.
virtual bool setDucStreamId(int index, unsigned int sid)
Sets the VITA 49 stream ID for a given DUC.
virtual bool sendReset(int resetType=0)
Resets the radio.
int headerSizeWords
Size of the VITA 49 header, in 32-byte words.
Definition: VitaIfSpec.h:48
virtual bool isWbddcGroupEnabled(int index) const
Gets whether or not a given WBDDC group is enabled.
virtual ConfigurationDict getTransmitterCWConfiguration(int index, int cwIndex) const
Gets the configuration for a given CW tone generator.
virtual int getGpioOutput()
Gets the current GPIO output bits.
virtual bool setTunerConfiguration(int index, ConfigurationDict &cfg)
Sets the configuration dictionary for a given tuner.
virtual int getTransmitterCWPhaseRes() const
Gets the CW phase resolution.
virtual ConfigurationDict getNbddcConfiguration(int index) const
Gets the configuration dictionary for a given NBDDC.
virtual Configurable & operator=(const Configurable &other)
Assignment operator for Configurable objects.
virtual int getWbddcVitaEnable(int index) const
Gets the VITA 49 setting for a given WBDDC.
virtual BasicIntList getTransmitterIndexRange() const
Gets the list of transmitter indices on the radio.
virtual bool getPps()
Gets the pulse-per-second (PPS) rising edge from the radio.
virtual void updateConfigurationDict()
Updates the configuration dictionary from object settings.
virtual bool setNbddcConfiguration(int index, ConfigurationDict &cfg)
Sets the configuration dictionary for a given NBDDC.
virtual const char * getByteOrder() const
Gets the byte order (endianness) of the VITA 49.
virtual bool setNbddcRateSet(int index, const NbddcRateSet &set)
Sets the rate set for a given NBDDC.
virtual bool setConfiguration(ConfigurationDict &cfg)
Sets the configuration dictionary for this object.
virtual bool isByteswapped() const
Gets whether the VITA 49 is byte-swapped with respect to the host operating system.
virtual BasicStringList sendCommand(const std::string &cmdString, double timeout=-1)
Sends a command to the radio.
BASIC_DICT_CONTAINER< int, double > WbddcRateSet
A rate set for a WBDDC.
virtual BasicStringStringDict getConnectionInfo()
Gets connection information for the radio.
virtual int getDucRateIndex(int index) const
Gets the rate index for a given DUC.
virtual BasicDoubleList getNbddcFrequencyRange() const
Gets the tunable frequency range for NBDDCs.
virtual bool enableWbddcGroup(int index, bool enabled)
Enables a given WBDDC group.
virtual ConfigurationDict getWbddcGroupConfiguration(int index) const
Gets the configuration dictionary for a given WBDDC group.
Base configurable object class.
Definition: Configurable.h:79
virtual bool transmitterSupportsCWSweep() const
Gets whether the transmitter supports CW tone sweeping.
virtual bool setWbddcConfiguration(int index, ConfigurationDict &cfg)
Sets the configuration dictionary for a given WBDDC.
BASIC_LIST_CONTAINER< int > BasicIntList
Type representing a list of integers.
Definition: BasicList.h:27
virtual bool setTransmitterConfiguration(int index, ConfigurationDict &cfg)
Sets the configuration dictionary for a given transmitter.
virtual bool enableTuner(int index, bool enabled=true)
Enables a given tuner.
virtual bool enableNbddc(int index, bool enabled=true)
Enables a given NBDDC.
virtual int getNbddcUdpDestination(int index) const
Gets the UDP destination for a given NBDDC.
virtual double getTunerFrequency(int index) const
Gets the tuned frequency for a given tuner.
virtual BasicIntList getDataPortDipEntryIndexRange() const
Gets the list of UDP destination table indices for the 10GigE data ports on the radio.
virtual bool sendCommand(const std::string &cmdString, bool clearRx=true)
Sends a command to the radio over the transport.
virtual unsigned int getWbddcStreamId(int index) const
Gets the VITA 49 stream ID for a given WBDDC.
virtual unsigned int getDataPortDestSourcePort(int index, int dipIndex) const
Gets the source UDP port number for a given entry in the destination IP table on a given data port...
virtual double getTransmitterCWFrequency(int index, int cwIndex) const
Gets the constant frequency for a given CW tone generator.
virtual BasicDoubleList getTransmitterFrequencyRange() const
Gets the frequency range for the transmitters on the radio.
virtual bool enableTransmitter(int index, bool enabled=true)
Enables a given transmitter.
virtual void disconnect()
Disconnects from the radio.
virtual double getDucAttenuation(int index) const
Gets the attenuation for a given DUC.
virtual bool setBypassMode(int mode)
Sets the reference bypass mode on the radio.
virtual BasicStringList receive(double timeout=-1)
Receives a command response from the radio.
virtual bool disableTuner(int index)
Disables a given tuner.
virtual bool setWbddcUdpDestination(int index, int dest)
Sets the UDP destination for a given WBDDC.
virtual int getTransmitterCWNum() const
Gets the number of CW tone generators associated with transmitters on this radio. ...
virtual unsigned int getDucStreamId(int index) const
Gets the VITA 49 stream ID for a given DUC.
virtual int getTemperature()
Gets the current radio temperature.
virtual double getNbddcFrequencyRes() const
Gets the tuned frequency resolution for NBDDCs.
virtual std::string getSimpleSourceMACAddress() const
Gets the source MAC address for radios without 10Gig data ports.
virtual bool isConnected() const
Gets whether the transport is connected.
virtual double getNbddcFrequency(int index) const
Gets the tuned frequency for a given NBDDC.
virtual bool disableNbddc(int index)
Disables a given NBDDC.
virtual int getNumTunerBoards() const
Gets the number of tuner boards on the radio.
virtual int getTunerFilter(int index) const
Gets the filter setting for a given tuner.
virtual int getWbddcUdpDestination(int index) const
Gets the UDP destination for a given WBDDC.
virtual std::string getDataPortDestIPAddress(int index, int dipIndex) const
Gets the IP address for a given entry in the destination IP table on a given data port...
virtual unsigned int getStatus()
Gets the status from the radio.
virtual bool setTransmitterCWAmplitude(int index, int cwIndex, double amp)
Sets the signal amplitude for a given CW tone generator.
virtual ConfigurationDict getTransmitterConfiguration(int index) const
Gets the configuration dictionary for a given transmitter.
virtual bool enableWbddc(int index, bool enabled=true)
Enables a given WBDDC.
virtual int getNbddcVitaEnable(int index) const
Gets the VITA 49 setting for a given NBDDC.
virtual void queryConfiguration()
Tells the radio to query its hardware configuration in order to create its configuration dictionary (...
virtual bool setGpioOutputByIndex(int index, int value, int duration, int loop, int go)
Sets the GPIO output settings for a given sequence index.
virtual int getNumNbddcGroups() const
Gets the number of NBDDC groups on the radio.
virtual bool enableTenGigFlowControl()
Enables flow control on all 10GigE data ports.
virtual bool isIqSwapped() const
Gets whether the VITA 49 format swaps real and imaginary (I and Q) portions of each sample...
virtual double getConfigurationValueAsDbl(const std::string &key) const
Gets a named configuration value as a double value.
int tailSizeWords
Size of the VITA 49 "tail", in 32-byte words.
Definition: VitaIfSpec.h:52
virtual double getTransmitterAttenuationRes() const
Gets the attenuation resolution for transmitters on the radio.
virtual double getDucFrequencyUnit() const
Gets the tuned frequency units for DUCs.
virtual bool setGpioOutput(int value)
Sets the current GPIO output bits.
virtual bool setDucDataPort(int index, int port)
Sets the data port for a given DUC.
virtual bool setTransmitterCWFrequencySweep(int index, int cwIndex, double start, double stop, double step, double dwell)
Sets the parameters for a frequency sweep for a given CW tone generator.
virtual BasicDoubleList getGpsPosition()
Gets the current GPS position the radio.
virtual bool setDataPortDestSourcePort(int index, int dipIndex, unsigned int sourcePort)
Sets the UDP port number for a given entry in the destination IP table on a given data port...
virtual bool isConnectionModeSupported(const std::string &mode) const
Gets whether the radio supports the given connection mode.
virtual double getAdcRate() const
Gets the ADC sample rate.
virtual bool setNbddcVitaEnable(int index, int enable)
Sets the VITA 49 setting for a given NBDDC.
virtual bool removeNbddcGroupMember(int index, int member)
Removes a NBDDC from the given NBDDC group.
virtual bool loadDucSnapshot(int index, const std::string &filename, unsigned int startSample=0, unsigned int samples=0)
Load a snapshot file into a given DUC&#39;s memory block.
virtual bool setSimpleDestIPAddress(const std::string &ipAddr)
Sets the destination IP address for radios without 10Gig data ports.
virtual bool setNbddcGroupMembers(int index, const BasicIntList &groupMembers)
Sets the list of group members for a given NBDDC group.
virtual BasicIntList getDucIndexRange() const
Gets the range of DUC indices on the radio.
virtual BasicDoubleList getWbddcRateList() const
Gets the list of allowed WBDDC sample rates, based on the rate set.
virtual double getTransmitterCWAmplitude(int index, int cwIndex) const
Gets the signal amplitude for a given CW tone generator.
virtual BasicDoubleList getTunerAttenuationRange() const
Gets the tuner attenuation range.
virtual BasicStringList getConnectionModeList() const
Gets the list of connection methods that the radio supports.
virtual int getNumDuc() const
Gets the number of DUCs on the radio.
virtual uint32_t getMessageId(void)
Get a json Message ID.
virtual bool isWbddcTunable() const
Gets whether the WBDDCs on this radio are tunable.