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; }
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(); }
private void UpdateStreetViewBox() { List <SignDetectionResult> results = processor.GetBypassResults(); foreach (SignDetectionResult result in results) { foreach (var detectorsResult in result.DetectorsResult) { foreach (Sign sign in detectorsResult.Value) { ConcurrencyUtils.AddRow(mainForm.SignsGridView, new object[] { sign.ClassName, sign.DetectorName }); mainForm.SignsRowIndexDictionary.Add(mainForm.SignsGridView.RowCount, sign); } } ConcurrencyUtils.SetImage(mainForm.StreetViewBox, result.Image); Thread.Sleep(1000); } }