Procházet zdrojové kódy

添加信号信噪比

wyq před 4 roky
rodič
revize
917702d902

binární
Service/CheckServer/AddIns/SignalProc.dll


+ 1 - 1
Service/CheckServer/AddIns/SignalProc.h

@@ -30,5 +30,5 @@ extern "C"
 	/// ffcs	: ÐÅºÅÆµÆ«ÒÆ
 	/// len		: ÐźŸöÊý
 	///
-	SignalProc_EXPORT void SigalEst(char *fileIn, __int64 fsample, int *pos, int *count, int *modes, double *rates, double *ffcs, int len);
+	SignalProc_EXPORT void SigalEst(char *fileIn, __int64 fsample, int *pos, int *count, int *modes, double *rates, double *ffcs, double *snrs, int len);
 };

binární
Service/CheckServer/AddIns/SignalProc.lib


+ 9 - 2
Service/CheckServer/AddIns/SignalProcHelper.cs

@@ -13,7 +13,7 @@ namespace CheckServer
 
         #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);
+        private extern static void SigalEst(string file, long fsHz, int[] smpStart, int[] smpCount, int[] modes, double[] rates, double[] ffcs, double[] snrs, int len);
         #endregion
 
         static List<int> list1 = new List<int>();
@@ -32,7 +32,8 @@ namespace CheckServer
             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);
+            double[] snrs = new double[sigCount];//信号信噪比dB
+            SigalEst(file, fsHz, smpStart, smpCount, modes, rates, ffcs, snrs, sigCount);
             List<SignalProcRes> list = new List<SignalProcRes>();
             for (int i = 0; i < modes.Length; i++)
             {
@@ -41,6 +42,7 @@ namespace CheckServer
                     SignalType = (EnumSignalType)modes[i],
                     Ffc = Math.Round(ffcs[i], 2),
                     Rate = Math.Round(rates[i], 2),
+                    Snr= Math.Round(snrs[i], 2),
                 };
                 list.Add(item);
             }
@@ -65,6 +67,11 @@ namespace CheckServer
         /// 频偏
         /// </summary>
         public double Ffc { get; set; }
+
+        /// <summary>
+        /// 信号信噪比
+        /// </summary>
+        public double Snr { get; set; }
     }
 
     public enum EnumSignalType

+ 1 - 0
Service/CheckServer/Controllers/CheckController.cs

@@ -158,6 +158,7 @@ namespace CheckServer.Controllers
                     {
                         SignalProcResDto resItem = new SignalProcResDto()
                         {
+                            Snr=item.Snr,
                             Ffc = item.Ffc,
                             Rate = item.Rate,
                             ModType = (EnumSignalTypeDto)(int)item.SignalType

+ 1 - 0
XdCxRhDW.App/Controllers/DetectCgController.cs

@@ -105,6 +105,7 @@ namespace XdCxRhDW.App.Controllers
                     res.data[i].ModRate = procRes.data[i].Rate;
                     res.data[i].ModType = procRes.data[i].ModType.GetEnumDisplayName();
                     res.data[i].FfcHz = procRes.data[i].Ffc;
+                    res.data[i].Snr= procRes.data[i].Snr;
                 }
             }
             return res;

+ 2 - 0
XdCxRhDW.App/CorTools/DetectToolForm.cs

@@ -168,6 +168,7 @@ namespace XdCxRhDW.App.CorTools
                                 data[i].ModType = resData[i].ModType.GetEnumDisplayName();
                                 data[i].ModRate = resData[i].Rate;
                                 data[i].FfcHz = resData[i].Ffc;
+                                data[i].SigSnr = resData[i].Snr;
                             }
                             gridView1.RefreshData();
                             gridView1.BestFitColumns();
@@ -260,6 +261,7 @@ namespace XdCxRhDW.App.CorTools
                             smpstart = dmcItem.Start,
                             smplen = dmcItem.Length,
                             DmcType = dmcItem.DmcType,
+                            SigSnr=dmcItem.Snr,
                             SigTime = sigTime,
                             tm = dmcItem.TimeMs,
                             //ModType = dmcItem.ModType,

