question

Martin K5 avatar image
0 Likes"
Martin K5 asked Jeanette F commented

Video recording trigger

Hi,

is it possible to set up a trigger on "On Model Open" which will start the (predefined) Video Recording?

Thank you,

Martin

FlexSim 23.2.3
triggersvideo recordertriggermodel open
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered

You can inspect the structure of the Video Recorder GUI to see that the 'Record' button has something similar to this:

  1. Object vr=Model.find("Tools/VideoRecorder");
  2. treenode outputs = node(">variables/outputs", vr);
  3. clearcontents(getvarnode(vr, "active"));
  4. treenode stopTimes = assertvariable(vr, "stopTimes");
  5. stopTimes.value = nullvar;
  6. for(int r = 1; r <= content(outputs); r++){
  7.         treenode currOutput = rank(outputs, r);
  8.         int active = getnodenum(node("active", currOutput));    
  9.         if(active == 0){  //If this output's not active, we don't care about it.        
  10.             continue;
  11.         }
  12.         // nodepoint(getvarnode(vr, "jobscallback"), node("onStopRecord", eventfunctions(ownerview(c)))); //
  13.         function_s(vr, "GenRecording", VREC_RECMODE_ONE, currOutput);            
  14. }    
  15. sendmessage(vr, vr, VREC_MSG_JOBS_RUN);


You may/not need to set the callback to some dummy node - the line I commented out for now.

5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.