Răsfoiți Sursa

Merge branch 'master' of http://139.155.15.221:3000/zoulei/XzXdDw

cherry 1 an în urmă
părinte
comite
50f254e991

+ 2 - 5
XzXdDw.App/Api/低轨GDOP误差椭圆/ErrEllipseHelper.cs

@@ -98,7 +98,7 @@ namespace XzXdDw.App.Api.低轨GDOP误差椭圆
         public double[] SelectPoint { get; set; }
 
         /// <summary>
-        /// 时差误差(Hz)
+        /// 时差误差(s)
         /// </summary>
         public double DtoErr { get; set; }
 
@@ -159,7 +159,7 @@ namespace XzXdDw.App.Api.低轨GDOP误差椭圆
     }
     public static class ErrEllipseHelper
     {
-        private const string GDOPDll = @"Api\低轨GDOP误差椭圆\GDOP\DLL_GDOP_Analysis.dll";
+        private const string GDOPDll = @"Api\低轨GDOP误差椭圆\GDOP\DLL_GD64.dll";
         /// <summary>
         /// 低轨双星误差椭圆
         /// </summary>
@@ -244,9 +244,6 @@ namespace XzXdDw.App.Api.低轨GDOP误差椭圆
 
         public static IEnumerable<(double lon, double lat)> ErrorEllipse2X1D(ErrorEllipseDTO2X1DOption opt)
         {
-
-            List<DtoLinePoint> list = new List<DtoLinePoint>();
-
             int LOP_Len = 0;
             IntPtr LOP_ValuePtr = Error_Ellipse_2X1D(
                 opt.MsEph,

BIN
XzXdDw.App/Api/低轨GDOP误差椭圆/GDOP/DLL_GD64.dll


BIN
XzXdDw.App/Api/低轨GDOP误差椭圆/GDOP/DLL_GDOP_Analysis.dll


+ 0 - 33
XzXdDw.App/Api/低轨GDOP误差椭圆/GdopHelper.cs

@@ -1,33 +0,0 @@
-using DevExpress.Charts.Native;
-using DevExpress.Internal.WinApi.Windows.UI.Notifications;
-using DevExpress.XtraPrinting;
-using Newtonsoft.Json;
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.IO;
-using System.Linq;
-using System.Runtime.InteropServices;
-using System.Text;
-using System.Threading.Tasks;
-using XdCxRhDW.App.DTO;
-using static DevExpress.XtraCharts.GLGraphics.Platform.EGL;
-using static System.Windows.Forms.VisualStyles.VisualStyleElement.TaskbarClock;
-
-namespace XzXdDw.App.Api.低轨GDOP误差椭圆
-{
-    /// <summary>
-    /// Gdop误差分布计算帮助类.该类调用了GdopCore.exe进程
-    /// 每种GDOP算法提供了两个接口,这两种接口是完全等价的,一种传入双行根,一种直接传入卫星状态x、y、z等
-    /// </summary>
-    public static class GdopHelper
-    {
-        private const string GDOPDll = @"Api\低轨GDOP误差椭圆\GDOP\DLL_GDOP_Analysis.dll";
-
-
-        [DllImport(GDOPDll, CallingConvention = CallingConvention.Cdecl)]
-        public static extern void freeBuff(IntPtr buf);
-       
-    }
-    
-}

BIN
XzXdDw.App/Api/星地GDOP误差椭圆/GDOP/GdopCore.exe


+ 80 - 0
XzXdDw.App/Api/星地GDOP误差椭圆/GdopHelper.cs

@@ -367,6 +367,86 @@ namespace XzXdDw.App.Api.星地GDOP误差椭圆
             return ParseResult(2, sb.ToString());
         }
 
+
+        /// <summary>
+        /// 低轨两星GDOP
+        /// </summary>
+        /// <param name="refLonLat">参考站位置 长度2</param>
+        /// <param name="mainTle">主星星历双行根</param>
+        /// <param name="adjaTle">邻星星历双行根</param>
+        /// <param name="time">采集时刻</param>
+        /// <param name="dtousErr">时差误差(us)</param>
+        /// <param name="dfoHzErr">频差误差(Hz)</param>
+        /// <param name="ephLocErr">星历位置误差(m)</param>
+        /// <param name="ephVLocErr">星历速度误差(m/s)</param>
+        /// <param name="fu1">主星上行频点</param>
+        /// <param name="fu2">邻星上行频点</param>
+        /// <returns></returns>
+        /// <exception cref="Exception"></exception>
+        public static (List<SatInfo>, List<ErrDistanceMapLines>) GdopLeoTowSatDRef( double[] refLonLat, string mainTle, string adjaTle, DateTime time, double dtousErr,double dfoHzErr, double ephLocErr,double ephVLocErr,double fuHz1,double fuHz2)
+        {
+            if (string.IsNullOrWhiteSpace(exePath))
+                throw new Exception($"请先调用SetExePath指定{exeName}进程所在路径,支持相对路径");
+            if (!Directory.Exists(exePath))
+                throw new Exception($"路径[{exePath}]不存在");
+            var exeFile = Path.Combine(exePath, exeName);
+            if (!File.Exists(exeFile))
+                throw new Exception($"文件[{exeFile}]不存在");
+            Process p = new Process();
+            p.StartInfo.WorkingDirectory = exePath;
+            p.StartInfo.FileName = exeFile;
+            p.StartInfo.Arguments = $"73 \"{mainTle}\" \"{adjaTle}\" \"{time:yyyy-MM-dd HH:mm:ss.000000}\" {string.Join(" ", refLonLat)} {dtousErr} {dfoHzErr} {ephLocErr} {ephVLocErr} {fuHz1} {fuHz2}";
+            p.StartInfo.CreateNoWindow = true;
+            p.StartInfo.RedirectStandardError = true;
+            p.StartInfo.RedirectStandardOutput = true;
+            p.StartInfo.UseShellExecute = false;
+            StringBuilder sb = new StringBuilder();
+            p.OutputDataReceived += (sender, e) => sb.Append(e.Data);
+            p.Start();
+            p.BeginOutputReadLine();
+            p.WaitForExit();//WaitForExit加了超时时间的话进程退出后不能保证异步流已经读取完成,这是.NET框架的BUG
+            return ParseResult(2, sb.ToString());
+        }
+
+        /// <summary>
+        /// 单星GDOP
+        /// </summary>
+        /// <param name="mainTle">第一刻时刻星历双行根</param>
+        /// <param name="adjaTle1">第二刻时刻星历双行根</param>
+        /// <param name="adjaTle2">第三刻时刻星历双行根></param>
+        /// <param name="time">采集时刻</param>
+        /// <param name="dfoHzErr">频差误差(Hz)</param>
+        /// <param name="ephLocErr">星历位置误差(m</param>
+        /// <param name="ephVLocErr">星历速度误差(m/s)</param>
+        /// <param name="fuHz">卫星上行频点(Hz)</param>
+        /// <returns></returns>
+        /// <exception cref="Exception"></exception>
+        public static (List<SatInfo>, List<ErrDistanceMapLines>) GdopSingleSatDRef(string mainTle, DateTime time1, DateTime time2, DateTime time3, double dfoHzErr, double ephLocErr, double ephVLocErr, double fuHz)
+        {
+            if (string.IsNullOrWhiteSpace(exePath))
+                throw new Exception($"请先调用SetExePath指定{exeName}进程所在路径,支持相对路径");
+            if (!Directory.Exists(exePath))
+                throw new Exception($"路径[{exePath}]不存在");
+            var exeFile = Path.Combine(exePath, exeName);
+            if (!File.Exists(exeFile))
+                throw new Exception($"文件[{exeFile}]不存在");
+            Process p = new Process();
+            p.StartInfo.WorkingDirectory = exePath;
+            p.StartInfo.FileName = exeFile;
+            p.StartInfo.Arguments = $"74 \"{mainTle}\" \"{time1:yyyy-MM-dd HH:mm:ss.000000}\" \"{time2:yyyy-MM-dd HH:mm:ss.000000}\" \"{time3:yyyy-MM-dd HH:mm:ss.000000}\" {dfoHzErr} {ephLocErr} {ephVLocErr} {fuHz}";
+            p.StartInfo.CreateNoWindow = true;
+            p.StartInfo.RedirectStandardError = true;
+            p.StartInfo.RedirectStandardOutput = true;
+            p.StartInfo.UseShellExecute = false;
+            StringBuilder sb = new StringBuilder();
+            p.OutputDataReceived += (sender, e) => sb.Append(e.Data);
+            p.Start();
+            p.BeginOutputReadLine();
+            p.WaitForExit();//WaitForExit加了超时时间的话进程退出后不能保证异步流已经读取完成,这是.NET框架的BUG
+            return ParseResult(1, sb.ToString());
+        }
+
+
         /// <summary>
         /// 两星一地GDOP带参
         /// </summary>

+ 199 - 0
XzXdDw.App/EditForms/SimulationEditor.Designer.cs

@@ -0,0 +1,199 @@
+namespace XzXdDw.App.EditForms
+{
+    partial class SimulationEditor
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl();
+            this.btnOk = new DevExpress.XtraEditors.SimpleButton();
+            this.btnCancel = new DevExpress.XtraEditors.SimpleButton();
+            this.btnFile = new DevExpress.XtraEditors.ButtonEdit();
+            this.Root = new DevExpress.XtraLayout.LayoutControlGroup();
+            this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem();
+            this.layoutControlItem4 = new DevExpress.XtraLayout.LayoutControlItem();
+            this.layoutControlItem5 = new DevExpress.XtraLayout.LayoutControlItem();
+            this.emptySpaceItem3 = new DevExpress.XtraLayout.EmptySpaceItem();
+            this.emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
+            this.layoutControl1.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.btnFile.Properties)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.Root)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem5)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem3)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).BeginInit();
+            this.SuspendLayout();
+            // 
+            // layoutControl1
+            // 
+            this.layoutControl1.Controls.Add(this.btnOk);
+            this.layoutControl1.Controls.Add(this.btnCancel);
+            this.layoutControl1.Controls.Add(this.btnFile);
+            this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.layoutControl1.Location = new System.Drawing.Point(0, 0);
+            this.layoutControl1.Name = "layoutControl1";
+            this.layoutControl1.OptionsCustomizationForm.DesignTimeCustomizationFormPositionAndSize = new System.Drawing.Rectangle(831, 101, 650, 400);
+            this.layoutControl1.Root = this.Root;
+            this.layoutControl1.Size = new System.Drawing.Size(788, 129);
+            this.layoutControl1.TabIndex = 0;
+            this.layoutControl1.Text = "layoutControl1";
+            // 
+            // btnOk
+            // 
+            this.btnOk.Location = new System.Drawing.Point(675, 85);
+            this.btnOk.Name = "btnOk";
+            this.btnOk.Size = new System.Drawing.Size(91, 22);
+            this.btnOk.StyleController = this.layoutControl1;
+            this.btnOk.TabIndex = 8;
+            this.btnOk.Text = "确定";
+            this.btnOk.Click += new System.EventHandler(this.btnOk_Click);
+            // 
+            // btnCancel
+            // 
+            this.btnCancel.Location = new System.Drawing.Point(581, 85);
+            this.btnCancel.Name = "btnCancel";
+            this.btnCancel.Size = new System.Drawing.Size(90, 22);
+            this.btnCancel.StyleController = this.layoutControl1;
+            this.btnCancel.TabIndex = 7;
+            this.btnCancel.Text = "取消";
+            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
+            // 
+            // btnFile
+            // 
+            this.btnFile.AllowDrop = true;
+            this.btnFile.EditValue = "D:\\Developers\\XzXdDw\\XzXdDw.App\\Simulation_Data2023.dat";
+            this.btnFile.Location = new System.Drawing.Point(22, 40);
+            this.btnFile.Name = "btnFile";
+            this.btnFile.Properties.AutoHeight = false;
+            this.btnFile.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
+            new DevExpress.XtraEditors.Controls.EditorButton()});
+            this.btnFile.Properties.NullText = "[EditValue is null]";
+            this.btnFile.Size = new System.Drawing.Size(744, 29);
+            this.btnFile.StyleController = this.layoutControl1;
+            this.btnFile.TabIndex = 4;
+            this.btnFile.Click += new System.EventHandler(this.btnFile_Click);
+            this.btnFile.DragDrop += new System.Windows.Forms.DragEventHandler(this.btnFile_DragDrop);
+            this.btnFile.DragEnter += new System.Windows.Forms.DragEventHandler(this.btnFile_DragEnter);
+            // 
+            // Root
+            // 
+            this.Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True;
+            this.Root.GroupBordersVisible = false;
+            this.Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
+            this.layoutControlItem1,
+            this.layoutControlItem4,
+            this.layoutControlItem5,
+            this.emptySpaceItem3,
+            this.emptySpaceItem1});
+            this.Root.Name = "Root";
+            this.Root.Padding = new DevExpress.XtraLayout.Utils.Padding(20, 20, 20, 20);
+            this.Root.Size = new System.Drawing.Size(788, 129);
+            this.Root.TextVisible = false;
+            // 
+            // layoutControlItem1
+            // 
+            this.layoutControlItem1.Control = this.btnFile;
+            this.layoutControlItem1.Location = new System.Drawing.Point(0, 0);
+            this.layoutControlItem1.MinSize = new System.Drawing.Size(50, 25);
+            this.layoutControlItem1.Name = "layoutControlItem1";
+            this.layoutControlItem1.Size = new System.Drawing.Size(748, 51);
+            this.layoutControlItem1.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
+            this.layoutControlItem1.Text = "仿真文件";
+            this.layoutControlItem1.TextLocation = DevExpress.Utils.Locations.Top;
+            this.layoutControlItem1.TextSize = new System.Drawing.Size(48, 14);
+            // 
+            // layoutControlItem4
+            // 
+            this.layoutControlItem4.Control = this.btnCancel;
+            this.layoutControlItem4.Location = new System.Drawing.Point(559, 63);
+            this.layoutControlItem4.Name = "layoutControlItem4";
+            this.layoutControlItem4.Size = new System.Drawing.Size(94, 26);
+            this.layoutControlItem4.TextSize = new System.Drawing.Size(0, 0);
+            this.layoutControlItem4.TextVisible = false;
+            // 
+            // layoutControlItem5
+            // 
+            this.layoutControlItem5.Control = this.btnOk;
+            this.layoutControlItem5.Location = new System.Drawing.Point(653, 63);
+            this.layoutControlItem5.Name = "layoutControlItem5";
+            this.layoutControlItem5.Size = new System.Drawing.Size(95, 26);
+            this.layoutControlItem5.TextSize = new System.Drawing.Size(0, 0);
+            this.layoutControlItem5.TextVisible = false;
+            // 
+            // emptySpaceItem3
+            // 
+            this.emptySpaceItem3.AllowHotTrack = false;
+            this.emptySpaceItem3.Location = new System.Drawing.Point(0, 63);
+            this.emptySpaceItem3.Name = "emptySpaceItem3";
+            this.emptySpaceItem3.Size = new System.Drawing.Size(559, 26);
+            this.emptySpaceItem3.TextSize = new System.Drawing.Size(0, 0);
+            // 
+            // emptySpaceItem1
+            // 
+            this.emptySpaceItem1.AllowHotTrack = false;
+            this.emptySpaceItem1.Location = new System.Drawing.Point(0, 51);
+            this.emptySpaceItem1.Name = "emptySpaceItem1";
+            this.emptySpaceItem1.Size = new System.Drawing.Size(748, 12);
+            this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0);
+            // 
+            // SimulationEditor
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(788, 129);
+            this.Controls.Add(this.layoutControl1);
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
+            this.Name = "SimulationEditor";
+            this.Text = "TaskEditor";
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).EndInit();
+            this.layoutControl1.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.btnFile.Properties)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.Root)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem5)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem3)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).EndInit();
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private DevExpress.XtraLayout.LayoutControl layoutControl1;
+        private DevExpress.XtraLayout.LayoutControlGroup Root;
+        private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem1;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem1;
+        private DevExpress.XtraEditors.SimpleButton btnOk;
+        private DevExpress.XtraEditors.SimpleButton btnCancel;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem4;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem5;
+        private DevExpress.XtraEditors.ButtonEdit btnFile;
+        private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem3;
+    }
+}

