[Positioner] Clean requests in Input

Delete the old requests in the Input class rather than in Positioning,
so autocalibration does not use old requests.
This commit is contained in:
Matteo Cypriani 2012-06-08 18:00:37 +02:00
parent f3c00334bf
commit 85c955bb03
2 changed files with 10 additions and 8 deletions

View File

@ -124,11 +124,19 @@ const Request& Input::get_next_request() const
const Request& request = medium->get_next_request() ;
log_current_request() ;
/* Update the current time */
if (Configuration::is_configured("replay"))
Timestamp::update_current_time(request.get_time_sent()) ;
// If the request is a calibration request, add it to the Stock
// (if allowed, and if it is not empty)
/* Clean the old requests */
unsigned int cr_timeout =
Configuration::uint_value(
"positioning.calibration-requests-timeout") ;
if (cr_timeout > 0)
Stock::delete_calibration_requests_older_than(cr_timeout) ;
/* If the request is a calibration request, add it to the Stock
* (if allowed, and if it is not empty) */
if (Configuration::bool_value(
"positioning.accept-new-calibration-requests")
&& request)

View File

@ -136,12 +136,6 @@ void Positioning::loop()
if (! request)
continue ;
unsigned int cr_timeout =
Configuration::uint_value(
"positioning.calibration-requests-timeout") ;
if (cr_timeout > 0)
Stock::delete_calibration_requests_older_than(cr_timeout) ;
Point3D real_position ;
bool compute_error = false ;
ResultList results(&request) ;