public void generate_schedule(object sender, EventArgs e)
        {
            if (Models.EngineManagerModel.instance != null && Models.EngineManagerModel.instance.IsConnected)
            {
                //get the schedule
                schedule = Barrista.getInstance().Schedule_Generate();
                if (OnRefresh != null)
                {
                    OnRefresh(sender, e);
                }

                //generate system -> time collection
                float totalTime = 0;
                PerfTimeData.Clear();
                OperationList.OperationListEnumerator en = schedule.GetEnumerator();
                while (en.MoveNext())
                {
                    float    timesample = (float)en.Current.samples_sum / (float)en.Current.samples_num;
                    PerfData p          = new PerfData()
                    {
                        AvgRunTime = timesample, SystemName = en.Current.name
                    };
                    PerfTimeData.Add(p);
                    totalTime += timesample;
                }

                //generate fps
                statusText  = "";
                statusText += "Total Frametime: " + (totalTime / 1000.0f).ToString();
                statusText += "\t\tFPS: " + ((1.0f / (totalTime / 10000.0f)) * 100.0f).ToString();
                PropertyChanged(this, new PropertyChangedEventArgs("statusText"));
            }
        }
Exemplo n.º 2
0
        public void generate_schedule(object sender, EventArgs e)
        {
            if (Models.EngineManagerModel.instance != null && Models.EngineManagerModel.instance.IsConnected)
            {
                //get the schedule
                schedule = Barrista.getInstance().Schedule_Generate();
                if (OnRefresh != null)
                    OnRefresh(sender, e);

                //generate system -> time collection
                float totalTime = 0;
                PerfTimeData.Clear();
                OperationList.OperationListEnumerator en = schedule.GetEnumerator();
                while (en.MoveNext())
                {
                    float timesample = (float)en.Current.samples_sum / (float)en.Current.samples_num;
                    PerfData p = new PerfData(){ AvgRunTime = timesample, SystemName = en.Current.name };
                    PerfTimeData.Add(p);
                    totalTime += timesample;
                }

                //generate fps
                statusText = "";
                statusText += "Total Frametime: " + (totalTime / 1000.0f).ToString();
                statusText += "\t\tFPS: " + ((1.0f/(totalTime / 10000.0f))*100.0f).ToString();
                PropertyChanged(this, new PropertyChangedEventArgs("statusText"));
            }
        }