فهرست منبع

修改导入航迹

wyq 1 سال پیش
والد
کامیت
418ea50655

+ 0 - 1
DataSimulation.Forms/DataSimulation.Forms.csproj

@@ -268,7 +268,6 @@
     <EmbeddedResource Include="MainForm.resx">
       <DependentUpon>MainForm.cs</DependentUpon>
     </EmbeddedResource>
-    <EmbeddedResource Include="Properties\licenses.licx" />
     <EmbeddedResource Include="Properties\Resources.resx">
       <Generator>ResXFileCodeGenerator</Generator>
       <LastGenOutput>Resources.Designer.cs</LastGenOutput>

+ 53 - 139
DataSimulation.Forms/EditForms/FlightImport.Designer.cs

@@ -29,58 +29,41 @@
         private void InitializeComponent()
         {
             this.components = new System.ComponentModel.Container();
-            DevExpress.XtraEditors.Controls.EditorButtonImageOptions editorButtonImageOptions2 = new DevExpress.XtraEditors.Controls.EditorButtonImageOptions();
-            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject5 = new DevExpress.Utils.SerializableAppearanceObject();
-            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject6 = new DevExpress.Utils.SerializableAppearanceObject();
-            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject7 = new DevExpress.Utils.SerializableAppearanceObject();
-            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject8 = new DevExpress.Utils.SerializableAppearanceObject();
             this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl();
             this.btnImport = new DevExpress.XtraEditors.SimpleButton();
             this.mapControl = new DevExpress.XtraMap.MapControl();
             this.btnSave = new DevExpress.XtraEditors.SimpleButton();
-            this.txtSpeed = new DevExpress.XtraEditors.ButtonEdit();
-            this.txtFlightName = new DevExpress.XtraEditors.TextEdit();
-            this.searchHj = new DevExpress.XtraEditors.SearchLookUpEdit();
-            this.searchLookUpEdit1View = new DevExpress.XtraGrid.Views.Grid.GridView();
             this.Root = new DevExpress.XtraLayout.LayoutControlGroup();
-            this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem();
             this.layoutControlItem13 = new DevExpress.XtraLayout.LayoutControlItem();
-            this.layoutControlItem10 = new DevExpress.XtraLayout.LayoutControlItem();
             this.splitterItem1 = new DevExpress.XtraLayout.SplitterItem();
             this.emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem();
-            this.emptySpaceItem2 = new DevExpress.XtraLayout.EmptySpaceItem();
             this.layoutControlItem12 = new DevExpress.XtraLayout.LayoutControlItem();
             this.layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem();
-            this.航迹 = new DevExpress.XtraLayout.LayoutControlItem();
             this.dxErrorProvider = new DevExpress.XtraEditors.DXErrorProvider.DXErrorProvider(this.components);
+            this.gridImprot = new DevExpress.XtraGrid.GridControl();
+            this.gridView1 = new DevExpress.XtraGrid.Views.Grid.GridView();
+            this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
             this.layoutControl1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.mapControl)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.txtSpeed.Properties)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.txtFlightName.Properties)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.searchHj.Properties)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.searchLookUpEdit1View)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.Root)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem13)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem10)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.splitterItem1)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem2)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem12)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.航迹)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.dxErrorProvider)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.gridImprot)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.gridView1)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).BeginInit();
             this.SuspendLayout();
             // 
             // layoutControl1
             // 
+            this.layoutControl1.Controls.Add(this.gridImprot);
             this.layoutControl1.Controls.Add(this.btnImport);
             this.layoutControl1.Controls.Add(this.mapControl);
             this.layoutControl1.Controls.Add(this.btnSave);
-            this.layoutControl1.Controls.Add(this.txtSpeed);
-            this.layoutControl1.Controls.Add(this.txtFlightName);
-            this.layoutControl1.Controls.Add(this.searchHj);
             this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill;
             this.layoutControl1.Location = new System.Drawing.Point(0, 0);
             this.layoutControl1.Name = "layoutControl1";
@@ -91,9 +74,9 @@
             // 
             // btnImport
             // 
-            this.btnImport.Location = new System.Drawing.Point(154, 475);
+            this.btnImport.Location = new System.Drawing.Point(217, 475);
             this.btnImport.Name = "btnImport";
