Discussion:
[Stellarium-pubdevel] Developping a plugin - where to start?
rusirius
2011-01-04 11:45:21 UTC
Permalink
Hi,

My name is John and I have been a user of Stelarium since version 8.x
and am currently enjoying the latest 10.6 version. I wanted to
contribute something to the project so some time ago I proposed a plugin
(http://www.stellarium.org/wiki/index.php?title=Proposals:Observation_Logger&oldid=10661)
and more recently, I got involved in some translation work.

A few days ago I saw a post on the Forum requesting a GPS plugin. Since
about 12 months ago I coded a GPS utility in Delphi, I wondered whether
I could make this work available to Stellarium. I had a look at the
Plugin Development section and realised this would entail development in
C++. I checked out the source code fort Stellarium and successufully
complied it on both Windows and Linux. I then developped some code for
both Windows and Linux in QT to read the GPS data and deliver the
current location and I am now at the stage where I want to think about
adding this to Stellarium in the form of a plugin. I've revewed the
informaton but I still have questions:

1. Should it be built as a static or dynamic plugin?
2. How do I build the plugin dialogue within Stellarium?
3. Is there an API function that would allow me to pass the GPS
co-ordinate location to Stellarium?
4. Rather than re-inventing something, is it possible to open up the
location dialogue and seed it with the GPS co-ordinates and allow the
user to save this together with their description as a new location?
5. How do you integrate a new plugin into the plugin configuration dialogue?

Any information on the above will be helpful. In the meantime I will
also continue scouring the wiki pages.
Reaves, Timothy
2011-01-04 13:12:45 UTC
Permalink
I'm not sure the WIKI will answer your questions; it'll just be a mater of
you looking at the other plugins to figure it out, with follow-up questions
here, and perhaps in IRC.

1. Dynamic is the default for plugins that are not distributed with the
app. It's also a good way to start, as you can re-compile your plugin
without needing to recompile the app.

2. You don't build it within Stellarium. You build it with Qt Designer.
Look for files ending in .ui for examples.

3. You can set the current location, yes.

4. Yes. However, you would eventually want more than that. A check-box or
something similar to allow the user to state that they want their location
updated via the plugin.

5. If you follow the example of the existing plugins it'll integrate
automatically. The Qt plugin system is used.

If you create a branch in LP, and get some code, some of us would be happy
to give it a test, and look it over. Just let us know.
Post by rusirius
Hi,
My name is John and I have been a user of Stelarium since version 8.x
and am currently enjoying the latest 10.6 version. I wanted to
contribute something to the project so some time ago I proposed a plugin
(
http://www.stellarium.org/wiki/index.php?title=Proposals:Observation_Logger&oldid=10661
)
and more recently, I got involved in some translation work.
A few days ago I saw a post on the Forum requesting a GPS plugin. Since
about 12 months ago I coded a GPS utility in Delphi, I wondered whether
I could make this work available to Stellarium. I had a look at the
Plugin Development section and realised this would entail development in
C++. I checked out the source code fort Stellarium and successufully
complied it on both Windows and Linux. I then developped some code for
both Windows and Linux in QT to read the GPS data and deliver the
current location and I am now at the stage where I want to think about
adding this to Stellarium in the form of a plugin. I've revewed the
1. Should it be built as a static or dynamic plugin?
2. How do I build the plugin dialogue within Stellarium?
3. Is there an API function that would allow me to pass the GPS
co-ordinate location to Stellarium?
4. Rather than re-inventing something, is it possible to open up the
location dialogue and seed it with the GPS co-ordinates and allow the
user to save this together with their description as a new location?
5. How do you integrate a new plugin into the plugin configuration dialogue?
Any information on the above will be helpful. In the meantime I will
also continue scouring the wiki pages.
------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment,
and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Stellarium-pubdevel mailing list
https://lists.sourceforge.net/lists/listinfo/stellarium-pubdevel
rusirius
2011-01-04 13:37:15 UTC
Permalink
Timothy,

Thanks for your e-mail.

Ok, from your comments I note that I should go down the dynamic route
for now. Up until now I've been using QT Creator but I will switch to
Designer to build the dialogues as you suggest. Thanks for confirming
that it is possible to set the current location. I do realise that I
will need more than just opening the location dialogue. I envisaged that
the plugin would open a dialogue that would allow the user to set the
GPS port configuration (port number or device, baud rate, etc). It would
also have a button to set the current location in Stellarium to the GPS
co-ordinates. It would also have a second button to open the location
dialogue to allow the user to save the current GPS co-ordinates as a
location. Of course, the configuration would also have to be saved
somewhere and for this I require advice again. Saved to where? Registry
(unlikely as this is Windows only)? Stand alone INI file? stelarium.ini?
What's the recommended choice?

Once I have a starting dialogue created, I will create a branch in LP as
you suggest.
Post by Reaves, Timothy
I'm not sure the WIKI will answer your questions; it'll just be a
mater of you looking at the other plugins to figure it out, with
follow-up questions here, and perhaps in IRC.
1. Dynamic is the default for plugins that are not distributed with
the app. It's also a good way to start, as you can re-compile your
plugin without needing to recompile the app.
2. You don't build it within Stellarium. You build it with Qt
Designer. Look for files ending in .ui for examples.
3. You can set the current location, yes.
4. Yes. However, you would eventually want more than that. A
check-box or something similar to allow the user to state that they
want their location updated via the plugin.
5. If you follow the example of the existing plugins it'll integrate
automatically. The Qt plugin system is used.
If you create a branch in LP, and get some code, some of us would be
happy to give it a test, and look it over. Just let us know.
Hi,
My name is John and I have been a user of Stelarium since version 8.x
and am currently enjoying the latest 10.6 version. I wanted to
contribute something to the project so some time ago I proposed a plugin
(http://www.stellarium.org/wiki/index.php?title=Proposals:Observation_Logger&oldid=10661
<http://www.stellarium.org/wiki/index.php?title=Proposals:Observation_Logger&oldid=10661>)
and more recently, I got involved in some translation work.
A few days ago I saw a post on the Forum requesting a GPS plugin. Since
about 12 months ago I coded a GPS utility in Delphi, I wondered whether
I could make this work available to Stellarium. I had a look at the
Plugin Development section and realised this would entail
development in
C++. I checked out the source code fort Stellarium and successufully
complied it on both Windows and Linux. I then developped some code for
both Windows and Linux in QT to read the GPS data and deliver the
current location and I am now at the stage where I want to think about
adding this to Stellarium in the form of a plugin. I've revewed the
1. Should it be built as a static or dynamic plugin?
2. How do I build the plugin dialogue within Stellarium?
3. Is there an API function that would allow me to pass the GPS
co-ordinate location to Stellarium?
4. Rather than re-inventing something, is it possible to open up the
location dialogue and seed it with the GPS co-ordinates and allow the
user to save this together with their description as a new location?
5. How do you integrate a new plugin into the plugin configuration dialogue?
Any information on the above will be helpful. In the meantime I will
also continue scouring the wiki pages.
------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database
environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Stellarium-pubdevel mailing list
https://lists.sourceforge.net/lists/listinfo/stellarium-pubdevel
Bogdan Marinov
2011-01-04 15:55:22 UTC
Permalink
Post by rusirius
Timothy,
Thanks for your e-mail.
Ok, from your comments I note that I should go down the dynamic route for
now. Up until now I've been using QT Creator but I will switch to Designer
to build the dialogues as you suggest.
Qt Designer is simply an application for editing Qt's .ui files. Qt
Creator can also open and edit them.

Windows in Stellarium are typically made from an .ui file + a child
class of StelDialog. You can look at the code of any of the existing
windows, or at the simpler code of the ExampleDialog plug-in:
http://www.stellarium.org/doc/head/plugins.html#examplePlugins
Post by rusirius
Thanks for confirming that it is
possible to set the current location.
I think it's just a question of calling the proper API function. See
Stellarium's developer documentation:
http://www.stellarium.org/doc/head/
http://www.stellarium.org/doc/head/classStelLocationMgr.html
http://www.stellarium.org/doc/head/classStelNavigator.html
http://www.stellarium.org/doc/head/classStelLocation.html
Post by rusirius
I do realise that I will need more
than just opening the location dialogue. I envisaged that the plugin would
open a dialogue that would allow the user to set the GPS port configuration
(port number or device, baud rate, etc). It would also have a button to set
the current location in Stellarium to the GPS co-ordinates. It would also
have a second button to open the location dialogue to allow the user to save
the current GPS co-ordinates as a location. Of course, the configuration
would also have to be saved somewhere and for this I require advice again.
Saved to where? Registry (unlikely as this is Windows only)? Stand alone INI
file? stelarium.ini? What's the recommended choice?
Stand-alone plug-ins usually use a configuration file in the directory
where the plug-in is installed.
Most of the static plug-ins for some time now have used a section
named after the plug-in in Stellarium's main configuration file. (Turn
on some of the plug-ins and look at Stellarium's config.ini file -
you'll notice things such as "[Satellites]", etc.)

Regards,
Bogdan Marinov

Loading...