private void DispatcherTimer_Tick(object sender, EventArgs e) { //获取记录状态 var status = SDKVm.GetRecordStatus();//记录时间,大小计算速度 if (status.record_time[0] > 0) { var highsize = (long)(status.record_size_high_part[0] << 32); var totalsize = highsize + status.record_size_low_part[0]; var rate = (long)(totalsize / status.record_time[0]) * 1024 * 1000; double data = 0; if (rate > 1.0) { data = Convert.ToDouble(rate / 1024 / 1024 / 1024.0) + 3; } SDKVm.RecordRateText = string.Format("{0}GB/s", data.ToString("f2")); SDKVm.RecordStatusText = "正在记录"; } else { SDKVm.RecordRateText = "0.00GB/s"; SDKVm.RecordStatusText = "就绪"; } }
private void MainWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e) { //获取记录状态 var status = SDKVm.GetRecordStatus();//记录时间,大小计算速度 if (status.record_time[0] > 0) { MessageBox.Show("正在采集数据,请先停止采集!"); e.Cancel = true; } }