Example #1
0
        private async void createPlotModel()
        {
            await Task.Run(() =>
            {
                this.EnergyHistogramDatum = SemanticHistogramDatum.GetEnergyInstance(this.SemanticLink, this.TripDirection);
            });

            setRepresentativeValue();

            createNumberModel();
        }
        public async void CreatePlotModel()
        {
            this.ProgressBarVisibility = Visibility.Visible;
            this.PlotModel             = null;

            this.EnergyHistogramData = new List <SemanticHistogramDatum>();

            await Task.Run(() =>
            {
                foreach (SemanticGraph graph in this.SemanticGraphs)
                {
                    this.EnergyHistogramData.Add(SemanticHistogramDatum.GetEnergyInstance(graph.SemanticLink, this.TripDirection));
                }
            });

            CurrentGraphType = GraphType.Raw;
            CreateNumberModel();
        }
Example #3
0
        private AreaSeries createAreaSeries(SemanticGraph semanticGraph, int sensorID)
        {
            AreaSeries series = new AreaSeries();

            //series.TrackerFormatString = series.TrackerFormatString + "\n" + link.Semantics + " : {Tag}";
            series.Title = "Sensor ID: " + sensorID;

            System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
            sw.Start();

            SemanticHistogramDatum datum = SemanticHistogramDatum.GetEnergyInstance(semanticGraph.SemanticLink, this.TripDirection, sensorID);

            //SemanticHistogramDatum datum = null;

            sw.Stop();
            Console.WriteLine("COST: " + sw.Elapsed);

            //series.Points.Add(new DataPoint(0.02, 0));

            foreach (LevelAndValue item in datum.HistogramData)
            {
                if (item.Level > 0.02 && item.Level < 0.15)
                {
                    series.Points.Add(new DataPoint(item.Level, item.Value));
                }
            }

            //series.Points.Add(new DataPoint(0.15, 0));

            AreaSeriesList.Add(series);
            semanticGraph.Series = series;

            Console.WriteLine("SENSOR: " + sensorID + ", WIDTH: " + datum.ClassWidth);

            return(series);
        }
Example #4
0
 private void setHistogramData()
 {
     this.EnergyHistogramDatumFirst  = SemanticHistogramDatum.GetEnergyInstance(this.SelectedSemanticLinks[0], this.TripDirection);
     this.EnergyHistogramDatumSecond = SemanticHistogramDatum.GetEnergyInstance(this.SelectedSemanticLinks[1], this.TripDirection);
 }