New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce Powershell Script and Config Generator #2
Conversation
Hi Scott, A few questions:
Thanks again! |
ok, one other thing.. and this is a big one.. Would you be opposed to switching this to being all done from inside the Sequencer? The timing could easily be managed there, and then the following could be used to play the sounds:
I'm not sure what using powershell for an entirely parallel execution adds that couldn't be achieved using this approach? Thanks, |
Hi @linuxkidd , These are some great questions and thoughts! Let me put some time into refactoring the logic this week and I'll get back to you with answers and an update. Thanks, |
Hi @linuxkidd , I have thought about this further. I will answer your questions and then I add some thoughts and questions too.
This is a great question. I believe you are correct but there is also an exception. The
Yes this is definitely possible.
With the modification above, the script should pick up where the user left off. Currently the script does loop through playing all of the previous sounds until it reaches the last sound. Right now this isn't ideal as the script hangs slightly in some cases. The change above should fix it this.
I am certainly not opposed to this as I think it could help ease the burden for anyone using this feature. This is where my thoughts and questions originate from.
When I originally started developing this script, I chose to separate it from FireCapture due to minimal amount of functionality the script editor there. I had to run a batch script to trigger the Powershell script. When I ported this over to SharpCap, I used the same thought process because the script was already built. However, your ideas got me thinking and I do have a potential revised approach in mind. Today I was able to create a series of Powershell commands which, when passed to the
For reference, the Sequence Editor documentation states:
To summarize, whatever we end up deciding on, I can work on the following as needed:
Example notification from Powershell: I hope I'm not overthinking this too much. Looking forward to your thoughts. |
The further we get down this ( seaming simple ) path, the more I lean toward using the Python scripting integration in SharpCap instead of the sequencer. There's just so much more control, including options for parallel executions, etc. The downside is... the learning curve and troubleshooting that has to occur in the next few (short) weeks. |
Thanks @linuxkidd ! I know what you mean. Time isn't really on our side right now. Here's what I'm thinking. I'll plan to refactor some of my logic while retaining the Powershell script because I know that is working for me right now. I'll plan to commit some updates here soon. I'll likely keep the I'll also plan to start a new pull request to attempt to have the SharpCap Sequence Generator manage the timing and trigger the alerts. I think it'll be easier for me to manage this in a separate pull request because it's involves a different approach. I'll be in touch! |
- Add section for Powershell script configuration - Add the following Powershell script configuration settings: generate, display windows notifications, sound type - Adjusted Powershell variable names for consistency - Created various Powershell helper functions - Converted sleepUntilandPlaySound() to sleepUntilAndThenTriggerAlert() - sleep, show windows notification, play sound (either TTS or WAV) - Converted all Powershell sound alert details to variables within the Powershell configuration file - Added logic to skip sleeping and playing sound alerts if the timestamp is in the past - Added various information statements to the console during script execution - Updated code formatting and comments
Hi @linuxkidd , I've been working on refactoring my Powershell script logic and I think it's in a pretty good place now. I feel it's more robust and it also gracefully handles restarts. I will be running through some real-world tests today to ensure the alerts are triggered at the proper times. Here's a list of updates since my last commit:
I still need to update the documentation and add logic to save the settings to localStorage/the encoded URL parameters. There is likely a better way to define all of the configuration parameters/variables. I'm open to ideas if you have any. I wanted most everything to be in the config file to allow users to customize to their liking. |
Signed-off-by: Michael J. Kidd <linuxkidd@gmail.com>
Hi @scottsousa Highlights:
Please check the powershell branch. It can be tested using the htmlpreview link I hope you don't mind me mangling your code.. 😁 ToDo:
|
Hi @linuxkidd , Thanks! This is really cool. I don't mind at all. I will plan to review the code changes and test as soon as I have a moment. |
Hi @scottsousa ... another big change! I moved all of the notifications array into the main eclipse script, and configured the script to accept params on the command line. So now, it's fully self contained and just gets called from the sequence with no external config file needed! |
@linuxkidd That's awesome! Great work. Thanks for bringing this to the next level! I will plan to test tonight if possible. I did notice one issue when I pulled the upstream changes to my local computer. Unfortunately the |
Hi @scottsousa , The branch can be tested from a public server here: Once someone has the file saved locally, and/or saves the HTML to launch in their browser, they should already have the powershell script and won't need the link to work then ( at least, that's my expectation ). |
Closing this pr, further updates / discussion via pr #5 |
Signed-off-by: Michael J. Kidd <linuxkidd@gmail.com>
Introduce Powershell Script ( based on pr #2 )
Hi @linuxkidd ,
First of all, I wanted to thank you so much for creating this sequencer! I recently acquired astrophotography gear and I'm getting ready to attempt to view and capture the total solar eclipse in April 2024. Your sequencer has been extremely helpful! Here's a bit of backstory for this pull request.
I'm not sure if you prefer a pull request template, but I'll use the following for now. Let me know if you'd like any additional information or if I can clarify anything.
Description
I originally wrote a script for FireCapture. However, I ran into issues with timing and switched to SharpCap. I found your sequencer at the perfect time.
While I was writing my script for FireCapture, I realized it could run external programs. So I decided to write a separate script which would trigger audible alerts at various times throughout the eclipse. This script was written in Powershell. Though I am a web developer by trade, I am by no means an expert in Powershell. However, I was able to get the script to function to my liking.
After finding your sequencer, I thought it would be a good foundation to help make the Powershell script dynamic. This pull request adds all of the Powershell logic. There is functionality to generate a configuration file for the Powershell script based on the sequencer times. The Powershell script is optional as I realize not everyone may have the capability to hear audio alerts on their devices. A checkbox below the "Generate Sequence" button toggles the Powershell script configuration generation.
All of the Powershell script assets are included in a zip archive for easy downloading by users. There's a button at the top of the sequencer to download the zip archive.
I've included a README in the Powershell script directory with more information, including installation details.
Type of change
Testing
I've tested this alongside my sequencer script a few times now. It does appear to be working as expected. I am planning to test further but I believe it can be considered stable.
Test Configuration:
Checklist