/// <summary> /// 导出 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Export_Click(object sender, RoutedEventArgs e) { Ga_Map ga_Map = SelectMap(); if (ga_Map == null) { return; } Microsoft.Win32.SaveFileDialog sfd = new Microsoft.Win32.SaveFileDialog(); sfd.Filter = "地图信息文件|*.tll"; sfd.FileName = "" + ga_Map.Name + "_" + DateTime.Now.ToString("yyyyMMdd_HHmmss"); if (sfd.ShowDialog() == true) { if (mapService.Export_Map(UTC.ConvertDateTimeLong(Convert.ToDateTime(ga_Map.CreateTime)), sfd.FileName)) { GetMaps.ToList().ForEach(x => x.IsSelected = false); //取消选择 Map_action.Invoke(); //刷新主界面 MessageBox.Show("导出成功!", "提示", MessageBoxButton.OK, MessageBoxImage.Asterisk, MessageBoxResult.No); } else { MessageBox.Show("导出失败!", "提示", MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.No); } } }
public MapEdit(Ga_Map ga_Map, bool edit) { InitializeComponent(); GetMap = ga_Map; editStatic = edit; LoadMap(edit); }
/// <summary> /// 编辑地图 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void EditMap_Click(object sender, RoutedEventArgs e) { Ga_Map ga_Map = SelectMap(); if (ga_Map == null) { return; } MapEdit map = new MapEdit(ga_Map, true); map.Show(); this.Close(); }
public void LoadMap(Ga_Map GetMap) { UTCTime = UTC.ConvertDateTimeLong(Convert.ToDateTime(GetMap.CreateTime)); Tags = mapService.TagManagement(UTCTime); SerialPortData.AutoGenerateColumns = false; SerialPortData.ItemsSource = Tags; CanvasWidth = GetMap.Width * 10; CanvasHeight = GetMap.Height * 10; double CanvasWidths = GetMap.Width * 10 * map.MapSise; double CanvasHeights = GetMap.Height * 10 * map.MapSise; map.Initial_Canvas(TopX, TopY, mainPanel, CanvasWidths, CanvasHeights); map.LoadEditMap(UTCTime, false, true); }
public void LoadMap(Ga_Map GetMap) { CanvasWidth = GetMap.Width * 10; CanvasHeight = GetMap.Height * 10; double CanvasWidths = GetMap.Width * 10 * map.MapSise; double CanvasHeights = GetMap.Height * 10 * map.MapSise; map.Initial_Canvas(TopX, TopY, mainPanel, CanvasWidths, CanvasHeights); UTCTime = UTC.ConvertDateTimeLong(Convert.ToDateTime(GetMap.CreateTime)); map.LoadEditMap(UTCTime, false, true); map.valuePairs.Select(p => p.Value).ToList().ForEach(p => { p.MouseDown += Value_MouseDown; p.Cursor = Cursors.Hand; }); GetRoutes = mapService.GetrouteList(UTCTime.ToString()); Line.ItemsSource = GetRoutes; Line.SelectedIndex = 0; }