Esempio n. 1
0
 public async Task <IActionResult> SetChannelModel([FromRoute] string id, [FromRoute] int portNumber, [FromBody] Simple <int> setting)
 {
     return(await ExecFunction(id, device =>
     {
         var chanel = _deviceQueries.GetChannelAsync(device.Id, portNumber).Result;
         Common.ConfigModel.ChannelValueDto <ChannelTypeEnum, int> model = new Common.ConfigModel.ChannelValueDto <ChannelTypeEnum, int>()
         {
             Channel = (ChannelTypeEnum)chanel.PortType, Value = setting.Data
         };
         return _skynetTerminalClient.ChannelIsAutoControl(model, device.EquipNum);
     }, "model"));
 }
Esempio n. 2
0
 public async Task <IActionResult> SetChannelSwitchStatus([FromRoute] string id, [FromRoute] int portNumber, [FromBody] Simple <int> switchStatuse)
 {
     return(await ExecFunction(id, device =>
     {
         var channel = _deviceQueries.GetChannelAsync(device.Id, portNumber).Result;
         var request = new Common.ConfigModel.ChannelValueDto <Common.ConfigModel.SkynetTerminal.Enums.ChannelTypeEnum, int>
         {
             Channel = (Common.ConfigModel.SkynetTerminal.Enums.ChannelTypeEnum)channel.PortType,
             Value = switchStatuse.Data
         };
         return _skynetTerminalClient.ChannelStatusControl(request, device.EquipNum);
     }, "onoff"));
 }