gongqiuhong 1 年之前
父节点
当前提交
b21fe219be

+ 2 - 0
.gitignore

@@ -9,6 +9,8 @@
 *.user
 *.userosscache
 *.sln.docstates
+*.doc
+*.docx
 
 # User-specific files (MonoDevelop/Xamarin Studio)
 *.userprefs

+ 245 - 15
XdCxRhDW.App/CorTools/DetectToolForm.cs

@@ -1,16 +1,30 @@
-using DevExpress.Internal.WinApi.Windows.UI.Notifications;
+using DevExpress.Data.Extensions;
+using DevExpress.Internal.WinApi.Windows.UI.Notifications;
+using DevExpress.Mvvm.Native;
 using DevExpress.XtraEditors;
 using DevExpress.XtraLayout.Utils;
+using Newtonsoft.Json;
 using System;
 using System.Collections.Generic;
 using System.ComponentModel;
 using System.Data;
+using System.Data.Entity;
 using System.Drawing;
 using System.IO;
+using System.IO.Compression;
 using System.Linq;
+using System.Net;
+using System.Net.Http;
 using System.Text;
 using System.Threading.Tasks;
+using System.Web.Http.Results;
+using System.Web.UI.WebControls;
 using System.Windows.Forms;
+using XdCxRhDw.Dto;
+using XdCxRhDW.App.CpuCgTools;
+using XdCxRhDW.App.EFContext;
+using XdCxRhDW.App.WebAPI;
+using static XdCxRhDW.App.WebAPI.BaseController;
 
 namespace XdCxRhDW.App.CorTools
 {
@@ -18,6 +32,7 @@ namespace XdCxRhDW.App.CorTools
     {
         static readonly string inifile = Path.Combine(Application.StartupPath, "par.ini");
         volatile bool beRunning = false;
+        private string uploadUrL;
         BindingList<CafResult> gridSource = new BindingList<CafResult>();
 
         public DetectToolForm()
@@ -82,9 +97,10 @@ namespace XdCxRhDW.App.CorTools
             File.WriteAllLines(inifile, lines);
         }
 
-        private void MainForm_Load(object sender, EventArgs e)
+        private async void MainForm_Load(object sender, EventArgs e)
         {
             this.gridControl1.DataSource = gridSource;
+            btnCheck.Enabled = !ckKY.Checked && !ckIBS.Checked && !chkDama.Checked ? false : true;
             ReadIni();
         }
 
@@ -187,27 +203,241 @@ namespace XdCxRhDW.App.CorTools
             {
                 return;
             }
-            var dmcResult = await XcorrUtils.DmcCheckAsync(btnFile1.Text, double.Parse(tefs.Text));
-            gridSource.Clear();
-
-            foreach (var dmcItem in dmcResult)
+            DmcType dmcType = DmcType.DAMA;
+            if (ckKY.Checked)
+            {
+                dmcType = DmcType.Ky5758;
+            }
+            else if (ckIBS.Checked)
+            {
+                dmcType = DmcType.IBS;
+            }
+            else if (chkDama.Checked)
             {
-                gridSource.Add(new CafResult()
+                dmcType = DmcType.DAMA;
+            }
+            DetectDto dto = new DetectDto();
+            dto.dmcType = dmcType;
+            try
+            {
+                using (RHDWContext db = new RHDWContext())
+                {
+                    var res = await db.SysSetings.FirstOrDefaultAsync();
+                    if (res != null)
+                    {
+                        uploadUrL = $"http://{res.ServerIp}:{res.HttpPort}/api/DetectCg";
+                    }
+                }
+                dto.file1  = UpLoadFile(btnFile1.Text);
+                // 构建上传请求的 Uri
+                string uploadUri = $"{uploadUrL}/DetectCalc";
+
+                var content = new StringContent(JsonConvert.SerializeObject(dto), System.Text.Encoding.UTF8, "application/json");
+                var dmcResult = PostRequest<IEnumerable<DetectResDto>> (uploadUri, content);
+                if (dmcResult!=null)
                 {
-                    file1 = btnFile1.Text,
-                    file2 = btnFile2.Text,
-                    smpstart = dmcItem.Start,
-                    smplen = dmcItem.Length
-                });
+                    //var dmcResult = await XcorrUtils.DmcCheckAsync(btnFile1.Text, dmcType);// double.Parse(tefs.Text),
+                    gridSource.Clear();
+                    foreach (var dmcItem in dmcResult)
+                    {
+                        gridSource.Add(new CafResult()
+                        {
+                            file1 = btnFile1.Text,
+                            file2 = btnFile2.Text,
+                            smpstart = dmcItem.Start,
+                            smplen = dmcItem.Length
+                        });
+                    }
+                }
+                WriteIni();
+            }
+            catch (Exception ex)
+            {
+                DxHelper.MsgBoxHelper.ShowError($"检测计算错误{ex.Message}");
             }
+           
         }
 
         private void chkDama_CheckedChanged(object sender, EventArgs e)
         {
-            //lciBtnCheck.Visibility = chkDama.Checked ? LayoutVisibility.Always : LayoutVisibility.Never;
-            lciStartPos.Visibility = lciSampleLength.Visibility = chkDama.Checked ? LayoutVisibility.Never : LayoutVisibility.Always;
-            //layoutControl1.BestFit();
+            lciStartPos.Visibility = lciSampleLength.Visibility = ckKY.Checked | ckIBS.Checked | chkDama.Checked ? LayoutVisibility.Never : LayoutVisibility.Always;
+            btnCalc.Enabled = ckKY.Checked | ckIBS.Checked | chkDama.Checked ? false : true;
+            btnCheck.Enabled = !ckKY.Checked && !ckIBS.Checked && !chkDama.Checked ? false : true;
+            if (chkDama.Checked)
+            {
+                ckIBS.Checked = false;
+                ckKY.Checked = false;
+            }
+        }
+        private void ckIBS_CheckedChanged(object sender, EventArgs e)
+        {
+            lciStartPos.Visibility = lciSampleLength.Visibility = ckKY.Checked | ckIBS.Checked | chkDama.Checked ? LayoutVisibility.Never : LayoutVisibility.Always;
+            btnCalc.Enabled = ckKY.Checked | ckIBS.Checked | chkDama.Checked ? false : true;
+            btnCheck.Enabled = !ckKY.Checked && !ckIBS.Checked && !chkDama.Checked ? false : true;
+            if (ckIBS.Checked)
+            {
+
+                chkDama.Checked = false;
+                ckKY.Checked = false;
+            }
+        }
 
+        private void ckKY_CheckedChanged(object sender, EventArgs e)
+        {
+            lciStartPos.Visibility = lciSampleLength.Visibility = ckKY.Checked | ckIBS.Checked | chkDama.Checked ? LayoutVisibility.Never : LayoutVisibility.Always;
+            btnCalc.Enabled = ckKY.Checked | ckIBS.Checked | chkDama.Checked ? false : true;
+            btnCheck.Enabled = !ckKY.Checked && !ckIBS.Checked && !chkDama.Checked ? false : true;
+            if (ckKY.Checked)
+            {
+                ckIBS.Checked = false;
+                chkDama.Checked = false;
+            }
         }
+        private async void btnCalc_Click(object sender, EventArgs e)
+        {
+            if (btnCalc.Text == "停止")
+            {
+                XcorrUtils.Stop();
+                return;
+            }
+            //开始计算
+            //校验文件名称
+            if (!ValidateFile(btnFile1.Text))
+            {
+                return;
+            }
+            if (!ValidateFile(btnFile2.Text))
+            {
+                return;
+            }
+            List<XcorrStruct> xcorrs = new List<XcorrStruct>();
+            XcorrStruct xItem = new XcorrStruct();
+            try
+            {
+                using (RHDWContext db = new RHDWContext())
+                {
+                    var res = await db.SysSetings.FirstOrDefaultAsync();
+                    if (res != null)
+                    {
+                        uploadUrL = $"http://{res.ServerIp}:{res.HttpPort}/api/DetectCg";
+                    }
+                }
+                xItem.file1 = UpLoadFile(btnFile1.Text);
+                xItem.file2 = UpLoadFile(btnFile2.Text);
+                xItem.smpCount = int.Parse(teCount.Text);
+                xItem.samplingRate = Convert.ToInt32(double.Parse(tefs.Text) * 1e6);
+                xItem.dtCenter = int.Parse(teCenter.Text);
+                xItem.dtRange = int.Parse(teRange.Text);
+                xItem.dfRange = int.Parse(teDfRange.Text);
+                xItem.smpStart = int.Parse(tePos.Text);
+                xItem.snrThreshold = int.Parse(teSnr.Text);
+
+            }
+            catch (Exception ex)
+            {
+                DxHelper.MsgBoxHelper.ShowError($"参数错误{ex.Message}");
+                return;
+            }
+            if (lciStartPos.Visibility == LayoutVisibility.Never)
+            {
+                foreach (var item in gridSource)
+                {
+                    var corritem = xItem.Copy();
+                    corritem.smpCount = (int)item.smplen;
+                    corritem.smpStart = (int)item.smpstart;
+                    xcorrs.Add(corritem);
+                }
+
+            }
+            else
+            {
+                xcorrs.Add(xItem);
+            }
+
+            WriteIni();
+            btnCalc.Text = "停止";
+            beRunning = true;
+            gridSource.Clear();
+            foreach (var xcitem in xcorrs)
+            {
+                // 构建上传请求的 Uri
+                string uploadUri = $"{uploadUrL}/EstimationCalc";
+
+                var content = new StringContent(JsonConvert.SerializeObject(xcitem), System.Text.Encoding.UTF8, "application/json");
+                try
+                {
+                    var result = PostRequest<CafResult>(uploadUri, content);
+                    // var result = await ExecuteCorAsync(xcitem);
+                    if (result != null)
+                    {
+                        gridSource.Add(result);
+                        gridView1.FocusedRowHandle = gridSource.Count - 1;
+                    }
+                }
+                catch (Exception)
+                {
+                    continue;
+                }
+               
+
+            }
+
+            btnCalc.Text = "计算";
+            beRunning = false;
+
+        }
+        private string UpLoadFile(string filePath)
+        {
+            string file = string.Empty;
+
+            // 构建上传请求的 Uri
+            string uploadUri = $"{uploadUrL}/UploadFile";
+            try
+            {
+                // 添加文件内容到 MultipartFormDataContent
+                byte[] fileBytes = File.ReadAllBytes(filePath);
+
+                // 创建 MultipartFormDataContent 用于封装文件内容
+                MultipartFormDataContent content = new MultipartFormDataContent();
+                ByteArrayContent fileContent = new ByteArrayContent(fileBytes);
+                content.Add(fileContent, "file", Path.GetFileName(filePath));
+
+                // 发送上传请求
+                file = PostRequest<string>(uploadUri, content);
+            }
+            catch (Exception ex)
+            {
+                throw new Exception($"上传文件{filePath}到{uploadUri}失败!");
+            }
+            return file;
+        }
+        private async Task<CafResult> ExecuteCorAsync(XcorrStruct xItem)
+        {
+
+            var result = await XcorrUtils.Calc(xItem);
+            //开始计算
+            if (result.flag == -2)
+            {
+                DxHelper.MsgBoxHelper.ShowError($"内部错误");
+                btnCalc.Text = "计算";
+                beRunning = false;
+                return null;
+            }
+            else if (result.flag == -1)
+            {
+                DxHelper.MsgBoxHelper.ShowError($"计算所需数据超出文件范围");
+                btnCalc.Text = "计算";
+                beRunning = false;
+                return null;
+            }
+            else if (result.flag == -3)
+            {
+                btnCalc.Text = "计算";
+                beRunning = false;
+                return null;
+            }
+            return result;
+        }
+
     }
 }

