Esempio n. 1
0
 public DeviceConfig GetDevice(RtuDeviceCreateViewModel model)
 {
     return(new DeviceConfig()
     {
         ChannelId = model.ChannelId,
         Title = model.Title,
         Type = DeviceType.ModbusRTU,
         Identificator = model.Identificator
     });
 }
Esempio n. 2
0
        public async Task <IActionResult> RtuDeviceCreate(RtuDeviceCreateViewModel model)
        {
            if (ModelState.IsValid)
            {
                await _modbusService.Create(_modbusFactory.GetDevice(model));

                return(_getDefaultForm());
            }

            return(PartialView("_RtuDeviceCreatePartial", model));
        }