PixInsight Forum (historical)
Software Development => PCL and PJSR Development => Topic started 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
-
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?
-
Sander,
yes, PJSR has a "Settings" object! I will give it a try.
Thanks!
Georg
-
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,
-
My script MaskedStretchTransform is a user of the Settings object, too.