Author Topic: Store PJSR script values across sessions  (Read 5999 times)

Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
Store PJSR script values across sessions
« 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
Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Re: Store PJSR script values across sessions
« Reply #1 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?
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: Store PJSR script values across sessions
« Reply #2 on: 2009 June 21 22:33:54 »
Sander,

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

Thanks!

Georg
Georg (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)

Offline Niall Saunders

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1456
  • We have cookies? Where ?
Re: Store PJSR script values across sessions
« Reply #3 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,
Cheers,
Niall Saunders
Clinterty Observatories
Aberdeen, UK

Altair Astro GSO 10" f/8 Ritchey Chrétien CF OTA on EQ8 mount with homebrew 3D Balance and Pier
Moonfish ED80 APO & Celestron Omni XLT 120
QHY10 CCD & QHY5L-II Colour
9mm TS-OAG and Meade DSI-IIC

Offline David Serrano

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 503
Re: Store PJSR script values across sessions
« Reply #4 on: 2009 June 22 04:54:07 »
My script MaskedStretchTransform is a user of the Settings object, too.
--
 David Serrano