wyq 1 year ago
parent
commit
e216844a6c
32 changed files with 2098 additions and 33 deletions
  1. 86 0
      Service/X2D1NoRefTaskServer54/AddIns/DDC/DDCHelper.cs
  2. BIN
      Service/X2D1NoRefTaskServer54/AddIns/DDC/DigitaDownConverter.exe
  3. BIN
      Service/X2D1NoRefTaskServer54/AddIns/DDC/ippcore-9.0.dll
  4. BIN
      Service/X2D1NoRefTaskServer54/AddIns/DDC/ipps-9.0.dll
  5. BIN
      Service/X2D1NoRefTaskServer54/AddIns/DDC/ippsy8-9.0.dll
  6. 14 0
      Service/X2D1NoRefTaskServer54/AddIns/DDC/readme.txt
  7. BIN
      Service/X2D1NoRefTaskServer54/AddIns/时隙获取/SlotChecker.dll
  8. 26 0
      Service/X2D1NoRefTaskServer54/AddIns/时隙获取/SlotChecker.h
  9. 115 0
      Service/X2D1NoRefTaskServer54/AddIns/时隙获取/SlotHelper.cs
  10. 114 0
      Service/X2D1NoRefTaskServer54/App.config
  11. 76 0
      Service/X2D1NoRefTaskServer54/Controllers/X2D1NoRefTaskProcessingController.cs
  12. 82 0
      Service/X2D1NoRefTaskServer54/HistoryFile.cs
  13. 34 0
      Service/X2D1NoRefTaskServer54/LogHelper.cs
  14. 38 0
      Service/X2D1NoRefTaskServer54/LogInfo.cs
  15. 76 0
      Service/X2D1NoRefTaskServer54/MainForm.Designer.cs
  16. 139 0
      Service/X2D1NoRefTaskServer54/MainForm.cs
  17. 143 0
      Service/X2D1NoRefTaskServer54/MainForm.resx
  18. 153 0
      Service/X2D1NoRefTaskServer54/Program.cs
  19. 36 0
      Service/X2D1NoRefTaskServer54/Properties/AssemblyInfo.cs
  20. 63 0
      Service/X2D1NoRefTaskServer54/Properties/Resources.Designer.cs
  21. 117 0
      Service/X2D1NoRefTaskServer54/Properties/Resources.resx
  22. 26 0
      Service/X2D1NoRefTaskServer54/Properties/Settings.Designer.cs
  23. 7 0
      Service/X2D1NoRefTaskServer54/Properties/Settings.settings
  24. 408 0
      Service/X2D1NoRefTaskServer54/Service/HistoryTaskService.cs
  25. 220 0
      Service/X2D1NoRefTaskServer54/X2D1NoRefTaskServer54.csproj
  26. 16 0
      Service/X2D1NoRefTaskServer54/packages.config
  27. 18 1
      XdCxRhDW.Api/AddIns/GDOP误差椭圆/GDOPAPi.cs
  28. 37 7
      XdCxRhDW.Api/AddIns/GDOP误差椭圆/GdopHelper.cs
  29. 1 1
      XdCxRhDW.App/App.config
  30. 31 23
      XdCxRhDW.App/UserControl/CtrlHome.cs
  31. 7 0
      XdCxRhDW.sln
  32. 15 1
      XdCxRhDw.Dto/SvrStateDto.cs

+ 86 - 0
Service/X2D1NoRefTaskServer54/AddIns/DDC/DDCHelper.cs

@@ -0,0 +1,86 @@
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace X2D1NoRefTaskServer54
+{
+    static class DDCHelper
+    {
+        private static string exePath = "AddIns\\DDC";
+        private const string exeName = "DigitaDownConverter.exe";
+        /// <summary>
+        /// 设置【DigitaDownConverter.exe】文件所在路径,支持相对路径
+        /// </summary>
+        public static void SetExePath(string path)
+        {
+            if (string.IsNullOrWhiteSpace(path)) return;
+            if (path.StartsWith("\\"))//相对路径要么开头不带\,要么是 .\
+                path = path.Remove(0, 1);
+            exePath = path;
+        }
+        /// <summary>
+        /// 对多个频点信号的AD文件做DDC
+        /// </summary>
+        /// <param name="file">输入文件</param>
+        /// <param name="adTime">采集时刻</param>
+        /// <param name="chNo">通道号0-3</param>
+        /// <param name="fsHz">输入文件采样率Hz</param>
+        /// <param name="freqCenterHz">中心频率Hz</param>
+        /// <param name="outDir">输出目录</param>
+        /// <param name="sigs">DDC信号参数</param>
+        /// <param name="timeoutSeconds">超时时间(秒)</param>
+        /// <returns>成功后返回DDC输出的文件</returns>
+        public static List<string> DDC(string file, DateTime adTime, int chNo, long fsHz, long freqCenterHz,
+            string outDir, IEnumerable<DDCSig> sigs, int timeoutSeconds = 60)
+        {
+            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;
+            StringBuilder sb = new StringBuilder();
+            sb.Append($"\"{file}\" \"{outDir}\" {adTime:yyyyMMddHHmmss} {chNo} {fsHz} {freqCenterHz} {sigs.Count()}");
+            List<string> list = new List<string>();
+            foreach (var sig in sigs)
+            {
+                sb.Append(" ").Append(sig.FreqDownHz).Append(" ").Append(sig.Mult);
+                list.Add(Path.Combine(outDir, $"{adTime:yyyyMMddHHmmss}_{sig.FreqDownHz / 1e6:f3}_C{fsHz / sig.Mult}_CH{chNo}.dat"));
+            }
+            p.StartInfo.Arguments = sb.ToString();
+            p.StartInfo.CreateNoWindow = true;
+            p.StartInfo.RedirectStandardError = true;
+            p.StartInfo.RedirectStandardOutput = true;
+            p.StartInfo.UseShellExecute = false;
+            p.Start();
+            var succeed = p.WaitForExit(timeoutSeconds * 1000);
+            if (!succeed)
+            {
+                throw new Exception($"进程[{exeName}]超时未完成!");
+            }
+            return list.Where(x => File.Exists(x)).ToList();
+        }
+    }
+    class DDCSig
+    {
+        /// <summary>
+        /// 信号下行频点Hz
+        /// </summary>
+        public int FreqDownHz { get; set; }
+
+        /// <summary>
+        /// 抽取倍数
+        /// </summary>
+        public int Mult { get; set; }
+
+        public SlotsInfo Slots { get; set; }
+    }
+}

BIN
Service/X2D1NoRefTaskServer54/AddIns/DDC/DigitaDownConverter.exe


BIN
Service/X2D1NoRefTaskServer54/AddIns/DDC/ippcore-9.0.dll


BIN
Service/X2D1NoRefTaskServer54/AddIns/DDC/ipps-9.0.dll


BIN
Service/X2D1NoRefTaskServer54/AddIns/DDC/ippsy8-9.0.dll


+ 14 - 0
Service/X2D1NoRefTaskServer54/AddIns/DDC/readme.txt

@@ -0,0 +1,14 @@
+D:\ztming\data\20240409094240_ADC_ch00.dat D:\ztming\data 20240409094240 0 112000000 227000000 1 252050000 1024
+D:\ztming\data\20240409094240_ADC_ch01.dat D:\ztming\data 20240409094240 1 112000000 227000000 1 252050000 1024
+D:\ztming\data\20240409094240_ADC_ch02.dat D:\ztming\data 20240409094240 2 112000000 227000000 1 252050000 1024
+
+
+std::string fileName = std::string(argv[++idx]);//输入文件
+	std::string opa = std::string(argv[++idx]);//输出路径
+	std::string basetime = std::string(argv[++idx]);//输入文件开始时间
+	int flag = atoi(argv[++idx]);//	通道号
+	__int64 samplingRate = atoll(argv[++idx]);//输入文件采样率 Hz
+	__int64 freqencemid = atoll(argv[++idx]);//输入文件中心频率
+	int sigcount = atoi(argv[++idx]);//信号个数
+	int *multis = new int[sigcount];
+	int *ffcs = new int[sigcount];

BIN
Service/X2D1NoRefTaskServer54/AddIns/时隙获取/SlotChecker.dll


+ 26 - 0
Service/X2D1NoRefTaskServer54/AddIns/时隙获取/SlotChecker.h

@@ -0,0 +1,26 @@
+#pragma once
+
+#ifdef SLOTCHECKER
+#define SlotExport __declspec(dllexport)
+#else
+#define SlotExport __declspec(dllimport)
+#endif
+
+extern "C"
+{
+	// 释放内存
+	SlotExport void freeslots(float *slotst, float *slotle);
+
+	// 获取时间
+	// ifile 输入文件
+	// fbasetime y M d H m s
+	// frequenceM 文件对应频点
+	// fsampleM 原始文件采样率
+	// multi  抽取倍数
+	// slotscount 突发个数
+	// slotst 开始时间  s
+	// slotle 持续时间  ms
+	SlotExport int getslots(char *ifile, unsigned char fbasetime[6]
+		, float *frequenceM, float *fsampleM, int *multi
+		, int *slotscount, float **slotst, float **slotle);
+};

+ 115 - 0
Service/X2D1NoRefTaskServer54/AddIns/时隙获取/SlotHelper.cs

@@ -0,0 +1,115 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Runtime.InteropServices;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace X2D1NoRefTaskServer54
+{
+    static class SlotHelper
+    {
+        #region cpp dll Interop 
+        private const string slotDll = @"AddIns\时隙获取\SlotChecker.dll";
+
+        [DllImport(slotDll, EntryPoint = "getslots", CallingConvention = CallingConvention.Cdecl)]
+        private extern static int GetFileSlots(string file, byte[] fileTime, ref float frequenceM, ref float fsampleM,
+            ref int multi, ref int slotscount, out IntPtr slotst, out IntPtr slotle);
+
+        [DllImport(slotDll, EntryPoint = "freeslots", CallingConvention = CallingConvention.Cdecl)]
+        private extern static void Free(IntPtr slotst, IntPtr slotle);
+        #endregion
+
+        public static SlotsInfo GetFileSlots(string file)
+        {
+            SlotsInfo res = new SlotsInfo();
+            string name = Path.GetFileName(file);
+            res.FreqDownMHz = Convert.ToDouble(name.Split(new string[] { "_", "MHz" }, StringSplitOptions.RemoveEmptyEntries)[1]);
+            byte[] timeData = new byte[6];
+            float frequenceM = 0, fsampleM = 0;
+            int multi = 0, slotscount = 0;
+            IntPtr slotst, slotle;
+            var ret = GetFileSlots(file, timeData, ref frequenceM, ref fsampleM, ref multi, ref slotscount, out slotst, out slotle);
+            if (ret == 0)
+            {
+                res.FrequenceM = (float)((long)((decimal)frequenceM * 1000000) / 1e6);
+                res.FsampleM = fsampleM;
+                res.Multi = multi;
+                res.AdTime = new DateTime(2000 + timeData[0], timeData[1], timeData[2], timeData[3], timeData[4], timeData[5]);
+                float[] startsF = new float[slotscount];
+                float[] lenF = new float[slotscount];
+                Marshal.Copy(slotst, startsF, 0, slotscount);
+                Marshal.Copy(slotle, lenF, 0, slotscount);
+                for (int i = 0; i < slotscount; i++)
+                {
+                    Slot s = new Slot()
+                    {
+                        StartPoint = (int)(fsampleM * 1e6 / multi * startsF[i]),
+                        TimeSeconds = startsF[i],
+                        Len = (int)(fsampleM * 1e6 / multi * lenF[i] * 1e-3)
+                    };
+                    res.Slots.Add(s);
+                }
+            }
+            Free(slotst, slotle);
+            return res;
+        }
+    }
+    /// <summary>
+    /// 突发信息
+    /// </summary>
+    class SlotsInfo
+    {
+        /// <summary>
+        /// 采集时刻
+        /// </summary>
+        public DateTime AdTime { get; set; }
+
+        /// <summary>
+        /// 信号下行频点MHz
+        /// </summary>
+        public double FreqDownMHz { get; set; }
+
+        /// <summary>
+        /// AD采样率
+        /// </summary>
+        public float FsampleM { get; set; }
+
+        /// <summary>
+        /// 信号下行频点
+        /// </summary>
+        public float FrequenceM { get; set; }
+
+        /// <summary>
+        /// 抽取倍数
+        /// </summary>
+        public float Multi { get; set; }
+
+        /// <summary>
+        /// 时隙位置集合
+        /// </summary>
+        public List<Slot> Slots { get; set; } = new List<Slot>();
+    }
+
+    /// <summary>
+    /// 时隙信息
+    /// </summary>
+    class Slot
+    {
+        /// <summary>
+        /// 起始样点
+        /// </summary>
+        public int StartPoint { get; set; }
+
+        /// <summary>
+        /// 结束样点
+        /// </summary>
+        public int Len { get; set; }
+
+        /// <summary>
+        /// 时间的秒数,避免误差
+        /// </summary>
+        public float TimeSeconds { get; set; }
+    }
+}

