Author Topic: how do I show process/instance GUI?  (Read 4576 times)

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
how do I show process/instance GUI?
« on: 2010 August 20 15:22:20 »

Hi,

as I've commented before I think one of the issues holding back large scale integration of various processes using scripts is the need to replicate their GUIs. Not a big deal for a few buttons but even the BatchDebayer script has a large section dedicated to just presenting the debayer methods and RGB offsets. That's,well, backwards and doesn't scale. In the case of Debayer it could simply be run with the saved defaults but this isn't possible for all modules.

I tried to make my script show the pixelmath dialog before executing it. launch and launchInstance did not do that. Is it possible at all? It would be even better (more useful) if the GUI elements from process could be integrated into a script's GUI. That's probably asking a bit much but still.

Frankly without something like that I don't see anyone spending hours and hours replicating calibration, alignment and stacking parameters into some monster script that should integrate them all. Well, let me be specific. I won't be doing that :)
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: how do I show process/instance GUI?
« Reply #1 on: 2010 August 22 02:49:05 »
Hi Sander,

You're nailing a key topic here. Yes, more interaction between scripts and modules is very necessary at this point. This is in the todo list and will be implemented soon. I have already been working on it, and the solution is closer than it seems (did I say that PI 1.6.1 has many internal new features that still have not been enabled at the user interface level? :) ).

Right now you can do something like this:

Code: [Select]
var p = new PixelMath;
p.launchInterface();
sleep( 5 );

But this is pretty useless because (1) there is no way to replace sleep() with some control code to wait for the interface until it 'finishes', mainly because the interface doesn't work modally, and (2) the instance (p in the example above) isn't modified by the interface being launched.

So what we need is that a script can run a process interface in slave mode. Basically, the process interface will be launched (or relaunched) as a modal window. The best candidate JS method is:

Boolean Instance.launchInterfaceModal( uint32 flags )

where the meaning (or even the existence of) flags is still undefined. Note that this requires changes at the managed interface level, as the current 'Execute = F5' and 'Execute Global = F6' automatically generated features doesn't make sense in slave mode. They will be replaced (in a completely automated way) by more standard 'OK' and 'Cancel' fatures on the interface's control bar. Note also that there will be changes at the PCL level, especially new member functions of the ProcessInterface class. There are also some problematic interactions with PI's workspace but nothing too difficult to solve.

As you may expect, Instance.launchInterfaceModal() returns true if the user selects 'OK' and false otherwise. When true is returned, the calling instance has already been replaced with the newly edited one.

Hopefully this will be reality in 1.6.2 or 1.6.3.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline RobF2

  • PixInsight Addict
  • ***
  • Posts: 189
  • Rob
    • Rob's Astropics
Re: how do I show process/instance GUI?
« Reply #2 on: 2010 August 22 03:12:36 »
Sounds like an exciting development.  Nikolay's work on the blinking script really opened my eyes to what users can contribute to the PI community, and agreed it would be much more enticing for people to write scripts if GUIs could be opened in this manner.  Thanks for explaining how far you've already gone down this road too Juan.

Anything that brings an "autostack" with defaults closer is great, but might even make it straightforward for Nikolay's blink script to do a quick default alignment of images before animation is another thought....
FSQ106/8" Newt on NEQ6/HEQ5Pro via EQMOD | QHY9 | Guiding:  ZS80II/QHY5IIL | Canon 450D | DBK21 and other "stuff"
Rob's Astropics

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Re: how do I show process/instance GUI?
« Reply #3 on: 2010 August 22 07:00:10 »
Thanks for the comments guys. Glad I was on to something.
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