+ 183 - 146
XdCxRhDW.App/CorTools/DetectToolForm.designer.cs

@@ -30,6 +30,7 @@
         {
             this.components = new System.ComponentModel.Container();
             this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl();
+            this.btnCalc = new DevExpress.XtraEditors.SimpleButton();
             this.chkDama = new DevExpress.XtraEditors.CheckEdit();
             this.barManager1 = new DevExpress.XtraBars.BarManager(this.components);
             this.barDockControlTop = new DevExpress.XtraBars.BarDockControl();
@@ -58,6 +59,8 @@
             this.tefs = new DevExpress.XtraEditors.TextEdit();
             this.btnFile1 = new DevExpress.XtraEditors.ButtonEdit();
             this.btnFile2 = new DevExpress.XtraEditors.ButtonEdit();
+            this.ckIBS = new DevExpress.XtraEditors.CheckEdit();
+            this.ckKY = new DevExpress.XtraEditors.CheckEdit();
             this.Root = new DevExpress.XtraLayout.LayoutControlGroup();
             this.layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem();
             this.layoutControlItem3 = new DevExpress.XtraLayout.LayoutControlItem();
@@ -71,12 +74,11 @@
             this.lciSampleLength = new DevExpress.XtraLayout.LayoutControlItem();
             this.layoutControlItem12 = new DevExpress.XtraLayout.LayoutControlItem();
             this.lciBtnCheck = new DevExpress.XtraLayout.LayoutControlItem();
-            this.popupMenu1 = new DevExpress.XtraBars.PopupMenu(this.components);
-            this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
-            this.checkEdit1 = new DevExpress.XtraEditors.CheckEdit();
             this.layoutControlItem6 = new DevExpress.XtraLayout.LayoutControlItem();
-            this.checkEdit2 = new DevExpress.XtraEditors.CheckEdit();
             this.layoutControlItem7 = new DevExpress.XtraLayout.LayoutControlItem();
+            this.layoutControlItem11 = new DevExpress.XtraLayout.LayoutControlItem();
+            this.popupMenu1 = new DevExpress.XtraBars.PopupMenu(this.components);
+            this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
             this.layoutControl1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.chkDama.Properties)).BeginInit();
@@ -92,6 +94,8 @@
             ((System.ComponentModel.ISupportInitialize)(this.tefs.Properties)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.btnFile1.Properties)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.btnFile2.Properties)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.ckIBS.Properties)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.ckKY.Properties)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.Root)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).BeginInit();
@@ -105,15 +109,15 @@
             ((System.ComponentModel.ISupportInitialize)(this.lciSampleLength)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem12)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.lciBtnCheck)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.popupMenu1)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.checkEdit1.Properties)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem6)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.checkEdit2.Properties)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem7)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem11)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.popupMenu1)).BeginInit();
             this.SuspendLayout();
             // 
             // layoutControl1
             // 
+            this.layoutControl1.Controls.Add(this.btnCalc);
             this.layoutControl1.Controls.Add(this.chkDama);
             this.layoutControl1.Controls.Add(this.btnCheck);
             this.layoutControl1.Controls.Add(this.teSnr);
@@ -126,27 +130,39 @@
             this.layoutControl1.Controls.Add(this.tefs);
             this.layoutControl1.Controls.Add(this.btnFile1);
             this.layoutControl1.Controls.Add(this.btnFile2);
-            this.layoutControl1.Controls.Add(this.checkEdit1);
-            this.layoutControl1.Controls.Add(this.checkEdit2);
+            this.layoutControl1.Controls.Add(this.ckIBS);
+            this.layoutControl1.Controls.Add(this.ckKY);
             this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill;
             this.layoutControl1.Location = new System.Drawing.Point(0, 0);
             this.layoutControl1.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.layoutControl1.Name = "layoutControl1";
             this.layoutControl1.OptionsCustomizationForm.DesignTimeCustomizationFormPositionAndSize = new System.Drawing.Rectangle(1589, 829, 1300, 800);
             this.layoutControl1.Root = this.Root;
-            this.layoutControl1.Size = new System.Drawing.Size(1257, 627);
+            this.layoutControl1.Size = new System.Drawing.Size(1100, 488);
             this.layoutControl1.TabIndex = 0;
             this.layoutControl1.Text = "layoutControl1";
             // 
+            // btnCalc
+            // 
+            this.btnCalc.Location = new System.Drawing.Point(984, 31);
+            this.btnCalc.Name = "btnCalc";
+            this.btnCalc.Size = new System.Drawing.Size(111, 22);
+            this.btnCalc.StyleController = this.layoutControl1;
+            this.btnCalc.TabIndex = 19;
+            this.btnCalc.Text = "计算";
+            this.btnCalc.Click += new System.EventHandler(this.btnCalc_Click);
+            // 
             // chkDama
             // 
-            this.chkDama.Location = new System.Drawing.Point(1023, 8);
+            this.chkDama.Location = new System.Drawing.Point(867, 6);
+            this.chkDama.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.chkDama.MenuManager = this.barManager1;
             this.chkDama.Name = "chkDama";
             this.chkDama.Properties.Caption = "DAMA";
-            this.chkDama.Size = new System.Drawing.Size(81, 24);
+            this.chkDama.Size = new System.Drawing.Size(70, 20);
             this.chkDama.StyleController = this.layoutControl1;
             this.chkDama.TabIndex = 16;
+            this.chkDama.TabStop = false;
             this.chkDama.CheckedChanged += new System.EventHandler(this.chkDama_CheckedChanged);
             // 
             // barManager1
@@ -168,16 +184,16 @@
             this.barDockControlTop.Location = new System.Drawing.Point(0, 0);
             this.barDockControlTop.Manager = this.barManager1;
             this.barDockControlTop.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
-            this.barDockControlTop.Size = new System.Drawing.Size(1257, 0);
+            this.barDockControlTop.Size = new System.Drawing.Size(1100, 0);
             // 
             // barDockControlBottom
             // 
             this.barDockControlBottom.CausesValidation = false;
             this.barDockControlBottom.Dock = System.Windows.Forms.DockStyle.Bottom;
-            this.barDockControlBottom.Location = new System.Drawing.Point(0, 627);
+            this.barDockControlBottom.Location = new System.Drawing.Point(0, 488);
             this.barDockControlBottom.Manager = this.barManager1;
             this.barDockControlBottom.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
-            this.barDockControlBottom.Size = new System.Drawing.Size(1257, 0);
+            this.barDockControlBottom.Size = new System.Drawing.Size(1100, 0);
             // 
             // barDockControlLeft
             // 
@@ -186,16 +202,16 @@
             this.barDockControlLeft.Location = new System.Drawing.Point(0, 0);
             this.barDockControlLeft.Manager = this.barManager1;
             this.barDockControlLeft.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
-            this.barDockControlLeft.Size = new System.Drawing.Size(0, 627);
+            this.barDockControlLeft.Size = new System.Drawing.Size(0, 488);
             // 
             // barDockControlRight
             // 
             this.barDockControlRight.CausesValidation = false;
             this.barDockControlRight.Dock = System.Windows.Forms.DockStyle.Right;
-            this.barDockControlRight.Location = new System.Drawing.Point(1257, 0);
+            this.barDockControlRight.Location = new System.Drawing.Point(1100, 0);
             this.barDockControlRight.Manager = this.barManager1;
             this.barDockControlRight.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
-            this.barDockControlRight.Size = new System.Drawing.Size(0, 627);
+            this.barDockControlRight.Size = new System.Drawing.Size(0, 488);
             // 
             // barButtonItem1
             // 
@@ -213,10 +229,9 @@
             // 
             // btnCheck
             // 
-            this.btnCheck.Location = new System.Drawing.Point(1023, 40);
-            this.btnCheck.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
+            this.btnCheck.Location = new System.Drawing.Point(867, 31);
             this.btnCheck.Name = "btnCheck";
-            this.btnCheck.Size = new System.Drawing.Size(229, 27);
+            this.btnCheck.Size = new System.Drawing.Size(113, 22);
             this.btnCheck.StyleController = this.layoutControl1;
             this.btnCheck.TabIndex = 15;
             this.btnCheck.Text = "检测";
@@ -225,21 +240,21 @@
             // teSnr
             // 
             this.teSnr.EditValue = "14";
-            this.teSnr.Location = new System.Drawing.Point(766, 75);
+            this.teSnr.Location = new System.Drawing.Point(646, 57);
             this.teSnr.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.teSnr.Name = "teSnr";
-            this.teSnr.Size = new System.Drawing.Size(62, 28);
+            this.teSnr.Size = new System.Drawing.Size(56, 22);
             this.teSnr.StyleController = this.layoutControl1;
             this.teSnr.TabIndex = 14;
             // 
             // gridControl1
             // 
             this.gridControl1.EmbeddedNavigator.Margin = new System.Windows.Forms.Padding(1, 0, 1, 0);
-            this.gridControl1.Location = new System.Drawing.Point(5, 109);
+            this.gridControl1.Location = new System.Drawing.Point(5, 83);
             this.gridControl1.MainView = this.gridView1;
             this.gridControl1.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.gridControl1.Name = "gridControl1";
-            this.gridControl1.Size = new System.Drawing.Size(1247, 511);
+            this.gridControl1.Size = new System.Drawing.Size(1090, 400);
             this.gridControl1.TabIndex = 12;
             this.gridControl1.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
             this.gridView1});
@@ -258,13 +273,13 @@
             this.tm,
             this.file1,
             this.file2});
-            this.gridView1.DetailHeight = 217;
+            this.gridView1.DetailHeight = 169;
             this.gridView1.FooterPanelHeight = 0;
             this.gridView1.GridControl = this.gridControl1;
             this.gridView1.GroupRowHeight = 0;
             this.gridView1.Name = "gridView1";
             this.gridView1.OptionsBehavior.Editable = false;