+ 114 - 0
Service/X2D1NoRefTaskServer54/App.config

@@ -0,0 +1,114 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+	<appSettings>
+		<!--服务ID-->
+		<add key="SvrID" value="001" />
+
+		<!--本地http端口-->
+		<add key="LocalHttpPort" value="8950" />
+
+		<!--定位平台Http地址-->
+		<add key="PosPlatformAddr" value="http://127.0.0.1:8091" />
+
+		<!--检测结果目录-->
+		<add key="DetectDir" value="D:\data\Detect"/>
+
+		<!--采集数据目录-->
+		<add key="CapDir" value="D:\data\AD"/>
+
+		<!--DDC处理后的目录-->
+		<add key="DdcDir" value="D:\data\DDC"/>
+
+		<!--定位结果输出目录-->
+		<add key="PosResDir" value="D:\data\PosRes"/>
+
+		<!--卫星及星历-->
+		<add key ="MainSatInfo" value="23467,-41275189.6404,5820330.8446,6331022.0431"/>
+		<add key ="Adja1SatInfo" value="40892,4694560.4826,41891872.2374,47531.3795"/>
+
+		<!--定位时差系数-->
+		<add key="PosDtoFactor" value="-1"/>
+
+		<!--时差误差-->
+		<add key="DtoErrus" value=""/>
+
+		<!--星历误差-->
+		<add key="EphErrm" value=""/>
+
+	</appSettings>
+	<startup>
+		<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
+	</startup>
+	<runtime>
+		<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+			<dependentAssembly>
+				<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+				<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
+			</dependentAssembly>
+			<dependentAssembly>
+				<assemblyIdentity name="Microsoft.Bcl.AsyncInterfaces" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
+				<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
+			</dependentAssembly>
+			<dependentAssembly>
+				<assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
+				<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
+			</dependentAssembly>
+			<dependentAssembly>
+				<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
+				<bindingRedirect oldVersion="0.0.0.0-4.2.2.0" newVersion="4.2.2.0" />
+			</dependentAssembly>
+			<dependentAssembly>
+				<assemblyIdentity name="Autofac" publicKeyToken="17863af14b0044da" culture="neutral" />
+				<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
+			</dependentAssembly>
+			<dependentAssembly>
+				<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
+				<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
+			</dependentAssembly>
+			<dependentAssembly>
+				<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
+				<bindingRedirect oldVersion="0.0.0.0-5.3.0.0" newVersion="5.3.0.0" />
+			</dependentAssembly>
+			<dependentAssembly>
+				<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
+				<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
+			</dependentAssembly>
+			<dependentAssembly>
+				<assemblyIdentity name="System.Web.Http.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
+				<bindingRedirect oldVersion="0.0.0.0-5.3.0.0" newVersion="5.3.0.0" />
+			</dependentAssembly>
+			<dependentAssembly>
+				<assemblyIdentity name="System.Web.Cors" publicKeyToken="31bf3856ad364e35" culture="neutral" />
+				<bindingRedirect oldVersion="0.0.0.0-5.3.0.0" newVersion="5.3.0.0" />
+			</dependentAssembly>
+			<dependentAssembly>
+				<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
+				<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
+			</dependentAssembly>
+			<dependentAssembly>
+				<assemblyIdentity name="Microsoft.Web.Infrastructure" publicKeyToken="31bf3856ad364e35" culture="neutral" />
+				<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
+			</dependentAssembly>
+			<dependentAssembly>
+				<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
+				<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
+			</dependentAssembly>
+			<dependentAssembly>
+				<assemblyIdentity name="Google.Protobuf" publicKeyToken="a7d26565bac4d604" culture="neutral" />
+				<bindingRedirect oldVersion="0.0.0.0-3.26.0.0" newVersion="3.26.0.0" />
+			</dependentAssembly>
+			<dependentAssembly>
+				<assemblyIdentity name="ZstdSharp" publicKeyToken="8d151af33a4ad5cf" culture="neutral" />
+				<bindingRedirect oldVersion="0.0.0.0-0.7.6.0" newVersion="0.7.6.0" />
+			</dependentAssembly>
+			<dependentAssembly>
+				<assemblyIdentity name="K4os.Compression.LZ4.Streams" publicKeyToken="2186fa9121ef231d" culture="neutral" />
+				<bindingRedirect oldVersion="0.0.0.0-1.3.8.0" newVersion="1.3.8.0" />
+			</dependentAssembly>
+			<dependentAssembly>
+				<assemblyIdentity name="System.IO.Pipelines" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
+				<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
+			</dependentAssembly>
+		</assemblyBinding>
+	</runtime>
+</configuration>

+ 76 - 0
Service/X2D1NoRefTaskServer54/Controllers/X2D1NoRefTaskProcessingController.cs

@@ -0,0 +1,76 @@
+using DevExpress.Utils.Extensions;
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.IO;
+using System.Linq;
+using System.Web.Http;
+using XdCxRhDW.Dto;
+using XdCxRhDW.WebApi;
+using X2D1NoRefTaskServer54.Service;
+
+namespace X2D1NoRefTaskServer54.Controllers
+{
+    /// <summary>
+    ///离线任务处理接口
+    /// </summary>
+    public class X2D1NoRefTaskProcessingController : BaseController
+    {
+        /*******************
+         * !!!不要在Controller中放业务逻辑的全局变量(每次调用Http接口Controller都可能是一个新的对象)
+         * Controller主要就是调用Service层的东西。Service层执行业务逻辑和调用Repository层操作数据库
+         * ********************/
+        private readonly HistoryTaskService _service;
+        public X2D1NoRefTaskProcessingController(HistoryTaskService service)
+        {
+            _service = service;
+        }
+
+
+        /// <summary>
+        /// 执行离线任务
+        /// </summary>
+        /// <param name="dto">离线任务信息</param>
+        /// <returns></returns>
+        [HttpPost]
+        public AjaxResult Run(X2D1NoRefTaskHandleDto dto)
+        {
+            try
+            {
+                LogHelper.Info($"接收到两星一地历史任务编号:{dto.ID}");
+                _service.StartAsync(dto);
+                return Success();
+            }
+            catch (Exception ex)
+            {
+                Serilog.Log.Error(ex, "两星一地历史任务处理出错!");
+                return Error("两星一地历史任务处理出错");
+            }
+        }
+
+
+        /// <summary>
+        /// 历史任务停止
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        public AjaxResult Stop(TaskStopHandleDto dto)
+        {
+            try
+            {
+
+                LogHelper.Warning($"接收停止两星一地历史任务编号:{dto.ID}");
+                _service.Stop();
+                return Success();
+            }
+            catch (Exception ex)
+            {
+                Serilog.Log.Error(ex, "停止两星一地历史任务处理出错!");
+                return Error("停止两星一地历史任务处理出错");
+            }
+        }
+
+
+    }
+}

+ 82 - 0
Service/X2D1NoRefTaskServer54/HistoryFile.cs

@@ -0,0 +1,82 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Security;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace X2D1NoRefTaskServer54
+{
+    public class CheckResFile
+    {
+        /// <summary>
+        /// 文件(含路径)
+        /// </summary>
+        public string File { get; set; }
+
+        /// <summary>
+        /// 下行频点MHz
+        /// </summary>
+        public double FreqDownMHz { get; set; }
+
+        /// <summary>
+        /// 日期(精度到天)
+        /// </summary>
+        public DateTime DayTime { get; set; }
+
+        /// <summary>
+        /// 序号
+        /// </summary>
+        public long FlagNo { get; set; }
+
+    }
+
+    public class AdFile
+    {
+        /// <summary>
+        /// 文件(含路径)
+        /// </summary>
+        public string File { get; set; }
+
+        /// <summary>
+        /// 采集时刻
+        /// </summary>
+        public DateTime AdTime { get; set; }
+
+        /// <summary>
+        /// 通道号
+        /// </summary>
+        public int ChNo { get; set; }
+    }
+
+    public class DDCFile
+    {
+        /// <summary>
+        /// 文件(含路径)
+        /// </summary>
+        public string File { get; set; }
+
+        /// <summary>
+        /// 采集时刻
+        /// </summary>
+        public DateTime AdTime { get; set; }
+
+        /// <summary>
+        /// 通道号
+        /// </summary>
+        
+        public int ChNo { get; set; }
+
+        /// <summary>
+        /// 下行频点MHz
+        /// </summary>
+
+        public double FreqDownMHz { get; set; }
+
+        /// <summary>
+        /// 采样率Hz
+        /// </summary>
+
+        public int Fs { get; set; }
+    }
+}

+ 34 - 0
Service/X2D1NoRefTaskServer54/LogHelper.cs

@@ -0,0 +1,34 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace X2D1NoRefTaskServer54
+{
+    public static class LogHelper
+    {
+        public static Action<LogInfo> Logger;
+        public static void Info(string msg)
+        {
+            Serilog.Log.Information(msg);
+            Logger?.Invoke(new LogInfo() { LogType = EnumLogType.Info, Msg = msg });
+        }
+        public static void Warning(string msg, Exception ex = null)
+        {
+            Serilog.Log.Warning(ex, msg);
+            Logger?.Invoke(new LogInfo() { LogType = EnumLogType.Warning, Msg = msg });
+        }
+        public static void Error(string msg, Exception ex = null)
+        {
+            if (ex != null && ex.GetType() == typeof(AggregateException))
+            {
+                var iex = (ex as AggregateException).InnerExceptions.FirstOrDefault();
+                if (iex != null)
+                    ex = iex;
+            }
+            Serilog.Log.Error(ex, msg);
+            Logger?.Invoke(new LogInfo() { LogType = EnumLogType.Error, Msg = msg });
+        }
+    }
+}

