![]() |
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 _TRANSMITTER_HPP 00029 #define _TRANSMITTER_HPP 00030 00031 #include <RISE/misc/pointer.hpp> 00032 #include <RISE/medium/PhysicalResource.hpp> 00033 #include <RISE/scenario/Scenario.hpp> 00034 #include <RISE/scenario/PropagationCharacteristic.hpp> 00035 #include <RISE/transmissionobjects/transmissionobject.hpp> 00036 00037 #include <WNS/PositionObserver.hpp> 00038 #include <WNS/container/FastListEnabler.hpp> 00039 #include <WNS/logger/Logger.hpp> 00040 #include <WNS/pyconfig/View.hpp> 00041 #include <WNS/PowerRatio.hpp> 00042 #include <WNS/Observer.hpp> 00043 00044 #include <sstream> 00045 00046 namespace rise { namespace antenna { 00047 class Antenna; 00048 }} 00049 00050 namespace rise 00051 { 00052 class TransmissionObject; 00053 class Station; 00054 00066 class Transmitter : 00067 public wns::container::FastListEnabler<Transmitter*>, 00068 public wns::Observer<wns::PositionObserver>, 00069 public scenario::PropagationCharacteristic 00070 { 00071 public: 00073 Transmitter(const wns::pyconfig::View& config, Station* s, antenna::Antenna* a); 00074 00076 virtual ~Transmitter(); 00077 00079 00084 virtual void startTransmitting(TransmissionObjectPtr transmissionObject, long int Sub_band_Id); 00085 00087 00092 virtual void stopTransmitting(TransmissionObjectPtr transmissionObject); 00093 00095 virtual long int getTransmitterId() const 00096 { 00097 return transmitterId; 00098 } 00100 virtual void tune(double f, double b, long int numberOfSubCarriers); 00102 virtual void positionChanged(); 00103 00105 virtual void positionWillChange(); 00106 00108 virtual wns::Power getTxPower() const 00109 { 00110 return txPwr; 00111 } 00113 virtual void setTxPower(wns::Power p) 00114 { 00115 txPwr = p; 00116 } 00118 virtual wns::Power getMaxTxPower() const 00119 { 00120 return maxTxPwr; 00121 } 00123 virtual void setMaxTxPower(wns::Power p) { 00124 maxTxPwr=p; 00125 } 00126 00127 antenna::Antenna* getAntenna() const 00128 { 00129 return antenna; 00130 } 00131 00132 virtual std::string getDebugInfo(); 00133 00134 virtual Station* getStation()=0; // pure virtual! Derive and implement! 00135 00136 protected: 00138 wns::Power txPwr; 00140 long int transmitterId; 00142 wns::Power maxTxPwr; 00143 00144 typedef std::vector<medium::PhysicalResource*> PhysicalResourceContainer; 00145 typedef PhysicalResourceContainer::iterator PhysicalResourceIterator; 00146 00150 PhysicalResourceContainer prc; 00151 00155 antenna::Antenna* antenna; 00156 00160 double midFrequency; 00161 00163 wns::logger::Logger log; 00164 00165 private: 00166 00167 static long int nextid; 00168 00169 bool active; 00170 }; 00171 } 00172 00173 #endif 00174 00175
1.5.5