-            this.btnImport.Size = new System.Drawing.Size(60, 22);
+            this.btnImport.Size = new System.Drawing.Size(72, 22);
             this.btnImport.StyleController = this.layoutControl1;
             this.btnImport.TabIndex = 17;
             this.btnImport.Text = "导入航迹";
@@ -101,14 +84,14 @@
             // 
             // mapControl
             // 
-            this.mapControl.Location = new System.Drawing.Point(304, 12);
+            this.mapControl.Location = new System.Drawing.Point(379, 12);
             this.mapControl.Name = "mapControl";
-            this.mapControl.Size = new System.Drawing.Size(873, 485);
+            this.mapControl.Size = new System.Drawing.Size(798, 485);
             this.mapControl.TabIndex = 16;
             // 
             // btnSave
             // 
-            this.btnSave.Location = new System.Drawing.Point(218, 475);
+            this.btnSave.Location = new System.Drawing.Point(293, 475);
             this.btnSave.Name = "btnSave";
             this.btnSave.Size = new System.Drawing.Size(72, 22);
             this.btnSave.StyleController = this.layoutControl1;
@@ -116,103 +99,34 @@
             this.btnSave.Text = "保存";
             this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
             // 
-            // txtSpeed
-            // 
-            this.txtSpeed.Location = new System.Drawing.Point(12, 111);
-            this.txtSpeed.MaximumSize = new System.Drawing.Size(0, 20);
-            this.txtSpeed.MinimumSize = new System.Drawing.Size(0, 20);
-            this.txtSpeed.Name = "txtSpeed";
-            this.txtSpeed.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
-            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "m/s", -1, false, true, false, editorButtonImageOptions2, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject5, serializableAppearanceObject6, serializableAppearanceObject7, serializableAppearanceObject8, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
-            this.txtSpeed.Properties.MaskSettings.Set("MaskManagerType", typeof(DevExpress.Data.Mask.NumericMaskManager));
-            this.txtSpeed.Properties.MaskSettings.Set("mask", "f3");
-            this.txtSpeed.Properties.MaxLength = 10;
-            this.txtSpeed.Size = new System.Drawing.Size(278, 20);
-            this.txtSpeed.StyleController = this.layoutControl1;
-            this.txtSpeed.TabIndex = 13;
-            // 
-            // txtFlightName
-            // 
-            this.txtFlightName.Location = new System.Drawing.Point(12, 70);
-            this.txtFlightName.Name = "txtFlightName";
-            this.txtFlightName.Properties.MaxLength = 12;
-            this.txtFlightName.Size = new System.Drawing.Size(278, 20);
-            this.txtFlightName.StyleController = this.layoutControl1;
-            this.txtFlightName.TabIndex = 4;
-            // 
-            // searchHj
-            // 
-            this.searchHj.Location = new System.Drawing.Point(12, 29);
-            this.searchHj.Name = "searchHj";
-            this.searchHj.Properties.AdvancedModeOptions.AllowSelectionAnimation = DevExpress.Utils.DefaultBoolean.True;
-            this.searchHj.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
-            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
-            this.searchHj.Properties.NullText = "";
-            this.searchHj.Properties.PopupSizeable = false;
-            this.searchHj.Properties.PopupView = this.searchLookUpEdit1View;
-            this.searchHj.Size = new System.Drawing.Size(278, 20);
-            this.searchHj.StyleController = this.layoutControl1;
-            this.searchHj.TabIndex = 18;
-            this.searchHj.EditValueChanged += new System.EventHandler(this.searchHj_EditValueChanged);
-            // 
-            // searchLookUpEdit1View
-            // 
-            this.searchLookUpEdit1View.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus;
-            this.searchLookUpEdit1View.Name = "searchLookUpEdit1View";
-            this.searchLookUpEdit1View.OptionsSelection.EnableAppearanceFocusedCell = false;
-            this.searchLookUpEdit1View.OptionsView.ShowGroupPanel = false;
-            // 
             // Root
             // 
             this.Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True;
             this.Root.GroupBordersVisible = false;
             this.Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
-            this.layoutControlItem1,
             this.layoutControlItem13,
-            this.layoutControlItem10,
             this.splitterItem1,
             this.emptySpaceItem1,
