Просмотр исходного кода

修改检测参估工具可以多选检测方式

wyq 1 год назад
Родитель
Сommit
95b7b6ba61

+ 5 - 0
XdCxRhDW.Api/AddIns/检测Cpu参估/CafResult.cs

@@ -54,6 +54,11 @@ namespace XdCxRhDW.Api
         /// </summary>
         public string file2 { get; set; }
 
+        /// <summary>
+        /// 检测类型
+        /// </summary>
+        public string DmcType { get; set; }
+
         /// <summary>
         /// 调制类型(只有DAMA有)
         /// </summary>

+ 2 - 0
XdCxRhDW.Api/AddIns/检测Cpu参估/DmcResult.cs

@@ -26,6 +26,8 @@ namespace XdCxRhDW.Api
 
         public string UserName { get; set; }
 
+        public string DmcType { get; set; }
+
         public string ModType { get; set; }//调制类型,BPSK等
 
         public int Times { get; set; }//ms

+ 2 - 0
XdCxRhDW.Api/AddIns/检测Cpu参估/XcorrUtils.cs

@@ -8,6 +8,7 @@ using System.Collections;
 using System.Collections.Generic;
 using XdCxRhDW.Dto;
 using System.Security.Policy;
+using XdCxRhDW.Entity;
 
 namespace XdCxRhDW.Api
 {
@@ -239,6 +240,7 @@ namespace XdCxRhDW.Api
                     item.ModType = "BPSK";
                 else
                     item.ModType = string.Empty;
+                item.DmcType = type.GetEnumDisplayName();
                 yield return item;
             }
         }

+ 19 - 3
XdCxRhDW.App/Controllers/DetectCgController.cs

@@ -167,16 +167,32 @@ namespace XdCxRhDW.App.Controllers
             List<DetectResDto> list = new List<DetectResDto>();
             try
             {
+                List<DmcResult> dmcResults = new List<DmcResult>();
                 XcorrUtils xcorr = new XcorrUtils();
-                var dmcResult = await xcorr.DmcCheckAsync(dto.file1, dto.fsHz, dto.dmcType,dto.band);
-                foreach (var dmcItem in dmcResult)
+                if (dto.dmcType.HasFlag(DmcType.DAMA))
+                {
+                    var dmcResult = await xcorr.DmcCheckAsync(dto.file1, dto.fsHz, DmcType.DAMA, dto.band);
+                    dmcResults.AddRange(dmcResult);
+                }
+                if (dto.dmcType.HasFlag(DmcType.IBS))
+                {
+                    var dmcResult = await xcorr.DmcCheckAsync(dto.file1, dto.fsHz, DmcType.IBS, dto.band);
+                    dmcResults.AddRange(dmcResult);
+                }
+                if (dto.dmcType.HasFlag(DmcType.Ky5758))
+                {
+                    var dmcResult = await xcorr.DmcCheckAsync(dto.file1, dto.fsHz, DmcType.Ky5758, dto.band);
+                    dmcResults.AddRange(dmcResult);
+                }
+              
+                foreach (var dmcItem in dmcResults)
                 {
                     DetectResDto detectRes = new DetectResDto(dmcItem.Start, dmcItem.Length, dmcItem.UserName);
                     detectRes.ModType = dmcItem.ModType;
+                    detectRes.DmcType = dmcItem.DmcType;
                     detectRes.File1 = dto.file1;
                     detectRes.TimeMs = dmcItem.Times;
                     list.Add(detectRes);
-
                 }
             }
             catch (Exception ex)

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

@@ -145,15 +145,19 @@ namespace XdCxRhDW.App.CorTools
             DmcType dmcType = DmcType.DAMA;
             if (ckKY.Checked)
             {
-                dmcType = DmcType.Ky5758;
+                dmcType |= DmcType.Ky5758;
             }
-            else if (ckIBS.Checked)
+            if (ckIBS.Checked)
+            {
+                dmcType |= DmcType.IBS;
+            }
+            if (chkDama.Checked)
             {
-                dmcType = DmcType.IBS;
+                dmcType |= DmcType.DAMA;
             }
-            else if (chkDama.Checked)
+            else
             {
-                dmcType = DmcType.DAMA;
+                dmcType= dmcType & ~DmcType.DAMA;
             }
             DetectDto dto = new DetectDto();
             dto.dmcType = dmcType;
@@ -192,6 +196,7 @@ namespace XdCxRhDW.App.CorTools
                             file2 = btnFile2.Text,
                             smpstart = dmcItem.Start,
                             smplen = dmcItem.Length,
+                            DmcType = dmcItem.DmcType,
                             SigTime = sigTime,
                             tm = dmcItem.TimeMs,
                             ModType = dmcItem.ModType,
@@ -352,8 +357,8 @@ namespace XdCxRhDW.App.CorTools
             btnCheck.Enabled = !ckKY.Checked && !ckIBS.Checked && !chkDama.Checked ? false : true;
             if (chkDama.Checked)
             {
-                ckIBS.Checked = false;
-                ckKY.Checked = false;
+                //ckIBS.Checked = false;
+                //ckKY.Checked = false;
                 UserName.Visible = true;
                 modType.Visible = true;
                 modRate.Visible = true;
@@ -375,8 +380,8 @@ namespace XdCxRhDW.App.CorTools
             btnCheck.Enabled = !ckKY.Checked && !ckIBS.Checked && !chkDama.Checked ? false : true;
             if (ckIBS.Checked)
             {
-                chkDama.Checked = false;
-                ckKY.Checked = false;
+                //chkDama.Checked = false;
+                //ckKY.Checked = false;
                 itemBand.Visibility = LayoutVisibility.Always;
 
             }
@@ -393,11 +398,11 @@ namespace XdCxRhDW.App.CorTools
             btnCalc.Enabled = ckKY.Checked | ckIBS.Checked | chkDama.Checked ? false : true;
             btnDrawImage.Enabled = btnCalc.Enabled;
             btnCheck.Enabled = !ckKY.Checked && !ckIBS.Checked && !chkDama.Checked ? false : true;
-            if (ckKY.Checked)
-            {
-                ckIBS.Checked = false;
-                chkDama.Checked = false;
-            }
+            //if (ckKY.Checked)
+            //{
+            //    ckIBS.Checked = false;
+            //    chkDama.Checked = false;
+            //}
             layoutControl1.BestFit();
         }
 

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

@@ -28,6 +28,11 @@
         /// </summary>
         private void InitializeComponent()
         {
+            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();
             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();
@@ -53,11 +58,6 @@
             DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject18 = new DevExpress.Utils.SerializableAppearanceObject();
             DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject19 = new DevExpress.Utils.SerializableAppearanceObject();
             DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject20 = new DevExpress.Utils.SerializableAppearanceObject();
-            DevExpress.XtraEditors.Controls.EditorButtonImageOptions editorButtonImageOptions6 = new DevExpress.XtraEditors.Controls.EditorButtonImageOptions();
-            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject21 = new DevExpress.Utils.SerializableAppearanceObject();
-            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject22 = new DevExpress.Utils.SerializableAppearanceObject();
-            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject23 = new DevExpress.Utils.SerializableAppearanceObject();
-            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject24 = new DevExpress.Utils.SerializableAppearanceObject();
             this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl();
             this.txtFileTime = new DevExpress.XtraEditors.DateEdit();
             this.btnCalc = new DevExpress.XtraEditors.SimpleButton();
@@ -109,6 +109,7 @@
             this.layoutItemDrawImage = new DevExpress.XtraLayout.LayoutControlItem();
             this.layoutControlItem13 = new DevExpress.XtraLayout.LayoutControlItem();
             this.itemBand = new DevExpress.XtraLayout.LayoutControlItem();
+            this.DemType = new DevExpress.XtraGrid.Columns.GridColumn();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
             this.layoutControl1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.txtFileTime.Properties)).BeginInit();