-            this.gridView1.OptionsEditForm.PopupEditFormWidth = 493;
+            this.gridView1.OptionsEditForm.PopupEditFormWidth = 431;
             this.gridView1.OptionsMenu.EnableColumnMenu = false;
             this.gridView1.OptionsView.ShowDetailButtons = false;
             this.gridView1.OptionsView.ShowGroupExpandCollapseButtons = false;
@@ -280,151 +295,151 @@
             // 
             this.dt.Caption = "时差(us)";
             this.dt.FieldName = "dt";
-            this.dt.MinWidth = 25;
+            this.dt.MinWidth = 22;
             this.dt.Name = "dt";
             this.dt.Visible = true;
             this.dt.VisibleIndex = 4;
-            this.dt.Width = 125;
+            this.dt.Width = 109;
             // 
             // df
             // 
             this.df.Caption = "频差(Hz)";
             this.df.FieldName = "df";
-            this.df.MinWidth = 25;
+            this.df.MinWidth = 22;
             this.df.Name = "df";
             this.df.Visible = true;
             this.df.VisibleIndex = 5;
-            this.df.Width = 125;
+            this.df.Width = 109;
             // 
             // snr
             // 
             this.snr.Caption = "信噪比";
             this.snr.FieldName = "snr";
-            this.snr.MinWidth = 25;
+            this.snr.MinWidth = 22;
             this.snr.Name = "snr";
             this.snr.Visible = true;
             this.snr.VisibleIndex = 6;
-            this.snr.Width = 95;
+            this.snr.Width = 83;
             // 
             // smpstart
             // 
             this.smpstart.Caption = "起始样点";
             this.smpstart.FieldName = "smpstart";
-            this.smpstart.MinWidth = 25;
+            this.smpstart.MinWidth = 22;
             this.smpstart.Name = "smpstart";
             this.smpstart.Visible = true;
             this.smpstart.VisibleIndex = 2;
-            this.smpstart.Width = 103;
+            this.smpstart.Width = 90;
             // 
             // smplen
             // 
             this.smplen.Caption = "样点长度";
             this.smplen.FieldName = "smplen";
-            this.smplen.MinWidth = 25;
+            this.smplen.MinWidth = 22;
             this.smplen.Name = "smplen";
             this.smplen.Visible = true;
             this.smplen.VisibleIndex = 3;
-            this.smplen.Width = 103;
+            this.smplen.Width = 90;
             // 
             // tm
             // 
             this.tm.Caption = "耗时(s)";
             this.tm.FieldName = "tm";
-            this.tm.MinWidth = 25;
+            this.tm.MinWidth = 22;
             this.tm.Name = "tm";
             this.tm.Visible = true;
             this.tm.VisibleIndex = 7;
-            this.tm.Width = 79;
+            this.tm.Width = 69;
             // 
             // file1
             // 
             this.file1.Caption = "文件1";
             this.file1.FieldName = "file1";
-            this.file1.MinWidth = 25;
+            this.file1.MinWidth = 22;
             this.file1.Name = "file1";
             this.file1.Visible = true;
             this.file1.VisibleIndex = 1;
-            this.file1.Width = 189;
+            this.file1.Width = 165;
             // 
             // file2
             // 
             this.file2.Caption = "文件2";
             this.file2.FieldName = "file2";
-            this.file2.MinWidth = 25;
+            this.file2.MinWidth = 22;
             this.file2.Name = "file2";
             this.file2.Visible = true;
             this.file2.VisibleIndex = 0;
-            this.file2.Width = 145;
+            this.file2.Width = 127;
             // 
             // teDfRange
             // 
             this.teDfRange.EditValue = "16384";
-            this.teDfRange.Location = new System.Drawing.Point(605, 75);
+            this.teDfRange.Location = new System.Drawing.Point(509, 57);
             this.teDfRange.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.teDfRange.Name = "teDfRange";
-            this.teDfRange.Size = new System.Drawing.Size(62, 28);
+            this.teDfRange.Size = new System.Drawing.Size(56, 22);
             this.teDfRange.StyleController = this.layoutControl1;
             this.teDfRange.TabIndex = 11;
             // 
             // tePos
             // 
             this.tePos.EditValue = "0";
-            this.tePos.Location = new System.Drawing.Point(911, 75);
+            this.tePos.Location = new System.Drawing.Point(770, 57);
             this.tePos.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.tePos.Name = "tePos";
-            this.tePos.Size = new System.Drawing.Size(62, 28);
+            this.tePos.Size = new System.Drawing.Size(55, 22);
             this.tePos.StyleController = this.layoutControl1;
             this.tePos.TabIndex = 10;
             // 
             // teCount
             // 
             this.teCount.EditValue = "0";
-            this.teCount.Location = new System.Drawing.Point(1057, 75);
+            this.teCount.Location = new System.Drawing.Point(894, 57);
             this.teCount.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.teCount.Name = "teCount";
-            this.teCount.Size = new System.Drawing.Size(195, 28);
+            this.teCount.Size = new System.Drawing.Size(201, 22);
             this.teCount.StyleController = this.layoutControl1;
             this.teCount.TabIndex = 9;
             // 
             // teRange
             // 
             this.teRange.EditValue = "40000";
-            this.teRange.Location = new System.Drawing.Point(440, 75);
+            this.teRange.Location = new System.Drawing.Point(370, 57);
             this.teRange.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.teRange.Name = "teRange";
-            this.teRange.Size = new System.Drawing.Size(62, 28);
+            this.teRange.Size = new System.Drawing.Size(55, 22);
             this.teRange.StyleController = this.layoutControl1;
             this.teRange.TabIndex = 8;
             // 
             // teCenter
             // 
             this.teCenter.EditValue = "0";
-            this.teCenter.Location = new System.Drawing.Point(267, 75);
+            this.teCenter.Location = new System.Drawing.Point(224, 57);
             this.teCenter.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.teCenter.Name = "teCenter";
-            this.teCenter.Size = new System.Drawing.Size(62, 28);
+            this.teCenter.Size = new System.Drawing.Size(55, 22);
             this.teCenter.StyleController = this.layoutControl1;
             this.teCenter.TabIndex = 7;
             // 
             // tefs
             // 
             this.tefs.EditValue = "0.096";
-            this.tefs.Location = new System.Drawing.Point(94, 75);
+            this.tefs.Location = new System.Drawing.Point(77, 57);
             this.tefs.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.tefs.Name = "tefs";
-            this.tefs.Size = new System.Drawing.Size(62, 28);
+            this.tefs.Size = new System.Drawing.Size(56, 22);
             this.tefs.StyleController = this.layoutControl1;
             this.tefs.TabIndex = 6;
             // 
             // btnFile1
             // 
             this.btnFile1.AllowDrop = true;
-            this.btnFile1.Location = new System.Drawing.Point(93, 7);
+            this.btnFile1.Location = new System.Drawing.Point(77, 5);
             this.btnFile1.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.btnFile1.Name = "btnFile1";
             this.btnFile1.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
             new DevExpress.XtraEditors.Controls.EditorButton()});
-            this.btnFile1.Size = new System.Drawing.Size(926, 28);
+            this.btnFile1.Size = new System.Drawing.Size(786, 22);
             this.btnFile1.StyleController = this.layoutControl1;
             this.btnFile1.TabIndex = 5;
             this.btnFile1.ButtonClick += new DevExpress.XtraEditors.Controls.ButtonPressedEventHandler(this.btnFile_ButtonClick);
@@ -435,12 +450,12 @@
             // btnFile2
             // 
             this.btnFile2.AllowDrop = true;
-            this.btnFile2.Location = new System.Drawing.Point(93, 41);
+            this.btnFile2.Location = new System.Drawing.Point(77, 31);
             this.btnFile2.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.btnFile2.Name = "btnFile2";
             this.btnFile2.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
             new DevExpress.XtraEditors.Controls.EditorButton()});
-            this.btnFile2.Size = new System.Drawing.Size(926, 28);
+            this.btnFile2.Size = new System.Drawing.Size(786, 22);
             this.btnFile2.StyleController = this.layoutControl1;
             this.btnFile2.TabIndex = 4;
             this.btnFile2.ButtonClick += new DevExpress.XtraEditors.Controls.ButtonPressedEventHandler(this.btnFile_ButtonClick);
@@ -448,6 +463,32 @@
             this.btnFile2.DragOver += new System.Windows.Forms.DragEventHandler(this.btnFile_DragOver);
             this.btnFile2.DoubleClick += new System.EventHandler(this.btnFile_DoubleClick);
             // 
+            // ckIBS
+            // 
+            this.ckIBS.Location = new System.Drawing.Point(941, 6);
+            this.ckIBS.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.ckIBS.MenuManager = this.barManager1;
+            this.ckIBS.Name = "ckIBS";
+            this.ckIBS.Properties.Caption = "IBS";
+            this.ckIBS.Size = new System.Drawing.Size(52, 20);
+            this.ckIBS.StyleController = this.layoutControl1;
+            this.ckIBS.TabIndex = 17;
+            this.ckIBS.TabStop = false;
+            this.ckIBS.CheckedChanged += new System.EventHandler(this.ckIBS_CheckedChanged);
+            // 
+            // ckKY
+            // 
+            this.ckKY.Location = new System.Drawing.Point(997, 6);
+            this.ckKY.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.ckKY.MenuManager = this.barManager1;
+            this.ckKY.Name = "ckKY";
+            this.ckKY.Properties.Caption = "Ky5758";
+            this.ckKY.Size = new System.Drawing.Size(98, 20);
+            this.ckKY.StyleController = this.layoutControl1;
+            this.ckKY.TabIndex = 18;
+            this.ckKY.TabStop = false;
+            this.ckKY.CheckedChanged += new System.EventHandler(this.ckKY_CheckedChanged);
+            // 
             // Root
             // 
             this.Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True;
@@ -466,10 +507,11 @@
             this.layoutControlItem12,
             this.lciBtnCheck,
             this.layoutControlItem6,
-            this.layoutControlItem7});
+            this.layoutControlItem7,
+            this.layoutControlItem11});
             this.Root.Name = "Root";
-            this.Root.Padding = new DevExpress.XtraLayout.Utils.Padding(3, 3, 4, 4);
-            this.Root.Size = new System.Drawing.Size(1257, 627);
+            this.Root.Padding = new DevExpress.XtraLayout.Utils.Padding(3, 3, 3, 3);
+            this.Root.Size = new System.Drawing.Size(1100, 488);
             this.Root.TextVisible = false;
             // 
             // layoutControlItem2
@@ -477,107 +519,107 @@
             this.layoutControlItem2.Control = this.btnFile1;
             this.layoutControlItem2.Location = new System.Drawing.Point(0, 0);
             this.layoutControlItem2.Name = "layoutControlItem2";
