Script usage of setUseTopocentricCoordinates()

Asked by Phil Shepherd

I am trying to set/unset the configuration setting "Topocentric Coordinates" within a script, but keep getting an error.

example :

       core.setUseTopocentricCoordinates(true);

In the console, I get the error :

script error: "TypeError: Result of expression 'core.setUseTopocentricCoordinates' [undefined] is not a function." @ line 1

The docs indicate
        void setUseTopocentricCoordinates (bool use)

Am I just being a bit thick or am I missing something?

Thanks,
Phil

Question information

Language:
English Edit question
Status:
Solved
For:
Stellarium Edit question
Assignee:
No assignee Edit question
Solved by:
Phil Shepherd
Solved:
Last query:
Last reply:
Revision history for this message
Alexander Wolf (alexwolf) said :
#1

But this method is not available for scripting: http://stellarium.org/doc/0.18/classStelMainScriptAPI.html

Are you really want to see some new methods in scripting "core"?

Revision history for this message
Phil Shepherd (psjshep) said :
#2

I struggle sometimes to deduce which methods are & are not available for scripting; I think I now get it : StelMainScriptAPI public slots, along with the named classes in the scripting API..

Thanks for clearing up my confusion.

It's not a problem, as I was trying to debug a situation which happens when FishEye projection is on AND Topocentric Coords is NOT enabled... I was merely ensuring the switch was on

As for your question: It would be easier as a scripting programmer to be able to use all the methods documented, but it hasn't been a big problem so far as these sorts of options can always be set in the GUI & saved.

Regards,

Phil

Revision history for this message
gzotti (georg-zotti) said :
#3

It's actually StelMainScriptAPI public slots as "core", and public slots of subclasses of StelModule, plus StelSkyDrawer. StelCore itself is not a StelModule, so its slots are not available for scripting.

See http://stellarium.org/doc/0.18/scripting.html

Revision history for this message
Phil Shepherd (psjshep) said :
#4

Thanks, Georg.. that's what I meant in a clumsy mannor.

Appreciate resposnes, guys

Phil