Program changes subroutine in sequence...Possible?

Questions, tips, information and discussions about using the SharpCap Sequencer and Sequence Planner tools
Post Reply
Jupiter
Posts: 24
Joined: Mon Nov 01, 2021 4:56 pm

Program changes subroutine in sequence...Possible?

#1

Post by Jupiter »

Given that the sequencer can call a program as one of the steps in the sequence, would it be possible for the program that is called to modify a subroutine script that is later called in the sequence? It appears that the sequences and the subroutine are simple text files and could be fairly easily modified programmatically or is something more subtle going on????

If so, while not elegant, it would seem that this could serve as a way to implement a form of conditional or a way to have the sequence interact more fully with the user?

I guess one form of the question is it possible for the sequence to modify, when it is run, a subroutine script later called in the sequence or is the entire sequence, included embedded subroutines in essence "frozen" once the sequence starts?
User avatar
admin
Site Admin
Posts: 13344
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Program changes subroutine in sequence...Possible?

#2

Post by admin »

Hi,

Sequences are effectively frozen once the start running - although you can launch python scripting from within the sequence, there is no way for the python script to reach back into the sequence and change things (I think I am glad about that - the complexities would be horrible!).

You can load subroutines defined in another sequence file at any point in a sequence, but redefining an existing subrouting isn't allowed (actually, SharpCap ignores a redefinition that is identical to the existing definition, but you can't change it).

You could have a script that generated and ran sequencer code on the fly (or created sequencer code from a template by filling in the blanks), possibly in multiple small blocks if that is easiest rather than one big sequence.

cheers,

Robin
Jupiter
Posts: 24
Joined: Mon Nov 01, 2021 4:56 pm

Re: Program changes subroutine in sequence...Possible?

#3

Post by Jupiter »

thanks!
yomamma
Posts: 54
Joined: Wed Mar 01, 2023 4:58 pm

Re: Program changes subroutine in sequence...Possible?

#4

Post by yomamma »

I use the "Run the sequence of steps in <Sequence to run>" to alter the execution of my sequences. I will place this command in my sequence in locations where I might want to do an extra focus or some other routine. The file will be empty to start therefore when executed nothing will be done.
I add or remove code as needed. You can move the mount to a new location and begin imaging without having to stop the sequence, or inject a focus if your normal focus has not been able to run for some reason. There are a lot uses for this and once I got used to it I make changes on the fly and the night goes much more smoothly and I can tweek things for the better.
Post Reply