+ 38 - 0
Service/X2D1NoRefTaskServer54/LogInfo.cs

@@ -0,0 +1,38 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace X2D1NoRefTaskServer54
+{
+    public class LogInfo
+    {
+        public LogInfo()
+        {
+            this.LogTime = DateTime.Now;
+            this.LogType = EnumLogType.Info;
+        }
+        [Display(Name = "时间")]
+        public DateTime LogTime { get; private set; }
+
+        [Display(Name = "日志类型")]
+        public EnumLogType LogType { get; set; }
+
+        [Display(Name = "内容")]
+        public string Msg { get; set; }
+    }
+    public enum EnumLogType
+    {
+        [Display(Name = "消息")]
+        Info,
+
+        [Display(Name = "警告")]
+        Warning,
+
+        [Display(Name = "错误")]
+        Error
+    }
+}

+ 76 - 0
Service/X2D1NoRefTaskServer54/MainForm.Designer.cs

@@ -0,0 +1,76 @@
+namespace X2D1NoRefTaskServer54
+{
+    partial class MainForm
+    {
+        /// <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()
+        {
+            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
+            this.gridLog = new DevExpress.XtraGrid.GridControl();
+            this.gridView1 = new DevExpress.XtraGrid.Views.Grid.GridView();
+            ((System.ComponentModel.ISupportInitialize)(this.gridLog)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.gridView1)).BeginInit();
+            this.SuspendLayout();
+            // 
+            // gridLog
+            // 
+            this.gridLog.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.gridLog.Location = new System.Drawing.Point(0, 0);
+            this.gridLog.MainView = this.gridView1;
+            this.gridLog.Name = "gridLog";
+            this.gridLog.Size = new System.Drawing.Size(823, 394);
+            this.gridLog.TabIndex = 0;
+            this.gridLog.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
+            this.gridView1});
+            // 
+            // gridView1
+            // 
+            this.gridView1.GridControl = this.gridLog;
+            this.gridView1.Name = "gridView1";
+            // 
+            // MainForm
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(823, 394);
+            this.Controls.Add(this.gridLog);
+            this.IconOptions.SvgImage = ((DevExpress.Utils.Svg.SvgImage)(resources.GetObject("MainForm.IconOptions.SvgImage")));
+            this.Name = "MainForm";
+            this.Text = "两星一地离线数据处理服务";
+            this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.MainForm_FormClosed);
+            this.Load += new System.EventHandler(this.MainForm_LoadAsync);
+            ((System.ComponentModel.ISupportInitialize)(this.gridLog)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.gridView1)).EndInit();
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private DevExpress.XtraGrid.GridControl gridLog;
+        private DevExpress.XtraGrid.Views.Grid.GridView gridView1;
+    }
+}

+ 139 - 0
Service/X2D1NoRefTaskServer54/MainForm.cs

@@ -0,0 +1,139 @@
+using DevExpress.Utils;
+using DxHelper;
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using XdCxRhDW.Dto;
+using XdCxRhDW.WebApi;
+
+namespace X2D1NoRefTaskServer54
+{
+    public partial class MainForm : DevExpress.XtraEditors.XtraForm
+    {
+        List<LogInfo> list = new List<LogInfo>();
+        public MainForm()
+        {
+            InitializeComponent();
+            gridLog.UseDefault(list).UseExportCsv().UseClear<LogInfo>().SetLogImageColumn(nameof(LogInfo.LogType), typeof(EnumLogType));
+            gridView1.Columns[nameof(LogInfo.LogType)].MaxWidth = 100;
+            gridView1.Columns[nameof(LogInfo.LogTime)].MaxWidth = 160;
+            gridView1.Columns[nameof(LogInfo.Msg)].AppearanceCell.TextOptions.HAlignment = HorzAlignment.Near;
+            this.IconOptions.SvgImage = DxHelper.SvgHelper.LoadFromFile("Service.svg");
+            LogHelper.Logger = info =>
+            {
+                try
+                {
+                    list.Insert(0, info);
+                    this.Invoke(new Action(() => gridView1.RefreshData()));
+                }
+                catch
+                { }
+            };
+        }
+
+        private async void MainForm_LoadAsync(object sender, EventArgs e)
+        {
+            var port = Convert.ToInt32(ConfigurationManager.AppSettings["LocalHttpPort"].Trim());
+            var svrID = ConfigurationManager.AppSettings["SvrID"].Trim();
+            var posPlatformAddr = ConfigurationManager.AppSettings["PosPlatformAddr"].Trim();
+            this.Text = EnumSvrType.X2D1NoRefTask54.GetEnumDisplayName() + "-" + svrID;
+            string localIp;
+            string getIpUrl = $"{posPlatformAddr}/api/task/getclientip";
+            while (true)
+            {
+                try
+                {
+                    var rsp = await HttpHelper.GetRequestAsync<string>(getIpUrl, 10);
+                    if (rsp.code == 0)
+                    {
+                        LogHelper.Error(rsp.msg);
+                        return;
+                    }
+                    else
+                    {
+                        localIp = rsp.data;
+                    }
+                    break;
+                }
+                catch (Exception ex)
+                {
+                    LogHelper.Error($"无法连接到平台{getIpUrl},请检测地址是否正确并确保平台防火墙允许端口通过", ex);
+                    await Task.Delay(5000);
+                }
+            }
+            LogHelper.Info($"本机IP={localIp}");
+            Startup.Start(port, $"{System.Reflection.Assembly.GetExecutingAssembly().GetName().Name}.xml", "XdCxRhDW.Dto.xml");
+            LogHelper.Info($"服务启动成功.接口地址http://{localIp}:{port}/swagger");
+
+            string url;
+            if (posPlatformAddr.EndsWith("/"))
+                url = posPlatformAddr + "api/SvrReport/Report";
+            else
+                url = posPlatformAddr + "/api/SvrReport/Report";
+            bool preSucceed = false;
+            while (!this.Disposing)
+            {
+                try
+                {
+                    var res = await HttpHelper.PostRequestAsync<object>(url, new SvrStateReportDto()
+                    {
+                        SvrType = EnumSvrType.X2D1NoRefTask54,
+                        SvrID = svrID,
+                        ReportType = 0,
+                        BaseHttpAddr = $"http://{localIp}:{port}",
+                        SwaggerAddr = $"http://{localIp}:{port}/Swagger",
+                    });
+                    if (res.code != 200)
+                    {
+                        LogHelper.Error($"状态上报异常[url={url}].{res.msg}");
+                        preSucceed = false;
+                    }
+                    else
+                    {
+                        if (!preSucceed)
+                            LogHelper.Info($"状态上报成功![url={url}]");
+                        preSucceed = true;
+                    }
+                }
+                catch (Exception ex)
+                {
+                    LogHelper.Error($"状态上报异常[url={url}]", ex);
+                    preSucceed = false;
+                }
+                await System.Threading.Tasks.Task.Delay(6000);
+            }
+        }
+
+        private void MainForm_FormClosed(object sender, FormClosedEventArgs e)
+        {
+            try
+            {
+                var port = Convert.ToInt32(ConfigurationManager.AppSettings["LocalHttpPort"].Trim());
+                var svrID = ConfigurationManager.AppSettings["SvrID"].Trim();
+                var posPlatformAddr = ConfigurationManager.AppSettings["PosPlatformAddr"].Trim();
+                string url;
+                if (posPlatformAddr.EndsWith("/"))
+                    url = posPlatformAddr + "api/SvrReport/Report";
+                else
+                    url = posPlatformAddr + "/api/SvrReport/Report";
+                var localIp = IpHelper.GetLocalIp();
+
+
+                _ = HttpHelper.PostRequestAsync<object>(url, new SvrStateReportDto()
+                {
+                    SvrID = svrID,
+                    SvrType = EnumSvrType.X2D1NoRefTask54,
+                    ReportType = 1,
+                    BaseHttpAddr = $"http://{localIp}:{port}",
+                });
+
+            }
+            catch (Exception ex)
+            {
+                LogHelper.Error("状态上报异常", ex);
+            }
+        }
+    }
+}

+ 143 - 0
Service/X2D1NoRefTaskServer54/MainForm.resx

@@ -0,0 +1,143 @@
+<?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>
+  <assembly alias="DevExpress.Data.v23.2" name="DevExpress.Data.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
+  <data name="MainForm.IconOptions.SvgImage" type="DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v23.2" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        AAEAAAD/////AQAAAAAAAAAMAgAAAFlEZXZFeHByZXNzLkRhdGEudjIzLjIsIFZlcnNpb249MjMuMi4z
+        LjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjg4ZDE3NTRkNzAwZTQ5YQUBAAAAHURl
+        dkV4cHJlc3MuVXRpbHMuU3ZnLlN2Z0ltYWdlAQAAAAREYXRhBwICAAAACQMAAAAPAwAAAIQDAAAC77u/
+        PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0nVVRGLTgnPz4NCjxzdmcgeD0iMHB4IiB5PSIwcHgi
+        IHZpZXdCb3g9IjAgMCAzMiAzMiIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcv
+        MjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWw6c3Bh
+        Y2U9InByZXNlcnZlIiBpZD0iTGF5ZXJfMSIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAg
+        MzIgMzIiPg0KICA8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLlllbGxvd3tmaWxsOiNGRkIxMTU7fQoJ
+        LlJlZHtmaWxsOiNEMTFDMUM7fQoJLkJsYWNre2ZpbGw6IzcyNzI3Mjt9CgkuQmx1ZXtmaWxsOiMxMTc3
+        RDc7fQoJLldoaXRle2ZpbGw6I0ZGRkZGRjt9CgkuR3JlZW57ZmlsbDojMDM5QzIzO30KCS5zdDB7b3Bh
+        Y2l0eTowLjc1O30KCS5zdDF7b3BhY2l0eTowLjU7fQoJLnN0MntvcGFjaXR5OjAuMjU7fQoJLnN0M3tm
+        aWxsOiNGRkIxMTU7fQo8L3N0eWxlPg0KICA8ZyAvPg0KICA8ZyBpZD0iU2VydmVyTW9kZSI+DQogICAg
+        PHBhdGggZD0iTTI3LDIwSDVjLTAuNSwwLTEsMC41LTEsMXY0YzAsMC41LDAuNSwxLDEsMWgyMmMwLjUs
+        MCwxLTAuNSwxLTF2LTRDMjgsMjAuNSwyNy41LDIwLDI3LDIweiBNOCwyNEg2di0yaDJWMjQgICB6IE0y
+        NywxMkg1Yy0wLjUsMC0xLDAuNS0xLDF2NGMwLDAuNSwwLjUsMSwxLDFoMjJjMC41LDAsMS0wLjUsMS0x
+        di00QzI4LDEyLjUsMjcuNSwxMiwyNywxMnogTTgsMTZINnYtMmgyVjE2eiBNMjcsNEg1ICAgQzQuNSw0
+        LDQsNC41LDQsNXY0YzAsMC41LDAuNSwxLDEsMWgyMmMwLjUsMCwxLTAuNSwxLTFWNUMyOCw0LjUsMjcu
+        NSw0LDI3LDR6IE04LDhINlY2aDJWOHoiIGNsYXNzPSJCbGFjayIgLz4NCiAgPC9nPg0KPC9zdmc+Cw==
+</value>
+  </data>
+</root>

