zoulei 1 year ago
parent
commit
de9ed70e41

BIN
XdCxRhDW.Api/AddIns/信号测量/SignalProc.dll


+ 58 - 0
XdCxRhDW.Api/AddIns/信号测量/SignalProcHelper.cs

@@ -1,6 +1,7 @@
 using System;
 using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
 using System.Linq;
 using System.Linq;
+using System.Runtime.InteropServices;
 using System.Text;
 using System.Text;
 using System.Threading.Tasks;
 using System.Threading.Tasks;
 
 
@@ -9,5 +10,62 @@ namespace XdCxRhDW.Api
     public static class SignalProcHelper
     public static class SignalProcHelper
     {
     {
         private const string dll = @"AddIns\信号测量\SignalProc.dll";
         private const string dll = @"AddIns\信号测量\SignalProc.dll";
+
+        #region cpp dll Interop 
+        [DllImport(dll, EntryPoint = "SigalEst", CallingConvention = CallingConvention.Cdecl)]
+        private extern static void SigalEst(string file, long fsHz, int[] smpStart, int[] smpCount, int[] modes, double[] rates, double[] ffcs, int len);
+        #endregion
+
+        public static List<SignalProcRes> SigalEst(string file, long fsHz, int[] smpStart, int[] smpCount)
+        {
+            int sigCount = smpStart.Length;
+            int[] modes = new int[sigCount];//信号模式
+            double[] rates = new double[sigCount];//调制速率
+            double[] ffcs = new double[sigCount];//信号频偏Hz
+            SigalEst(file, fsHz, smpStart, smpCount, modes, rates, ffcs, sigCount);
+            List<SignalProcRes> list = new List<SignalProcRes>();
+            for (int i = 0; i < modes.Length; i++)
+            {
+                SignalProcRes item = new SignalProcRes()
+                {
+                    SignalType = (EnumSignalType)modes[i],
+                    Ffc = Math.Round(ffcs[i], 2),
+                    Rate = Math.Round(rates[i], 2),
+                };
+                list.Add(item);
+            }
+            return list;
+        }
+
+    }
+
+    public class SignalProcRes
+    {
+        /// <summary>
+        /// 信号类型
+        /// </summary>
+        public EnumSignalType SignalType { get; set; }
+
+        /// <summary>
+        /// 调制速率(bps)
+        /// </summary>
+        public double Rate { get; set; }
+
+        /// <summary>
+        /// 频偏
+        /// </summary>
+        public double Ffc { get; set; }
+    }
+
+    public enum EnumSignalType
+    {
+        SUNKNOW = -1,       //UNKNOW	
+        BPSK = 1,       //BPSK						备注为界面显示字母
+        OQPSK = 2,      //OQPSK
+        QPSK = 3,       //QPSK
+        P4QPSK = 4,     //Pi/4QPSK
+        _8PSK = 5,      //8PSK
+        _16APSK = 6,        //16APSK
+        _32APSK = 7		//32APSK
     }
     }
 }
 }

+ 9 - 4
XdCxRhDW.Api/AddIns/检测Cpu参估/CafResult.cs

@@ -60,19 +60,24 @@ namespace XdCxRhDW.Api
         public string DmcType { get; set; }
         public string DmcType { get; set; }
 
 
         /// <summary>
         /// <summary>
-        /// 调制类型(只有DAMA有)
+        /// 用户名(只有DAMA有)
+        /// </summary>
+        public string UserName { get; set; }
+
+        /// <summary>
+        /// 调制类型
         /// </summary>
         /// </summary>
         public string ModType { get; set; }
         public string ModType { get; set; }
 
 
         /// <summary>
         /// <summary>
-        /// 调制速率(只有DAMA有)
+        /// 调制速率
         /// </summary>
         /// </summary>
         public double? ModRate { get; set; }
         public double? ModRate { get; set; }
 
 
         /// <summary>
         /// <summary>
-        /// 用户名(只有DAMA有)
+        /// 频偏Hz
         /// </summary>
         /// </summary>
-        public string UserName { get; set; }
+        public double? FfcHz { get; set; }
 
 
         public int flag { get; set; }
         public int flag { get; set; }
 
 

+ 64 - 16
XdCxRhDW.App/Controllers/DetectCgController.cs

@@ -1,6 +1,7 @@
 using System;
 using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
 using System.IO;
 using System.IO;
