24 #include "../utils/satellite-env-variables.h"
27 #include <ns3/singleton.h>
29 NS_LOG_COMPONENT_DEFINE(
"SatRxCnoInputTraceContainer");
34 NS_OBJECT_ENSURE_REGISTERED(SatRxCnoInputTraceContainer);
39 static TypeId tid = TypeId(
"ns3::SatRxCnoInputTraceContainer")
41 .AddConstructor<SatRxCnoInputTraceContainer>();
48 NS_LOG_FUNCTION(
this);
55 NS_LOG_FUNCTION(
this);
60 NS_LOG_FUNCTION(
this);
68 NS_LOG_FUNCTION(
this);
72 SatBaseTraceContainer::DoDispose();
78 NS_LOG_FUNCTION(
this);
91 Ptr<SatInputFileStreamTimeDoubleContainer>
94 NS_LOG_FUNCTION(
this);
96 std::stringstream filename;
97 std::string dataPath = Singleton<SatEnvVariables>::Get()->LocateDataDirectory();
99 int32_t gwId = Singleton<SatIdMapper>::Get()->GetGwIdWithMac(key.first);
100 int32_t utId = Singleton<SatIdMapper>::Get()->GetUtIdWithMac(key.first);
101 int32_t beamId = Singleton<SatIdMapper>::Get()->GetBeamIdWithMac(key.first);
103 if (beamId < 0 || (utId < 0 && gwId < 0))
109 if (utId >= 0 && gwId < 0)
111 filename << dataPath <<
"/rxcnotraces/input/BEAM_" << beamId <<
"_UT_" << utId
115 if (gwId >= 0 && utId < 0)
117 filename << dataPath <<
"/rxcnotraces/input/BEAM_" << beamId <<
"_GW_" << gwId
121 std::pair<container_t::iterator, bool> result =
m_container.insert(
123 CreateObject<SatInputFileStreamTimeDoubleContainer>(
124 filename.str().c_str(),
128 if (result.second ==
false)
130 NS_FATAL_ERROR(
"SatRxCnoInputTraceContainer::AddNode failed");
133 NS_LOG_INFO(
"Added node with MAC " << key.first <<
" channel type " << key.second);
135 return result.first->second;
138 NS_FATAL_ERROR(
"SatRxCnoInputTraceContainer::AddNode failed");
142 Ptr<SatInputFileStreamTimeDoubleContainer>
145 NS_LOG_FUNCTION(
this);
147 container_t::iterator iter =
m_container.find(key);
160 NS_LOG_FUNCTION(
this);
166 return FindNode(key)->ProceedToNextClosestTimeSample().at(
177 NS_LOG_FUNCTION(
this << cno);
188 std::pair<containerConstantCno_t::iterator, bool> result =
190 if (result.second ==
false)
192 NS_FATAL_ERROR(
"SatRxCnoInputTraceContainer::SetRxCno failed");
200 NS_LOG_FUNCTION(
this);
202 container_t::iterator iter =
m_container.find(key);
206 iter->second = CreateObject<SatInputFileStreamTimeDoubleContainer>(
214 std::pair<container_t::iterator, bool> result =
m_container.insert(
216 CreateObject<SatInputFileStreamTimeDoubleContainer>(
221 if (result.second ==
false)
223 NS_FATAL_ERROR(
"SatRxCnoInputTraceContainer::SetRxCnoFile failed");
Base class for trace containers such as interference or fading traces.
static const uint32_t RX_CNO_TRACE_DEFAULT_RX_POWER_DENSITY_INDEX
Default Rx power density index for Rx power traces.
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)
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.