+ 153 - 0
Service/X2D1NoRefTaskServer54/Program.cs

@@ -0,0 +1,153 @@
+using DevExpress.LookAndFeel;
+using DevExpress.XtraEditors;
+using Microsoft.Win32;
+using Serilog;
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Diagnostics;
+using System.IO;
+using System.Linq;
+using System.Reflection;
+using System.Security.Principal;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace X2D1NoRefTaskServer54
+{
+    internal static class Program
+    {
+        static Program()
+        {
+
+            //设置私有路径
+            Environment.CurrentDirectory = AppDomain.CurrentDomain.BaseDirectory;
+            AppDomain.CurrentDomain.SetData("PRIVATE_BINPATH", "AddIns;");
+            var m = typeof(AppDomainSetup).GetMethod("UpdateContextProperty", BindingFlags.NonPublic | BindingFlags.Static);
+            var funsion = typeof(AppDomain).GetMethod("GetFusionContext", BindingFlags.NonPublic | BindingFlags.Instance);
+            m.Invoke(null, new object[] { funsion.Invoke(AppDomain.CurrentDomain, null), "PRIVATE_BINPATH", "AddIns;" });
+
+            //c++dll加入环境变量
+            string paths = Environment.GetEnvironmentVariable("PATH");
+            var dirs = Directory.EnumerateDirectories("AddIns", "*", SearchOption.AllDirectories);
+            List<string> list = new List<string>
+            {
+                Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "AddIns")
+            };
+            foreach (var item in dirs)
+            {
+                list.Add(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, item));
+            }
+            Environment.SetEnvironmentVariable("PATH", $"{paths};{string.Join(";", list)}");
+
+            AppDomain.CurrentDomain.UnhandledException += (sender, e) =>
+            {
+                var args = e.ExceptionObject as Exception;
+                Serilog.Log.Error(args, "出现未处理的异常,程序即将退出!");
+                DxHelper.MsgBoxHelper.ShowError("出现未处理的异常,程序即将退出!");
+            };
+            Application.ThreadException += (sender, e) =>
+            {
+                DxHelper.MsgBoxHelper.ShowError($"出现未处理的线程异常!{e.Exception.Message}");
+                Serilog.Log.Error(e.Exception, "出现未处理的线程异常");
+            };
+        }
+        static bool IsRunningAsAdmin()
+        {
+            bool result;
+            try
+            {
+                WindowsIdentity identity = WindowsIdentity.GetCurrent();
+                WindowsPrincipal principal = new WindowsPrincipal(identity);
+                result = principal.IsInRole(WindowsBuiltInRole.Administrator);
+            }
+            catch
+            {
+                result = false;
+            }
+            return result;
+        }
+        static void RestartAsAdmin()
+        {
+            var startInfo = new ProcessStartInfo();
+            startInfo.FileName = Application.ExecutablePath;
+            startInfo.Verb = "runas"; // 以管理员身份运行
+            try
+            {
+                Process.Start(startInfo);
+            }
+            catch (System.ComponentModel.Win32Exception)
+            {
+                // 用户取消了管理员权限提示,或者其他错误
+                // 可以在此处处理错误情况
+            }
+
+            Application.Exit();
+        }
+        //win10及以上版本管理员运行无法访问网络映射盘等,需要修改注册表并且重启设备
+        static void CheckUACReg()
+        {
+            try
+            {
+                RegistryKey key = Registry.LocalMachine;
+                RegistryKey system = key.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Policies\System", true);
+                if (system == null)
+                {
+                    system = key.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Policies\System");
+                }
+                object obj = system.GetValue("EnableLinkedConnections");
+                if (obj == null || (int)obj != 1)
+                {
+                    system.SetValue("EnableLinkedConnections", Convert.ToInt32(1), RegistryValueKind.DWord);
+                }
+            }
+            catch (Exception ex)
+            {
+                Serilog.Log.Error(ex, "修改UAC注册表信息异常!");
+            }
+        }
+        /// <summary>
+        /// 应用程序的主入口点。
+        /// </summary>
+        [STAThread]
+        static void Main()
+        {
+            string outputTemplate = "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {Message:lj}{NewLine}  {Exception}";
+            Serilog.Log.Logger = new Serilog.LoggerConfiguration()
+                .WriteTo.Console(outputTemplate: outputTemplate)
+                .WriteTo.Logger(p => p.Filter.ByIncludingOnly(e => e.Level == Serilog.Events.LogEventLevel.Information)
+                    .WriteTo.File("Logs\\Info\\.log", rollingInterval: Serilog.RollingInterval.Day))
+                .WriteTo.Logger(p => p.Filter.ByIncludingOnly(e => e.Level == Serilog.Events.LogEventLevel.Warning)
+                    .WriteTo.File("Logs\\Warning\\.log", rollingInterval: Serilog.RollingInterval.Day))
+                .WriteTo.Logger(p => p.Filter.ByIncludingOnly(e => e.Level == Serilog.Events.LogEventLevel.Error)
+                    .WriteTo.File("Logs\\Error\\.log", rollingInterval: Serilog.RollingInterval.Day, outputTemplate: outputTemplate))
+                .CreateLogger();
+
+            WindowsFormsSettings.AllowDpiScale = true;
+            WindowsFormsSettings.AllowHoverAnimation = DevExpress.Utils.DefaultBoolean.True;
+            WindowsFormsSettings.AllowDefaultSvgImages = DevExpress.Utils.DefaultBoolean.True;
+            WindowsFormsSettings.AllowRoundedWindowCorners = DevExpress.Utils.DefaultBoolean.True;
+            WindowsFormsSettings.AnimationMode = AnimationMode.EnableAll;
+            WindowsFormsSettings.BackgroundSkinningMode = BackgroundSkinningMode.AllColors;
+            WindowsFormsSettings.DefaultAllowHtmlDraw = true;
+            WindowsFormsSettings.DefaultLookAndFeel.SetSkinStyle(SkinStyle.WXICompact);
+            WindowsFormsSettings.DefaultFont = new System.Drawing.Font("微软雅黑", 10f);
+            WindowsFormsSettings.SetPerMonitorDpiAware();
+            if (Debugger.IsAttached)
+            {
+                //DevExpress23.2以上版本查看未本地化的资源
+                //DevExpress.Utils.Localization.XtraLocalizer.EnableTraceSource();
+            }
+            if (IsRunningAsAdmin())
+            {
+                XdCxRhDW.ChsLocalizer.UseChs();
+                MainForm mainForm = new MainForm();
+                System.Windows.Forms.Application.Run(mainForm);
+            }
+            else
+            {
+                RestartAsAdmin();
+            }
+        }
+    }
+}

+ 36 - 0
Service/X2D1NoRefTaskServer54/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 有关程序集的一般信息由以下
+// 控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("X2D1NoRefTaskServer54")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("X2D1NoRefTaskServer54")]
+[assembly: AssemblyCopyright("Copyright ©  2024")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// 将 ComVisible 设置为 false 会使此程序集中的类型
+//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
+//请将此类型的 ComVisible 特性设置为 true。
+[assembly: ComVisible(false)]
+
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
+[assembly: Guid("c1becb5b-a11e-4a10-988f-1056fe60e689")]
+
+// 程序集的版本信息由下列四个值组成: 
+//
+//      主版本
+//      次版本
+//      生成号
+//      修订号
+//
+//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
+//通过使用 "*",如下所示:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 63 - 0
Service/X2D1NoRefTaskServer54/Properties/Resources.Designer.cs

@@ -0,0 +1,63 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     此代码由工具生成。
+//     运行时版本:4.0.30319.42000
+//
+//     对此文件的更改可能会导致不正确的行为,并且如果
+//     重新生成代码,这些更改将会丢失。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace X2D1NoRefTaskServer54.Properties {
+    using System;
+    
+    
+    /// <summary>
+    ///   一个强类型的资源类,用于查找本地化的字符串等。
+    /// </summary>
+    // 此类是由 StronglyTypedResourceBuilder
+    // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
+    // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
+    // (以 /str 作为命令选项),或重新生成 VS 项目。
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    internal class Resources {
+        
+        private static global::System.Resources.ResourceManager resourceMan;
+        
+        private static global::System.Globalization.CultureInfo resourceCulture;
+        
+        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+        internal Resources() {
+        }
+        
+        /// <summary>
+        ///   返回此类使用的缓存的 ResourceManager 实例。
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Resources.ResourceManager ResourceManager {
+            get {
+                if (object.ReferenceEquals(resourceMan, null)) {
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("X2D1NoRefTaskServer54.Properties.Resources", typeof(Resources).Assembly);
+                    resourceMan = temp;
+                }
+                return resourceMan;
+            }
+        }
+        
+        /// <summary>
+        ///   重写当前线程的 CurrentUICulture 属性,对
+        ///   使用此强类型资源类的所有资源查找执行重写。
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Globalization.CultureInfo Culture {
+            get {
+                return resourceCulture;
+            }
+            set {
+                resourceCulture = value;
+            }
+        }
+    }
+}

+ 117 - 0
Service/X2D1NoRefTaskServer54/Properties/Resources.resx

@@ -0,0 +1,117 @@
+<?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.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: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" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+            </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" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+            </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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 26 - 0
Service/X2D1NoRefTaskServer54/Properties/Settings.Designer.cs

@@ -0,0 +1,26 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     此代码由工具生成。
+//     运行时版本:4.0.30319.42000
+//
+//     对此文件的更改可能会导致不正确的行为,并且如果
+//     重新生成代码,这些更改将会丢失。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace X2D1NoRefTaskServer54.Properties {
+    
+    
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.8.0.0")]
+    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
+        
+        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+        
+        public static Settings Default {
+            get {
+                return defaultInstance;
+            }
+        }
+    }
+}

+ 7 - 0
Service/X2D1NoRefTaskServer54/Properties/Settings.settings

@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
+  <Profiles>
+    <Profile Name="(Default)" />
+  </Profiles>
+  <Settings />
+</SettingsFile>

+ 408 - 0
Service/X2D1NoRefTaskServer54/Service/HistoryTaskService.cs