+using System.Linq;
 using System.Threading.Tasks;
 using System.Threading.Tasks;
 using System.Web.Http;
 using System.Web.Http;
 using XdCxRhDW.Api;
 using XdCxRhDW.Api;
@@ -215,10 +216,11 @@ namespace XdCxRhDW.App.Controllers
         [HttpPost]
         [HttpPost]
         public async Task<AjaxResult<List<DetectResDto>>> DetectCalc(DetectDto dto)
         public async Task<AjaxResult<List<DetectResDto>>> DetectCalc(DetectDto dto)
         {
         {
-            dto.file1 = GetLocalFile(dto.file1);
-            List<DetectResDto> list = new List<DetectResDto>();
+        
             try
             try
             {
             {
+                dto.file1 = GetLocalFile(dto.file1);
+                List<DetectResDto> list = new List<DetectResDto>();
                 List<DmcResult> dmcResults = new List<DmcResult>();
                 List<DmcResult> dmcResults = new List<DmcResult>();
                 XcorrUtils xcorr = new XcorrUtils();
                 XcorrUtils xcorr = new XcorrUtils();
                 if (dto.dmcType.HasFlag(DmcType.DAMA))
                 if (dto.dmcType.HasFlag(DmcType.DAMA))
@@ -246,12 +248,50 @@ namespace XdCxRhDW.App.Controllers
                     detectRes.TimeMs = dmcItem.Times;
                     detectRes.TimeMs = dmcItem.Times;
                     list.Add(detectRes);
                     list.Add(detectRes);
                 }
                 }
+                return Success(list);
             }
             }
             catch (Exception ex)
             catch (Exception ex)
             {
             {
-                return Error<List<DetectResDto>>($"执行检测计算异常,{ex.Message}");
+                Serilog.Log.Error(ex, $"{dto.dmcType}检测异常");
+                return Error<List<DetectResDto>>($"{dto.dmcType}检测异常");
             }
             }
-            return Success(list);
+        }
+
+        /// <summary>
+        /// 信号识别(调制类型、调制速率、频偏)
+        /// </summary>
+        /// <param name="dto">信号检测参数</param>
+        /// <returns></returns>
+        [HttpPost]
+        public async Task<AjaxResult<List<SignalProcResDto>>> SignalProc(SignalProcDto dto)
+        {
+            return await Task.Run(() =>
+             {
+                 try
+                 {
+                     dto.File = GetLocalFile(dto.File);
+                     List<SignalProcResDto> list = new List<SignalProcResDto>();
+                     var res = SignalProcHelper.SigalEst(dto.File, dto.Fs
+                          , dto.Smps.Select(p => (int)p.smpStart).ToArray()
+                          , dto.Smps.Select(p => (int)p.smpCount).ToArray());
+                     foreach (var item in res)
+                     {
+                         SignalProcResDto resItem = new SignalProcResDto()
+                         {
+                             Ffc = item.Ffc,
+                             Rate = item.Rate,
+                             ModType = (EnumSignalTypeDto)(int)item.SignalType
+                         };
+                         list.Add(resItem);
+                     }
+                     return Success(list);
+                 }
+                 catch (Exception ex)
+                 {
+                     Serilog.Log.Error(ex, "信号识别算法执行异常");
+                     return Error<List<SignalProcResDto>>($"信号识别算法执行异常");
+                 }
+             });
 
 
         }
         }
 
 
