Exemple #1
0
        public void Exec(int _tick)
        {
            if (IsComplete)
            {
                return;
            }
            bool was = false;

            if (IW.Cross)
            {
                for (BankZoneDataA z = bank.GetNextZoneCross(); z != null; z = bank.GetNextZoneCross())
                {
                    was = true;
                    RK.ST.result.Cross.AddZoneA(bank.CrossData, z);
                }
            }
            if (IW.Line)
            {
                for (BankZoneDataA z = bank.GetNextZoneLine(); z != null; z = bank.GetNextZoneLine())
                {
                    was = true;
                    RK.ST.result.Line.AddZoneA(bank.LineData, z);
                }
            }
            if (IW.Thick)
            {
                for (BankZoneThick z = bank.GetNextZoneThick(); z != null; z = bank.GetNextZoneThick())
                {
                    was = true;
                    RK.ST.result.Thick.MZone.Add(z);
                }
            }
            if (IW.SG)
            {
                BankZoneData z = bank.GetNextZoneSG();
                if (z != null)
                {
                    was = true;
                    string lret;
                    RK.ST.result.SG.sgState = SGSet.SaveToDb(bank.SGData, z.size, out lret);
                    if (lret != null)
                    {
                        prsl(1, lret);
                    }
                }
            }
            if (was)
            {
                Result result = RK.ST.result;
                result.Sum.Compute(result.Cross, result.Line, result.Thick);
                List <EClass> L = result.Sum.MClass;
                for (int i = 0; i < L.Count; i++)
                {
                    bank.AddResultZone(i, Classer.ToBool(L[i]));
                }
                Send("DRAW");
            }
        }
Exemple #2
0
        Sensor AddZoneData(double[] _data, BankZoneData _zd, int _sensor, int _Sensors)
        {
            int packets = _zd.size / _Sensors;

            if (packets * _Sensors != _zd.size)
            {
                throw (new Exception("Result::AddZoneData: packets*Sensors!=size"));
            }
            Sensor ret = new Sensor(Tp, packets);

            for (int packet = 0; packet < packets; packet++)
            {
                Meas m = ret.MMeas[packet];
                m.Source = _data[_zd.idata + packet * _Sensors + _sensor];
                //                    m.index = _idata1 + packet * lsensors + s;
            }
            return(ret);
        }
Exemple #3
0
        public void Finish()
        {
            bank.SGLastData = true;
            BankZoneData z = bank.GetNextZoneSG();

            if (z != null)
            {
                string lret;
                SGSet.SaveToDb(bank.SGData, z.size, out lret);
                if (lret != null)
                {
                    prsl(1, lret);
                }
            }
            IsComplete = true;
            foreach (IJob job in J)
            {
                job.Finish();
            }
            Dispose();
        }