/// <summary> /// 读取NVR配置信息 /// </summary> private void ReadNVRConfig() { WeighterClientModel wcm = (this.DataContext as VideoMonitorViewModel).CurClientModel; string basePath = System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "CarMeasureClient"); string configPath = System.IO.Path.Combine(basePath, wcm.ClientId + ".xml"); Talent.Measure.DomainModel.ConfigReader cfgReader1 = new Talent.Measure.DomainModel.ConfigReader(configPath); this.nvrConfig = ConfigReader.ReadAudioConfig(); }
/// <summary> /// 处理cmd命令 /// </summary> /// <param name="msg"></param> private void GetRealData(string realDataJsonStr) { if (!string.IsNullOrEmpty(realDataJsonStr)) { WeighterClientModel weighterClient = JsonConvert.DeserializeObject <WeighterClientModel>(realDataJsonStr); if (weighterClient != null) { if (this.selectedMeasure.equcode == weighterClient.ClientId && weighterClient.EquTag != null && weighterClient.EquTag.Equals("P") && !isShowChildFormMsg) { #region 写打印结果的日志 LogModel timerLog = new LogModel() { CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), Direction = LogConstParam.Directions_OutIn, FunctionName = "坐席_数据查询窗体", Level = LogConstParam.LogLevel_Error, Msg = "在实时数据中获取到打印结果信息,等待打印结果计时器停止计时", Origin = "汽车衡_" + LoginUser.Role.Name, OperateUserName = LoginUser.Name }; Talent.ClinetLog.SysLog.Log(JsonConvert.SerializeObject(timerLog)); #endregion waitPrintReusltTimer.Stop(); SocketCls.listenEvent -= SocketCls_listenEvent; printError = weighterClient.PrintState; string msg = "打印成功!"; if (!string.IsNullOrEmpty(printError)) { msg = "打印失败,原因:" + printError; } #region 写打印结果的日志 LogModel timerLog1 = new LogModel() { CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), Direction = LogConstParam.Directions_OutIn, FunctionName = "数据查询", Msg = msg + ",当前isShowChildFormMsg(信息子窗体是否已经打开)值为:" + isShowChildFormMsg.ToString(), Origin = "汽车衡_" + LoginUser.Role.Name, OperateUserName = LoginUser.Name }; Talent.ClinetLog.SysLog.Log(JsonConvert.SerializeObject(timerLog1)); #endregion isShowChildFormMsg = true; System.Windows.Application.Current.Dispatcher.Invoke(new Action(() => { //打印失败业务处理 ConfirmMessageBox confirmBox = new ConfirmMessageBox("系统提示", msg, true, false, "确定", ""); confirmBox.ShowDialog(); })); isShowChildFormMsg = false; } } } }
private VideoConfig InitReadVideoConfig() { string basePath = System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "CarMeasureClient"); WeighterClientModel wcm = (this.DataContext as VideoMonitorViewModel).CurClientModel; string configPath = System.IO.Path.Combine(basePath, wcm.ClientId + ".xml"); Talent.Measure.DomainModel.ConfigReader cfgReader1 = new Talent.Measure.DomainModel.ConfigReader(configPath); VideoConfig gCfg = ConfigReader.ReadVideoConfig(); gCfg.CameraList = (from r in gCfg.CameraList select r).OrderBy(c => c.Position).ToList(); return(gCfg); }