示例#1
0
        void GetZones()
        {
            Select S = new Select(string.Format("select * from ThickZones where Zone > {0} order by Zone",
                                                last_index.ToString()));

            while (S.Read())
            {
                BankZoneThick z = new BankZoneThick();
                z.index  = Convert.ToInt32(S["Zone"]);
                z.Length = Convert.ToInt32(S["Length"]);
                object o = S["RLevel"];
                if (o is DBNull)
                {
                    z.Level = null;
                }
                else
                {
                    z.Level = Convert.ToDouble(S["RLevel"]);
                }
                z.RClass = Classer.FromChar(Convert.ToChar(S["Class"]));
                z.last   = Convert.ToBoolean(S["Last"]);
                pr(z.ToString());
                bank.AddThickZone(z);
                last_index = z.index;
                if (z.last)
                {
                    pr("Закончили работу на последней зоне");
                    IsComplete = true;
                }
            }
            S.Dispose();
        }
示例#2
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");
            }
        }