[Positioner] Stock::generate_RP(): fix update mobile

In generate_reference_point(), update the mobile's attributes *before*
to test if the current AP should be skipped.
This commit is contained in:
Matteo Cypriani 2012-02-29 16:34:39 +01:00
parent fb9d2d0cef
commit 4c5ad300c3
1 changed files with 4 additions and 4 deletions

View File

@ -508,15 +508,15 @@ void Stock::generate_reference_point(const Point3D &point)
for (unordered_map<string, AccessPoint>::const_iterator for (unordered_map<string, AccessPoint>::const_iterator
rx = aps.begin() ; rx != aps.end() ; ++rx) rx = aps.begin() ; rx != aps.end() ; ++rx)
{ {
/* Update the mobile's attributes */
vmob_gain += rx->second.get_antenna_gain() / aps.size() ;
vmob_pow += rx->second.get_trx_power() / aps.size() ;
/* Skip the AP if it is not at the good level */ /* Skip the AP if it is not at the good level */
const Point3D &rx_coord = rx->second.get_coordinates() ; const Point3D &rx_coord = rx->second.get_coordinates() ;
if (rx_coord.get_z() != point.get_z()) if (rx_coord.get_z() != point.get_z())
continue ; continue ;
/* Update the mobile's attributes */
vmob_gain += rx->second.get_antenna_gain() / aps.size() ;
vmob_pow += rx->second.get_trx_power() / aps.size() ;
/* Choose the 2 nearest APs in angle */ /* Choose the 2 nearest APs in angle */
multimap<double, pair<double, multimap<double, pair<double,
unordered_map<string, AccessPoint>::const_iterator> > unordered_map<string, AccessPoint>::const_iterator> >