-            this.emptySpaceItem2,
             this.layoutControlItem12,
             this.layoutControlItem2,
-            this.航迹});
+            this.layoutControlItem1});
             this.Root.Name = "Root";
             this.Root.Size = new System.Drawing.Size(1189, 509);
             this.Root.TextVisible = false;
             // 
-            // layoutControlItem1
-            // 
-            this.layoutControlItem1.Control = this.txtFlightName;
-            this.layoutControlItem1.Location = new System.Drawing.Point(0, 41);
-            this.layoutControlItem1.Name = "layoutControlItem1";
-            this.layoutControlItem1.Size = new System.Drawing.Size(282, 41);
-            this.layoutControlItem1.Text = "航迹名称";
-            this.layoutControlItem1.TextLocation = DevExpress.Utils.Locations.Top;
-            this.layoutControlItem1.TextSize = new System.Drawing.Size(48, 14);
-            // 
             // layoutControlItem13
             // 
             this.layoutControlItem13.Control = this.mapControl;
-            this.layoutControlItem13.Location = new System.Drawing.Point(292, 0);
+            this.layoutControlItem13.Location = new System.Drawing.Point(367, 0);
             this.layoutControlItem13.Name = "layoutControlItem13";
-            this.layoutControlItem13.Size = new System.Drawing.Size(877, 489);
+            this.layoutControlItem13.Size = new System.Drawing.Size(802, 489);
             this.layoutControlItem13.TextSize = new System.Drawing.Size(0, 0);
             this.layoutControlItem13.TextVisible = false;
             // 
-            // layoutControlItem10
-            // 
-            this.layoutControlItem10.Control = this.txtSpeed;
-            this.layoutControlItem10.Location = new System.Drawing.Point(0, 82);
-            this.layoutControlItem10.Name = "layoutControlItem10";
-            this.layoutControlItem10.Size = new System.Drawing.Size(282, 44);
-            this.layoutControlItem10.Text = "速度";
-            this.layoutControlItem10.TextLocation = DevExpress.Utils.Locations.Top;
-            this.layoutControlItem10.TextSize = new System.Drawing.Size(48, 14);
-            // 
             // splitterItem1
             // 
             this.splitterItem1.AllowHotTrack = true;
-            this.splitterItem1.Location = new System.Drawing.Point(282, 0);
+            this.splitterItem1.Location = new System.Drawing.Point(357, 0);
             this.splitterItem1.Name = "splitterItem1";
             this.splitterItem1.Size = new System.Drawing.Size(10, 489);
             // 
@@ -221,21 +135,13 @@
             this.emptySpaceItem1.AllowHotTrack = false;
             this.emptySpaceItem1.Location = new System.Drawing.Point(0, 463);
             this.emptySpaceItem1.Name = "emptySpaceItem1";
-            this.emptySpaceItem1.Size = new System.Drawing.Size(142, 26);
+            this.emptySpaceItem1.Size = new System.Drawing.Size(205, 26);
             this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0);
             // 
-            // emptySpaceItem2
-            // 
-            this.emptySpaceItem2.AllowHotTrack = false;
-            this.emptySpaceItem2.Location = new System.Drawing.Point(0, 126);
-            this.emptySpaceItem2.Name = "emptySpaceItem2";
-            this.emptySpaceItem2.Size = new System.Drawing.Size(282, 337);
-            this.emptySpaceItem2.TextSize = new System.Drawing.Size(0, 0);
-            // 
             // layoutControlItem12
             // 
             this.layoutControlItem12.Control = this.btnSave;
-            this.layoutControlItem12.Location = new System.Drawing.Point(206, 463);
+            this.layoutControlItem12.Location = new System.Drawing.Point(281, 463);
             this.layoutControlItem12.MaxSize = new System.Drawing.Size(76, 26);
             this.layoutControlItem12.MinSize = new System.Drawing.Size(76, 26);
             this.layoutControlItem12.Name = "layoutControlItem12";
@@ -247,25 +153,43 @@
             // layoutControlItem2
             // 
             this.layoutControlItem2.Control = this.btnImport;
