PixInsight Forum (historical)
Software Development => PCL and PJSR Development => Topic started by: georg.viehoever 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
-
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.
-
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 (http://www.pixinsight.com/developer/pcl/doc/html/classpcl_1_1MetaFileFormat.html) describes the functionality of a file format implemented by a PI module.
- FileFormatImplementation (http://www.pixinsight.com/developer/pcl/doc/html/classpcl_1_1FileFormatImplementation.html) implements the functionality of a file format instance (usually a disk file).
- FileFormat (http://www.pixinsight.com/developer/pcl/doc/html/classpcl_1_1FileFormat.html) allows you to access file formats defined by other PI modules.
- FileFormatInstance (http://www.pixinsight.com/developer/pcl/doc/html/classpcl_1_1FileFormatInstance.html) 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 (http://www.pixinsight.com/developer/pcl/doc/html/classpcl_1_1MetaProcess.html) defines the functionality of a process.
- ProcessImplementation (http://www.pixinsight.com/developer/pcl/doc/html/classpcl_1_1ProcessImplementation.html) 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 :)
-
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
-
I already have some ideas for this PI 1.8 functionality.
Out with them, then! :)
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.