-            this.layoutControlItem2.Size = new System.Drawing.Size(1018, 34);
+            this.layoutControlItem2.Size = new System.Drawing.Size(862, 26);
             this.layoutControlItem2.Text = "信号文件1:";
             this.layoutControlItem2.TextAlignMode = DevExpress.XtraLayout.TextAlignModeItem.AutoSize;
-            this.layoutControlItem2.TextSize = new System.Drawing.Size(83, 18);
+            this.layoutControlItem2.TextSize = new System.Drawing.Size(67, 14);
             this.layoutControlItem2.TextToControlDistance = 5;
             // 
             // layoutControlItem3
             // 
             this.layoutControlItem3.Control = this.tefs;
-            this.layoutControlItem3.Location = new System.Drawing.Point(0, 68);
+            this.layoutControlItem3.Location = new System.Drawing.Point(0, 52);
             this.layoutControlItem3.Name = "layoutControlItem3";
-            this.layoutControlItem3.Size = new System.Drawing.Size(155, 34);
+            this.layoutControlItem3.Size = new System.Drawing.Size(132, 26);
             this.layoutControlItem3.Text = "采样率(M):";
             this.layoutControlItem3.TextAlignMode = DevExpress.XtraLayout.TextAlignModeItem.AutoSize;
-            this.layoutControlItem3.TextSize = new System.Drawing.Size(84, 18);
+            this.layoutControlItem3.TextSize = new System.Drawing.Size(67, 14);
             this.layoutControlItem3.TextToControlDistance = 5;
             // 
             // layoutControlItem9
             // 
             this.layoutControlItem9.Control = this.gridControl1;
-            this.layoutControlItem9.Location = new System.Drawing.Point(0, 102);
+            this.layoutControlItem9.Location = new System.Drawing.Point(0, 78);
             this.layoutControlItem9.Name = "layoutControlItem9";
-            this.layoutControlItem9.Size = new System.Drawing.Size(1251, 517);
+            this.layoutControlItem9.Size = new System.Drawing.Size(1094, 404);
             this.layoutControlItem9.TextSize = new System.Drawing.Size(0, 0);
             this.layoutControlItem9.TextVisible = false;
             // 
             // layoutControlItem1
             // 
             this.layoutControlItem1.Control = this.btnFile2;
-            this.layoutControlItem1.Location = new System.Drawing.Point(0, 34);
+            this.layoutControlItem1.Location = new System.Drawing.Point(0, 26);
             this.layoutControlItem1.Name = "layoutControlItem1";
-            this.layoutControlItem1.Size = new System.Drawing.Size(1018, 34);
+            this.layoutControlItem1.Size = new System.Drawing.Size(862, 26);
             this.layoutControlItem1.Text = "信号文件2:";
             this.layoutControlItem1.TextAlignMode = DevExpress.XtraLayout.TextAlignModeItem.AutoSize;
-            this.layoutControlItem1.TextSize = new System.Drawing.Size(83, 18);
+            this.layoutControlItem1.TextSize = new System.Drawing.Size(67, 14);
             this.layoutControlItem1.TextToControlDistance = 5;
             // 
             // layoutControlItem4
             // 
             this.layoutControlItem4.Control = this.teCenter;
-            this.layoutControlItem4.Location = new System.Drawing.Point(155, 68);
+            this.layoutControlItem4.Location = new System.Drawing.Point(132, 52);
             this.layoutControlItem4.Name = "layoutControlItem4";
-            this.layoutControlItem4.Size = new System.Drawing.Size(173, 34);
+            this.layoutControlItem4.Size = new System.Drawing.Size(146, 26);
             this.layoutControlItem4.Text = "时差中心(us):";
             this.layoutControlItem4.TextAlignMode = DevExpress.XtraLayout.TextAlignModeItem.AutoSize;
-            this.layoutControlItem4.TextSize = new System.Drawing.Size(102, 18);
+            this.layoutControlItem4.TextSize = new System.Drawing.Size(82, 14);
             this.layoutControlItem4.TextToControlDistance = 5;
             // 
             // layoutControlItem5
             // 
             this.layoutControlItem5.Control = this.teRange;
-            this.layoutControlItem5.Location = new System.Drawing.Point(328, 68);
+            this.layoutControlItem5.Location = new System.Drawing.Point(278, 52);
             this.layoutControlItem5.Name = "layoutControlItem5";
-            this.layoutControlItem5.Size = new System.Drawing.Size(173, 34);
+            this.layoutControlItem5.Size = new System.Drawing.Size(146, 26);
             this.layoutControlItem5.Text = "时差范围(us):";
             this.layoutControlItem5.TextAlignMode = DevExpress.XtraLayout.TextAlignModeItem.AutoSize;
-            this.layoutControlItem5.TextSize = new System.Drawing.Size(102, 18);
+            this.layoutControlItem5.TextSize = new System.Drawing.Size(82, 14);
             this.layoutControlItem5.TextToControlDistance = 5;
             // 
             // layoutControlItem10
             // 
             this.layoutControlItem10.Control = this.teSnr;
-            this.layoutControlItem10.Location = new System.Drawing.Point(666, 68);
+            this.layoutControlItem10.Location = new System.Drawing.Point(564, 52);
             this.layoutControlItem10.Name = "layoutControlItem10";
-            this.layoutControlItem10.Size = new System.Drawing.Size(161, 34);
+            this.layoutControlItem10.Size = new System.Drawing.Size(137, 26);
             this.layoutControlItem10.Text = "信噪比门限:";
             this.layoutControlItem10.TextAlignMode = DevExpress.XtraLayout.TextAlignModeItem.AutoSize;
-            this.layoutControlItem10.TextSize = new System.Drawing.Size(90, 18);
+            this.layoutControlItem10.TextSize = new System.Drawing.Size(72, 14);
             this.layoutControlItem10.TextToControlDistance = 5;
             // 
             // layoutControlItem8
             // 
             this.layoutControlItem8.Control = this.teDfRange;
-            this.layoutControlItem8.Location = new System.Drawing.Point(501, 68);
+            this.layoutControlItem8.Location = new System.Drawing.Point(424, 52);
             this.layoutControlItem8.Name = "layoutControlItem8";
-            this.layoutControlItem8.Size = new System.Drawing.Size(165, 34);
+            this.layoutControlItem8.Size = new System.Drawing.Size(140, 26);
             this.layoutControlItem8.Text = "频差范围(Hz):";
             this.layoutControlItem8.TextAlignMode = DevExpress.XtraLayout.TextAlignModeItem.AutoSize;
-            this.layoutControlItem8.TextSize = new System.Drawing.Size(94, 18);
+            this.layoutControlItem8.TextSize = new System.Drawing.Size(75, 14);
             this.layoutControlItem8.TextToControlDistance = 5;
             // 
             // lciStartPos
             // 
             this.lciStartPos.Control = this.tePos;
-            this.lciStartPos.Location = new System.Drawing.Point(827, 68);
+            this.lciStartPos.Location = new System.Drawing.Point(701, 52);
             this.lciStartPos.Name = "lciStartPos";
-            this.lciStartPos.Size = new System.Drawing.Size(145, 34);
+            this.lciStartPos.Size = new System.Drawing.Size(123, 26);
             this.lciStartPos.Text = "起始样点:";
             this.lciStartPos.TextAlignMode = DevExpress.XtraLayout.TextAlignModeItem.AutoSize;
-            this.lciStartPos.TextSize = new System.Drawing.Size(75, 18);
+            this.lciStartPos.TextSize = new System.Drawing.Size(60, 14);
             this.lciStartPos.TextToControlDistance = 4;
             // 
             // lciSampleLength
             // 
             this.lciSampleLength.Control = this.teCount;
-            this.lciSampleLength.Location = new System.Drawing.Point(972, 68);
+            this.lciSampleLength.Location = new System.Drawing.Point(824, 52);
             this.lciSampleLength.Name = "lciSampleLength";
-            this.lciSampleLength.Size = new System.Drawing.Size(279, 34);
+            this.lciSampleLength.Size = new System.Drawing.Size(270, 26);
             this.lciSampleLength.Text = "计算样点:";
             this.lciSampleLength.TextAlignMode = DevExpress.XtraLayout.TextAlignModeItem.AutoSize;
-            this.lciSampleLength.TextSize = new System.Drawing.Size(75, 18);
+            this.lciSampleLength.TextSize = new System.Drawing.Size(60, 14);
             this.lciSampleLength.TextToControlDistance = 5;
             // 
             // layoutControlItem12
@@ -585,11 +627,11 @@
             this.layoutControlItem12.ContentHorzAlignment = DevExpress.Utils.HorzAlignment.Center;
             this.layoutControlItem12.ContentVertAlignment = DevExpress.Utils.VertAlignment.Center;
             this.layoutControlItem12.Control = this.chkDama;
-            this.layoutControlItem12.Location = new System.Drawing.Point(1018, 0);
-            this.layoutControlItem12.MaxSize = new System.Drawing.Size(0, 33);
-            this.layoutControlItem12.MinSize = new System.Drawing.Size(85, 33);
+            this.layoutControlItem12.Location = new System.Drawing.Point(862, 0);
+            this.layoutControlItem12.MaxSize = new System.Drawing.Size(0, 26);
+            this.layoutControlItem12.MinSize = new System.Drawing.Size(74, 26);
             this.layoutControlItem12.Name = "layoutControlItem12";
-            this.layoutControlItem12.Size = new System.Drawing.Size(85, 33);
+            this.layoutControlItem12.Size = new System.Drawing.Size(74, 26);
             this.layoutControlItem12.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
             this.layoutControlItem12.TextSize = new System.Drawing.Size(0, 0);
             this.layoutControlItem12.TextVisible = false;
@@ -597,83 +639,75 @@
             // lciBtnCheck
             // 
             this.lciBtnCheck.Control = this.btnCheck;
-            this.lciBtnCheck.Location = new System.Drawing.Point(1018, 33);
-            this.lciBtnCheck.MaxSize = new System.Drawing.Size(233, 33);
-            this.lciBtnCheck.MinSize = new System.Drawing.Size(233, 33);
+            this.lciBtnCheck.Location = new System.Drawing.Point(862, 26);
+            this.lciBtnCheck.MaxSize = new System.Drawing.Size(0, 26);
+            this.lciBtnCheck.MinSize = new System.Drawing.Size(117, 26);
             this.lciBtnCheck.Name = "lciBtnCheck";
-            this.lciBtnCheck.Size = new System.Drawing.Size(233, 35);
+            this.lciBtnCheck.Size = new System.Drawing.Size(117, 26);
             this.lciBtnCheck.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
             this.lciBtnCheck.TextSize = new System.Drawing.Size(0, 0);
             this.lciBtnCheck.TextVisible = false;
             // 
