Esempio n. 1
0
        /// <summary>
        /// Выполняет загрузку Eprom с файла
        /// </summary>
        /// <param name="filePath">Путь к файлу</param>
        /// <param name="format">Формат в котором сохранен Eprom</param>
        /// <returns></returns>
        public Eprom LoadEpromFromFile(string filePath, FileFormat format)
        {
            IEFLoader ldr   = null;
            Eprom     eprom = new Eprom();

            switch (format)
            {
            case FileFormat.EF1TXT:

                ldr = platform.GetEFLoader(FileFormat.EF1TXT);
                break;

            case FileFormat.EF2XMLOLD:

                ldr = platform.GetEFLoader(FileFormat.EF2XMLOLD);
                break;

            case FileFormat.EF2XML:

                ldr = platform.GetEFLoader(FileFormat.EF2XML);
                break;
            }
            eprom = ldr.Load(filePath);
            return(eprom);
        }
Esempio n. 2
0
        public void LoadFromFile(string filePath, HandleIO handle, FileFormat format)
        {
            IEFLoader ldr   = platform.GetEFLoader(format);
            Eprom     eprom = new Eprom();

            eprom = ldr.Load(filePath);
            if (eprom != null)
            {
                handle.Eprom       = eprom;
                handle.VisionBlock = CreateBlock(eprom);

                if (handle.VisionBlock != null)
                {
                    handle.CRC16           = CalculateCRC16(eprom);
                    handle.ProgrammVersion = new Version(0, 0, 0, 0);
                }
            }
        }