43 {
"NEM",
"Latitude",
"Longitude",
"Altitude",
"Pitch",
"Roll",
"Yaw",
"Azimuth",
"Elevation",
"Magnitude"},
45 "Shows the location event information received");
49 {
"NEM",
"Forward Pathloss",
"Reverse Pathloss"},
51 "Shows the precomputed pathloss information received");
53 pAntennaProfileTable_ =
55 {
"NEM",
"Antenna Profile",
"Antenna Azimuth",
"Antenna Elevation"},
57 "Shows the antenna profile information received");
63 for(
const auto & location : locations)
65 auto targetNEM = location.getNEMId();
67 if(locationNEMSet_.find(targetNEM) == locationNEMSet_.end())
69 auto position = location.getPosition();
71 auto optionalOrientation = location.getOrientation();
73 auto optionalVelocity = location.getVelocity();
75 pLocationTable_->
addRow(targetNEM,{
Any{targetNEM},
76 Any{position.getLatitudeDegrees()},
77 Any{position.getLongitudeDegrees()},
78 Any{position.getAltitudeMeters()},
79 Any{optionalOrientation.first.getPitchDegrees()},
80 Any{optionalOrientation.first.getRollDegrees()},
81 Any{optionalOrientation.first.getYawDegrees()},
82 Any{optionalVelocity.first.getAzimuthDegrees()},
83 Any{optionalVelocity.first.getElevationDegrees()},
84 Any{optionalVelocity.first.getMagnitudeMetersPerSecond()}});
86 locationNEMSet_.insert(targetNEM);
90 auto position = location.getPosition();
92 auto optionalOrientation = location.getOrientation();
94 auto optionalVelocity = location.getVelocity();
96 pLocationTable_->
setCell(targetNEM,1,
Any{position.getLatitudeDegrees()});
97 pLocationTable_->
setCell(targetNEM,2,
Any{position.getLongitudeDegrees()});
98 pLocationTable_->
setCell(targetNEM,3,
Any{position.getAltitudeMeters()});
100 if(optionalOrientation.second)
102 pLocationTable_->
setCell(targetNEM,4,
Any{optionalOrientation.first.getPitchDegrees()});
103 pLocationTable_->
setCell(targetNEM,5,
Any{optionalOrientation.first.getRollDegrees()});
104 pLocationTable_->
setCell(targetNEM,6,
Any{optionalOrientation.first.getYawDegrees()});
107 if(optionalVelocity.second)
109 pLocationTable_->
setCell(targetNEM,7,
Any{optionalVelocity.first.getAzimuthDegrees()});
110 pLocationTable_->
setCell(targetNEM,8,
Any{optionalVelocity.first.getElevationDegrees()});
111 pLocationTable_->
setCell(targetNEM,9,
Any{optionalVelocity.first.getMagnitudeMetersPerSecond()});
120 for(
const auto & pathloss : pathlosses)
122 auto targetNEM = pathloss.getNEMId();
124 std::vector<Any> row{
Any{targetNEM},
125 Any{pathloss.getForwardPathlossdB()},
126 Any{pathloss.getReversePathlossdB()}};
128 if(pathlossNEMSet_.find(targetNEM) == pathlossNEMSet_.end())
130 pPathlossTable_->
addRow(targetNEM,row);
132 pathlossNEMSet_.insert(targetNEM);
136 pPathlossTable_->
setRow(targetNEM,row);
144 for(
const auto & profile : profiles)
146 auto targetNEM = profile.getNEMId();
148 std::vector<Any> row{
Any{targetNEM},
149 Any{profile.getAntennaProfileId()},
150 Any{profile.getAntennaAzimuthDegrees()},
151 Any{profile.getAntennaElevationDegrees()}};
153 if(antennaProfileNEMSet_.find(targetNEM) == antennaProfileNEMSet_.end())
155 pAntennaProfileTable_->
addRow(targetNEM,row);
157 antennaProfileNEMSet_.insert(targetNEM);
161 pAntennaProfileTable_->
setRow(targetNEM,row);
void setCell(const Key &key, std::size_t columnIndex, const Any &any)
void update(const Events::Locations &locations)
void setRow(const Key &key, const std::vector< Any > &anys)
std::list< Pathloss > Pathlosses
The StatisticRegistrar allows NEM layers to register statistics and statistic tables. Statistics and Statistic tables are owned by the emulator framework and a borrowed reference is returned to the registering NEM layer.
void registerStatistics(StatisticRegistrar ®istrar)
StatisticTable< Key, Compare, scolumn > * registerTable(const std::string &sName, const StatisticTableLabels &labels, const StatisticProperties &properties=StatisticProperties::NONE, const std::string &sDescription="")
std::list< Location > Locations
void addRow(const Key &key, const std::vector< Any > &anys={})
EventTablePublisher(NEMId nemId)
The Any class can contain an instance of one of any type in its support type set. ...
std::list< AntennaProfile > AntennaProfiles