public void threadlistViewCaptureRecord(object obj) { try { MyCapFaceLogWithImg _MyCapFaceLogWithImg = (MyCapFaceLogWithImg)obj;; List <byte[]> listImageBytes = new List <byte[]>(); listImageBytes = thirft.QueryCapLogImageH(_MyCapFaceLogWithImg.ID, currDay); //得到图片 if (listImageBytes[0].Length > 0) { GridCapCapPic.Dispatcher.BeginInvoke(new Action(() => { GridCapCapPic.Background = new ImageBrush { ImageSource = new BitmapImage(new Uri("pack://*****:*****@"/", "").Replace(@"/", "")); if (senceImg != null && senceImg.Count > 0 && senceImg[0].Length > 0) { btnPicCaptureRecord.Dispatcher.BeginInvoke(new Action(() => { BitmapImage bitImage = new BitmapImage(); bitImage.BeginInit(); bitImage.StreamSource = new System.IO.MemoryStream(senceImg[0]); bitImage.EndInit(); image_SenceImg.Source = bitImage; })); } else { btnPicCaptureRecord.Dispatcher.BeginInvoke(new Action(() => { image_SenceImg.Source = null; })); } } else { btnPicCaptureRecord.Dispatcher.BeginInvoke(new Action(() => { btnPicCaptureRecord.Background = null; })); } } catch (Exception ex) { } Thread.CurrentThread.Abort(); }
/// <summary> /// 双击抓拍照片 添加模版 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void listViewCaptureResults_MouseDoubleClick(object sender, MouseButtonEventArgs e) { if (Login.ClientType == "1") { return; } MyCapFaceLogWithImg cmpFaceLogWidthImg = listViewCaptureResults.SelectedItem as MyCapFaceLogWithImg; if (cmpFaceLogWidthImg == null) { return; } List <byte[]> listImageBytes = new List <byte[]>(); listImageBytes = thirft.QueryCapLogImageH(cmpFaceLogWidthImg.ID, cmpFaceLogWidthImg.time.Split(' ')[0].Replace(@"/", "").Replace(@"/", "")); TempleteInfoPop tIP = new TempleteInfoPop(); if (listImageBytes.Count <= 0) { return; } else { tIP.SetTempleteInfo(null, 3, listImageBytes[0]); } tIP.ShowDialog(); }
/// <summary> /// 抓拍记录变更选中项 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void listViewCaptureRecord_SelectionChanged(object sender, SelectionChangedEventArgs e) { MyCapFaceLogWithImg _MyCapFaceLogWithImg = listViewCaptureRecord.SelectedItem as MyCapFaceLogWithImg; Thread threadQuery = new Thread(new ParameterizedThreadStart(threadlistViewCaptureRecord)); threadQuery.SetApartmentState(ApartmentState.STA); threadQuery.Start(_MyCapFaceLogWithImg); }
/// <summary> /// 查询抓拍记录(筛选) /// </summary> /// <param name="captureRecordQueryValue"></param> /// <param name="pflag"></param> /// <returns></returns> public List <MyCapFaceLogWithImg> QueryCapLogSXC(CaptureRecordQueryValue captureRecordQueryValue, List <string> channelList) { List <CapFaceLog> listCapFaceLog = new List <CapFaceLog>(); List <MyCapFaceLogWithImg> listMyCapFaceLogWithImg = new List <MyCapFaceLogWithImg>(); //声明客户端内容 TTransport transport = new TSocket(GlobalCache.Host, GlobalCache.Port); TProtocol protocol = new TBinaryProtocol(transport); BusinessServer.Client _BusinessServerClient = new BusinessServer.Client(protocol); try { //获得查询数据 if (!transport.IsOpen) { transport.Open(); } listCapFaceLog = _BusinessServerClient.QueryCapLogSXC(channelList, captureRecordQueryValue.StartDayValue, captureRecordQueryValue.EndDayValue, captureRecordQueryValue.StartRowValue, captureRecordQueryValue.PageRowValue); for (int i = listCapFaceLog.Count - 1; i >= 0; i--) { MyCapFaceLogWithImg _MyCapFaceLogWithImg = new MyCapFaceLogWithImg(); _MyCapFaceLogWithImg.Id = captureRecordQueryValue.MaxCount - captureRecordQueryValue.StartRowValue - i; _MyCapFaceLogWithImg.ID = listCapFaceLog[i].ID; // 获得抓拍id _MyCapFaceLogWithImg.ChannelID = listCapFaceLog[i].ChannelID; // 获得通道id //获得通道名称 foreach (MyChannelCfg mcc in QueryAllChannel()) { if (listCapFaceLog[i].ChannelID == mcc.TcChaneelID) { _MyCapFaceLogWithImg.ChannelName = mcc.Name; } } long longTime = listCapFaceLog[i].Time; DateTime time = new DateTime(1970, 1, 1); time = time.AddSeconds(longTime); _MyCapFaceLogWithImg.time = time.ToString("yyyy/MM/dd HH:mm:ss");; // 获得抓拍时间 listMyCapFaceLogWithImg.Add(_MyCapFaceLogWithImg); } transport.Close(); } catch (Exception ex) { if (transport.IsOpen) { transport.Close(); } //MB_MODULES.Views.MyMessage.showYes("网络异常,稍后重试"); MB_MODULES.Views.MyMessage.showYes("网络异常,稍后重试"); return(null); } return(listMyCapFaceLogWithImg); }
public int UpdateRealtimeCapLBS(RealtimeCapInfoLBS info) { try { if (GlobalCache.AppType == 1) { if (!info.Channelname.Contains(GlobalCache.AppLocation)) { return(-1); } } //接收服务器附送过来的实时照片 if (snapPersonObj != null) { snapPersonObj = null; } snapPersonObj = new MyCapFaceLogWithImg(); snapPersonObj.ID = info.Id;// 抓拍id //string strChannelId = info.Channel.Substring(0, 6) + "\r\n"; //strChannelId += info.Channel.Substring(0, 6); snapPersonObj.ChannelID = info.Channel;// 通道id snapPersonObj.ChannelName = info.Channelname; snapPersonObj.Longitude = info.Longitude; snapPersonObj.Latitude = info.Latitude; snapPersonObj.Score = info.Score; snapPersonObj.Address = info.Address; DateTime s = new DateTime(1970, 1, 1); s = s.AddSeconds(info.Time); snapPersonObj.time = s.ToString("yyyy/MM/dd HH:mm:ss"); //ChannelManage.CapimageByteRealtimeCapInfo = info.Image; //ChannelManage._MyCapFaceLogWithImg = snapPersonImage; //ChannelManage.ResetServerRealtimeCapInfo.Set(); GlobalCache.SnapStream = info.Image; //snapFaceImgField = snapPersonObj; GlobalCache.MySnapFaceLogWithImgObj = snapPersonObj; resetSnapInfoField.Set(); return(0); } catch (Exception ex) { Logger <UIServerInterForWifi> .Log.Error("UpdateRealtimeCapLBS", ex); return(-1); } }
/// <summary> /// 双击添加模版 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void listViewCaptureRecord_MouseDoubleClick(object sender, MouseButtonEventArgs e) { if (Login.ClientType == "1") { return; } MyCapFaceLogWithImg cmpFaceLogWidthImg = listViewCaptureRecord.SelectedItem as MyCapFaceLogWithImg; if (cmpFaceLogWidthImg == null) { return; } List <byte[]> listImageBytes = new List <byte[]>(); listImageBytes = thirft.QueryCapLogImageH(cmpFaceLogWidthImg.ID, currDay); TempleteInfoPop tIP = new TempleteInfoPop(); tIP.SetTempleteInfo(null, 3, listImageBytes[0]); tIP.ShowDialog(); }
public int UpdateRealtimeCap(RealtimeCapInfo info, string channelName) { try { if (GlobalCache.AppType == 1) { if (!channelName.Contains(GlobalCache.AppLocation)) { return(-1); } } //接收服务器附送过来的实时照片 if (snapPersonObj != null) { snapPersonObj = null; } snapPersonObj = new MyCapFaceLogWithImg(); snapPersonObj.ID = info.Id; // 抓拍id snapPersonObj.ChannelID = info.Channel; // 通道id snapPersonObj.ChannelName = channelName; long _longtime = info.Time; DateTime s = new DateTime(1970, 1, 1); s = s.AddSeconds(_longtime); snapPersonObj.time = s.ToString("yyyy/MM/dd HH:mm:ss"); //ChannelManage.CapimageByteRealtimeCapInfo = info.Image; //ChannelManage._MyCapFaceLogWithImg = snapPersonImage; //ChannelManage.ResetServerRealtimeCapInfo.Set(); info = null; return(0); } catch (Exception ex) { Logger <UIServerInterForWifi> .Log.Error("", ex); return(-1); } }