Example #1
0
        public void AddNewPack(onepack o)
        {
            if (!bSimulate)
            {
                total_packs++;
                total_weights += o.weight;
            }
            else
            {
                total_sim_weights += o.weight;
                total_sim_packs++;
            }
            last_one_pack = o;

            packhist.Add(o);
            lastmin = DateTime.Now.AddMinutes(-1);
            packhist.RemoveAll(new Predicate <onepack>(screen));
            speed = (UInt32)packhist.Count;
            if (bSimulate)
            {
                return;
            }
            if (total_packs % 100 == 1) //update record for every 100 packs
            {
                ProdHistory.UpdateRecord(this);
                EngWnd.DecreasePacker(100);
            }
        }
Example #2
0
        private void ReleaseAction(byte[] addrs, double weight)
        {
            string log = weight.ToString("F2") + "\t";

            log = weight.ToString("F2") + "\t";

            foreach (byte n in addrs)
            {
                log = log + String.Format("({0}){1}\t", n, NodeMaster.GetWeight(n));

                while (true)
                {
                    try
                    {
                        NodeMaster.Action(new byte[] { n }, "flag_release");
                        break;
                    }
                    catch
                    {
                        Program.MsgShow(StringResource.str("tryagain"));
                    }
                }
            }
            NodeMaster.HitMatch(addrs);
            StringResource.dolog(log);

            onepack o = new onepack();

            o.bucket    = new byte[5];
            o.bucket[1] = o.bucket[2] = o.bucket[3] = o.bucket[4] = o.bucket[0] = (byte)0;
            int i = 0;

            foreach (byte n in addrs)
            {
                o.bucket[i++] = n;
            }
            o.time   = DateTime.Now;
            o.weight = weight;
            packer.AddNewPack(o);
        }
Example #3
0
        private void ReleaseAction(byte[] addrs, double weight)
        {
            string log = weight.ToString("F2") + "\t";

            log = weight.ToString("F2") + "\t";

            foreach (byte n in addrs)
            {
                log = log + String.Format("({0}){1}\t", n, NodeMaster.GetWeight(n));

                while(true)
                {
                try
                {
                    NodeMaster.Action(new byte[] { n }, "flag_release");
                    break;
                }
                catch
                {
                    Program.MsgShow(StringResource.str("tryagain"));
                }
                }
            }
            NodeMaster.HitMatch(addrs);
            StringResource.dolog(log);
            
            onepack o = new onepack();
            o.bucket = new byte[5];
            o.bucket[1] = o.bucket[2] = o.bucket[3] = o.bucket[4] = o.bucket[0] = (byte)0;
            int i = 0;
            foreach (byte n in addrs)
            {
                o.bucket[i++] = n;
            }
            o.time = DateTime.Now;
            o.weight = weight;
            packer.AddNewPack(o);

        }
Example #4
0
 public bool screen(onepack po)
 {
     return(po.time < lastmin);
 }
Example #5
0
        public void AddNewPack(onepack o)
        {
            if (!bSimulate)
            {
                total_packs++;
                total_weights += o.weight;
            }
            else
            {
                total_sim_weights += o.weight;
                total_sim_packs++;
            }
            last_one_pack = o;

            packhist.Add(o);
            lastmin = DateTime.Now.AddMinutes(-1);
            packhist.RemoveAll(new Predicate<onepack>(screen));
            speed = (UInt32)packhist.Count;
            if (bSimulate)
                return;
            if (total_packs % 100 == 1) //update record for every 100 packs
            {
                ProdHistory.UpdateRecord(this);
                EngWnd.DecreasePacker(100);
            }
        }
Example #6
0
 public bool screen(onepack po)
 {
     return (po.time < lastmin);
 }