fixed spectrum code for python bindings as per Gustavo's suggestion
This commit is contained in:
@@ -29,6 +29,9 @@ NS_LOG_COMPONENT_DEFINE ("SpectrumConverter");
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
SpectrumConverter::SpectrumConverter ()
|
||||
{
|
||||
}
|
||||
|
||||
SpectrumConverter::SpectrumConverter (Ptr<const SpectrumModel> fromSpectrumModel, Ptr<const SpectrumModel> toSpectrumModel)
|
||||
{
|
||||
|
||||
@@ -50,6 +50,8 @@ public:
|
||||
*/
|
||||
SpectrumConverter (Ptr<const SpectrumModel> fromSpectrumModel, Ptr<const SpectrumModel> toSpectrumModel);
|
||||
|
||||
SpectrumConverter ();
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -31,6 +31,9 @@ NS_LOG_COMPONENT_DEFINE ("SpectrumValue");
|
||||
namespace ns3 {
|
||||
|
||||
|
||||
SpectrumValue::SpectrumValue ()
|
||||
{
|
||||
}
|
||||
|
||||
SpectrumValue::SpectrumValue (Ptr<const SpectrumModel> sof)
|
||||
: m_spectrumModel (sof),
|
||||
|
||||
@@ -74,6 +74,10 @@ public:
|
||||
*/
|
||||
SpectrumValue (Ptr<const SpectrumModel> sm);
|
||||
|
||||
|
||||
SpectrumValue ();
|
||||
|
||||
|
||||
/**
|
||||
* Access value at given frequency index
|
||||
*
|
||||
@@ -517,6 +521,14 @@ private:
|
||||
|
||||
std::ostream& operator << (std::ostream& os, const SpectrumValue& pvf);
|
||||
|
||||
double Norm (const SpectrumValue& x);
|
||||
double Sum (const SpectrumValue& x);
|
||||
double Prod (const SpectrumValue& x);
|
||||
SpectrumValue Pow (const SpectrumValue& base, double exp);
|
||||
SpectrumValue Pow (double base, const SpectrumValue& exp);
|
||||
SpectrumValue Log10 (const SpectrumValue& arg);
|
||||
SpectrumValue Log2 (const SpectrumValue& arg);
|
||||
SpectrumValue Log (const SpectrumValue& arg);
|
||||
|
||||
|
||||
} // namespace ns3
|
||||
|
||||
@@ -263,6 +263,13 @@ AlohaNoackNetDevice::GetPhy () const
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
AlohaNoackNetDevice::SetChannel (Ptr<Channel> c)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << c);
|
||||
m_channel = c;
|
||||
}
|
||||
|
||||
|
||||
Ptr<Channel>
|
||||
AlohaNoackNetDevice::GetChannel (void) const
|
||||
|
||||
@@ -196,6 +196,12 @@ NonCommunicatingNetDevice::GetPhy () const
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
NonCommunicatingNetDevice::SetChannel (Ptr<Channel> c)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << c);
|
||||
m_channel = c;
|
||||
}
|
||||
|
||||
Ptr<Channel>
|
||||
NonCommunicatingNetDevice::GetChannel (void) const
|
||||
|
||||
@@ -111,16 +111,6 @@ public:
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Set the time resolution of the generated waveforms.
|
||||
*
|
||||
* @param resolution time resolution of the generated
|
||||
* waveforms. This determines both the duration of waveforms, and
|
||||
* the time between subsequent waveforms (i.e., they are generated
|
||||
* back to back during the active portion of the generator cycle).
|
||||
*/
|
||||
void SetResolution (Time resolution);
|
||||
|
||||
/**
|
||||
* Start the waveform generator
|
||||
*
|
||||
|
||||
@@ -126,6 +126,7 @@ AdhocAlohaNoackIdealPhyHelper::Install (NodeContainer c) const
|
||||
|
||||
NS_ASSERT_MSG (m_channel, "you forgot to call AdhocAlohaNoackIdealPhyHelper::SetChannel ()");
|
||||
phy->SetChannel (m_channel);
|
||||
dev->SetChannel (m_channel);
|
||||
m_channel->AddRx (phy);
|
||||
|
||||
phy->SetPhyMacTxEndCallback (MakeCallback (&AlohaNoackNetDevice::NotifyTransmissionEnd, dev));
|
||||
|
||||
@@ -153,6 +153,8 @@ SpectrumAnalyzerHelper::Install (NodeContainer c) const
|
||||
NS_ASSERT_MSG (m_channel, "you forgot to call SpectrumAnalyzerHelper::SetChannel ()");
|
||||
m_channel->AddRx (phy);
|
||||
|
||||
dev->SetChannel (m_channel);
|
||||
|
||||
uint32_t devId = node->AddDevice (dev);
|
||||
devices.Add (dev);
|
||||
|
||||
|
||||
@@ -108,7 +108,8 @@ WaveformGeneratorHelper::Install (NodeContainer c) const
|
||||
|
||||
NS_ASSERT_MSG (m_channel, "you forgot to call WaveformGeneratorHelper::SetChannel ()");
|
||||
phy->SetChannel (m_channel);
|
||||
//m_channel->AddRx (phy);
|
||||
dev->SetChannel (m_channel);
|
||||
|
||||
|
||||
node->AddDevice (dev);
|
||||
devices.Add (dev);
|
||||
|
||||
Reference in New Issue
Block a user