wyq 1 жил өмнө
parent
commit
0c5c651da0

+ 25 - 20
DataSimulation.Forms/EditForms/TaskEditor.cs

@@ -16,6 +16,7 @@ using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 using System.Windows.Forms;
+using static DevExpress.Utils.Drawing.Helpers.NativeMethods;
 
 namespace DataSimulation.Forms.EditForms
 {
@@ -56,19 +57,19 @@ namespace DataSimulation.Forms.EditForms
             .UseExportImg()
             .UseExportXlsx()
             .UseExportCsv()
-            .UseFlightLine(res =>
-            {
-                (bool isShowPopup, XtraUserControl frm) = res;
-                if (isShowPopup)
-                {
-                    DxHelper.PopupHelper.ShowPopup(frm, mapControl, 400);
-                }
-                else
-                {
-
-                    DxHelper.PopupHelper.HidePopup(frm);
-                }
-            })
+            //.UseFlightLine(res =>
+            //{
+            //    (bool isShowPopup, XtraUserControl frm) = res;
+            //    if (isShowPopup)
+            //    {
+            //        DxHelper.PopupHelper.ShowPopup(frm, mapControl, 400);
+            //    }
+            //    else
+            //    {
+
+            //        DxHelper.PopupHelper.HidePopup(frm);
+            //    }
+            //})
             .SetMapLayerType(null)
             .UseDrawRect(rect =>
             {
@@ -76,15 +77,12 @@ namespace DataSimulation.Forms.EditForms
             });
 
             var hjList = await SimulationCache.GetAllAsync();
-            // this.txtHj.UseDefault();
-            // this.txtHj.SetData(hjList, nameof(SimulationInfo.SimulationName));
             this.txtHj.Properties.DataSource = hjList;
             this.txtHj.Properties.ValueMember = nameof(SimulationInfo);
-           // this.txtHj.Properties.KeyMember = nameof(SimulationInfo.CreateTime);
+            // this.txtHj.Properties.KeyMember = nameof(SimulationInfo.CreateTime);
             this.txtHj.Properties.DisplayMember = nameof(SimulationInfo.SimulationName);
             this.txtHj.SetSearchGridLookUpEditMultiSelected<SimulationInfo>();
 
-
             using (SimulationContext db = new SimulationContext())
             {
                 var sats = await db.SatInfos.ToListAsync();
@@ -224,11 +222,18 @@ namespace DataSimulation.Forms.EditForms
         private void txtHj_EditValueChanged(object sender, EventArgs e)
         {
             var selectedValue = txtHj.Properties.Tag.MapTo<List<SimulationInfo>>();
-            if (selectedValue != null) {
-                for (int i = 0; i < selectedValue.Count(); i++)
+            if (selectedValue != null)
+            {
+                List<FlightInfo> flightInfos = new List<FlightInfo>();
+                foreach (var item in selectedValue)
                 {
-
+                    var simulationPonitInfo = SimulationCache.GetAllByIDAsync(item.ID, item.CreateTime).Result;
+                    var flinfo = new FlightInfo(item.SimulationName, item.SimulationSpeed);
+                    var fpoinits = simulationPonitInfo.Select(s => new FlightData(s.SimulationLon, s.SimulationLat));
+                    flinfo.flights.AddRange(fpoinits);
+                    flightInfos.Add(flinfo);
                 }
+                mapControl.SetFlightLine(flightInfos);
             }
         }
     }

+ 16 - 1
DataSimulation.Forms/ExtensionsDev/SearchLookUpEditExtension.cs

@@ -122,10 +122,25 @@ namespace ExtensionsDev
             //var keys = new List<string>();
             var texts = new List<string>();
             ctrl.Properties.Tag = values;
-           // ctrl.Tag = keys;
+            // ctrl.Tag = keys;
+            ctrl.Popup += (s, e) =>
+            {
+                view.ClearSelection();
+                view.BeginSelection();
+                for (int i = 0; i < view.RowCount; i++)
+                {
+                    var value = view.GetRow(i);
+                    if (values.Any(a=>a.ToJsonStr()==value.ToJsonStr()))
+                    {
+                        view.SelectRow(i);
+                    }
+                }
+                view.EndSelection();    
+            };
             ctrl.CloseUp += (s, e) =>
             {
                 values.Clear();
+                texts.Clear();
                 var indexs = view.GetSelectedRows();
                 foreach ( var row in indexs )
                 {

+ 4 - 5
DataSimulation.Forms/Properties/licenses.licx

@@ -1,7 +1,6 @@
-DevExpress.XtraEditors.ButtonEdit, DevExpress.XtraEditors.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.TextEdit, DevExpress.XtraEditors.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
 DevExpress.XtraEditors.ImageComboBoxEdit, 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
+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.ComboBoxEdit, DevExpress.XtraEditors.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