Commit fee3c028 authored by aligungr's avatar aligungr

UE SAS dev.

parent 52eb0de5
......@@ -9,7 +9,7 @@
#include "task.hpp"
#include <cmath>
static int MIN_ALLOWED_DBM = -100;
static int MIN_ALLOWED_DBM = -120;
static int EstimateSimulatedDbm(const Vector3 &myPos, const Vector3 &uePos)
{
......@@ -18,6 +18,8 @@ static int EstimateSimulatedDbm(const Vector3 &myPos, const Vector3 &uePos)
int deltaZ = myPos.z - uePos.z;
int distance = static_cast<int>(std::sqrt(deltaX * deltaX + deltaY * deltaY + deltaZ * deltaZ));
if (distance == 0)
return -1; // 0 may be confusing for people
return -distance;
}
......
......@@ -9,8 +9,6 @@
#include "task.hpp"
#include <utils/common.hpp>
static int DBM_STRONG_STRENGTH_THRESHOLD = -70;
namespace nr::ue
{
......@@ -22,20 +20,12 @@ void UeSasTask::onMeasurement()
// compare active and pending measurements
for (auto &m : m_activeMeasurements)
{
bool oldStrong = m.second.dbm >= DBM_STRONG_STRENGTH_THRESHOLD;
if (m_pendingMeasurements.count(m.first))
{
bool newStrong = m_pendingMeasurements[m.first].dbm >= DBM_STRONG_STRENGTH_THRESHOLD;
if (newStrong ^ oldStrong)
(newStrong ? entered : exited).push_back(m.first);
}
else if (oldStrong)
if (!m_pendingMeasurements.count(m.first))
exited.push_back(m.first);
}
for (auto &m : m_pendingMeasurements)
{
bool newStrong = m_pendingMeasurements[m.first].dbm >= DBM_STRONG_STRENGTH_THRESHOLD;
if (!m_activeMeasurements.count(m.first) && newStrong)
if (!m_activeMeasurements.count(m.first))
entered.push_back(m.first);
}
if (!entered.empty() || !exited.empty())
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment