INET Framework for OMNeT++/OMNEST
inet::physicallayer::IsotropicScalarBackgroundNoise Class Reference

#include <IsotropicScalarBackgroundNoise.h>

Inheritance diagram for inet::physicallayer::IsotropicScalarBackgroundNoise:
inet::physicallayer::IBackgroundNoise inet::physicallayer::IPrintableObject

Public Member Functions

 IsotropicScalarBackgroundNoise ()
 
virtual std::ostream & printToStream (std::ostream &stream, int level) const override
 Prints this object to the provided output stream. More...
 
virtual W getPower () const
 
virtual const INoisecomputeNoise (const IListening *listening) const override
 
- Public Member Functions inherited from inet::physicallayer::IPrintableObject
virtual ~IPrintableObject ()
 
virtual std::string getInfoStringRepresentation () const
 
virtual std::string getDetailStringRepresentation () const
 
virtual std::string getDebugStringRepresentation () const
 
virtual std::string getTraceStringRepresentation () const
 
virtual std::string getCompleteStringRepresentation () const
 

Protected Member Functions

virtual void initialize (int stage) override
 

Protected Attributes

W power
 

Additional Inherited Members

- Public Types inherited from inet::physicallayer::IPrintableObject
enum  PrintLevel {
  PRINT_LEVEL_TRACE, PRINT_LEVEL_DEBUG, PRINT_LEVEL_DETAIL, PRINT_LEVEL_INFO,
  PRINT_LEVEL_COMPLETE = INT_MIN
}
 

Constructor & Destructor Documentation

inet::physicallayer::IsotropicScalarBackgroundNoise::IsotropicScalarBackgroundNoise ( )
28  :
29  power(W(NaN))
30 {
31 }
compose< J, pow< s,-1 > > W
Definition: Units.h:770
#define NaN
Definition: INETMath.h:103
W power
Definition: IsotropicScalarBackgroundNoise.h:30

Member Function Documentation

const INoise * inet::physicallayer::IsotropicScalarBackgroundNoise::computeNoise ( const IListening listening) const
overridevirtual

Implements inet::physicallayer::IBackgroundNoise.

50 {
51  const BandListening *bandListening = check_and_cast<const BandListening *>(listening);
52  simtime_t startTime = listening->getStartTime();
53  simtime_t endTime = listening->getEndTime();
54  std::map<simtime_t, W> *powerChanges = new std::map<simtime_t, W>();
55  powerChanges->insert(std::pair<simtime_t, W>(startTime, power));
56  powerChanges->insert(std::pair<simtime_t, W>(endTime, -power));
57  return new ScalarNoise(startTime, endTime, bandListening->getCarrierFrequency(), bandListening->getBandwidth(), powerChanges);
58 }
W power
Definition: IsotropicScalarBackgroundNoise.h:30
virtual W inet::physicallayer::IsotropicScalarBackgroundNoise::getPower ( ) const
inlinevirtual
39 { return power; }
W power
Definition: IsotropicScalarBackgroundNoise.h:30
void inet::physicallayer::IsotropicScalarBackgroundNoise::initialize ( int  stage)
overrideprotectedvirtual
34 {
35  cModule::initialize(stage);
36  if (stage == INITSTAGE_LOCAL) {
37  power = mW(math::dBm2mW(par("power")));
38  }
39 }
double dBm2mW(double dBm)
Converts a dBm value into milliwatts.
Definition: INETMath.h:176
Local initializations.
Definition: InitStages.h:35
milli< W >::type mW
Definition: Units.h:903
W power
Definition: IsotropicScalarBackgroundNoise.h:30
std::ostream & inet::physicallayer::IsotropicScalarBackgroundNoise::printToStream ( std::ostream &  stream,
int  level 
) const
overridevirtual

Prints this object to the provided output stream.

Function calls to operator<< with pointers or references either const or not are all forwarded to this function.

Reimplemented from inet::physicallayer::IPrintableObject.

42 {
43  stream << "IsotropicScalarBackgroundNoise";
44  if (level <= PRINT_LEVEL_DETAIL)
45  stream << ", power = " << power;
46  return stream;
47 }
W power
Definition: IsotropicScalarBackgroundNoise.h:30

Member Data Documentation

W inet::physicallayer::IsotropicScalarBackgroundNoise::power
protected

The documentation for this class was generated from the following files: