public RUnit(EType _type, Series _series, Axis _axisY, CheckBox _box, string _hint, ToolTip _tt) { type = _type; series = _series; bline = new BorderLine(_axisY, Classer.GetColor(EClass.Brak), Classer.GetColor(EClass.Class2)); bline1 = new BorderLine(_axisY, Classer.GetColor(EClass.Brak), Classer.GetColor(EClass.Class2)); box = _box; _tt.SetToolTip(box, _hint); box.CheckedChanged += new System.EventHandler(CheckedChanged); }
public void Clear() { chart1.Series[0].Points.Clear(); chart1.Series[0].Points.Clear(); if (bline != null) { bline.Visible = false; } if (blineIn != null) { blineIn.Visible = false; } bline = null; blineIn = null; cursor.Visible = false; }
public void InitRange(ResultDef _resultDef, int _iz0, int _iz1, int _is, double _gain) { chart1.Series.SuspendUpdates(); Clear(); TypeSize ts = ParAll.ST.TSSet.Current; resultDef = _resultDef; iz0 = _iz0; iz1 = _iz1; ise = _is; Color DeviderColor = ParAll.ST.Some.SignalsView.DeviderColor; DataPointCollection p = chart1.Series[0].Points; DataPointCollection pIn = chart1.Series[0].Points; int ip = 0; int ipIn = 0; int istrip = 0; chart1.ChartAreas[0].AxisX.StripLines.Clear(); DefCL dcl = new DefCL(_resultDef.Tp); bool IsIn = dcl.IsFinterIn; for (int ii = _iz0; ii <= _iz1; ii++) { Meas[] MMeas = _resultDef.MZone[ii].MSensor[ise].MMeas; if (istrip > 0) { StripLine sl = new StripLine(); sl.BorderColor = DeviderColor; sl.BorderWidth = 2; sl.IntervalOffset = ip; chart1.ChartAreas[0].AxisX.StripLines.Add(sl); } istrip++; for (int i = 0; i < MMeas.Length; i++) { Meas m = MMeas[i]; DataPoint dp = new DataPoint(ip, m.FilterABC * _gain); dp.Color = m.Dead ? Classer.GetColor(EClass.None) : Classer.GetColor(m.Class); dp.Tag = new PointSubj(ii, ise, i); p.Add(dp); ip++; if (IsIn) { pIn.AddXY(ipIn, -m.FilterInABC * _gain); p[ipIn].Color = m.Dead ? Classer.GetColor(EClass.None) : Classer.GetColor(m.ClassIn); ipIn++; } } istrip++; } if (bline != null) { bline.Visible = false; } if (blineIn != null) { blineIn.Visible = false; } bline = new BorderLine(chart1.ChartAreas[0].AxisY, Classer.GetColor(EClass.Brak), Classer.GetColor(EClass.Class2)); blineIn = new BorderLine(chart1.ChartAreas[0].AxisY, Classer.GetColor(EClass.Brak), Classer.GetColor(EClass.Class2)); bline.SetBorders(dcl.Borders); bline.Visible = true; if (IsIn) { double[] borders = new double[2]; borders[0] = -dcl.Border1In; borders[1] = -dcl.Border2In; blineIn.SetBorders(borders); blineIn.Visible = true; } chart1.ChartAreas[0].AxisY.Maximum = 100; if (IsIn) { chart1.ChartAreas[0].AxisY.Minimum = -100; } else { chart1.ChartAreas[0].AxisY.Minimum = 0; } if (cursor.Visible) { OnMove(cursor.Position); } chart1.Series[0].Enabled = true; chart1.Series[1].Enabled = IsIn; chart1.Series.ResumeUpdates(); }