Ejemplo n.º 1
0
        public async Task WriteFile()
        {
            if (_workProgramCheckBox.Checked)
            {
                ModuleWritterController controller = new ModuleWritterController(this._moduleInformation, TypeOfMemory.WORK, DevicesManager.DeviceNumber, _data);
                try
                {
                    await controller.StartSave(progressWork);
                }
                catch (Exception e)
                {
                    throw new Exception(e.Message);
                }
            }
            if (_eepromCheckBox.Checked)
            {
                ModuleWritterController controller = new ModuleWritterController(this._moduleInformation, TypeOfMemory.EEPROM, DevicesManager.DeviceNumber, _dataEeprom);
                try
                {
                    await controller.StartSaveForAnotherMemmoryType(progressEProm);

                    _eepromCheckBox.Checked = false;
                }
                catch (Exception e)
                {
                    throw new Exception(e.Message);
                }
            }
            if (_relayDiscretCheckBox.Checked)
            {
                ModuleWritterController controller = new ModuleWritterController(this._moduleInformation, TypeOfMemory.RALAY_DISCRET, DevicesManager.DeviceNumber, _dataDiscretRelay);
                try
                {
                    await controller.StartSaveForAnotherMemmoryType(progressRelay);

                    _relayDiscretCheckBox.Checked = false;
                }
                catch (Exception e)
                {
                    throw new Exception(e.Message);
                }
            }
            if (_flashCheckBox.Checked)
            {
                ModuleWritterController controller = new ModuleWritterController(this._moduleInformation, TypeOfMemory.BOOT_FLASH, DevicesManager.DeviceNumber, _dataFlash,
                                                                                 (ushort)Convert.ToUInt16(_startReadPage.Text), (ushort)Convert.ToUInt16(_countReadPage.Text));
                try
                {
                    await controller.StartSaveForAnotherMemmoryType(progressFlash);
                }
                catch (Exception e)
                {
                    throw new Exception(e.Message);
                }
            }
        }
Ejemplo n.º 2
0
 public async Task WriteFile()
 {
     if (this._workProgramCheckFile.Checked)
     {
         ModuleWritterController moduleWritter = new ModuleWritterController(this.Information, TypeOfMemory.WORK, DevicesManager.DeviceNumber, this._data);
         try
         {
             await moduleWritter.StartSave(_progressBarReport);
         }
         catch (Exception e)
         {
             this.State = ModuleStates.ERROR_WRITEFILE_TO_MODULE;
             throw new Exception(e.Message);
         }
     }
 }