[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kstars-devel
Subject:    Re: Segfault on command line generation
From:       Akarsh Simha <akarshsimha () gmail ! com>
Date:       2020-07-06 0:26:34
Message-ID: CA+9k5tzF61wgSjaw-8TTD8xJPfEsZYerdGwoeVpk1T42Dmct_w () mail ! gmail ! com
[Download RAW message or body]

Hi

The syntax `--dump --filename` is incorrect, it should instead be `--dump
<filename>`, e.g.
kstars --dump /tmp/test.png --width 600 --height 400

But this doesn't work as expected at all -- it produces an image with no
stars, only guide lines are shown or something of that sort. I vote for
disabling the `--dump` option and instead providing DBus as the only way to
generate a star map as of now. This is unfortunate, but a fully booted up
KStars is less buggier than a half-booted up KStars. You can also achieve
much more control through DBus than with --dump.

Example (shell script):
qdbus org.kde.kstars /KStars org.kde.kstars.lookTowards "M 31" # Point to M
31
qdbus org.kde.kstars /KStars org.kde.kstars.exportImage /tmp/test.svg 1024
768 false # Write SVG graphic of size 1024x768 without legend

The syntax of exportImage is exportImage(filename, width, height,
includeLegend). The file format is determined from the extension. All
arguments except "filename" are optional. You can see this in kstars.h:417

If you want to control via Python, you can do that too:

dbus = QtDBus.QDBusConnection.sessionBus()


kstars_dbus = QtDBus.QDBusInterface(


    "org.kde.kstars",


    "/KStars",


    "org.kde.kstars",


    dbus


)


assert kstars_dbus is not None


if not kstars_dbus.isValid():


    raise RuntimeError('Could not connect to KStars DBus interface!')





kstars_dbus.call(


    QtDBus.QDBus.AutoDetect, "<method-name>", argument1, argument2, ...


)



A useful way to find out what methods KStars exposes on DBus, is to run on
a terminal:

qdbus org.kde.kstars /KStars

It'll list the signature of all available methods. There are a few other
interfaces, but /KStars is the primary one of most value. If you've set it
up, qdbus has tab completion which is extremely helpful.

Other methods of interest are:
org.kde.kstars.setRaDecJ2000
org.kde.kstars.setApproxFOV

There is a bug with setRaDecJ2000 and setRaDec when atmospheric corrections
are enabled.

Regards
Akarsh

[Attachment #3 (text/html)]

<div dir="ltr"><div>Hi</div><div><br></div><div>The syntax `--dump --filename` is incorrect, it should \
instead be `--dump &lt;filename&gt;`, e.g.<br>kstars --dump /tmp/test.png --width 600 --height \
400<br><br></div><div>But this doesn&#39;t work as expected at all -- it produces an image with no stars, \
only guide lines are shown or something of that sort. I vote for disabling the `--dump` option and \
instead providing DBus as the only way to generate a star map as of now. This is unfortunate, but a fully \
booted up KStars is less buggier than a half-booted up KStars. You can also achieve much more control \
through DBus than with --dump.<br><br></div><div>Example (shell script):<br>qdbus org.kde.kstars /KStars \
org.kde.kstars.lookTowards &quot;M 31&quot; # Point to M 31<br>qdbus org.kde.kstars /KStars \
org.kde.kstars.exportImage /tmp/test.svg 1024 768 false # Write SVG graphic of size 1024x768 without \
legend<br><br></div><div>The syntax of exportImage is exportImage(filename, width, height, \
includeLegend). The file format is determined from the extension. All arguments except \
&quot;filename&quot; are optional. You can see this in kstars.h:417<br><br></div><div>If you want to \
control via Python, you can do that too:<br><br>dbus = QtDBus.QDBusConnection.sessionBus()                \
<br>kstars_dbus = QtDBus.QDBusInterface(                                                                  \
<br>    &quot;org.kde.kstars&quot;,                                                                       \
<br>    &quot;/KStars&quot;,                                                                              \
<br>    &quot;org.kde.kstars&quot;,                                                                       \
<br>    dbus                                                                                              \
<br>)                                                                                                     \
<br>assert kstars_dbus is not None                                                                        \
<br>if not kstars_dbus.isValid():                                                                         \
<br>    raise RuntimeError(&#39;Could not connect to KStars DBus interface!&#39;)                         \
<br>                                                                                                      \
<br>kstars_dbus.call(                                                                                     \
<br>    QtDBus.QDBus.AutoDetect, &quot;&lt;method-name&gt;&quot;, argument1, argument2, ...               \
<br>)                                                                                                     \
</div><div><br></div><div>A useful way to find out what methods KStars exposes on DBus, is to run on a \
terminal:<br><br>qdbus org.kde.kstars /KStars<br><br></div><div>It&#39;ll list the signature of all \
available methods. There are a few other interfaces, but /KStars is the primary one of most value. If \
you&#39;ve set it up, qdbus has tab completion which is extremely helpful.<br><br></div><div>Other \
methods of interest are:<br></div><div>org.kde.kstars.setRaDecJ2000<br></div><div>org.kde.kstars.setApproxFOV<br><br></div><div>There \
is a bug with setRaDecJ2000 and setRaDec when atmospheric corrections are \
enabled.<br></div><div><br></div><div>Regards<br></div><div>Akarsh</div><div><br></div></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic