Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
OpenSpace
Commits
431a6d49
Commit
431a6d49
authored
3 years ago
by
Malin E
Browse files
Options
Download
Email Patches
Plain Diff
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
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/openspace/events/event.h
+10
-9
include/openspace/events/event.h
src/events/event.cpp
+13
-13
src/events/event.cpp
with
23 additions
and
22 deletions
+23
-22
include/openspace/events/event.h
+
10
-
9
View file @
431a6d49
...
...
@@ -73,7 +73,7 @@ struct Event {
LayerAdded
,
LayerRemoved
,
SessionRecordingPlayback
,
Point
JwstRequested
,
Point
Spacecraft
,
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 t
he JWST to
* \param Dec The Dec part of the sky coordinate in decimal degrees to point t
he JWST to
* \param Ra The Ra part of the sky coordinate in decimal degrees to point t
owards
* \param Dec The Dec part of the sky coordinate in decimal degrees to point t
owards
* \param Duration The duration of time in seconds that the telescope should redirect
* itself to the coordinate. Default is 3 seconds
*/
struct
EventPoint
JwstRequested
:
public
Event
{
static
const
Type
Type
=
Event
::
Type
::
Point
JwstRequested
;
struct
EventPoint
Spacecraft
:
public
Event
{
static
const
Type
Type
=
Event
::
Type
::
Point
Spacecraft
;
EventPoint
JwstRequested
(
double
ra_
,
double
dec_
,
double
duration_
=
3.0
);
EventPoint
Spacecraft
(
double
ra_
,
double
dec_
,
double
duration_
=
3.0
);
const
double
ra
;
const
double
dec
;
const
double
duration
;
...
...
This diff is collapsed.
Click to expand it.
src/events/event.cpp
+
13
-
13
View file @
431a6d49
...
...
@@ -171,10 +171,10 @@ void log(int i, const EventSessionRecordingPlayback& e) {
LINFO
(
fmt
::
format
(
"[{}] SessionRecordingPlayback: {}"
,
i
,
state
));
}
void
log
(
int
i
,
const
EventPoint
JwstRequested
&
e
)
{
ghoul_assert
(
e
.
type
==
EventPoint
JwstRequested
::
Type
,
"Wrong type"
);
void
log
(
int
i
,
const
EventPoint
Spacecraft
&
e
)
{
ghoul_assert
(
e
.
type
==
EventPoint
Spacecraft
::
Type
,
"Wrong type"
);
LINFO
(
fmt
::
format
(
"[{}] Point
JwstRequested
: Ra: {}, Dec: {}, Duration: {}"
,
i
,
e
.
ra
,
e
.
dec
,
"[{}] Point
Spacecraft
: 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
::
Point
JwstRequested
:
return
"Point
JwstRequested
"
;
case
Event
::
Type
::
Point
Spacecraft
:
return
"Point
Spacecraft
"
;
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
==
"Point
JwstRequested
"
)
{
return
Event
::
Type
::
Point
JwstRequested
;
else
if
(
str
==
"Point
Spacecraft
"
)
{
return
Event
::
Type
::
Point
Spacecraft
;
}
else
if
(
str
==
"Custom"
)
{
return
Event
::
Type
::
Custom
;
...
...
@@ -423,10 +423,10 @@ ghoul::Dictionary toParameter(const Event& e) {
break
;
}
break
;
case
Event
::
Type
::
Point
JwstRequested
:
d
.
setValue
(
"Ra"
,
static_cast
<
const
EventPoint
JwstRequested
&>
(
e
).
ra
);
d
.
setValue
(
"Dec"
,
static_cast
<
const
EventPoint
JwstRequested
&>
(
e
).
dec
);
d
.
setValue
(
"Duration"
,
static_cast
<
const
EventPoint
JwstRequested
&>
(
e
).
duration
);
case
Event
::
Type
::
Point
Spacecraft
:
d
.
setValue
(
"Ra"
,
static_cast
<
const
EventPoint
Spacecraft
&>
(
e
).
ra
);
d
.
setValue
(
"Dec"
,
static_cast
<
const
EventPoint
Spacecraft
&>
(
e
).
dec
);
d
.
setValue
(
"Duration"
,
static_cast
<
const
EventPoint
Spacecraft
&>
(
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
::
Point
JwstRequested
:
log
(
i
,
*
static_cast
<
const
EventPoint
JwstRequested
*>
(
e
));
case
Event
::
Type
::
Point
Spacecraft
:
log
(
i
,
*
static_cast
<
const
EventPoint
Spacecraft
*>
(
e
));
break
;
case
Event
::
Type
::
Custom
:
log
(
i
,
*
static_cast
<
const
CustomEvent
*>
(
e
));
...
...
@@ -609,7 +609,7 @@ EventSessionRecordingPlayback::EventSessionRecordingPlayback(State state_)
,
state
(
state_
)
{}
EventPoint
JwstRequested
::
EventPointJwstRequested
(
double
ra_
,
double
dec_
,
double
duration_
)
EventPoint
Spacecraft
::
EventPointSpacecraft
(
double
ra_
,
double
dec_
,
double
duration_
)
:
Event
(
Type
)
,
ra
(
ra_
)
,
dec
(
dec_
)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help