@@ -264,22 +304,30 @@ namespace XdCxRhDW.App.Controllers
         {
         {
             var res = await Task.Run(() =>
             var res = await Task.Run(() =>
              {
              {
-                 string fileIn = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "wwwroot", dto.File);
-                 string fileOut = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "wwwroot", Guid.NewGuid() + ".dat");
-                 var val = Gcd(dto.FsHz, dto.OutFsHz);//最大公约数
-                 var insertFactor = dto.OutFsHz / val;
-                 var extFactor = dto.FsHz / val;
-                 var outFile = ReSampleHelper.Resample(fileIn, fileOut, insertFactor, extFactor, dto.TimeoutSeconds);
-                 if (!string.IsNullOrWhiteSpace(outFile))
+                 try
                  {
                  {
-                     if (!File.Exists(outFile))
-                         return Error<ResampleResponseDto>("变采样后的文件未能生成");
+                     string fileIn = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "wwwroot", dto.File);
+                     string fileOut = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "wwwroot", Guid.NewGuid() + ".dat");
+                     var val = Gcd(dto.FsHz, dto.OutFsHz);//最大公约数
+                     var insertFactor = dto.OutFsHz / val;
+                     var extFactor = dto.FsHz / val;
+                     var outFile = ReSampleHelper.Resample(fileIn, fileOut, insertFactor, extFactor, dto.TimeoutSeconds);
+                     if (!string.IsNullOrWhiteSpace(outFile))
+                     {
+                         if (!File.Exists(outFile))
+                             return Error<ResampleResponseDto>("变采样后的文件未能生成");
+                         else
+                             return Success(new ResampleResponseDto() { File = Path.GetFileName(outFile), OutFsHz = dto.OutFsHz });
+                     }
                      else
                      else
-                         return Success(new ResampleResponseDto() { File = Path.GetFileName(outFile), OutFsHz = dto.OutFsHz });
+                     {
+                         return Error<ResampleResponseDto>("变采样算法返回失败");
+                     }
                  }
                  }
-                 else
+                 catch (Exception ex)
                  {
                  {
-                     return Error<ResampleResponseDto>("变采样算法调用失败");
+                     Serilog.Log.Error(ex, "变采样算法执行异常");
+                     return Error<ResampleResponseDto>("变采样算法执行异常");
                  }
                  }
              });
              });
             return res;
             return res;

+ 34 - 7
XdCxRhDW.App/Controllers/FileController.cs

@@ -18,7 +18,7 @@ namespace XdCxRhDW.App.Controllers
     public class FileController : BaseController
     public class FileController : BaseController
     {
     {
         private readonly string uploadFolder;
         private readonly string uploadFolder;
-        
+
         /// <summary>
         /// <summary>
         /// 
         /// 
         /// </summary>
         /// </summary>
@@ -33,10 +33,10 @@ namespace XdCxRhDW.App.Controllers
         /// <returns></returns>
         /// <returns></returns>
         [HttpPost, SwaggerForm]
         [HttpPost, SwaggerForm]
         public async Task<AjaxResult<string>> UploadFileAsync()
         public async Task<AjaxResult<string>> UploadFileAsync()
-         {
+        {
             if (!Request.Content.IsMimeMultipartContent("form-data"))
             if (!Request.Content.IsMimeMultipartContent("form-data"))
             {
             {
-                bool s=Request.Content.IsFormData();
+                bool s = Request.Content.IsFormData();
                 return Error<string>("请求数据不是form-data类型");
                 return Error<string>("请求数据不是form-data类型");
             }
             }
             var provider = new MultipartMemoryStreamProvider();
             var provider = new MultipartMemoryStreamProvider();
@@ -53,13 +53,14 @@ namespace XdCxRhDW.App.Controllers
             }
             }
 
 
             //清除1个小时之前的文件
             //清除1个小时之前的文件
-            _ = Task.Run(() => {
+            _ = Task.Run(() =>
+            {
 
 
-                var files=Directory.EnumerateFiles(uploadFolder);
+                var files = Directory.EnumerateFiles(uploadFolder);
                 foreach (var file in files)
                 foreach (var file in files)
                 {
                 {
-                    FileInfo info=new FileInfo(file);
-                    if (info.CreationTime<DateTime.Now.AddHours(-1))
+                    FileInfo info = new FileInfo(file);
+                    if (info.CreationTime < DateTime.Now.AddHours(-1))
                     {
                     {
                         try
                         try
                         {
                         {
@@ -74,5 +75,31 @@ namespace XdCxRhDW.App.Controllers
             return Success(fileName);
             return Success(fileName);
         }
         }
 
 
+        /// <summary>
+        /// 批量删除文件
+        /// </summary>
+        /// <param name="files">上传后返回的一个或多个文件集合</param>
+        /// <returns>返回删除成功的文件个数</returns>
+        [HttpPost]
+        public AjaxResult<int> DeleteFiles(List<string> files)
+        {
+            int count = 0;
+            foreach (var fileName in files)
+            {
+                try
+                {
+                    var file = Path.Combine(uploadFolder, fileName);
+                    File.Delete(file);
+                    count++;
+                }
+                catch (Exception ex)
+                {
+                    Serilog.Log.Error(ex, $"删除文件[{fileName}]失败!");
+                }
+            }
+            return Success(count);
+
+        }
+
     }
     }
 }
 }

+ 72 - 14
XdCxRhDW.App/CorTools/DetectToolForm.cs

@@ -27,8 +27,10 @@ namespace XdCxRhDW.App.CorTools
         public DetectToolForm()
         public DetectToolForm()
         {
         {
             InitializeComponent();
             InitializeComponent();
-            this.gcCheckCgRes.UseDefault(gridSource);
+            this.gcCheckCgRes.UseDefault(gridSource, showScrollH: true);
             txtFileTime.UseDefault().UseDoubleClickToSelectAll();
             txtFileTime.UseDefault().UseDoubleClickToSelectAll();
+            gridView1.Columns[nameof(CafResult.file1)].MaxWidth = 300;
+            gridView1.Columns[nameof(CafResult.file2)].MaxWidth = 300;
         }
         }
 
 
         private async void MainForm_Load(object sender, EventArgs e)
         private async void MainForm_Load(object sender, EventArgs e)
@@ -45,6 +47,7 @@ namespace XdCxRhDW.App.CorTools
                         t.dt = null;
                         t.dt = null;
                         t.df = null;
                         t.df = null;
                         t.snr = null;
                         t.snr = null;
+                        t.file2 = Path.GetFileName(btnFile2.Text);
                     });
                     });
                     gridView1.RefreshData();
                     gridView1.RefreshData();
                     foreach (var item in data)
                     foreach (var item in data)
@@ -118,8 +121,59 @@ namespace XdCxRhDW.App.CorTools
                         }
                         }
                     }
                     }
                     layoutControl1.Enabled = true;
                     layoutControl1.Enabled = true;
