Author Topic: Javascript Documentation  (Read 5529 times)

Offline Bob Andersson

  • Member
  • *
  • Posts: 67
Javascript Documentation
« on: 2012 December 28 04:25:22 »
Hi folks,

Having decided to develop a Script (ref: my post True Colours) code examples from other scripts make the process of creating a suitable Dialog Box seems straightforward enough but I'm struggling with the current lack of documentation for other stuff. Page PixInsight JavaScript Runtime (PJSR) is listed as "Under Construction".

Did that happen when v1.8 was "released"? If so what is the anticipated time before documentation is restored?

I can probably make some educated guesses about some of the script Methods and Properties by referring to the PCL documentation but that's time consuming and may be error prone. Even something as simple as using Image.getPixels is frustrating as things stand. I'd guess I need to set a selection but even how to do that isn't clear to me as there is no "Image.setRectSelection" method to complement the Image.resetRectSelection method.

Can anyone point me to some documentation please. Even if it will change when v1.8 is released it will be better than nothing. Thanks.

Bob.
TEC 140 'scope, FLI ML16803 camera, ASA DDM60 Pro mount.

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
Re: Javascript Documentation
« Reply #1 on: 2012 December 28 04:42:39 »
The answer is simple: there is no dedicated PJSR documentation-there never was. Best approach is to have a look at the existing scripts in the scripts directory. The context help in the PJSR explorer helps to see which params are requested, but what exactly they do needs an educated guess. Sometimes, the PCL documentation also helps. In doubt, post a message in the forum.
Georg
Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)

Offline Bob Andersson

  • Member
  • *
  • Posts: 67
Re: Javascript Documentation
« Reply #2 on: 2012 December 28 04:59:01 »
Thanks Georg. Frustrating but I have to remind myself that the extensibility that PI offers is a wonderful resource.

Bob.
TEC 140 'scope, FLI ML16803 camera, ASA DDM60 Pro mount.

Offline bitli

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 513
Re: Javascript Documentation
« Reply #3 on: 2012 December 28 09:16:05 »
The state of the documentation is really a PITA, as the object do not specify details on the returned value, error conditions and so on.

For built-in objects it may help looking at the Javascript standard and look if the object do not appear to be present. For example JSON make its apparition in 1.8 but is not in the list of objects.

It sometimes help to look at the PCL documentation or source - and sometime not.

Also for the UI stuff, the QT doc may (or may not) give some hints.

In general it is safer to work by cut and paste, especially with the UI components.

It is quite easy to crash PI with an error in Javascript (at least as soon as you do non trivial stuff). So it is better to save your work before testing a script.

Otherwise it is quite a power tool...

-- bitli

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: Javascript Documentation
« Reply #4 on: 2012 December 29 03:24:58 »
Quote
The state of the documentation is really a PITA

I am building the foundations for a PJSR reference documentation system in PI 1.8. Take a look at the Object Explorer window. Right now it generates lists of properties and methods automatically because there are no object-specific documents, but almost all of the necessary resources are already implemented. A new PJSRDocument PIDoc document class is being defined formally.

PJSR documentation will grow quickly, since most of PCL documentation (which is now reasonably complete) can be reused. Just have a bit of patience; this is the work of a single man. And of course don't hesitate to ask on this forum.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Bob Andersson

  • Member
  • *
  • Posts: 67
Re: Javascript Documentation
« Reply #5 on: 2012 December 29 06:46:21 »
Hi Juan,

That's great news and thanks for stopping by in this thread and sharing. I held back from installing 1.8 RC1 as I generally don't install release candidates these days but maybe I'll make an exception (no pun intended) with RC2.

Slightly early but may I wish you a very Happy New Year.

Bob.
TEC 140 'scope, FLI ML16803 camera, ASA DDM60 Pro mount.

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: Javascript Documentation
« Reply #6 on: 2012 December 31 05:45:41 »
We'll release RC2 in a couple days. It should be very stable after all the nice support and help we have been getting for RC1. Hopefully we'll be able to start producing PJSR documentation in February.

Happy New Year to you too!
Juan Conejero
PixInsight Development Team
http://pixinsight.com/