Exemple #1
0
        public void Process()
        {
            FLBuffer  input            = Root.ActiveBuffer;
            FLProgram externalFunction = ExternalFunctionBlueprint.Initialize(Root.Instance, InstructionSet);

            input.SetRoot(externalFunction);

            externalFunction.ActiveChannels = Root.ActiveChannels;
            externalFunction.SetCLVariables(input, false);

            //Not making it internal to the subscript because that would dispose the buffer later in the method
            //FLProgram.Debugger?.SubProgramStarted(Root, this, externalFunction);
            FLDebuggerHelper.OnSubProgramStart(
                Root,
                new FLDebuggerEvents.SubProgramStartEventArgs(
                    externalFunction,
                    this,
                    externalFunction
                    .EntryPoint,
                    false
                    )
                );

            //FLDebuggerHelper.OnProgramStart(externalFunction, new FLDebuggerEvents.ProgramStartEventArgs(externalFunction, externalFunction.EntryPoint, false, false));

            externalFunction.EntryPoint.Process();

            //FLProgram.Debugger?.SubProgramEnded(Root, externalFunction);
            FLDebuggerHelper.OnSubProgramExit(
                Root,
                new FLDebuggerEvents.SubProgramExitEventArgs(externalFunction, this)
                );

            //FLDebuggerHelper.OnProgramExit(externalFunction, new FLDebuggerEvents.ProgramExitEventArgs(externalFunction, false)); //Fire On Program Exit as External Function as well

            FLBuffer buf = externalFunction.ActiveBuffer;

            buf.SetRoot(Root);
            input.SetRoot(Root);
            externalFunction.RemoveFromSystem(buf);
            externalFunction.RemoveFromSystem(input);

            Root.ActiveChannels = externalFunction.ActiveChannels;
            Root.ActiveBuffer   = buf;


            externalFunction.FreeResources();
        }