Stellarium 0.12.3
|
Provide script API for Stellarium global functions. More...
#include <StelMainScriptAPI.hpp>
Public Slots | |
void | setJDay (double JD) |
Set the current date in Julian Day. More... | |
double | getJDay () const |
Get the current date in Julian Day. More... | |
void | setMJDay (double MJD) |
Set the current date in Modified Julian Day. More... | |
double | getMJDay () const |
Get the current date in Modified Julian Day. More... | |
void | setDate (const QString &dt, const QString &spec="utc", const bool &enableDeltaT=true) |
set the date in ISO format, e.g. More... | |
QString | getDate (const QString &spec="utc") |
get the simulation date and time as a string in ISO format, e.g. More... | |
QString | getDeltaT () const |
get the DeltaT for the simulation date and time as a string in HMS format, e.g. More... | |
QString | getDeltaTAlgorithm () const |
get the DeltaT equation name for the simulation date and time as a string More... | |
void | setDeltaTAlgorithm (QString algorithmName) |
set equation of the DeltaT for the simulation date and time More... | |
void | setTimeRate (double ts) |
Set time speed in JDay/sec. More... | |
double | getTimeRate () const |
Get simulation time rate. More... | |
bool | isRealTime () |
Get the simulation time and rate state - is it "real time". More... | |
void | setRealTime () |
Set the simulation time to the current system time, and the time rate to 1. More... | |
void | selectObjectByName (const QString &name, bool pointer=false) |
Select an object by name. More... | |
QVariantMap | getObjectPosition (const QString &name) |
Fetch a map with data about an object's position, magnitude and so on. More... | |
QVariantMap | getObjectInfo (const QString &name) |
Fetch a map with data about an object's position, magnitude and so on. More... | |
QVariantMap | getSelectedObjectInfo () |
Fetch a map with data about an latest selected object's position, magnitude and so on. More... | |
void | clear (const QString &state="natural") |
Clear the display options, setting a "standard" view. More... | |
double | getViewAltitudeAngle () |
Get the current viewing direction altitude angle at center of view. More... | |
double | getViewAzimuthAngle () |
Get the current viewing direction azimuth angle at center of view. More... | |
double | getViewRaAngle () |
Get the current viewing direction Right Ascension at center of view. More... | |
double | getViewDecAngle () |
Get the current viewing direction Declination angle at center of view. More... | |
double | getViewRaJ2000Angle () |
Get the current viewing direction Right Ascension in J2000 frame at center of view. More... | |
double | getViewDecJ2000Angle () |
Get the current viewing direction Declination angle in J2000 frame at center of view. More... | |
void | moveToAltAzi (const QString &alt, const QString &azi, float duration=1.) |
move the current viewing direction to some specified altitude and azimuth angles may be specified in a format recognised by StelUtils::getDecAngle() More... | |
void | moveToRaDec (const QString &ra, const QString &dec, float duration=1.) |
move the current viewing direction to some specified right ascension and declination angles may be specified in a format recognised by StelUtils::getDecAngle() More... | |
void | moveToRaDecJ2000 (const QString &ra, const QString &dec, float duration=1.) |
move the current viewing direction to some specified right ascension and declination in the J2000 frame angles may be specified in a format recognised by StelUtils::getDecAngle() More... | |
void | setObserverLocation (double longitude, double latitude, double altitude, double duration=1., const QString &name="", const QString &planet="") |
Set the observer location. More... | |
void | setObserverLocation (const QString id, float duration=1.) |
Set the location by the name of the location. More... | |
QString | getObserverLocation () |
Get the ID of the current observer location. More... | |
QVariantMap | getObserverLocationInfo () |
Get the info of the current observer location. More... | |
void | screenshot (const QString &prefix, bool invert=false, const QString &dir="") |
Save a screenshot. More... | |
void | setGuiVisible (bool b) |
Show or hide the GUI (toolbars). More... | |
void | setMinFps (float m) |
Set the minimum frames per second. More... | |
float | getMinFps () |
Get the current minimum frames per second. More... | |
void | setMaxFps (float m) |
Set the maximum frames per second. More... | |
float | getMaxFps () |
Get the current maximum frames per second. More... | |
QString | getMountMode () |
Get the mount mode as a string. More... | |
void | setMountMode (const QString &mode) |
Set the mount mode. More... | |
bool | getNightMode () |
Get the current status of Night Mode. More... | |
void | setNightMode (bool b) |
Set the status of Night Mode. More... | |
QString | getProjectionMode () |
Get the current projection mode ID string. More... | |
void | setProjectionMode (const QString &id) |
Set the current projection mode. More... | |
bool | getDiskViewport () |
Get the status of the disk viewport. More... | |
void | setDiskViewport (bool b) |
Set the disk viewport. More... | |
QStringList | getAllSkyCultureIDs () |
Get a list of Sky Culture IDs. More... | |
QString | getSkyCulture () |
Find out the current sky culture. More... | |
void | setSkyCulture (const QString &id) |
Set the current sky culture. More... | |
QString | getSkyCultureName () |
Find out the current sky culture and get it English name. More... | |
QString | getSkyCultureNameI18n () |
Find out the current sky culture and get it localized name. More... | |
bool | getFlagGravityLabels () |
Get the current status of the gravity labels option. More... | |
void | setFlagGravityLabels (bool b) |
Turn on/off gravity labels. More... | |
void | loadSkyImage (const QString &id, const QString &filename, double ra0, double dec0, double ra1, double dec1, double ra2, double dec2, double ra3, double dec3, double minRes=2.5, double maxBright=14, bool visible=true) |
Load an image which will have sky coordinates. More... | |
void | loadSkyImage (const QString &id, const QString &filename, const QString &ra0, const QString &dec0, const QString &ra1, const QString &dec1, const QString &ra2, const QString &dec2, const QString &ra3, const QString &dec3, double minRes=2.5, double maxBright=14, bool visible=true) |
Convenience function which allows the user to provide RA and DEC angles as strings (e.g. More... | |
void | loadSkyImage (const QString &id, const QString &filename, double ra, double dec, double angSize, double rotation, double minRes=2.5, double maxBright=14, bool visible=true) |
Convenience function which allows loading of a sky image based on a central coordinate, angular size and rotation. More... | |
void | loadSkyImage (const QString &id, const QString &filename, const QString &ra, const QString &dec, double angSize, double rotation, double minRes=2.5, double maxBright=14, bool visible=true) |
Convenience function which allows loading of a sky image based on a central coordinate, angular size and rotation. More... | |
void | loadSkyImageAltAz (const QString &id, const QString &filename, double alt0, double azi0, double alt1, double azi1, double alt2, double azi2, double alt3, double azi3, double minRes=2.5, double maxBright=14, bool visible=true) |
Load an image which will have sky coordinates. More... | |
void | loadSkyImageAltAz (const QString &id, const QString &filename, double alt, double azi, double angSize, double rotation, double minRes=2.5, double maxBright=14, bool visible=true) |
Convenience function which allows loading of a sky image based on a central coordinate, angular size and rotation. More... | |
void | removeSkyImage (const QString &id) |
Remove a SkyImage. More... | |
void | loadSound (const QString &filename, const QString &id) |
Load a sound from a file. More... | |
void | playSound (const QString &id) |
Play a sound which has previously been loaded with loadSound. More... | |
void | pauseSound (const QString &id) |
Pause a sound which is playing. More... | |
void | stopSound (const QString &id) |
Stop a sound from playing. More... | |
void | dropSound (const QString &id) |
Drop a sound from memory. More... | |
void | loadVideo (const QString &filename, const QString &id, float x, float y, bool show, float alpha) |
Load a video from a file. More... | |
void | playVideo (const QString &id) |
Play a video which has previously been loaded with loadVideo. More... | |
void | pauseVideo (const QString &id) |
Pause a video which is playing. More... | |
void | stopVideo (const QString &id) |
Stop a video from playing. More... | |
void | dropVideo (const QString &id) |
Drop a video from memory. More... | |
void | seekVideo (const QString &id, qint64 ms) |
Seeks a video to the requested time. More... | |
void | setVideoXY (const QString &id, float x, float y) |
Sets the position of the video widget. More... | |
void | setVideoAlpha (const QString &id, float alpha) |
Set the alpha value of a video when visible. More... | |
void | resizeVideo (const QString &id, float w, float h) |
Resize the video widget to the specified width, height. More... | |
void | showVideo (const QString &id, bool show) |
Set the visibility state of a video. More... | |
int | getScreenWidth () |
Get the screen width in pixels. More... | |
int | getScreenHeight () |
Get the screen height in pixels. More... | |
double | getScriptRate () |
Get the script execution rate as a multiple of normal execution speed. More... | |
void | setScriptRate (double r) |
Set the script execution rate as a multiple of normal execution speed. More... | |
void | pauseScript () |
Pause the currently running script. More... | |
void | setSelectedObjectInfo (const QString &level) |
Set the amount of selected object information to display. More... | |
void | exit () |
Stop the script. More... | |
void | quitStellarium () |
Close Stellarium. More... | |
void | debug (const QString &s) |
print a debugging message to the console More... | |
QString | getAppLanguage () |
Get the current application language. More... | |
void | setAppLanguage (QString langCode) |
Set the current application language. More... | |
QString | getSkyLanguage () |
Get the current sky language. More... | |
void | setSkyLanguage (QString langCode) |
Set the current sky language. More... | |
void | goHome () |
Go to defaults position and direction of view. More... | |
void | setMilkyWayVisible (bool b) |
Show or hide the Milky Way. More... | |
void | setMilkyWayIntensity (double i) |
Set Milky Way intensity. More... | |
double | getMilkyWayIntensity () |
Get Milky Way intensity. More... | |
double | jdFromDateString (const QString &dt, const QString &spec) |
For use in setDate and waitFor For parameter descriptions see setDate(). More... | |
Public Member Functions | |
StelMainScriptAPI (QObject *parent=0) | |
Properties | |
double | JDay |
double | timeSpeed |
Provide script API for Stellarium global functions.
Public slots in this class may be used in Stellarium scripts, and are accessed as member function to the "core" scripting object. Module-specific functions, such as setting and clearing of display flags (e.g. LandscapeMgr::setFlagAtmosphere) can be accessed directly via the scripting object with the class name, e.g. by using the scripting command: LandscapeMgr.setFlagAtmosphere(true);
Definition at line 35 of file StelMainScriptAPI.hpp.
|
slot |
Clear the display options, setting a "standard" view.
Preset states:
state | the name of a preset state. |
|
slot |
print a debugging message to the console
s | the message to be displayed on the console. |
|
slot |
Drop a sound from memory.
You should do this before the end of your script.
id | the identifier used when loadSound was called |
|
slot |
Drop a video from memory.
You should do this before the end of your script.
id | the identifier used when loadVideo was called |
|
slot |
Stop the script.
|
slot |
Get a list of Sky Culture IDs.
|
slot |
Get the current application language.
|
slot |
get the simulation date and time as a string in ISO format, e.g.
"2008-03-24T13:21:01"
spec | if "utc", the returned string's timezone is UTC, else it is local time. |
|
slot |
get the DeltaT for the simulation date and time as a string in HMS format, e.g.
"0h1m68.2s"
|
slot |
get the DeltaT equation name for the simulation date and time as a string
|
slot |
Get the status of the disk viewport.
|
slot |
Get the current status of the gravity labels option.
|
slot |
Get the current date in Julian Day.
|
slot |
Get the current maximum frames per second.
|
slot |
Get Milky Way intensity.
|
slot |
Get the current minimum frames per second.
|
slot |
Get the current date in Modified Julian Day.
|
slot |
Get the mount mode as a string.
|
slot |
Get the current status of Night Mode.
|
slot |
Fetch a map with data about an object's position, magnitude and so on.
name | is the English name of the object for which data will be returned. |
|
slot |
Fetch a map with data about an object's position, magnitude and so on.
name | is the English name of the object for which data will be returned. |
|
slot |
Get the ID of the current observer location.
|
slot |
Get the info of the current observer location.
|
slot |
Get the current projection mode ID string.
|
slot |
Get the screen height in pixels.
|
slot |
Get the screen width in pixels.
|
slot |
Get the script execution rate as a multiple of normal execution speed.
|
slot |
Fetch a map with data about an latest selected object's position, magnitude and so on.
|
slot |
Find out the current sky culture.
|
slot |
Find out the current sky culture and get it English name.
|
slot |
Find out the current sky culture and get it localized name.
|
slot |
Get the current sky language.
|
slot |
Get simulation time rate.
|
slot |
Get the current viewing direction altitude angle at center of view.
|
slot |
Get the current viewing direction azimuth angle at center of view.
|
slot |
Get the current viewing direction Declination angle at center of view.
|
slot |
Get the current viewing direction Declination angle in J2000 frame at center of view.
|
slot |
Get the current viewing direction Right Ascension at center of view.
|
slot |
Get the current viewing direction Right Ascension in J2000 frame at center of view.
|
slot |
Go to defaults position and direction of view.
|
slot |
Get the simulation time and rate state - is it "real time".
|
slot |
For use in setDate and waitFor For parameter descriptions see setDate().
|
slot |
Load an image which will have sky coordinates.
id | a string ID to be used when referring to this image (e.g. when changing the displayed status or deleting it. |
filename | the file name of the image. If a relative path is specified, "scripts/" will be prefixed before the image is searched for using StelFileMgr. |
ra0 | The right ascension of the first corner of the image in degrees |
dec0 | The declination of the first corner of the image in degrees |
ra1 | The right ascension of the second corner of the image in degrees |
dec1 | The declination of the second corner of the image in degrees |
ra2 | The right ascension of the third corner of the image in degrees |
dec2 | The declination of the third corner of the image in degrees |
ra3 | The right ascension of the fourth corner of the image in degrees |
dec3 | The declination of the fourth corner of the image in degrees |
minRes | The minimum resolution setting for the image |
maxBright | The maximum brightness setting for the image |
visible | The initial visibility of the image |
|
slot |
Convenience function which allows the user to provide RA and DEC angles as strings (e.g.
"12d 14m 8s" or "5h 26m 8s" - formats accepted by StelUtils::getDecAngle()).
|
slot |
Convenience function which allows loading of a sky image based on a central coordinate, angular size and rotation.
id | a string ID to be used when referring to this image (e.g. when changing the displayed status or deleting it. |
filename | the file name of the image. If a relative path is specified, "scripts/" will be prefixed before the image is searched for using StelFileMgr. |
ra | The right ascension of the center of the image in J2000 frame degrees |
dec | The declination of the center of the image in J2000 frame degrees |
angSize | The angular size of the image in arc minutes |
rotation | The clockwise rotation angle of the image in degrees |
minRes | The minimum resolution setting for the image |
maxBright | The maximum brightness setting for the image |
visible | The initial visibility of the image |
|
slot |
Convenience function which allows loading of a sky image based on a central coordinate, angular size and rotation.
Parameters are the same as the version of this function which takes double values for the ra and dec, except here text expressions of angles may be used.
|
slot |
Load an image which will have sky coordinates.
id | a string ID to be used when referring to this image (e.g. when changing the displayed status or deleting it. |
filename | the file name of the image. If a relative path is specified, "scripts/" will be prefixed before the image is searched for using StelFileMgr. |
alt0 | The altitude angle of the first corner of the image in degrees |
azi0 | The azimuth angle of the first corner of the image in degrees |
alt1 | The altitude angle of the second corner of the image in degrees |
azi1 | The azimuth angle of the second corner of the image in degrees |
alt2 | The altitude angle of the third corner of the image in degrees |
azi2 | The azimuth angle of the third corner of the image in degrees |
alt3 | The altitude angle of the fourth corner of the image in degrees |
azi3 | The azimuth angle of the fourth corner of the image in degrees |
minRes | The minimum resolution setting for the image |
maxBright | The maximum brightness setting for the image |
visible | The initial visibility of the image |
|
slot |
Convenience function which allows loading of a sky image based on a central coordinate, angular size and rotation.
id | a string ID to be used when referring to this image (e.g. when changing the displayed status or deleting it. |
filename | the file name of the image. If a relative path is specified, "scripts/" will be prefixed before the image is searched for using StelFileMgr. |
alt | The altitude angle of the center of the image in degrees |
azi | The azimuth angle of the center of the image in degrees |
angSize | The angular size of the image in arc minutes |
rotation | The clockwise rotation angle of the image in degrees |
minRes | The minimum resolution setting for the image |
maxBright | The maximum brightness setting for the image |
visible | The initial visibility of the image |
|
slot |
Load a sound from a file.
filename | the name of the file to load. |
id | the identifier which will be used to refer to the sound when calling playSound, pauseSound, stopSound and dropSound. |
|
slot |
Load a video from a file.
filename | the name of the file to load. |
id | the identifier which will be used to refer to the video when calling playVideo, pauseVideo, stopVideo and dropVideo. |
x | the x-coordinate for the video widget. |
y | the y-coordinate for the video widget. |
show | the visibility state for the video. |
alpha | the initial alpha value of the video. |
|
slot |
move the current viewing direction to some specified altitude and azimuth angles may be specified in a format recognised by StelUtils::getDecAngle()
alt | the altitude angle |
azi | the azimuth angle |
duration | the duration of the movement in seconds |
|
slot |
move the current viewing direction to some specified right ascension and declination angles may be specified in a format recognised by StelUtils::getDecAngle()
ra | the right ascension angle |
dec | the declination angle |
duration | the duration of the movement in seconds |
|
slot |
move the current viewing direction to some specified right ascension and declination in the J2000 frame angles may be specified in a format recognised by StelUtils::getDecAngle()
ra | the right ascension angle |
dec | the declination angle |
duration | the duration of the movement in seconds |
|
slot |
Pause the currently running script.
Note that you may need to use the key '6' or the GUI to resume script execution.
|
slot |
Pause a sound which is playing.
Subsequent playSound calls will resume playing from the position in the file when it was paused.
id | the identifier used when loadSound was called |
|
slot |
Pause a video which is playing.
Subsequent playVideo calls will resume playing from the position in the file when it was paused.
id | the identifier used when loadVideo was called |
|
slot |
Play a sound which has previously been loaded with loadSound.
id | the identifier used when loadSound was called |
|
slot |
Play a video which has previously been loaded with loadVideo.
id | the identifier used when loadVideo was called |
|
slot |
Close Stellarium.
|
slot |
Remove a SkyImage.
id | the ID of the image to remove. |
|
slot |
Resize the video widget to the specified width, height.
id | the identifier used when loadVideo was called |
w | the new width for the widget. |
h | the new height for the widget. |
|
slot |
Save a screenshot.
prefix | the prefix for the file name to use |
dir | the path of the directory to save the screenshot in. If none is specified, the default screenshot directory will be used. |
invert | whether colors have to be inverted in the output image |
|
slot |
Seeks a video to the requested time.
id | the identifier used when loadVideo was called |
ms | the time in milliseconds from the start of the media. |
|
slot |
Select an object by name.
name | the name of the object to select (english) If the name is "", any currently selected objects will be de-selected. |
pointer | whether or not to have the selection pointer enabled |
|
slot |
Set the current application language.
langCode | two letter language code, e.g. "en", or "de". |
|
slot |
set the date in ISO format, e.g.
"2008-03-24T13:21:01"
dt | the date string to use. Formats:
|
spec | "local" or "utc" - only has an effect when the ISO date type is used. Defaults to "utc". |
enableDeltaT | is true or false - enable Delta-T correction or not. Defaults to "true". |
|
slot |
set equation of the DeltaT for the simulation date and time
algorithmName | is name of equation, e.g. "WithoutCorrection" or "EspenakMeeus" |
|
slot |
Set the disk viewport.
b | if true, sets the disk viewport on, else sets it off |
|
slot |
Turn on/off gravity labels.
b | if true, turn on gravity labels, else turn them off |
|
slot |
Show or hide the GUI (toolbars).
Note this only applies to GUI plugins which provide the public slot "setGuiVisible(bool)".
b | if true, show the GUI, if false, hide the GUI. |
|
slot |
Set the current date in Julian Day.
JD | the Julian Date |
|
slot |
Set the maximum frames per second.
m | the new maximum fps setting. |
|
slot |
Set Milky Way intensity.
i | value of intensity for the Milky Way |
|
slot |
Show or hide the Milky Way.
b | if true, show the Milky Way, if false, hide the Milky Way. |
|
slot |
Set the minimum frames per second.
Usually this minimum will be switched to after there are no user events for some seconds to save power. However, if can be useful to set this to a high value to improve playing smoothness in scripts.
m | the new minimum fps setting. |
|
slot |
Set the current date in Modified Julian Day.
MJD | the Modified Julian Date |
|
slot |
Set the mount mode.
mode | should be "equatorial" or "azimuthal" |
|
slot |
Set the status of Night Mode.
b | if true, set Night Mode, else set Normal Mode |
|
slot |
Set the observer location.
longitude | the longitude in degrees. E is +ve. values out of the range -180 .. 180 mean that the longitude will not be set |
latitude | the longitude in degrees. N is +ve. values out of the range -180 .. 180 mean that the latitude will not be set |
altitude | the new altitude in meters. values less than -1000 mean the altitude will not be set. |
duration | the time for the transition from the old to the new location. |
name | A name for the location (which will appear in the status bar. |
planet | the English name of the new planet. If the planet name is not known (e.g. ""), the planet will not be set. |
|
slot |
Set the location by the name of the location.
id | the location ID as it would be found in the database of locations - do a search in the Location window to see what where is. e.g. "York, UnitedKingdom". |
duration | the number of seconds to take to move location. |
|
slot |
Set the current projection mode.
id | the name of the projection mode to use, e.g. "Perspective" and so on. valid values of id are:
|
|
slot |
Set the simulation time to the current system time, and the time rate to 1.
|
slot |
Set the script execution rate as a multiple of normal execution speed.
r | the multiple of the normal script execution speed, i.e. if 5 is passed the script will execute 5 times faster than it would if the script rate was 1. |
|
slot |
Set the amount of selected object information to display.
level | can be "AllInfo", "ShortInfo", "None" |
|
slot |
Set the current sky culture.
id | the ID of the sky culture to set, e.g. western or inuit etc. |
|
slot |
Set the current sky language.
langCode | two letter language code, e.g. "en", or "de". |
|
slot |
Set time speed in JDay/sec.
ts | the new rate of passage of time as a multiple of real time. For example if ts is 1, time will pass at the normal rate. If ts == 10 then simulation time will pass at 10 times the normal rate. If ts is negative, simulation time will go backwards. |
|
slot |
Set the alpha value of a video when visible.
id | the identifier used when loadVideo was called |
alpha | the new alpha value to set. |
|
slot |
Sets the position of the video widget.
id | the identifier used when loadVideo was called |
x | the new x-coordinate for the video. |
y | the new y-coordinate for the video. |
|
slot |
Set the visibility state of a video.
id | the identifier used when loadVideo was called |
show | the new visible state of the video. |
|
slot |
Stop a sound from playing.
This resets the position in the sound to the start so that subsequent playSound calls will start from the beginning.
id | the identifier used when loadSound was called |
|
slot |
Stop a video from playing.
This resets the position in the video to the start so that subsequent playVideo calls will start from the beginning.
id | the identifier used when loadVideo was called |