+ 88 - 0
XzXdDw.App/EditForms/SimulationEditor.cs

@@ -0,0 +1,88 @@
+using DevExpress.XtraEditors;
+using System;
+using System.IO;
+using System.Windows.Forms;
+
+namespace XzXdDw.App.EditForms
+{
+    public partial class SimulationEditor : DevExpress.XtraEditors.XtraForm
+    {
+        public string SimulationFile;
+        public SimulationEditor()
+        {
+            InitializeComponent();
+            this.Text = "仿真文件选择";
+            this.StartPosition = FormStartPosition.CenterParent;
+        }
+        private void btnCancel_Click(object sender, EventArgs e)
+        {
+            this.DialogResult = DialogResult.Cancel;
+        }
+        private void btnOk_Click(object sender, EventArgs e)
+        {
+            var file = btnFile.Text;
+            if (string.IsNullOrEmpty(file))
+            {
+                XtraMessageBox.Show("仿真文件不能为空!");
+                return;
+            }
+            if (!File.Exists(file))
+            {
+                XtraMessageBox.Show($"仿真文件{file}不存在!");
+                return;
+            }
+            SimulationFile = file;
+            this.DialogResult = DialogResult.OK;
+
+        }
+
+        private void btnFile_Click(object sender, EventArgs e)
+        {
+            OpenFileDialog openFileDialog = new OpenFileDialog();
+            openFileDialog.InitialDirectory = "c:\\";
+            openFileDialog.Filter = "数据文件|*.dat";
+            openFileDialog.RestoreDirectory = false;
+            openFileDialog.FilterIndex = 1;
+            if (openFileDialog.ShowDialog() == DialogResult.OK)
+            {
+                btnFile.Text = openFileDialog.FileName;
+            }
+        }
+
+        private void btnFile_DragDrop(object sender, DragEventArgs e)
+        {
+            var files = ((System.Array)e.Data.GetData(DataFormats.FileDrop));
+            if (files.Length > 0)
+            {
+                btnFile.Text = files.GetValue(0).ToString();
+
+            }
+        }
+
+        private void btnFile_DragEnter(object sender, DragEventArgs e)
+        {
+            if (e.Data.GetDataPresent(DataFormats.FileDrop))
+            {
+                var files = ((System.Array)e.Data.GetData(DataFormats.FileDrop));
+
+                if (files.Length == 0)
+                {
+                    e.Effect = DragDropEffects.None;
+                    return;
+
+                }
+                string file = files.GetValue(0).ToString();
+                var extension = Path.GetExtension(file);
+                if (File.Exists(file) && extension.ToUpper() == ".dat".ToUpper())
+                {
+                    e.Effect = DragDropEffects.Link;
+                }
+
+            }
+            else
+            {
+                e.Effect = DragDropEffects.None;
+            }
+        }
+    }
+}

+ 120 - 0
XzXdDw.App/EditForms/SimulationEditor.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 23 - 17
XzXdDw.App/UserControl/CtrlPosXd.cs

@@ -84,7 +84,7 @@ namespace XzXdDw.App.UserControl
                     })
                     .AddMenu("手动定位", SvgHelper.LoadFromFile("Image\\Pos.svg"), XdPos)
                     .AddMenu("绘制时差线", SvgHelper.LoadFromFile("Image\\DrawLine.svg"), DrawDtoLine)
-                    .AddMenu("加载仿真数据", SvgHelper.LoadFromFile("Image\\LoadData.svg"), LoadTestData)
+                    .AddMenu("加载仿真数据", SvgHelper.LoadFromFile("Image\\LoadData.svg"), LoadSimulationData)
                     .AddMenu("绘制误差椭圆", SvgHelper.LoadFromFile("Image\\误差椭圆.svg"), DrawErrorEllipse2X1D)
                     .AddMenu("停止加载", SvgHelper.LoadFromFile("Image\\Stop.svg"), () => stoped = true);
 
@@ -110,7 +110,7 @@ namespace XzXdDw.App.UserControl
                 //MapMenu为地图瓦片上右键菜单
                 //AddPosMenu为定位点上右键菜单
                 //RectMenu为框选的区域上右键菜单
