11#ifndef INCLUDED_LIBCYBERRADIO_DRIVER_DUCCOMPONENT_H
12#define INCLUDED_LIBCYBERRADIO_DRIVER_DUCCOMPONENT_H
14#include "LibCyberRadio/Driver/RadioComponent.h"
15#include "LibCyberRadio/Common/BasicDict.h"
16#include "LibCyberRadio/Common/BasicList.h"
99 double freqRangeMin = 0.0,
100 double freqRangeMax = 0.0,
101 double freqRes = 1.0,
102 double freqUnits = 1.0,
103 double attRangeMin = 0.0,
104 double attRangeMax = 10.0,
107 double frequency = 0.0,
108 double attenuation = 0.0,
112 unsigned int streamId = 0);
134 virtual bool enable(
bool enabled =
true);
244 virtual bool setMode(
int mode);
293 unsigned int startSample = 0,
294 unsigned int samples = 0);
335 unsigned int& streamId);
355 unsigned int& streamId);
365 const std::string& filename,
366 unsigned int startSample,
367 unsigned int samples);
371 double _freqRangeMin;
373 double _freqRangeMax;
397 unsigned int _streamId;
399 bool _supportsSnapLoad;
401 std::string _snapFilename;
403 unsigned int _snapStartSample;
405 unsigned int _snapSamples;
407 bool _supportsSnapTransmit;
409 bool _snapSinglePlayback;
411 bool _snapPauseUntilEnabled;
virtual int debug(const char *format,...)
Outputs debug information.
A configuration dictionary.
virtual bool enable(bool enabled=true)
Enables this component.
virtual bool setConfiguration(ConfigurationDict &cfg)
Sets the configuration dictionary for this component.
virtual bool supportsSnapshotTransmit() const
Gets whether or not the DUC supports transmitting snapshots.
virtual double getAttenuation() const
Gets the attenuation.
virtual bool setAttenuation(double atten)
Sets the attenuation.
DucComponent(const std::string &name="DUC", int index=1, RadioHandler *parent=NULL, bool debug=false, double freqRangeMin=0.0, double freqRangeMax=0.0, double freqRes=1.0, double freqUnits=1.0, double attRangeMin=0.0, double attRangeMax=10.0, double attRes=1.0, int dataPort=0, double frequency=0.0, double attenuation=0.0, int rateIndex=0, int txChannels=0, int mode=0, unsigned int streamId=0)
Constructs a DucComponent object.
virtual ~DucComponent()
Destroys a DucComponent object.
virtual int getMode() const
Gets the DUC's mode.
virtual BasicDoubleList getFrequencyRange() const
Gets the tunable frequency range.
virtual bool setFrequency(double freq)
Sets the DUC tuned frequency.
virtual int getDataPort() const
Gets the DUC's data port.
virtual bool executeDucCommand(int index, int &dataPort, double &frequency, double &attenuation, int &rateIndex, int &txChannels, int &mode, unsigned int &streamId)
Executes the DUC configuration set command.
virtual double getFrequency() const
Gets the tuned frequency.
virtual bool loadSnapshot(const std::string &filename, unsigned int startSample=0, unsigned int samples=0)
Load a snapshot file into the DUC's memory block.
virtual BasicDoubleList getRateList() const
Gets the list of allowed sample rates, based on the rate set.
virtual unsigned int getStreamId() const
Gets the DUC's VITA 49 stream ID.
virtual int getTxChannelBitmap() const
Gets the DUC's transmit channel bitmap.
virtual int getRateIndex() const
Gets the DUC's rate index.
virtual bool supportsSnapshotLoad() const
Gets whether or not the DUC supports loading snapshot files.
virtual BasicDoubleList getAttenuationRange() const
Gets the attenuation range.
virtual DucComponent & operator=(const DucComponent &other)
Assignment operator for DucComponent objects.
virtual bool setTxChannelBitmap(int txChannels)
Sets the DUC's transmit channel bitmap.
virtual void queryConfiguration()
Tells the component to query its hardware configuration in order to create its configuration dictiona...
virtual bool executeSnapshotLoadCommand(int index, const std::string &filename, unsigned int startSample, unsigned int samples)
Executes the DUC snapshot load command.
virtual bool setDataPort(int port)
Sets the DUC's data port.
virtual bool setRateSet(const DucRateSet &set)
Sets the DUC rate set.
virtual bool setStreamId(unsigned int sid)
Sets the DUC's VITA 49 stream ID.
virtual void updateConfigurationDict()
Updates the configuration dictionary from component settings.
virtual double getAttenuationRes() const
Gets the attenuation resolution.
virtual bool executeDucQuery(int index, int &dataPort, double &frequency, double &attenuation, int &rateIndex, int &txChannels, int &mode, unsigned int &streamId)
Executes the DUC configuration query command.
virtual DucRateSet getRateSet() const
Gets the DUC's rate set.
virtual bool setMode(int mode)
Sets the DUC's mode.
virtual bool setRateIndex(int index)
Sets the DUC's rate index.
virtual void initConfigurationDict()
Initializes the configuration dictionary, defining the allowed keys.
virtual double getFrequencyUnit() const
Gets the tuned frequency units.
virtual double getFrequencyRes() const
Gets the tuned frequency resolution.
RadioComponent(const std::string &name="<unknown>", int index=0, RadioHandler *parent=NULL, bool debug=false)
Constructs a RadioComponent object.
Generic radio handler class.
Provides programming elements for driving CRS NDR-class radios.
BASIC_DICT_CONTAINER< int, double > DucRateSet
A rate set for a DUC.
BASIC_DICT_CONTAINER< int, DucComponent * > DucComponentDict
A dictionary of DUC components, keyed by index.
Defines functionality for LibCyberRadio applications.
BASIC_LIST_CONTAINER< double > BasicDoubleList
Type representing a list of doubles.