Goto spacecraft

Description

Celestia's navigation function has an awkward quality. It will happily: show the label of, 'select' and 'goto' objects that aren't really there; simply because the current time of the simulation clock is outside the object's timeline. It won't even show the object's timeline in the info text or anywhere else on the screen. This particularly relates to spacecrafts, since those are among the few Celestia object types that actually do have a timeline. This script is designed to overcome that shortcoming but only for spacecrafts.

The script extends the default Celestia "Goto"; it Reacts to [Shift] + [G] and shows a message and a menu íf the currently selected object is a spacecraft and íf the current simulation time is outside the spacecrafts lifetime. The menu allows to:

B - set the clock to the beginning of the crafts lifetime
- and set the direction of the clock to forward
M - set the clock in the middle of the crafts lifetime
- do not change the direction of the clock
E - set the clock to the end of the crafts lifetime
- and set the direction of the clock to backward
N - set the clock to "now" (is the current system time)
- only when "now" is within the craft's lifetime
- do not change the direction of the clock
P - show a menu to select a specific phase
- a submenu then allows to set the clock to the beginning, middle or end of the chosen phase
- only if a craft has more than 1 phase specified
- allows max 9 phases per object to keep the state machine from becomming too complex for a script

If the selected object is not a spacecraft or the current simulation time is within the lifetime of the currently selected craft, the script reverts to Celestia's default Goto function. The same happens when the object has no lifetime specified; i.e. both begin- and endtime are reported by celestia as -infinity and +infinity respectively (like for the spacecrafts: Integral and Chandra X-Ray Observatory).

Pressing any other key then B, M, etc. will set the menu state machine back to it's default state. This excludes keys like "escape", F1 => F12, Up, Down, etc. These keys do not seem to be reported to the script by celestia's keyeventhandler().

The script also reacts to: [Shift] + [B], [Shift] + [M], [Shift] + [N], [Shift] + [E] and [Shift] + [P]. These act as shortcuts into the Goto menu for a currently selected spacecraft, but they also work when the simulation clock is within the spacecraft's lifetime.

Remarks:

    • if a begin- or end time is +infinity or -infinity, the menu option in question is disabled as is the "middle" option.
    • only travels (uses the goto function) when the target object's centre is further away from the observer then 10* the target object's radius
    • except for the Begin and End options, only those menu options are shown that are applicable

Downloads

Installation and use

Installation

    1. Unzip and copy "goto_sp_v21.celx" to your Celestia\scripts folder.

Use

    1. Start Celestia and choose "File/Scripts/Goto for spacecrafts" from the menubar. Or choose "File/Open Script...", navigate to your scripts folder, select "goto_sp.celx" and choose "Open". The script will confirm it's running status by printing "Spacecraft goto is active" onscreen.
    2. Select a spacecraft like the MIR that doesn't exist anymore, press [Shift] + [G] and follow the onscreen messages.
    3. Once a spacecraft is selected, you can also use [Shift] + [B], etc. as a shortcut into the menu.

Remarks

    • Celestia can only run 1 script at a time. When you execute a second script, you will have to 'restart' goto for spacecrafts again.

History

Version 2.1, 17 apr 2011

- Changed:

    • Changed menu display time:
    • now stays on screen for max 60 seconds
    • Changed the way the menu prints:
    • time elements now print in 2 positions
    • Changed the menu layout:
    • some cosmetic changes
    • Corrected an error that caused "mid timespan" to print as "mid lifetime"

Version 2, 16 jan 2011

- Added:

Menuoptions:

M = Middle of lifetime or timespan

N = Now (systemtime)

- Changed:

    • Replaced the use of celestia:goto() by celestia:gotodistance(). Goes to a distance of 7 times the object's radius from the objects centre, whereas the goto() seems to default to 5 times the radius.
    • Now only travels (uses gotodistance()) when at the start the observer is further away from the object's centre then 10* it's radius. Otherwise it confines to (re)setting the simulation clock.
    • Added some ui reportings, like for infinite lifetimes
    • Corrected error with phases and infinity

Version 1, 13 jan 2011

Initial version