-                },false)
-                .UseClear<CafResult>(menuCaption:"清除表格");
+                }, false)
+                .AddContentMenu<CafResult>("信号识别", SvgHelper.CreateSigProc(), async data =>
+                {
+                    layoutControl1.Enabled = false;
+                    try
+                    {
+                        data.ForEach(t =>
+                        {
+                            t.ModType = "";
+                            t.ModRate = null;
+                            t.FfcHz = null;
+                            t.dt = null;
+                            t.df = null;
+                            t.snr = null;
+                        });
+                        gridView1.RefreshData();
+                        var file1 = await HttpHelper.UploadFileAsync(btnFile1.Text, baseUrl + "File/UploadFileAsync");
+                        var smps = data.Select(p => new SmpPosition()
+                        {
+                            smpStart = p.smpstart,
+                            smpCount = p.smplen,
+                        }).ToList();
+                        var dto = new SignalProcDto()
+                        {
+                            File = file1,
+                            Fs = (long)(Convert.ToDouble(tefs.Text) * 1e6),
+                            Smps = smps,
+                        };
+                        var result = await HttpHelper.PostRequestAsync<List<SignalProcResDto>>(baseUrl + "DetectCg/SignalProc", dto);
+                        if (result.code == 200)
+                        {
+                            var resData = result.data;
+                            for (int i = 0; i < data.Count; i++)
+                            {
+                                data[i].ModType = resData[i].ModType.GetEnumDisplayName();
+                                data[i].ModRate = resData[i].Rate;
+                                data[i].FfcHz = resData[i].Ffc;
+                            }
+                            gridView1.RefreshData();
+                            gridView1.BestFitColumns();
+                        }
+                        else
+                        {
+                            DxHelper.MsgBoxHelper.ShowError(result.msg);
+                        }
+                    }
+                    catch
+                    {
+                        throw;
+                    }
+                    layoutControl1.Enabled = true;
+                }, false)
+                .UseClear<CafResult>(menuCaption: "清除表格");
             this.btnFile1.UseChooseWaveFile((file, fsHz) =>
             this.btnFile1.UseChooseWaveFile((file, fsHz) =>
             {
             {
                 if (fsHz > 0)
                 if (fsHz > 0)
@@ -197,14 +251,14 @@ namespace XdCxRhDW.App.CorTools
                         }
                         }
                         gridSource.Add(new CafResult()
                         gridSource.Add(new CafResult()
                         {
                         {
-                            file1 = btnFile1.Text,
-                            file2 = btnFile2.Text,
+                            file1 = Path.GetFileName(btnFile1.Text),
+                            //file2 = btnFile2.Text,
                             smpstart = dmcItem.Start,
                             smpstart = dmcItem.Start,
                             smplen = dmcItem.Length,
                             smplen = dmcItem.Length,
                             DmcType = dmcItem.DmcType,
                             DmcType = dmcItem.DmcType,
                             SigTime = sigTime,
                             SigTime = sigTime,
                             tm = dmcItem.TimeMs,
                             tm = dmcItem.TimeMs,
-                            ModType = dmcItem.ModType,
+                            //ModType = dmcItem.ModType,
                             UserName = dmcItem.UserName,
                             UserName = dmcItem.UserName,
                         });
                         });
                     }
                     }