-            this.layoutControlItem2.Location = new System.Drawing.Point(142, 463);
+            this.layoutControlItem2.Location = new System.Drawing.Point(205, 463);
+            this.layoutControlItem2.MaxSize = new System.Drawing.Size(76, 26);
+            this.layoutControlItem2.MinSize = new System.Drawing.Size(76, 26);
             this.layoutControlItem2.Name = "layoutControlItem2";
-            this.layoutControlItem2.Size = new System.Drawing.Size(64, 26);
+            this.layoutControlItem2.Size = new System.Drawing.Size(76, 26);
+            this.layoutControlItem2.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
             this.layoutControlItem2.TextSize = new System.Drawing.Size(0, 0);
             this.layoutControlItem2.TextVisible = false;
             // 
-            // 航迹
-            // 
-            this.航迹.Control = this.searchHj;
-            this.航迹.Location = new System.Drawing.Point(0, 0);
-            this.航迹.Name = "航迹";
-            this.航迹.Size = new System.Drawing.Size(282, 41);
-            this.航迹.TextLocation = DevExpress.Utils.Locations.Top;
-            this.航迹.TextSize = new System.Drawing.Size(48, 14);
-            // 
             // dxErrorProvider
             // 
             this.dxErrorProvider.ContainerControl = this;
             // 
+            // gridImprot
+            // 
+            this.gridImprot.Location = new System.Drawing.Point(12, 12);
+            this.gridImprot.MainView = this.gridView1;
+            this.gridImprot.Name = "gridImprot";
+            this.gridImprot.Size = new System.Drawing.Size(353, 459);
+            this.gridImprot.TabIndex = 18;
+            this.gridImprot.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
+            this.gridView1});
+            // 
+            // gridView1
+            // 
+            this.gridView1.GridControl = this.gridImprot;
+            this.gridView1.Name = "gridView1";
+            // 
+            // layoutControlItem1
+            // 
+            this.layoutControlItem1.Control = this.gridImprot;
+            this.layoutControlItem1.Location = new System.Drawing.Point(0, 0);
+            this.layoutControlItem1.Name = "layoutControlItem1";
+            this.layoutControlItem1.Size = new System.Drawing.Size(357, 463);
+            this.layoutControlItem1.TextSize = new System.Drawing.Size(0, 0);
+            this.layoutControlItem1.TextVisible = false;
+            // 
             // FlightImport
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
@@ -279,21 +203,16 @@
             ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).EndInit();
             this.layoutControl1.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.mapControl)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.txtSpeed.Properties)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.txtFlightName.Properties)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.searchHj.Properties)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.searchLookUpEdit1View)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.Root)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem13)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem10)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.splitterItem1)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem2)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem12)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.航迹)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.dxErrorProvider)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.gridImprot)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.gridView1)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).EndInit();
             this.ResumeLayout(false);
 
         }
@@ -302,13 +221,8 @@
 
         private DevExpress.XtraLayout.LayoutControl layoutControl1;
         private DevExpress.XtraLayout.LayoutControlGroup Root;
-        private DevExpress.XtraEditors.TextEdit txtFlightName;
-        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem1;
-        private DevExpress.XtraEditors.ButtonEdit txtSpeed;
-        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem10;
         private DevExpress.XtraEditors.SimpleButton btnSave;
         private DevExpress.XtraLayout.LayoutControlItem layoutControlItem12;
-        private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem2;
         private DevExpress.XtraEditors.DXErrorProvider.DXErrorProvider dxErrorProvider;
         private DevExpress.XtraMap.MapControl mapControl;
         private DevExpress.XtraLayout.LayoutControlItem layoutControlItem13;
@@ -316,8 +230,8 @@
         private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem1;
         private DevExpress.XtraEditors.SimpleButton btnImport;
         private DevExpress.XtraLayout.LayoutControlItem layoutControlItem2;
-        private DevExpress.XtraLayout.LayoutControlItem 航迹;
-        private DevExpress.XtraEditors.SearchLookUpEdit searchHj;
-        private DevExpress.XtraGrid.Views.Grid.GridView searchLookUpEdit1View;
+        private DevExpress.XtraGrid.GridControl gridImprot;
+        private DevExpress.XtraGrid.Views.Grid.GridView gridView1;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem1;
     }
 }

+ 29 - 30
DataSimulation.Forms/EditForms/FlightImport.cs

