Passing parameters from Script to Sequence

Discussions on extending SharpCap using the built in Python scripting functionality
Post Reply
User avatar
CarCarlo147
Posts: 32
Joined: Wed Feb 14, 2024 8:12 pm
Location: Ariccia (RM) - Italy
Contact:

Passing parameters from Script to Sequence

#1

Post by CarCarlo147 »

Hi Robion

I'm trying to create a script that with a dialog box allows me to insert parameters (object name, focal length, filter used, etc...) so, I would like to pass them to my sequence created with the "sequence editor".

I know that I can start a sequence from the script in this way:
SharpCap.Sequencer.RunSequence("MySequence")

Carlo
Carlo Mollicone
https://www.astroboh.it/
User avatar
admin
Site Admin
Posts: 17610
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Passing parameters from Script to Sequence

#2

Post by admin »

Hi Carlo,

currently, there isn't any support for variables in sequences, or for passing parameters to a sequence. The workaround for this would be to make a sequence file that is a template with blanks to be filled in (or markers like '%%EXPOSURE%%'). Then you make the python script copy the template to a new sequence file, fill in the templates with the right values and then run the newly created sequence file.

Aside from that approach, there are a few ways you could get info across that are not obvious

*) Set one set of co-ordinates that you want to use as the 'Target' co-ordinates of the mount before running the sequence - the sequence can then use that target
* ) Set camera parameters from script before calling the sequence and then use blocks like 'save the camera settings and restore' to bring them back when needed in the script

cheers,

Robin
Post Reply