Reimplemented the ability to chain multiple log files and run them in sequences.

This commit is contained in:
Collin Kidder
2017-11-08 21:09:20 -05:00
parent 3bf19fdbc4
commit ed2cd7bd8c
3 changed files with 49 additions and 60 deletions
+1 -58
View File
@@ -38,26 +38,6 @@ quint64 FramePlaybackObject::updatePosition(bool forward)
playbackActive = false;
playbackTimer->stop();
emit EndOfFrameCache();
/*
currentSeqNum++; //go forward in the sequence
if (currentSeqNum == seqItems.count()) //are we at the end of the sequence?
{
//reset the loop figures for each sequence entry
for (int i = 0; i < seqItems.count(); i++) seqItems[i].currentLoopCount = 0;
currentSeqNum = 0;
if (ui->cbLoop->isChecked()) //go back to beginning if we're looping the sequence
{
}
else //not looping so stop playback entirely
{
playbackActive = false;
playbackTimer->stop();
}
}
currentSeqItem = &seqItems[currentSeqNum];
ui->tblSequence->setCurrentCell(currentSeqNum, 0);
*/
}
}
}
@@ -74,31 +54,10 @@ quint64 FramePlaybackObject::updatePosition(bool forward)
playbackActive = false;
playbackTimer->stop();
emit EndOfFrameCache();
/*
currentSeqNum--; //go backward in the sequence
if (currentSeqNum == -1) //are we trying to go past the beginning?
{
//reset the loop figures for each sequence entry
for (int i = 0; i < seqItems.count(); i++) seqItems[i].currentLoopCount = 0;
currentSeqNum = seqItems.count() - 1;
if (ui->cbLoop->isChecked()) //go back to the last sequence entry if we're looping
{
}
else //not looping so stop playback entirely
{
playbackActive = false;
playbackTimer->stop();
}
}
currentSeqItem = &seqItems[currentSeqNum];
ui->tblSequence->setCurrentCell(currentSeqNum, 0);
*/
}
}
}
//updateFrameLabel();
//only send frame out if its ID is checked in the list. Otherwise discard it.
CANFrame *thisFrame = &currentSeqItem->data[currentPosition];
uint32_t originalBus = thisFrame->bus;
@@ -303,22 +262,6 @@ void FramePlaybackObject::stopPlayback()
playbackTimer->stop(); //pushing this button halts automatic playback
playbackActive = false;
currentPosition = 0;
/*
if (seqItems.count() > 0)
{
currentSeqNum = 0;
currentSeqItem = &seqItems[currentSeqNum];
}
else {
currentSeqNum = -1;
currentSeqItem = NULL;
}
if (ui->tblSequence->rowCount() > 0)
{
ui->tblSequence->setCurrentCell(0, 0);
refreshIDList();
}
updateFrameLabel(); */
}
void FramePlaybackObject::pausePlayback()
+47 -2
View File
@@ -43,6 +43,7 @@ FramePlaybackWindow::FramePlaybackWindow(const QVector<CANFrame> *frames, QWidge
currentSeqNum = -1;
currentPosition = 0;
forward = true;
isPlaying = false;
updateFrameLabel();
@@ -271,11 +272,49 @@ void FramePlaybackWindow::EndOfFrameCache()
{
if (forward)
{
currentSeqNum++; //go forward in the sequence
if (currentSeqNum == seqItems.count()) //are we at the end of the sequence?
{
//reset the loop figures for each sequence entry
for (int i = 0; i < seqItems.count(); i++) seqItems[i].currentLoopCount = 0;
currentSeqNum = 0;
if (ui->cbLoop->isChecked()) //go back to beginning if we're looping the sequence
{
}
else //not looping so stop playback entirely
{
isPlaying = false;
playbackObject.stopPlayback();
}
}
currentSeqItem = &seqItems[currentSeqNum];
playbackObject.setSequenceObject(currentSeqItem);
if (isPlaying) playbackObject.startPlaybackForward();
ui->tblSequence->setCurrentCell(currentSeqNum, 0);
}
else
{
currentSeqNum--; //go backward in the sequence
if (currentSeqNum == -1) //are we trying to go past the beginning?
{
//reset the loop figures for each sequence entry
for (int i = 0; i < seqItems.count(); i++) seqItems[i].currentLoopCount = 0;
currentSeqNum = seqItems.count() - 1;
if (ui->cbLoop->isChecked()) //go back to the last sequence entry if we're looping
{
}
else //not looping so stop playback entirely
{
isPlaying = false;
playbackObject.stopPlayback();
}
}
currentSeqItem = &seqItems[currentSeqNum];
playbackObject.setSequenceObject(currentSeqItem);
if (isPlaying) playbackObject.startPlaybackBackward();
ui->tblSequence->setCurrentCell(currentSeqNum, 0);
}
}
@@ -445,22 +484,26 @@ void FramePlaybackWindow::btnLoadLive()
void FramePlaybackWindow::btnBackOneClick()
{
forward = false;
isPlaying = false;
playbackObject.stepPlaybackBackward();
}
void FramePlaybackWindow::btnPauseClick()
{
isPlaying = false;
playbackObject.pausePlayback();
}
void FramePlaybackWindow::btnReverseClick()
{
forward = false;
isPlaying = true;
playbackObject.startPlaybackBackward();
}
void FramePlaybackWindow::btnStopClick()
{
isPlaying = false;
playbackObject.stopPlayback();
if (seqItems.count() > 0)
{
@@ -475,19 +518,21 @@ void FramePlaybackWindow::btnStopClick()
{
ui->tblSequence->setCurrentCell(0, 0);
refreshIDList();
}
//updateFrameLabel();
}
updateFrameLabel();
}
void FramePlaybackWindow::btnPlayClick()
{
forward = true;
isPlaying = true;
playbackObject.startPlaybackForward();
}
void FramePlaybackWindow::btnFwdOneClick()
{
forward = true;
isPlaying = false;
playbackObject.stepPlaybackForward();
}
+1
View File
@@ -55,6 +55,7 @@ private:
int currentSeqNum;
FramePlaybackObject playbackObject;
bool forward;
bool isPlaying;
int currentPosition;
void refreshIDList();