Script TheSkyX  Version 1.27
Script TheSkyX Documentation

TheSkyX Scriptable Objects

Simple, Reliable, Manipulation of TheSkyX, from within TheSky or Cross-process-same-machine, Cross-machine, Cross-operating Systems

Features

Introduction

TheSkyX offers several useful objects documented here that can be manipulated programmatically. These objects allow a broad range of capabilities from manipulating TheSkyX (for example, Look North), to retrieval of celestial object information (for example, what are the coordinates of the Sun) to device control (for example, slew the mount to M1 and take a photo).

This documentation lists these objects along with their methods (called slots) and their properties. These objects can be called from within TheSkyX (Tools, Run Java Script). In addition these objects can be called externally by using TheSkyX's ability to execute a script passed to it over a socket and returning the result of the script to the client (Tools, TCP server).

Since there is no standardized, cross-platform remote procedure call, and TheSkyX is cross-platform, TheSkyX's native scripting architecture is based upon two standardized, cross-platform technologies, namely sockets and the ECMAScript Language Specification ECMA-262 ECMA-262

Hopefully this flexible scripting architecture will open up uses for TheSkyX in new and exciting ways with the increase its interoperability between processes on the same machine, across machines and operating systems. Some examples to exploit this architecture include running two virtual machines (with differing operating systems where one vm scripts TheSkyX running on the vm) and iOS clients and http clients.

On Windows, TheSkyX can be scripted almost identically as earlier versions of TheSky (that were not cross-platform) through the TheSky6's Object Model. Please note, the objects documented here (all with sky6 prefix) are NOT interface identical to the well established object interfaces of earlier versions of TheSky because qt's implementation of COM does not allow it (on Windows, TheSkyX is a native COM server without ATL, MFC). There is, however, on Windows a TheSkyXAdaptor COM object that when programmed to makes TheSkyX appear identical to TheSky6's object model the only difference being the objects program id. This means TheSkyX is compatible with most every classic Visual Basic Script on Windows provided the corresponding TheSkyXAdaptor program id is used. Under the hood, the TheSkyXAdaptor calls the sky6 objects documented here. In short, we attempted to smooth the transition to TheSkyX on Windows from earlier versions of TheSky while at the same time looking ahead to allow scripting on other operating system and even allow scripting across machines and across operating systems.

TheSkyX Pro can replace or be exchanged for TheSky6 Pro as far as automation is concerned, the only caveat is that controlling programs (clients) need to use TheSkyX Pro's program identifiers (or program ids) in place of TheSky6 Pro's program identifiers. For example, if your existing script or application source code references TheSky6 Pro's StarChart object:

TheSky6.StarChart

In order to use TheSkyX Pro's StarChart object, replace the above syntax with:

TheSkyXAdaptor.StarChart

Your application will now use TheSkyX Professional Edition's StarChart object instead of TheSky6 Pro's StarChart object.

The table below includes a complete list of TheSky6 Pro and TheSkyX Pro program ids.

TheSky6 Pro Program ID Equivalent TheSkyX Pro Program ID
TheSky6.DataWizard TheSkyXAdaptor.DataWizard
TheSky6.MyFOVs TheSkyXAdaptor.MyFOVs
TheSky6.ObjectInformation TheSkyXAdaptor.ObjectInformation
TheSky6.RASCOMTele TheSkyXAdaptor.RASCOMTele
TheSky6.RASCOMTheSky TheSkyXAdaptor.RASCOMTheSky
TheSky6.RASServerApp TheSkyXAdaptor.RASServerApp
TheSky6.Raven TheSkyXAdaptor.Raven
TheSky6.StarChart TheSkyXAdaptor.StarChart
TheSky6.Utils TheSkyXAdaptor.Utils

Here's a specific example of automating TheSkyX vs TheSky6. The Windows-specific Visual Basic (VB) code below shows an example how to use the StarChart object in either TheSky6 Pro or TheSkyX Pro. Note that both applications can be installed and run on the same computer, and both object models can be accessed on a single computer, without issue.

