public void Search() { var selectedCamera = this._screen.SelectedCamera; if (selectedCamera == null) { return; } _selectedCamera = this._screen.SelectedCamera; _range = this._screen.TimeRange; _scope = this._screen.SearchScope; _currentRange = new DateTimeRange(_range.From, _range.From.AddHours(1)); var videos = FindFirstVideo(); if (videos.Count == 0) { MessageBox.Show("在该时间段内,没有录制视频"); return; } _range.From = videos.First().CapturedAt; _range.To = videos.Last().CapturedAt; UpdateCurrentRange(videos); SearchAsync(); }
public static Damany.Imaging.Common.IFrameStream NewFrameStream(Damany.PC.Domain.CameraInfo cameraInfo) { IFrameStream source = null; switch (cameraInfo.Provider) { #if DEBUG case Damany.PC.Domain.CameraProvider.LocalDirectory: break; #endif case Damany.PC.Domain.CameraProvider.Sanyo: var sanyo = new SanyoNetCamera(); sanyo.Uri = cameraInfo.Location; sanyo.UserName = cameraInfo.LoginUserName ?? "guest"; sanyo.PassWord = cameraInfo.LoginPassword ?? "guest"; source = sanyo; break; #if DEBUG case Damany.PC.Domain.CameraProvider.AipStar: var aip = new Damany.Cameras.Wrappers.AipStarCamera(cameraInfo.Location.Host, cameraInfo.Location.Port, "", ""); aip.UserName = cameraInfo.LoginUserName ?? "system"; aip.PassWord = cameraInfo.LoginPassword ?? "system"; source = aip; break; #endif default: throw new NotSupportedException("camera type not supported"); break; } source.Id = cameraInfo.Id; return(source); }