@@ -0,0 +1,408 @@
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Diagnostics;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+using XdCxRhDW.Api;
+using XdCxRhDW.Dto;
+
+namespace X2D1NoRefTaskServer54.Service
+{
+    //业务逻辑处理类
+    public class HistoryTaskService
+    {
+        private readonly string baseUrl;
+        CancellationTokenSource cts;
+
+        string DetectDir;
+        string CapDir;
+        string DdcDir;
+        string PosResDir;
+        int MainSatCode, Adja1SatCode;
+        double[] MainSatXYZ, Adja1SatXYZ;
+        int PosDtoFactor;
+        public HistoryTaskService()
+        {
+            var posPlatformAddr = ConfigurationManager.AppSettings["PosPlatformAddr"].Trim();//like http://127.0.0.1:8091 or http://127.0.0.1:8091/
+            if (posPlatformAddr.EndsWith("/"))
+                this.baseUrl = posPlatformAddr + "api/";
+            else
+                this.baseUrl = posPlatformAddr + "/api/";
+
+            DetectDir = ConfigurationManager.AppSettings["DetectDir"].Trim();
+            CapDir = ConfigurationManager.AppSettings["CapDir"].Trim();
+            DdcDir = ConfigurationManager.AppSettings["DdcDir"].Trim();
+            PosResDir = ConfigurationManager.AppSettings["PosResDir"].Trim();
+            var PosDtoFactorstr = ConfigurationManager.AppSettings["PosDtoFactor"].Trim();
+            int.TryParse(PosDtoFactorstr, out PosDtoFactor);
+            if (PosDtoFactor == 0) PosDtoFactor = 1;
+        }
+        public void StartAsync(X2D1NoRefTaskHandleDto dto)
+        {
+            cts = new CancellationTokenSource();
+            Task.Run(async () =>
+            {
+                LogHelper.Info($"【任务{dto.ID}】开始执行...");
+                //点击定位平台右上角查看接口可以在浏览器中查看平台提供的所有接口详细信息
+                while (!cts.IsCancellationRequested)
+                {
+                    try
+                    {
+                        #region 第1步,读取需要的配置信息
+                        if (!Directory.Exists(DetectDir))
+                        {
+                            StopTask(dto.ID, EnumTaskStopType.Error, $"检测结果目录[{DetectDir}]不存在");
+                            return;
+                        }
+                        if (!Directory.Exists(CapDir))
+                        {
+                            StopTask(dto.ID, EnumTaskStopType.Error, $"AD采集目录[{CapDir}]不存在");
+                            return;
+                        }
+                        Directory.CreateDirectory(DdcDir);
+                        Directory.CreateDirectory(PosResDir);
+                        LogHelper.Info($"【任务{dto.ID}】检测结果目录[{DetectDir}]");
+                        LogHelper.Info($"【任务{dto.ID}】AD采集目录[{CapDir}]");
+                        LogHelper.Info($"【任务{dto.ID}】DDC输出目录[{DdcDir}]");
+                        try
+                        {
+                            var mainInfo = ConfigurationManager.AppSettings["MainSatInfo"].Replace(",", ",").Trim();
+                            var adja1Info = ConfigurationManager.AppSettings["Adja1SatInfo"].Replace(",", ",").Trim();
+                            //var adja2Info = ConfigurationManager.AppSettings["Adja2SatInfo"].Replace(",", ",").Trim();
+                            var arr1 = mainInfo.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
+                            var arr2 = adja1Info.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
+                            // var arr3 = adja2Info.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
+                            MainSatCode = Convert.ToInt32(arr1[0]);
+                            Adja1SatCode = Convert.ToInt32(arr2[0]);
+                            //Adja2SatCode = Convert.ToInt32(arr3[0]);
+                            MainSatXYZ = new double[3] { Convert.ToDouble(arr1[1]), Convert.ToDouble(arr1[2]), Convert.ToDouble(arr1[3]) };
+                            Adja1SatXYZ = new double[3] { Convert.ToDouble(arr2[1]), Convert.ToDouble(arr2[2]), Convert.ToDouble(arr2[3]) };
+                            //Adja2SatXYZ = new double[3] { Convert.ToDouble(arr3[1]), Convert.ToDouble(arr3[2]), Convert.ToDouble(arr3[3]) };
+                        }
+                        catch
+                        {
+                            StopTask(dto.ID, EnumTaskStopType.Error, $"任务处理服务配置文件卫星信息解析出错");
+                            return;
+                        }
+                        #endregion
+
+                        #region 第2步,扫描检测结果目录
+                        var groupFiles = Directory.EnumerateFiles(DetectDir, "*.dat", SearchOption.TopDirectoryOnly).Select(p => StringToCheckResFile(p))
+                             .GroupBy(m => Convert.ToInt64(m.DayTime.ToString("yyyyMMdd") + m.FlagNo)).OrderBy(m => m.Key);
+                        if (!groupFiles.Any())
+                        {
+                            LogHelper.Info($"【任务{dto.ID}】等待扫描文件...");
+                            await Task.Delay(10000);
+                        }
+                        foreach (var groupFile in groupFiles)//每一组文件代表同一个时刻的
+                        {
+                            if (cts.IsCancellationRequested) break;
+                            List<SlotsInfo> listSlotsInfo = new List<SlotsInfo>();//多个频点的时隙结果
+                            foreach (var item in groupFile)
+                            {
+                                var slotsInfo = SlotHelper.GetFileSlots(item.File);//某个频点的所有时隙
+                                if (!Debugger.IsAttached)
+                                    File.Delete(item.File);//检测检测结果文件
+                                if (slotsInfo.Slots.Any())
+                                    listSlotsInfo.Add(slotsInfo);
+                                LogHelper.Warning($"【任务{dto.ID}】{slotsInfo.AdTime:yyyyMMddHHmmss}时刻频点{slotsInfo.FreqDownMHz}共{slotsInfo.Slots.Count}个突发");
+                            }
+                            if (!listSlotsInfo.Any()) continue;
+                            var adFiles = Directory.EnumerateFiles(CapDir, "*.dat", SearchOption.TopDirectoryOnly).Select(p => StringToAdFile(p))
+                                .Where(p => p.AdTime == listSlotsInfo.First().AdTime);
+                            if (!adFiles.Any())
+                            {
+                                LogHelper.Warning($"【任务{dto.ID}】{listSlotsInfo.First().AdTime:yyyyMMddHHmmss}时刻找不到原始AD文件,跳过此组文件");
+                                continue;
+                            }
+                            var first = listSlotsInfo.First();
+                            var sigs = listSlotsInfo.Select(p => new DDCSig() { FreqDownHz = (int)(p.FreqDownMHz * 1e6), Mult = (int)first.Multi, Slots = p });
+                            List<DDCFile> chDDCFiles = new List<DDCFile>();//同一个时刻多个频点多个通道的DDC数据
+                            LogHelper.Info($"【任务{dto.ID}】{listSlotsInfo.First().AdTime:yyyyMMddHHmmss}时刻DDC处理开始...");
+                            Parallel.ForEach(adFiles, adFile =>
+                            {
+
+                                //227=变频器频点255-(140-112))
+                                var ddcRes = DDCHelper.DDC(adFile.File, adFile.AdTime, adFile.ChNo, (long)(first.FsampleM * 1e6), (long)(227 * 1e6), DdcDir, sigs);
+                                chDDCFiles.AddRange(StringToDDCFile(ddcRes));
+                                if (!Debugger.IsAttached)
+                                    File.Delete(adFile.File);//删除AD文件
+                            });
+                            LogHelper.Info($"【任务{dto.ID}】{listSlotsInfo.First().AdTime:yyyyMMddHHmmss}时刻DDC处理完成");
+                            if (!chDDCFiles.Any())
+                            {
+                                LogHelper.Error($"【任务{dto.ID}】{listSlotsInfo.First().AdTime:yyyyMMddHHmmss}时刻DDC处理无结果");
+                                continue;
+                            }
+                            var groupDDCFiles = chDDCFiles.GroupBy(p => p.FreqDownMHz);
+                            foreach (var group in groupDDCFiles)
+                            {
+                                //group:同一个时刻同一个频点的多个通道数据
+                                var capTime = group.First().AdTime;
+                                var ch0File = group.Where(p => p.ChNo == 0).FirstOrDefault();
+                                var ch1File = group.Where(p => p.ChNo == 1).FirstOrDefault();
+                                var ch2File = group.Where(p => p.ChNo == 2).FirstOrDefault();
+                                if (ch0File == null)
+                                {
+                                    LogHelper.Warning($"【任务{dto.ID}】{capTime:yyyyMMddHHmmss}时刻未找到主星信号ch0文件,跳过此组数据");
+                                    continue;
+                                }
+                                if (ch1File == null)
+                                {
+                                    LogHelper.Warning($"【任务{dto.ID}】{capTime:yyyyMMddHHmmss}时刻未找到邻星信号ch1文件,跳过此组数据");
+                                    continue;
+                                }
+                                if (ch2File == null)
+                                {
+                                    LogHelper.Warning($"【任务{dto.ID}】{capTime:yyyyMMddHHmmss}时刻未找到超短信号ch2文件,跳过此组数据");
+                                    continue;
+                                }
+                                if (cts.IsCancellationRequested) break;
+                                string mainFile = await HttpHelper.UploadFileAsync(ch0File.File, baseUrl, token: cts.Token);//主星文件
+                                string adja1File = await HttpHelper.UploadFileAsync(ch1File.File, baseUrl, token: cts.Token);//邻1星文件
+                                string cdbFile = await HttpHelper.UploadFileAsync(ch2File.File, baseUrl, token: cts.Token);//地面信号文件
+
+
+                                var sig = sigs.FirstOrDefault(p => p.FreqDownHz == (int)(group.Key * 1e6));
+                                var cgDto = new CpuCgMultiDto()
+                                {
+                                    dtCenter = 0,
+                                    dtRange = 40000,
+                                    file1 = mainFile,
+                                    file2 = adja1File,
+                                    samplingRate = ch0File.Fs,
+                                    smpPositions = sig.Slots.Slots.Select(p => new SmpPosition() { TimeSeconds = p.TimeSeconds, smpStart = p.StartPoint, smpCount = p.Len }).ToList(),
+                                    snrThreshold = 15,
+                                };
+                                LogHelper.Info($"【任务{dto.ID}】{capTime:yyyyMMddHHmmss}时刻主星邻星CPU参估开始...");
+                                var result1 = await HttpHelper.PostRequestAsync<List<CpuCgResDto>>(baseUrl + "DetectCg/CpuCgMultiCalc", cgDto, token: cts.Token);
+                                if (result1.code != 200)
+                                {
+                                    LogHelper.Error($"【任务{dto.ID}】{capTime:yyyyMMddHHmmss}时刻主星邻星CPU参估出错.{result1.msg}");
+                                    continue;
+                                }
+                                LogHelper.Info($"【任务{dto.ID}】{capTime:yyyyMMddHHmmss}时刻主星邻星CPU参估完成");
+                                cgDto = new CpuCgMultiDto()
+                                {
+                                    dtCenter = 260000,
+                                    dtRange = 50000,
+                                    file1 = mainFile,
+                                    file2 = cdbFile,
+                                    samplingRate = ch0File.Fs,
+                                    smpPositions = sig.Slots.Slots.Select(p => new SmpPosition() { TimeSeconds = p.TimeSeconds, smpStart = p.StartPoint, smpCount = p.Len }).ToList(),
+                                    snrThreshold = 15,
+                                };
+                                LogHelper.Info($"【任务{dto.ID}】{capTime:yyyyMMddHHmmss}时刻主星超短CPU参估开始...");
+                                var result2 = await HttpHelper.PostRequestAsync<List<CpuCgResDto>>(baseUrl + "DetectCg/CpuCgMultiCalc", cgDto, token: cts.Token);
+                                if (result2.code != 200)
+                                {
+                                    LogHelper.Error($"【任务{dto.ID}】{capTime:yyyyMMddHHmmss}时刻主星超短CPU参估出错.{result2.msg}");
+                                    continue;
+                                }
+                                //删除DDC文件
+                                File.Delete(ch0File.File);
+                                File.Delete(ch1File.File);
+                                File.Delete(ch2File.File);
+                                LogHelper.Info($"【任务{dto.ID}】{capTime:yyyyMMddHHmmss}时刻主星超短CPU参估完成");
+                                var data1 = result1.data;
+                                var data2 = result2.data;
+                                if (data1.Count != data2.Count || data1.Count != cgDto.smpPositions.Count)
+                                {
+                                    LogHelper.Error($"【任务{dto.ID}】{capTime:yyyyMMddHHmmss}时刻参估结果个数和检测结果个数不匹配");
+                                    continue;
+                                }
+                                for (int i = 0; i < data1.Count; i++)
+                                {
+                                    try
+                                    {
+                                        if (cts.IsCancellationRequested) break;
+                                        X2D1NoParPosDto x21d = new X2D1NoParPosDto()
+                                        {
+                                            TaskID = dto.ID,
+                                            //SigTime = capTime.AddSeconds(data1[i].Smpstart / (double)ch0File.Fs),
+                                            SigTime = capTime.AddSeconds(data1[i].TimeSeconds),
+                                            MainCode = MainSatCode,
+                                            AdjaCode = Adja1SatCode,
+                                            MainX = MainSatXYZ[0],
+                                            MainY = MainSatXYZ[1],
+                                            MainZ = MainSatXYZ[2],
+                                            AdjaX = Adja1SatXYZ[0],
+                                            AdjaY = Adja1SatXYZ[1],
+                                            AdjaZ = Adja1SatXYZ[2],
+                                            SxDto = PosDtoFactor * data1[i].Dt,
+                                            SxDfo = data1[i].Df,
+                                            SxSnr = data1[i].Snr,
+                                            XdDto = PosDtoFactor * data2[i].Dt,
+                                            XdDfo = data2[i].Df,
+                                            XdSnr = data2[i].Snr,
+                                            SatTxLon = dto.CapLon,
+                                            SatTxLat = dto.CapLat,
+                                            FreqDown = ch0File.FreqDownMHz * 1e6,
+                                            CheckRes = new CheckResDto()
+                                            {
+                                                FileName = Path.GetFileName(ch0File.File),
+                                                SmpStart = sig.Slots.Slots[i].StartPoint,
+                                                SmpCount = sig.Slots.Slots[i].Len,
+                                                PosCheckType = EnumPosCheckTypeDto.DAMA,
+                                            }
+                                        };
+                                        var result = await HttpHelper.PostRequestAsync<PosResDto>(baseUrl + "Pos/PosX2D1NoParAsync", x21d);
+                                        if (result.code != 200)
+                                        {
+                                            LogHelper.Error($"【任务{dto.ID}】{capTime:yyyyMMddHHmmss}时刻时隙位置{data1[i].Smpstart}定位异常.{result.msg}");
+                                        }
+                                        else
+                                        {
+                                            var posRes = result.data;
+                                            double posLon = posRes.PosLon;
+                                            double posLat = posRes.PosLat;
+                                            if (x21d.SxSnr == 0 || x21d.XdSnr == 0)
+                                            {
+                                                posLon = 0;
+                                                posLat = 0;
+                                            }
+                                            double[] cdbPos= new double[] { 0, 0, 0 };
+                                            double[] RefGeod= new double[] { 0, 0, 0 };
+                                            //GdopHelper.ErrorEllipse2X1D(posLon, posLat, MainSatXYZ, Adja1SatXYZ, cdbPos, RefGeod,);
+
+                                            StringBuilder sb = new StringBuilder();
+                                            sb.Append($"{x21d.SigTime:yyyy}\t");
+                                            sb.Append($"{x21d.SigTime:MM}\t");
+                                            sb.Append($"{x21d.SigTime:dd}\t");
+                                            sb.Append($"{x21d.SigTime:HH}\t");
+                                            sb.Append($"{x21d.SigTime:mm}\t");
+                                            sb.Append($"{x21d.SigTime:ss}\t");
+                                            sb.Append($"{x21d.SigTime:fff}\t");
+                                            sb.Append($"{x21d.CheckRes.SmpCount * 1000 / ch0File.Fs:D4}\t");//信号持续时间ms
+                                            sb.Append($"{Convert.ToInt64(group.First().FreqDownMHz * 1e6):D12}\t");//下行频点
+                                            sb.Append($"{Convert.ToInt64((group.First().FreqDownMHz + 44) * 1e6):D12}\t");//上行频点
+                                            sb.Append($"{4}\t");//信号样式(暂定有这些1:CPM,2:BPSK,4:QPSK),
+                                            sb.Append($"{0:D4}\t");//目标序号
+                                            sb.Append($"res\t");
+                                            sb.Append($"{Convert.ToInt64(posLon * 1e6):D10}\t");
+                                            sb.Append($"{Convert.ToInt64(posLat * 1e6):D10}\t");
+                                            sb.Append($"{Convert.ToInt64(0 * 1e3):D8}\t");//定位误差km
+                                            sb.Append($"{Convert.ToInt64(x21d.SxDto * 1e2):D10}\t");
+                                            sb.Append($"{Convert.ToInt64(x21d.SxDfo * 1e2):D10}\t");
+                                            sb.Append($"{Convert.ToInt64(x21d.SxSnr * 1e2):D6}\t");
+                                            sb.Append($"{Convert.ToInt64(x21d.XdDto * 1e2):D10}\t");
+                                            sb.Append($"{Convert.ToInt64(x21d.XdDfo * 1e2):D10}\t");
+                                            sb.Append($"{Convert.ToInt64(x21d.XdSnr * 1e2):D6}\t");
+                                            sb.Append($"{Convert.ToInt64(0 * 1e2):D10}\t");
+                                            sb.Append($"{Convert.ToInt64(0 * 1e2):D10}\t");
+                                            sb.Append($"{Convert.ToInt64(0 * 1e2):D6}\t");
+                                            sb.Append($"{0:D8}\t");//长轴
+                                            sb.Append($"{0:D8}\t");//短轴
+                                            sb.Append($"{0:D7}\t");//倾角
+                                            sb.Append($"{data1.Count:D2}\t");//时隙属性
+                                            sb.Append($"{1}\t");//所属卫星
+                                            sb.Append($"{950:D3}\t");//置信度
+                                            sb.Append($"{3}\r\n");//定位体制(星地=3)
+                                            string resFile = Path.Combine(PosResDir, $"定位结果_{posRes.SigTime:yyyyMMdd}.txt");
+                                            File.AppendAllText(resFile, sb.ToString());
+                                        }
+                                    }
+                                    catch (Exception ex)
+                                    {
+                                        LogHelper.Error($"【任务{dto.ID}】{capTime:yyyyMMddHHmmss}时刻时隙位置{data1[i].Smpstart}定位异常", ex);
+                                    }
+                                }
+                                LogHelper.Info($"【任务{dto.ID}】{capTime:yyyyMMddHHmmss}时刻定位完成");
+                            }
+
+                        }
+                        #endregion
+                    }
+                    catch (Exception ex)
+                    {
+                        if (!cts.IsCancellationRequested)
+                            LogHelper.Error("任务执行出错", ex);
+                    }
+                }
+            }, cts.Token);
+        }
+        public void Stop()
+        {
+            cts?.Cancel();
+        }
+        private void StopTask(int taskID, EnumTaskStopType type, string stopReason)
+        {
+            Thread.Sleep(2000);
+            if (type == EnumTaskStopType.Properly)
+            {
+                LogHelper.Info($"【任务{taskID}】{stopReason}");
+            }
+            else
+            {
+                LogHelper.Error($"【任务{taskID}】{stopReason}");
+            }
+            TaskStopHandleDto stopDto = new TaskStopHandleDto() { ID = taskID, StopType = type, StopReason = stopReason };
+            var stopResp = HttpHelper.PostRequestAsync(baseUrl + "Task/StopTask", stopDto).Result;
+            if (stopResp.code != 200)
+            {
+                LogHelper.Error($"【任务{taskID}】停止异常.{stopResp.msg}");
+            }
+        }
+
+        private CheckResFile StringToCheckResFile(string file)
+        {
+            //YUFO_252.050MHz_20240409_1398.dat
+            string fileName = Path.GetFileNameWithoutExtension(file).ToUpper();
+            var arr = fileName.Split(new string[] { "_", "MHZ" }, StringSplitOptions.RemoveEmptyEntries);
+            var dayTime = DateTime.ParseExact(arr[2], "yyyyMMdd", null);
+            CheckResFile res = new CheckResFile()
+            {
+                DayTime = dayTime,
+                File = file,
+                FreqDownMHz = Convert.ToDouble(arr[1]),
+                FlagNo = Convert.ToInt64(arr[3]),
+            };
+            return res;
+        }
+        private AdFile StringToAdFile(string file)
+        {
+            //20240409094240_ADC_ch02.dat
+            var name = Path.GetFileNameWithoutExtension(file).ToUpper();
+            var arr = name.Split(new string[] { "_", "CH" }, StringSplitOptions.RemoveEmptyEntries);
+            var time = DateTime.ParseExact(arr[0], "yyyyMMddHHmmss", null);
+            AdFile adFile = new AdFile()
+            {
+                File = file,
+                AdTime = time,
+                ChNo = Convert.ToInt32(arr[2]),
+            };
+            return adFile;
+        }
+        public DDCFile StringToDDCFile(string file)
+        {
+            //20240409094240_252.025_C109375_ch0.dat
+            var name = Path.GetFileNameWithoutExtension(file).ToUpper();
+            var arr = name.Split(new string[] { "_", "MHz", "C", "H" }, StringSplitOptions.RemoveEmptyEntries);
+            var time = DateTime.ParseExact(arr[0], "yyyyMMddHHmmss", null);
+            double freqDown = Convert.ToDouble(arr[1]);
+            int fs = Convert.ToInt32(arr[2]);
+            int chNo = Convert.ToInt32(arr[3]);
+            return new DDCFile()
+            {
+                AdTime = time,
+                ChNo = chNo,
+                File = file,
+                FreqDownMHz = freqDown,
+                Fs = fs
+            };
+        }
+        public List<DDCFile> StringToDDCFile(List<string> files)
+        {
+            List<DDCFile> list = new List<DDCFile>();
+            foreach (var item in files)
+            {
+                list.Add(StringToDDCFile(item));
+            }
+            return list;
+        }
+    }
+}