-            // popupMenu1
-            // 
-            this.popupMenu1.LinksPersistInfo.AddRange(new DevExpress.XtraBars.LinkPersistInfo[] {
-            new DevExpress.XtraBars.LinkPersistInfo(this.barButtonItem1),
-            new DevExpress.XtraBars.LinkPersistInfo(this.barButtonItem2)});
-            this.popupMenu1.Manager = this.barManager1;
-            this.popupMenu1.Name = "popupMenu1";
-            // 
-            // openFileDialog1
-            // 
-            this.openFileDialog1.FileName = "openFileDialog1";
-            // 
-            // checkEdit1
-            // 
-            this.checkEdit1.Location = new System.Drawing.Point(1108, 8);
-            this.checkEdit1.MenuManager = this.barManager1;
-            this.checkEdit1.Name = "checkEdit1";
-            this.checkEdit1.Properties.Caption = "IBS";
-            this.checkEdit1.Size = new System.Drawing.Size(60, 24);
-            this.checkEdit1.StyleController = this.layoutControl1;
-            this.checkEdit1.TabIndex = 17;
-            // 
             // layoutControlItem6
             // 
             this.layoutControlItem6.ContentHorzAlignment = DevExpress.Utils.HorzAlignment.Center;
             this.layoutControlItem6.ContentVertAlignment = DevExpress.Utils.VertAlignment.Center;
-            this.layoutControlItem6.Control = this.checkEdit1;
-            this.layoutControlItem6.Location = new System.Drawing.Point(1103, 0);
-            this.layoutControlItem6.MaxSize = new System.Drawing.Size(0, 33);
-            this.layoutControlItem6.MinSize = new System.Drawing.Size(64, 33);
+            this.layoutControlItem6.Control = this.ckIBS;
+            this.layoutControlItem6.Location = new System.Drawing.Point(936, 0);
+            this.layoutControlItem6.MaxSize = new System.Drawing.Size(0, 26);
+            this.layoutControlItem6.MinSize = new System.Drawing.Size(56, 26);
             this.layoutControlItem6.Name = "layoutControlItem6";
-            this.layoutControlItem6.Size = new System.Drawing.Size(64, 33);
+            this.layoutControlItem6.Size = new System.Drawing.Size(56, 26);
             this.layoutControlItem6.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
             this.layoutControlItem6.TextSize = new System.Drawing.Size(0, 0);
             this.layoutControlItem6.TextVisible = false;
             // 
-            // checkEdit2
-            // 
-            this.checkEdit2.Location = new System.Drawing.Point(1172, 8);
-            this.checkEdit2.MenuManager = this.barManager1;
-            this.checkEdit2.Name = "checkEdit2";
-            this.checkEdit2.Properties.Caption = "Ky5758";
-            this.checkEdit2.Size = new System.Drawing.Size(80, 24);
-            this.checkEdit2.StyleController = this.layoutControl1;
-            this.checkEdit2.TabIndex = 18;
-            // 
             // layoutControlItem7
             // 
             this.layoutControlItem7.ContentHorzAlignment = DevExpress.Utils.HorzAlignment.Center;
             this.layoutControlItem7.ContentVertAlignment = DevExpress.Utils.VertAlignment.Center;
-            this.layoutControlItem7.Control = this.checkEdit2;
-            this.layoutControlItem7.Location = new System.Drawing.Point(1167, 0);
+            this.layoutControlItem7.Control = this.ckKY;
+            this.layoutControlItem7.Location = new System.Drawing.Point(992, 0);
             this.layoutControlItem7.Name = "layoutControlItem7";
-            this.layoutControlItem7.Size = new System.Drawing.Size(84, 33);
+            this.layoutControlItem7.Size = new System.Drawing.Size(102, 26);
             this.layoutControlItem7.TextSize = new System.Drawing.Size(0, 0);
             this.layoutControlItem7.TextVisible = false;
             // 
+            // layoutControlItem11
+            // 
+            this.layoutControlItem11.Control = this.btnCalc;
+            this.layoutControlItem11.Location = new System.Drawing.Point(979, 26);
+            this.layoutControlItem11.MaxSize = new System.Drawing.Size(0, 26);
+            this.layoutControlItem11.MinSize = new System.Drawing.Size(115, 26);
+            this.layoutControlItem11.Name = "layoutControlItem11";
+            this.layoutControlItem11.Size = new System.Drawing.Size(115, 26);
+            this.layoutControlItem11.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
+            this.layoutControlItem11.TextSize = new System.Drawing.Size(0, 0);
+            this.layoutControlItem11.TextVisible = false;
+            // 
+            // popupMenu1
+            // 
+            this.popupMenu1.LinksPersistInfo.AddRange(new DevExpress.XtraBars.LinkPersistInfo[] {
+            new DevExpress.XtraBars.LinkPersistInfo(this.barButtonItem1),
+            new DevExpress.XtraBars.LinkPersistInfo(this.barButtonItem2)});
+            this.popupMenu1.Manager = this.barManager1;
+            this.popupMenu1.Name = "popupMenu1";
+            // 
+            // openFileDialog1
+            // 
+            this.openFileDialog1.FileName = "openFileDialog1";
+            // 
             // DetectToolForm
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 18F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1257, 627);
+            this.ClientSize = new System.Drawing.Size(1100, 488);
             this.Controls.Add(this.layoutControl1);
             this.Controls.Add(this.barDockControlLeft);
             this.Controls.Add(this.barDockControlRight);
             this.Controls.Add(this.barDockControlBottom);
             this.Controls.Add(this.barDockControlTop);
-            this.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
+            this.Margin = new System.Windows.Forms.Padding(2);
             this.MaximizeBox = false;
             this.Name = "DetectToolForm";
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
@@ -695,6 +729,8 @@
             ((System.ComponentModel.ISupportInitialize)(this.tefs.Properties)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.btnFile1.Properties)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.btnFile2.Properties)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.ckIBS.Properties)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.ckKY.Properties)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.Root)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).EndInit();
@@ -708,11 +744,10 @@
             ((System.ComponentModel.ISupportInitialize)(this.lciSampleLength)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem12)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.lciBtnCheck)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.popupMenu1)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.checkEdit1.Properties)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem6)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.checkEdit2.Properties)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem7)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem11)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.popupMenu1)).EndInit();
             this.ResumeLayout(false);
             this.PerformLayout();
 
@@ -765,9 +800,11 @@
         private DevExpress.XtraLayout.LayoutControlItem lciBtnCheck;
         private DevExpress.XtraEditors.CheckEdit chkDama;
         private DevExpress.XtraLayout.LayoutControlItem layoutControlItem12;
-        private DevExpress.XtraEditors.CheckEdit checkEdit1;
-        private DevExpress.XtraEditors.CheckEdit checkEdit2;
+        private DevExpress.XtraEditors.CheckEdit ckIBS;
+        private DevExpress.XtraEditors.CheckEdit ckKY;
         private DevExpress.XtraLayout.LayoutControlItem layoutControlItem6;
         private DevExpress.XtraLayout.LayoutControlItem layoutControlItem7;
+        private DevExpress.XtraEditors.SimpleButton btnCalc;
+        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem11;
     }
 }

+ 36 - 2
XdCxRhDW.App/CorTools/XcorrUtils.cs

@@ -8,6 +8,10 @@ using System.Windows.Forms;
 using XdCxRhDW.App.CpuCgTools;
 using System.Collections;
 using System.Collections.Generic;
+using DevExpress.Drawing.Internal.Fonts.Interop;
+using System.Windows.Documents;
+using XdCxRhDW.App.WebAPI.DTO;
+using XdCxRhDw.Dto;
 
 namespace XdCxRhDW.App.CorTools
 {
@@ -24,6 +28,21 @@ namespace XdCxRhDW.App.CorTools
         public double dfRange { get; set; }         //频差范围
         public double snrThreshold { get; set; }	//信噪比门限
 
+        public XcorrStruct Copy()
+        {
+            XcorrStruct xItem = new XcorrStruct();
+            xItem.file1 = file1;
+            xItem.file2 = file2;
+            xItem.smpCount = smpCount;
+            xItem.samplingRate = samplingRate;
+            xItem.dtCenter = dtCenter;
+            xItem.dtRange = dtRange;
+            xItem.dfRange = dfRange;
+            xItem.smpStart = smpStart;
+            xItem.snrThreshold = snrThreshold;
+            return xItem;
+        }
+
     }
     class XcorrUtils
     {
@@ -57,12 +76,27 @@ namespace XdCxRhDW.App.CorTools
             return res;
         }
 
