LEFT | RIGHT |
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) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) | 3 * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 } | 197 } |
198 else | 198 else |
199 { | 199 { |
200 while (BufferSizeLevelBsrTable[index] < val) | 200 while (BufferSizeLevelBsrTable[index] < val) |
201 { | 201 { |
202 NS_ASSERT (index < 64); | 202 NS_ASSERT (index < 64); |
203 index++; | 203 index++; |
204 } | 204 } |
205 } | 205 } |
206 | 206 |
207 return index; | 207 return (index); |
208 } | 208 } |
209 | 209 |
210 | 210 |
211 uint8_t | 211 uint8_t |
212 TransmissionModesLayers::TxMode2LayerNum (uint8_t txMode) | 212 TransmissionModesLayers::TxMode2LayerNum (uint8_t txMode) |
213 { | 213 { |
214 uint8_t nLayer = 0; | 214 uint8_t nLayer = 0; |
215 switch (txMode) | 215 switch (txMode) |
216 { | 216 { |
217 case 0: // Tx MODE 1: SISO | 217 case 0: // Tx MODE 1: SISO |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 uint8_t | 303 uint8_t |
304 EutranMeasurementMapping::ActualHysteresis2IeValue (double hysteresisDb) | 304 EutranMeasurementMapping::ActualHysteresis2IeValue (double hysteresisDb) |
305 { | 305 { |
306 if ((hysteresisDb < 0.0) || (hysteresisDb > 15.0)) | 306 if ((hysteresisDb < 0.0) || (hysteresisDb > 15.0)) |
307 { | 307 { |
308 NS_FATAL_ERROR ("The value " << hysteresisDb | 308 NS_FATAL_ERROR ("The value " << hysteresisDb |
309 << " is out of the allowed range (0..15) dB" | 309 << " is out of the allowed range (0..15) dB" |
310 << " for hysteresis"); | 310 << " for hysteresis"); |
311 } | 311 } |
312 | 312 |
313 uint8_t ieValue = static_cast<uint8_t>(lround (hysteresisDb * 2.0)); | 313 uint8_t ieValue = static_cast<uint8_t> (lround (hysteresisDb * 2.0)); |
314 NS_ASSERT (ieValue <= 30); | 314 NS_ASSERT (ieValue <= 30); |
315 return ieValue; | 315 return ieValue; |
316 } | 316 } |
317 | 317 |
318 double | 318 double |
319 EutranMeasurementMapping::IeValue2ActualA3Offset (int8_t a3OffsetIeValue) | 319 EutranMeasurementMapping::IeValue2ActualA3Offset (int8_t a3OffsetIeValue) |
320 { | 320 { |
321 if ((a3OffsetIeValue < -30) || (a3OffsetIeValue > 30)) | 321 if ((a3OffsetIeValue < -30) || (a3OffsetIeValue > 30)) |
322 { | 322 { |
323 NS_FATAL_ERROR ("The value " << (int16_t) a3OffsetIeValue | 323 NS_FATAL_ERROR ("The value " << (int16_t) a3OffsetIeValue |
(...skipping 10 matching lines...) Expand all Loading... |
334 int8_t | 334 int8_t |
335 EutranMeasurementMapping::ActualA3Offset2IeValue (double a3OffsetDb) | 335 EutranMeasurementMapping::ActualA3Offset2IeValue (double a3OffsetDb) |
336 { | 336 { |
337 if ((a3OffsetDb < -15.0) || (a3OffsetDb > 15.0)) | 337 if ((a3OffsetDb < -15.0) || (a3OffsetDb > 15.0)) |
338 { | 338 { |
339 NS_FATAL_ERROR ("The value " << a3OffsetDb | 339 NS_FATAL_ERROR ("The value " << a3OffsetDb |
340 << " is out of the allowed range (-15..15) dB
" | 340 << " is out of the allowed range (-15..15) dB
" |
341 << " for A3 Offset"); | 341 << " for A3 Offset"); |
342 } | 342 } |
343 | 343 |
344 int8_t ieValue = static_cast<uint8_t>(lround (a3OffsetDb * 2.0)); | 344 int8_t ieValue = static_cast<uint8_t> (lround (a3OffsetDb * 2.0)); |
345 NS_ASSERT (ieValue >= -30); | 345 NS_ASSERT (ieValue >= -30); |
346 NS_ASSERT (ieValue <= 30); | 346 NS_ASSERT (ieValue <= 30); |
347 return ieValue; | 347 return ieValue; |
348 } | 348 } |
349 | 349 |
350 double | 350 double |
351 EutranMeasurementMapping::IeValue2ActualQRxLevMin (int8_t qRxLevMinIeValue) | 351 EutranMeasurementMapping::IeValue2ActualQRxLevMin (int8_t qRxLevMinIeValue) |
352 { | 352 { |
353 if ((qRxLevMinIeValue < -70) || (qRxLevMinIeValue > -22)) | 353 if ((qRxLevMinIeValue < -70) || (qRxLevMinIeValue > -22)) |
354 { | 354 { |
(...skipping 19 matching lines...) Expand all Loading... |
374 } | 374 } |
375 | 375 |
376 double actual = static_cast<double> (qQualMinIeValue); | 376 double actual = static_cast<double> (qQualMinIeValue); |
377 NS_ASSERT (actual >= -34.0); | 377 NS_ASSERT (actual >= -34.0); |
378 NS_ASSERT (actual <= -3.0); | 378 NS_ASSERT (actual <= -3.0); |
379 return actual; | 379 return actual; |
380 } | 380 } |
381 | 381 |
382 }; // namespace ns3 | 382 }; // namespace ns3 |
383 | 383 |
LEFT | RIGHT |