+ 220 - 0
Service/X2D1NoRefTaskServer54/X2D1NoRefTaskServer54.csproj

@@ -0,0 +1,220 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{9AF4DF2F-7AAE-4363-98D6-8DDDB9072EEE}</ProjectGuid>
+    <OutputType>WinExe</OutputType>
+    <RootNamespace>X2D1NoRefTaskServer54</RootNamespace>
+    <AssemblyName>两星一地离线数据处理服务</AssemblyName>
+    <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
+    <Deterministic>true</Deterministic>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <DocumentationFile>bin\Debug\两星一地离线数据处理服务.xml</DocumentationFile>
+    <Prefer32Bit>false</Prefer32Bit>
+    <NoWarn>CS1591</NoWarn>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup>
+    <ApplicationIcon>..\..\Service.ico</ApplicationIcon>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="DevExpress.Data.Desktop.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
+    <Reference Include="DevExpress.Data.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
+    <Reference Include="DevExpress.Drawing.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
+    <Reference Include="DevExpress.Printing.v23.2.Core, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
+    <Reference Include="DevExpress.Utils.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
+    <Reference Include="DevExpress.XtraBars.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
+    <Reference Include="DevExpress.XtraEditors.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
+    <Reference Include="DevExpress.XtraGrid.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
+    <Reference Include="DevExpress.XtraLayout.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
+    <Reference Include="DevExpress.XtraPrinting.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
+    <Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
+      <HintPath>..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
+    </Reference>
+    <Reference Include="Newtonsoft.Json.Bson, Version=1.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
+      <HintPath>..\..\packages\Newtonsoft.Json.Bson.1.0.2\lib\net45\Newtonsoft.Json.Bson.dll</HintPath>
+    </Reference>
+    <Reference Include="Serilog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL">
+      <HintPath>..\..\packages\Serilog.3.1.1\lib\net471\Serilog.dll</HintPath>
+    </Reference>
+    <Reference Include="Serilog.Sinks.Console, Version=5.0.1.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL">
+      <HintPath>..\..\packages\Serilog.Sinks.Console.5.0.1\lib\net471\Serilog.Sinks.Console.dll</HintPath>
+    </Reference>
+    <Reference Include="Serilog.Sinks.File, Version=5.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10, processorArchitecture=MSIL">
+      <HintPath>..\..\packages\Serilog.Sinks.File.5.0.0\lib\net45\Serilog.Sinks.File.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
+      <HintPath>..\..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
+    </Reference>
+    <Reference Include="System.ComponentModel.DataAnnotations" />
+    <Reference Include="System.Configuration" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Diagnostics.DiagnosticSource, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
+      <HintPath>..\..\packages\System.Diagnostics.DiagnosticSource.8.0.0\lib\net462\System.Diagnostics.DiagnosticSource.dll</HintPath>
+    </Reference>
+    <Reference Include="System.Management" />
+    <Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
+      <HintPath>..\..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
+    </Reference>
+    <Reference Include="System.Net.Http.Formatting, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+      <HintPath>..\..\packages\Microsoft.AspNet.WebApi.Client.6.0.0\lib\net45\System.Net.Http.Formatting.dll</HintPath>
+    </Reference>
+    <Reference Include="System.Numerics" />
+    <Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+      <HintPath>..\..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
+    </Reference>
+    <Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+      <HintPath>..\..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
+    </Reference>
+    <Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
+      <HintPath>..\..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
+    </Reference>
+    <Reference Include="System.Transactions" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Deployment" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Web.Http, Version=5.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\System.Web.Http.dll</HintPath>
+    </Reference>
+    <Reference Include="System.Windows.Forms" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="..\..\XdCxRhDW.App\DxHelper\MsgBoxHelper.cs">
+      <Link>DxHelper\MsgBoxHelper.cs</Link>
+    </Compile>
+    <Compile Include="..\..\XdCxRhDW.App\DxHelper\SvgHelper.cs">
+      <Link>DxHelper\SvgHelper.cs</Link>
+    </Compile>
+    <Compile Include="..\..\XdCxRhDW.App\ExtensionsDev\GridControlEx.cs">
+      <Link>DxHelper\GridControlEx.cs</Link>
+    </Compile>
+    <Compile Include="..\..\XdCxRhDW.App\Localizer\ChsLocalizer.cs">
+      <Link>DxHelper\ChsLocalizer.cs</Link>
+    </Compile>
+    <Compile Include="AddIns\DDC\DDCHelper.cs" />
+    <Compile Include="Controllers\X2D1NoRefTaskProcessingController.cs" />
+    <Compile Include="HistoryFile.cs" />
+    <Compile Include="LogHelper.cs" />
+    <Compile Include="LogInfo.cs" />
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="MainForm.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="MainForm.Designer.cs">
+      <DependentUpon>MainForm.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Service\HistoryTaskService.cs" />
+    <Compile Include="AddIns\时隙获取\SlotHelper.cs" />
+    <None Include="packages.config" />
+    <EmbeddedResource Include="Properties\Resources.resx">
+      <Generator>ResXFileCodeGenerator</Generator>
+      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+    <Compile Include="Properties\Resources.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Resources.resx</DependentUpon>
+      <DesignTime>True</DesignTime>
+    </Compile>
+    <EmbeddedResource Include="MainForm.resx">
+      <DependentUpon>MainForm.cs</DependentUpon>
+    </EmbeddedResource>
+    <None Include="Properties\Settings.settings">
+      <Generator>SettingsSingleFileGenerator</Generator>
+      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+    </None>
+    <Compile Include="Properties\Settings.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Settings.settings</DependentUpon>
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>
+    </Compile>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="App.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\XdCxRhDW.Api\XdCxRhDW.Api.csproj">
+      <Project>{2deb9c8d-8cb5-4029-8121-173b7e08e5b4}</Project>
+      <Name>XdCxRhDW.Api</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\XdCxRhDw.Dto\02.XdCxRhDW.Dto.csproj">
+      <Project>{994f5945-4d73-40b4-a1d9-3e23a9fcd350}</Project>
+      <Name>02.XdCxRhDW.Dto</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\XdCxRhDW.Framework\01.XdCxRhDW.Framework.csproj">
+      <Project>{cd41cedf-e0b8-41cc-867b-3b57f476b450}</Project>
+      <Name>01.XdCxRhDW.Framework</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\XdCxRhDW.WebApi\05.XdCxRhDW.WebApi.csproj">
+      <Project>{652C29AC-65DE-466A-A964-8F1A2E657D86}</Project>
+      <Name>05.XdCxRhDW.WebApi</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="AddIns\时隙获取\SlotChecker.dll">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="AddIns\时隙获取\SlotChecker.h">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="AddIns\DDC\DigitaDownConverter.exe">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="AddIns\DDC\ippcore-9.0.dll">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="AddIns\DDC\ipps-9.0.dll">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="AddIns\DDC\ippsy8-9.0.dll">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+    <None Include="AddIns\DDC\readme.txt">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </None>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <PropertyGroup>
+    <PostBuildEvent>del DevExpress*.xml,EntityFramework*.xml,Serilog*.xml,Newtonsoft*.xml
+del System*.xml,Microsoft*.xml,autofac*.xml,MySql*.xml,K4os*.xml,google*.xml
+del BouncyCastle*.xml
+
+if not exist "AddIns" md AddIns
+move /Y *.dll AddIns
+move /Y *.pdb AddIns
+move AddIns\$(TargetName).pdb .
+copy $(SolutionDir)Service.svg Service.svg
+rmdir logs /S/Q
+rmdir wwwroot /S/Q</PostBuildEvent>
+  </PropertyGroup>
+</Project>