@@ -222,6 +276,7 @@ namespace XdCxRhDW.App.CorTools
                 DxHelper.MsgBoxHelper.ShowError($"信号检测出错");
                 DxHelper.MsgBoxHelper.ShowError($"信号检测出错");
             }
             }
             gridView1.RefreshData();
             gridView1.RefreshData();
+            gridView1.BestFitColumns();
             layoutControl1.Enabled = true;
             layoutControl1.Enabled = true;
         }
         }
         private async void btnCalc_Click(object sender, EventArgs e)
         private async void btnCalc_Click(object sender, EventArgs e)
@@ -274,8 +329,8 @@ namespace XdCxRhDW.App.CorTools
                     }
                     }
                     gridSource.Add(new CafResult()
                     gridSource.Add(new CafResult()
                     {
                     {
-                        file1 = btnFile1.Text,
-                        file2 = btnFile2.Text,
+                        file1 = Path.GetFileName(btnFile1.Text),
+                        file2 = Path.GetFileName(btnFile2.Text),
                         smpstart = result.data.Smpstart,
                         smpstart = result.data.Smpstart,
                         smplen = result.data.Smplen,
                         smplen = result.data.Smplen,
                         dt = result.data.Dt,
                         dt = result.data.Dt,
@@ -476,16 +531,19 @@ namespace XdCxRhDW.App.CorTools
                 || e.Column.FieldName == nameof(CafResult.df)
                 || e.Column.FieldName == nameof(CafResult.df)
                 || e.Column.FieldName == nameof(CafResult.snr))
                 || e.Column.FieldName == nameof(CafResult.snr))
             {
             {
-                var val = gridView1.GetRowCellValue(e.ListSourceRowIndex, gridView1.Columns[nameof(CafResult.snr)]);
-                if (val != null && (double)val == 0)
-                {
+                if (e.Value == null || e.Value.ToString() == "")
                     e.DisplayText = "--";
                     e.DisplayText = "--";
-                }
+                //var val = gridView1.GetRowCellValue(e.ListSourceRowIndex, gridView1.Columns[nameof(CafResult.snr)]);
+                //if (val != null && (double)val == 0)
+                //{
+                //    e.DisplayText = "--";
+                //}
             }
             }
             else if (e.Column.FieldName == nameof(CafResult.ModType)
             else if (e.Column.FieldName == nameof(CafResult.ModType)
-                || e.Column.FieldName == nameof(CafResult.ModRate))
+                || e.Column.FieldName == nameof(CafResult.ModRate)
+                || e.Column.FieldName == nameof(CafResult.FfcHz))
             {
             {
-                if (e.Value == null||e.Value.ToString()=="")
+                if (e.Value == null || e.Value.ToString() == "")
                     e.DisplayText = "--";
                     e.DisplayText = "--";
             }
             }
         }
         }

+ 13 - 2
XdCxRhDW.App/CorTools/DetectToolForm.designer.cs

@@ -78,6 +78,7 @@
             this.DemType = new DevExpress.XtraGrid.Columns.GridColumn();
             this.DemType = new DevExpress.XtraGrid.Columns.GridColumn();
             this.modType = new DevExpress.XtraGrid.Columns.GridColumn();
             this.modType = new DevExpress.XtraGrid.Columns.GridColumn();
             this.modRate = new DevExpress.XtraGrid.Columns.GridColumn();
             this.modRate = new DevExpress.XtraGrid.Columns.GridColumn();
+            this.colFFC = new DevExpress.XtraGrid.Columns.GridColumn();
             this.tePos = new DevExpress.XtraEditors.TextEdit();
             this.tePos = new DevExpress.XtraEditors.TextEdit();
             this.teCount = new DevExpress.XtraEditors.TextEdit();
             this.teCount = new DevExpress.XtraEditors.TextEdit();
             this.btnFile1 = new DevExpress.XtraEditors.ButtonEdit();
             this.btnFile1 = new DevExpress.XtraEditors.ButtonEdit();
