private void P2PStart() { _isP2P = true; _viconPositionGet.Start(); _p2pTimer.IsEnabled = true; _p2pTimer.Start(); }
/// <summary> /// 开始记录视频 /// 按钮点击事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /// <returns></returns> private void btnStartRecording_Click(object sender, EventArgs e) { string path = string.Format("flight_{0:yyyy_MM_dd_HH_mm}" + ARDroneTrackFileExt, DateTime.Now); using (var dialog = new SaveFileDialog { DefaultExt = ARDroneTrackFileExt, Filter = ARDroneTrackFilesFilter, FileName = path }) { if (dialog.ShowDialog(this) == DialogResult.OK) { StopRecording(); _recorderStream = new FileStream(dialog.FileName, FileMode.OpenOrCreate); _packetRecorderWorker = new PacketRecorder(_recorderStream); _packetRecorderWorker.Start(); _viconPositionGet.Start(); //_pwrite.Start(); //string file = string.Format(@"vicon_{0:yyyy_MM_dd_HH_mm}.txt", DateTime.Now); //string dir = Path.GetDirectoryName(dialog.FileName); //_viconFileStream = new FileStream(dir + @"/" + file, FileMode.OpenOrCreate); //_viconWriteStream = new StreamWriter(_viconFileStream); //_viconPositionGet.Start(); } } }