+ 16 - 0
Service/X2D1NoRefTaskServer54/packages.config

@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+  <package id="Microsoft.AspNet.WebApi.Client" version="6.0.0" targetFramework="net472" />
+  <package id="Microsoft.AspNet.WebApi.Core" version="5.3.0" targetFramework="net472" />
+  <package id="Newtonsoft.Json" version="13.0.3" targetFramework="net472" />
+  <package id="Newtonsoft.Json.Bson" version="1.0.2" targetFramework="net472" />
+  <package id="Serilog" version="3.1.1" targetFramework="net472" />
+  <package id="Serilog.Sinks.Console" version="5.0.1" targetFramework="net472" />
+  <package id="Serilog.Sinks.File" version="5.0.0" targetFramework="net472" />
+  <package id="System.Buffers" version="4.5.1" targetFramework="net472" />
+  <package id="System.Diagnostics.DiagnosticSource" version="8.0.0" targetFramework="net472" />
+  <package id="System.Memory" version="4.5.5" targetFramework="net472" />
+  <package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net472" />
+  <package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net472" />
+  <package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" />
+</packages>

+ 18 - 1
XdCxRhDW.Api/AddIns/GDOP误差椭圆/GDOPAPi.cs

@@ -13,7 +13,24 @@ namespace XdCxRhDW.Api
 
         private const string ErrellipDll = @"AddIns\GDOP误差椭圆\DLL_GDOP_Analysis0415";
 
-        
+
+        /// <summary>
+        /// 两星一地误差椭圆
+        /// </summary>
+        /// <param name="main_eph">主星位置 长度6</param>
+        /// <param name="neigh_eph">邻星位置 长度6</param>
+        /// <param name="cdbAnt">超短波 长度3</param>
+        /// <param name="refStation">参考站 长度3</param>
+        /// <param name="Select_Point">定位点 长度3</param>
+        /// <param name="dto_err">时差误差(s)</param>
+        /// <param name="eph_err"></param>
+        /// <param name="Pe">0.5</param>
+        /// <param name="LOP_Len"></param>
+        /// <returns></returns>
+        [DllImport(ErrellipDll, EntryPoint = "Error_Ellipse_2X1D", CallingConvention = CallingConvention.Cdecl)]
+        public extern static IntPtr Error_Ellipse_2X1D(double[] main_eph, double[] neigh_eph, double[] cdbAnt, double[] refStation, double[] Select_Point, double dto_err,
+        double eph_err, double Pe, ref int LOP_Len);
+
 
         ///
         /// 获取三星双时差GDOP  带参考

+ 37 - 7
XdCxRhDW.Api/AddIns/GDOP误差椭圆/GdopHelper.cs

@@ -13,6 +13,36 @@ namespace XdCxRhDW.Api
         static readonly DateTime dtZero = new DateTime(1970, 1, 1, 8, 0, 0, 0);
 
 
+        public static double[] ErrorEllipse2X1D(double posLon, double posLat, double[] mainEph, double[] adajEph, double[] cdbPos, double[] RefGeod, double DtoErrus, double EphErrm)
+        {
+            IEnumerable<double> res = new List<double>();
+            int LOP_Len = 0;
+            /// <summary>
+            /// 概率 默认0.5
+            /// </summary>
+            double Pe = 0.5;
+            IntPtr LOP_ValuePtr = GDOPApi.Error_Ellipse_2X1D(
+                   mainEph,
+                   adajEph,
+                   cdbPos,
+                   RefGeod,
+                    new double[3] { posLon, posLat, 0 },
+                    DtoErrus * 1e-6,
+                    EphErrm,//单位m
+                    Pe, ref LOP_Len);
+            List<DtoLinePoint> list = new List<DtoLinePoint>();
+            double[] LOP_Value = new double[LOP_Len];
+            if (LOP_Len > 0)
+            {
+                Marshal.Copy(LOP_ValuePtr, LOP_Value, 0, LOP_Value.Length);
+
+                int lastcount = LOP_Len - 3;
+                res = LOP_Value.Skip(lastcount).Take(3);
+            }
+            return res.ToArray();
+        }
+
+
         /// <summary>
         /// 两星一地GDOP 无参时参考位置不赋值
         /// </summary>
@@ -104,12 +134,12 @@ namespace XdCxRhDW.Api
 
             }
 
-           var errs= ToErrDistanceMapPoints(level,resCount,lpoints,res);
+            var errs = ToErrDistanceMapPoints(level, resCount, lpoints, res);
             GDOPApi.FreeGDOPBuf(res);
             GDOPApi.FreeGDOPBuf(lpoints);
             return errs;
         }
