|
@@ -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
|
|
|
{
|
|
@@ -80,7 +81,7 @@ namespace DataSimulation.Forms.EditForms
|
|
|
// 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>();
|
|
|
|
|
@@ -224,11 +225,19 @@ 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);
|
|
|
}
|
|
|
}
|
|
|
}
|