PixInsight Forum (historical)

Software Development => PCL and PJSR Development => Topic started by: georg.viehoever on 2009 June 21 12:47:11

Title: Store PJSR script values across sessions
Post by: georg.viehoever on 2009 June 21 12:47:11
Hi,

has PJSR any tools to store settings between sessions? I would like to store the user's last inputs, and restore them when he/she calls the script the next time. Of course I could write a file, but in this case at least the file name needs to be persistent (if chosen by the user).

Georg
Title: Re: Store PJSR script values across sessions
Post by: Nocturnal on 2009 June 21 16:40:31
Code: [Select]
void DebayerInterface::SaveSettings()
{
Settings::Write(BAYERPATTERN, instance.BayerPattern);
Settings::Write(DEBAYERMETHOD, instance.DebayerMethod);
} // SaveSettings


void DebayerInterface::LoadSettings()
{
pcl_enum tmp;

if (Settings::Read(BAYERPATTERN, tmp))
instance.BayerPattern = tmp;
if (Settings::Read(DEBAYERMETHOD, tmp))
instance.DebayerMethod = tmp;
} // LoadSettings


Hi Georg,

the above is how I do it in PCL. I hope PSJR has a similar facility?
Title: Re: Store PJSR script values across sessions
Post by: georg.viehoever on 2009 June 21 22:33:54
Sander,

yes, PJSR has a "Settings" object! I will give it a try.

Thanks!

Georg
Title: Re: Store PJSR script values across sessions
Post by: Niall Saunders on 2009 June 22 01:55:19
Sorry folks,

If you check my CMYG deBayer PJSR, you'll see that 'settings' was on my outstanding 'ToDo' list. But, Georg,  there is a sample script in one of the 'sticky' sections of the Forum.

Cheers,
Title: Re: Store PJSR script values across sessions
Post by: David Serrano on 2009 June 22 04:54:07
My script MaskedStretchTransform is a user of the Settings object, too.