[Positioner] Input: fix calib. request handling
Reorganise the tests in order to really ignore calibration requests if positioning.accept-new-calibration-requests = false and positioning.position-calibration-requests = false. Display a message when a calibration request is ignored.
This commit is contained in:
parent
e278aab032
commit
18761a06ce
|
@ -140,34 +140,37 @@ const Request& Input::get_next_request() const
|
||||||
Stock::delete_calibration_requests_older_than(cr_timeout) ;
|
Stock::delete_calibration_requests_older_than(cr_timeout) ;
|
||||||
|
|
||||||
/* If the request is a calibration request, add it to the Stock */
|
/* If the request is a calibration request, add it to the Stock */
|
||||||
if (Configuration::bool_value(
|
CalibrationRequest *calibration_request =
|
||||||
"positioning.accept-new-calibration-requests"))
|
dynamic_cast<CalibrationRequest*>(const_cast<Request*>(&request)) ;
|
||||||
|
if (calibration_request != NULL)
|
||||||
{
|
{
|
||||||
CalibrationRequest *calibration_request =
|
if (Configuration::bool_value(
|
||||||
dynamic_cast<CalibrationRequest*>(
|
"positioning.accept-new-calibration-requests"))
|
||||||
const_cast<Request*>(&request)) ;
|
|
||||||
if (calibration_request != NULL)
|
|
||||||
{
|
{
|
||||||
|
if (Configuration::is_configured("verbose"))
|
||||||
|
cerr
|
||||||
|
<< "Got a new calibration request (total "
|
||||||
|
<< Stock::nb_calibration_requests() << " in "
|
||||||
|
<< Stock::nb_reference_points()
|
||||||
|
<< " reference points).\n" ;
|
||||||
|
|
||||||
if (Configuration::bool_value(
|
if (Configuration::bool_value(
|
||||||
"positioning.unique-calibration-requests"))
|
"positioning.unique-calibration-requests"))
|
||||||
calibration_request->reference_point_delete_requests() ;
|
calibration_request->reference_point_delete_requests() ;
|
||||||
Stock::store_calibration_request(*calibration_request) ;
|
Stock::store_calibration_request(*calibration_request) ;
|
||||||
|
|
||||||
if (Configuration::is_configured("verbose"))
|
|
||||||
cerr
|
|
||||||
<< "Got a new calibration request (total "
|
|
||||||
<< Stock::nb_calibration_requests() << " in "
|
|
||||||
<< Stock::nb_reference_points()
|
|
||||||
<< " reference points).\n" ;
|
|
||||||
|
|
||||||
if (Configuration::bool_value(
|
if (Configuration::bool_value(
|
||||||
"positioning.generate-reference-points"))
|
"positioning.generate-reference-points"))
|
||||||
Stock::regenerate_reference_points() ;
|
Stock::regenerate_reference_points() ;
|
||||||
|
|
||||||
if (! Configuration::bool_value(
|
|
||||||
"positioning.position-calibration-requests"))
|
|
||||||
medium->clear_current_request() ;
|
|
||||||
}
|
}
|
||||||
|
else if (Configuration::is_configured("verbose"))
|
||||||
|
cerr
|
||||||
|
<< "Ignored new calibration request (positioning."
|
||||||
|
<< "accept-new-calibration-requests = false).\n" ;
|
||||||
|
|
||||||
|
if (! Configuration::bool_value(
|
||||||
|
"positioning.position-calibration-requests"))
|
||||||
|
medium->clear_current_request() ;
|
||||||
}
|
}
|
||||||
|
|
||||||
return medium->get_current_request() ;
|
return medium->get_current_request() ;
|
||||||
|
|
Loading…
Reference in New Issue