OLD | NEW |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2009 CTTC | 3 * Copyright (c) 2009 CTTC |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 | 139 |
140 Ptr<MobilityModel> receiverMobility = (*rxPhyIterator)->GetMobility ()
; | 140 Ptr<MobilityModel> receiverMobility = (*rxPhyIterator)->GetMobility ()
; |
141 NS_LOG_LOGIC ("copying signal parameters " << txParams); | 141 NS_LOG_LOGIC ("copying signal parameters " << txParams); |
142 Ptr<SpectrumSignalParameters> rxParams = txParams->Copy (); | 142 Ptr<SpectrumSignalParameters> rxParams = txParams->Copy (); |
143 | 143 |
144 if (senderMobility && receiverMobility) | 144 if (senderMobility && receiverMobility) |
145 { | 145 { |
146 double pathLossDb = 0; | 146 double pathLossDb = 0; |
147 if (rxParams->txAntenna != 0) | 147 if (rxParams->txAntenna != 0) |
148 { | 148 { |
149 Angles txAngles (receiverMobility->GetPosition (), senderMobil
ity->GetPosition ()); | 149 double txAntennaGain = rxParams->txAntenna->GetGainDb (senderM
obility, receiverMobility); |
150 double txAntennaGain = rxParams->txAntenna->GetGainDb (txAngle
s); | |
151 NS_LOG_LOGIC ("txAntennaGain = " << txAntennaGain << " dB"); | 150 NS_LOG_LOGIC ("txAntennaGain = " << txAntennaGain << " dB"); |
152 pathLossDb -= txAntennaGain; | 151 pathLossDb -= txAntennaGain; |
153 } | 152 } |
154 Ptr<AntennaModel> rxAntenna = (*rxPhyIterator)->GetRxAntenna (); | 153 Ptr<AntennaModel> rxAntenna = (*rxPhyIterator)->GetObject<AntennaM
odel> (); |
155 if (rxAntenna != 0) | 154 if (rxAntenna != 0) |
156 { | 155 { |
157 Angles rxAngles (senderMobility->GetPosition (), receiverMobil
ity->GetPosition ()); | 156 double rxAntennaGain = rxAntenna->GetGainDb (receiverMobility,
senderMobility); |
158 double rxAntennaGain = rxAntenna->GetGainDb (rxAngles); | |
159 NS_LOG_LOGIC ("rxAntennaGain = " << rxAntennaGain << " dB"); | 157 NS_LOG_LOGIC ("rxAntennaGain = " << rxAntennaGain << " dB"); |
160 pathLossDb -= rxAntennaGain; | 158 pathLossDb -= rxAntennaGain; |
161 } | 159 } |
162 if (m_propagationLoss) | 160 if (m_propagationLoss) |
163 { | 161 { |
164 double propagationGainDb = m_propagationLoss->CalcRxPower (0,
senderMobility, receiverMobility); | 162 double propagationGainDb = m_propagationLoss->CalcRxPower (0,
senderMobility, receiverMobility); |
165 NS_LOG_LOGIC ("propagationGainDb = " << propagationGainDb << "
dB"); | 163 NS_LOG_LOGIC ("propagationGainDb = " << propagationGainDb << "
dB"); |
166 pathLossDb -= propagationGainDb; | 164 pathLossDb -= propagationGainDb; |
167 }···················· | 165 }···················· |
168 NS_LOG_LOGIC ("total pathLoss = " << pathLossDb << " dB");···· | 166 NS_LOG_LOGIC ("total pathLoss = " << pathLossDb << " dB");···· |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 | 256 |
259 Ptr<SpectrumPropagationLossModel> | 257 Ptr<SpectrumPropagationLossModel> |
260 SingleModelSpectrumChannel::GetSpectrumPropagationLossModel (void) | 258 SingleModelSpectrumChannel::GetSpectrumPropagationLossModel (void) |
261 { | 259 { |
262 NS_LOG_FUNCTION (this); | 260 NS_LOG_FUNCTION (this); |
263 return m_spectrumPropagationLoss; | 261 return m_spectrumPropagationLoss; |
264 } | 262 } |
265 | 263 |
266 | 264 |
267 } // namespace ns3 | 265 } // namespace ns3 |
OLD | NEW |