Commit 431a6d49 authored by Malin E's avatar Malin E
Browse files

Rename JWST pointing event to a more general name

parent 1b25e1b0
master content/2012EventProfile feature/WSA feature/arrow-renderable feature/asset-require feature/atmosphere-stars-rendering feature/change-renderbin-runtime feature/compile-times feature/direction-hint-renderable feature/du-meshes-selection feature/gamma-correction feature/geojson feature/getting-started-tour feature/grid-labels feature/grids-update feature/gui-mouseinteraction-fix feature/horizons-unit-tests feature/imageTestKeys2Actions feature/jenkins-fix feature/jenkins-timeout feature/jwst-pointing feature/jwst-trail-update feature/labels-rendering feature/model-opacity feature/molecule_rendering feature/properties-visibility feature/renderable-enabled-event feature/satellites feature/saturn-shepherd-moons feature/skybrowser feature/skybrowser-cleanup feature/skybrowser-drag-and-drop feature/skybrowser-reload feature/spice-update feature/ubuntu2204 feature/userproperties feature/various-changes feature/video-on-globe feature/xbox-update issue/1479 issue/1607 issue/1751 issue/1827 issue/1851 issue/1989 issue/2029 issue/2055 issue/2093 issue/2111 issue/2118 issue/2121 issue/2127 issue/2133 issue/2137 issue/2194 issue/2207 issue/2209 issue/2212 issue/2236 issue/2259 issue/2261 issue/2266 issue/2269 jenkins/2286 project/2021-wisdome-installation project/exoplanet-explorer project/exoplanets-expert-tool rc/0.18.1 thesis/2020/sonification thesis/2022/climate thesis/2022/cosmic-view thesis/2022/fieldline-rendering thesis/2022/software-integration thesis/2022/software-integration_receive-ra-dec thesis/2022/streaming releases/v0.18.0
No related merge requests found
Showing with 23 additions and 22 deletions
+23 -22
......@@ -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;
......
......@@ -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_)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment