24 #include "../utils/satellite-env-variables.h"
27 #include <ns3/singleton.h>
35 NS_LOG_COMPONENT_DEFINE(
"SatRxCnoInputTraceContainer");
40 NS_OBJECT_ENSURE_REGISTERED(SatRxCnoInputTraceContainer);
45 static TypeId tid = TypeId(
"ns3::SatRxCnoInputTraceContainer")
47 .AddConstructor<SatRxCnoInputTraceContainer>();
54 NS_LOG_FUNCTION(
this);
61 NS_LOG_FUNCTION(
this);
66 NS_LOG_FUNCTION(
this);
74 NS_LOG_FUNCTION(
this);
78 SatBaseTraceContainer::DoDispose();
84 NS_LOG_FUNCTION(
this);
97 Ptr<SatInputFileStreamTimeDoubleContainer>
100 NS_LOG_FUNCTION(
this);
102 std::stringstream filename;
103 std::string dataPath = Singleton<SatEnvVariables>::Get()->LocateDataDirectory();
105 int32_t gwId = Singleton<SatIdMapper>::Get()->GetGwIdWithMac(key.first);
106 int32_t utId = Singleton<SatIdMapper>::Get()->GetUtIdWithMac(key.first);
107 int32_t beamId = Singleton<SatIdMapper>::Get()->GetBeamIdWithMac(key.first);
109 if (beamId < 0 || (utId < 0 && gwId < 0))
115 if (utId >= 0 && gwId < 0)
117 filename << dataPath <<
"/rxcnotraces/input/BEAM_" << beamId <<
"_UT_" << utId
121 if (gwId >= 0 && utId < 0)
123 filename << dataPath <<
"/rxcnotraces/input/BEAM_" << beamId <<
"_GW_" << gwId
127 std::pair<container_t::iterator, bool> result =
m_container.insert(
129 CreateObject<SatInputFileStreamTimeDoubleContainer>(
130 filename.str().c_str(),
134 if (result.second ==
false)
136 NS_FATAL_ERROR(
"SatRxCnoInputTraceContainer::AddNode failed");
139 NS_LOG_INFO(
"Added node with MAC " << key.first <<
" channel type " << key.second);
141 return result.first->second;
144 NS_FATAL_ERROR(
"SatRxCnoInputTraceContainer::AddNode failed");
148 Ptr<SatInputFileStreamTimeDoubleContainer>
151 NS_LOG_FUNCTION(
this);
153 container_t::iterator iter =
m_container.find(key);
166 NS_LOG_FUNCTION(
this);
172 return FindNode(key)->ProceedToNextClosestTimeSample().at(
183 NS_LOG_FUNCTION(
this << cno);
194 std::pair<containerConstantCno_t::iterator, bool> result =
196 if (result.second ==
false)
198 NS_FATAL_ERROR(
"SatRxCnoInputTraceContainer::SetRxCno failed");
206 NS_LOG_FUNCTION(
this);
208 container_t::iterator iter =
m_container.find(key);
212 iter->second = CreateObject<SatInputFileStreamTimeDoubleContainer>(
220 std::pair<container_t::iterator, bool> result =
m_container.insert(
222 CreateObject<SatInputFileStreamTimeDoubleContainer>(
227 if (result.second ==
false)
229 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.