private void RemoveBtn_Click(object sender, RoutedEventArgs e) { ZoneRegister zr = (sender as Button).DataContext as ZoneRegister; trafficRounterService.ClearZoneRegister(zr.NameId); trafficRounterService.SaveConfigZone(JsonConvert.SerializeObject(MainDataGrid.ItemsSource, Formatting.Indented)); }
public void TrafficUpdate() { while (true) { try { prioritLevel.IndexOnMainRoad = trafficManagementService.FindIndexZoneRegister(properties.pose.Position); if (onFlagSupervisorTraffic) { // cập nhật vùng riskzone // update vùng risk area cho robot ZoneRegister rZR = trafficManagementService.GetTypeZoneReg(properties.pose.Position, TrafficSetValue.YES);// trafficManagementService.Find(properties.pose.Position, 0, 200); if (rZR != null) { properties.L1 = rZR.L1; properties.L2 = rZR.L2; properties.WS = rZR.WS; properties.DistInter = rZR.distance; L1Cv = rZR.L1 * properties.Scale; L2Cv = rZR.L2 * properties.Scale; WSCv = rZR.WS * properties.Scale; DistInterCv = rZR.distance * properties.Scale; //UpdateRiskAraParams(rZR.L1, rZR.L2, rZR.WS, rZR.distance); } else { UpdateRiskAraParams(DfL1, DfL2, DfWS, DfDistanceInter); } RobotBehavior(); } // giám sát an toàn } catch { Console.WriteLine("TrafficRobotUnity Error in TrafficUpdate"); } Thread.Sleep(500); } }