2012-02-06 16:44:09 +01:00
|
|
|
/*
|
2013-05-29 18:43:35 +02:00
|
|
|
* This file is part of the Owl Positioning System (OwlPS) project.
|
|
|
|
* It is subject to the copyright notice and license terms in the
|
|
|
|
* COPYRIGHT.t2t file found in the top-level directory of this
|
|
|
|
* distribution and at
|
|
|
|
* http://code.lm7.fr/p/owlps/source/tree/master/COPYRIGHT.t2t
|
|
|
|
* No part of the OwlPS Project, including this file, may be copied,
|
|
|
|
* modified, propagated, or distributed except according to the terms
|
|
|
|
* contained in the COPYRIGHT.t2t file; the COPYRIGHT.t2t file must be
|
|
|
|
* distributed along with this file, either separately or by replacing
|
2013-06-22 23:30:17 +02:00
|
|
|
* this notice by the COPYRIGHT.t2t file's contents.
|
2012-02-06 16:44:09 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
2010-02-16 19:31:25 +01:00
|
|
|
#include "calibrationrequest.hh"
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-03-31 17:08:24 +02:00
|
|
|
/* *** Constructors *** */
|
|
|
|
|
|
|
|
|
2013-10-02 20:38:45 +02:00
|
|
|
CalibrationRequest::CalibrationRequest(const uint_fast8_t _type):
|
2014-05-13 23:50:53 +02:00
|
|
|
reference_point(nullptr), direction(Direction())
|
2011-03-31 17:08:24 +02:00
|
|
|
{
|
|
|
|
type = _type ;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
CalibrationRequest::
|
|
|
|
CalibrationRequest(const Request &source,
|
2013-10-02 20:38:45 +02:00
|
|
|
ReferencePoint *const _reference_point,
|
2013-06-17 18:52:02 +02:00
|
|
|
const Direction &_direction,
|
2013-10-02 20:38:45 +02:00
|
|
|
const uint_fast8_t _type):
|
2011-03-31 17:08:24 +02:00
|
|
|
Request(source), reference_point(_reference_point),
|
|
|
|
direction(_direction)
|
|
|
|
{
|
|
|
|
type = _type ;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-02-16 19:31:25 +01:00
|
|
|
/* *** Write accessors *** */
|
|
|
|
|
|
|
|
|
2011-06-20 11:43:17 +02:00
|
|
|
void CalibrationRequest::reference_point_delete_requests() const
|
|
|
|
{
|
|
|
|
reference_point->delete_requests() ;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-02-19 11:40:55 +01:00
|
|
|
void CalibrationRequest::reference_point_backward_link() const
|
|
|
|
{
|
|
|
|
reference_point->add_request(this) ;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-02-16 19:31:25 +01:00
|
|
|
void CalibrationRequest::clear()
|
|
|
|
{
|
|
|
|
Request::clear() ;
|
2014-05-13 23:50:53 +02:00
|
|
|
reference_point = nullptr ;
|
2010-02-19 11:40:55 +01:00
|
|
|
direction.clear() ;
|
2010-02-16 19:31:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* *** Operators *** */
|
|
|
|
|
|
|
|
|
2011-07-30 20:38:42 +02:00
|
|
|
CalibrationRequest& CalibrationRequest::
|
|
|
|
operator=(const CalibrationRequest &source)
|
2010-02-16 19:31:25 +01:00
|
|
|
{
|
|
|
|
if (this == &source)
|
|
|
|
return *this ;
|
|
|
|
|
|
|
|
this->Request::operator=(source) ;
|
2010-02-19 11:40:55 +01:00
|
|
|
direction = source.direction ;
|
2010-02-16 19:31:25 +01:00
|
|
|
reference_point = source.reference_point ;
|
|
|
|
|
|
|
|
return *this ;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-07-30 20:38:42 +02:00
|
|
|
bool CalibrationRequest::
|
|
|
|
operator==(const CalibrationRequest &source) const
|
2010-02-16 19:31:25 +01:00
|
|
|
{
|
|
|
|
if (this == &source)
|
|
|
|
return true ;
|
|
|
|
|
|
|
|
return
|
|
|
|
this->Request::operator==(source) &&
|
2010-02-19 11:40:55 +01:00
|
|
|
direction == source.direction &&
|
2010-02-16 19:31:25 +01:00
|
|
|
reference_point == source.reference_point ;
|
|
|
|
}
|