Example #1
0
        public ActionProgramRun(ActionFile af,                      // associated file
                                ActionProgram r,                    // the program
                                ConditionVariables iparas,          // input variables to the program only.. not globals
                                ActionRun runner,                   // who is running it..
                                ActionController ed) : base(r.Name) // allow a pause
        {
            actionfile           = af;
            actionrun            = runner;
            actioncontroller     = ed;
            execlevel            = 0;
            execstate[execlevel] = ExecState.On;
            nextstepnumber       = 0;

            System.Diagnostics.Debug.WriteLine("Run " + actionfile.name + "::" + r.Name);
            //ActionData.DumpVars(gvars, " Func Var:");

            inputvars = iparas;             // current vars is set up by ActionRun at the point of invokation to have the latests globals

            List <Action> psteps = new List <Action>();
            Action        ac;

            for (int i = 0; (ac = r.GetStep(i)) != null; i++)
            {
                psteps.Add(Action.CreateCopy(ac));
            }

            programsteps = psteps;
        }
Example #2
0
        public void ReLoad(bool completereload = true)        // COMPLETE reload..
        {
            if (completereload)
            {
                actionfiles = new ActionFileList();     // clear the list
            }
            ErrorList = actionfiles.LoadAllActionFiles(EDDOptions.Instance.ActionsAppDirectory());

            AdditionalChecks(ref ErrorList);

            actionrunasync = new ActionRun(this, actionfiles);        // this is the guy who runs programs asynchronously
        }
Example #3
0
        public void ReLoad(bool completereload = true)        // COMPLETE reload..
        {
            if (completereload)
            {
                actionfiles = new ActionFileList();     // clear the list
            }
            ErrorList = actionfiles.LoadAllActionFiles(AppFolder);

            AdditionalChecks(ref ErrorList);

            actionrunasync = new ActionRun(this, actionfiles);        // this is the guy who runs programs asynchronously
            ActionConfigureKeys();
            VoiceLoadEvents();
        }
Example #4
0
        public void ReLoad(bool completereload = true)        // COMPLETE reload..
        {
            actionfiles?.CloseDown();

            if (completereload)
            {
                actionfiles = new ActionFileList();     // clear the list
            }
            frontierbindings.LoadBindingsFile(System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Frontier Developments", "Elite Dangerous", "Options", "Bindings"), true);

            ErrorList = actionfiles.LoadAllActionFiles(EDDOptions.Instance.ActionsAppDirectory());

            AdditionalChecks(ref ErrorList);

            actionrunasync = new ActionRun(this, actionfiles);        // this is the guy who runs programs asynchronously
        }
Example #5
0
        public void ReLoad(bool completereload = true)         // COMPLETE reload..
        {
            if (completereload)
            {
                actionfiles = new ActionFileList();     // clear the list
            }
            string errlist = actionfiles.LoadAllActionFiles(AppFolder);

            if (errlist.Length > 0)
            {
                ExtendedControls.MessageBoxTheme.Show("Failed to load files\r\n" + errlist, "WARNING!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }

            actionrunasync = new ActionRun(this, actionfiles);        // this is the guy who runs programs asynchronously
            ActionConfigureKeys();
        }
Example #6
0
        // now = true run immediately, else defer to current programs
        public void RunActions(bool now, List <Actions.ActionFileList.MatchingSets> ale, ActionRun run, ConditionVariables inputparas)
        {
            foreach (Actions.ActionFileList.MatchingSets ae in ale)                       // for every file which passed..
            {
                foreach (ConditionLists.Condition fe in ae.passed)                        // and every condition..
                {
                    Tuple <ActionFile, ActionProgram> ap = FindProgram(fe.action, ae.af); // find program using this name, prefer this action file first

                    if (ap != null)                                                       // program got,
                    {
                        ConditionVariables adparas = new ConditionVariables();
                        string             flags;
                        adparas.FromActionDataString(fe.actiondata, out flags);

                        inputparas.Add(adparas);

                        run.Run(now, ap.Item1, ap.Item2, inputparas);
                    }
                }
            }
        }