public void vsListView_Update(object sender, VsMotionEventArgs e) { VsMotion vsMotion = (VsMotion)e.Motion.Clone(); String [] strItem = {vsMotion.DateStart.ToString(), vsMotion.CameraName, vsMotion.EventName}; ListViewItem item = new ListViewItem(strItem); this.listView1.Items.Add(item); item.Selected = true; item.EnsureVisible(); }
// On new frame ready //[MethodImpl(MethodImplOptions.Synchronized)] public void FrameIn(object sender, VsMotionEventArgs e) { try { /* if (eventBuffer.Count > 1000 / syncTimer) { VsMotion rm = (VsMotion)eventBuffer.Dequeue(); rm.Dispose(); rm = null; logger.Log(LogLevel.Warn, DateTime.Now.ToString() + "; frame removed from EventAlert"); }*/ VsMotion img = (VsMotion)e.Motion.Clone(); eventBuffer.Enqueue(img); } catch (Exception err) { logger.Log(LogLevel.Error, err.Message + " " + err.Source + " " + err.StackTrace); } }
// New frame public void FrameIn(object sender, VsMotionEventArgs e) { this.listView1.Invoke(new VsMotionEventHandler(vsListView_Update), sender, e); }