+ 38 - 27
XdCxRhDW.App/CorTools/DetectToolForm.designer.cs

@@ -28,6 +28,11 @@
         /// </summary>
         private void InitializeComponent()
         {
+            DevExpress.XtraEditors.Controls.EditorButtonImageOptions editorButtonImageOptions8 = new DevExpress.XtraEditors.Controls.EditorButtonImageOptions();
+            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject29 = new DevExpress.Utils.SerializableAppearanceObject();
+            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject30 = new DevExpress.Utils.SerializableAppearanceObject();
+            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject31 = new DevExpress.Utils.SerializableAppearanceObject();
+            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject32 = new DevExpress.Utils.SerializableAppearanceObject();
             DevExpress.XtraEditors.Controls.EditorButtonImageOptions editorButtonImageOptions1 = new DevExpress.XtraEditors.Controls.EditorButtonImageOptions();
             DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject1 = new DevExpress.Utils.SerializableAppearanceObject();
             DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject2 = new DevExpress.Utils.SerializableAppearanceObject();
@@ -58,11 +63,6 @@
             DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject22 = new DevExpress.Utils.SerializableAppearanceObject();
             DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject23 = new DevExpress.Utils.SerializableAppearanceObject();
             DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject24 = new DevExpress.Utils.SerializableAppearanceObject();
-            DevExpress.XtraEditors.Controls.EditorButtonImageOptions editorButtonImageOptions7 = new DevExpress.XtraEditors.Controls.EditorButtonImageOptions();
-            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject25 = new DevExpress.Utils.SerializableAppearanceObject();
-            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject26 = new DevExpress.Utils.SerializableAppearanceObject();
-            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject27 = new DevExpress.Utils.SerializableAppearanceObject();
-            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject28 = new DevExpress.Utils.SerializableAppearanceObject();
             this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl();
             this.txtFileTime = new DevExpress.XtraEditors.DateEdit();
             this.btnCalc = new DevExpress.XtraEditors.SimpleButton();
@@ -97,6 +97,7 @@
             this.teDfRange = new DevExpress.XtraEditors.ButtonEdit();
             this.teSnr = new DevExpress.XtraEditors.ButtonEdit();
             this.txtBand = new DevExpress.XtraEditors.ButtonEdit();
+            this.txtTimeout = new DevExpress.XtraEditors.ButtonEdit();
             this.Root = new DevExpress.XtraLayout.LayoutControlGroup();
             this.layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem();
             this.layoutControlItem3 = new DevExpress.XtraLayout.LayoutControlItem();
@@ -116,8 +117,8 @@
             this.layoutItemDrawImage = new DevExpress.XtraLayout.LayoutControlItem();
             this.layoutControlItem13 = new DevExpress.XtraLayout.LayoutControlItem();
             this.itemBand = new DevExpress.XtraLayout.LayoutControlItem();
-            this.txtTimeout = new DevExpress.XtraEditors.ButtonEdit();
             this.layoutControlItem14 = new DevExpress.XtraLayout.LayoutControlItem();
+            this.SigSnr = new DevExpress.XtraGrid.Columns.GridColumn();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
             this.layoutControl1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.txtFileTime.Properties)).BeginInit();
@@ -137,6 +138,7 @@
             ((System.ComponentModel.ISupportInitialize)(this.teDfRange.Properties)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.teSnr.Properties)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.txtBand.Properties)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.txtTimeout.Properties)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.Root)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).BeginInit();
@@ -156,7 +158,6 @@
             ((System.ComponentModel.ISupportInitialize)(this.layoutItemDrawImage)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem13)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.itemBand)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.txtTimeout.Properties)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem14)).BeginInit();
             this.SuspendLayout();
             // 
@@ -268,6 +269,7 @@
             this.DemType,
             this.modType,
             this.modRate,
+            this.SigSnr,
             this.colFFC});
             this.gridView1.DetailHeight = 169;
             this.gridView1.FooterPanelHeight = 0;
@@ -504,7 +506,7 @@
             this.tefs.Name = "tefs";
             this.tefs.Properties.AutoHeight = false;
             this.tefs.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
