Extensions

Inleiding

Extensies zijn kleine programma’s die toegevoegd kunnen worden om samen te werken met Kstars/Ekos/INDI om extra functies en mogelijkheden te leveren.

Notitie

Extensies zijn gescheiden van Kstars/Ekos/INDI. Ze worden niet geleverd als onderdeel van deze software. Allee als een middel om ze aan te roepen wordt voor het gemak geleverd. Ga na dat u begrijpt wat de vereisten zijn en de risico’s van het gebruik van een extensie.

Vereisten

Elke extensie moet bestaan uit minstens 2 bestanden, met een optioneel derde pictogrambestand.

  • Het programmabestand. Dit is elk uitvoerbaar bestand dat zal draaien op het systeem van de gebruiker. De gebruiker waaronder KStars draait moet uitvoerrechten hebben op dit bestand.

  • Het configuratiebestand. Dit is een gewoon tekstbestand dat de vereiste en optionele invoer voor de extensie definieert. Het moet hetzelfde genaamd zijn als de uitvoerbare bestand met de toevoeging van de bestandsextensie .conf.

It is mandatory that the configuration file contains a line starting with minimum_kstars_version=n.n.n where n.n.n is the lowest version of KStars that supports the extension e.g. 3.7.3

Optionally (and non-preferred) the configuration file may contain a line starting with runDetached=true. If present this line makes the extension run independently from KStars. Once it has been started the extension can not pass status information back to Ekos. This should only be used by extensions that are required to continue to run after KStars has closed. The extension must also provide its own user interface.

Daarnaast kan het configuratiebestand elke andere parameters bevatten die de auteur van de extensie bepaalt en vrije tekst.

  • Het pictogrambestand, indien aanwezig, moet dezelfde naam hebben als het uitvoerbare bestand van de extensie met de toevoeging van de juiste extensie van de bestandsnaam voor het afbeeldingsformaat, .jpg, .bmp, .gif, .png en .svg worden ondersteund. Indien geleverd zal dit pictogram gebruikt worden in de keuzelijst voor de selectie van de extensies. Als er geen pictogram is geleverd zal in plaats daarvan een standaard pictogram worden gebruikt.

All files of the extension (executable, configuration, and optional icon) must be copied into the KStars writable data location /extensions e.g. ~/.local/share/kstars/extensions

Extensions that are present, have a valid configuration file, and have a minimum KStars version no higher than the current installation will be detected when Ekos is started. If there are no valid extensions detected the extension UI element will not be displayed. The extension UI elements are a ComboBox showing the name and icon of each detected extension, and a start/stop button. If the extension fails to close within 10 seconds of the stop button being clicked, it becomes re-enabled as an abort button that will force close the extension. Only one extension can be used at a time.

Ontwikkeling

Het volgende beschrijft extra punten voor ontwikkelaars van extensies.

  • Some extension sources including an example skeleton extension are available in the KStars Extension Github

  • Elke extensie moet controleren op het bestaan en de geldigheid van zijn eigen configuratiebestand. Het item minimum_kstars_version in het configuratiebestand moet gecontroleerd worden tegen een interne referentie om te bevestigen dat het configuratiebestand overeenkomt met de vereisten aan een extensie. Zie het raamwerkvoorbeeld.

  • De versie van het aanroepende KStars wordt doorgegeven aan de extensie als arg(1) in de aanroep bij starten met QProcess.

  • All interaction with KStars/Ekos/INDI should be via the DBus interface. See the skeleton example. Useful tools for interrogating, monitoring and understanding DBus include D-Feet and Bustle

It may appear on initial investigation that using the Qt DBus Adaptors system would be much easier than direct use of the Qt DBus Interfaces/Messages and KStars does provide the required xml definitions. However currently there is heavy use of custom types, the definitions of which are combined with other information in the KStars sources. This results in a large set of files from KStars that require inclusion within an extension in order to make use of the Qt DBus Adaptors. Hopefully this will be addressed in the future.