Example #1
0
        public FLProgramCheckBuilder(
            FLInstructionSet iset, BufferCreator bc,
            FLProgramCheckType profile = FLProgramCheckType.InputValidation)
        {
            StartProfile  = profile;
            ProgramChecks = new List <FLProgramCheck>();


            ProgramChecks.Sort((x, y) => y.Priority.CompareTo(x.Priority));
            InstructionSet = iset;
            BufferCreator  = bc;
            PluginManager.LoadPlugins(this);
        }
Example #2
0
        public static void InitializeFL(bool noDialogs, FLProgramCheckType checkType)
        {
            NoDialogs = noDialogs;
            int maxTasks = 6;

            Logger.Log(LogType.Log, "Initializing FS", 1);
            PrepareFileSystem();

            SetProgress("Initializing Logging System", 0, 1, maxTasks);
            Debug.DefaultInitialization();

            SetProgress("Initializing Resource System", 0, 2, maxTasks);
            InitializeResourceSystem();

            SetProgress("Initializing Plugin System", 0, 3, maxTasks);
            InitializePluginSystem();

            PluginManager.LoadPlugins(Host);

            SetProgress("Running Custom Actions", 0, 4, maxTasks);
            CustomStartupActions?.Invoke();

            SetProgress("Initializing FL", 0, 5, maxTasks);
            Container = InitializeCLKernels("resources/kernel");

            FLProgramCheckBuilder builder =
                FLProgramCheckBuilder.CreateDefaultCheckBuilder(
                    Container.InstructionSet,
                    Container.BufferCreator,
                    checkType
                    );

            Container.SetCheckBuilder(builder);

            SetProgress("Finished", 0, 6, maxTasks);
        }
Example #3
0
        public void Run(string[] args)
        {
            Debug.OnConfigCreate += ProjectDebugConfig_OnConfigCreate;

            AbstractCommand.MIN_COMMAND_SEVERITY = 0;

            Runner r = new Runner();

            r._AddCommand(
                new SetDataCommand(
                    s => NoDialog = true,
                    new[] { "--yes" },
                    "Answer all dialogs with Yes"
                    )
                );
            r._AddCommand(
                new SetDataCommand(
                    strings => Verbosity = int.Parse(strings.First()),
                    new[] { "--verbosity", "-v" },
                    "The Verbosity Level (lower = less logs)"
                    )
                );
            r._AddCommand(
                new SetDataCommand(
                    strings => CheckTypes =
                        (FLProgramCheckType)Enum.Parse(
                            typeof(FLProgramCheckType),
                            strings.First(),
                            true
                            ),
                    new[] { "--checks", "-checks" },
                    $"Program Check Profile. (Available: {Enum.GetNames(typeof(FLProgramCheckType)).Unpack(", ")})"
                    )
                );
            r._AddCommand(new DefaultHelpCommand(true));
            AddCommands(r);

            Debug.DefaultInitialization();
            r._RunCommands(args);
            if (AbortRun)
            {
                Console.ReadLine();
                return;
            }

            foreach (KeyValuePair <IProjectDebugConfig, List <ADLLogger> > keyValuePair in ADLLogger.GetReadOnlyLoggerMap()
                     )
            {
                keyValuePair.Key.SetMinSeverity(Verbosity);
            }

            OpenFLDebugConfig.Settings.SetMinSeverity(Verbosity);

            FLData.InitializeFL(NoDialog, CheckTypes);

            BeforeRun();

            DoRun(args);

            AfterRun();

            Debug.OnConfigCreate -= ProjectDebugConfig_OnConfigCreate;
        }
Example #4
0
 public static FLProgramCheckBuilder CreateDefaultCheckBuilder(
     FLInstructionSet iset, BufferCreator bc,
     FLProgramCheckType profile = FLProgramCheckType.InputValidation)
 {
     return(new FLProgramCheckBuilder(iset, bc, profile));
 }