-        private static List<ErrDistanceMapPoints> ToErrDistanceMapPoints(double[] level,int[] resCount, IntPtr lpoints, IntPtr res)
+        private static List<ErrDistanceMapPoints> ToErrDistanceMapPoints(double[] level, int[] resCount, IntPtr lpoints, IntPtr res)
         {
             int total = resCount.Sum(r => r);
             int[] Points_Value = new int[total];
@@ -218,11 +248,11 @@ namespace XdCxRhDW.Api
             int[] resCount = new int[level.Length];
             if (refPos == null || refPos.Length == 0)
             {
-                GDOPApi.GdopXDCXNoRefByXyz_new(mainEph, cdbPos, cxPos, dtousErr, doaErr, ephLocErr, level, level.Length, resCount,out lpoints, out res, satllh);
+                GDOPApi.GdopXDCXNoRefByXyz_new(mainEph, cdbPos, cxPos, dtousErr, doaErr, ephLocErr, level, level.Length, resCount, out lpoints, out res, satllh);
             }
             else
             {
-                GDOPApi.GdopXDCXRefByXyz_new(mainEph, cdbPos, cxPos, refPos, dtousErr, doaErr, ephLocErr, level, level.Length, resCount,out lpoints, out res, satllh);
+                GDOPApi.GdopXDCXRefByXyz_new(mainEph, cdbPos, cxPos, refPos, dtousErr, doaErr, ephLocErr, level, level.Length, resCount, out lpoints, out res, satllh);
             }
             var errs = ToErrDistanceMapPoints(level, resCount, lpoints, res);
             GDOPApi.FreeGDOPBuf(res);
@@ -293,7 +323,7 @@ namespace XdCxRhDW.Api
             int[] resCount = new int[level.Length];
             if (refPos == null || refPos.Length == 0)
             {
-                GDOPApi.Gdop3SatNoRefByXyz_new(mainEph, adaj1Eph, adaj2Eph, dtousErr, ephLocErr, level, level.Length, resCount,out lpoints, out res, satllh);
+                GDOPApi.Gdop3SatNoRefByXyz_new(mainEph, adaj1Eph, adaj2Eph, dtousErr, ephLocErr, level, level.Length, resCount, out lpoints, out res, satllh);
 
             }
             else
@@ -382,7 +412,7 @@ namespace XdCxRhDW.Api
         }
         private static List<(double lon, double lat)> ParseResult(double[] ponits)
         {
-            List<(double lon,double lat)> mapDots = new List<(double lon, double lat)>();
+            List<(double lon, double lat)> mapDots = new List<(double lon, double lat)>();
             int count = 2;
             for (int i = 0; i < ponits.Length / count; i++)
             {
@@ -407,7 +437,7 @@ namespace XdCxRhDW.Api
             IntPtr res = IntPtr.Zero;
             IntPtr lpoints = IntPtr.Zero;
             int[] resCount = new int[level.Length];
-            GDOPApi.Gdop3SatDFByXyz_new(mainEph, adaj1Eph, adaj2Eph, refPos, fuHz1, fuHz2, dfoErr, ephLocErr, ephVErr, level, level.Length, resCount,out lpoints, out res, satllh);
+            GDOPApi.Gdop3SatDFByXyz_new(mainEph, adaj1Eph, adaj2Eph, refPos, fuHz1, fuHz2, dfoErr, ephLocErr, ephVErr, level, level.Length, resCount, out lpoints, out res, satllh);
 
             var errs = ToErrDistanceMapPoints(level, resCount, lpoints, res);
             GDOPApi.FreeGDOPBuf(res);

+ 1 - 1
XdCxRhDW.App/App.config

@@ -5,7 +5,7 @@
 	</connectionStrings>
 	<appSettings>
 		<!--54专用-->
-		<!--<add key="UseFor54" value="0"/>-->
+		<add key="UseFor54" value="1"/>
 		
 		<!--程序标题-->
 		<add key="SystemName" value="多模式融合定位平台" />

+ 31 - 23
XdCxRhDW.App/UserControl/CtrlHome.cs

@@ -576,6 +576,20 @@ namespace XdCxRhDW.App.UserControl
             }
         }
 
+        private bool UseFor54()
+        {
+            if (ConfigurationManager.AppSettings["UseFor54"] != null
+                          && ConfigurationManager.AppSettings["UseFor54"].ToLower() != "false"
+                          && ConfigurationManager.AppSettings["UseFor54"].ToLower() != "0")
+            {
+                return true;
+            }
+            else
+            {
+                return false;
+            }
+        }
+
         private async void btn_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
         {
             var tsk = gridView1.GetFocusedRow() as TaskInfo;
@@ -618,13 +632,17 @@ namespace XdCxRhDW.App.UserControl
                                 return;
                             }
                         }
+
+
+                        bool isUserFor54 = UseFor54();
                         if (tsk.PosType == EnumPosType.X2D1)
                         {
+                            EnumSvrType svrType = isUserFor54 ? EnumSvrType.X2D1NoRefTask54 : EnumSvrType.X2D1NoRefTask;
                             //下发任务
-                            var svtItem = ServerContext.Instance.GetRandomOne(EnumSvrType.X2D1NoRefTask);
+                            var svtItem = ServerContext.Instance.GetRandomOne(svrType);
                             if (svtItem == null)
                             {
-                                DxHelper.MsgBoxHelper.ShowWarning($"未找到注册的处理服务");
+                                DxHelper.MsgBoxHelper.ShowWarning($"未找到注册的两星一地数据处理服务");
                                 return;
                             }
                             X2D1NoRefTaskHandleDto dto = new X2D1NoRefTaskHandleDto()
@@ -659,30 +677,16 @@ namespace XdCxRhDW.App.UserControl
                         }
                         else if (tsk.PosType == EnumPosType.X3TwoDto)
                         {
+                            
                             //下发任务
-                            var svtItem = ServerContext.Instance.GetRandomOne(EnumSvrType.X3NoRefHistoryTask);
+                            var svtItem = ServerContext.Instance.GetRandomOne(EnumSvrType.X3NoRefTask54);
                             if (svtItem == null)
                             {
-                                DxHelper.MsgBoxHelper.ShowWarning($"未找到注册的处理服务");
+                                DxHelper.MsgBoxHelper.ShowWarning($"未找到注册的三星数据处理服务");
                                 return;
                             }
-                            DateTime startTime;
-                            DateTime endTime;
-
-                            if (ConfigurationManager.AppSettings["UseFor54"] != null
-                           && ConfigurationManager.AppSettings["UseFor54"].ToLower() != "false"
-                           && ConfigurationManager.AppSettings["UseFor54"].ToLower() != "0")
-                            {
-                                startTime = DateTime.Now;
-                                endTime = DateTime.Now.AddHours(1);
-                            }
-                            else
-                            {
-                                TaskHistoryTimeEditor frm = new TaskHistoryTimeEditor(tsk);
-                                if (frm.ShowDialog() != DialogResult.OK) return;
-                                startTime = frm.start;
-                                endTime = frm.end;
-                            }
+                            DateTime startTime = DateTime.Now;
+                            DateTime endTime = DateTime.Now.AddHours(1);
                             X2D1NoRefTaskHandleDto dto = new X2D1NoRefTaskHandleDto()
                             {
                                 MainSatCode = tsk.MainSat,
@@ -741,9 +745,13 @@ namespace XdCxRhDW.App.UserControl
                     {
                         ModelSvr svtItem = null;
                         if (tsk.PosType == EnumPosType.X2D1)
-                            svtItem = ServerContext.Instance.GetRandomOne(EnumSvrType.X2D1NoRefTask);
+                        {
+                            bool isUserFor54 = UseFor54();
+                            EnumSvrType svrType = isUserFor54 ? EnumSvrType.X2D1NoRefTask54 : EnumSvrType.X2D1NoRefTask;
+                            svtItem = ServerContext.Instance.GetRandomOne(svrType);
+                        }
                         else if (tsk.PosType == EnumPosType.X3TwoDto)
-                            svtItem = ServerContext.Instance.GetRandomOne(EnumSvrType.X3NoRefHistoryTask);
+                            svtItem = ServerContext.Instance.GetRandomOne(EnumSvrType.X3NoRefTask54);
                         if (svtItem == null)
                         {
                             //DxHelper.MsgBoxHelper.ShowWarning($"未找到注册的处理服务");

+ 7 - 0
XdCxRhDW.sln

@@ -35,6 +35,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CapMoni", "Service\CapMoni\
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XdCxRhDW.DataEmulation", "XdCxRhDW.DataEmulation\XdCxRhDW.DataEmulation.csproj", "{E0E5334A-9DC1-4A45-8E1E-1049A9FD15F2}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "X2D1NoRefTaskServer54", "Service\X2D1NoRefTaskServer54\X2D1NoRefTaskServer54.csproj", "{9AF4DF2F-7AAE-4363-98D6-8DDDB9072EEE}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -101,6 +103,10 @@ Global
 		{E0E5334A-9DC1-4A45-8E1E-1049A9FD15F2}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{E0E5334A-9DC1-4A45-8E1E-1049A9FD15F2}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{E0E5334A-9DC1-4A45-8E1E-1049A9FD15F2}.Release|Any CPU.Build.0 = Release|Any CPU
+		{9AF4DF2F-7AAE-4363-98D6-8DDDB9072EEE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{9AF4DF2F-7AAE-4363-98D6-8DDDB9072EEE}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{9AF4DF2F-7AAE-4363-98D6-8DDDB9072EEE}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{9AF4DF2F-7AAE-4363-98D6-8DDDB9072EEE}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
@@ -112,6 +118,7 @@ Global
 		{36EF70B3-C602-4346-BDA2-D87B40C789A3} = {3EB6F47A-A57D-4468-B4BE-3A63E13B692D}
 		{993D7982-3BB0-4339-ADD8-10D0C422FA5A} = {3EB6F47A-A57D-4468-B4BE-3A63E13B692D}
 		{205094BA-1381-43F3-8F42-0E1175587754} = {3EB6F47A-A57D-4468-B4BE-3A63E13B692D}
+		{9AF4DF2F-7AAE-4363-98D6-8DDDB9072EEE} = {3EB6F47A-A57D-4468-B4BE-3A63E13B692D}
 	EndGlobalSection
 	GlobalSection(ExtensibilityGlobals) = postSolution
 		SolutionGuid = {657E89B6-AB65-4E75-965C-06D70796CB71}

+ 15 - 1
XdCxRhDw.Dto/SvrStateDto.cs

@@ -74,6 +74,20 @@ namespace XdCxRhDW.Dto
         [Display(Name = "两星一地无参数据处理服务")]
         X2D1NoRefTask,
 
+
+        /// <summary>
+        /// 两星一地无参数据处理服务
+        /// </summary>
+        [Display(Name = "两星一地无参数据处理服务")]
+        X2D1NoRefTask54,
+
+        /// <summary>
+        /// 三星无参数据处理服务
+        /// </summary>
+        [Display(Name = "三星无参数据处理服务")]
+        X3NoRefTask54,
+
+        /*
         /// <summary>
         /// 三星无参离线数据处理服务
         /// </summary>
@@ -103,6 +117,6 @@ namespace XdCxRhDW.Dto
         /// </summary>
         [Display(Name = "三星带参实时数据处理服务")]
         X3RealTask,
-
+        */
     }
 }