User Manual, Developers Guide and API Documentation

Receiver.hpp

Go to the documentation of this file.
00001 /*******************************************************************************
00002  * This file is part of openWNS (open Wireless Network Simulator)
00003  * _____________________________________________________________________________
00004  *
00005  * Copyright (C) 2004-2007
00006  * Chair of Communication Networks (ComNets)
00007  * Kopernikusstr. 5, D-52074 Aachen, Germany
00008  * phone: ++49-241-80-27910,
00009  * fax: ++49-241-80-22242
00010  * email: info@openwns.org
00011  * www: http://www.openwns.org
00012  * _____________________________________________________________________________
00013  *
00014  * openWNS is free software; you can redistribute it and/or modify it under the
00015  * terms of the GNU Lesser General Public License version 2 as published by the
00016  * Free Software Foundation;
00017  *
00018  * openWNS is distributed in the hope that it will be useful, but WITHOUT ANY
00019  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
00020  * A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
00021  * details.
00022  *
00023  * You should have received a copy of the GNU Lesser General Public License
00024  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00025  *
00026  ******************************************************************************/
00027 
00028 #ifndef OFDMAPHY_RECEIVER_RECEIVER_HPP
00029 #define OFDMAPHY_RECEIVER_RECEIVER_HPP
00030 
00031 #include <OFDMAPHY/receiver/ReceiverBase.hpp>
00032 #include <OFDMAPHY/receiver/OFDMAAspect.hpp>
00033 #include <OFDMAPHY/receiver/FTFadingAspect.hpp>
00034 #include <OFDMAPHY/receiver/MeasurementAspect.hpp>
00035 
00036 #include <OFDMAPHY/receiver/mimo/ICalculationStrategy.hpp>
00037 
00038 #include <OFDMAPHY/Station.hpp>
00039 #include <OFDMAPHY/RSSInterface.hpp>
00040 
00041 #include <RISE/receiver/LossCalculation.hpp>
00042 #include <RISE/transceiver/cache/propagationcache.hpp>
00043 
00044 #include <WNS/PowerRatio.hpp>
00045 #include <WNS/pyconfig/View.hpp>
00046 
00047 #include <map>
00048 
00049 namespace ofdmaphy { namespace receiver {
00053     class Receiver :
00054         virtual public ReceiverBase,
00055         public OFDMAAspect,
00056         public FTFadingAspect,
00057         public MeasurementAspect,
00058         public rise::receiver::TimeWeightedTransmissionAveraging,
00059         protected rise::receiver::LossCalculation,
00060         public wns::Subject<RSSInterface>
00061     {
00062 
00063     public:
00064         Receiver(const wns::pyconfig::View& config, rise::Station* s);
00065 
00066         virtual ~Receiver();
00067 
00069         virtual wns::Power
00070         getRxPower(const rise::TransmissionObjectPtr& t);
00071 
00073         virtual wns::Power
00074         getAllRxPower(const int subCarrier);
00075 
00077         virtual wns::Power
00078         getAllRxPower();
00079 
00083         virtual wns::Power
00084         getInterference(const rise::TransmissionObjectPtr& t);
00085 
00087         virtual void
00088         positionWillChange();
00089 
00090         virtual void
00091         positionChanged();
00092 
00098         virtual void
00099         notify(rise::TransmissionObjectPtr t);
00100 
00101         void
00102         signalNewReceivedSignalStrength();
00103 
00105         virtual void
00106         doMeasurementsNow();
00107 
00108         virtual void
00109         mobilityUpdate(rise::Transmitter* t);
00110 
00112         virtual void
00113         writeCacheEntry(rise::PropCacheEntry& cacheEntry, rise::Transmitter* t, double freq);
00114 
00116         struct OnNewRSS
00117         {
00118             OnNewRSS(const wns::Power _rss):
00119                 rss(_rss)
00120                 {}
00121 
00122             void operator()(RSSInterface* rss)
00123                 {
00124                     // The functor calls the onNewRSS implemented by the Observer
00125                     rss->onNewRSS(this->rss);
00126                 }
00127         private:
00128             wns::Power rss;
00129         };
00130 
00131         void
00132         updateRequest();
00133 
00134         void
00135         insertReceivePattern(wns::node::Interface*, wns::service::phy::ofdma::PatternPtr);
00136 
00137         void
00138         removeReceivePattern(wns::node::Interface*);
00139 
00140         void
00141         setCurrentReceivePatterns(std::map<wns::node::Interface*, wns::service::phy::ofdma::PatternPtr> _currentReceivePatterns);
00142 
00143         virtual wns::service::phy::ofdma::PatternPtr
00144         getCurrentReceivePattern(const rise::TransmissionObjectPtr& t) const;
00145 
00146         virtual wns::service::phy::ofdma::PatternPtr
00147         getCurrentReceivePattern(wns::node::Interface* pStack) const;
00148 
00149         bool
00150         isReceiving() const;
00151 
00152         std::string
00153         printActiveTransmissions() const;
00154 
00155         virtual void
00156         tune(double f, double b, int numberOfSubCarriers);
00157 
00158         wns::Power
00159         getRxPower(const rise::TransmissionObjectPtr& t, wns::service::phy::ofdma::PatternPtr pattern);
00160 
00161         wns::Power
00162         getUnfilteredRxPower(const rise::TransmissionObjectPtr& t);
00163 
00164         virtual rise::Station* getStation() const
00165             {
00166                 assure(station, "Not set");
00167                 return station;
00168             }
00169 
00170         Station* getOFDMAStation() const
00171             {
00172                 Station* tmp = dynamic_cast<Station*>(getStation());
00173                 assure(tmp, "Station is not an OFDMA Station");
00174                 return tmp;
00175             }
00176 
00177         template<typename TYPE>
00178         TYPE* getMIMOProcessing() const
00179             {
00180                 TYPE* t = dynamic_cast<TYPE*>(mimoProcessing);
00181                 assure(t, "MIMO processing is not of the requested type");
00182                 return t;
00183             }
00184 
00186         virtual wns::Ratio
00187         getLoss(rise::Transmitter* t, double f);
00188 
00189         virtual wns::Ratio
00190         getQuasiStaticPathLoss(const rise::TransmissionObjectPtr& t, wns::service::phy::ofdma::PatternPtr pattern);
00191 
00192         virtual wns::Ratio
00193         getFullPathLoss(const rise::TransmissionObjectPtr& t, wns::service::phy::ofdma::PatternPtr pattern);
00194     private:
00195         rise::Station* station;
00196 
00197         rise::PropagationCache* propagationCache;
00198 
00199         std::map<wns::node::Interface*, wns::service::phy::ofdma::PatternPtr> currentReceivePatterns;
00200         typedef std::list<rise::TransmissionObjectPtr> TransmissionObjectPtrList;
00201         TransmissionObjectPtrList activeTransmissions;
00202 
00203         wns::Power receivedSignalStrength;
00204 
00205         const rise::SystemManager::WraparoundShiftVectorContainer* wraparoundShiftVectors;
00206 
00207         int nSectors;
00208 
00209         mimo::ICalculationStrategy* mimoProcessing;
00210     };
00211 }
00212 }
00213 
00214 #endif // not defined __RISE_OFDMA_HPP
00215 
00216 
00217 

Generated on Sun May 27 03:32:18 2012 for openWNS by  doxygen 1.5.5