@@ -256,7 +257,8 @@
             this.file2,
             this.file2,
             this.DemType,
             this.DemType,
             this.modType,
             this.modType,
-            this.modRate});
+            this.modRate,
+            this.colFFC});
             this.gridView1.DetailHeight = 169;
             this.gridView1.DetailHeight = 169;
             this.gridView1.FooterPanelHeight = 0;
             this.gridView1.FooterPanelHeight = 0;
             this.gridView1.GridControl = this.gcCheckCgRes;
             this.gridView1.GridControl = this.gcCheckCgRes;
@@ -389,12 +391,20 @@
             // 
             // 
             // modRate
             // modRate
             // 
             // 
-            this.modRate.Caption = "调制速率";
+            this.modRate.Caption = "调制速率bps";
             this.modRate.FieldName = "ModRate";
             this.modRate.FieldName = "ModRate";
             this.modRate.Name = "modRate";
             this.modRate.Name = "modRate";
             this.modRate.Visible = true;
             this.modRate.Visible = true;
             this.modRate.VisibleIndex = 12;
             this.modRate.VisibleIndex = 12;
             // 
             // 
+            // colFFC
+            // 
+            this.colFFC.Caption = "频偏Hz";
+            this.colFFC.FieldName = "FfcHz";
+            this.colFFC.Name = "colFFC";
+            this.colFFC.Visible = true;
+            this.colFFC.VisibleIndex = 13;
+            // 
             // tePos
             // tePos
             // 
             // 
             this.tePos.EditValue = "0";
             this.tePos.EditValue = "0";
@@ -930,5 +940,6 @@
         private DevExpress.XtraEditors.ButtonEdit txtBand;
         private DevExpress.XtraEditors.ButtonEdit txtBand;
         private DevExpress.XtraGrid.Columns.GridColumn modRate;
         private DevExpress.XtraGrid.Columns.GridColumn modRate;
         private DevExpress.XtraGrid.Columns.GridColumn DemType;
         private DevExpress.XtraGrid.Columns.GridColumn DemType;
+        private DevExpress.XtraGrid.Columns.GridColumn colFFC;
     }
     }
 }
 }

+ 20 - 0
XdCxRhDW.App/DxHelper/SvgHelper.cs

@@ -425,6 +425,7 @@ namespace DxHelper
             ms.Dispose();
             ms.Dispose();
             return svg;
             return svg;
         }
         }
+
         /// <summary>
         /// <summary>
         /// 查看参估结果
         /// 查看参估结果
         /// </summary>
         /// </summary>
@@ -456,6 +457,7 @@ namespace DxHelper
             ms.Dispose();
             ms.Dispose();
             return svg;
             return svg;
         }
         }
+
         /// <summary>
         /// <summary>
         /// 查看检测结果
         /// 查看检测结果
         /// </summary>
         /// </summary>
@@ -486,6 +488,7 @@ namespace DxHelper
             ms.Dispose();
             ms.Dispose();
             return svg;
             return svg;
         }
         }
+
         /// <summary>
         /// <summary>
         /// 重新定位
         /// 重新定位
         /// </summary>
         /// </summary>
@@ -532,5 +535,22 @@ namespace DxHelper
             ms.Dispose();
             ms.Dispose();
             return svg;
             return svg;
         }
         }
+
+        /// <summary>
+        /// 信号识别
+        /// </summary>
+        /// <returns></returns>
+        public static SvgImage CreateSigProc(int width = 24, int height = 24)
+        {
+            string xml = $"<svg xmlns='http://www.w3.org/2000/svg\' width='{width}px' height='{height}px' viewBox='0 0 32 32'>"
+                + $"<circle fill='#039C23' cx='9' cy='9' r='7'/>"
+                +$"<path fill='#FFB115' d='M24.5,2.4c0.3-0.6,0.8-0.6,1.1,0l6.3,12.5c0.3,0.6,0.1,1.1-0.5,1.1H18.7c-0.6,0-0.8-0.5-0.5-1.1L24.5,2.4z'/>"
+                + $"<path fill='#D11C1C' d='M2.4,25.9c-0.5-0.5-0.5-1.3,0-1.8l5.7-5.7c0.5-0.5,1.3-0.5,1.8,0l5.7,5.7c0.5,0.5,0.5,1.3,0,1.8l-5.7,5.7 c-0.5,0.5-1.3,0.5-1.8,0L2.4,25.9z'/>"
+                + "</svg>";
+            MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
+            var svg = SvgLoader.LoadFromStream(ms);
+            ms.Dispose();
+            return svg;
+        }
     }
     }
 }
 }

