Author Topic: PCL Introspection  (Read 4163 times)

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
PCL Introspection
« on: 2012 August 15 11:16:42 »
Hi,

a question, probably to Juan: since PCL modules invest a lot of effort to declare the module/process properties, I wondered if it is possible to query the interfaces of other processes from within modules (aka External Objects in the Script Editors browser). Is it possible to call modules from modules (my guess: No). Is it possible to do introspection on the Core JavaScript objects from within a module? Will both be possible in future PCL versions?

Georg
Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Re: PCL Introspection
« Reply #1 on: 2012 August 15 11:25:19 »
When I was contemplating writing a PCL image stacking module I'm pretty sure I ran into the issue that a module can not instantiate another module. It's been a while so maybe I don't remember correctly.

Ideally you should be able to give a module a parent window which will cause the module to be rendered inside that window. You can then build aggregate modules.
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: PCL Introspection
« Reply #2 on: 2012 August 16 07:14:32 »
Quote
Is it possible to call modules from modules

So far intermodule communication isn't possible for processes, but it will be implemented in PI 1.8. Note that this is already possible for format support modules with the following PCL classes:

- MetaFileFormat describes the functionality of a file format implemented by a PI module.

- FileFormatImplementation implements the functionality of a file format instance (usually a disk file).

- FileFormat allows you to access file formats defined by other PI modules.

- FileFormatInstance allows you to instantiate any installed file format (basically open, read, create and write image files).

So we have a server side (MetaFileFormat, FileFormatImplementation) and a client side (FileFormat, FileFormatInstance) for file formats. Currently we only have a server side for processes:

- MetaProcess defines the functionality of a process.

- ProcessImplementation defines the functionality and properties of a process instance.

So we lack the client side of processes, i.e. the Process and ProcessInstance classes, which are already implemented as JavaScript objects in PJSR. Both PCL classes will be available in PI 1.8.

Communication with process interfaces, in the sense of making a process interface a child of another control, is a much more complex topic. Note that this is not possible even with PJSR. While I am conscious of the fact that having this functionality would be very desirable, I am still considering what might be the best way to implement it. Process interfaces are rather complex and making them more flexible involves redesigning some aspects of PI's workspace that are not trivial. Let's face one problem at a time :)

Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
Re: PCL Introspection
« Reply #3 on: 2012 August 16 08:39:25 »
Hi Juan,

this sound great! I already have some ideas for this PI 1.8 functionality.

...Communication with process interfaces, in the sense of making a process interface a child of another control, is a much more complex topic....

This means the Process GUI, right? I can imagine that is difficult. For the moment I could live without this, but having it later would indeed be nice.

Georg
Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: PCL Introspection
« Reply #4 on: 2012 August 16 12:51:46 »
Quote
I already have some ideas for this PI 1.8 functionality.

Out with them, then! :)

Quote
For the moment I could live without this, but having it later would indeed be nice.

By design, all process interfaces are non-modal in PI. If we could launch a process interface programmatically as a modal window (like a dialog for example), then it could be used as a 'slave' of another interface. This should work equally well for both scripts (which can only use modal dialogs) and PCL-based modules. Not an easy task, but I'll think on how we could get it working as soon as possible in some 1.8.x version. This would extend PI's development capabilities significantly.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/