コード例 #1
0
ファイル: NodeCombination.cs プロジェクト: ymz000/kpgweigher
        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);
        }