zoulei hace 1 año
padre
commit
45d31c9f4e

+ 106 - 40
XdCxRhDW.App/CorTools/CgImageForm.Designer.cs

@@ -28,76 +28,145 @@
         /// </summary>
         private void InitializeComponent()
         {
+            DevExpress.XtraCharts.ImageAnnotation imageAnnotation1 = new DevExpress.XtraCharts.ImageAnnotation();
+            DevExpress.XtraCharts.ChartAnchorPoint chartAnchorPoint1 = new DevExpress.XtraCharts.ChartAnchorPoint();
+            DevExpress.XtraCharts.FreePosition freePosition1 = new DevExpress.XtraCharts.FreePosition();
+            DevExpress.XtraCharts.TextAnnotation textAnnotation1 = new DevExpress.XtraCharts.TextAnnotation();
+            DevExpress.XtraCharts.ChartAnchorPoint chartAnchorPoint2 = new DevExpress.XtraCharts.ChartAnchorPoint();
+            DevExpress.XtraCharts.FreePosition freePosition2 = new DevExpress.XtraCharts.FreePosition();
+            DevExpress.XtraCharts.TextAnnotation textAnnotation2 = new DevExpress.XtraCharts.TextAnnotation();
+            DevExpress.XtraCharts.ChartAnchorPoint chartAnchorPoint3 = new DevExpress.XtraCharts.ChartAnchorPoint();
+            DevExpress.XtraCharts.FreePosition freePosition3 = new DevExpress.XtraCharts.FreePosition();
             DevExpress.XtraCharts.XYDiagram xyDiagram1 = new DevExpress.XtraCharts.XYDiagram();
             DevExpress.XtraCharts.Series series1 = new DevExpress.XtraCharts.Series();
             DevExpress.XtraCharts.PointSeriesView pointSeriesView1 = new DevExpress.XtraCharts.PointSeriesView();
-            this.repositoryItemPictureEdit1 = new DevExpress.XtraEditors.Repository.RepositoryItemPictureEdit();
-            this.directXFormContainerControl1 = new DevExpress.XtraEditors.DirectXFormContainerControl();
+            DevExpress.XtraCharts.ChartTitle chartTitle1 = new DevExpress.XtraCharts.ChartTitle();
             this.chartControl1 = new DevExpress.XtraCharts.ChartControl();
-            this.pic = new DevExpress.XtraBars.BarEditItem();
-            ((System.ComponentModel.ISupportInitialize)(this.repositoryItemPictureEdit1)).BeginInit();
-            this.directXFormContainerControl1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.chartControl1)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(imageAnnotation1)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(textAnnotation1)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(textAnnotation2)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(xyDiagram1)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(series1)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(pointSeriesView1)).BeginInit();
             this.SuspendLayout();
             // 
-            // repositoryItemPictureEdit1
-            // 
-            this.repositoryItemPictureEdit1.Name = "repositoryItemPictureEdit1";
-            // 
-            // directXFormContainerControl1
-            // 
-            this.directXFormContainerControl1.Controls.Add(this.chartControl1);
-            this.directXFormContainerControl1.Location = new System.Drawing.Point(1, 31);
-            this.directXFormContainerControl1.Name = "directXFormContainerControl1";
-            this.directXFormContainerControl1.Size = new System.Drawing.Size(807, 555);
-            this.directXFormContainerControl1.TabIndex = 0;
-            // 
             // chartControl1
             // 