-                mapControl1.AddMapMenu("加载仿真数据", SvgHelper.LoadFromFile("Image\\LoadData.svg"), (lon, lat) => LoadTestData())
+                mapControl1.AddMapMenu("加载仿真数据", SvgHelper.LoadFromFile("Image\\LoadData.svg"), (lon, lat) => LoadSimulationData())
                     .AddMapMenu("停止加载", SvgHelper.LoadFromFile("Image\\Stop.svg"), (lon, lat) => stoped = true)
                     .AddMapMenu("GDOP分析", SvgHelper.LoadFromFile("Image\\GDOP.svg"), (lon, lat) =>
                     {
@@ -120,7 +120,7 @@ namespace XzXdDw.App.UserControl
                             if (hideReason == HideReason.Defalut) return;
                             var model = ctrl.Model;
                             var (listSat, data) = GdopHelper.Gdop2Sat1DRef(new double[] { model.StationLon, model.StationLat },
-                                new double[] { model.RefLon, model.RefLat }, model.TleMain, model.TleAdja, model.CapTime, model.DtousErr, model.SatLocErr);
+                              new double[] { model.RefLon, model.RefLat }, model.TleMain, model.TleAdja, model.CapTime, model.DtousErr, model.SatLocErr);
                             if (data == null)
                             {
                                 return;
@@ -220,18 +220,23 @@ namespace XzXdDw.App.UserControl
             }
         }
         bool stoped = false;
