Example #1
0
 public void Init(ResultDef _Result, int _iz, int _is)
 {
     result           = _Result;
     iz               = _iz;
     iis              = _is;
     label1.Text      = string.Format("Д{0}", iis + 1);
     label1.BackColor = Classer.GetColor(result.MZone[iz].MSensor[iis].Class);
     uSensorData1.InitSingle(_Result, _iz, _is, uCalibr1.Gain);
 }
Example #2
0
 public Result()
 {
     Error = null;
     Thick = new ResultThickLite();
     Cross = new ResultDef(EUnit.Cross);
     Line  = new ResultDef(EUnit.Line);
     SG    = new ResultSG();
     Sum   = new SumResult();
 }
Example #3
0
        void AddZone(ResultDef _resultDef, int _izone)
        {
            Zone zone = _resultDef.MZone[_izone];

            SetSeries(zone.MSensor.Length);
            for (int si = 0; si < zone.MSensor.Count(); si++)
            {
                DataPoint dp = chart1.Series[si].Points.Add(1);
                dp.Color = Classer.GetColor(zone.MSensor[si].Class);
            }
        }
Example #4
0
        //public void ComputeLine(ResultDef _line)
        //{
        //    MClass.Clear();
        //    MClass.Capacity = _line.MZone.Count();
        //    for (int i = 0; i < _line.MZone.Count(); i++)
        //        MClass.Add(_line.MZone[i].Class);
        //}

        public void Compute(ResultDef _cross, ResultDef _line, ResultThickLite _thick)
        {
            int size = 1000;

            if (_cross != null && _cross.MZone.Count > 0)
            {
                if (size > _cross.MZone.Count)
                {
                    size = _cross.MZone.Count;
                }
            }

            if (_line != null && _line.MZone.Count > 0)
            {
                if (size > _line.MZone.Count)
                {
                    size = _line.MZone.Count;
                }
            }

            if (_thick != null && _thick.MZone.Count > 0)
            {
                if (size > _thick.MZone.Count)
                {
                    size = _thick.MZone.Count;
                }
            }
            if (size == 1000)
            {
                size = 0;
            }
            MClass.Clear();
            MClass.Capacity = size;
            for (int i = 0; i < size; i++)
            {
                EClass c = EClass.None;
                if (_cross != null && i < _cross.MZone.Count())
                {
                    c = Classer.Compare(c, _cross.MZone[i].Class);
                }
                if (_line != null && i < _line.MZone.Count())
                {
                    c = Classer.Compare(c, _line.MZone[i].Class);
                }
                if (_thick != null && i < _thick.MZone.Count)
                {
                    c = Classer.Compare(c, _thick.MZone[i].RClass);
                }
                MClass.Add(c);
            }
            RClass = MaxGood != null ? EClass.Class1 : EClass.Brak;
        }
Example #5
0
        public void Draw()
        {
            ResultDef resultDef = null;

            if (Tp == EUnit.Cross)
            {
                resultDef = RK.ST.result.Cross;
            }
            else
            {
                resultDef = RK.ST.result.Line;
            }
            Clear();
            for (int zi = 0; zi < resultDef.MZone.Count(); zi++)
            {
                AddZone(resultDef, zi);
            }
        }
Example #6
0
        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();
        }
Example #7
0
 public void InitSingle(ResultDef _resultDef, int _iz, int _is, double _gain)
 {
     InitRange(_resultDef, _iz, _iz, _is, _gain);
 }
 public DemoParams()
 {
     m_ResultDef = new ResultDef();
 }