private void btnReplay_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(this.cbbCarNumber.Text)) { MessageBox.Show("未指定车辆,无法进行轨迹回放!"); return; } if (dtpEndTime.Value == dtpStartTime.Value) { MessageBox.Show("请设置正确的时间段。"); return; } this._replayOperation.ClearTrackings(false); //计算插值 TrackInterpolate oTrackInter = new TrackInterpolate(); this._inputData = TrackingReplay.TrackingData.GetHistoryTrackingData(this.cbbCarNumber.Text, dtpStartTime.Value, dtpEndTime.Value); if (this._inputData == null || this._inputData.Count == 0) { MessageBox.Show("在指定的时间段内该车辆没有出行记录。"); return; } this._outputData = oTrackInter.InterpolateProcess(this._inputData, this.trbSmoothScale.Value); if (this._outputData == null || this._outputData.Count == 0) { // MessageBox.Show("插值分析失败!"); return; } //显示轨迹线 this._replayOperation.AddTrackingPath(this._inputData); //开始回放 this._curIndex = 0; this._trackReplayTimer.Interval = 1000 / this.trbReplaySpeed.Value; this._trackReplayTimer.Start(); this.btnReplay.Enabled = false; this.btnStop.Enabled = true; }
private void btnReplay_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(this.cbbCarNumber.Text)) { MessageBox.Show("δָ�������������й켣�طţ�"); return; } if (dtpEndTime.Value == dtpStartTime.Value) { MessageBox.Show("��������ȷ��ʱ��Ρ�"); return; } this._replayOperation.ClearTrackings(false); //�����ֵ TrackInterpolate oTrackInter = new TrackInterpolate(); this._inputData = TrackingReplay.TrackingData.GetHistoryTrackingData(this.cbbCarNumber.Text,dtpStartTime.Value,dtpEndTime.Value); if (this._inputData == null || this._inputData.Count == 0) { MessageBox.Show("��ָ����ʱ����ڸó���û�г��м�¼��"); return; } this._outputData = oTrackInter.InterpolateProcess(this._inputData, this.trbSmoothScale.Value); if (this._outputData == null || this._outputData.Count == 0) { // MessageBox.Show("��ֵ����ʧ�ܣ�"); return; } //��ʾ�켣�� this._replayOperation.AddTrackingPath(this._inputData); //��ʼ�ط� this._curIndex = 0; this._trackReplayTimer.Interval = 1000 / this.trbReplaySpeed.Value; this._trackReplayTimer.Start(); this.btnReplay.Enabled = false; this.btnStop.Enabled = true; }
/// <summary> /// ��ȡ������ /// </summary> /// <param name="inputPoints">����켣�㼯��</param> /// <param name="baseIntervalTime">����ֵ�켣��֮���ʱ����</param> /// <returns>��ֵ��Ĺ켣�㼯��</returns> public TrackPoints GetResultByInterpolateTime(TrackPoints inputPoints, double baseIntervalTime) { TrackPoints oResultPoint = null; try { TrackInterpolate oTrackInter = new TrackInterpolate(); oTrackInter.BaseIntervalTime = baseIntervalTime; oResultPoint = oTrackInter.InterpolateProcess(inputPoints,); } catch (Exception ex) { throw new Exception(ex.StackTrace); } return oResultPoint; }