[Application] Xplanet with custom Frontend/Launcher (released)

Discussion in 'DragonBox Coding Compo 2012/2013' started by F_Slim, Jan 5, 2013.

  1. F_Slim

    F_Slim IDDQD

    Joined:
    Feb 13, 2011
    Messages:
    986
    Location:
    Germany
    Hi there,
     
    finally, after one week of agony I can give you a beta-version B)
    (everything was working as it should, until I packed it up as PND ... then suddenly NOTHING worked anymore, and it took me forever to (hopefully) fix everything and make it work again ... I was close to giving up to be honest)
     
    Xplanet is an advanced version of Xearth. You can use it to render pictures of the earth or any planet of our solar-system including their moons and/or the sun. The idea is that you run it in the background, and your Desktop-Wallpaper is updated almost in realtime, showing eg. a picture of the earth as seen from space right now.
    In a way you can see it as a geeky desktop clock/calendar, since the shadow gives you a pretty good idea of the current time and season ^_^
    You can also display the image in a window or just save it.
    For more information check the Xplanet webpage:
    http://xplanet.sourceforge.net/
    Here is a nice gallery:
    http://xplanet.sourceforge.net/Gallery/
     
    The way it works is that Xplanet renders an image which can be displayed, so don't expect any real-time animations like with Celestia!
    Remember that a day has 24 hours and it takes the moon about a month to complete his orbit (in other words: things move quite slow anyway). You'll probably get most out of it by running it in desktop mode over an entire day.
     
    A few instructions:

    • To run Xplanet press the "Run Xplanet"-toggle button, to stop press it again. (If you run Xplanet in the window and just close the Xplanet-window, the frontend will still be locked as Xplanet is still running. In this case just press the toggle-button again). When you Quit the frontend, Xplanet is automatically stopped. You can minimize the frontend to the system tray by clicking on the [x]-button in the top-right corner.
    • On quit the current settings will be saved and automatically restored the next time you start xplanet. You can also save or load settings, or revert back to the default settings.
    • Xplanet comes with night and day textures for earth. These are shipped with the .PND. If you want textures for other bodies you have to download them and put them in .../appdata/xplanet/images/
      Please refer to the xplanet webpage for possible download-locations. You can also override the standard earth images by putting new ones into the -images folder (named earth.jpg and night.jpg) or by making your own config file.
    • You can download the daily cloud-file directly from within the frontend by clicking on the "update clouds" button. For this to work you have to be connected before you start the frontend. Watch the status-bar, it may stop downloading before the download is done. If you are connected and still get an Error-message chances are that the download is currently unavailable (seems to happen frequently), try again later.
    • For the clouds to actually show up you have to use a different config file. Type

      -config overlay_clouds
      in the "Additional command line options"-field.
    • Put your own config files into "config" subfolder in the appdata folder (look inside for a few sample config files that come with Xplanet).
    • Via the About button you also have access to the Xplanet README files, explaining all parameters and config-files. Note that not all parameters are covered with the available buttons (hence the "Additional command line options"-field, which can also be used to override settings given with the frontend).
    Known limitations:
    GIF and SPICE support are missing
    Update desktop wallpaper only works with XFCE

    Screenshots:
    shot1.png shot2.png shot3.png shot4.png
     
    Get it while it's hot!
    http://repo.openpandora.org/?page=detail&app=xplanet.fs.000

     
    For completeness my original first post in the spoiler:

    Hi there,
     
    ok, I will make absolutely no promises if I'm going to make the deadline or not ... or if I'm going to finish the project at all actually (depends on general feedback I guess) ;)
    I ported Xplanet to the Pandora and I'm currently writing a small Frontend for it.
     
    Xplanet is an advanced version of Xearth. You can use it to render pictures of the earth or any planet of our solar-system including their moons and/or the sun. The idea is that you run it in the background, and your Desktop-Wallpaper is updated almost in realtime, showing eg. a picture of the earth as seen from space right now.
    You can also display the image in a window or just save it.
    For more information check the Xplanet webpage:
    http://xplanet.sourceforge.net/
    Here is a nice gallery:
    http://xplanet.sourceforge.net/Gallery/
     
    The plan for the Frontend is to enable you to set some of the basic command-line options, specify a custom config-file and add additional command-options in a text-box. Maybe also a button to download the daily cloud-map, but no promises. With a toggle-button you can start/stop rendering images. The Frontend will be written in Python.
    I only know some very basic Python, and this is the first time I'm writing a GUI.
     
    Progress so far:
    - managed to build Xplanet on the Pandora, but missing support for .GIF images and SPICE.
    - managed to replace/update the Desktop wallpaper
    - started with the Frontend, managed to toggle Xplanet rendering with a button.
     
    Not sure if this will be used by anyone at all, since usually you just power up your unit, do something and put it back to sleep, while this program is most usefull when you sit in front of the screen all day (working) and from time to time see the the earth rotate over the day.
    One might use it as a replacement for Celestia in window-mode, but it is probably too cumbersome to use with the config-file and command-line options. There is a timeshift-option to get some "action", but a simple image with just one body takes around 6 seconds to render. And it gets worse when there are more bodies to render of course.
     
    So yeah, no idea why I'm doing this  :p   ... probably because I always liked to have some kind of Xearth/Xplanet-clone running on my desktop ... it is the first time I managed to build something on the Pandora which is actually usable ... and I always wanted to start writing a GUI in Python.
     
    Last edited by a moderator: Feb 14, 2013
    Tags:
    porg likes this.
  2. ptitSeb

    ptitSeb Serial Porter

    Joined:
    Aug 15, 2012
    Messages:
    8,408
    Location:
    France, near Lyon
    Looks cool !
     
  3. Linux-SWAT

    Linux-SWAT Hardcore Member

    Joined:
    Feb 13, 2010
    Messages:
    8,199
    Nice !

    But isn't the earth supposed to be plane ?
     
  4. b_o_b

    b_o_b Advanced Member

    Joined:
    Sep 7, 2010
    Messages:
    1,316
  5. F_Slim

    F_Slim IDDQD

    Joined:
    Feb 13, 2011
    Messages:
    986
    Location:
    Germany
    You can chose different projections, including several "flat" ones. One is called "ancient", probably that's what you're looking for :D

    @b_o_b: that's an awsome video you found there!!

    EDIT: Above all my main concern at the moment is to make the frontend fool-proof ... so you can't exit it and accidently leave Xplanet running in the background updating the wallpaper every xx seconds ... after that I'll start adding different options to it.
     
    Last edited by a moderator: Jan 5, 2013
  6. F_Slim

    F_Slim IDDQD

    Joined:
    Feb 13, 2011
    Messages:
    986
    Location:
    Germany
    This turns out to be real hard work :p

    Spend most of the day figuring out a "give me the full path if you want it to work"-problem. The UI is progressing nicely, several functions are already working. I need to figure out a better way to pass all the button-events to the function which in the end runs Xplanet though ... well, not really, but I guess I should.

    Main problem I have right now is to figure out why the window takes up more space than it should. Probably because of some size or spacing definitions of the boxes(?)

    But I can already change the size of the rendered image, interval between renderings and switch between window and desktop mode. Also close/quit also terminates Xplanet in the background.

    If the frontend should somehow crash I guess it would still keep Xplanet in the background ... no idea how to prevent this. I hope that killing the .PND would also kill Xplanet as a last resort ... does anybody know?

    ToDo:

    - still a lot of missing settings/some settings not yet hardwired

    - implement save settings and restore defaults

    - minimize to tray (still have to figure out if and how this will work)

    - package it all up including all dependencies :blink:

    Would you prefer to automatically restore the last settings, be able to save and restore current settings or both?
     
  7. _wb_

    _wb_ Microbe Staff Member

    Joined:
    Apr 5, 2012
    Messages:
    5,387
    Location:
    Brussels, Belgium
    I would probably _want_ to keep it running even after I exit the frontend. However, I don't want to have it spending cpu time updating my wallpaper while the lid of my Pandora is closed.

    Maybe we need to make something like /etc/pandora/lid_closed/ and ...lid_opened/ folders, containing scripts that are automatically called whenever the lid is closed or opened. If that existed, you could just add a script to kill/start xplanet in those folders.
     
  8. F_Slim

    F_Slim IDDQD

    Joined:
    Feb 13, 2011
    Messages:
    986
    Location:
    Germany
    I think Xplanet comes with an option to sleep when the screen is inactive for xx minutes ... no idea if it works on the Pandora though (updating the wallpaper also only works by doing it manually, although it should do it automatically). Have to test this.

    It would of course be possible to close the frontend and keep Xplanet running, but then you will not be able to stop Xplanet! And I wouldn't know how to catch it again with the frontend the way I am doing things now. That is why I hope I can get it to minimize to the tray, then it's separated from the normal tasks in the taskbar and can easily be brought up again to make changes or quit.
     
  9. Linux-SWAT

    Linux-SWAT Hardcore Member

    Joined:
    Feb 13, 2010
    Messages:
    8,199
    Suggested something like that, more ppl back up plz ^^:

    http://boards.openpandora.org/index.php/topic/10374-superzaxxon-v152-released/?p=199332
     
    Last edited by a moderator: Feb 6, 2016
  10. F_Slim

    F_Slim IDDQD

    Joined:
    Feb 13, 2011
    Messages:
    986
    Location:
    Germany
    A small update and some screenshots.
    The frontend is coming along nicely. Apart from the "save/load" and "about" buttons it is already fully functional. Unless there are requests there are no more features to be added (you can always add or override options using the textbox).
    About downloading the daily cloudmap I'm not sure yet. If I do it, it would just be a button that calls wget, and I don't know yet how to make this foolproof (eg. how can I check if Wifi is on and you're connected to the internet?) ... also it would be nice to have some kind of status window where you can see if it is downloading or when it is finished ...
    Loading and saving is still going to take me a lot of time to implement I guess.
     
    There is one big problem: sometimes updating the desktop background randomly stops working, and I have not been able to figure out exactly why. Also currently the background image is saved to the SD-card. When you remove the card and rebott, there will be no desktop-wallpaper, which is not a problem. But it seems this is one of the things that break updating the wallaper from the command-line then :unsure:
    Any experts around who know how to deal with this properly? With Google I only found the solution I'm using, which is obviously not very robust:


    #/bin/bash
    xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-path -s /media/<SD-card>/<path>/bg.jpg


    One more minor issue: when pressing the "Run Xplanet" button and you run Xplanet in a window, you can close the window (instead of pressing the toggle button again to stop Xplanet) and the frontend thinks it is still running ... I currently don't see how I can prevent this though. It's a minor issue anyway, you just have to untoggle the toggle button befor you can toggle it again.

    Anyway, 3 screenshots below, showing Xplanet running in a window, on the desktop and the current frontend:

    130112-150842.png 130112-151041.png 130112-151054.png
     
    Last edited by a moderator: Jan 12, 2013
  11. ptitSeb

    ptitSeb Serial Porter

    Joined:
    Aug 15, 2012
    Messages:
    8,408
    Location:
    France, near Lyon
    Yeah, that's promising !
     
  12. sswam

    sswam Advanced Member

    Joined:
    Dec 16, 2009
    Messages:
    1,392
    Looking good, I love Celestia and this looks similar, will be a sweet app to show off :)
     
    Last edited by a moderator: Jan 16, 2013
  13. F_Slim

    F_Slim IDDQD

    Joined:
    Feb 13, 2011
    Messages:
    986
    Location:
    Germany
    I'm slowly getting there ... the frontend is almost finished, and I think I managed to solve the problem updating the desktop-wallpaper. Definetly more testing is needed though.

    Still need to re-build Xplanet and figure out how to get all dependencies together to pack it all up into one nice .PND, which I will put up for beta-testing. (Not sure when I'll find the time to do that).

    No new screenshots, sorry.
     
  14. Askarus

    Askarus Hardcore Member

    Joined:
    Sep 28, 2011
    Messages:
    4,296
    Location:
    Germany
    What about the CPU usage.

    Won't it drain lots of battery if desktop background is updated every x-seconds?

    Looks nice.
     
    Last edited by a moderator: Jan 20, 2013
  15. F_Slim

    F_Slim IDDQD

    Joined:
    Feb 13, 2011
    Messages:
    986
    Location:
    Germany
    Updating the wallpaper shouldn't do much, but rendering the picture needs a lot of CPU. In normal use you would only update the wallpaper every x minutes and not every xx seconds anyway though, so I guess it won't be noticable ...

    which reminds me: still need to test the behaviour when in suspend-mode and automatically stop rendering when the screen is off (not updated) ...
     
  16. Askarus

    Askarus Hardcore Member

    Joined:
    Sep 28, 2011
    Messages:
    4,296
    Location:
    Germany
    I see.

    So no real time movie in the background :) .
     
  17. F_Slim

    F_Slim IDDQD

    Joined:
    Feb 13, 2011
    Messages:
    986
    Location:
    Germany
    No, it just displays freshly rendered still-images. Rendering time depends on the contents, just the earth with clouds takes around 7 seconds. Jupiter with several moons will take longer. The minimum interval for images I allow in my frontend is thus 10 seconds. Doesn't really make sense to use less (although you can override any setting from the frontend by manually entering it into the text-field, so you can give -wait 1 and it will render the next image as soon as it's done with the current one).

    Things move relatively slow though, so you won't notice much difference between images at timescales of a few seconds anyway (unless you choose random positions, fly along a path or speed up time, but the original idea of Xearth was to display the earth as seen from space on your desktop in "realtime").
     
    Last edited by a moderator: Jan 21, 2013
  18. Askarus

    Askarus Hardcore Member

    Joined:
    Sep 28, 2011
    Messages:
    4,296
    Location:
    Germany
    Nice.

    So do I need internet connection and get some pictures taken directly from space?
     
  19. _wb_

    _wb_ Microbe Staff Member

    Joined:
    Apr 5, 2012
    Messages:
    5,387
    Location:
    Brussels, Belgium
    No, the pictures are based on static pictures of the earth (optionally with dynamic cloud maps on top of them), rendered in the astronomically correct constellation. So it basically has satellite images of "earth by day" and "earth by night", and it will mix them correctly according to the current time. What you get is not an actual picture, but it would be very close to how an actual picture would look. Actual pictures would be impossible in general, because 1) bandwidth, and 2) there are no satellites available for any arbitrary point in space. Internet connection is not needed, unless you want the optional clouds.
     
  20. mcobit

    mcobit Advanced Member

    Joined:
    Jul 28, 2008
    Messages:
    6,755
    So would this rendering take cputime from other applications? I guess a lot of people won't run it when an emulator is stufferi because this renders and changes the desktop in the background.


    A way to suspend it while other applications are running would be good.
     

Share This Page

Loading...