Skip to content

Commit

Permalink
Using framestep interface if available for forward stepping.
Browse files Browse the repository at this point in the history
Switch to chart after manual data acquisition.
  • Loading branch information
avosskuehler committed Dec 27, 2015
1 parent 02fc293 commit cd33d80
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions VianaNET/MainWindow/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -971,8 +971,8 @@ private void ManualDataAquisitionButtonClick(object sender, RoutedEventArgs e)

this.Refresh();

// Switch to datagrid window
this.VideoTab.IsSelected = true;
// Switch to chart window
this.ChartTab.IsSelected = true;
}

/// <summary>
Expand Down
3 changes: 2 additions & 1 deletion VianaNET/Modules/Video/Control/VideoPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ public void StepOneFrame(bool forward)
{
if (forward)
{
if (Video.Instance.IsDataAcquisitionRunning)
if (Video.Instance.IsDataAcquisitionRunning || this.frameStep != null)
{
this.StepFrames(1);
}
Expand Down Expand Up @@ -737,6 +737,7 @@ private void EventWait()
}
else if (ec == EventCode.StepComplete)
{
Console.WriteLine("StepComplete");
// Throw event
if (this.StepComplete != null)
{
Expand Down
4 changes: 3 additions & 1 deletion VianaNET/Modules/Video/VideoWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -898,6 +898,7 @@ private void VideoPlayerElementStepComplete(object sender, EventArgs e)
Viana.Project.ProcessingData.ProcessImage();
});


// Run next sample
this.Dispatcher.Invoke(
(ThreadStart)delegate
Expand Down Expand Up @@ -1141,7 +1142,7 @@ private void TimesliderUpdateTimerTick(object sender, EventArgs e)

// double alignedTime = (int)(preciseTime / Video.Instance.VideoPlayerElement.FrameTimeIn100NanoSeconds) *
// Video.Instance.VideoPlayerElement.FrameTimeIn100NanoSeconds;
this.TimelineSlider.Value = preciseTime * VideoBase.NanoSecsToMilliSecs;
this.TimelineSlider.Value = Math.Round(preciseTime * VideoBase.NanoSecsToMilliSecs);
}
}

Expand All @@ -1153,6 +1154,7 @@ private void StepBackward()
if (this.TimelineSlider.Value >= this.TimelineSlider.SelectionStart + this.TimelineSlider.TickFrequency)
{
Video.Instance.StepOneFrame(false);

}
}

Expand Down

0 comments on commit cd33d80

Please sign in to comment.