예제 #1
0
        public static void InsertEcolog(InsertDatum datum, MainWindowViewModel.UpdateTextDelegate updateTextDelegate, InsertConfig.GpsCorrection correction, out int count)
        {
            count = 0;
            var tripsTable = TripsDao.Get(datum);
            //int i = 1;

            //foreach (DataRow row in tripsTable.Rows)
            //{
            //    updateTextDelegate($"Insetring ECOLOG ... , {i} / {tripsTable.Rows.Count}");
            //    LogWritter.WriteLog(LogWritter.LogMode.Ecolog, $"Insetring ECOLOG... , { i} / { tripsTable.Rows.Count}, Datum: {datum}");
            //    var ecologTable = HagimotoEcologCalculator.CalcEcolog(row, datum, correction);
            //    EcologDao.Insert(ecologTable);

            //    i++;
            //}
            int t = 0;

            Parallel.For(0, tripsTable.Rows.Count, i =>
            {
                if (tripsTable.Rows[i][(TripsDao.ColumnConsumedEnergy)] == DBNull.Value)
                {
                    updateTextDelegate($"Insetring ECOLOG ... , {i + 1} / {tripsTable.Rows.Count}");
                    LogWritter.WriteLog(LogWritter.LogMode.Ecolog, $"Insetring ECOLOG... , { i} / { tripsTable.Rows.Count}, Datum: {datum}");
                    var ecologTable = HagimotoEcologCalculator.CalcEcolog(tripsTable.Rows[i], datum, correction);
                    EcologDao.Insert(ecologTable);
                    t++;
                }
            });
            count = t;
            TripsDao.UpdateConsumedEnergy();
        }
예제 #2
0
        public async void Initialize()
        {
            Title                 = "CHORALE";
            BackgroundColor       = Resources.ColorBlue;
            TextColor             = Resources.ColorWhite;
            ProgressBarVisibility = System.Windows.Visibility.Visible;

            await Task.Run(() =>
            {
                GraphDataList       = EcologDao.GetGraphDataOnSemanticLink(SemanticLink, Direction);
                RecentGraphDataList = EcologDao.GetRecentGraphDataOnSemanticLink(SemanticLink, Direction);
                OutlierExclusion();
                ChoraleModel = ChoraleModel.Init(GraphDataList);
                RModel       = RModel.Init(GraphDataList);
            });

            SwitchToChoralePage();
        }
        public async void Initialize()
        {
            //var SemanticLinks = SemanticLinkDao.OutwardSemanticLinks;
            //Direction = new TripDirection { Direction = "outward" };
            //SemanticLink = SemanticLinks.FirstOrDefault(s => s.SemanticLinkId == 13);
            Title                 = "CHORALE";
            BackgroundColor       = Resources.ColorBlue;
            TextColor             = Resources.ColorWhite;
            ProgressBarVisibility = System.Windows.Visibility.Visible;

            await Task.Run(() =>
            {
                GraphDataList = EcologDao.GetGraphDataOnSemanticLink(SemanticLink, Direction);
                OutlierExclusion();
                ChoraleModel = ChoraleModel.Init(GraphDataList);
                RModel       = RModel.Init(GraphDataList);
            });

            SwitchToChoralePage();
        }