27#include "ns3/singleton.h"
35NS_LOG_COMPONENT_DEFINE(
"SatRxCnoInputTraceContainer");
45 static TypeId tid = TypeId(
"ns3::SatRxCnoInputTraceContainer")
47 .AddConstructor<SatRxCnoInputTraceContainer>();
53 NS_LOG_FUNCTION(
this);
58 NS_LOG_FUNCTION(
this);
66 NS_LOG_FUNCTION(
this);
70 SatBaseTraceContainer::DoDispose();
76 NS_LOG_FUNCTION(
this);
89Ptr<SatInputFileStreamTimeDoubleContainer>
92 NS_LOG_FUNCTION(
this);
94 std::stringstream filename;
97 int32_t gwId = Singleton<SatIdMapper>::Get()->GetGwIdWithMac(key.first);
98 int32_t utId = Singleton<SatIdMapper>::Get()->GetUtIdWithMac(key.first);
99 int32_t beamId = Singleton<SatIdMapper>::Get()->GetBeamIdWithMac(key.first);
101 if (beamId < 0 || (utId < 0 && gwId < 0))
107 if (utId >= 0 && gwId < 0)
109 filename << dataPath <<
"/rxcnotraces/input/BEAM_" << beamId <<
"_UT_" << utId
113 if (gwId >= 0 && utId < 0)
115 filename << dataPath <<
"/rxcnotraces/input/BEAM_" << beamId <<
"_GW_" << gwId
119 std::pair<container_t::iterator, bool> result =
m_container.insert(
121 CreateObject<SatInputFileStreamTimeDoubleContainer>(
122 filename.str().c_str(),
126 if (result.second ==
false)
128 NS_FATAL_ERROR(
"SatRxCnoInputTraceContainer::AddNode failed");
131 NS_LOG_INFO(
"Added node with MAC " << key.first <<
" channel type " << key.second);
133 return result.first->second;
136 NS_FATAL_ERROR(
"SatRxCnoInputTraceContainer::AddNode failed");
140Ptr<SatInputFileStreamTimeDoubleContainer>
143 NS_LOG_FUNCTION(
this);
145 container_t::iterator iter =
m_container.find(key);
158 NS_LOG_FUNCTION(
this);
164 return FindNode(key)->ProceedToNextClosestTimeSample().at(
175 NS_LOG_FUNCTION(
this << cno);
186 std::pair<containerConstantCno_t::iterator, bool> result =
188 if (result.second ==
false)
190 NS_FATAL_ERROR(
"SatRxCnoInputTraceContainer::SetRxCno failed");
198 NS_LOG_FUNCTION(
this);
200 container_t::iterator iter =
m_container.find(key);
204 iter->second = CreateObject<SatInputFileStreamTimeDoubleContainer>(
212 std::pair<container_t::iterator, bool> result =
m_container.insert(
214 CreateObject<SatInputFileStreamTimeDoubleContainer>(
219 if (result.second ==
false)
221 NS_FATAL_ERROR(
"SatRxCnoInputTraceContainer::SetRxCnoFile failed");
static const uint32_t RX_CNO_TRACE_DEFAULT_RX_POWER_DENSITY_INDEX
Default Rx power density index for Rx power traces.
SatBaseTraceContainer()
Constructor.
static const uint32_t RX_CNO_TRACE_DEFAULT_NUMBER_OF_COLUMNS
Default Rx power density index for Rx power traces.
static std::string GetChannelTypeName(ChannelType_t channelType)
static Ptr< SatEnvVariables > GetInstance()
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.