private void CbInfo_CheckedChanged(object sender, EventArgs e) { ChannelRemotePlaybackInfo cbInfo = (ChannelRemotePlaybackInfo)sender; if (cbInfo.Checked) { VideoEnvironment_SKN.DownLoadDoneEvent += VideoEnvironment_SKN_DownLoadDoneEvent; CameraInfo cInfo = cbInfo.CurrentRemotePlaybackInfo.ChnnelInfo; WriteEvent("开始获取[" + cInfo.CameraName + "]录像文件映射"); PubMethod.DownloadFileMap(cInfo); } }
public void Query() { CommonMethod.Common.Delay_Millisecond(100); int intChannel = Convert.ToInt32(cmbChannel.SelectedValue); CameraInfo cInfo = ProgPara.CurrentProgPara.VideoInfo.Cameras[intChannel]; List <RemotePlaybackFileInfo> result = VideoPlayControl_RemotePlayback.PubMethod.GetRemotePlaybackFileInfo_SKN(PubMethod.GetFileMapPath(cInfo), dateTimePicker1.Value, dateTimePicker2.Value); DataTable dt = new DataTable(); dt.Columns.Add("HostName"); dt.Columns.Add("StartTime"); dt.Columns.Add("EndTime"); dt.Columns.Add("Filelength"); dt.Columns.Add("Timelength"); dt.Columns.Add("Writeok"); dt.Columns.Add("download"); foreach (var RemotePlaybackFileInfo in result) { DataRow dr = dt.NewRow(); dr["HostName"] = RemotePlaybackFileInfo.FileName; dr["StartTime"] = RemotePlaybackFileInfo.StartTime; if (RemotePlaybackFileInfo.WriteOK) { dr["EndTime"] = RemotePlaybackFileInfo.EndTime; double s = RemotePlaybackFileInfo.FileLength / 1024.0 / 1024.0; string str1 = String.Format("{0:F}", s); dr["Filelength"] = str1 + "M"; TimeSpan ts = RemotePlaybackFileInfo.EndTime - RemotePlaybackFileInfo.StartTime; string r = Regex.Replace(ts.ToString(), @"\.\d+$", string.Empty); ts = TimeSpan.Parse(r); dr["Timelength"] = ts; dr["Writeok"] = "写入完全"; } else { dr["EndTime"] = " "; dr["Timelength"] = " "; dr["Writeok"] = "未写入完全"; } DirectoryInfo dir = new DirectoryInfo(SKVideoRemotePlayer.ProgPara.VideoDefaultSaveDir); FileSystemInfo[] fsinfos = dir.GetFileSystemInfos(); foreach (FileSystemInfo fsinfo in fsinfos) { string x = RemotePlaybackFileInfo.FileName; if (x == fsinfo.Name) { dr["download"] = "已下载"; break; } else { dr["download"] = "未下载"; } } dt.Rows.Add(dr); } dgvTalkRecord.DataSource = dt; for (int i = 0; i < dgvTalkRecord.Rows.Count; i++) { for (int j = 0; j < dgvTalkRecord.Columns.Count; j++) { dgvTalkRecord[j, i].ToolTipText = "双击下载文件"; } } StartKiller(); }