Public Member Functions

StelMainScriptAPI (QObject *parent=0)

Properties

double

JDay

double

timeSpeed

Detailed Description

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);

Member Function Documentation

void StelMainScriptAPI::setJDay

(

double

JD

)

[slot]

Set the current date in Julian Day.

Parameters:

JD

the Julian Date

double StelMainScriptAPI::getJDay

(

)

const [slot]

Get the current date in Julian Day.

Returns:

the Julian Date

void StelMainScriptAPI::setDate

(

const QString &

dt,

const QString &

spec = "utc"

)

[slot]

set the date in ISO format, e.g.

"2008-03-24T13:21:01"

Parameters:

dt

the date string to use. Formats:

ISO, e.g. "2008-03-24T13:21:01"

"now" (set sim time to real time)

relative, e.g. "+ 4 days", "-2 weeks". can use these units: seconds, minutes, hours, days, weeks, months, years. You may also append " sidereal" to use sidereal days and so on. You can also use "now" at the start. For example: "now + 3 hours sidereal" Note: you must use the plural all the time, even when the number of the unit is 1. i.e. use "+ 1 days" not "+1 day". Note: when sidereal time is used, the length of time for each unit is dependent on the current planet. By contrast when sidereal timeis not specified (i.e. solar time is used) the value is conventional - i.e. 1 day means 1 Earth Solar day.

spec

"local" or "utc" - only has an effect when the ISO date type is used.

QString StelMainScriptAPI::getDate

(

const QString &

spec = "utc"

)

[slot]

get the simulation date and time as a string in ISO format, e.g.

"2008-03-24T13:21:01"

Parameters:

spec

if "utc", the returned string's timezone is UTC, else it is local time.

Returns:

the current simulation time.

void StelMainScriptAPI::setTimeRate

(

double

ts

)

[slot]

Set time speed in JDay/sec.

Parameters:

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.

double StelMainScriptAPI::getTimeRate

(

)

const [slot]

Get simulation time rate.

Returns:

time speed as a multiple of real time.

bool StelMainScriptAPI::isRealTime

(

)

[slot]

Get the simulation time and rate state - is it "real time".

Returns:

true if the time rate is normal, and the simulation time is real time, else return false

void StelMainScriptAPI::setRealTime

(

)

[slot]

Set the simulation time to the current system time, and the time rate to 1.

void StelMainScriptAPI::selectObjectByName

(

const QString &

name,

bool

pointer = false

)

[slot]

Select an object by name.

Parameters:

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

QVariantMap StelMainScriptAPI::getObjectPosition

(

const QString &

name

)

[slot]

Fetch a map with data about an object's position, magnitude and so on.