rename function to remove implication of rx use only
This commit is contained in:
parent
f500d6d376
commit
9548145629
|
@ -85,7 +85,7 @@ double Universe::rxRate()
|
|||
* @brief milliseconds since the last update
|
||||
* @return
|
||||
*/
|
||||
long Universe::rxAge()
|
||||
long Universe::age()
|
||||
{
|
||||
if (!last_updated_.time_since_epoch().count())
|
||||
return -1; // universe has never been seen
|
||||
|
@ -310,7 +310,7 @@ void Universe::rx_timeout_(bool add_now)
|
|||
last_updated_ = now;
|
||||
rx_times_.push(now);
|
||||
}
|
||||
else if (status_ == DMX_ACTIVE && rxAge() >= E111_DATA_LOSS_TIMEOUT)
|
||||
else if (status_ == DMX_ACTIVE && age() >= E111_DATA_LOSS_TIMEOUT)
|
||||
// E1.11 DMX timeout period may be different the the rx_timeout_period
|
||||
setStatus(DMX_LOST);
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ class Universe {
|
|||
|
||||
virtual uint8_t slot (const uint16_t);
|
||||
virtual double rxRate();
|
||||
virtual long rxAge();
|
||||
virtual long age();
|
||||
|
||||
virtual void setValue (const uint16_t address, const uint8_t value);
|
||||
virtual void setValue (const uint16_t start, const uint16_t footprint,
|
||||
|
|
|
@ -315,7 +315,7 @@ std::shared_ptr<Universe> ArbitratingUniverse::dominant_()
|
|||
// cache the age of each universe
|
||||
std::unordered_map<DATA::data_header,uint> ages;
|
||||
for (const auto& [header, universe] : sources_)
|
||||
ages.insert({header, universe->rxAge()});
|
||||
ages.insert({header, universe->age()});
|
||||
|
||||
purge_stale_sources_(&ages);
|
||||
|
||||
|
@ -347,7 +347,7 @@ void ArbitratingUniverse::purge_stale_sources_(std::unordered_map<DATA::data_hea
|
|||
ages = *age_cache;
|
||||
else
|
||||
for (const auto& [header, universe] : sources_)
|
||||
ages.insert({header, universe->rxAge()});
|
||||
ages.insert({header, universe->age()});
|
||||
|
||||
// order the member universes by age
|
||||
std::multimap<uint,DATA::data_header> by_age;
|
||||
|
|
Loading…
Reference in New Issue