@@ -5,9 +5,11 @@ using DevExpress.Utils.About;
 using DevExpress.XtraEditors;
 using DevExpress.XtraEditors.Controls;
 using DevExpress.XtraEditors.DXErrorProvider;
+using DevExpress.XtraGrid.Views.Grid;
 using DxHelper;
 using ExtensionsDev;
 using System;
+using System.Collections;
 using System.Collections.Generic;
 using System.ComponentModel;
 using System.Data;
@@ -26,7 +28,7 @@ namespace DataSimulation.Forms.EditForms
     {
         public List<SimulationInfo> Addinfo;
         private List<SimulationInfo> simulationInfos;
-        private List<FlightInfo> flightInfos;
+        private List<FlightInfo> flightInfos = new List<FlightInfo>();
         public FlightImport(List<SimulationInfo> simulationInfos)
         {
             InitializeComponent();
@@ -47,8 +49,25 @@ namespace DataSimulation.Forms.EditForms
            .UseExportCsv()
            .UseExportFlightLine()
            .SetMapLayerType(null);
+
+            gridView1.SelectionChanged += GridView1_SelectionChanged;
+            gridImprot.Init<FlightInfo>().UseSort().UseFilter().UseMultiSelect().UseRowNumber();
+            gridView1.OptionsSelection.MultiSelectMode = GridMultiSelectMode.CheckBoxRowSelect;
+            gridImprot.DataSource = flightInfos;
+            gridView1.RefreshData();
         }
 
+        private void GridView1_SelectionChanged(object sender, DevExpress.Data.SelectionChangedEventArgs e)
+        {
+            var ids = gridView1.GetSelectedRows();
+            List<FlightInfo> selects = new List<FlightInfo>();
+            foreach (var id in ids)
+            {
+                var item = gridView1.GetRow(id) as FlightInfo;
+                selects.Add(item);
+            }
+            mapControl.SetFlightLine(selects);
+        }
 
         private async void btnSave_Click(object sender, EventArgs e)
         {
@@ -94,7 +113,7 @@ namespace DataSimulation.Forms.EditForms
         private List<FlightInfo> AnalysisFlight(string filePath)
         {
 
-            List<FlightInfo> flightInfos = new List<FlightInfo>();
+            List<FlightInfo> fs = new List<FlightInfo>();
             try
             {
 
@@ -130,7 +149,7 @@ namespace DataSimulation.Forms.EditForms
                     var fligths = flight.Select(f => new FlightData(f.FlightLon, f.FlightLat)).ToList();
                     FlightInfo flightInfo = new FlightInfo(name, speed);
                     flightInfo.flights.AddRange(fligths);
-                    flightInfos.Add(flightInfo);
+                    fs.Add(flightInfo);
                 }
             }
             catch (Exception ex)
@@ -139,46 +158,26 @@ namespace DataSimulation.Forms.EditForms
                 DxHelper.MsgBoxHelper.ShowError($"导入航迹解析异常:{ex.Message}");
             }
 
-            return flightInfos;
+            return fs;
 
         }
 
         private void btnFlight_Click(object sender, EventArgs e)
         {
-            flightInfos = new List<FlightInfo>();
+            flightInfos.Clear();
             XtraOpenFileDialog xtraOpenFileDialog1 = new XtraOpenFileDialog();
             xtraOpenFileDialog1.Multiselect = false;
             xtraOpenFileDialog1.Filter = "CSV文件|*.csv";
             if (xtraOpenFileDialog1.ShowDialog() == DialogResult.OK)
             {
                 string filePath = xtraOpenFileDialog1.FileName;
-                flightInfos = AnalysisFlight(filePath);
-            }
-            try
-            {
-                this.searchHj.Properties.DataSource = flightInfos;
-                this.searchHj.Properties.ValueMember = nameof(FlightInfo);
-                this.searchHj.Properties.DisplayMember = nameof(FlightInfo.FlightName);
-                this.searchHj.SetSearchGridLookUpEditMultiSelected<FlightInfo>();
-                if (flightInfos.Count > 0)
-                {
-                    mapControl.SetFlightLine(flightInfos);
-                }
-            }
-            catch (Exception ex)
-            {
-                Serilog.Log.Error(ex, $"导入航迹异常:{ex.Message}");
-                DxHelper.MsgBoxHelper.ShowError($"导入航迹异常:{ex.Message}");
+                var ff = AnalysisFlight(filePath);
+                flightInfos.AddRange(ff);
             }
+            gridView1.RefreshData();
+            gridView1.SelectAll();
+            mapControl.SetFlightLine(flightInfos);
 
         }
