![]() |
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 #include <WNS/osi/PDU.hpp> 00029 #include <WNS/service/phy/phymode/PhyModeInterface.hpp> 00030 00031 #include <RISE/transmissionobjects/transmissionobject.hpp> 00032 #include <RISE/transceiver/transmitter.hpp> 00033 #include <RISE/antenna/Beamforming.hpp> 00034 #include <RISE/misc/pointer.hpp> 00035 00036 using namespace std; 00037 using namespace rise; 00038 00039 TransmissionInterface::TransmissionInterface() : 00040 onAir(false), 00041 pr(NULL) 00042 { 00043 } 00044 00045 TransmissionInterface::~TransmissionInterface() 00046 { 00047 } 00048 00049 TransmissionObject::TransmissionObject(Transmitter* _transmitter, 00050 const wns::Power& _txPower, 00051 unsigned long int _linkMode, 00052 int _numberOfSpatialStreams) : 00053 transmitter(_transmitter), 00054 payload(NULL), 00055 linkMode(_linkMode) 00056 { 00057 this->setTxPower(_txPower); 00058 this->setNumberOfSpatialStreams(_numberOfSpatialStreams); 00059 } 00060 00061 00062 TransmissionObject::TransmissionObject(Transmitter* _transmitter, 00063 wns::osi::PDUPtr _payload, 00064 const wns::Power& _txPower, 00065 unsigned long int _linkMode, 00066 int _numberOfSpatialStreams) : 00067 transmitter(_transmitter), 00068 payload(_payload), 00069 linkMode(_linkMode) 00070 { 00071 this->setTxPower(_txPower); 00072 this->setNumberOfSpatialStreams(_numberOfSpatialStreams); 00073 } 00074 00075 TransmissionObject::TransmissionObject(Transmitter* _transmitter, 00076 const wns::Power& _txPower, 00077 const wns::service::phy::phymode::PhyModeInterfacePtr _phyModePtr, 00078 unsigned long int _linkMode) : 00079 transmitter(_transmitter), 00080 payload(NULL), 00081 linkMode(_linkMode) 00082 { 00083 this->setTxPower(_txPower); 00084 assure(_phyModePtr,"phyModePtr==NULL"); 00085 this->setPhyModePtr(_phyModePtr); 00086 } 00087 00088 00089 TransmissionObject::TransmissionObject(Transmitter* _transmitter, 00090 wns::osi::PDUPtr _payload, 00091 const wns::Power& _txPower, 00092 const wns::service::phy::phymode::PhyModeInterfacePtr _phyModePtr, 00093 unsigned long int _linkMode) : 00094 transmitter(_transmitter), 00095 payload(_payload), 00096 linkMode(_linkMode) 00097 { 00098 this->setTxPower(_txPower); 00099 assure(_phyModePtr,"phyModePtr==NULL"); 00100 this->setPhyModePtr(_phyModePtr); 00101 } 00102 00103 TransmissionObject::~TransmissionObject() 00104 { 00105 } 00106 00107 wns::Ratio TransmissionObject::getTransmittersAntennaGain(const wns::Position& receiverPosition) const 00108 { 00109 return getTransmitter()->getAntenna()->getGain(receiverPosition, rise::antenna::PatternPtr()); 00110 } 00111 00112 std::string 00113 TransmissionObject::toString() const 00114 { 00115 std::stringstream s; 00116 s << "TO("; 00117 s << transmitter->getDebugInfo()<<","; // rise::Transmitter 00118 s << "phyMode="<<getPhyModePtr()->getString(); 00119 s <<",linkMode="<<getLinkMode(); 00120 s << ",payload="<<*payload; // wns::osi::PDUPtr 00121 s << ")"; 00122 return s.str(); 00123 }
1.5.5