Esempio n. 1
0
        public void __program(Firmware fw)
        {
            byte[]        code   = fw.imagebyte;
            List <byte[]> groups = self.__split_len(code, PROG_MULTI_MAX);
            int           a      = 1;

            foreach (Byte[] bytes in groups)
            {
                self.__program_multi(bytes);

                System.Diagnostics.Debug.WriteLine("Program {0}/{1}", a, groups.Count);

                a++;
                if (ProgressEvent != null)
                {
                    ProgressEvent((a / (float)groups.Count) * 100.0);
                }
            }
        }
        public void __program(Firmware fw)
        {
            byte[]        code   = fw.imagebyte;
            List <byte[]> groups = self.__split_len(code, (byte)Code.PROG_MULTI_MAX);

            Console.WriteLine("Programing packet total: " + groups.Count);
            int a = 1;

            foreach (Byte[] bytes in groups)
            {
                self.__program_multi(bytes);

                Console.WriteLine("Program {0}/{1}", a, groups.Count);

                a++;
                if (ProgressEvent != null)
                {
                    ProgressEvent((a / (float)groups.Count) * 100.0);
                }
            }
        }