Author Topic: PJSR scripts modal on purpose?  (Read 5178 times)

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
PJSR scripts modal on purpose?
« on: 2010 July 27 17:59:37 »

Hi,

I have to admit I don't use scripts too often but I tried the BasicCCDParameters and noticed the dialog is modal. For the uninitiated this means that while the dialog is still up nothing else can be done with PI. This seems rather restrictive. Why can't I have the script dialog 'up' with the parameters from the dialog visible as I work with other processes?

As an aside the script estimated my full well to be over 100K while it's only around 25K. Not sure what that's about.
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: PJSR scripts modal on purpose?
« Reply #1 on: 2010 July 29 12:34:58 »
Hi Sander,

Unfortunately, scripts are modal by nature in PixInsight. For a number of critical reasons, script execution has to block the Core application. This means that you can't run a script and continue interacting with the application as if nothing were happening. This level of integration, which is naturally achieved with PCL-based modules, is simply impossible with scripts right now (and will probably continue that way in the foreseeable future). This is the reason why you can only create dialogs in PJSR (the Dialog object and descendants), not generic top-level windows.

But don't let this limitation stop you. JavaScript scripts are extremely powerful and in many cases are the best way to implement specific tasks that aren't available as standard tools, such as batch procedures. And you can do a lot of sophisticated things by just invoking processEvents(), as Nikolay and Georg have demonstrated with their respective Animation and CanonBandingReduction scripts.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Re: PJSR scripts modal on purpose?
« Reply #2 on: 2010 July 29 12:57:21 »
Hi Juan,

thanks for that explanation. Certainly scripts are still useful but it's an important limitation to keep in mind when deciding PCL vs. PJSR.
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 georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
Re: PJSR scripts modal on purpose?
« Reply #3 on: 2010 September 13 11:22:21 »
...
As an aside the script estimated my full well to be over 100K while it's only around 25K. Not sure what that's about.

Oops, did not realize this was my script....

I tried to implement the formulas as I understood them from HAIP. I have never had the opportunity to verify the script (see http://pixinsight.com/forum/index.php?topic=1235.msg6137#msg6137). It is very well possible that I got something wrong. The compute engine (class CcdParamsEngine) is 300 lines of very basic PJSR, so feel free to compare the results to your reference and see where it differs.
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: PJSR scripts modal on purpose?
« Reply #4 on: 2010 September 13 11:24:49 »
Well if I ever have a few hours to spare I'll do that :) I have AIP4WIN so I'll start by running the frames through that first.
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