-        public static async Task<IEnumerable<DmcResult>> DmcCheckAsync(string fileName, double fs)
+        public static async Task<IEnumerable<DmcResult>> DmcCheckAsync(string fileName,  DmcType dmcType)
         {
+            string dmcCmd = "all";
+            switch (dmcType)
+            {
+                case DmcType.DAMA:
+                    dmcCmd = "dm";
+                    break;
+                case DmcType.IBS:
+                    dmcCmd = "nd";
+                    break;
+                case DmcType.Ky5758:
+                    throw new Exception("ky未实现!");
+                    break;
+                default:
+                    break;
+            }
             return await Task.Run(() =>
              {
                  p.StartInfo.FileName = Path.Combine(p.StartInfo.WorkingDirectory, "xcorr\\dmc.exe");
-                 p.StartInfo.Arguments = $"all \"{fileName}\" -f {fs} -c --dmfirst";
+                 p.StartInfo.Arguments = $"{dmcCmd} \"{fileName}\"";// -f {fs}" -c --dmfirst";
                  p.StartInfo.CreateNoWindow = true;
                  p.StartInfo.RedirectStandardError = true;
                  p.StartInfo.RedirectStandardOutput = true;

+ 1 - 0
XdCxRhDW.App/CpuCgTools/DmcResult.cs

@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;

+ 17 - 16
XdCxRhDW.App/MainForm.Designer.cs

@@ -31,8 +31,8 @@
             this.components = new System.ComponentModel.Container();
             this.components = new System.ComponentModel.Container();
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
-            DevExpress.Utils.SuperToolTip superToolTip4 = new DevExpress.Utils.SuperToolTip();
-            DevExpress.Utils.ToolTipItem toolTipItem4 = new DevExpress.Utils.ToolTipItem();
+            DevExpress.Utils.SuperToolTip superToolTip2 = new DevExpress.Utils.SuperToolTip();
+            DevExpress.Utils.ToolTipItem toolTipItem2 = new DevExpress.Utils.ToolTipItem();
             this.ribbon = new DevExpress.XtraBars.Ribbon.RibbonControl();
             this.skinPaletteDropDownButtonItem1 = new DevExpress.XtraBars.SkinPaletteDropDownButtonItem();
             this.btnOpenApi = new DevExpress.XtraBars.BarButtonItem();
@@ -47,6 +47,7 @@
             this.btnCocTool = new DevExpress.XtraBars.BarButtonItem();
             this.btnErrFx = new DevExpress.XtraBars.BarButtonItem();
             this.btnDetectTool = new DevExpress.XtraBars.BarButtonItem();
+            this.btnXlCalculate = new DevExpress.XtraBars.BarButtonItem();
             this.ribbonPage1 = new DevExpress.XtraBars.Ribbon.RibbonPage();
             this.ribbonPageGroup1 = new DevExpress.XtraBars.Ribbon.RibbonPageGroup();
             this.ribbonPageGroup2 = new DevExpress.XtraBars.Ribbon.RibbonPageGroup();
@@ -55,7 +56,6 @@
             this.documentManager1 = new DevExpress.XtraBars.Docking2010.DocumentManager(this.components);
             this.tabbedView1 = new DevExpress.XtraBars.Docking2010.Views.Tabbed.TabbedView(this.components);
             this.dockManager1 = new DevExpress.XtraBars.Docking.DockManager(this.components);
-            this.btnXlCalculate = new DevExpress.XtraBars.BarButtonItem();
             ((System.ComponentModel.ISupportInitialize)(this.ribbon)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.documentManager1)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.tabbedView1)).BeginInit();
@@ -98,7 +98,7 @@
             this.ribbon.ShowPageHeadersMode = DevExpress.XtraBars.Ribbon.ShowPageHeadersMode.Show;
             this.ribbon.ShowQatLocationSelector = false;
             this.ribbon.ShowToolbarCustomizeItem = false;
-            this.ribbon.Size = new System.Drawing.Size(1347, 126);
+            this.ribbon.Size = new System.Drawing.Size(1347, 133);
             this.ribbon.Toolbar.ShowCustomizeItem = false;
             // 
             // skinPaletteDropDownButtonItem1
@@ -112,9 +112,9 @@
             this.btnOpenApi.Id = 21;
             this.btnOpenApi.ImageOptions.SvgImage = ((DevExpress.Utils.Svg.SvgImage)(resources.GetObject("btnOpenApi.ImageOptions.SvgImage")));
             this.btnOpenApi.Name = "btnOpenApi";
-            toolTipItem4.Text = "查看接口文档";
-            superToolTip4.Items.Add(toolTipItem4);
-            this.btnOpenApi.SuperTip = superToolTip4;
+            toolTipItem2.Text = "查看接口文档";
+            superToolTip2.Items.Add(toolTipItem2);
+            this.btnOpenApi.SuperTip = superToolTip2;
             this.btnOpenApi.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.btnOpenApi_ItemClick);
             // 
             // btnTask
@@ -189,6 +189,7 @@
             this.btnCocTool.Id = 17;
             this.btnCocTool.ImageOptions.ImageUri.Uri = "snap/calcdefault";
             this.btnCocTool.Name = "btnCocTool";
+            this.btnCocTool.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
             this.btnCocTool.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.btn_ItemClick);
             // 
             // btnErrFx
@@ -200,12 +201,20 @@
             // 
             // btnDetectTool
             // 
-            this.btnDetectTool.Caption = "检测工具";
+            this.btnDetectTool.Caption = "检测参估工具";
             this.btnDetectTool.Id = 22;
             this.btnDetectTool.ImageOptions.SvgImage = ((DevExpress.Utils.Svg.SvgImage)(resources.GetObject("btnDetectTool.ImageOptions.SvgImage")));
             this.btnDetectTool.Name = "btnDetectTool";
             this.btnDetectTool.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.btn_ItemClick);
             // 
+            // btnXlCalculate
+            // 
+            this.btnXlCalculate.Caption = "星历推算";
+            this.btnXlCalculate.Id = 24;
+            this.btnXlCalculate.ImageOptions.SvgImage = ((DevExpress.Utils.Svg.SvgImage)(resources.GetObject("btnXlCalculate.ImageOptions.SvgImage")));
+            this.btnXlCalculate.Name = "btnXlCalculate";
+            this.btnXlCalculate.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.btn_ItemClick);
+            // 
             // ribbonPage1
             // 
             this.ribbonPage1.Groups.AddRange(new DevExpress.XtraBars.Ribbon.RibbonPageGroup[] {
@@ -277,14 +286,6 @@
             "DevExpress.XtraBars.FluentDesignSystem.FluentDesignFormControl",
             "DevExpress.XtraBars.ToolbarForm.ToolbarFormControl"});
             // 
-            // btnXlCalculate
-            // 
-            this.btnXlCalculate.Caption = "星历推算";
-            this.btnXlCalculate.Id = 24;
-            this.btnXlCalculate.ImageOptions.SvgImage = ((DevExpress.Utils.Svg.SvgImage)(resources.GetObject("btnXlCalculate.ImageOptions.SvgImage")));
-            this.btnXlCalculate.Name = "btnXlCalculate";
-            this.btnXlCalculate.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.btn_ItemClick);
-            // 
             // MainForm
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);

+ 3 - 3
XdCxRhDW.App/MainForm.cs

@@ -42,9 +42,9 @@ namespace XdCxRhDW
             ctrlTypes.Add("天线管理", typeof(CtrlTx));
             ctrlTypes.Add("目标管理", typeof(CtrlTarget));
             ctrlTypes.Add("系统设置", typeof(CtrlSysSettings));
-            ctrlTypes.Add("参估工具", typeof(CorToolForm));
-            ctrlTypes.Add("检测工具", typeof(DetectToolForm));
-            ctrlTypes.Add("星历推算", typeof(XlCalculateForm));
+            //ctrlTypes.Add("参估工具", typeof(CorToolForm));
+            ctrlTypes.Add("检测参估工具", typeof(DetectToolForm));
+            ctrlTypes.Add("星历推算", typeof(CtrlXlCalculate));
             btn_ItemClick(null, null);
             XlScan();
         }

+ 0 - 12
XdCxRhDW.App/Properties/licenses.licx

@@ -1,12 +0,0 @@
-DevExpress.XtraBars.BarManager, DevExpress.XtraBars.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
-DevExpress.XtraEditors.TextEdit, DevExpress.XtraEditors.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
-DevExpress.XtraBars.Ribbon.RibbonControl, DevExpress.XtraBars.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
-DevExpress.XtraBars.Docking.DockManager, DevExpress.XtraBars.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
-DevExpress.XtraBars.Docking2010.DocumentManager, DevExpress.XtraBars.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
-DevExpress.XtraEditors.DateEdit, DevExpress.XtraEditors.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
-DevExpress.XtraEditors.ButtonEdit, DevExpress.XtraEditors.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
-DevExpress.XtraEditors.ComboBoxEdit, DevExpress.XtraEditors.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
-DevExpress.XtraLayout.LayoutControl, DevExpress.XtraLayout.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
-DevExpress.XtraGrid.GridControl, DevExpress.XtraGrid.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
-DevExpress.XtraEditors.CheckEdit, DevExpress.XtraEditors.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
-DevExpress.XtraEditors.SearchLookUpEdit, DevExpress.XtraGrid.v23.2, Version=23.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a

+ 42 - 2
XdCxRhDW.App/WebAPI/Controllers/BaseController.cs

@@ -1,4 +1,5 @@
-using System;
+using Newtonsoft.Json;
+using System;
 using System.Collections.Generic;
 using System.Configuration;
 using System.Linq;
@@ -41,6 +42,45 @@ namespace XdCxRhDW.App.WebAPI
                 throw ex;
             }
         }
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <typeparam name="T"></typeparam>
+        /// <param name="url"></param>
+        /// <param name="data"></param>
+        /// <returns></returns>
+        public static T PostRequest<T>(string url, HttpContent data)
+        {
+            try
+            {
+                var handler = new HttpClientHandler() { UseCookies = false };
+                HttpClient client = new HttpClient(handler);
+                client.Timeout = TimeSpan.FromSeconds(10);
+                var message = new HttpRequestMessage(HttpMethod.Post, url);
+                message.Content = data;
+                var response = client.SendAsync(message).Result;
+                response.EnsureSuccessStatusCode();
+                var result = response.Content.ReadAsStringAsync().Result;
+                var AjaxResult = JsonConvert.DeserializeObject<AjaxResult>(result);
+                if (AjaxResult.code == 200)
+                {
+                    if (AjaxResult.data.GetType().ToString().Contains("System.String"))
+                    {
+                        return (T)AjaxResult.data;
+                    }
+                    var pres = JsonConvert.DeserializeObject<T>(AjaxResult.data.ToString());
+                    return pres;
+                }
+                else
+                {
+                    throw new Exception(AjaxResult.msg);
+                }
+            }
+            catch (Exception ex)
+            {
+                throw ex;
+            }
+        }
 
         /// <summary>
         /// Http返回结果
@@ -102,7 +142,7 @@ namespace XdCxRhDW.App.WebAPI
         /// <param name="msg">返回的消息</param>
         /// <param name="data">返回的数据</param>
         /// <returns></returns>