+ 2 - 0
XdCxRhDw.Dto/02.XdCxRhDW.Dto.csproj

@@ -54,6 +54,8 @@
     <Compile Include="Attribute\Pow2Attribute.cs" />
     <Compile Include="Attribute\Pow2Attribute.cs" />
     <Compile Include="Attribute\RangeAttribute.cs" />
     <Compile Include="Attribute\RangeAttribute.cs" />
     <Compile Include="CpuCgMultiDto.cs" />
     <Compile Include="CpuCgMultiDto.cs" />
+    <Compile Include="SignalProcResDto.cs" />
+    <Compile Include="SignalProcDto.cs" />
     <Compile Include="GpuCgDto.cs" />
     <Compile Include="GpuCgDto.cs" />
     <Compile Include="CpuCgDto.cs" />
     <Compile Include="CpuCgDto.cs" />
     <Compile Include="FileDownloadDto.cs" />
     <Compile Include="FileDownloadDto.cs" />

+ 42 - 0
XdCxRhDw.Dto/SignalProcDto.cs

@@ -0,0 +1,42 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using XdCxRhDW.Dto.Attribute;
+
+namespace XdCxRhDW.Dto
+{
+    /// <summary>
+    /// 信号识别模型
+    /// </summary>
+    public class SignalProcDto: IValidatableObject
+    {
+        /// <summary>
+        /// 调用Upload接口上传文件后返回的文件名
+        /// </summary>
+        [FileMustExist]
+        public string File { get; set; }
+
+        /// <summary>
+        /// 文件采样率(Hz)
+        /// </summary>
+        public long Fs { get; set; }
+
+        /// <summary>
+        /// 样点集合信息
+        /// </summary>
+        public List<SmpPosition> Smps { get; set; } = new List<SmpPosition>();
+
+
+        public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
+        {
+            if (Smps==null||!Smps.Any())
+                yield return new ValidationResult("样点集合至少包含一个元素", new[] { nameof(this.Smps) });
+            yield return null;
+        }
+    }
+
+}

+ 87 - 0
XdCxRhDw.Dto/SignalProcResDto.cs

@@ -0,0 +1,87 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using XdCxRhDW.Dto.Attribute;
+
+namespace XdCxRhDW.Dto
+{
+    /// <summary>
+    /// 信号识别结果模型
+    /// </summary>
+    public class SignalProcResDto
+    {
+        /// <summary>
+        /// 调制类型
+        /// </summary>
+        public EnumSignalTypeDto ModType { get; set; }
+
+        /// <summary>
+        /// 调制速率(bps)
+        /// </summary>
+        public double Rate { get; set; }
+
+        /// <summary>
+        /// 频偏(Hz)
+        /// </summary>
+        public double Ffc { get; set; }
+    }
+
+    /// <summary>
+    /// 信号类型枚举
+    /// </summary>
+    public enum EnumSignalTypeDto
+    {
+        /// <summary>
+        /// 未知
+        /// </summary>
+        [Display(Name = "未知")]
+        SUNKNOW = -1,
+
+        /// <summary>
+        /// BPSK
+        /// </summary>
+        [Display(Name = "BPSK")]
+        BPSK = 1,
+
+        /// <summary>
+        /// OQPSK
+        /// </summary>
+        [Display(Name = "OQPSK")]
+        OQPSK = 2,
+
+        /// <summary>
+        /// QPSK
+        /// </summary>
+        [Display(Name = "QPSK")]
+        QPSK = 3,
+
+        /// <summary>
+        /// Pi/4QPSK
+        /// </summary>
+        [Display(Name = "Pi/4QPSK")]
+        P4QPSK = 4,
+
+        /// <summary>
+        /// 8PSK
+        /// </summary>
+        [Display(Name = "8PSK")]
+        _8PSK = 5,
+
+        /// <summary>
+        /// 16APSK
+        /// </summary>
+        [Display(Name = "16APSK")]
+        _16APSK = 6,
+
+        /// <summary>
+        /// 32APSK
+        /// </summary>
+        [Display(Name = "32APSK")]
+        _32APSK = 7
+    }
+
+}