+            imageAnnotation1.AnchorPoint = chartAnchorPoint1;
+            imageAnnotation1.AnnotationID = 1;
+            imageAnnotation1.AutoHeight = false;
+            imageAnnotation1.AutoWidth = false;
+            imageAnnotation1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
+            imageAnnotation1.Border.Color = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
+            imageAnnotation1.ConnectorStyle = DevExpress.XtraCharts.AnnotationConnectorStyle.None;
+            imageAnnotation1.FillStyle.Tag = "";
+            imageAnnotation1.Height = 32;
+            imageAnnotation1.Name = "Annotation 1";
+            imageAnnotation1.Padding.Bottom = 0;
+            imageAnnotation1.Padding.Left = 0;
+            imageAnnotation1.Padding.Right = 0;
+            imageAnnotation1.Padding.Top = 0;
+            imageAnnotation1.ShapeKind = DevExpress.XtraCharts.ShapeKind.Rectangle;
+            freePosition1.InnerIndents.Left = 231;
+            freePosition1.InnerIndents.Top = 7;
+            imageAnnotation1.ShapePosition = freePosition1;
+            imageAnnotation1.SizeMode = DevExpress.XtraCharts.ChartImageSizeMode.Stretch;
+            imageAnnotation1.Width = 400;
+            textAnnotation1.AnchorPoint = chartAnchorPoint2;
+            textAnnotation1.AnnotationID = 2;
+            textAnnotation1.AutoHeight = true;
+            textAnnotation1.AutoWidth = true;
+            textAnnotation1.Border.Visibility = DevExpress.Utils.DefaultBoolean.False;
+            textAnnotation1.ConnectorStyle = DevExpress.XtraCharts.AnnotationConnectorStyle.None;
+            textAnnotation1.Name = "Annotation 2";
+            textAnnotation1.Padding.Right = 0;
+            textAnnotation1.ShapeKind = DevExpress.XtraCharts.ShapeKind.Rectangle;
+            freePosition2.InnerIndents.Left = 200;
+            freePosition2.InnerIndents.Top = 12;
+            textAnnotation1.ShapePosition = freePosition2;
+            textAnnotation1.Text = "色系";
+            textAnnotation2.AnchorPoint = chartAnchorPoint3;
+            textAnnotation2.AnnotationID = 3;
+            textAnnotation2.AutoHeight = true;
+            textAnnotation2.AutoWidth = true;
+            textAnnotation2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
+            textAnnotation2.Border.Visibility = DevExpress.Utils.DefaultBoolean.False;
+            textAnnotation2.ConnectorStyle = DevExpress.XtraCharts.AnnotationConnectorStyle.None;
+            textAnnotation2.Name = "Annotation 3";
+            textAnnotation2.Padding.Left = 0;
+            textAnnotation2.ShapeKind = DevExpress.XtraCharts.ShapeKind.Rectangle;
+            freePosition3.InnerIndents.Left = 632;
+            freePosition3.InnerIndents.Top = 13;
+            textAnnotation2.ShapePosition = freePosition3;
+            textAnnotation2.Text = "共0个点";
+            this.chartControl1.AnnotationRepository.AddRange(new DevExpress.XtraCharts.Annotation[] {
+            imageAnnotation1,
+            textAnnotation1,
+            textAnnotation2});
+            this.chartControl1.BorderOptions.Visibility = DevExpress.Utils.DefaultBoolean.False;
+            this.chartControl1.CrosshairEnabled = DevExpress.Utils.DefaultBoolean.Default;
+            xyDiagram1.AxisX.Label.TextColor = System.Drawing.Color.FromArgb(((int)(((byte)(242)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
+            xyDiagram1.AxisX.Tickmarks.MinorVisible = false;
+            xyDiagram1.AxisX.Tickmarks.Visible = false;
             xyDiagram1.AxisX.VisibleInPanesSerializable = "-1";
+            xyDiagram1.AxisY.GridLines.Visible = false;
+            xyDiagram1.AxisY.Label.TextColor = System.Drawing.Color.FromArgb(((int)(((byte)(242)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
+            xyDiagram1.AxisY.Tickmarks.MinorVisible = false;
+            xyDiagram1.AxisY.Tickmarks.Visible = false;
+            xyDiagram1.AxisY.Visibility = DevExpress.Utils.DefaultBoolean.True;
             xyDiagram1.AxisY.VisibleInPanesSerializable = "-1";
+            xyDiagram1.DefaultPane.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
+            xyDiagram1.DefaultPane.BorderVisible = false;
+            xyDiagram1.DefaultPane.EnableAxisXScrolling = DevExpress.Utils.DefaultBoolean.False;
+            xyDiagram1.DefaultPane.EnableAxisXZooming = DevExpress.Utils.DefaultBoolean.False;
+            xyDiagram1.DefaultPane.EnableAxisYScrolling = DevExpress.Utils.DefaultBoolean.True;
+            xyDiagram1.DefaultPane.EnableAxisYZooming = DevExpress.Utils.DefaultBoolean.True;
+            xyDiagram1.EnableAxisXZooming = true;
+            xyDiagram1.EnableAxisYZooming = true;
             this.chartControl1.Diagram = xyDiagram1;
             this.chartControl1.Dock = System.Windows.Forms.DockStyle.Fill;
             this.chartControl1.Legend.LegendID = -1;
+            this.chartControl1.Legend.MarkerMode = DevExpress.XtraCharts.LegendMarkerMode.None;
+            this.chartControl1.Legend.Visibility = DevExpress.Utils.DefaultBoolean.False;
             this.chartControl1.Location = new System.Drawing.Point(0, 0);
             this.chartControl1.Name = "chartControl1";
+            this.chartControl1.PaletteName = "Blue Green";
+            series1.CrosshairEnabled = DevExpress.Utils.DefaultBoolean.False;
             series1.Name = "Series 1";
             series1.SeriesID = 0;
+            series1.ToolTipEnabled = DevExpress.Utils.DefaultBoolean.True;
+            pointSeriesView1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
+            pointSeriesView1.PointMarkerOptions.Size = 6;
             series1.View = pointSeriesView1;
             this.chartControl1.SeriesSerializable = new DevExpress.XtraCharts.Series[] {
         series1};
-            this.chartControl1.Size = new System.Drawing.Size(807, 555);
-            this.chartControl1.TabIndex = 4;
-            // 
-            // pic
-            // 
-            this.pic.Alignment = DevExpress.XtraBars.BarItemLinkAlignment.Right;
-            this.pic.Caption = "色系";
-            this.pic.Edit = this.repositoryItemPictureEdit1;
-            this.pic.EditHeight = 32;
-            this.pic.Id = 0;
-            this.pic.Name = "pic";
-            this.pic.PaintStyle = DevExpress.XtraBars.BarItemPaintStyle.CaptionGlyph;
-            this.pic.Size = new System.Drawing.Size(300, 0);
+            this.chartControl1.Size = new System.Drawing.Size(898, 599);
+            this.chartControl1.TabIndex = 1;
+            chartTitle1.Indent = 10;
+            chartTitle1.Text = " ";
+            chartTitle1.TitleID = 1;
+            chartTitle1.Visibility = DevExpress.Utils.DefaultBoolean.True;
+            this.chartControl1.Titles.AddRange(new DevExpress.XtraCharts.ChartTitle[] {
+            chartTitle1});
             // 
-            // CgImageForm
+            // Test
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ChildControls.Add(this.directXFormContainerControl1);
-            this.ClientSize = new System.Drawing.Size(809, 587);
+            this.ClientSize = new System.Drawing.Size(898, 599);
+            this.Controls.Add(this.chartControl1);
             this.IconOptions.ShowIcon = false;
             this.MaximizeBox = false;
             this.MinimizeBox = false;
-            this.Name = "CgImageForm";
+            this.Name = "Test";
             this.ShowInTaskbar = false;
+            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
             this.Text = "互模糊结果";
-            this.Load += new System.EventHandler(this.CgImageForm_Load);
-            ((System.ComponentModel.ISupportInitialize)(this.repositoryItemPictureEdit1)).EndInit();
-            this.directXFormContainerControl1.ResumeLayout(false);
+            this.Load += new System.EventHandler(this.Test_Load);
+            ((System.ComponentModel.ISupportInitialize)(imageAnnotation1)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(textAnnotation1)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(textAnnotation2)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(xyDiagram1)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(pointSeriesView1)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(series1)).EndInit();
@@ -107,9 +176,6 @@
         }
 
         #endregion
-        private DevExpress.XtraEditors.DirectXFormContainerControl directXFormContainerControl1;
-        private DevExpress.XtraBars.BarEditItem pic;
         private DevExpress.XtraCharts.ChartControl chartControl1;
-        private DevExpress.XtraEditors.Repository.RepositoryItemPictureEdit repositoryItemPictureEdit1;
     }
 }

+ 101 - 23
XdCxRhDW.App/CorTools/CgImageForm.cs

@@ -1,4 +1,11 @@
-using System;
+using DevExpress.Charts.Native;
+using DevExpress.Map.Dashboard;
+using DevExpress.Map.Native;
+using DevExpress.XtraBars;
+using DevExpress.XtraCharts;
+using DevExpress.XtraEditors.Repository;
+using ExtensionsDev;
+using System;
 using System.Collections.Generic;
 using System.ComponentModel;
 using System.Data;
@@ -6,37 +13,33 @@ using System.Drawing;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using System.Windows;
 using System.Windows.Forms;
-using DevExpress.XtraEditors;
-using DevExpress.XtraEditors.Repository;
+using System.Windows.Media.Imaging;
+using System.Xml.Linq;
 using XdCxRhDW.Core;
 using XdCxRhDW.Core.Api;
+using static DevExpress.XtraEditors.Mask.Design.MaskSettingsForm.DesignInfo.MaskManagerInfo;
+using static System.Windows.Forms.VisualStyles.VisualStyleElement.TaskbarClock;
+using static System.Windows.Forms.VisualStyles.VisualStyleElement.ToolTip;
 
 namespace XdCxRhDW.App.CorTools
 {
-    public partial class CgImageForm : DirectXForm// DevExpress.XtraEditors.XtraForm
+    public partial class CgImageForm : DevExpress.XtraEditors.XtraForm
     {
+        List<ImageResult> list;
+        float maxY;
         public CgImageForm()
         {
             InitializeComponent();
-            this.Font = new Font("微软雅黑", 12);
-        }
-        List<ImageResult> list;
-        public CgImageForm(List<ImageResult> list)
-            :this()
-        { 
-            this.list= list;
-        }
-
-        private void CgImageForm_Load(object sender, EventArgs e)
-        {
-            directXFormContainerControl1.Location = new Point(1, 40);
-            Bitmap bmp = new Bitmap(1024, 768);
-            for (int x = 0; x < 1024; x++)
+            int w = (this.chartControl1.AnnotationRepository[0] as ImageAnnotation).Width;
+            int h = (this.chartControl1.AnnotationRepository[0] as ImageAnnotation).Height;
+            Bitmap bmp = new Bitmap(w, h);
+            for (int x = 0; x < w; x++)
             {
-                for (int y = 0; y < 768; y++)
+                for (int y = 0; y < h; y++)
                 {
-                    var rgbb = ColorRGB.GetSpecColor(x / 1023d);
+                    var rgbb = ColorRGB.GetSpecColor(x / 1d / w);
                     int r = rgbb.R;
                     int g = rgbb.G;
                     int b = rgbb.B;
@@ -44,9 +47,84 @@ namespace XdCxRhDW.App.CorTools
                     bmp.SetPixel(x, y, c);
                 }
             }
-            var edit = (RepositoryItemPictureEdit)this.pic.Edit;
-            edit.SizeMode = DevExpress.XtraEditors.Controls.PictureSizeMode.Stretch;
-            this.pic.EditValue= bmp;    
+            var bgColor = ColorRGB.GetSpecColor(0);
+            chartControl1.BackColor = bgColor;
+            (this.chartControl1.Diagram as XYDiagram).DefaultPane.BackColor = bgColor;
+            (this.chartControl1.AnnotationRepository[0] as ImageAnnotation).Image.DXImage = bmp;
+            (this.chartControl1.AnnotationRepository[1] as TextAnnotation).BackColor = bgColor;
+            (this.chartControl1.AnnotationRepository[1] as TextAnnotation).TextColor = Color.White;
+            (this.chartControl1.AnnotationRepository[2] as TextAnnotation).BackColor = bgColor;
+            (this.chartControl1.AnnotationRepository[2] as TextAnnotation).TextColor = Color.White;
+            (this.chartControl1.Diagram as XYDiagram).AxisX.Color = Color.White;
+            (this.chartControl1.Diagram as XYDiagram).AxisX.Label.TextColor = Color.White;
+            (this.chartControl1.Diagram as XYDiagram).AxisY.Color = Color.White;
+            (this.chartControl1.Diagram as XYDiagram).AxisY.Label.TextColor = Color.White;
+            this.chartControl1.Series[0].ToolTipEnabled = DevExpress.Utils.DefaultBoolean.True;
+            (this.chartControl1.Series[0].View as PointSeriesView).PointMarkerOptions.Size = 12;//点的大小
+
+            //ToolTipPointPattern可以参考以下网站说明
+            //https://docs.devexpress.com/CoreLibraries/DevExpress.XtraCharts.SeriesBase.ToolTipPointPattern?utm_source=visualstudio&utm_medium=DXHelpAssistant&utm_campaign=onlinehelp
+            this.chartControl1.Series[0].ToolTipPointPattern = "{A:f3}us\r\n{V:f3}Hz\r\n{}dB";
+        }
+        public CgImageForm(List<ImageResult> list)
+            : this()
+        {
+            this.list = list;
+            var maxX = (list[0].XMax - 1 + list[0].XFlag) * 1e6 / list[0].FsHz;
+            var minX = (list[0].XFlag) * 1e6 / list[0].FsHz;
+            maxY = list.Max(p => p.YValue) + 200;
+            (this.chartControl1.AnnotationRepository[2] as TextAnnotation).Text = $"共{list.Count}个点";
+            (this.chartControl1.Diagram as XYDiagram).AxisX.WholeRange.SetMinMaxValues(minX, maxX);
+            (this.chartControl1.Diagram as XYDiagram).AxisX.VisualRange.SetMinMaxValues(minX, maxX);
+            (this.chartControl1.Diagram as XYDiagram).AxisY.WholeRange.SetMinMaxValues(-maxY, maxY);
+            (this.chartControl1.Diagram as XYDiagram).AxisY.VisualRange.SetMinMaxValues(-maxY, maxY);
+
+        }
+        private void Test_Load(object sender, EventArgs e)
+        {
+            chartControl1.QueryCursor += ChartControl1_QueryCursor;
+            chartControl1.Zoom += ChartControl1_Zoom;
+            foreach (var item in list)
+            {
+                double xValue = (item.XValue + item.XFlag) * 1e6 / item.FsHz;//us
+                this.chartControl1.Series[0].Points.Add(new SeriesPoint()
+                {
+                    Argument = xValue.ToString(),
+                    Values = new double[1] { item.YValue },
+                    Color = item.GetColor(),
+                    Tag = item.Snr.ToString("f1"),
+                });
+            }
+        }
+
+
+        private void ChartControl1_QueryCursor(object sender, QueryCursorEventArgs e)
+        {
+            e.Cursor = Cursors.Default;
+        }
+        private void ChartControl1_Zoom(object sender, ChartZoomEventArgs e)
+        {
+            if ((double)e.NewYRange.MinValue < -maxY || (double)e.NewYRange.Max > maxY)
+            {
+                (this.chartControl1.Diagram as XYDiagram).AxisY.WholeRange.SetMinMaxValues(-maxY, maxY);
+                (this.chartControl1.Diagram as XYDiagram).AxisY.VisualRange.SetMinMaxValues(-maxY, maxY);
+            }
+            else
+            {
+                if (e.Type == ChartZoomEventType.ZoomOut)
+                {
+                    (this.chartControl1.Diagram as XYDiagram).AxisY.WholeRange.SetMinMaxValues((double)e.NewYRange.MinValue - 10, (double)e.NewYRange.MaxValue + 10);
+                    (this.chartControl1.Diagram as XYDiagram).AxisY.VisualRange.SetMinMaxValues((double)e.NewYRange.MinValue - 10, (double)e.NewYRange.MaxValue + 10);
+                }
+                else
+                {
+                    if ((double)e.NewYRange.MaxValue - (double)e.NewYRange.MinValue < 40)
+                    {
+                        //(this.chartControl1.Diagram as XYDiagram).AxisY.WholeRange.SetMinMaxValues(e.NewYRange.MinValue, e.NewYRange.MaxValue);
+                        (this.chartControl1.Diagram as XYDiagram).AxisY.VisualRange.SetMinMaxValues(e.NewYRange.MinValue, e.NewYRange.MaxValue);
+                    }
+                }
+            }
         }
     }
 }

+ 31 - 28
XdCxRhDW.App/CorTools/DetectToolForm.cs

@@ -89,7 +89,7 @@ namespace XdCxRhDW.App.CorTools
                 {
                     dto.file1 = HttpHelper.UploadFile(btnFile1.Text, baseUrl + "File/UploadFileAsync");
                     dto.fsHz = double.Parse(tefs.Text) * 1e6;
-                    var dmcResult =await HttpHelper.PostRequestAsync<IEnumerable<DetectResDto>>(baseUrl + "DetectCg/DetectCalc", dto);
+                    var dmcResult = await HttpHelper.PostRequestAsync<IEnumerable<DetectResDto>>(baseUrl + "DetectCg/DetectCalc", dto);
                     if (dmcResult.code == 200)
                     {
                         gridSource.Clear();
@@ -121,7 +121,7 @@ namespace XdCxRhDW.App.CorTools
             List<XcorrStruct> xcorrs = new List<XcorrStruct>();
             XcorrStruct xItem = new XcorrStruct();
             layoutControl1.Enabled = false;
-            await Task.Run(async () =>
+            await Task.Run(() =>
             {
                 try
                 {
@@ -157,39 +157,42 @@ namespace XdCxRhDW.App.CorTools
                 {
                     xcorrs.Add(xItem);
                 }
-
                 WriteIni();
+
+            });
+            this.Invoke(new Action(() =>
+            {
                 gridSource.Clear();
-                foreach (var xcitem in xcorrs)
+            }));
+            foreach (var xcitem in xcorrs)
+            {
+                try
                 {
-                    try
+                    var result = await HttpHelper.PostRequestAsync<CpuCgResDto>(baseUrl + "DetectCg/CpuCgCalc", xcitem);
+                    if (result.code == 200)
                     {
-                        var result = await HttpHelper.PostRequestAsync<CpuCgResDto>(baseUrl + "DetectCg/CpuCgCalc", xcitem);
-                        if (result.code==200)
+                        gridSource.Add(new CafResult()
                         {
-                            gridSource.Add(new CafResult()
-                            {
-                                file1 = btnFile1.Text,
-                                file2 = btnFile2.Text,
-                                smpstart = result.data.Smpstart,
-                                smplen = result.data.Smplen,
-                                dt = result.data.Dt,
-                                df = result.data.Df,
-                                snr = result.data.Snr,
-                                tm = result.data.TimeMs,
-                            });
-                            gridView1.FocusedRowHandle = gridSource.Count - 1;
-                        }
-                    }
-                    catch (Exception ex)
-                    {
-                        Serilog.Log.Error(ex, "CPU参估出错");
-                        continue;
+                            file1 = btnFile1.Text,
+                            file2 = btnFile2.Text,
+                            smpstart = result.data.Smpstart,
+                            smplen = result.data.Smplen,
+                            dt = result.data.Dt,
+                            df = result.data.Df,
+                            snr = result.data.Snr,
+                            tm = result.data.TimeMs,
+                        });
+                        this.BeginInvoke(new Action(() => gridView1.FocusedRowHandle = gridSource.Count - 1));
                     }
+                }
+                catch (Exception ex)
+                {
+                    Serilog.Log.Error(ex, "CPU参估出错");
+                    continue;
+                }
 
 
-                }
-            });
+            }
             layoutControl1.Enabled = true;
         }
         private async void btnDrawImage_Click(object sender, EventArgs e)
@@ -238,7 +241,7 @@ namespace XdCxRhDW.App.CorTools
             }
             if (res != null && res.Any())
             {
-                new Test(res).ShowDialog();
+                new CgImageForm(res).ShowDialog();
             }
             else
             {

+ 0 - 181
XdCxRhDW.App/CorTools/Test.Designer.cs

@@ -1,181 +0,0 @@
-namespace XdCxRhDW.App.CorTools
-{
-    partial class Test
-    {
-        /// <summary>
-        /// Required designer variable.
-        /// </summary>
-        private System.ComponentModel.IContainer components = null;
-
-        /// <summary>
-        /// Clean up any resources being used.
-        /// </summary>
-        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-        protected override void Dispose(bool disposing)
-        {
-            if (disposing && (components != null))
-            {
-                components.Dispose();
-            }
-            base.Dispose(disposing);
-        }
-
-        #region Windows Form Designer generated code
-
-        /// <summary>
-        /// Required method for Designer support - do not modify
-        /// the contents of this method with the code editor.
-        /// </summary>
-        private void InitializeComponent()
-        {
-            DevExpress.XtraCharts.ImageAnnotation imageAnnotation1 = new DevExpress.XtraCharts.ImageAnnotation();
-            DevExpress.XtraCharts.ChartAnchorPoint chartAnchorPoint1 = new DevExpress.XtraCharts.ChartAnchorPoint();
-            DevExpress.XtraCharts.FreePosition freePosition1 = new DevExpress.XtraCharts.FreePosition();
-            DevExpress.XtraCharts.TextAnnotation textAnnotation1 = new DevExpress.XtraCharts.TextAnnotation();
-            DevExpress.XtraCharts.ChartAnchorPoint chartAnchorPoint2 = new DevExpress.XtraCharts.ChartAnchorPoint();
-            DevExpress.XtraCharts.FreePosition freePosition2 = new DevExpress.XtraCharts.FreePosition();
-            DevExpress.XtraCharts.TextAnnotation textAnnotation2 = new DevExpress.XtraCharts.TextAnnotation();
-            DevExpress.XtraCharts.ChartAnchorPoint chartAnchorPoint3 = new DevExpress.XtraCharts.ChartAnchorPoint();
-            DevExpress.XtraCharts.FreePosition freePosition3 = new DevExpress.XtraCharts.FreePosition();
-            DevExpress.XtraCharts.XYDiagram xyDiagram1 = new DevExpress.XtraCharts.XYDiagram();
-            DevExpress.XtraCharts.Series series1 = new DevExpress.XtraCharts.Series();
-            DevExpress.XtraCharts.PointSeriesView pointSeriesView1 = new DevExpress.XtraCharts.PointSeriesView();
-            DevExpress.XtraCharts.ChartTitle chartTitle1 = new DevExpress.XtraCharts.ChartTitle();
-            this.chartControl1 = new DevExpress.XtraCharts.ChartControl();
-            ((System.ComponentModel.ISupportInitialize)(this.chartControl1)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(imageAnnotation1)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(textAnnotation1)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(textAnnotation2)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(xyDiagram1)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(series1)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(pointSeriesView1)).BeginInit();
-            this.SuspendLayout();
-            // 
-            // chartControl1
-            // 
-            imageAnnotation1.AnchorPoint = chartAnchorPoint1;
-            imageAnnotation1.AnnotationID = 1;
-            imageAnnotation1.AutoHeight = false;
-            imageAnnotation1.AutoWidth = false;
-            imageAnnotation1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
-            imageAnnotation1.Border.Color = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
-            imageAnnotation1.ConnectorStyle = DevExpress.XtraCharts.AnnotationConnectorStyle.None;
-            imageAnnotation1.FillStyle.Tag = "";
-            imageAnnotation1.Height = 32;
-            imageAnnotation1.Name = "Annotation 1";
-            imageAnnotation1.Padding.Bottom = 0;
-            imageAnnotation1.Padding.Left = 0;
-            imageAnnotation1.Padding.Right = 0;
-            imageAnnotation1.Padding.Top = 0;
-            imageAnnotation1.ShapeKind = DevExpress.XtraCharts.ShapeKind.Rectangle;
-            freePosition1.InnerIndents.Left = 231;
-            freePosition1.InnerIndents.Top = 7;
-            imageAnnotation1.ShapePosition = freePosition1;
-            imageAnnotation1.SizeMode = DevExpress.XtraCharts.ChartImageSizeMode.Stretch;
-            imageAnnotation1.Width = 400;
-            textAnnotation1.AnchorPoint = chartAnchorPoint2;
-            textAnnotation1.AnnotationID = 2;
-            textAnnotation1.AutoHeight = true;
-            textAnnotation1.AutoWidth = true;
-            textAnnotation1.Border.Visibility = DevExpress.Utils.DefaultBoolean.False;
-            textAnnotation1.ConnectorStyle = DevExpress.XtraCharts.AnnotationConnectorStyle.None;
-            textAnnotation1.Name = "Annotation 2";
-            textAnnotation1.Padding.Right = 0;
-            textAnnotation1.ShapeKind = DevExpress.XtraCharts.ShapeKind.Rectangle;
-            freePosition2.InnerIndents.Left = 200;
-            freePosition2.InnerIndents.Top = 12;
-            textAnnotation1.ShapePosition = freePosition2;
-            textAnnotation1.Text = "色系";
-            textAnnotation2.AnchorPoint = chartAnchorPoint3;
-            textAnnotation2.AnnotationID = 3;
-            textAnnotation2.AutoHeight = true;
-            textAnnotation2.AutoWidth = true;
-            textAnnotation2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
-            textAnnotation2.Border.Visibility = DevExpress.Utils.DefaultBoolean.False;
-            textAnnotation2.ConnectorStyle = DevExpress.XtraCharts.AnnotationConnectorStyle.None;
-            textAnnotation2.Name = "Annotation 3";
-            textAnnotation2.Padding.Left = 0;
-            textAnnotation2.ShapeKind = DevExpress.XtraCharts.ShapeKind.Rectangle;
-            freePosition3.InnerIndents.Left = 632;
-            freePosition3.InnerIndents.Top = 13;
-            textAnnotation2.ShapePosition = freePosition3;
-            textAnnotation2.Text = "共0个点";
-            this.chartControl1.AnnotationRepository.AddRange(new DevExpress.XtraCharts.Annotation[] {
-            imageAnnotation1,
-            textAnnotation1,
-            textAnnotation2});
-            this.chartControl1.BorderOptions.Visibility = DevExpress.Utils.DefaultBoolean.False;
-            this.chartControl1.CrosshairEnabled = DevExpress.Utils.DefaultBoolean.Default;
-            xyDiagram1.AxisX.Label.TextColor = System.Drawing.Color.FromArgb(((int)(((byte)(242)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
-            xyDiagram1.AxisX.Tickmarks.MinorVisible = false;
-            xyDiagram1.AxisX.Tickmarks.Visible = false;
-            xyDiagram1.AxisX.VisibleInPanesSerializable = "-1";
-            xyDiagram1.AxisY.GridLines.Visible = false;
-            xyDiagram1.AxisY.Label.TextColor = System.Drawing.Color.FromArgb(((int)(((byte)(242)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
-            xyDiagram1.AxisY.Tickmarks.MinorVisible = false;
-            xyDiagram1.AxisY.Tickmarks.Visible = false;
-            xyDiagram1.AxisY.Visibility = DevExpress.Utils.DefaultBoolean.True;
-            xyDiagram1.AxisY.VisibleInPanesSerializable = "-1";
-            xyDiagram1.DefaultPane.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
-            xyDiagram1.DefaultPane.BorderVisible = false;
-            xyDiagram1.DefaultPane.EnableAxisXScrolling = DevExpress.Utils.DefaultBoolean.False;
-            xyDiagram1.DefaultPane.EnableAxisXZooming = DevExpress.Utils.DefaultBoolean.False;
-            xyDiagram1.DefaultPane.EnableAxisYScrolling = DevExpress.Utils.DefaultBoolean.True;
-            xyDiagram1.DefaultPane.EnableAxisYZooming = DevExpress.Utils.DefaultBoolean.True;
-            xyDiagram1.EnableAxisXZooming = true;
-            xyDiagram1.EnableAxisYZooming = true;
-            this.chartControl1.Diagram = xyDiagram1;
-            this.chartControl1.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.chartControl1.Legend.LegendID = -1;
-            this.chartControl1.Legend.MarkerMode = DevExpress.XtraCharts.LegendMarkerMode.None;
-            this.chartControl1.Legend.Visibility = DevExpress.Utils.DefaultBoolean.False;
-            this.chartControl1.Location = new System.Drawing.Point(0, 0);
-            this.chartControl1.Name = "chartControl1";
-            this.chartControl1.PaletteName = "Blue Green";
-            series1.CrosshairEnabled = DevExpress.Utils.DefaultBoolean.False;
-            series1.Name = "Series 1";
-            series1.SeriesID = 0;
-            series1.ToolTipEnabled = DevExpress.Utils.DefaultBoolean.True;
-            pointSeriesView1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(240)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
-            pointSeriesView1.PointMarkerOptions.Size = 6;
-            series1.View = pointSeriesView1;
-            this.chartControl1.SeriesSerializable = new DevExpress.XtraCharts.Series[] {
-        series1};
-            this.chartControl1.Size = new System.Drawing.Size(898, 599);
-            this.chartControl1.TabIndex = 1;
-            chartTitle1.Indent = 10;
-            chartTitle1.Text = " ";
-            chartTitle1.TitleID = 1;
-            chartTitle1.Visibility = DevExpress.Utils.DefaultBoolean.True;
-            this.chartControl1.Titles.AddRange(new DevExpress.XtraCharts.ChartTitle[] {
-            chartTitle1});
-            // 
-            // Test
-            // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
-            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(898, 599);
-            this.Controls.Add(this.chartControl1);
-            this.IconOptions.ShowIcon = false;
-            this.MaximizeBox = false;
-            this.MinimizeBox = false;
-            this.Name = "Test";
-            this.ShowInTaskbar = false;
-            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
-            this.Text = "互模糊结果";
-            this.Load += new System.EventHandler(this.Test_Load);
-            ((System.ComponentModel.ISupportInitialize)(imageAnnotation1)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(textAnnotation1)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(textAnnotation2)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(xyDiagram1)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(pointSeriesView1)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(series1)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.chartControl1)).EndInit();
-            this.ResumeLayout(false);
-
-        }
-
-        #endregion
-        private DevExpress.XtraCharts.ChartControl chartControl1;
-    }
-}

+ 0 - 84
XdCxRhDW.App/CorTools/Test.cs

@@ -1,84 +0,0 @@
-using DevExpress.Charts.Native;
-using DevExpress.Map.Dashboard;
-using DevExpress.Map.Native;
-using DevExpress.XtraBars;
-using DevExpress.XtraCharts;
-using DevExpress.XtraEditors.Repository;
-using ExtensionsDev;
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows;
-using System.Windows.Forms;
-using System.Xml.Linq;
-using XdCxRhDW.Core;
-using XdCxRhDW.Core.Api;
-using static DevExpress.XtraEditors.Mask.Design.MaskSettingsForm.DesignInfo.MaskManagerInfo;
-using static System.Windows.Forms.VisualStyles.VisualStyleElement.TaskbarClock;
-using static System.Windows.Forms.VisualStyles.VisualStyleElement.ToolTip;
-
-namespace XdCxRhDW.App.CorTools
-{
-    public partial class Test : DevExpress.XtraEditors.XtraForm
-    {
-        List<ImageResult> list;
-        public Test()
-        {
-            InitializeComponent();
-            int w = (this.chartControl1.AnnotationRepository[0] as ImageAnnotation).Width;
-            int h = (this.chartControl1.AnnotationRepository[0] as ImageAnnotation).Height;
-            Bitmap bmp = new Bitmap(w, h);
-            for (int x = 0; x < w; x++)
-            {
-                for (int y = 0; y < h; y++)
-                {
-                    var rgbb = ColorRGB.GetSpecColor(x / 1d / w);
-                    int r = rgbb.R;
-                    int g = rgbb.G;
-                    int b = rgbb.B;
-                    Color c = Color.FromArgb(r, g, b);
-                    bmp.SetPixel(x, y, c);
-                }
-            }
-            var bgColor = ColorRGB.GetSpecColor(0.3);
-            chartControl1.BackColor = bgColor;
-            (this.chartControl1.Diagram as XYDiagram).DefaultPane.BackColor = bgColor;
-            (this.chartControl1.AnnotationRepository[0] as ImageAnnotation).Image.DXImage = bmp;
-            (this.chartControl1.AnnotationRepository[1] as TextAnnotation).BackColor = bgColor;
-            (this.chartControl1.AnnotationRepository[1] as TextAnnotation).TextColor = Color.White;
-            (this.chartControl1.AnnotationRepository[2] as TextAnnotation).BackColor = bgColor;
-            (this.chartControl1.AnnotationRepository[2] as TextAnnotation).TextColor = Color.White;
-            (this.chartControl1.Diagram as XYDiagram).AxisX.Color = Color.White;
-            (this.chartControl1.Diagram as XYDiagram).AxisX.Label.TextColor = Color.White;
-            (this.chartControl1.Diagram as XYDiagram).AxisY.Color = Color.White;
-            (this.chartControl1.Diagram as XYDiagram).AxisY.Label.TextColor = Color.White;
-            this.chartControl1.Series[0].ToolTipEnabled = DevExpress.Utils.DefaultBoolean.True;
-
-            //ToolTipPointPattern可以参考以下网站说明
-            //https://docs.devexpress.com/CoreLibraries/DevExpress.XtraCharts.SeriesBase.ToolTipPointPattern?utm_source=visualstudio&utm_medium=DXHelpAssistant&utm_campaign=onlinehelp
-            this.chartControl1.Series[0].ToolTipPointPattern = "{A:f3}us\r\n{V:f3}Hz";
-        }
-        public Test(List<ImageResult> list)
-            : this()
-        { 
-            this.list = list;
-            var maxY = list.First().YMax / 2;
-            (this.chartControl1.AnnotationRepository[2] as TextAnnotation).Text = $"共{list.Count}个点";
-            (this.chartControl1.Diagram as XYDiagram).AxisY.WholeRange.SetMinMaxValues(-maxY, maxY);
-            (this.chartControl1.Diagram as XYDiagram).AxisY.VisualRange.SetMinMaxValues(-maxY, maxY);
-        }
-        private void Test_Load(object sender, EventArgs e)
-        {
-            foreach (var item in list)
-            {
-                double xValue = (item.XValue + item.XFlag)/1d/
-                this.chartControl1.Series[0].Points.AddPoint(item.XValue, item.YValue);
-            }
-        }
-    }
-}

+ 0 - 120
XdCxRhDW.App/CorTools/Test.resx

@@ -1,120 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
-  <!-- 
-    Microsoft ResX Schema 
-    
-    Version 2.0
-    
-    The primary goals of this format is to allow a simple XML format 
-    that is mostly human readable. The generation and parsing of the 
-    various data types are done through the TypeConverter classes 
-    associated with the data types.
-    
-    Example:
-    
-    ... ado.net/XML headers & schema ...
-    <resheader name="resmimetype">text/microsoft-resx</resheader>
-    <resheader name="version">2.0</resheader>
-    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
-    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
-    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
-    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
-    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
-        <value>[base64 mime encoded serialized .NET Framework object]</value>
-    </data>
-    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
-        <comment>This is a comment</comment>
-    </data>
-                
-    There are any number of "resheader" rows that contain simple 
-    name/value pairs.
-    
-    Each data row contains a name, and value. The row also contains a 
-    type or mimetype. Type corresponds to a .NET class that support 
-    text/value conversion through the TypeConverter architecture. 
-    Classes that don't support this are serialized and stored with the 
-    mimetype set.
-    
-    The mimetype is used for serialized objects, and tells the 
-    ResXResourceReader how to depersist the object. This is currently not 
-    extensible. For a given mimetype the value must be set accordingly:
-    
-    Note - application/x-microsoft.net.object.binary.base64 is the format 
-    that the ResXResourceWriter will generate, however the reader can 
-    read any of the formats listed below.
-    
-    mimetype: application/x-microsoft.net.object.binary.base64
-    value   : The object must be serialized with 
-            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
-            : and then encoded with base64 encoding.
-    
-    mimetype: application/x-microsoft.net.object.soap.base64
-    value   : The object must be serialized with 
-            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
-            : and then encoded with base64 encoding.
-
-    mimetype: application/x-microsoft.net.object.bytearray.base64
-    value   : The object must be serialized into a byte array 
-            : using a System.ComponentModel.TypeConverter
-            : and then encoded with base64 encoding.
-    -->
-  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
-    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
-    <xsd:element name="root" msdata:IsDataSet="true">
-      <xsd:complexType>
-        <xsd:choice maxOccurs="unbounded">
-          <xsd:element name="metadata">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" />
-              </xsd:sequence>
-              <xsd:attribute name="name" use="required" type="xsd:string" />
-              <xsd:attribute name="type" type="xsd:string" />
-              <xsd:attribute name="mimetype" type="xsd:string" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="assembly">
-            <xsd:complexType>
-              <xsd:attribute name="alias" type="xsd:string" />
-              <xsd:attribute name="name" type="xsd:string" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="data">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
-              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
-              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="resheader">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" />
-            </xsd:complexType>
-          </xsd:element>
-        </xsd:choice>
-      </xsd:complexType>
-    </xsd:element>
-  </xsd:schema>
-  <resheader name="resmimetype">
-    <value>text/microsoft-resx</value>
-  </resheader>
-  <resheader name="version">
-    <value>2.0</value>
-  </resheader>
-  <resheader name="reader">
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-</root>

+ 5 - 14
XdCxRhDW.App/XdCxRhDW.App.csproj

@@ -252,12 +252,6 @@
     <Compile Include="Basic\DebounceDispatcher.cs" />
     <Compile Include="Basic\IOverlayFormService.cs" />
     <Compile Include="Basic\PhysicsHelper.cs" />
-    <Compile Include="CorTools\CgImageForm.cs">
-      <SubType>Form</SubType>
-    </Compile>
-    <Compile Include="CorTools\CgImageForm.Designer.cs">
-      <DependentUpon>CgImageForm.cs</DependentUpon>
-    </Compile>
     <Compile Include="CorTools\DetectToolForm.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -270,11 +264,11 @@
     <Compile Include="CorTools\CorToolForm.designer.cs">
       <DependentUpon>CorToolForm.cs</DependentUpon>
     </Compile>
-    <Compile Include="CorTools\Test.cs">
+    <Compile Include="CorTools\CgImageForm.cs">
       <SubType>Form</SubType>
     </Compile>
-    <Compile Include="CorTools\Test.Designer.cs">
-      <DependentUpon>Test.cs</DependentUpon>
+    <Compile Include="CorTools\CgImageForm.Designer.cs">
+      <DependentUpon>CgImageForm.cs</DependentUpon>
     </Compile>
     <Compile Include="CorTools\XlCalculateForm.cs">
       <SubType>Form</SubType>
@@ -460,17 +454,14 @@
     <Compile Include="UserControl\X2D1GDOPParam.Designer.cs">
       <DependentUpon>X2D1GDOPParam.cs</DependentUpon>
     </Compile>
-    <EmbeddedResource Include="CorTools\CgImageForm.resx">
-      <DependentUpon>CgImageForm.cs</DependentUpon>
-    </EmbeddedResource>
     <EmbeddedResource Include="CorTools\DetectToolForm.resx">
       <DependentUpon>DetectToolForm.cs</DependentUpon>
     </EmbeddedResource>
     <EmbeddedResource Include="CorTools\CorToolForm.resx">
       <DependentUpon>CorToolForm.cs</DependentUpon>
     </EmbeddedResource>
-    <EmbeddedResource Include="CorTools\Test.resx">
-      <DependentUpon>Test.cs</DependentUpon>
+    <EmbeddedResource Include="CorTools\CgImageForm.resx">
+      <DependentUpon>CgImageForm.cs</DependentUpon>
     </EmbeddedResource>
     <EmbeddedResource Include="CorTools\XlCalculateForm.resx">
       <DependentUpon>XlCalculateForm.cs</DependentUpon>

+ 3 - 3
XdCxRhDW.Core/Api/检测Cpu参估/ImageResult.cs

@@ -10,7 +10,7 @@ namespace XdCxRhDW.Core.Api
 {
     public class ImageResult
     {
-        public static float MaxColorValue;
+        private static float MaxColorValue = 40;//最大信噪比
 
         public int FsHz { get; set; }
 
@@ -29,10 +29,10 @@ namespace XdCxRhDW.Core.Api
         public Color GetColor()
         {
             double flag;
-            if (Snr == MaxColorValue)
+            if (Snr >= MaxColorValue)
                 flag = 1;
             else
-                flag = Snr / 1.2 / MaxColorValue;
+                flag = Snr / MaxColorValue;
             return ColorRGB.GetSpecColor(flag);
         }
 

+ 0 - 1
XdCxRhDW.Core/Api/检测Cpu参估/XcorrUtils.cs

@@ -122,7 +122,6 @@ namespace XdCxRhDW.Core.Api
                             };
                             list.Add(ir);
                         }
-                        ImageResult.MaxColorValue = list.Max(p => p.Snr);
                     }
                     File.Delete(outFile);
                 }