2012-01-07 23:26:33 +00:00
|
|
|
#ifndef DECAYEDEXCEPTION_H_
|
|
|
|
#define DECAYEDEXCEPTION_H_
|
|
|
|
|
2012-10-11 18:52:51 +00:00
|
|
|
#include "DateTime.h"
|
2012-01-07 23:26:33 +00:00
|
|
|
#include "Vector.h"
|
|
|
|
|
2012-10-24 17:01:17 +00:00
|
|
|
#include <exception>
|
|
|
|
|
2012-10-25 19:40:47 +00:00
|
|
|
/**
|
|
|
|
* @brief The exception that the SGP4 class throws when a satellite decays.
|
|
|
|
*/
|
2012-01-07 23:26:33 +00:00
|
|
|
class DecayedException : public std::exception
|
|
|
|
{
|
|
|
|
public:
|
2012-10-11 18:52:51 +00:00
|
|
|
/**
|
|
|
|
* Constructor
|
|
|
|
* @param[in] dt time of the event
|
|
|
|
* @param[in] pos position of the satellite at dt
|
|
|
|
* @param[in] vel velocity of the satellite at dt
|
|
|
|
*/
|
|
|
|
DecayedException(const DateTime& dt, const Vector& pos, const Vector& vel)
|
2012-01-07 23:26:33 +00:00
|
|
|
: _dt(dt), _pos(pos), _vel(vel)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-10-11 18:52:51 +00:00
|
|
|
/**
|
|
|
|
* Destructor
|
|
|
|
*/
|
2012-01-07 23:26:33 +00:00
|
|
|
virtual ~DecayedException(void) throw ()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-10-11 18:52:51 +00:00
|
|
|
/**
|
|
|
|
* @returns the error string
|
|
|
|
*/
|
2012-01-07 23:26:33 +00:00
|
|
|
virtual const char* what() const throw ()
|
|
|
|
{
|
|
|
|
return "Error: Satellite decayed";
|
|
|
|
}
|
|
|
|
|
2012-10-11 18:52:51 +00:00
|
|
|
/**
|
|
|
|
* @returns the date
|
|
|
|
*/
|
2012-10-24 17:01:17 +00:00
|
|
|
DateTime Decayed() const
|
2012-01-07 23:26:33 +00:00
|
|
|
{
|
|
|
|
return _dt;
|
|
|
|
}
|
|
|
|
|
2012-10-11 18:52:51 +00:00
|
|
|
/**
|
|
|
|
* @returns the position
|
|
|
|
*/
|
2012-10-24 17:01:17 +00:00
|
|
|
Vector Position() const
|
2012-01-07 23:26:33 +00:00
|
|
|
{
|
|
|
|
return _pos;
|
|
|
|
}
|
|
|
|
|
2012-10-11 18:52:51 +00:00
|
|
|
/**
|
|
|
|
* @returns the velocity
|
|
|
|
*/
|
2012-10-24 17:01:17 +00:00
|
|
|
Vector Velocity() const
|
2012-01-07 23:26:33 +00:00
|
|
|
{
|
|
|
|
return _vel;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
2012-10-11 18:52:51 +00:00
|
|
|
DateTime _dt;
|
2012-01-07 23:26:33 +00:00
|
|
|
Vector _pos;
|
|
|
|
Vector _vel;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|