-        private async void LoadTestData()
+        private async void LoadSimulationData()
         {
-            //OpenFileDialog openFile = new OpenFileDialog();
-           // openFile.Filter = "文本文件|*.dat";
-            
+            SimulationEditor editor = new SimulationEditor();
+            if (editor.ShowDialog() != DialogResult.OK)
+            {
+                return;
+            }
+           
+            //"Simulation_Data2023.dat"
+            string simulationFile = editor.SimulationFile;
             stoped = false;
 
             //在列表控件中全选+右键可以删除所有测试结果
             using (RHDWContext db = new RHDWContext())
             {
                 var listTx = db.TxInfos.ToList();
-                var lines = File.ReadAllLines("Simulation_Data2023.dat");
+                var lines = File.ReadAllLines(simulationFile);
                 Random r = new Random();
                 foreach (var item in lines)
                 {
@@ -430,26 +435,27 @@ namespace XzXdDw.App.UserControl
                     XtraMessageBox.Show($"未找到定位相关的计算[{item.CgResID}]信息");
                     return;
                 }
+
                 var satTx = listTx.Find(p => p.TxType == EnumTxType.MainSat);
                 var satNTx = listTx.Find(p => p.TxType == EnumTxType.AdjaSat);
                 var cdbTx = listTx.Find(p => p.TxType == EnumTxType.Cdb);
                 var refTx = listTx.Find(p => p.TxType == EnumTxType.Ref);
                 XzXdDw.App.Api.低轨GDOP误差椭圆.ErrorEllipseDTO2X1DOption Option = new XzXdDw.App.Api.低轨GDOP误差椭圆.ErrorEllipseDTO2X1DOption();
-                /*Option.MsEph = new double[] { cg.MainX, cg.MainY, cg.MainZ, 0, 0, 0 };
+                Option.MsEph = new double[] { cg.MainX, cg.MainY, cg.MainZ, 0, 0, 0 };
                 Option.NsEph = new double[] { cg.AdjaX, cg.AdjaY, cg.AdjaZ, 0, 0, 0 };
                 Option.CDBAnt = new double[] { cdbTx.Lon, cdbTx.Lat, 0 };
                 Option.RefGeod = new double[] { refTx.Lon, refTx.Lat, 0 };
                 Option.SelectPoint = new double[3] { item.PosLon, item.PosLat, 0 };
                 Option.DtoErr = 1.0e-6;
-                Option.EphErr = 1.0e3;*/
-
-                Option.MsEph = new double[] { -1608409.905, 5994264.071, 3139843.443, -6633.016931, -374.023436, -2678.1580461 };
-                Option.NsEph = new double[] { -4629566.829, 4978943.601, 1487242.596, -4890.245126, -3337.702797, -4031.339975 };
-                Option.CDBAnt = new double[] { cdbTx.Lon, cdbTx.Lat, 0 };
-                Option.RefGeod = new double[] { 115.5, 9.899, 64 };
-                Option.SelectPoint = new double[2] { -180, -85 }; ;
-                Option.DtoErr = 1.0e-6;
                 Option.EphErr = 1.0e3;
+
+                /*Option.MsEph = new double[] { -41250768, 5295530, 6825975, 0, 0, 0 };
+                Option.NsEph = new double[] { -38198363, 17843895, 8881, 0, 0, 0 };
+                Option.CDBAnt = new double[] { 115, 10, 0 };
+                Option.RefGeod = new double[] { 121, 32, 0 };
+                Option.SelectPoint = new double[3] { -180, -85, 0 };
+                Option.DtoErr = 1.0e-6; //*****目标时差,单位是秒
+                Option.EphErr = 1.0e3;*/
                 var points = XzXdDw.App.Api.低轨GDOP误差椭圆.ErrEllipseHelper.ErrorEllipse2X1D(Option);
                 mapControl1.DrawDtoPonit($"双星[{listSat.FirstOrDefault(m => m.ID == satTx.ID)?.Sat},{listSat.FirstOrDefault(m => m.ID == satNTx.ID)?.Sat}]误差椭圆线", points);
 

+ 10 - 2
XzXdDw.App/XzXdDw.App.csproj

@@ -144,7 +144,6 @@
   </ItemGroup>
   <ItemGroup>
     <Compile Include="Api\低轨GDOP误差椭圆\ErrEllipseHelper.cs" />
-    <Compile Include="Api\低轨GDOP误差椭圆\GdopHelper.cs" />
     <Compile Include="Api\时差粗值预测\DtApi.cs" />
     <Compile Include="Api\时差线\DrawDtoLineHelper.cs" />
     <Compile Include="Api\时差线\DtoLineModel.cs" />
@@ -162,6 +161,12 @@
     <Compile Include="DxHelper\PopupHelper.cs" />
     <Compile Include="DxHelper\SvgHelper.cs" />
     <Compile Include="DxHelper\WaitHelper.cs" />
+    <Compile Include="EditForms\SimulationEditor.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="EditForms\SimulationEditor.Designer.cs">
+      <DependentUpon>SimulationEditor.cs</DependentUpon>
+    </Compile>
     <Compile Include="EditForms\SatEditor.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -332,6 +337,9 @@
     <Compile Include="UserControl\X2D1GDOPParam.Designer.cs">
       <DependentUpon>X2D1GDOPParam.cs</DependentUpon>
     </Compile>
+    <EmbeddedResource Include="EditForms\SimulationEditor.resx">
+      <DependentUpon>SimulationEditor.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="EditForms\SatEditor.resx">
       <DependentUpon>SatEditor.cs</DependentUpon>
     </EmbeddedResource>
@@ -528,7 +536,7 @@
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
     <Content Include="Api\低轨GDOP误差椭圆\GDOP\DLLFunction.h" />
-    <Content Include="Api\低轨GDOP误差椭圆\GDOP\DLL_GDOP_Analysis.dll">
+    <Content Include="Api\低轨GDOP误差椭圆\GDOP\DLL_GD64.dll">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>
     <Content Include="Api\时差线\DLL_LHDW32.dll">