/// <summary> /// 更新昆仑 /// </summary> /// <param name="model">The model.</param> public void UpdateKunLunServer(HWDeviceDetail model) { try { var server = new KunLunServer(); server.MakeDetail(model, this.ESightIp); KunLunConnector.Instance.UpdateKunLun(server); } catch (Exception ex) { this.OnNotifyError($"UpdateKunLunServer Error.eSight:{this.ESightIp} Dn:{model.DN}. ", ex); } }
/// <summary> /// 更新昆仑 /// </summary> /// <param name="model">The model.</param> /// <param name="alarmSn">The alarm sn.</param> private void UpdateKunLunServer(HWDeviceDetail model, int alarmSn) { try { logger.NotifyProcess.Info($"Start Update KunLunServer:{model.DN}.[alarmSn:{alarmSn}]"); var server = new KunLunServer(); server.MakeDetail(model, this.ESightIp); KunLunConnector.Instance.UpdateKunLun(server, false); } catch (Exception ex) { logger.NotifyProcess.Error(ex, $"UpdateKunLunServer Error. Dn:{model.DN}.[alarmSn:{alarmSn}] "); } }
/// <summary> /// Queries the kunLun detial. /// </summary> /// <param name="kunLun">The kun lun.</param> public void QueryKunLunDetial(KunLunServer kunLun) { var task = Task.Run(() => { try { var device = this.Session.GetServerDetails(kunLun.DN); kunLun.MakeDetail(device, this.ESightIp); KunLunConnector.Instance.InsertDetials(kunLun); } catch (Exception ex) { this.OnError($"QueryKunLunDetial Error:{kunLun.DN}", ex); } }); this.taskList.Add(task); }
/// <summary> /// Queries the kunLun detial. /// </summary> /// <param name="kunLun">The kun lun.</param> private void QueryKunLunDetial(KunLunServer kunLun) { var task = taskFactory.StartNew(() => { try { var device = this.Session.GetServerDetails(kunLun.DN); kunLun.MakeDetail(device, this.ESightIp); KunLunConnector.Instance.SyncServer(kunLun); } catch (Exception ex) { OnPollingError($"QueryKunLunDetial Error:{kunLun.DN}", ex); } }, cts.Token); this.taskList.Add(task); }