-        protected AjaxResult Success(object data,string msg= "请求成功!")
+        protected AjaxResult Success(object data, string msg = "请求成功!")
         {
             AjaxResult res = new AjaxResult
             {

+ 252 - 0
XdCxRhDW.App/WebAPI/Controllers/DetectCgController.cs

@@ -0,0 +1,252 @@
+using PosResAnalysis;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Net.Http;
+using System.Net;
+using System.Text;
+using System.Threading.Tasks;
+using System.Web.Http;
+using XdCxRhDw.Dto;
+using XdCxRhDW.App.CorTools;
+using System.Web;
+using Newtonsoft.Json.Linq;
+using XdCxRhDW.App.CpuCgTools;
+namespace XdCxRhDW.App.WebAPI
+{
+    /// <summary>
+    /// 检测参估功能相关接口
+    /// </summary>
+    public class DetectCgController : BaseController
+    {
+
+        private string UploadFolder = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "UploadFolder");
+        private (bool, string) ValidateCalcParam(CalcDto dto)
+        {
+            if (dto == null)
+            {
+                return (false, "参估计算参数格式错误!");
+            }
+            if (string.IsNullOrEmpty(dto.file1))
+            {
+                return (false, "参估计算参数数据文件[file1]不能为空!");
+            }
+            if (string.IsNullOrEmpty(dto.file2))
+            {
+                return (false, "参估计算参数数据文件[file2]不能为空!");
+            }
+            if (!File.Exists(dto.file1))
+            {
+                return (false, $"参估计算参数数据文件[{dto.file1}]不存在!");
+            }
+            if (!File.Exists(dto.file2))
+            {
+                return (false, $"参估计算参数数据文件[{dto.file2}]不存在!");
+            }
+            if (dto.dtRange <= 0)
+            {
+                return (false, "参估计算参数时差范围[dtRange]不能小于等于0!");
+            }
+            if (dto.smpStart < 0)
+            {
+                return (false, "参估计算参数开始样点[smpStart]不能小于0!");
+            }
+            if (dto.smpCount < 0)
+            {
+                return (false, "参估计算参数样点数[smpCount]不能小于0!");
+            }
+            return (true, string.Empty);
+        }
+        /// <summary>
+        /// 参估计算
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        public async Task<AjaxResult<EstimationResDto>> EstimationCalc(CalcDto dto)
+        {
+            var vpres = ValidateCalcParam(dto);
+            if (!vpres.Item1)
+            {
+                Serilog.Log.Warning(vpres.Item2);
+                return Error<EstimationResDto>(vpres.Item2);
+            }
+            XcorrStruct xItem = new XcorrStruct();
+            xItem.file1 = dto.file1;
+            xItem.file2 = dto.file2;
+            xItem.samplingRate = dto.samplingRate;
+            xItem.dtCenter = dto.dtCenter;
+            xItem.dtRange = dto.dtRange;
+            xItem.dfRange = dto.dfRange;
+            //样点数为0时计算所有样本
+            if (dto.smpCount == 0)
+            {
+
+                FileInfo file = new FileInfo(dto.file1);
+                long totalsamp = file.Length / 4;
+                xItem.smpCount = (int)totalsamp - dto.smpStart;
+            }
+            else
+            {
+                xItem.smpCount = dto.smpCount;
+            }
+            xItem.smpStart = dto.smpStart;
+            xItem.snrThreshold = dto.snrThreshold;
+
+            var result = await XcorrUtils.Calc(xItem);
+            //开始计算
+            if (result.flag == -2)
+            {
+                Serilog.Log.Warning("参估计算内部错误!");
+                return Error<EstimationResDto>("参估计算内部错误!");
+            }
+            else if (result.flag == -1)
+            {
+                Serilog.Log.Warning("参估计算所需数据超出文件范围!");
+                return Error<EstimationResDto>("参估计算所需数据超出文件范围!");
+            }
+            EstimationResDto resDto = new EstimationResDto();
+            resDto.Tm = result.tm;
+            resDto.Smpstart = result.smpstart;
+            resDto.Smplen = result.smplen;
+            resDto.File1 = result.file1;
+            resDto.File2 = result.file2;
+            if (result.flag == 1)
+            {
+                resDto.Dt = result.dt.Value;
+                resDto.Df = result.df.Value;
+                resDto.Snr = result.snr.Value;
+            }
+            try
+            {
+                //删除计算得文件
+                File.Delete(dto.file1);
+                File.Delete(dto.file2);
+            }
+            catch 
+            {
+            }
+            return Success(resDto);
+
+        }
+
+
+        private (bool, string) ValidateDetectParam(DetectDto dto)
+        {
+            if (dto == null)
+            {
+                return (false, "检测计算参数格式错误!");
+            }
+            if (string.IsNullOrEmpty(dto.file1))
+            {
+                return (false, "检测计算参数数据文件[file1]不能为空!");
+            }
+            if (!File.Exists(dto.file1))
+            {
+                return (false, $"检测计算参数数据文件[{dto.file1}]不存在!");
+            }
+            bool containsValue = Enum.IsDefined(typeof(DmcType), dto.dmcType); 
+            if (!containsValue)
+            {
+                return (false, $"检测计算参数[dmcType]检测类型值{dto.dmcType}不存在!");
+            }
+          
+            return (true, string.Empty);
+        }
+
+        /// <summary>
+        /// 检测计算
+        /// </summary>
+        /// <param name="dto"></param>
+        /// <returns></returns>
+        [HttpPost]
+        public async Task<AjaxResult<IEnumerable<DetectResDto>>> DetectCalc(DetectDto dto)
+        {
+            var vpres = ValidateDetectParam(dto);
+            if (!vpres.Item1)
+            {
+                Serilog.Log.Warning(vpres.Item2);
+                return Error<IEnumerable<DetectResDto>>(vpres.Item2);
+            }
+            List<DetectResDto> list = new List<DetectResDto>();
+            try
+            {
+                var dmcResult = await XcorrUtils.DmcCheckAsync(dto.file1, dto.dmcType);
+                foreach (var dmcItem in dmcResult)
+                {
+                    DetectResDto detectRes = new DetectResDto(dmcItem.Start, dmcItem.Length, dmcItem.UserName);
+                    detectRes.File1 = dto.file1;
+                    list.Add(detectRes);
+
+                }
+            }
+            catch (Exception ex)
+            {
+                return Error<IEnumerable<DetectResDto>>($"执行检测计算异常,{ex.Message}");
+            }
+            finally
+            {
+                try
+                {
+                    //删除检测的文件
+                    File.Delete(dto.file1);
+                }
+                catch
+                {
+                }
+            }
+           
+            return Success<IEnumerable<DetectResDto>>(list);
+
+        }
+
+
+        /// <summary>
+        /// 上传文件
+        /// </summary>
+        /// <returns></returns>
+        [HttpPost]
+        public async Task<AjaxResult<string>> UploadFile()
+        {
+            if (!Request.Content.IsMimeMultipartContent("form-data"))
+            {
+                return Error<string>("请求数据不是multipart/form-data类型");
+            }
+            var provider = new MultipartMemoryStreamProvider();
+            await Request.Content.ReadAsMultipartAsync(provider);
+
+            // 创建文件夹(如果尚未存在)
+            if (!Directory.Exists(UploadFolder))
+            {
+                Directory.CreateDirectory(UploadFolder);
+            }
+            var content = provider.Contents.First();
+            var fileName = GetFileName(content.Headers);
+            var fileData = await content.ReadAsByteArrayAsync();
+
+            // 将文件保存到本地文件夹中
+            var filePath = Path.Combine(UploadFolder, fileName);
+            using (var fileStream = new FileStream(filePath, FileMode.Create))
+            {
+                await fileStream.WriteAsync(fileData, 0, fileData.Length);
+            }
+
+            return Success<string>(filePath);
+        }
+
+        private string GetFileName(System.Net.Http.Headers.HttpContentHeaders headers)
+        {
+            var disposition = headers.ContentDisposition;
+            var fileName = disposition.FileName.Trim('"');
+
+            // 如果 fileName 为空,则可以根据需要生成唯一的文件名
+            if (string.IsNullOrEmpty(fileName))
+            {
+                fileName = Guid.NewGuid().ToString();
+            }
+
+            return fileName;
+        }
+    }
+}

+ 131 - 1
XdCxRhDW.App/WebAPI/Startup.cs

@@ -1,13 +1,20 @@
 using System;
 using System.Collections.Concurrent;
 using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
 using System.IO;
+using System.Linq;
 using System.Net;
 using System.Net.Http;
+using System.Runtime.Remoting.Contexts;
 using System.Text;
 using System.Web.Http;
+using System.Web.Http.Description;
 using System.Web.Http.Filters;
+using System.Web.Http.Metadata;
 using System.Web.Http.Routing;
+using System.Web.Http.Validation;
+using System.Web.Http.Validation.Providers;
 using System.Xml;
 using Microsoft.Owin;
 using Microsoft.Owin.Cors;
@@ -28,6 +35,13 @@ namespace XdCxRhDW.App.WebAPI
         {
             HttpConfiguration config = new HttpConfiguration();
 
+            IEnumerable<ModelValidatorProvider> modelValidatorProviders = config.Services.GetModelValidatorProviders();
+
+            DataAnnotationsModelValidatorProvider provider = (DataAnnotationsModelValidatorProvider)
+                    modelValidatorProviders.Single(x => x is DataAnnotationsModelValidatorProvider);
+
+            provider.RegisterDefaultValidatableObjectAdapter(typeof(CustomModelValidator));
+
             JsonSerializerSettings setting = new JsonSerializerSettings()
             {
                 //日期类型默认格式化处理
@@ -58,7 +72,6 @@ namespace XdCxRhDW.App.WebAPI
 
             //app.Use<LoggingMiddleware>();
             app.UseWebApi(config);
-
         }
         private static void ConfigureSwagger(HttpConfiguration config)
         {
@@ -75,6 +88,7 @@ namespace XdCxRhDW.App.WebAPI
                  c.UseFullTypeNameInSchemaIds();
                  //加入控制器描述
                  c.CustomProvider((defaultProvider) => new SwaggerControllerDescProvider(defaultProvider, webApiXmlPath1));
+                 c.OperationFilter<FileUploadOperation>();
              })
              .EnableSwaggerUi(c =>
              {
@@ -82,7 +96,84 @@ namespace XdCxRhDW.App.WebAPI
                  c.DocumentTitle("");
              });
         }
+        /// <summary>
+        /// Swagger文件上传特性标注
+        /// </summary>
+        [AttributeUsage(AttributeTargets.Method)]
+        public sealed class SwaggerFormAttribute : Attribute
+        {
+            public SwaggerFormAttribute()
+            {
+                this.Name = "文件";
+                this.Description = "选择文件";
+            }
+            /// <summary>
+            /// Swagger特性标注
+            /// </summary>
+            /// <param name="name"></param>
+            /// <param name="description"></param>
+            public SwaggerFormAttribute(string name, string description)
+            {
+                Name = name;
+                Description = description;
+            }
+            /// <summary>
+            /// 名称
+            /// </summary>
+            public string Name { get; private set; }
+            /// <summary>
+            /// 描述
+            /// </summary>
+            public string Description { get; private set; }
+        }
+       
+        public class FileUploadOperation : IOperationFilter
+        {
+            public void Apply(Operation operation, SchemaRegistry schemaRegistry, ApiDescription apiDescription)
+            {
+                if (operation.parameters == null)
+                {
+                    operation.parameters = new List<Parameter>();
+                }
+                var requestAttributes = apiDescription.GetControllerAndActionAttributes<SwaggerFormAttribute>();
+                foreach (var attr in requestAttributes)
+                {
+                    operation.parameters.Add(new Parameter
+                    {
+                        description = attr.Description,
+                        name = attr.Name,
+                        @in = "formData",
+                        required = true,
+                        type = "file",
+                    });
+                    operation.consumes.Add("multipart/form-data");
+                }
+                //if (operation.operationId.ToLower() == "apivaluesuploadpost")
+                //{
+                //    operation.parameters.Clear();
+                //    operation.parameters.Add(new Parameter
+                //    {
+                //        name = "uploadedFile",
+                //        @in = "formData",
+                //        description = "Upload File",
+                //        required = true,
+                //        type = "file"
+                //    });
+                //    operation.consumes.Add("multipart/form-data");
+                //}
 
+                //判断上传文件的类型,只有上传的类型是IFormCollection的才进行重写。
+                //var paras = apiDescription.ActionDescriptor.GetParameters();
+                //if (paras.Any(w => w.ParameterType == typeof(IFormCollection)))
+                //{
+                //    Dictionary<string, OpenApiSchema> schema = new Dictionary<string, OpenApiSchema>();
+                //    schema["fileName"] = new OpenApiSchema { Description = "Select file", Type = "string", Format = "binary" };
+                //    Dictionary<string, OpenApiMediaType> content = new Dictionary<string, OpenApiMediaType>();
+                //    content["multipart/form-data"] = new OpenApiMediaType { Schema = new OpenApiSchema { Type = "object", Properties = schema } };
+                //    operation.RequestBody = new OpenApiRequestBody() { Content = content };
+                //}
+            }
+        }
         public class HandlerErrorAttribute : ExceptionFilterAttribute
         {
             /// <summary>
@@ -183,4 +274,43 @@ namespace XdCxRhDW.App.WebAPI
             }
         }
     }
