Exemple #1
0
 public void SetValue(CompilerData.CompileCategory category, uint input)
 {
     if ((int)category < (int)CompilerData.CompileThresholds.Display)
     {
         values[(int)category] = input;
     }
 }
Exemple #2
0
        public static string GetHeaderStr(CompilerData.CompileCategory category)
        {
            switch (category)
            {
            case CompilerData.CompileCategory.ExecuteCompiler: return("Duration");

            default: return(CompileScore.Common.UIConverters.ToSentenceCase(category.ToString()));
            }
        }
Exemple #3
0
 public TimelineNode(string label, uint start, uint duration, CompilerData.CompileCategory category, object compileValue = null)
 {
     Label    = label;
     Start    = start;
     Duration = duration;
     Children = new List <TimelineNode>();
     Value    = compileValue;
     Category = category;
 }
Exemple #4
0
        static public Brush GetCategoryBackground(CompilerData.CompileCategory category)
        {
            switch (category)
            {
            case CompilerData.CompileCategory.Include:               return(IncludeBrush);

            case CompilerData.CompileCategory.ParseClass:            return(ParseClassBrush);

            case CompilerData.CompileCategory.ParseTemplate:         return(ParseTemplateBrush);

            case CompilerData.CompileCategory.InstanceClass:         return(InstantiateClassBrush);

            case CompilerData.CompileCategory.InstanceFunction:      return(InstantiateFuncBrush);

            case CompilerData.CompileCategory.InstanceVariable:      return(InstantiateVariableBrush);

            case CompilerData.CompileCategory.InstanceConcept:       return(InstantiateConceptBrush);

            case CompilerData.CompileCategory.CodeGeneration:        return(CodeGenBrush);

            case CompilerData.CompileCategory.PendingInstantiations: return(PendingInstantiationBrush);

            case CompilerData.CompileCategory.OptimizeModule:        return(OptModuleBrush);

            case CompilerData.CompileCategory.OptimizeFunction:      return(OptFunctionBrush);

            case CompilerData.CompileCategory.RunPass:               return(RunPassBrush);

            case CompilerData.CompileCategory.CodeGenPasses:         return(CodeGenBrush);  //repeated color

            case CompilerData.CompileCategory.PerFunctionPasses:     return(RunPassBrush);  //repeated color

            case CompilerData.CompileCategory.PerModulePasses:       return(RunPassBrush);  //repeated color

            case CompilerData.CompileCategory.DebugType:             return(OtherBrush);    //repeated color

            case CompilerData.CompileCategory.DebugGlobalVariable:   return(OtherBrush);    //repeated color

            case CompilerData.CompileCategory.FrontEnd:              return(FrontEndBrush);

            case CompilerData.CompileCategory.BackEnd:               return(BackEndBrush);

            case CompilerData.CompileCategory.ExecuteCompiler:       return(ExecuteCompilerBrush);

            case CompilerData.CompileCategory.Other:                 return(OtherBrush);

            case CompilerData.CompileCategory.Thread:                return(ThreadBrush);

            case CompilerData.CompileCategory.Timeline:              return(TimelineBrush);
            }

            return(OtherBrush);
        }
Exemple #5
0
        private void AddTab(CompilerData.CompileCategory category)
        {
            TabItem tab = new TabItem();

            tab.Header = CompileScore.Common.UIConverters.ToSentenceCase(Enum.GetName(typeof(CompilerData.CompileCategory), (int)category));

            CompileDataTable content = new CompileDataTable();

            content.SetCategory(category);
            tab.Content = content;
            tabControl.Items.Add(tab);
        }
Exemple #6
0
        public OverviewWindowControl()
        {
            this.InitializeComponent();

            //Initialize Tabs
            for (CompilerData.CompileCategory category = 0; (int)category < (int)CompilerData.CompileThresholds.Gather; ++category)
            {
                AddTab(category);
            }

            CompilerData.Instance.ScoreDataChanged += OnScoreDataChanged;
            OnScoreDataChanged();
        }
Exemple #7
0
        private void RefreshTabs()
        {
            int baseIndex = tabControl.Items.Count - (int)CompilerData.CompileThresholds.Gather;

            if (baseIndex >= 0)
            {
                //We assume the last tabs are the one for the categories
                for (CompilerData.CompileCategory category = 0; (int)category < (int)CompilerData.CompileThresholds.Gather; ++category)
                {
                    int index = baseIndex + (int)category;
                    (tabControl.Items[index] as TabItem).Visibility = CompilerData.Instance.GetCollection(category).Count > 0? Visibility.Visible : Visibility.Collapsed;
                }
            }
        }
Exemple #8
0
        private TimelineNode LoadNode(BinaryReader reader)
        {
            uint start    = reader.ReadUInt32();
            uint duration = reader.ReadUInt32();
            uint eventId  = reader.ReadUInt32();

            CompilerData.CompileCategory category = (CompilerData.CompileCategory)reader.ReadByte();
            CompileValue value = CompilerData.Instance.GetValue(category, (int)eventId);

            string label = value != null ? value.Name : Common.UIConverters.ToSentenceCase(category.ToString());

            label += " ( " + Common.UIConverters.GetTimeStr(duration) + " )";

            return(new TimelineNode(label, start, duration, category, value));
        }
        private void CreateColumn(CompilerData.CompileCategory category)
        {
            string header      = Common.UIConverters.GetHeaderStr(category);
            string bindingText = "ValuesList[" + (int)category + "]";

            Binding binding = new Binding(bindingText);

            binding.Converter = this.Resources["uiTimeConverter"] as IValueConverter;

            var textColumn = new DataGridTextColumn();

            textColumn.Binding    = binding;
            textColumn.Header     = header;
            textColumn.IsReadOnly = true;
            textColumn.Width      = Math.Max(75, header.Length * 8);
            compileDataGrid.Columns.Add(textColumn);
        }
Exemple #10
0
 public UnitTotal(CompilerData.CompileCategory category)
 {
     Category = category;
     Total    = 0;
 }
Exemple #11
0
 public void SetCategory(CompilerData.CompileCategory category)
 {
     Category = category;
     OnDataChanged();
 }