[ANSWERED] Periodically refreshing the Javascript actor
-
Hello!
I am pulling gps data from a Tile, and using that data to drive some LED lighting units. My setup is complete and functional, and here is the signal path:
-Tile Data to Webpage spreadsheet
-Webpage spreadsheet to local Script File, on show computer. Queried / refreshed every 15 minutes.
-Script File is referenced in the Izzy JavaScript actor, with 16 outputs (4 channels per light) (no inputs in Izzy). The correct data shows up here but not automatically (my issue!)
-DMX data sent from JS Actor to Matrix Value Send actor and DX - DMX Universe Enttec Compatible. This is functioning.
So basically the Tile GPS Data uploads to a script on my computer every 15 minutes. This is working well, but the JavaScript actor receives the updated info only AFTER / Upon scene enter, which is true according to the tutorial as well. I am looking for a workaround - a way for the updated script data to be updated in the JS actor automatically every time the file itself updates, WITHOUT having to exit the scene and re-enter (which results in DMX data-loss and a slight dip in the light intensity.)
I tried placing a "Jump to Cue" actor and entered the current Q# but that didn't work. The only way I've found so far is to create a duplicate scene and toggle between them every 15 minutes. But this results in the lights dipping slightly which is what I want to avoid.
I tried a periodic trigger to but that didn't work either.
Any ideas? My programmer is saying maybe he could instruct the PHP to create a NEW script file each time its queried every 15 minutes, which may result in Isadora having to re-load the file which would refresh the data, i suppose. He is working on that but I wanted to poll the forum and see if there were any results in Izzy.
Here is a screenshot of the Izzy patch and of the functioning java code editor which is accessed by double-clicking the JS Actor.
-
@fug1t1v said:
aScript actor, with 16 o
Can you place the JS actor inside a user actor and have an on/off toggle that you can trigger as you need? I used this method for a time of day actor that would only refresh the hours/day/moth at the respective intervals.
-
@lpmode said:
Can you place the JS actor inside a user actor and have an on/off toggle that you can trigger as you need?
This is an excellent suggestion.
User Actor On/Off Example File
Another way would be to put it and its related actors in a background Scene, then use the Activate/Deactivate Scene actors to deactivate then reactivate the Scene to re-up the Javascript actor at a chosen interval.
JS Background Scene Example File
Best wishes,
Woland
-
@fug1t1v said:
But this results in the lights dipping slightly which is what I want to avoid.
Both my methods above would probably do this, so here's two more possible solutions to try:
OPTION 1
Add an input on the JS actor that's just doing simple math (input +1) and spitting that out to another output. When this input changes it should cause the rest of the code to run too (I think). P.S. I know the code I wrote here doesn't work properly. I don't know JS so I don't know how to make it spit out an array that's:
Outputs 1-16 = your values
Output 17 = Input 1 + 1
I'll leave that to you.Prelim JS Refresh Example File
OPTION 2
Instead of using JS to read a script, write your data to a simple .txt file and use a Data Array actor to read it, because that's easy to re-trigger. (Put both the Isadora file and the .txt file on your desktop, in the same folder, or give the Data Array actor the full file path to the text file.)
Best wishes,
Woland
-
The placement of your include means that function is only called the first run, after than only the Main() function is called.
I am not sure what your locationData.js file contains, but if its something that can be read inline with the rest of the script, you can move that include inside your Main() function.
If the data is not JS (maybe is JSON, or plain text) you can use read().Easiest fix or what you have already is the User Actor On/Off for sure though.
-
Thanks all!
Creating the basic operation 0+1 as an extra input / output didn't work. It didn't force the script to run again, based on what I could see.
User actor on/off DID work! But it still caused a data loss / light dip. So, i took the matrix value send (which is the source of the DMX data) OUT of the User Actor, so that it wasn't also being toggled on / off with each cycle. Just had to make 16 User Outputs in the user actor, but I actually prefer this because I can have my own lables such as "Light 1 Hue..." etc. These connect to the values in the Matrix Value Send which lives in the main scene. Problem solved! Now have lossless light change with real time updating.
Thanks again for all the help! I will try the other solutions in due time but for now, we install this week so glad to have the problem fixed, even if its a little bit of a roundabout.