mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-11 22:10:07 -05:00
Rename JWST pointing event to a more general name
This commit is contained in:
@@ -73,7 +73,7 @@ struct Event {
|
||||
LayerAdded,
|
||||
LayerRemoved,
|
||||
SessionRecordingPlayback,
|
||||
PointJwstRequested,
|
||||
PointSpacecraft,
|
||||
Custom
|
||||
};
|
||||
constexpr explicit Event(Type type_) : type(type_) {}
|
||||
@@ -378,19 +378,20 @@ struct EventSessionRecordingPlayback : public Event {
|
||||
};
|
||||
|
||||
/**
|
||||
* This event is created when a request for pointing the JWST model to a Ra Dec coordinate
|
||||
* in the sky is issued. The event contains information about the sky coordinate to point
|
||||
* the JWST towards and an optional argument for the duration it should do the pointing.
|
||||
* This event is created when a request for pointing a spacecraft towards a Ra Dec
|
||||
* coordinate in the sky is issued. The event contains information about the sky
|
||||
* coordinate to point the spacecraft towards, and an optional argument for the duration
|
||||
* it should do the pointing.
|
||||
*
|
||||
* \param Ra The Ra part of the sky coordinate in decimal degrees to point the JWST to
|
||||
* \param Dec The Dec part of the sky coordinate in decimal degrees to point the JWST to
|
||||
* \param Ra The Ra part of the sky coordinate in decimal degrees to point towards
|
||||
* \param Dec The Dec part of the sky coordinate in decimal degrees to point towards
|
||||
* \param Duration The duration of time in seconds that the telescope should redirect
|
||||
* itself to the coordinate. Default is 3 seconds
|
||||
*/
|
||||
struct EventPointJwstRequested : public Event {
|
||||
static const Type Type = Event::Type::PointJwstRequested;
|
||||
struct EventPointSpacecraft : public Event {
|
||||
static const Type Type = Event::Type::PointSpacecraft;
|
||||
|
||||
EventPointJwstRequested(double ra_, double dec_, double duration_ = 3.0);
|
||||
EventPointSpacecraft(double ra_, double dec_, double duration_ = 3.0);
|
||||
const double ra;
|
||||
const double dec;
|
||||
const double duration;
|
||||
|
||||
+13
-13
@@ -171,10 +171,10 @@ void log(int i, const EventSessionRecordingPlayback& e) {
|
||||
LINFO(fmt::format("[{}] SessionRecordingPlayback: {}", i, state));
|
||||
}
|
||||
|
||||
void log(int i, const EventPointJwstRequested& e) {
|
||||
ghoul_assert(e.type == EventPointJwstRequested::Type, "Wrong type");
|
||||
void log(int i, const EventPointSpacecraft& e) {
|
||||
ghoul_assert(e.type == EventPointSpacecraft::Type, "Wrong type");
|
||||
LINFO(fmt::format(
|
||||
"[{}] PointJwstRequested: Ra: {}, Dec: {}, Duration: {}", i, e.ra, e.dec,
|
||||
"[{}] PointSpacecraft: Ra: {}, Dec: {}, Duration: {}", i, e.ra, e.dec,
|
||||
e.duration
|
||||
));
|
||||
}
|
||||
@@ -203,7 +203,7 @@ std::string_view toString(Event::Type type) {
|
||||
case Event::Type::LayerAdded: return "LayerAdded";
|
||||
case Event::Type::LayerRemoved: return "LayerRemoved";
|
||||
case Event::Type::SessionRecordingPlayback: return "SessionRecordingPlayback";
|
||||
case Event::Type::PointJwstRequested: return "PointJwstRequested";
|
||||
case Event::Type::PointSpacecraft: return "PointSpacecraft";
|
||||
case Event::Type::Custom: return "Custom";
|
||||
default:
|
||||
throw ghoul::MissingCaseException();
|
||||
@@ -259,8 +259,8 @@ Event::Type fromString(std::string_view str) {
|
||||
else if (str == "SessionRecordingPlayback") {
|
||||
return Event::Type::SessionRecordingPlayback;
|
||||
}
|
||||
else if (str == "PointJwstRequested") {
|
||||
return Event::Type::PointJwstRequested;
|
||||
else if (str == "PointSpacecraft") {
|
||||
return Event::Type::PointSpacecraft;
|
||||
}
|
||||
else if (str == "Custom") {
|
||||
return Event::Type::Custom;
|
||||
@@ -423,10 +423,10 @@ ghoul::Dictionary toParameter(const Event& e) {
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case Event::Type::PointJwstRequested:
|
||||
d.setValue("Ra", static_cast<const EventPointJwstRequested&>(e).ra);
|
||||
d.setValue("Dec", static_cast<const EventPointJwstRequested&>(e).dec);
|
||||
d.setValue("Duration", static_cast<const EventPointJwstRequested&>(e).duration);
|
||||
case Event::Type::PointSpacecraft:
|
||||
d.setValue("Ra", static_cast<const EventPointSpacecraft&>(e).ra);
|
||||
d.setValue("Dec", static_cast<const EventPointSpacecraft&>(e).dec);
|
||||
d.setValue("Duration", static_cast<const EventPointSpacecraft&>(e).duration);
|
||||
break;
|
||||
case Event::Type::Custom:
|
||||
d.setValue(
|
||||
@@ -494,8 +494,8 @@ void logAllEvents(const Event* e) {
|
||||
case Event::Type::SessionRecordingPlayback:
|
||||
log(i, *static_cast<const EventSessionRecordingPlayback*>(e));
|
||||
break;
|
||||
case Event::Type::PointJwstRequested:
|
||||
log(i, *static_cast<const EventPointJwstRequested*>(e));
|
||||
case Event::Type::PointSpacecraft:
|
||||
log(i, *static_cast<const EventPointSpacecraft*>(e));
|
||||
break;
|
||||
case Event::Type::Custom:
|
||||
log(i, *static_cast<const CustomEvent*>(e));
|
||||
@@ -609,7 +609,7 @@ EventSessionRecordingPlayback::EventSessionRecordingPlayback(State state_)
|
||||
, state(state_)
|
||||
{}
|
||||
|
||||
EventPointJwstRequested::EventPointJwstRequested(double ra_, double dec_, double duration_)
|
||||
EventPointSpacecraft::EventPointSpacecraft(double ra_, double dec_, double duration_)
|
||||
: Event(Type)
|
||||
, ra(ra_)
|
||||
, dec(dec_)
|
||||
|
||||
Reference in New Issue
Block a user