-            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "MHz", -1, false, true, false, editorButtonImageOptions1, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject1, serializableAppearanceObject2, serializableAppearanceObject3, serializableAppearanceObject4, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "MHz", -1, false, true, false, editorButtonImageOptions8, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject29, serializableAppearanceObject30, serializableAppearanceObject31, serializableAppearanceObject32, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
             this.tefs.Size = new System.Drawing.Size(82, 20);
             this.tefs.StyleController = this.layoutControl1;
             this.tefs.TabIndex = 6;
@@ -517,7 +519,7 @@
             this.teCenter.Name = "teCenter";
             this.teCenter.Properties.AutoHeight = false;
             this.teCenter.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
-            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "us", -1, false, true, false, editorButtonImageOptions2, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject5, serializableAppearanceObject6, serializableAppearanceObject7, serializableAppearanceObject8, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "us", -1, false, true, false, editorButtonImageOptions1, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject1, serializableAppearanceObject2, serializableAppearanceObject3, serializableAppearanceObject4, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
             this.teCenter.Size = new System.Drawing.Size(70, 20);
             this.teCenter.StyleController = this.layoutControl1;
             this.teCenter.TabIndex = 7;
@@ -530,7 +532,7 @@
             this.teRange.Name = "teRange";
             this.teRange.Properties.AutoHeight = false;
             this.teRange.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
-            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "us", -1, false, true, false, editorButtonImageOptions3, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject9, serializableAppearanceObject10, serializableAppearanceObject11, serializableAppearanceObject12, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "us", -1, false, true, false, editorButtonImageOptions2, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject5, serializableAppearanceObject6, serializableAppearanceObject7, serializableAppearanceObject8, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
             this.teRange.Size = new System.Drawing.Size(50, 20);
             this.teRange.StyleController = this.layoutControl1;
             this.teRange.TabIndex = 8;
@@ -543,7 +545,7 @@
             this.teDfRange.Name = "teDfRange";
             this.teDfRange.Properties.AutoHeight = false;
             this.teDfRange.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
-            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "Hz", -1, false, true, false, editorButtonImageOptions4, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject13, serializableAppearanceObject14, serializableAppearanceObject15, serializableAppearanceObject16, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "Hz", -1, false, true, false, editorButtonImageOptions3, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject9, serializableAppearanceObject10, serializableAppearanceObject11, serializableAppearanceObject12, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
             this.teDfRange.Size = new System.Drawing.Size(51, 20);
             this.teDfRange.StyleController = this.layoutControl1;
             this.teDfRange.TabIndex = 11;
@@ -556,7 +558,7 @@
             this.teSnr.Name = "teSnr";
             this.teSnr.Properties.AutoHeight = false;
             this.teSnr.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
-            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "dB", -1, false, true, false, editorButtonImageOptions5, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject17, serializableAppearanceObject18, serializableAppearanceObject19, serializableAppearanceObject20, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "dB", -1, false, true, false, editorButtonImageOptions4, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject13, serializableAppearanceObject14, serializableAppearanceObject15, serializableAppearanceObject16, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
             this.teSnr.Size = new System.Drawing.Size(56, 20);
             this.teSnr.StyleController = this.layoutControl1;
             this.teSnr.TabIndex = 14;
@@ -569,11 +571,24 @@
             this.txtBand.Name = "txtBand";
             this.txtBand.Properties.AutoHeight = false;
             this.txtBand.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
-            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "KHz", -1, false, true, false, editorButtonImageOptions6, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject21, serializableAppearanceObject22, serializableAppearanceObject23, serializableAppearanceObject24, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "KHz", -1, false, true, false, editorButtonImageOptions5, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject17, serializableAppearanceObject18, serializableAppearanceObject19, serializableAppearanceObject20, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
             this.txtBand.Size = new System.Drawing.Size(70, 21);
             this.txtBand.StyleController = this.layoutControl1;
             this.txtBand.TabIndex = 6;
             // 