@@ -253,6 +254,7 @@
             this.tm,
             this.file1,
             this.file2,
+            this.DemType,
             this.modType,
             this.modRate});
             this.gridView1.DetailHeight = 169;
@@ -374,7 +376,7 @@
             this.modType.FieldName = "ModType";
             this.modType.Name = "modType";
             this.modType.Visible = true;
-            this.modType.VisibleIndex = 10;
+            this.modType.VisibleIndex = 11;
             // 
             // modRate
             // 
@@ -382,7 +384,7 @@
             this.modRate.FieldName = "ModRate";
             this.modRate.Name = "modRate";
             this.modRate.Visible = true;
-            this.modRate.VisibleIndex = 11;
+            this.modRate.VisibleIndex = 12;
             // 
             // tePos
             // 
@@ -473,7 +475,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, editorButtonImageOptions7, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject25, serializableAppearanceObject26, serializableAppearanceObject27, serializableAppearanceObject28, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
             this.tefs.Size = new System.Drawing.Size(72, 20);
             this.tefs.StyleController = this.layoutControl1;
             this.tefs.TabIndex = 6;
@@ -486,7 +488,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(54, 20);
             this.teCenter.StyleController = this.layoutControl1;
             this.teCenter.TabIndex = 7;
@@ -499,7 +501,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;
@@ -512,7 +514,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;
@@ -525,7 +527,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(52, 20);
             this.teSnr.StyleController = this.layoutControl1;
             this.teSnr.TabIndex = 14;
@@ -538,7 +540,7 @@
             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(61, 21);
             this.txtBand.StyleController = this.layoutControl1;
             this.txtBand.TabIndex = 6;
@@ -811,6 +813,14 @@
             this.itemBand.TextToControlDistance = 5;
             this.itemBand.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
             // 
+            // DemType
+            // 
+            this.DemType.Caption = "检测类型";
+            this.DemType.FieldName = "DmcType";
+            this.DemType.Name = "DemType";
+            this.DemType.Visible = true;
+            this.DemType.VisibleIndex = 10;
+            // 
             // DetectToolForm
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
@@ -918,5 +928,6 @@
         private DevExpress.XtraLayout.LayoutControlItem itemBand;
         private DevExpress.XtraEditors.ButtonEdit txtBand;
         private DevExpress.XtraGrid.Columns.GridColumn modRate;
+        private DevExpress.XtraGrid.Columns.GridColumn DemType;
     }
 }

+ 3 - 2
XdCxRhDw.Dto/DetectDto.cs

@@ -23,7 +23,7 @@ namespace XdCxRhDW.Dto
         /// <summary>
         /// 检测类型
         /// </summary>
-        [RangeInt(1, 3, IncludeMin = true)]
+        [RangeInt(1, 4, IncludeMin = true)]
         public DmcType dmcType { get; set; }
 
         /// <summary>
@@ -41,6 +41,7 @@ namespace XdCxRhDW.Dto
     /// <summary>
     /// 检测类型
     /// </summary>
+    [Flags]
     public enum DmcType
     {
         /// <summary>
@@ -59,6 +60,6 @@ namespace XdCxRhDW.Dto
         /// 能量检测
         /// </summary>
         [Display(Name = "能量检测")]
-        Ky5758 = 3
+        Ky5758 = 4
     }
 }

+ 5 - 0
XdCxRhDw.Dto/DetectResDto.cs

@@ -48,6 +48,11 @@ namespace XdCxRhDW.Dto
         /// </summary>
         public string UserName { get; set; }
 
+        /// <summary>
+        /// 检测类型
+        /// </summary>
+        public string DmcType { get; set; }
+
         /// <summary>
         /// 调制类型
         /// </summary>