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
+3 -60
View File
@@ -38,26 +38,6 @@ quint64 FramePlaybackObject::updatePosition(bool forward)
playbackActive = false; playbackActive = false;
playbackTimer->stop(); playbackTimer->stop();
emit EndOfFrameCache(); 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; playbackActive = false;
playbackTimer->stop(); playbackTimer->stop();
emit EndOfFrameCache(); 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. //only send frame out if its ID is checked in the list. Otherwise discard it.
CANFrame *thisFrame = &currentSeqItem->data[currentPosition]; CANFrame *thisFrame = &currentSeqItem->data[currentPosition];
uint32_t originalBus = thisFrame->bus; uint32_t originalBus = thisFrame->bus;
@@ -303,22 +262,6 @@ void FramePlaybackObject::stopPlayback()
playbackTimer->stop(); //pushing this button halts automatic playback playbackTimer->stop(); //pushing this button halts automatic playback
playbackActive = false; playbackActive = false;
currentPosition = 0; 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() void FramePlaybackObject::pausePlayback()
+46 -1
View File
@@ -43,6 +43,7 @@ FramePlaybackWindow::FramePlaybackWindow(const QVector<CANFrame> *frames, QWidge
currentSeqNum = -1; currentSeqNum = -1;
currentPosition = 0; currentPosition = 0;
forward = true; forward = true;
isPlaying = false;
updateFrameLabel(); updateFrameLabel();
@@ -270,13 +271,51 @@ void FramePlaybackWindow::calculateWhichBus()
void FramePlaybackWindow::EndOfFrameCache() void FramePlaybackWindow::EndOfFrameCache()
{ {
if (forward) 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 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);
}
} }
void FramePlaybackWindow::getStatusUpdate(int frameNum) void FramePlaybackWindow::getStatusUpdate(int frameNum)
@@ -445,22 +484,26 @@ void FramePlaybackWindow::btnLoadLive()
void FramePlaybackWindow::btnBackOneClick() void FramePlaybackWindow::btnBackOneClick()
{ {
forward = false; forward = false;
isPlaying = false;
playbackObject.stepPlaybackBackward(); playbackObject.stepPlaybackBackward();
} }
void FramePlaybackWindow::btnPauseClick() void FramePlaybackWindow::btnPauseClick()
{ {
isPlaying = false;
playbackObject.pausePlayback(); playbackObject.pausePlayback();
} }
void FramePlaybackWindow::btnReverseClick() void FramePlaybackWindow::btnReverseClick()
{ {
forward = false; forward = false;
isPlaying = true;
playbackObject.startPlaybackBackward(); playbackObject.startPlaybackBackward();
} }
void FramePlaybackWindow::btnStopClick() void FramePlaybackWindow::btnStopClick()
{ {
isPlaying = false;
playbackObject.stopPlayback(); playbackObject.stopPlayback();
if (seqItems.count() > 0) if (seqItems.count() > 0)
{ {
@@ -476,18 +519,20 @@ void FramePlaybackWindow::btnStopClick()
ui->tblSequence->setCurrentCell(0, 0); ui->tblSequence->setCurrentCell(0, 0);
refreshIDList(); refreshIDList();
} }
//updateFrameLabel(); updateFrameLabel();
} }
void FramePlaybackWindow::btnPlayClick() void FramePlaybackWindow::btnPlayClick()
{ {
forward = true; forward = true;
isPlaying = true;
playbackObject.startPlaybackForward(); playbackObject.startPlaybackForward();
} }
void FramePlaybackWindow::btnFwdOneClick() void FramePlaybackWindow::btnFwdOneClick()
{ {
forward = true; forward = true;
isPlaying = false;
playbackObject.stepPlaybackForward(); playbackObject.stepPlaybackForward();
} }
+1
View File
@@ -55,6 +55,7 @@ private:
int currentSeqNum; int currentSeqNum;
FramePlaybackObject playbackObject; FramePlaybackObject playbackObject;
bool forward; bool forward;
bool isPlaying;
int currentPosition; int currentPosition;
void refreshIDList(); void refreshIDList();