+            // txtTimeout
+            // 
+            this.txtTimeout.EditValue = "30";
+            this.txtTimeout.Location = new System.Drawing.Point(1241, 57);
+            this.txtTimeout.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
+            this.txtTimeout.Name = "txtTimeout";
+            this.txtTimeout.Properties.AutoHeight = false;
+            this.txtTimeout.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
+            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "秒", -1, false, true, false, editorButtonImageOptions6, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject21, serializableAppearanceObject22, serializableAppearanceObject23, serializableAppearanceObject24, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
+            this.txtTimeout.Size = new System.Drawing.Size(69, 20);
+            this.txtTimeout.StyleController = this.layoutControl1;
+            this.txtTimeout.TabIndex = 14;
+            // 
             // Root
             // 
             this.Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True;
@@ -843,19 +858,6 @@
             this.itemBand.TextToControlDistance = 5;
             this.itemBand.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
             // 
-            // txtTimeout
-            // 
-            this.txtTimeout.EditValue = "30";
-            this.txtTimeout.Location = new System.Drawing.Point(1241, 57);
-            this.txtTimeout.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
-            this.txtTimeout.Name = "txtTimeout";
-            this.txtTimeout.Properties.AutoHeight = false;
-            this.txtTimeout.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
-            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "秒", -1, false, true, false, editorButtonImageOptions7, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject25, serializableAppearanceObject26, serializableAppearanceObject27, serializableAppearanceObject28, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
-            this.txtTimeout.Size = new System.Drawing.Size(69, 20);
-            this.txtTimeout.StyleController = this.layoutControl1;
-            this.txtTimeout.TabIndex = 14;
-            // 
             // layoutControlItem14
             // 
             this.layoutControlItem14.Control = this.txtTimeout;
@@ -872,6 +874,14 @@
             this.layoutControlItem14.TextSize = new System.Drawing.Size(52, 14);
             this.layoutControlItem14.TextToControlDistance = 5;
             // 
+            // SigSnr
+            // 
+            this.SigSnr.Caption = "信号信噪比dB";
+            this.SigSnr.FieldName = "SigSnr";
+            this.SigSnr.Name = "SigSnr";
+            this.SigSnr.Visible = true;
+            this.SigSnr.VisibleIndex = 14;
+            // 
             // DetectToolForm
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
@@ -903,6 +913,7 @@
             ((System.ComponentModel.ISupportInitialize)(this.teDfRange.Properties)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.teSnr.Properties)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.txtBand.Properties)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.txtTimeout.Properties)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.Root)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).EndInit();
@@ -922,7 +933,6 @@
             ((System.ComponentModel.ISupportInitialize)(this.layoutItemDrawImage)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem13)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.itemBand)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.txtTimeout.Properties)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem14)).EndInit();
             this.ResumeLayout(false);
 
@@ -985,5 +995,6 @@
         private DevExpress.XtraGrid.Columns.GridColumn colFFC;
         private DevExpress.XtraEditors.ButtonEdit txtTimeout;
         private DevExpress.XtraLayout.LayoutControlItem layoutControlItem14;
+        private DevExpress.XtraGrid.Columns.GridColumn SigSnr;
     }
 }

+ 5 - 0
XdCxRhDw.Dto/CafResultDto.cs

@@ -88,6 +88,11 @@ namespace XdCxRhDW.Dto
         /// </summary>
         public double? FfcHz { get; set; }
 
+        /// <summary>
+        /// 信号信噪比
+        /// </summary>
+        public double? SigSnr { get; set; }
+
         /// <summary>
         /// 
         /// </summary>

+ 5 - 0
XdCxRhDw.Dto/DetectResDto.cs

@@ -68,6 +68,11 @@ namespace XdCxRhDW.Dto
         /// </summary>
         public double? FfcHz { get; set; }
 
+        /// <summary>
+        /// 信号信噪比
+        /// </summary>
+        public double? Snr { get; set; }
+
         /// <summary>
         /// 耗时(ms)
         /// </summary>

+ 5 - 0
XdCxRhDw.Dto/SignalProcResDto.cs

@@ -28,6 +28,11 @@ namespace XdCxRhDW.Dto
         /// 频偏(Hz)
         /// </summary>
         public double Ffc { get; set; }
+
+        /// <summary>
+        /// 信号信噪比
+        /// </summary>
+        public double Snr { get; set; }
     }
 
     /// <summary>