Dim StarChart 'Remove the tic mark below to use TheSky6
'Set StarChart = CreateObject("TheSky6.StarChart")
'The following line will use TheSkyX Pro's StarChart object
Set StarChart = CreateObject("TheSkyXAdaptor.StarChart")

TheSkyX Scripted Camera Control

As of TheSkyX Pro build 6500 and later (released January 16, 2013), TheSkyX's camera control is scriptable, see the ccdsoftCamera and ccdsoftImage objects.

To help ease migration to TheSkyX's native camera control, on Windows, TheSkyX offers a COM adaptor that is interface identical to the well established, ubiquitous, CCDSoft's camera and image object model. This means, any existing, third party (automation) software which leverages CCDSoft for camera control can easily be converted (optionally, if necessary) to use TheSkyX instead for camera control by merely changing the CCDSoft program ids used in their programs, namely:

CCDSoft5 Program ID Equivalent TheSkyX Pro Program ID
CCDSoft.Camera CCDSoft2XAdaptor.ccdsoft5Camera
CCDSoft.Image CCDSoft2XAdaptor.ccdsoft5Image

At this time, the only CCDSoft objects supported in TheSkyX are the camera and image objects, but other CCDSoft objects may be offered in the future based on customer demand.

With scripted camera control, TheSkyX is the most complete observatory control program on the market. TheSkyX Pro represents a single application that can run on either Mac or Windows, with its own cross-platform device driver model, that can not only provide an exciting, easy to use, user interface for interactive control, but also offers a rich scripting object model for camera/focuser/filterwheel/rotator/AO/mount/dome, callable in process or across machine; everything from autofocus, slewing to target, acquiring a long autoguided image, inventorying the light sources on the resultant image, being able compute an astrometric solution, convert from image x,y to ra,dec and vise versa, and so on.

Developer Summary

TheSky6's Object Model documentation applies equally to TheSkyX, provided the TheSkyXAdaptor object is used.

CCDSoft's camera and image object model applies equally to TheSkyX, provided the CCDSoft2XAdaptor object is used (camera and image objects only).

If you new to scripting TheSkyX, use the objects documented under the Modules tab.

If you want to script TheSkyX on Windows staying TheSky5/6 compatible use the above TheSky6's object model along with TheSkyXAdaptor.

If you want to script TheSkyX on Windows staying CCDSoft compatible use the above CCDSoft object model along with CCDSoft2XAdaptor.

If you want to script TheSkyX on Windows using new TheSkyX objects not found in the TheSky6's object model (i.e. those not prefixed with sky6 like the ImageLink object) use Microsoft COM, TheSkyX object model plus TheSky6's object model.

If you want to script TheSkyX on the Mac (or script TheSkyX in a more cross-platform way, for instance you plan to have a Mac/Windows/Linux client that manipulates TheSkyX) use the object model documented here (that is, all objects listed under the Modules tab) along with TheSkyX's ability to execute a script passed to it over a socket.

Included in the "ScriptTheSkyX Examples" referenced in the footer of this page, there is a tcpscriptclient sample application that controls TheSkyX externally by sending scripts over a socket. Both a Windows binary and a Mac binary of the tcpscriptclient is included.

It may turn out that some point in the future, an AppleScript layer on the Mac and or, say a Perl layer on Linux (remember there already is COM interface on Windows) will be created that calls into TheSkyX (via a socket or by operating system specific RPC technologies). In short this would make TheSkyX scriptable using the "favorite" operating-system specific scriptable language. The important point is that this architecture allows for these possibilities and even opens up new, unique possibilities by allowing simple, reliable, cross-machine, cross-operating system scripting. Thank you in advance for you patience as we migrate TheSkyX to cross platform scripting.

The socket scripting architecture discussed above has been in use with TheSkyX and the Seeing in the Dark web site that has served almost 1 million star charts to date.

See also:

Synchronous vs. Asynchronous Execution

Running a Java Script Over a Network Socket

Change log

ScriptTheSkyX Examples
(C) Software Bisque, Inc. All rights reserved.