示例#1
0
        internal override void Process()
        {
            Thread roadLoadStatusThread = new Thread(UpdateStatus);

            roadLoadStatusThread.Start();
            ConcurrencyUtils.SetText(mainForm.ResultLabel, "Идет пстроение улиц");
            ConcurrencyUtils.SetAvailability(mainForm.AllDirectionButton, false);
            ConcurrencyUtils.SetAvailability(mainForm.ClearButton, false);
            ConcurrencyUtils.SetAvailability(mainForm.StreetViewsRequestButton, false);

            if (mainForm.GMapForm.Markers.Count > 1)
            {
                LoadedRoades = controller.GetAllRoadsOfArea(
                    mainForm.GMapForm.Markers[0].Position.Lat, mainForm.GMapForm.Markers[0].Position.Lng,
                    mainForm.GMapForm.Markers[1].Position.Lat, mainForm.GMapForm.Markers[1].Position.Lng);
            }
            else
            {
                LoadedRoades = controller.GetAllRoadsOfArea(mainForm.GMapForm.Markers[0].Position.Lat, mainForm.GMapForm.Markers[0].Position.Lng);
            }
            foreach (Road road in LoadedRoades.Values)
            {
                mainForm.GMapForm.MainMapRoute.AddRoad(road);
                int rowIndex = mainForm.FindRowByStreetName(mainForm.StreetsGridView, road.Name);
                if (rowIndex != -1)
                {
                    ConcurrencyUtils.SetCellValue(mainForm.StreetsGridView, rowIndex, 1, "Нет");
                }
                else
                {
                    ConcurrencyUtils.AddRow(mainForm.StreetsGridView, new object[] { road.Name, road.IsStreetViewsDownloaded ? "Да" : "Нет", false });
                }
            }
            isLoadComplete = true;
        }
示例#2
0
        private void UpdateRoadsStatus()
        {
            List <Road> downloadedRoads = downloader.GetDownloadedRoads();

            foreach (Road road in downloadedRoads)
            {
                int rowIndex = mainForm.FindRowByStreetName(mainForm.StreetsGridView, road.Name);
                if (rowIndex != -1)
                {
                    ConcurrencyUtils.SetCellValue(mainForm.StreetsGridView, rowIndex, 1, "Да");
                    ConcurrencyUtils.SetCellValue(mainForm.StreetsGridView, rowIndex, 2, false);
                    rowIndex = mainForm.FindRowByStreetName(mainForm.StreetsBypassView, road.Name);
                    if (rowIndex != -1)
                    {
                        ConcurrencyUtils.SetCellValue(mainForm.StreetsBypassView, rowIndex, 1, "Нет");
                    }
                    else
                    {
                        ConcurrencyUtils.AddRow(mainForm.StreetsBypassView, new object[] { road.Name, road.IsSignDetected ? "Да" : "Нет", false });
                    }
                    mainForm.GMapForm.MiniMapRoute.AddRoad(road);
                }
            }
            mainForm.GMapForm.RefreshGMapMini();
        }
示例#3
0
        private void UpdateRoadsStatus()
        {
            List <string> processedRoads = processor.GetProcessedRoadsNames();

            foreach (string roadName in processedRoads)
            {
                int rowIndex = mainForm.FindRowByStreetName(mainForm.StreetsBypassView, roadName);
                if (rowIndex != -1)
                {
                    ConcurrencyUtils.SetCellValue(mainForm.StreetsBypassView, rowIndex, 1, "Да");
                    ConcurrencyUtils.SetCellValue(mainForm.StreetsBypassView, rowIndex, 2, false);
                }
            }
        }