![]() |
User Manual, Developers Guide and API Documentation |
![]() |
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 RISE_STATION_HPP 00029 #define RISE_STATION_HPP 00030 00031 #include <RISE/misc/pointer.hpp> 00032 #include <RISE/scenario/Scenario.hpp> 00033 #include <RISE/scenario/scenerymap/SceneryMap.hpp> 00034 #include <RISE/scenario/mobility/Mobility.hpp> 00035 #include <RISE/manager/systemmanager.hpp> 00036 00037 #include <WNS/Positionable.hpp> 00038 #include <WNS/PositionObserver.hpp> 00039 #include <WNS/Position.hpp> 00040 #include <WNS/logger/Logger.hpp> 00041 #include <WNS/pyconfig/View.hpp> 00042 #include <WNS/Subject.hpp> 00043 #include <WNS/Observer.hpp> 00044 #include <WNS/service/phy/power/PowerMeasurement.hpp> 00045 00046 #include <vector> 00047 #include <list> 00048 00049 namespace rise { namespace antenna { 00050 class Antenna; 00051 }} 00052 00053 namespace rise { 00054 class SystemManager; 00055 class MobilityInterface; 00060 class Station : 00061 virtual public wns::PositionableInterface, 00062 public wns::Subject<wns::PositionObserver>, 00063 public wns::Observer<wns::PositionObserver> 00064 { 00065 public: 00066 00070 Station(const wns::pyconfig::View& _pyConfigView); 00071 00075 virtual ~Station(); 00076 00080 virtual void 00081 setMobility(rise::scenario::mobility::MobilityInterface* _mobility); 00082 00086 virtual void 00087 positionWillChange(); 00088 00089 virtual void 00090 positionChanged(); 00091 00095 virtual const wns::Position& 00096 getPosition() const; 00097 00098 virtual double 00099 getDistance(PositionableInterface* p); 00100 00101 virtual double 00102 getDistance(const PositionableInterface& p); 00103 00104 virtual double 00105 getAngle(const PositionableInterface& p); 00106 00113 virtual void initialize(); 00114 00120 long int getStationId() const; 00121 00127 void setStationId(long int id); 00128 00132 antenna::Antenna* getAntenna() const; 00133 00143 virtual SystemManager* getSystemManager() const = 0; 00144 00146 virtual void moveTo(const wns::Position& p); 00148 virtual void moveTo(const wns::PositionOffset& p); 00149 00153 bool hasPathlossMap() const; 00154 00158 const scenario::scenerymap::PathlossMap2D& getPathlossMap() const; 00159 00163 const scenario::scenerymap::Interpolation2D& getInterpolatedPathlossMap() const; 00164 00168 bool hasShadowingMap() const; 00169 00173 const scenario::scenerymap::ShadowingMap2D& getShadowingMap() const; 00174 00178 const scenario::scenerymap::Interpolation2D& getInterpolatedShadowingMap() const; 00179 00184 virtual void receiveData(wns::osi::PDUPtr, wns::Ratio) 00185 { 00186 } 00187 00193 virtual void receiveData(wns::osi::PDUPtr, wns::Power, wns::Power, wns::Ratio) 00194 { 00195 } 00196 00202 virtual void receiveData(wns::osi::PDUPtr, wns::service::phy::power::PowerMeasurementPtr) 00203 { 00204 assure(false,"rise::station::receiveData(wns::osi::PDUPtr, wns::service::phy::power::PowerMeasurementPtr) called accidentially"); 00205 } 00206 00207 protected: 00208 00212 virtual bool isInitialized() const; 00213 00217 antenna::Antenna* pd_antenna; 00218 00222 scenario::mobility::MobilityInterface* getMobility() const; 00223 00225 wns::pyconfig::View pyConfigView; 00226 00227 00231 //RISELogger log; 00232 wns::logger::Logger log; 00233 00234 private: 00235 00239 bool initialized; 00240 00244 long int stationId; 00245 00249 Station(const Station&); 00250 00254 Station& operator=(const Station&); 00255 00256 void initializePathlossMap(); 00257 void initializeShadowingMap(); 00258 void createAntenna(); 00259 00260 const scenario::scenerymap::PathlossMap2D* pathlossMap; 00261 const scenario::scenerymap::Interpolation2D* interpolatedPathlossMap; 00262 00263 const scenario::scenerymap::ShadowingMap2D* shadowingMap; 00264 const scenario::scenerymap::Interpolation2D* interpolatedShadowingMap; 00265 00266 scenario::mobility::MobilityInterface* mobility; 00267 }; 00268 00269 } 00270 #endif // RISE_STATION_HPP 00271 00272
1.5.5