-        private void searchHj_EditValueChanged(object sender, EventArgs e)
-        {
-            var selectedValue = searchHj.Properties.Tag.MapTo<List<FlightInfo>>();
-            if (selectedValue != null)
-            {
-                mapControl.SetFlightLine(selectedValue);
-            }
-        }
     }
 }

+ 7 - 6
DataSimulation.Forms/ExtensionsDev/SearchLookUpEditExtension.cs

@@ -67,7 +67,7 @@ namespace ExtensionsDev
             ctrl.Properties.DataSource = data;
             GridView view = ctrl.Properties.View;
             view.OptionsView.ShowColumnHeaders = true;
-            view.GridControl.Init<T>(searchLookUpEdit:ctrl);
+            view.GridControl.Init<T>(searchLookUpEdit: ctrl);
             ctrl.CustomDisplayText += (sender, e) =>
             {
                 if (e.Value == null) return;
@@ -108,7 +108,7 @@ namespace ExtensionsDev
         public static SearchLookUpEdit SetSearchGridLookUpEditMultiSelected<T>(this SearchLookUpEdit ctrl,string nullText = "请选择")
         {
             var view = ctrl.Properties.PopupView as DevExpress.XtraGrid.Views.Grid.GridView;
-          
+           
             view.OptionsSelection.MultiSelect = true;
             view.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.CheckBoxRowSelect;
             view.OptionsSelection.CheckBoxSelectorColumnWidth = 45;
@@ -119,6 +119,7 @@ namespace ExtensionsDev
             ctrl.Properties.ShowNullValuePrompt = ShowNullValuePromptOptions.Default;
             ctrl.Properties.ShowAddNewButton = false;
             var values = new List<T>();
+           
             //var keys = new List<string>();
             var texts = new List<string>();
             ctrl.Properties.Tag = values;
@@ -130,21 +131,21 @@ namespace ExtensionsDev
                 for (int i = 0; i < view.RowCount; i++)
                 {
                     var value = view.GetRow(i);
-                    if (values.Any(a=>a.ToJsonStr()==value.ToJsonStr()))
+                    if (values.Any(a => a.ToJsonStr() == value.ToJsonStr()))
                     {
                         view.SelectRow(i);
                     }
                 }
-                view.EndSelection();    
+                view.EndSelection();
             };
             ctrl.CloseUp += (s, e) =>
             {
                 values.Clear();
                 texts.Clear();
                 var indexs = view.GetSelectedRows();
-                foreach ( var row in indexs )
+                foreach (var row in indexs)
                 {
-                    var value =view.GetRow(row).MapTo<T>();
+                    var value = view.GetRow(row).MapTo<T>();
                     values.Add(value);
                     var text = view.GetRowCellDisplayText(row, ctrl.Properties.DisplayMember);
                     texts.Add(text);

+ 0 - 6
DataSimulation.Forms/Properties/licenses.licx

@@ -1,6 +0,0 @@
-DevExpress.XtraEditors.ImageComboBoxEdit, DevExpress.XtraEditors.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
-DevExpress.XtraEditors.TextEdit, DevExpress.XtraEditors.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
-DevExpress.XtraLayout.LayoutControl, DevExpress.XtraLayout.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
-DevExpress.XtraEditors.SearchLookUpEdit, DevExpress.XtraGrid.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
-DevExpress.XtraEditors.ButtonEdit, DevExpress.XtraEditors.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
-DevExpress.XtraMap.MapControl, DevExpress.XtraMap.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a

+ 1 - 1
DataSimulation.Repostory/PosData.cs

@@ -192,7 +192,7 @@ namespace DataSimulation.Repostory
         /// <summary>
         /// 航迹数据点
         /// </summary>
-        [Display(Name = "航迹数据点")]
+        [Display(Name = "航迹数据点", AutoGenerateField = false)]
         [ExportCell()]
         public List<FlightData> flights { get; set; }