Exemple #1
0
        public void Drawchart(SpecBase lib, NIR.Component c)
        {
            this.specGraph1.DrawSpec(lib);

            var clonelib = lib.Clone();

            clonelib.FilterNaN(c);



            var xaxis = this.Xaxis;

            double[] yaxis;
            if (c == null)
            {
                yaxis = Tools.Corelatn(clonelib.X, clonelib.GetY(lib.Components.First()));
            }
            else
            {
                yaxis = Tools.Corelatn(clonelib.X, clonelib.GetY(c));
            }


            var coreSpec = new Spectrum()
            {
                Name = "相关系数",
                Data = new SpectrumData(xaxis, yaxis, clonelib.First().Data.XType, DataTypeEnum.Corelatn)
            };

            this.specGraph2.DrawSpec(coreSpec);
        }
Exemple #2
0
        private void guetGrid1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex != 1 || e.RowIndex < 0)
            {
                return;
            }
            var row = this.gridMethodLst.Rows[e.RowIndex] as MyDataRow;

            if (row == null)
            {
                return;
            }
            if (!row.Preocesser.Filter.EditEnable)
            {
                return;
            }
            var dialog = new ArgusForm();

            dialog.Changed    += new EventHandler <ArgusFormEventArgus>(dialog_Changed);
            this._editRowIndex = e.RowIndex;
            if (row.Preocesser.Filter.FType == FilterType.SpecFilter)
            {
                dialog.OpenDialog(row.Preocesser.Filter.Argus);
            }
            else
            {
                this.compute();
                //  p.SpecsInput = this._filtedSpecList;

                var regionform = new VarRegionSet();
                regionform.Width    = (int)(this.TopLevelControl.Width * 0.85);
                regionform.Height   = (int)(this.TopLevelControl.Height * 0.9);
                regionform.Changed += new EventHandler(regionform_Changed);
                NIR.Component c = null;
                if (this.GetComponent != null)
                {
                    c = this.GetComponent();
                }
                if (c == null)
                {
                    c = row.Preocesser.SpecsInput.Components.FirstOrDefault();
                }


                regionform.ShowDialog(row.Preocesser, c);
            }
        }
Exemple #3
0
        /// <summary>
        /// 添加新的预处理方法
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void treeMethod_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            var node = e.Node as MyTreenode;

            if (node == null)
            {
                return;
            }
            if (node.Preocesser.Filter.FType == FilterType.VarFilter)//如果是区间设置,需要先将之前的全部处理一次
            {
                Action a = () =>
                {
                    this.compute();
                    var p = Serialize.DeepClone <Preprocesser>(node.Preocesser);
                    p.SpecsInput = this._lastRowSpec;

                    var dlg = new VarRegionSet();
                    dlg.Width  = (int)(this.TopLevelControl.Width * 0.85);
                    dlg.Height = (int)(this.TopLevelControl.Height * 0.9);
                    NIR.Component c = null;
                    if (this.GetComponent != null)
                    {
                        c = this.GetComponent();
                    }
                    if (c == null)
                    {
                        c = p.SpecsInput.Components.FirstOrDefault();
                    }

                    if (dlg.ShowDialog(p, c) == DialogResult.OK)
                    {
                        this.addRow(p);
                    }
                };
                this.BeginInvoke(a);
            }
            else
            {
                this.addRow(Serialize.DeepClone <Preprocesser>(node.Preocesser));
            }
        }
Exemple #4
0
        public DialogResult ShowDialog(Preprocesser p, NIR.Component c)
        {
            if (p == null || p.SpecsInput == null || p.SpecsInput.Count == 0)
            {
                return(System.Windows.Forms.DialogResult.Abort);
            }
            var filter = p.Filter as VarRegionManu;

            if (filter == null)
            {
                return(System.Windows.Forms.DialogResult.Abort);
            }
            this._processer = p;

            this.varRegionControl1.Drawchart(p.SpecsInput, c);
            this.varRegionControl1.XaxisRegion = filter.XaxisRegion.Select(d => new SelectRange()
            {
                Begin = d.X,
                End   = d.Y
            }).ToList();
            var result = this.ShowDialog();

            return(result);
        }