/// <summary> /// 设备上线同步配置 /// </summary> /// <param name="id"></param> /// <returns></returns> private Task SyncConfigProfile(string id) { return(Task.Run(async() => { _terminalClient.RdDeviceInfo(id); await Task.Delay(delay); _terminalClient.RdDisarmControl(id); await Task.Delay(delay); _terminalClient.RdCameraFaultCheckTime(id); await Task.Delay(delay); _terminalClient.RdDisarmControl(id); await Task.Delay(delay); _terminalClient.RdVATHLimit(id); await Task.Delay(delay); for (int port = 1; port < 9; port++) { _terminalClient.RdCameraIP(port, id); await Task.Delay(delay); _terminalClient.RdVedioAssign(port, id); await Task.Delay(delay); } for (int i = 0; i < 5; i++) { _terminalClient.RdChannelMode((Common.ConfigModel.SkynetTerminal.Enums.ChannelTypeEnum)i, id); await Task.Delay(delay); _terminalClient.RdChannelTask((Common.ConfigModel.SkynetTerminal.Enums.ChannelTypeEnum)i, id); await Task.Delay(delay); } })); }
public async Task <IActionResult> GetChannelTask([FromRoute] string id, [FromRoute] int portNumber) { return(await ExecFunction(id, device => { var chanel = _deviceQueries.GetChannelAsync(device.Id, portNumber).Result; ChannelTypeEnum type = (ChannelTypeEnum)chanel.PortType; return _skynetTerminalClient.RdChannelTask(type, device.EquipNum); }, "task")); }