PJSR scripts modal on purpose?

Nocturnal

Well-known member
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.
 
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.
 
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.
 
Nocturnal said:
...
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 
 
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.
 
Back
Top