+
+    public class CustomModelValidator : ModelValidator
+    {
+        public CustomModelValidator(IEnumerable<ModelValidatorProvider> modelValidatorProviders) : base(modelValidatorProviders)
+        {
+
+        }
+
+
+        public override IEnumerable<ModelValidationResult> Validate(ModelMetadata metadata, object container)
+        {
+            if (metadata.IsComplexType && metadata.Model == null)
+            {
+                return new List<ModelValidationResult> { new ModelValidationResult { MemberName = metadata.GetDisplayName(), Message = "请求参数对象不能为空。" } };
+            }
+
+            if (typeof(IValidatableObject).IsAssignableFrom(metadata.ModelType))
+            {
+                var validationResult = (metadata.Model as IValidatableObject).Validate(new ValidationContext(metadata.Model));
+                if (validationResult != null)
+                {
+                    var modelValidationResults = new List<ModelValidationResult>();
+                    foreach (var result in validationResult)
+                    {
+                        modelValidationResults.Add(new ModelValidationResult
+                        {
+                            MemberName = string.Join(",", result.MemberNames),
+                            Message = result.ErrorMessage
+                        });
+                    }
+
+                    return modelValidationResults;
+                }
+                return null;
+            }
+
+            return GetModelValidator(ValidatorProviders).Validate(metadata, container);
+        }
+    }
 }

+ 4 - 10
XdCxRhDW.App/XdCxRhDW.App.csproj

@@ -92,9 +92,6 @@
     <Reference Include="Microsoft.Owin.Hosting, Version=4.2.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
       <HintPath>..\packages\Microsoft.Owin.Hosting.4.2.2\lib\net45\Microsoft.Owin.Hosting.dll</HintPath>
     </Reference>
-    <Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
-      <HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
-    </Reference>
     <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>
       <Private>True</Private>
@@ -130,6 +127,9 @@
     <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.Annotations, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+      <HintPath>..\packages\System.ComponentModel.Annotations.5.0.0\lib\net461\System.ComponentModel.Annotations.dll</HintPath>
+    </Reference>
     <Reference Include="System.ComponentModel.DataAnnotations" />
     <Reference Include="System.Configuration" />
     <Reference Include="System.Core" />
@@ -187,9 +187,6 @@
     <Reference Include="System.Web.Http.SelfHost, Version=5.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
       <HintPath>..\packages\Microsoft.AspNet.WebApi.SelfHost.5.3.0\lib\net45\System.Web.Http.SelfHost.dll</HintPath>
     </Reference>
-    <Reference Include="System.Web.Http.WebHost, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
-      <HintPath>..\packages\Microsoft.AspNet.WebApi.WebHost.4.0.30506.0\lib\net40\System.Web.Http.WebHost.dll</HintPath>
-    </Reference>
     <Reference Include="System.Xml.Linq" />
     <Reference Include="System.Data.DataSetExtensions" />
     <Reference Include="Microsoft.CSharp" />
@@ -198,9 +195,6 @@
     <Reference Include="System.Drawing" />
     <Reference Include="System.Windows.Forms" />
     <Reference Include="System.Xml" />
-    <Reference Include="WebActivatorEx, Version=2.0.0.0, Culture=neutral, PublicKeyToken=7b26dc2a43f6a0d4, processorArchitecture=MSIL">
-      <HintPath>..\packages\WebActivatorEx.2.0\lib\net40\WebActivatorEx.dll</HintPath>
-    </Reference>
   </ItemGroup>
   <ItemGroup>
     <Compile Include="Api\EphHelper.cs" />
@@ -362,6 +356,7 @@
       <DependentUpon>CtrlXl.cs</DependentUpon>
     </Compile>
     <Compile Include="WebAPI\Controllers\BaseController.cs" />
+    <Compile Include="WebAPI\Controllers\DetectCgController.cs" />
     <Compile Include="WebAPI\Controllers\XlController.cs" />
     <Compile Include="WebAPI\Controllers\PosController.cs" />
     <Compile Include="WebAPI\DTO\Test.cs" />
@@ -400,7 +395,6 @@
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
     <None Include="packages.config" />
-    <EmbeddedResource Include="Properties\licenses.licx" />
     <EmbeddedResource Include="Properties\Resources.resx">
       <Generator>ResXFileCodeGenerator</Generator>
       <LastGenOutput>Resources.Designer.cs</LastGenOutput>

+ 1 - 0
XdCxRhDW.App/packages.config

@@ -27,6 +27,7 @@
   <package id="Swashbuckle" version="5.6.0" targetFramework="net472" />
   <package id="Swashbuckle.Core" version="5.6.0" targetFramework="net472" />
   <package id="System.Buffers" version="4.5.1" targetFramework="net472" />
+  <package id="System.ComponentModel.Annotations" version="5.0.0" targetFramework="net472" />
   <package id="System.Data.SQLite" version="1.0.118.0" targetFramework="net472" />
   <package id="System.Data.SQLite.Core" version="1.0.118.0" targetFramework="net472" />
   <package id="System.Data.SQLite.EF6" version="1.0.118.0" targetFramework="net472" />

+ 56 - 0
XdCxRhDw.Dto/CalcDto.cs

@@ -0,0 +1,56 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Markup;
+
+namespace XdCxRhDw.Dto
+{
+    /// <summary>
+    /// 参数估计计算参数DTo
+    /// </summary>
+    public class CalcDto
+    {
+        /// <summary>
+        /// 数据文件1
+        /// </summary>
+        public String file1 { get; set; }
+        /// <summary>
+        /// 数据文件2
+        /// </summary>
+        public String file2 { get; set; }
+
+        [Range(1, 5, ErrorMessage = "111")]
+        /// <summary>
+        /// 开始样点
+        /// </summary>
+        public int smpStart { get; set; }  
+        /// <summary>
+        /// 样点数
+        /// </summary>
+        public int smpCount { get; set; }      
+        /// <summary>
+        /// 采样率(Hz)
+        /// </summary>
+        public double samplingRate { get; set; } 
+        /// <summary>
+        /// 时差中心(us)
+        /// </summary>
+        public double dtCenter { get; set; } 
+        /// <summary>
+        /// 时差范围(us)
+        /// </summary>
+        public double dtRange { get; set; }   
+        /// <summary>
+        /// 频差范围(Hz)
+        /// </summary>
+        public double dfRange { get; set; } 
+        /// <summary>
+        /// 信噪比dB
+        /// </summary>
+        public double snrThreshold { get; set; }
+
+    }
+}

+ 32 - 0
XdCxRhDw.Dto/DetectDto.cs

@@ -0,0 +1,32 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace XdCxRhDw.Dto
+{
+  /// <summary>
+  /// 检测计算DTO
+  /// </summary>
+    public class DetectDto
+    {
+        /// <summary>
+        /// 数据文件1
+        /// </summary>
+        public String file1 { get; set; }
+        
+        public DmcType dmcType { get; set; }
+
+    }
+    /// <summary>
+    /// 检测类型
+    /// </summary>
+    public enum DmcType
+    {
+        DAMA=1,
+        IBS=2,
+        Ky5758=3
+    }
+}

+ 53 - 0
XdCxRhDw.Dto/DetectResDto.cs

@@ -0,0 +1,53 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace XdCxRhDw.Dto
+{
+    /// <summary>
+    /// 检测结果Dto
+    /// </summary>
+    public class DetectResDto
+    {
+        /// <summary>
+        /// 检测结果
+        /// </summary>
+        public DetectResDto()
+        {
+        }
+        /// <summary>
+        /// 检测结果
+        /// </summary>
+        /// <param name="start"></param>
+        /// <param name="length"></param>
+        /// <param name="userName"></param>
+        public DetectResDto(int start, int length, string userName)
+        {
+            Start = start;
+            Length = length;
+            UserName = userName;
+        }
+
+        /// <summary>
+        /// 检测开始样点
+        /// </summary>
+        public int Start { get; set; }
+        /// <summary>
+        /// 检测样点长度
+        /// </summary>
+        public int Length { get; set; }
+        /// <summary>
+        /// 检测用户名称
+        /// </summary>
+
+        public string UserName { get; set; }
+
+        /// <summary>
+        /// 数据文件
+        /// </summary>
+        public String File1 { get; set; }
+
+    }
+}

+ 56 - 0
XdCxRhDw.Dto/EstimationResDto.cs

@@ -0,0 +1,56 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace XdCxRhDw.Dto
+{
+    /// <summary>
+    /// 参估结果DTO
+    /// </summary>
+    public class EstimationResDto
+    {
+        
+        /// <summary>
+        /// 相关时差,单位:us
+        /// </summary>
+        public double Dt { get; set; }
+
+        /// <summary>
+        /// 相关频差:单位:Hz
+        /// </summary>
+        public double Df { get; set; }
+
+        /// <summary>
+        /// 相关信噪比,单位:db
+        /// </summary>
+        public double Snr { get; set; }
+
+        /// <summary>
+        /// 耗时(s)
+        /// </summary>
+        public double Tm { get; set; }
+
+        /// <summary>
+        /// 开始样点
+        /// </summary>
+        public Int64 Smpstart { get; set; }
+
+        /// <summary>
+        /// 样点长度
+        /// </summary>
+        public Int64 Smplen { get; set; }
+
+        /// <summary>
+        /// 数据文件1
+        /// </summary>
+        public String File1 { get; set; }
+
+        /// <summary>
+        /// 数据文件2
+        /// </summary>
+        public String File2 { get; set; }
+
+    }
+}

+ 4 - 0
XdCxRhDw.Dto/XdCxRhDw.Dto.csproj

@@ -46,6 +46,10 @@
     <Reference Include="System.Xml" />
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="CalcDto.cs" />
+    <Compile Include="DetectDto.cs" />
+    <Compile Include="DetectResDto.cs" />
+    <Compile Include="EstimationResDto.cs" />
     <Compile Include="PosResQueryDto.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="SendDto.cs" />